useblocks 1.1.85-dev.10 → 1.1.85-dev.11
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 +70 -40
- package/compat-globals.js +1 -1
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/discussHandlers.sDXLf5I7.js +88 -0
- package/iframe/js/{iframe-eblock.body.js → iframe-eblock.body.714faf8a.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/{iframe.body.js → iframe.body.714faf8a.js} +35 -35
- package/iframe/js/iframe.js +2 -2
- package/package.json +4 -1
- package/runtime/THIRD_PARTY_LICENSES.txt +49 -42
- package/runtime/package.json +4 -1
- package/runtime/react/index.js +1 -1
- package/runtime/uuid/index.js +21 -0
- package/static/core/11bc33e0.js +1 -0
- package/static/core/1ed86ed3.js +1 -0
- package/static/core/248de796.js +1 -0
- package/static/core/{e50b6f57.js → 274b5d7a.js} +1 -1
- package/static/core/4067c5be.js +1 -0
- package/static/core/453596ac.js +27 -0
- package/static/core/4b12ae50.js +1 -0
- package/static/core/{db82c42b.js → 50d547f6.js} +1 -1
- package/static/core/549c0ef1.js +1 -0
- package/static/core/{b29146b3.js → 563a690f.js} +5 -5
- package/static/core/{c1bf6439.js → 5c62f38b.js} +1 -1
- package/static/core/5f949f39.js +1 -0
- package/static/core/{e0d71533.js → 60aa31a3.js} +6 -6
- package/static/core/{79749848.js → 66619f08.js} +7 -7
- package/static/core/7052d050.js +28 -0
- package/static/core/{984e936f.js → 7555e955.js} +1 -1
- package/static/core/{55a38638.js → 7c89682e.js} +7 -7
- package/static/core/83c17079.js +2 -0
- package/static/core/{4c83d06a.js → 8c5284f6.js} +1 -1
- package/static/core/{e0e5c9b9.js → 958fe93e.js} +2 -2
- package/static/core/{6fcb3c31.js → a3f7b4c9.js} +1 -1
- package/static/core/{9560f31a.js → a494cc9f.js} +1 -1
- package/static/core/{a5996860.js → a6303cb2.js} +1 -1
- package/static/core/b8a0f663.js +1 -0
- package/static/core/bb65f553.js +1 -0
- package/static/core/{4c3f5897.js → c2f990cf.js} +2 -2
- package/static/core/{72d350ea.js → c8d6258e.js} +1 -1
- package/static/core/{3ece766f.js → d58ae4ac.js} +2 -2
- package/static/core/d61988e0.js +7 -0
- package/static/core/d887672a.js +1 -0
- package/static/core/dcc37768.js +1 -0
- package/static/core/{30841c46.js → e50f64f6.js} +1 -1
- package/static/core/{175b5b0f.js → ff7d14e8.js} +1 -1
- package/static/esm/2490dab8.js +1 -0
- package/static/esm/971f1b2c.js +1 -0
- package/static/esm/ad8c16a9.js +1 -0
- package/static/esm/f76c9d9d.js +1 -0
- package/static/umd/6639d610.js +1 -0
- package/static/umd-runtime/B7h7P1Np.js +1 -0
- package/static/umd-runtime/{DHIkHsbq.js → BAqQTgiL.js} +1 -1
- package/static/umd-runtime/{DiNHpyis.js → BB6AXfHj.js} +1 -1
- package/static/umd-runtime/{CnUGCoaH.js → BauvM4c_.js} +1 -1
- package/static/umd-runtime/{cL_ha9ef.js → CgVJ4rE0.js} +1 -1
- package/static/umd-runtime/Cvm7BS4_.js +341 -0
- package/static/umd-runtime/{BnE05QKl.js → D7DggGzi.js} +1 -1
- package/static/umd-runtime/{2iAslXEF.js → DBbch1O-.js} +1 -1
- package/static/umd-runtime/{Bcqtk2f7.js → Dqoi-pC_.js} +2 -2
- package/static/umd-runtime/{CDTBLHGd.js → G2k8ELiO.js} +3 -3
- package/static/umd-runtime/{CVtPwspX.js → SFp4nbvq.js} +1 -1
- package/static/umd-runtime/{DVB_-O4B.js → UsRzAWs2.js} +1 -1
- package/static/umd-runtime/runtime.js +1 -1
- package/static/umd-runtime/ui-kit-icons.js +1 -1
- package/static/umd-runtime/ui-kit.js +2 -2
- package/static/umd-runtime/{DP3QTW77.js → uk9LyZos.js} +1 -1
- package/useblocks-core.714faf8a.js +859 -0
- package/useblocks-esm.js +11 -11
- package/{useblocks-po.8098d114.js → useblocks-po.714faf8a.js} +1 -1
- package/useblocks.d.ts +109 -25
- package/useblocks.js +39 -15
- package/vendor/@rc-component/cascader/package.json +1 -1
- package/vendor/@rc-component/dialog/es/Dialog/Content/Panel.js +3 -2
- package/vendor/@rc-component/dialog/package.json +1 -1
- package/vendor/@rc-component/image/es/Preview/index.js +3 -3
- package/vendor/@rc-component/image/package.json +1 -1
- package/vendor/@rc-component/input/es/BaseInput.js +3 -3
- package/vendor/@rc-component/input/es/Input.js +20 -27
- package/vendor/@rc-component/{textarea → input}/es/ResizableTextArea.js +5 -4
- package/vendor/@rc-component/{textarea → input}/es/TextArea.js +30 -40
- package/vendor/@rc-component/{textarea → input}/es/calculateNodeHeight.js +4 -4
- package/vendor/@rc-component/input/es/hooks/useCountDisplay.js +25 -0
- package/vendor/@rc-component/input/es/hooks/useCountExceed.js +25 -0
- package/vendor/@rc-component/input/es/hooks/useMergedValue.js +13 -0
- package/vendor/@rc-component/input/es/index.js +3 -1
- package/vendor/@rc-component/input/package.json +1 -1
- package/vendor/@rc-component/mentions/es/DropdownMenu.js +1 -1
- package/vendor/@rc-component/mentions/es/Mentions.js +35 -8
- package/vendor/@rc-component/mentions/package.json +1 -1
- package/vendor/@rc-component/menu/es/Menu.js +1 -0
- package/vendor/@rc-component/menu/es/MenuItem.js +1 -0
- package/vendor/@rc-component/menu/es/MenuItemGroup.js +1 -0
- package/vendor/@rc-component/menu/es/SubMenu/PopupTrigger.js +1 -0
- package/vendor/@rc-component/menu/es/SubMenu/index.js +1 -0
- package/vendor/@rc-component/menu/es/context/MenuContext.js +1 -0
- package/vendor/@rc-component/menu/es/hooks/useAccessibility.js +1 -0
- package/vendor/@rc-component/menu/es/hooks/useKeyRecords.js +1 -0
- package/vendor/@rc-component/menu/es/utils/commonUtil.js +1 -0
- package/vendor/@rc-component/menu/es/utils/nodeUtil.js +2 -1
- package/vendor/@rc-component/menu/es/utils/warnUtil.js +1 -0
- package/vendor/@rc-component/menu/package.json +1 -1
- package/vendor/@rc-component/notification/LICENSE +21 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/LICENSE +22 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Children/toArray.js +15 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/canUseDom.js +6 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/contains.js +13 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/dynamicCSS.js +94 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/findDOMNode.js +14 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/focus.js +99 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/isVisible.js +18 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/shadow.js +12 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/styleChecker.js +2 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/KeyCode.js +499 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Portal.js +28 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/React/isFragment.js +12 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/React/render.js +2 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/getScrollBarSize.js +2 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useControlledState.js +3 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useDelayState.js +4 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useEvent.js +9 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useId.js +23 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useLayoutEffect.js +26 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useMemo.js +12 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useMergedState.js +4 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useState.js +24 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useSyncState.js +20 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/index.js +36 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/is.js +21 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/isEqual.js +35 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/isMobile.js +11 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/mergeProps.js +14 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/omit.js +1 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/pickAttrs.js +50 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/proxyObject.js +1 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/raf.js +36 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/ref.js +38 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/test/domHook.js +36 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/utils/get.js +11 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/utils/set.js +58 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/warning.js +46 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/package.json +6 -0
- package/vendor/@rc-component/notification/es/Notification.js +129 -0
- package/vendor/@rc-component/notification/es/NotificationList/Content.js +33 -0
- package/vendor/@rc-component/notification/es/NotificationList/index.js +174 -0
- package/vendor/@rc-component/notification/es/NotificationProvider.js +4 -3
- package/vendor/@rc-component/notification/es/Notifications.js +28 -31
- package/vendor/@rc-component/notification/es/Progress.js +10 -0
- package/vendor/@rc-component/notification/es/hooks/useClosable.js +30 -0
- package/vendor/@rc-component/notification/es/hooks/useListPosition/index.js +50 -0
- package/vendor/@rc-component/notification/es/hooks/useListPosition/useSizes.js +33 -0
- package/vendor/@rc-component/notification/es/hooks/useNoticeTimer.js +58 -0
- package/vendor/@rc-component/notification/es/hooks/useNotification.js +27 -18
- package/vendor/@rc-component/notification/es/hooks/useStack.js +4 -4
- package/vendor/@rc-component/notification/es/index.js +4 -2
- package/vendor/@rc-component/notification/package.json +1 -1
- package/vendor/@rc-component/picker/es/PickerInput/Selector/SingleSelector/MultipleDates.js +13 -3
- package/vendor/@rc-component/picker/es/PickerInput/Selector/SingleSelector/index.js +3 -1
- package/vendor/@rc-component/picker/es/PickerInput/SinglePicker.js +2 -1
- package/vendor/@rc-component/picker/package.json +1 -1
- package/vendor/@rc-component/table/LICENSE +21 -0
- package/vendor/@rc-component/table/es/Body/MeasureCell.js +1 -0
- package/vendor/@rc-component/table/es/Body/MeasureRow.js +1 -0
- package/vendor/@rc-component/table/es/Cell/useCellRender.js +1 -0
- package/vendor/@rc-component/table/es/FixedHolder/index.js +1 -0
- package/vendor/@rc-component/table/es/Table.js +17 -9
- package/vendor/@rc-component/table/es/VirtualTable/BodyGrid.js +10 -4
- package/vendor/@rc-component/table/es/VirtualTable/BodyLine.js +13 -5
- package/vendor/@rc-component/table/es/hooks/useColumns/index.js +1 -0
- package/vendor/@rc-component/table/es/hooks/useExpand.js +1 -0
- package/vendor/@rc-component/table/es/hooks/useFixedInfo.js +1 -0
- package/vendor/@rc-component/table/es/hooks/useSticky.js +1 -0
- package/vendor/@rc-component/table/es/index.js +2 -1
- package/vendor/@rc-component/table/es/stickyScrollBar.js +1 -0
- package/vendor/@rc-component/table/es/utils/legacyUtil.js +1 -0
- package/vendor/@rc-component/table/es/utils/offsetUtil.js +1 -0
- package/vendor/@rc-component/table/package.json +1 -1
- package/vendor/@rc-component/tabs/es/TabNavList/OperationNode.js +4 -2
- package/vendor/@rc-component/tabs/es/TabNavList/TabNode.js +5 -4
- package/vendor/@rc-component/tabs/es/TabNavList/index.js +11 -4
- package/vendor/@rc-component/tabs/es/Tabs.js +1 -0
- package/vendor/@rc-component/tabs/es/hooks/useAnimateConfig.js +1 -0
- package/vendor/@rc-component/tabs/es/hooks/useIndicator.js +1 -0
- package/vendor/@rc-component/tabs/es/hooks/useUpdate.js +1 -0
- package/vendor/@rc-component/tabs/package.json +1 -1
- package/vendor/@rc-component/tour/es/TourStep/DefaultPanel.js +4 -1
- package/vendor/@rc-component/tour/package.json +1 -1
- package/vendor/@rc-component/tree/es/MotionTreeNode.js +1 -0
- package/vendor/@rc-component/tree/es/NodeList.js +2 -2
- package/vendor/@rc-component/tree/es/Tree.js +4 -5
- package/vendor/@rc-component/tree/es/TreeNode.js +7 -2
- package/vendor/@rc-component/tree/es/index.js +3 -0
- package/vendor/@rc-component/tree/es/useUnmount.js +1 -0
- package/vendor/@rc-component/tree/es/util.js +1 -0
- package/vendor/@rc-component/tree/es/utils/conductUtil.js +1 -0
- package/vendor/@rc-component/tree/es/utils/treeUtil.js +1 -0
- package/vendor/@rc-component/tree/package.json +1 -1
- package/vendor/@rc-component/tree-select/package.json +1 -1
- package/vendor/@rc-component/util/es/index.js +10 -10
- package/vendor/antd/es/_util/ActionButton.js +2 -3
- package/vendor/antd/es/_util/ContextIsolator.js +1 -1
- package/vendor/antd/es/_util/PurePanel.js +7 -4
- package/vendor/antd/es/_util/convertToTooltipProps.js +2 -2
- package/vendor/antd/es/_util/fallbackProp.js +15 -0
- package/vendor/antd/es/_util/gapSize.js +2 -1
- package/vendor/antd/es/_util/getRenderPropValue.js +2 -1
- package/vendor/antd/es/_util/getScroll.js +4 -4
- package/vendor/antd/es/_util/hooks/index.js +2 -2
- package/vendor/antd/es/_util/hooks/useAllowClear.js +25 -0
- package/vendor/antd/es/_util/hooks/useClosable.js +6 -5
- package/vendor/antd/es/_util/hooks/{useMergeSemantic.js → useMergeSemantic/index.js} +14 -24
- package/vendor/antd/es/_util/hooks/useMergeSemantic/utils.js +14 -0
- package/vendor/antd/es/_util/hooks/useMergedMask.js +2 -1
- package/vendor/antd/es/_util/is.js +27 -0
- package/vendor/antd/es/_util/motion.js +8 -8
- package/vendor/antd/es/_util/normalizeIcon.js +9 -0
- package/vendor/antd/es/_util/placements.js +2 -1
- package/vendor/antd/es/_util/reactNode.js +2 -1
- package/vendor/antd/es/_util/responsiveObserver.js +3 -2
- package/vendor/antd/es/_util/scrollTo.js +3 -1
- package/vendor/antd/es/_util/styleChecker.js +1 -0
- package/vendor/antd/es/_util/throttleByAnimationFrame.js +1 -0
- package/vendor/antd/es/_util/toList.js +1 -1
- package/vendor/antd/es/_util/wave/WaveEffect.js +3 -1
- package/vendor/antd/es/_util/wave/index.js +14 -4
- package/vendor/antd/es/_util/wave/util.js +5 -3
- package/vendor/antd/es/alert/Alert.js +12 -10
- package/vendor/antd/es/alert/ErrorBoundary.js +1 -1
- package/vendor/antd/es/alert/style/index.js +16 -10
- package/vendor/antd/es/anchor/Anchor.js +23 -16
- package/vendor/antd/es/anchor/AnchorLink.js +4 -4
- package/vendor/antd/es/app/App.js +7 -3
- package/vendor/antd/es/auto-complete/AutoComplete.js +7 -8
- package/vendor/antd/es/avatar/Avatar.js +5 -3
- package/vendor/antd/es/back-top/index.js +1 -0
- package/vendor/antd/es/badge/Badge.js +5 -6
- package/vendor/antd/es/badge/Ribbon.js +1 -2
- package/vendor/antd/es/badge/style/index.js +4 -3
- package/vendor/antd/es/border-beam/BorderBeam.js +42 -0
- package/vendor/antd/es/border-beam/BorderBeamEffect.js +24 -0
- package/vendor/antd/es/border-beam/hooks/useBorderSize.js +37 -0
- package/vendor/antd/es/border-beam/hooks/useChildDom.js +24 -0
- package/vendor/antd/es/border-beam/index.js +7 -0
- package/vendor/antd/es/border-beam/style/index.js +60 -0
- package/vendor/antd/es/border-beam/util.js +26 -0
- package/vendor/antd/es/breadcrumb/Breadcrumb.js +1 -2
- package/vendor/antd/es/breadcrumb/BreadcrumbItem.js +1 -1
- package/vendor/antd/es/breadcrumb/useItemRender.js +3 -2
- package/vendor/antd/es/button/Button.js +7 -6
- package/vendor/antd/es/button/buttonHelpers.js +4 -8
- package/vendor/antd/es/button/index.js +2 -2
- package/vendor/antd/es/button/style/index.js +5 -0
- package/vendor/antd/es/calendar/generateCalendar.js +20 -8
- package/vendor/antd/es/card/Card.js +5 -7
- package/vendor/antd/es/card/CardMeta.js +1 -2
- package/vendor/antd/es/carousel/index.js +2 -1
- package/vendor/antd/es/cascader/Panel.js +1 -1
- package/vendor/antd/es/cascader/index.js +23 -16
- package/vendor/antd/es/cascader/style/columns.js +6 -2
- package/vendor/antd/es/checkbox/Checkbox.js +2 -3
- package/vendor/antd/es/checkbox/Group.js +2 -1
- package/vendor/antd/es/checkbox/style/index.js +1 -5
- package/vendor/antd/es/checkbox/useBubbleLock.js +1 -0
- package/vendor/antd/es/collapse/Collapse.js +3 -3
- package/vendor/antd/es/collapse/style/index.js +1 -4
- package/vendor/antd/es/color-picker/ColorPicker.js +1 -2
- package/vendor/antd/es/color-picker/ColorPickerPanel.js +2 -1
- package/vendor/antd/es/color-picker/components/ColorTrigger.js +3 -1
- package/vendor/antd/es/color-picker/components/PanelPicker/index.js +1 -0
- package/vendor/antd/es/config-provider/hooks/useSize.js +3 -2
- package/vendor/antd/es/config-provider/hooks/useTheme.js +2 -0
- package/vendor/antd/es/config-provider/index.js +11 -3
- package/vendor/antd/es/date-picker/generatePicker/generateRangePicker.js +20 -10
- package/vendor/antd/es/date-picker/generatePicker/generateSinglePicker.js +17 -8
- package/vendor/antd/es/date-picker/generatePicker/useSuffixIcon.js +1 -1
- package/vendor/antd/es/date-picker/hooks/useMergedPickerSemantic.js +1 -2
- package/vendor/antd/es/date-picker/style/index.js +13 -3
- package/vendor/antd/es/date-picker/style/multiple.js +3 -4
- package/vendor/antd/es/date-picker/style/panel.js +5 -20
- package/vendor/antd/es/date-picker/util.js +14 -13
- package/vendor/antd/es/descriptions/Cell.js +2 -3
- package/vendor/antd/es/descriptions/hooks/useItems.js +2 -1
- package/vendor/antd/es/descriptions/index.js +3 -3
- package/vendor/antd/es/divider/index.js +3 -2
- package/vendor/antd/es/drawer/Drawer.js +10 -5
- package/vendor/antd/es/drawer/DrawerPanel.js +3 -2
- package/vendor/antd/es/dropdown/dropdown.js +11 -8
- package/vendor/antd/es/dropdown/style/index.js +2 -6
- package/vendor/antd/es/empty/index.js +1 -2
- package/vendor/antd/es/flex/index.js +2 -2
- package/vendor/antd/es/float-button/BackTop.js +1 -0
- package/vendor/antd/es/float-button/FloatButton.js +3 -3
- package/vendor/antd/es/float-button/FloatButtonGroup.js +2 -2
- package/vendor/antd/es/form/ErrorList.js +13 -6
- package/vendor/antd/es/form/Form.js +7 -6
- package/vendor/antd/es/form/FormItem/ItemHolder.js +1 -1
- package/vendor/antd/es/form/FormItem/index.js +6 -6
- package/vendor/antd/es/form/FormItemInput.js +5 -3
- package/vendor/antd/es/form/FormItemLabel.js +2 -1
- package/vendor/antd/es/form/FormList.js +1 -0
- package/vendor/antd/es/form/hooks/useChildren.js +4 -3
- package/vendor/antd/es/form/hooks/useForm.js +3 -1
- package/vendor/antd/es/form/hooks/useFrameState.js +1 -0
- package/vendor/antd/es/form/hooks/useItemRef.js +7 -5
- package/vendor/antd/es/form/style/index.js +1 -3
- package/vendor/antd/es/grid/col.js +5 -7
- package/vendor/antd/es/grid/hooks/useBreakpoint.js +1 -0
- package/vendor/antd/es/grid/hooks/useGutter.js +2 -1
- package/vendor/antd/es/grid/row.js +7 -6
- package/vendor/antd/es/image/PreviewGroup.js +1 -2
- package/vendor/antd/es/image/Progress.js +58 -0
- package/vendor/antd/es/image/hooks/useMergedPreviewConfig.js +3 -1
- package/vendor/antd/es/image/hooks/usePlaceholderConfig.js +15 -0
- package/vendor/antd/es/image/hooks/usePreviewConfig.js +3 -2
- package/vendor/antd/es/image/index.js +36 -5
- package/vendor/antd/es/image/style/index.js +114 -4
- package/vendor/antd/es/image/style/progressAnimation.js +26 -0
- package/vendor/antd/es/index.js +2 -1
- package/vendor/antd/es/input/Input.js +9 -4
- package/vendor/antd/es/input/OTP/OTPInput.js +1 -0
- package/vendor/antd/es/input/OTP/index.js +3 -3
- package/vendor/antd/es/input/Password.js +45 -26
- package/vendor/antd/es/input/Search.js +6 -5
- package/vendor/antd/es/input/TextArea.js +13 -7
- package/vendor/antd/es/input/style/index.js +17 -11
- package/vendor/antd/es/input/style/otp.js +2 -1
- package/vendor/antd/es/input/style/variants.js +16 -10
- package/vendor/antd/es/input-number/index.js +3 -3
- package/vendor/antd/es/input-number/style/index.js +9 -9
- package/vendor/antd/es/layout/Sider.js +3 -2
- package/vendor/antd/es/list/index.js +5 -3
- package/vendor/antd/es/locale/en_US.js +3 -1
- package/vendor/antd/es/locale/ru_RU.js +3 -1
- package/vendor/antd/es/locale/useLocale.js +2 -1
- package/vendor/antd/es/masonry/Masonry.js +4 -3
- package/vendor/antd/es/mentions/index.js +28 -14
- package/vendor/antd/es/menu/MenuItem.js +2 -1
- package/vendor/antd/es/menu/OverrideContext.js +1 -0
- package/vendor/antd/es/menu/SubMenu.js +1 -1
- package/vendor/antd/es/menu/menu.js +5 -5
- package/vendor/antd/es/menu/style/index.js +21 -36
- package/vendor/antd/es/menu/style/vertical.js +2 -1
- package/vendor/antd/es/message/PureList.js +49 -0
- package/vendor/antd/es/message/PurePanel.js +28 -36
- package/vendor/antd/es/message/index.js +6 -3
- package/vendor/antd/es/message/style/index.js +102 -99
- package/vendor/antd/es/message/useMessage.js +29 -33
- package/vendor/antd/es/message/util.js +1 -1
- package/vendor/antd/es/modal/ConfirmDialog.js +11 -9
- package/vendor/antd/es/modal/Modal.js +12 -7
- package/vendor/antd/es/modal/PurePanel.js +1 -2
- package/vendor/antd/es/modal/confirm.js +4 -3
- package/vendor/antd/es/modal/shared.js +3 -2
- package/vendor/antd/es/modal/useModal/HookModal.js +2 -1
- package/vendor/antd/es/notification/PureList.js +46 -0
- package/vendor/antd/es/notification/PurePanel.js +37 -56
- package/vendor/antd/es/notification/hooks/useStackConfig.js +13 -0
- package/vendor/antd/es/notification/index.js +3 -1
- package/vendor/antd/es/notification/style/index.js +103 -170
- package/vendor/antd/es/notification/style/notification.js +191 -0
- package/vendor/antd/es/notification/style/placement.js +117 -60
- package/vendor/antd/es/notification/useNotification.js +37 -40
- package/vendor/antd/es/notification/util.js +9 -50
- package/vendor/antd/es/pagination/Pagination.js +1 -2
- package/vendor/antd/es/pagination/useShowSizeChanger.js +2 -1
- package/vendor/antd/es/popconfirm/PurePanel.js +4 -1
- package/vendor/antd/es/popconfirm/index.js +1 -2
- package/vendor/antd/es/popover/PurePanel.js +1 -2
- package/vendor/antd/es/popover/index.js +1 -2
- package/vendor/antd/es/progress/Circle.js +2 -1
- package/vendor/antd/es/progress/progress.js +3 -3
- package/vendor/antd/es/progress/utils.js +4 -3
- package/vendor/antd/es/qr-code/index.js +4 -4
- package/vendor/antd/es/radio/group.js +4 -3
- package/vendor/antd/es/radio/radio.js +2 -2
- package/vendor/antd/es/radio/style/index.js +1 -1
- package/vendor/antd/es/rate/index.js +2 -4
- package/vendor/antd/es/result/index.js +6 -5
- package/vendor/antd/es/result/style/index.js +10 -6
- package/vendor/antd/es/segmented/index.js +5 -3
- package/vendor/antd/es/select/index.js +23 -12
- package/vendor/antd/es/select/style/dropdown.js +1 -1
- package/vendor/antd/es/select/style/select-input.js +23 -15
- package/vendor/antd/es/select/useIcons.js +43 -26
- package/vendor/antd/es/skeleton/Element.js +2 -1
- package/vendor/antd/es/skeleton/Skeleton.js +3 -3
- package/vendor/antd/es/slider/SliderTooltip.js +1 -0
- package/vendor/antd/es/slider/index.js +5 -3
- package/vendor/antd/es/slider/useRafLock.js +1 -0
- package/vendor/antd/es/space/Compact.js +1 -1
- package/vendor/antd/es/space/Item.js +1 -1
- package/vendor/antd/es/space/index.js +2 -2
- package/vendor/antd/es/space/style/addon.js +5 -2
- package/vendor/antd/es/spin/Indicator/Progress.js +2 -1
- package/vendor/antd/es/spin/index.js +1 -2
- package/vendor/antd/es/splitter/Panel.js +7 -3
- package/vendor/antd/es/splitter/SplitBar.js +5 -4
- package/vendor/antd/es/splitter/Splitter.js +9 -6
- package/vendor/antd/es/splitter/hooks/useItems.js +2 -1
- package/vendor/antd/es/splitter/hooks/useSizes.js +1 -1
- package/vendor/antd/es/splitter/style/index.js +8 -6
- package/vendor/antd/es/statistic/Number.js +8 -4
- package/vendor/antd/es/statistic/Statistic.js +14 -10
- package/vendor/antd/es/steps/index.js +4 -4
- package/vendor/antd/es/style/compact-item-vertical.js +2 -1
- package/vendor/antd/es/style/compact-item.js +6 -6
- package/vendor/antd/es/switch/index.js +1 -2
- package/vendor/antd/es/table/InternalTable.js +23 -14
- package/vendor/antd/es/table/hooks/useFilledColumns.js +23 -0
- package/vendor/antd/es/table/hooks/useFilter/FilterDropdown.js +22 -16
- package/vendor/antd/es/table/hooks/useFilter/FilterWrapper.js +1 -0
- package/vendor/antd/es/table/hooks/useFilter/index.js +34 -18
- package/vendor/antd/es/table/hooks/useLazyKVMap.js +2 -1
- package/vendor/antd/es/table/hooks/usePagination.js +7 -4
- package/vendor/antd/es/table/hooks/useSelection.js +32 -21
- package/vendor/antd/es/table/hooks/useSorter.js +10 -5
- package/vendor/antd/es/table/style/bordered.js +5 -27
- package/vendor/antd/es/table/style/empty.js +1 -4
- package/vendor/antd/es/table/style/index.js +1 -4
- package/vendor/antd/es/table/util.js +6 -6
- package/vendor/antd/es/tabs/hooks/useAnimateConfig.js +2 -1
- package/vendor/antd/es/tabs/index.js +1 -2
- package/vendor/antd/es/tag/CheckableTagGroup.js +8 -5
- package/vendor/antd/es/tag/hooks/useColor.js +4 -3
- package/vendor/antd/es/tag/index.js +13 -7
- package/vendor/antd/es/theme/themes/dark/colors.js +2 -1
- package/vendor/antd/es/theme/themes/default/colors.js +2 -1
- package/vendor/antd/es/theme/useToken.js +2 -2
- package/vendor/antd/es/theme/util/alias.js +34 -29
- package/vendor/antd/es/timeline/Timeline.js +3 -4
- package/vendor/antd/es/tooltip/PurePanel.js +1 -2
- package/vendor/antd/es/tooltip/UniqueProvider/index.js +2 -1
- package/vendor/antd/es/tooltip/index.js +9 -7
- package/vendor/antd/es/tour/PurePanel.js +2 -2
- package/vendor/antd/es/tour/index.js +1 -1
- package/vendor/antd/es/tour/panelRender.js +4 -2
- package/vendor/antd/es/transfer/ListBody.js +3 -1
- package/vendor/antd/es/transfer/ListItem.js +2 -1
- package/vendor/antd/es/transfer/Section.js +17 -8
- package/vendor/antd/es/transfer/index.js +51 -16
- package/vendor/antd/es/transfer/style/index.js +5 -1
- package/vendor/antd/es/tree/Tree.js +1 -2
- package/vendor/antd/es/tree/style/index.js +5 -1
- package/vendor/antd/es/tree/utils/iconUtil.js +5 -4
- package/vendor/antd/es/tree-select/index.js +3 -3
- package/vendor/antd/es/typography/Base/CopyBtn.js +3 -2
- package/vendor/antd/es/typography/Base/Ellipsis.js +3 -3
- package/vendor/antd/es/typography/Base/index.js +38 -31
- package/vendor/antd/es/typography/Editable.js +10 -4
- package/vendor/antd/es/typography/Link.js +1 -0
- package/vendor/antd/es/typography/Text.js +2 -1
- package/vendor/antd/es/typography/Typography.js +20 -10
- package/vendor/antd/es/typography/hooks/useCopyClick.js +2 -1
- package/vendor/antd/es/typography/hooks/useMergedConfig.js +13 -7
- package/vendor/antd/es/typography/hooks/useTooltipProps.js +2 -1
- package/vendor/antd/es/typography/hooks/useTypographySemantic.js +33 -0
- package/vendor/antd/es/typography/style/index.js +12 -27
- package/vendor/antd/es/typography/style/mixins.js +46 -13
- package/vendor/antd/es/upload/Upload.js +13 -7
- package/vendor/antd/es/upload/UploadList/ListItem.js +6 -5
- package/vendor/antd/es/upload/UploadList/index.js +4 -3
- package/vendor/antd/es/upload/utils.js +18 -1
- package/vendor/antd/es/version/version.js +1 -1
- package/vendor/antd/es/watermark/index.js +6 -4
- package/vendor/antd/es/watermark/useSingletonCache.js +1 -0
- package/vendor/antd/es/watermark/useWatermark.js +3 -3
- package/vendor/antd/package.json +1 -1
- package/vendor/useblocks-ui-kit/es/components/DataEntry/Input/index.js +1 -1
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/iframe/js/discussHandlers.CCCXIEaO.js +0 -88
- package/static/core/1f101241.js +0 -1
- package/static/core/1fa93ad8.js +0 -28
- package/static/core/2007bc93.js +0 -1
- package/static/core/30ab7b1d.js +0 -1
- package/static/core/440a91be.js +0 -1
- package/static/core/44e96a78.js +0 -1
- package/static/core/823aedee.js +0 -1
- package/static/core/828583e1.js +0 -2
- package/static/core/8cc6e392.js +0 -1
- package/static/core/9aefcefb.js +0 -1
- package/static/core/a4f90443.js +0 -27
- package/static/core/a7ac37cd.js +0 -1
- package/static/core/df41de18.js +0 -7
- package/static/esm/349f9e2c.js +0 -1
- package/static/esm/50fbfdf6.js +0 -1
- package/static/media/icon-sets/lucide.json +0 -6275
- package/static/media/icon-sets/tabler.json +0 -19336
- package/static/umd-runtime/Cl8heeC3.js +0 -1
- package/static/umd-runtime/D0xo8o9c.js +0 -335
- package/useblocks-core.8098d114.js +0 -859
- package/vendor/@rc-component/notification/es/Notice.js +0 -106
- package/vendor/@rc-component/notification/es/NoticeList.js +0 -98
- package/vendor/@rc-component/textarea/LICENSE.md +0 -9
- package/vendor/@rc-component/textarea/es/index.js +0 -6
- package/vendor/@rc-component/textarea/package.json +0 -6
- package/vendor/antd/es/_util/extendsObject.js +0 -12
- package/vendor/antd/es/_util/getAllowClear.js +0 -12
- package/vendor/antd/es/_util/isNonNullable.js +0 -6
- package/vendor/antd/es/_util/isPrimitive.js +0 -4
- package/vendor/antd/es/notification/style/pure-panel.js +0 -18
- package/vendor/antd/es/notification/style/stack.js +0 -85
- /package/iframe/{iframe-eblock.8098d114.html → iframe-eblock.714faf8a.html} +0 -0
- /package/iframe/{iframe.8098d114.html → iframe.714faf8a.html} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
(function(){try{if(typeof document<"u"){var r=".blocks-app .form-editor-calendar-panel.panel-form{height:100%;min-height:0;max-height:100%}.blocks-app .form-editor-calendar-panel .panel-form__body.form-editor-calendar-panel__body{-webkit-overflow-scrolling:touch;flex:1;min-width:0;min-height:0;overflow:hidden auto}.blocks-app .form-editor-calendar-panel .panel-form__body-content{box-sizing:border-box;min-height:0}.blocks-app .form-editor-calendar-panel__title{font-size:16px;font-weight:600}.blocks-app .form-editor-calendar-panel__inner{box-sizing:border-box;padding:16px 20px 32px}.blocks-app .form-editor-calendar.ant-form-vertical>.ant-form-item{margin-bottom:20px}.blocks-app .form-editor-calendar__label-with-info{align-items:center;gap:6px;display:inline-flex}.blocks-app .form-editor-calendar__info-icon{color:var(--ub-colorTextSecondary);cursor:help;display:inline-flex}.blocks-app .form-editor-calendar__section-divider{margin:16px 0 20px}.blocks-app .form-editor-calendar__more-btn{margin-bottom:12px}.blocks-app .form-editor-calendar__expanded{flex-direction:column;gap:0;margin-top:8px;display:flex}.blocks-app .form-editor-calendar__expanded>.form-section:first-child>.form-section__header .form-section__title{padding-top:12px}.blocks-app .form-editor-calendar__section.form-section .form-section__body{padding-top:8px;padding-bottom:18px}.blocks-app .form-editor-calendar__bg-preview{align-items:center;gap:12px;margin-top:4px;padding-top:12px;display:flex}.blocks-app .form-editor-calendar__bg-chip{border-radius:calc(var(--ub-borderRadius) * 1px);border:1px solid var(--ub-colorBorderSecondary);justify-content:center;align-items:center;min-width:40px;height:36px;padding:0 10px;line-height:1;display:inline-flex}.blocks-app .form-editor-calendar__bg-chip--active{box-shadow:0 0 0 1px var(--ub-colorPrimaryBg)}.blocks-app .form-editor-calendar__full-width{width:100%}.blocks-app .form-editor-calendar__typography-stack{flex-direction:column;gap:16px;display:flex}.blocks-app .form-editor-calendar .form-border-radius-inputs,.blocks-app .form-editor-calendar .em-form-border-inputs{margin-top:4px}.blocks-app .form-editor-checkbox-panel.panel-form{height:100%;min-height:0;max-height:100%}.blocks-app .form-editor-checkbox-panel .panel-form__body.form-editor-checkbox-panel__body{-webkit-overflow-scrolling:touch;flex:1;min-width:0;min-height:0;overflow:hidden auto}.blocks-app .form-editor-checkbox-panel .panel-form__body-content{box-sizing:border-box;min-height:0}.blocks-app .form-editor-checkbox-panel__title{font-size:16px;font-weight:600}.blocks-app .form-editor-checkbox-panel__inner{box-sizing:border-box;padding:16px 20px 32px}.blocks-app .form-editor-checkbox.ant-form-vertical>.ant-form-item{margin-bottom:20px}.blocks-app .form-editor-checkbox__label-with-info{align-items:center;gap:6px;display:inline-flex}.blocks-app .form-editor-checkbox__info-icon{color:var(--ub-colorTextSecondary);cursor:help;display:inline-flex}.blocks-app .form-editor-checkbox__default-radios.em-radio.ant-radio-group,.blocks-app .form-editor-checkbox__shape-radios.em-radio.ant-radio-group{flex-wrap:wrap;align-items:center;gap:8px 24px;display:flex}.blocks-app .form-editor-checkbox__icon-toggle-group.em-radio.ant-radio-group{flex-wrap:nowrap;gap:6px;display:flex}.blocks-app .form-editor-checkbox__icon-toggle-group .ant-radio-button-wrapper{justify-content:center;align-items:center;min-width:32px;padding-inline:10px;line-height:1;display:inline-flex}.blocks-app .form-editor-checkbox__inner-section-divider{margin:12px 0 16px}.blocks-app .form-editor-checkbox__align-form-item.ant-form-item{margin-bottom:0}.blocks-app .form-editor-checkbox__align-block{margin-top:16px}.blocks-app .form-editor-checkbox__align-columns{flex-wrap:wrap;align-items:flex-start;gap:16px 24px;display:flex}.blocks-app .form-editor-checkbox__align-column{flex:140px;min-width:108px}.blocks-app .form-editor-checkbox__section-divider{margin:16px 0 20px}.blocks-app .form-editor-checkbox__more-btn{margin-bottom:12px}.blocks-app .form-editor-checkbox__bg-preview{flex-direction:column;gap:8px;margin-top:4px;padding-top:8px;display:flex}.blocks-app .form-editor-checkbox__preview-panel{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;flex-direction:column;gap:6px;padding:10px;display:flex}.blocks-app .form-editor-checkbox__preview-row{box-sizing:border-box;align-items:center;gap:10px;min-height:28px;padding:4px 0;display:flex}.blocks-app .form-editor-checkbox__preview-checkbox{box-sizing:border-box;border-style:solid;border-width:2px;flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}.blocks-app .form-editor-checkbox__preview-checkbox--round{border-radius:50%}.blocks-app .form-editor-checkbox__preview-checkbox--square{border-radius:2px}.blocks-app .form-editor-checkbox__preview-label{color:var(--ub-colorText);font-size:12px;line-height:1.3}.blocks-app .form-editor-checkbox__section.form-section .form-section__body{padding-top:8px;padding-bottom:18px}.blocks-app .form-editor-checkbox__expanded{flex-direction:column;gap:0;margin-top:8px;display:flex}.blocks-app .form-editor-checkbox__expanded>.form-section:first-child>.form-section__header .form-section__title{padding-top:12px}.blocks-app .form-editor-checkbox__full-width{width:100%}.blocks-app .form-editor-checkbox__micro-label{color:var(--ub-colorTextSecondary);margin-bottom:0;font-size:12px;line-height:1.2;display:block}.blocks-app .form-editor-checkbox .form-border-radius-inputs,.blocks-app .form-editor-checkbox .em-form-border-inputs{margin-top:4px}.blocks-app .form-editor-dropdown-list-panel.panel-form{height:100%;min-height:0;max-height:100%}.blocks-app .form-editor-dropdown-list-panel .panel-form__body.form-editor-dropdown-list-panel__body{-webkit-overflow-scrolling:touch;flex:1;min-width:0;min-height:0;overflow:hidden auto}.blocks-app .form-editor-dropdown-list-panel .panel-form__body-content{box-sizing:border-box;min-height:0}.blocks-app .form-editor-dropdown-list-panel__title{font-size:16px;font-weight:600}.blocks-app .form-editor-dropdown-list-panel__inner{box-sizing:border-box;padding:16px 20px 32px}.blocks-app .form-editor-dropdown.ant-form-vertical>.ant-form-item{margin-bottom:20px}.blocks-app .form-editor-dropdown__section-divider{margin:16px 0 20px}.blocks-app .form-editor-dropdown__more-btn{margin-bottom:12px}.blocks-app .form-editor-dropdown__bg-preview{flex-direction:column;gap:8px;margin-top:4px;padding-top:8px;display:flex}.blocks-app .form-editor-dropdown__trigger-mock{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;justify-content:space-between;align-items:center;gap:8px;min-height:32px;padding:4px 11px;display:flex}.blocks-app .form-editor-dropdown__trigger-mock-text{min-width:0;color:var(--ub-colorTextQuaternary,var(--ub-colorTextSecondary));text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;line-height:1.3;overflow:hidden}.blocks-app .form-editor-dropdown__trigger-mock-arrow{flex-shrink:0;align-items:center;line-height:0;display:inline-flex}.blocks-app .form-editor-dropdown__list-mock{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;flex-direction:column;gap:4px;padding:8px 10px;display:flex}.blocks-app .form-editor-dropdown__list-mock-item{color:var(--ub-colorText);font-size:12px;line-height:1.4}.blocks-app .form-editor-dropdown__section.form-section .form-section__body{padding-top:8px;padding-bottom:18px}.blocks-app .form-editor-dropdown__expanded{flex-direction:column;gap:0;margin-top:8px;display:flex}.blocks-app .form-editor-dropdown__expanded>.form-section:first-child>.form-section__header .form-section__title{padding-top:12px}.blocks-app .form-editor-dropdown__full-width{width:100%}.blocks-app .form-editor-dropdown .form-border-radius-inputs,.blocks-app .form-editor-dropdown .em-form-border-inputs{margin-top:4px}.blocks-app .form-editor-input-panel.panel-form{height:100%;min-height:0;max-height:100%}.blocks-app .form-editor-input-panel .panel-form__body.form-editor-input-panel__body{-webkit-overflow-scrolling:touch;flex:1;min-width:0;min-height:0;overflow:hidden auto}.blocks-app .form-editor-input-panel .panel-form__body-content{box-sizing:border-box;min-height:0}.blocks-app .form-editor-input-panel__title{font-size:16px;font-weight:600}.blocks-app .form-editor-input-panel__inner{box-sizing:border-box;padding:16px 20px 32px}.blocks-app .form-editor-input.ant-form-vertical>.ant-form-item{margin-bottom:20px}.blocks-app .form-editor-input__icon-toggle-group.em-radio.ant-radio-group{flex-wrap:nowrap;gap:6px;display:flex}.blocks-app .form-editor-input__icon-toggle-group .ant-radio-button-wrapper{justify-content:center;align-items:center;min-width:32px;padding-inline:10px;line-height:1;display:inline-flex}.blocks-app .form-editor-input__align-form-item.ant-form-item{margin-bottom:0}.blocks-app .form-editor-input__align-columns{flex-wrap:wrap;align-items:flex-start;gap:16px 24px;display:flex}.blocks-app .form-editor-input__align-column{flex:140px;min-width:108px}.blocks-app .form-editor-input__section-divider{margin:16px 0 20px}.blocks-app .form-editor-input__more-btn{margin-bottom:12px}.blocks-app .form-editor-input__bg-preview{margin-top:4px;padding-top:8px}.blocks-app .form-editor-input__preview-panel{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;padding:10px}.blocks-app .form-editor-input__preview-input{border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;text-align:left;border-style:solid;border-width:1px;width:100%;min-height:32px;padding:6px 11px;font-size:14px;line-height:1.4}.blocks-app .form-editor-input__preview-placeholder-bit{opacity:.65}.blocks-app .form-editor-input__section.form-section .form-section__body{padding-top:8px;padding-bottom:18px}.blocks-app .form-editor-input__expanded{flex-direction:column;gap:0;margin-top:8px;display:flex}.blocks-app .form-editor-input__expanded>.form-section:first-child>.form-section__header .form-section__title{padding-top:12px}.blocks-app .form-editor-input__full-width{width:100%}.blocks-app .form-editor-input .form-border-radius-inputs,.blocks-app .form-editor-input .em-form-border-inputs{margin-top:4px}.blocks-app .form-editor-input__padding-row{flex-wrap:wrap;align-items:flex-start;gap:8px;width:100%;display:flex}.blocks-app .form-editor-input__padding-field.ant-form-item{flex:120px;min-width:100px;max-width:calc(50% - 4px);margin-bottom:0}.blocks-app .form-editor-input__padding-link-btn{flex:0 0 32px;justify-content:center;align-items:center;width:32px;height:32px;padding:0;display:inline-flex}.blocks-app .form-editor-input__advanced-block{flex-direction:column;gap:8px;width:100%;display:flex}.blocks-app .form-editor-input__advanced-block+.form-editor-input__advanced-block{margin-top:16px}.blocks-app .form-editor-input__advanced-switch-row{align-items:center;gap:12px;width:100%;padding:6px 0;display:flex}.blocks-app .form-editor-input__advanced-switch-label{color:var(--ub-colorText);flex:auto;min-width:0;margin:0;font-size:14px;line-height:1.3}.blocks-app .form-editor-input__advanced-description{margin:0;font-size:12px;line-height:1.35;display:block}.blocks-app .form-editor-input__visibility-row{flex-wrap:wrap;align-items:center;gap:12px 16px;width:100%;display:flex}.blocks-app .form-editor-input__visibility-form-item.ant-form-item,.blocks-app .form-editor-input__direction-form-item.ant-form-item{margin-bottom:0}.blocks-app .form-editor-input__visibility-segment.ant-radio-group,.blocks-app .form-editor-input__visibility-amp.ant-radio-group{flex-wrap:wrap;gap:6px;display:flex}.blocks-app .form-editor-input__visibility-segment .ant-radio-button-wrapper,.blocks-app .form-editor-input__visibility-amp .ant-radio-button-wrapper{justify-content:center;align-items:center;display:inline-flex}.blocks-app .form-editor-radio-panel.panel-form{height:100%;min-height:0;max-height:100%}.blocks-app .form-editor-radio-panel .panel-form__body.form-editor-radio-panel__body{-webkit-overflow-scrolling:touch;flex:1;min-width:0;min-height:0;overflow:hidden auto}.blocks-app .form-editor-radio-panel .panel-form__body-content{box-sizing:border-box;min-height:0}.blocks-app .form-editor-radio-panel__title{font-size:16px;font-weight:600}.blocks-app .form-editor-radio-panel__inner{box-sizing:border-box;padding:16px 20px 32px}.blocks-app .form-editor-radio.ant-form-vertical>.ant-form-item{margin-bottom:20px}.blocks-app .form-editor-radio__default-radios.em-radio.ant-radio-group,.blocks-app .form-editor-radio__shape-radios.em-radio.ant-radio-group{flex-wrap:wrap;align-items:center;gap:8px 24px;display:flex}.blocks-app .form-editor-radio__icon-toggle-group.em-radio.ant-radio-group{flex-wrap:nowrap;gap:6px;display:flex}.blocks-app .form-editor-radio__icon-toggle-group .ant-radio-button-wrapper{justify-content:center;align-items:center;min-width:32px;padding-inline:10px;line-height:1;display:inline-flex}.blocks-app .form-editor-radio__inner-section-divider{margin:12px 0 16px}.blocks-app .form-editor-radio__position-block,.blocks-app .form-editor-radio__layout-form-item.ant-form-item,.blocks-app .form-editor-radio__align-form-item.ant-form-item{margin-bottom:0}.blocks-app .form-editor-radio__align-block{margin-top:16px}.blocks-app .form-editor-radio__section-divider{margin:16px 0 20px}.blocks-app .form-editor-radio__more-btn{margin-bottom:12px}.blocks-app .form-editor-radio__bg-preview{flex-direction:column;gap:8px;margin-top:4px;padding-top:8px;display:flex}.blocks-app .form-editor-radio__preview-panel{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;flex-direction:column;gap:6px;padding:10px;display:flex}.blocks-app .form-editor-radio__preview-row{border-radius:calc(var(--ub-borderRadius) * 1px);box-sizing:border-box;align-items:center;gap:10px;min-height:28px;padding:4px 8px;display:flex}.blocks-app .form-editor-radio__preview-dot{border:2px solid var(--ub-colorBorderSecondary);box-sizing:border-box;border-radius:50%;flex-shrink:0;width:14px;height:14px}.blocks-app .form-editor-radio__preview-dot--selected{border-style:solid}.blocks-app .form-editor-radio__preview-label{color:var(--ub-colorText);font-size:12px;line-height:1.3}.blocks-app .form-editor-radio__section.form-section .form-section__body{padding-top:8px;padding-bottom:18px}.blocks-app .form-editor-radio__expanded{flex-direction:column;gap:0;margin-top:8px;display:flex}.blocks-app .form-editor-radio__expanded>.form-section:first-child>.form-section__header .form-section__title{padding-top:12px}.blocks-app .form-editor-radio__full-width{width:100%}.blocks-app .form-editor-radio__micro-label{color:var(--ub-colorTextSecondary);margin-bottom:0;font-size:12px;line-height:1.2;display:block}.blocks-app .form-editor-radio .form-border-radius-inputs,.blocks-app .form-editor-radio .em-form-border-inputs{margin-top:4px}",o=window.__useblocks_styles__||(window.__useblocks_styles__={sheets:{},order:[]}),t=r;if(!o.sheets[t]){var e=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(e=new CSSStyleSheet,e.replaceSync(r))}catch{e=null}if(e){if(!o.host||!o.host.isConnected||!o.host.sheet){var i=document.createElement("style");i.setAttribute("data-useblocks","true"),document.head.appendChild(i),o.host=i}for(var d=o.host.sheet,a=0;a<e.cssRules.length;a++)try{d.insertRule(e.cssRules[a].cssText,d.cssRules.length)}catch{}(o.texts||(o.texts=[])).push(r),(o.listeners||[]).forEach(function(p){try{p(r)}catch{}})}else{var i=document.createElement("style");i.setAttribute("data-useblocks","true"),i.appendChild(document.createTextNode(r)),document.head.appendChild(i)}o.sheets[t]=!0,o.order.push(t)}}}catch(p){console.error("vite-plugin-css-injected-by-js",p)}})();
|
|
2
|
+
__useblocks__.define("static/core/2827ff97.js",["require","exports","module","static/core/2ff39ddf.js","static/core/41d2fa95.js","static/core/5ae1e3a3.js","react","react/jsx-runtime","__delivery__/libs","classnames"],function(B,I,De){const J=B("./2ff39ddf.js"),r=B("./41d2fa95.js"),u=B("./5ae1e3a3.js");let d=B("react");d=J.__toESM(d);let e=B("react/jsx-runtime"),i=B("__delivery__/libs"),Q=B("classnames");Q=J.__toESM(Q);var S=J.__toESM(r.require_prop_types()),h="calendar_",ee=`${h}borderRadiusAll`,N=`${h}borderRadiusTopLeft`,y=`${h}borderRadiusTopRight`,L=`${h}borderRadiusBottomLeft`,w=`${h}borderRadiusBottomRight`,ne="Segoe UI, Helvetica Neue, Helvetica, Arial, sans-serif",he=t=>t.closest(".email-pane__collapse-wrapper")||t.closest(".email-pane__content-col")||document.body;function ie({namePrefix:t,microLabel:l}){const a=u.useGoogleFontsLoader(),{__:o}=r.useI18n(),c=r.useSelector(r.selectEmailSettings)?.usedColors;return(0,e.jsx)(i.ui_kit$FormTypographyFields,{namePrefix:t,microLabel:l,usedColors:c,loadGoogleFonts:a,getPopupContainer:he,formatLabels:{bold:o("Strong ( Ctrl+B )"),italic:o("Italic ( Ctrl+I )"),strikethrough:o("Strikethrough ( Alt+Shift+5 )"),underline:o("Underline ( Ctrl+U )")},inputLabels:{fontSize:o("Font size"),lineHeight:o("Line height"),textColor:o("Text color")}})}ie.propTypes={namePrefix:S.default.string.isRequired,microLabel:S.default.node.isRequired};function xe(){const t=i.ui_kit$Form.useWatch("inactiveDateBg"),l=i.ui_kit$Form.useWatch("activeDateBg"),a=i.ui_kit$Form.useWatch("inactiveColor"),o=i.ui_kit$Form.useWatch("activeColor"),c=i.ui_kit$Form.useWatch("inactiveFontFamily"),_=i.ui_kit$Form.useWatch("activeFontFamily"),m=i.ui_kit$Form.useWatch("inactiveFontSize"),$=i.ui_kit$Form.useWatch("activeFontSize"),b=i.ui_kit$Form.useWatch("inactiveTextStrong"),g=i.ui_kit$Form.useWatch("activeTextStrong");return(0,e.jsxs)("div",{className:"form-editor-calendar__bg-preview","aria-hidden":!0,children:[(0,e.jsx)("span",{className:"form-editor-calendar__bg-chip",style:{background:t,color:a,fontFamily:c,fontSize:m,fontWeight:b?700:400},children:"31"}),(0,e.jsx)("span",{className:"form-editor-calendar__bg-chip form-editor-calendar__bg-chip--active",style:{background:l,color:o,fontFamily:_,fontSize:$,fontWeight:g?700:400},children:"15"})]})}var ke=()=>{const{__:t}=r.useI18n(),l=r.useDispatch(),a=r.useAppConfig(),[o]=i.ui_kit$Form.useForm(),[c,_]=(0,d.useState)(!1),[m,$]=(0,d.useState)(!0),b=(0,d.useMemo)(()=>({placeholder:"",valueMode:void 0,dateFormat:"24h",required:!1,inactiveDateBg:"#ffffff",activeDateBg:"#01bca6",inactiveFontFamily:ne,inactiveFontSize:19,inactiveLineHeight:24,inactiveColor:"#333333",inactiveTextStrong:!1,inactiveTextItalic:!1,inactiveTextStrikethrough:!1,inactiveTextUnderline:!1,activeFontFamily:ne,activeFontSize:19,activeLineHeight:24,activeColor:"#ffffff",activeTextStrong:!0,activeTextItalic:!1,activeTextStrikethrough:!1,activeTextUnderline:!1,[`${h}borderPosition`]:`${h}borderAll`,[`${h}borderAll`]:{width:1,style:"solid",color:"#ffffff"},[`${h}borderTop`]:{...u.NULL_BORDER},[`${h}borderBottom`]:{...u.NULL_BORDER},[`${h}borderRight`]:{...u.NULL_BORDER},[`${h}borderLeft`]:{...u.NULL_BORDER},[ee]:5,[N]:null,[y]:null,[L]:null,[w]:null}),[]),g=(0,d.useCallback)(()=>{l(r.setActiveSettingsTab(r.BUILD))},[l]),v=(0,d.useCallback)(()=>{const n=o.getFieldsValue(!0);if(m){const j=n[ee]??0;o.setFieldsValue({[N]:j,[y]:j,[L]:j,[w]:j})}else{const j=n[N];j===n[y]&&j===n[L]&&j===n[w]?o.setFieldsValue({[ee]:j}):o.setFieldsValue({[N]:null,[y]:null,[L]:null,[w]:null})}$(j=>!j)},[o,m]),R=[{value:"24h",label:t("24 hours")},{value:"12h",label:t("12 hours")},{value:"DDMMYYYY",label:"DD.MM.YYYY"},{value:"YYYYMMDD",label:"YYYY-MM-DD"}],C=[{value:"empty",label:t("Enter value")},{value:"today",label:t("Today")},{value:"custom",label:t("Custom")}],T=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Remove"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:18,strokeWidth:a.iconStrokeWidth})})}),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Link"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"LinkOutlined",component:i.icons$LinkOutlined,size:18,strokeWidth:a.iconStrokeWidth})})})]}),s=(0,e.jsx)("div",{className:"form-editor-calendar-panel__inner",children:(0,e.jsxs)(i.ui_kit$Form,{form:o,layout:"vertical",className:"element-controls form-editor-calendar",autoComplete:"off",initialValues:b,children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"placeholder",label:t("Placeholder"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Text visible at the start"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"valueMode",label:(0,e.jsxs)("span",{className:"form-editor-calendar__label-with-info",children:[t("Value"),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Default or bound value for the field"),children:(0,e.jsx)("span",{className:"form-editor-calendar__info-icon",children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"InfoCircleOutlined",component:i.icons$InfoCircleOutlined,size:16})})})]}),children:(0,e.jsx)(i.ui_kit$Select,{className:"form-editor-calendar__full-width",placeholder:t("Enter value"),options:C,allowClear:!0})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"dateFormat",label:t("Date format"),children:(0,e.jsx)(i.ui_kit$Select,{className:"form-editor-calendar__full-width",options:R})}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"required",label:t("Required field")}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-calendar__section-divider"}),(0,e.jsx)(i.ui_kit$Button,{type:c?"primary":"default",block:!0,className:"form-editor-calendar__more-btn",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"SettingOutlined",component:i.icons$SettingOutlined,size:16}),onClick:()=>_(n=>!n),children:t(c?"Fewer settings":"More settings")}),c&&(0,e.jsxs)("div",{className:"form-editor-calendar__expanded",children:[(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-calendar__section",title:t("Background"),children:(0,e.jsxs)(i.ui_kit$Space,{orientation:"vertical",size:20,className:"form-editor-calendar__full-width",children:[(0,e.jsx)(i.ui_kit$FormColorField,{name:"inactiveDateBg",label:t("Inactive date background color")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"activeDateBg",label:t("Active date background color")}),(0,e.jsx)(xe,{})]})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-calendar__section",title:t("Input field text"),children:(0,e.jsxs)("div",{className:"form-editor-calendar__typography-stack",children:[(0,e.jsx)(ie,{namePrefix:"inactive",microLabel:t("Inactive date font")}),(0,e.jsx)(ie,{namePrefix:"active",microLabel:t("Active date font")})]})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-calendar__section",title:t("Border radius"),collapsible:!0,defaultOpen:!0,children:(0,e.jsx)(i.ui_kit$FormBorderRadiusInputs,{namePrefix:h,typeOfForm:"desktop",oneBorderRadiusValue:m,onToggle:v,borderRadiusIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"RadiusUpleftOutlined",component:i.icons$RadiusUpleftOutlined,className:"selected-td-form__icon-radius"}),labels:{borderRadius:t("Border radius"),topLeft:t("Top left corner"),topRight:t("Top right corner"),bottomLeft:t("Bottom left corner"),bottomRight:t("Bottom right corner")}})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-calendar__section",title:t("Border"),children:(0,e.jsx)(u.SelectedElementFormBorder,{form:o,namePrefix:h})})]})]})});return(0,e.jsxs)(i.ui_kit$PanelForm,{className:"form-editor-calendar-panel",children:[(0,e.jsx)(i.ui_kit$PanelForm.Header,{onClose:g,closeIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Close",component:i.icons$Close,size:24,strokeWidth:a.iconStrokeWidth}),extra:T,children:(0,e.jsx)(i.ui_kit$PanelForm.HeaderTitle,{className:"form-editor-calendar-panel__title",children:t("Calendar")})}),(0,e.jsx)(i.ui_kit$PanelForm.Body,{className:"form-editor-calendar-panel__body",padding:{horizontal:0,vertical:0},children:s})]})},x="checkbox_",te=`${x}borderRadiusAll`,O=`${x}borderRadiusTopLeft`,E=`${x}borderRadiusTopRight`,A=`${x}borderRadiusBottomLeft`,P=`${x}borderRadiusBottomRight`,fe="Segoe UI, Helvetica Neue, Helvetica, Arial, sans-serif",ae=t=>t.closest(".email-pane__collapse-wrapper")||t.closest(".email-pane__content-col")||document.body;function se({namePrefix:t,microLabel:l}){const a=u.useGoogleFontsLoader(),{__:o}=r.useI18n(),c=r.useSelector(r.selectEmailSettings)?.usedColors;return(0,e.jsx)(i.ui_kit$FormTypographyFields,{namePrefix:t,microLabel:l,usedColors:c,loadGoogleFonts:a,getPopupContainer:ae,formatLabels:{bold:o("Strong ( Ctrl+B )"),italic:o("Italic ( Ctrl+I )"),strikethrough:o("Strikethrough ( Alt+Shift+5 )"),underline:o("Underline ( Ctrl+U )")},inputLabels:{fontSize:o("Font size"),lineHeight:o("Line height"),textColor:o("Text color")}})}se.propTypes={namePrefix:S.default.string.isRequired,microLabel:S.default.node.isRequired};function $e(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("markerShape"),a=i.ui_kit$Form.useWatch("appearanceBackground"),o=i.ui_kit$Form.useWatch("appearanceStrokeColor"),c=i.ui_kit$Form.useWatch("appearanceCheckColor"),_=i.ui_kit$Form.useWatch("useCustomCheckIcon"),m=(0,Q.default)("form-editor-checkbox__preview-checkbox",l==="round"&&"form-editor-checkbox__preview-checkbox--round",l==="square"&&"form-editor-checkbox__preview-checkbox--square");return(0,e.jsx)("div",{className:"form-editor-checkbox__bg-preview","aria-hidden":!0,children:(0,e.jsxs)("div",{className:"form-editor-checkbox__preview-panel",children:[(0,e.jsxs)("div",{className:"form-editor-checkbox__preview-row",children:[(0,e.jsx)("span",{className:m,style:{borderColor:o,background:c},children:!_&&(0,e.jsx)(i.ui_kit$EmIcons,{icon:"CheckOutlined",component:i.icons$CheckOutlined,size:10,style:{color:"#ffffff"}})}),(0,e.jsx)("span",{className:"form-editor-checkbox__preview-label",children:t("Checked")})]}),(0,e.jsxs)("div",{className:"form-editor-checkbox__preview-row",children:[(0,e.jsx)("span",{className:m,style:{borderColor:o,background:a}}),(0,e.jsx)("span",{className:"form-editor-checkbox__preview-label",children:t("Unchecked")})]})]})})}function be(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("useCustomCheckIcon");return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"markerShape",label:t("Marker shape"),children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-checkbox__shape-radios",children:[(0,e.jsx)(i.ui_kit$Radio,{value:"round",children:t("Round")}),(0,e.jsx)(i.ui_kit$Radio,{value:"square",children:t("Square")})]})}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-checkbox__inner-section-divider"}),(0,e.jsxs)(i.ui_kit$Space,{orientation:"vertical",size:16,className:"form-editor-checkbox__full-width",children:[(0,e.jsx)(i.ui_kit$FormColorField,{name:"appearanceBackground",label:t("Background color")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"appearanceStrokeColor",label:t("Stroke color")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"appearanceCheckColor",label:t("Checked fill color")})]}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"useCustomCheckIcon",label:t("Use custom icon for checked state")}),l&&(0,e.jsx)(i.ui_kit$Form.Item,{name:"customCheckIconUrl",label:t("Checked icon URL"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:"https://",allowClear:!0})}),(0,e.jsx)($e,{})]})}function ge(){const{__:t}=r.useI18n(),l=r.useAppConfig().iconStrokeWidth;return(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-checkbox__section",title:t("Position in cell"),children:(0,e.jsxs)("div",{className:"form-editor-checkbox__align-columns",children:[(0,e.jsxs)("div",{className:"form-editor-checkbox__align-column",children:[(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-checkbox__micro-label",children:t("Horizontal alignment")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"alignHorizontal",className:"form-editor-checkbox__align-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-checkbox__icon-toggle-group",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"left",title:t("Align left"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignLeftOutlined",component:i.icons$AlignLeftOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"center",title:t("Align center"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignCenterOutlined",component:i.icons$AlignCenterOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"right",title:t("Align right"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignRightOutlined",component:i.icons$AlignRightOutlined,size:16,strokeWidth:l})})]})})]}),(0,e.jsxs)("div",{className:"form-editor-checkbox__align-column",children:[(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-checkbox__micro-label",children:t("Vertical alignment")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"alignVertical",className:"form-editor-checkbox__align-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-checkbox__icon-toggle-group",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"top",title:t("Align top"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignVerticalTop",component:i.icons$AlignVerticalTop,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"middle",title:t("Align middle"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignVerticalCenter",component:i.icons$AlignVerticalCenter,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"bottom",title:t("Align bottom"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignVerticalBottom",component:i.icons$AlignVerticalBottom,size:16,strokeWidth:l})})]})})]})]})})}function je(){const{__:t}=r.useI18n();return i.ui_kit$Form.useWatch("showHelperText")?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"helperText",label:t("Helper text"),children:(0,e.jsx)(i.ui_kit$Input.TextArea,{rows:2,placeholder:t("Tooltip or hint text"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"validationErrorText",label:t("Validation error message"),children:(0,e.jsx)(i.ui_kit$Input.TextArea,{rows:2,placeholder:t("Message when validation fails"),allowClear:!0})})]}):null}var Fe=()=>{const{__:t}=r.useI18n(),l=r.useDispatch(),a=r.useAppConfig(),[o]=i.ui_kit$Form.useForm(),[c,_]=(0,d.useState)(!1),[m,$]=(0,d.useState)(!0),b=(0,d.useMemo)(()=>[{value:"v1",label:`${t("Value")} 1`},{value:"v2",label:`${t("Value")} 2`},{value:"custom",label:t("Custom")}],[t]),g=(0,d.useMemo)(()=>({fieldHeading:"",boundValue:void 0,checkboxLabel:"",required:!1,defaultState:"disabled",showHelperText:!1,helperText:"",validationErrorText:"",alignHorizontal:"left",alignVertical:"top",markerShape:"square",appearanceBackground:"#ffffff",appearanceStrokeColor:"#d9d9d9",appearanceCheckColor:"#01bca6",useCustomCheckIcon:!1,customCheckIconUrl:"",labelTextFontFamily:fe,labelTextFontSize:19,labelTextLineHeight:24,labelTextColor:"#333333",labelTextStrong:!1,labelTextItalic:!1,labelTextStrikethrough:!1,labelTextUnderline:!1,[`${x}borderPosition`]:`${x}borderAll`,[`${x}borderAll`]:{width:1,style:"solid",color:"#d9d9d9"},[`${x}borderTop`]:{...u.NULL_BORDER},[`${x}borderBottom`]:{...u.NULL_BORDER},[`${x}borderRight`]:{...u.NULL_BORDER},[`${x}borderLeft`]:{...u.NULL_BORDER},[te]:5,[O]:null,[E]:null,[A]:null,[P]:null}),[]),v=(0,d.useCallback)(()=>{l(r.setActiveSettingsTab(r.BUILD))},[l]),R=(0,d.useCallback)(()=>{const s=o.getFieldsValue(!0);if(m){const n=s[te]??0;o.setFieldsValue({[O]:n,[E]:n,[A]:n,[P]:n})}else{const n=s[O];n===s[E]&&n===s[A]&&n===s[P]?o.setFieldsValue({[te]:n}):o.setFieldsValue({[O]:null,[E]:null,[A]:null,[P]:null})}$(n=>!n)},[o,m]),C=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Remove"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:18,strokeWidth:a.iconStrokeWidth})})}),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Link"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"LinkOutlined",component:i.icons$LinkOutlined,size:18,strokeWidth:a.iconStrokeWidth})})})]}),T=(0,e.jsx)("div",{className:"form-editor-checkbox-panel__inner",children:(0,e.jsxs)(i.ui_kit$Form,{form:o,layout:"vertical",className:"element-controls form-editor-checkbox",autoComplete:"off",initialValues:g,children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"fieldHeading",label:t("Field heading"),children:(0,e.jsx)(i.ui_kit$Input.TextArea,{rows:2,placeholder:t("Title shown above the control"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"boundValue",label:(0,e.jsxs)("span",{className:"form-editor-checkbox__label-with-info",children:[t("Value"),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Stored or bound value for this field"),children:(0,e.jsx)("span",{className:"form-editor-checkbox__info-icon",children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"InfoCircleOutlined",component:i.icons$InfoCircleOutlined,size:12})})})]}),children:(0,e.jsx)(i.ui_kit$Select,{className:"form-editor-checkbox__full-width",placeholder:t("Enter value"),options:b,allowClear:!0,getPopupContainer:ae})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"checkboxLabel",label:t("Label next to checkbox"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Text beside the box"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"required",label:t("Required field")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"defaultState",label:t("Default value"),children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-checkbox__default-radios",children:[(0,e.jsx)(i.ui_kit$Radio,{value:"enabled",children:t("Enabled")}),(0,e.jsx)(i.ui_kit$Radio,{value:"disabled",children:t("Disabled")})]})}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"showHelperText",label:t("Helper text / tooltip")}),(0,e.jsx)(je,{}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-checkbox__section-divider"}),(0,e.jsx)(i.ui_kit$Button,{type:c?"primary":"default",block:!0,className:"form-editor-checkbox__more-btn",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"SettingOutlined",component:i.icons$SettingOutlined,size:16}),onClick:()=>_(s=>!s),children:t(c?"Fewer settings":"More settings")}),c&&(0,e.jsxs)("div",{className:"form-editor-checkbox__expanded",children:[(0,e.jsx)(ge,{}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-checkbox__section",title:t("Appearance"),children:(0,e.jsx)(be,{})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-checkbox__section",title:t("Label text style"),children:(0,e.jsx)(se,{namePrefix:"labelText",microLabel:t("Caption next to checkbox")})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-checkbox__section",title:t("Border radius"),collapsible:!0,defaultOpen:!0,children:(0,e.jsx)(i.ui_kit$FormBorderRadiusInputs,{namePrefix:x,typeOfForm:"desktop",oneBorderRadiusValue:m,onToggle:R,borderRadiusIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"RadiusUpleftOutlined",component:i.icons$RadiusUpleftOutlined,className:"selected-td-form__icon-radius"}),labels:{borderRadius:t("Border radius"),topLeft:t("Top left corner"),topRight:t("Top right corner"),bottomLeft:t("Bottom left corner"),bottomRight:t("Bottom right corner")}})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-checkbox__section",title:t("Border"),children:(0,e.jsx)(u.SelectedElementFormBorder,{form:o,namePrefix:x})})]})]})});return(0,e.jsxs)(i.ui_kit$PanelForm,{className:"form-editor-checkbox-panel",children:[(0,e.jsx)(i.ui_kit$PanelForm.Header,{onClose:v,closeIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Close",component:i.icons$Close,size:24,strokeWidth:a.iconStrokeWidth}),extra:C,children:(0,e.jsx)(i.ui_kit$PanelForm.HeaderTitle,{className:"form-editor-checkbox-panel__title",children:t("Checkbox")})}),(0,e.jsx)(i.ui_kit$PanelForm.Body,{className:"form-editor-checkbox-panel__body",padding:{horizontal:0,vertical:0},children:T})]})},k="dropdown_",oe=`${k}borderRadiusAll`,D=`${k}borderRadiusTopLeft`,V=`${k}borderRadiusTopRight`,z=`${k}borderRadiusBottomLeft`,W=`${k}borderRadiusBottomRight`,ve="Segoe UI, Helvetica Neue, Helvetica, Arial, sans-serif",ce=t=>t.closest(".email-pane__collapse-wrapper")||t.closest(".email-pane__content-col")||document.body;function de({namePrefix:t,microLabel:l}){const a=u.useGoogleFontsLoader(),{__:o}=r.useI18n(),c=r.useSelector(r.selectEmailSettings)?.usedColors;return(0,e.jsx)(i.ui_kit$FormTypographyFields,{namePrefix:t,microLabel:l,usedColors:c,loadGoogleFonts:a,getPopupContainer:ce,formatLabels:{bold:o("Strong ( Ctrl+B )"),italic:o("Italic ( Ctrl+I )"),strikethrough:o("Strikethrough ( Alt+Shift+5 )"),underline:o("Underline ( Ctrl+U )")},inputLabels:{fontSize:o("Font size"),lineHeight:o("Line height"),textColor:o("Text color")}})}de.propTypes={namePrefix:S.default.string.isRequired,microLabel:S.default.node.isRequired};function Re(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("triggerBackground"),a=i.ui_kit$Form.useWatch("listPanelBackground"),o=i.ui_kit$Form.useWatch("arrowColor");return(0,e.jsxs)("div",{className:"form-editor-dropdown__bg-preview","aria-hidden":!0,children:[(0,e.jsxs)("div",{className:"form-editor-dropdown__trigger-mock",style:{background:l},children:[(0,e.jsx)("span",{className:"form-editor-dropdown__trigger-mock-text",children:t("Text visible at the start")}),(0,e.jsx)("span",{className:"form-editor-dropdown__trigger-mock-arrow",style:{color:o},children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DownOutlined",component:i.icons$DownOutlined,size:14})})]}),(0,e.jsxs)("div",{className:"form-editor-dropdown__list-mock",style:{background:a},children:[(0,e.jsxs)("span",{className:"form-editor-dropdown__list-mock-item",children:[t("Value")," 1"]}),(0,e.jsxs)("span",{className:"form-editor-dropdown__list-mock-item",children:[t("Value")," 2"]})]})]})}var Ce=()=>{const{__:t}=r.useI18n(),l=r.useDispatch(),a=r.useAppConfig(),[o]=i.ui_kit$Form.useForm(),[c,_]=(0,d.useState)(!1),[m,$]=(0,d.useState)(!0),b=(0,d.useMemo)(()=>[{value:"v1",label:`${t("Value")} 1`},{value:"v2",label:`${t("Value")} 2`},{value:"custom",label:t("Custom")}],[t]),g=(0,d.useMemo)(()=>({placeholder:"",options:[{title:"",boundValue:void 0},{title:"",boundValue:void 0}],allowMultiple:!1,required:!1,triggerBackground:"#ffffff",listPanelBackground:"#ffffff",arrowColor:"rgba(0, 0, 0, 0.45)",listTextFontFamily:ve,listTextFontSize:14,listTextLineHeight:22,listTextColor:"#333333",listTextStrong:!1,listTextItalic:!1,listTextStrikethrough:!1,listTextUnderline:!1,[`${k}borderPosition`]:`${k}borderAll`,[`${k}borderAll`]:{width:1,style:"solid",color:"#d9d9d9"},[`${k}borderTop`]:{...u.NULL_BORDER},[`${k}borderBottom`]:{...u.NULL_BORDER},[`${k}borderRight`]:{...u.NULL_BORDER},[`${k}borderLeft`]:{...u.NULL_BORDER},[oe]:5,[D]:null,[V]:null,[z]:null,[W]:null}),[]),v=(0,d.useCallback)(()=>{l(r.setActiveSettingsTab(r.BUILD))},[l]),R=(0,d.useCallback)(()=>{const s=o.getFieldsValue(!0);if(m){const n=s[oe]??0;o.setFieldsValue({[D]:n,[V]:n,[z]:n,[W]:n})}else{const n=s[D];n===s[V]&&n===s[z]&&n===s[W]?o.setFieldsValue({[oe]:n}):o.setFieldsValue({[D]:null,[V]:null,[z]:null,[W]:null})}$(n=>!n)},[o,m]),C=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Remove"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:18,strokeWidth:a.iconStrokeWidth})})}),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Link"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"LinkOutlined",component:i.icons$LinkOutlined,size:18,strokeWidth:a.iconStrokeWidth})})})]}),T=(0,e.jsx)("div",{className:"form-editor-dropdown-list-panel__inner",children:(0,e.jsxs)(i.ui_kit$Form,{form:o,layout:"vertical",className:"element-controls form-editor-dropdown",autoComplete:"off",initialValues:g,children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"placeholder",label:t("Placeholder"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Text visible at the start"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$FormOptionsList,{name:"options",boundValueOptions:b,getPopupContainer:ce,labels:{itemTitle:s=>`${t("Value")} ${s}`,headingLabel:t("Heading"),valueLabel:t("Value"),valueTooltip:t("Stored or bound value for this option"),addLabel:t("Add value"),removeTooltip:t("Remove"),headingPlaceholder:t("Enter heading"),valuePlaceholder:t("Enter value")}}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"allowMultiple",label:t("Allow multiple selection")}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"required",label:t("Required field")}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-dropdown__section-divider"}),(0,e.jsx)(i.ui_kit$Button,{type:c?"primary":"default",block:!0,className:"form-editor-dropdown__more-btn",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"SettingOutlined",component:i.icons$SettingOutlined,size:16}),onClick:()=>_(s=>!s),children:t(c?"Fewer settings":"More settings")}),c&&(0,e.jsxs)("div",{className:"form-editor-dropdown__expanded",children:[(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-dropdown__section",title:t("Background"),children:(0,e.jsxs)(i.ui_kit$Space,{orientation:"vertical",size:20,className:"form-editor-dropdown__full-width",children:[(0,e.jsx)(i.ui_kit$FormColorField,{name:"triggerBackground",label:t("Closed field background")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"listPanelBackground",label:t("List panel background")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"arrowColor",label:t("Arrow color")}),(0,e.jsx)(Re,{})]})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-dropdown__section",title:t("List text style"),children:(0,e.jsx)(de,{namePrefix:"listText",microLabel:t("List item appearance")})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-dropdown__section",title:t("Border radius"),collapsible:!0,defaultOpen:!0,children:(0,e.jsx)(i.ui_kit$FormBorderRadiusInputs,{namePrefix:k,typeOfForm:"desktop",oneBorderRadiusValue:m,onToggle:R,borderRadiusIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"RadiusUpleftOutlined",component:i.icons$RadiusUpleftOutlined,className:"selected-td-form__icon-radius"}),labels:{borderRadius:t("Border radius"),topLeft:t("Top left corner"),topRight:t("Top right corner"),bottomLeft:t("Bottom left corner"),bottomRight:t("Bottom right corner")}})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-dropdown__section",title:t("Border"),children:(0,e.jsx)(u.SelectedElementFormBorder,{form:o,namePrefix:k})})]})]})});return(0,e.jsxs)(i.ui_kit$PanelForm,{className:"form-editor-dropdown-list-panel",children:[(0,e.jsx)(i.ui_kit$PanelForm.Header,{onClose:v,closeIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Close",component:i.icons$Close,size:24,strokeWidth:a.iconStrokeWidth}),extra:C,children:(0,e.jsx)(i.ui_kit$PanelForm.HeaderTitle,{className:"form-editor-dropdown-list-panel__title",children:t("Dropdown list")})}),(0,e.jsx)(i.ui_kit$PanelForm.Body,{className:"form-editor-dropdown-list-panel__body",padding:{horizontal:0,vertical:0},children:T})]})},F={TEXT:"text",EMAIL:"email",PHONE:"phone",NAME:"name",URL:"url",PASSWORD:"password"},p="inputField_",le=`${p}borderRadiusAll`,U=`${p}borderRadiusTopLeft`,H=`${p}borderRadiusTopRight`,M=`${p}borderRadiusBottomLeft`,G=`${p}borderRadiusBottomRight`,ue="Segoe UI, Helvetica Neue, Helvetica, Arial, sans-serif",q=t=>t.closest(".email-pane__collapse-wrapper")||t.closest(".email-pane__content-col")||document.body;function me({namePrefix:t,microLabel:l}){const a=u.useGoogleFontsLoader(),{__:o}=r.useI18n(),c=r.useSelector(r.selectEmailSettings)?.usedColors;return(0,e.jsx)(i.ui_kit$FormTypographyFields,{namePrefix:t,microLabel:l,usedColors:c,loadGoogleFonts:a,getPopupContainer:q,formatLabels:{bold:o("Strong ( Ctrl+B )"),italic:o("Italic ( Ctrl+I )"),strikethrough:o("Strikethrough ( Alt+Shift+5 )"),underline:o("Underline ( Ctrl+U )")},inputLabels:{fontSize:o("Font size"),lineHeight:o("Line height"),textColor:o("Text color")}})}function Te(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("fieldBackground"),a=i.ui_kit$Form.useWatch(`${p}borderAll`),o=i.ui_kit$Form.useWatch("placeholderTextColor"),c=i.ui_kit$Form.useWatch("inputValueTextColor"),_=a?.color??"#d9d9d9";return(0,e.jsx)("div",{className:"form-editor-input__bg-preview","aria-hidden":!0,children:(0,e.jsx)("div",{className:"form-editor-input__preview-panel",children:(0,e.jsxs)("div",{className:"form-editor-input__preview-input",style:{background:l,borderColor:_,color:c},children:[(0,e.jsx)("span",{className:"form-editor-input__preview-placeholder-bit",style:{color:o},children:t("Placeholder")}),(0,e.jsx)("span",{children:" · "}),(0,e.jsx)("span",{children:t("Value")})]})})})}function Se(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useFormInstance(),a=(0,d.useCallback)(()=>{const o=l.getFieldValue("paddingHorizontal");o!=null&&o!==""&&l.setFieldValue("fieldMinHeight",o)},[l]);return(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Internal padding"),children:(0,e.jsxs)("div",{className:"form-editor-input__padding-row",children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"paddingHorizontal",className:"form-editor-input__padding-field",children:(0,e.jsx)(i.ui_kit$DraggableInputNumber,{min:0,max:200,placeholder:"0",prefix:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"ColumnWidthOutlined",component:i.icons$ColumnWidthOutlined}),addonAfter:"px"})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"fieldMinHeight",className:"form-editor-input__padding-field",children:(0,e.jsx)(i.ui_kit$DraggableInputNumber,{min:0,max:200,placeholder:t("Height"),prefix:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"ColumnHeightOutlined",component:i.icons$ColumnHeightOutlined}),addonAfter:"px"})}),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Apply horizontal padding to height"),children:(0,e.jsx)(i.ui_kit$Button,{type:"default",className:"form-editor-input__padding-link-btn",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"BorderOuterOutlined",component:i.icons$BorderOuterOutlined,size:16}),onClick:a})})]})})}function Be(){const{__:t}=r.useI18n();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"form-editor-input__advanced-block",children:[(0,e.jsxs)("div",{className:"form-editor-input__advanced-switch-row",children:[(0,e.jsx)(i.ui_kit$Typography.Text,{className:"form-editor-input__advanced-switch-label",children:t("Field state appearance")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"customStylesForStates",valuePropName:"checked",noStyle:!0,children:(0,e.jsx)(i.ui_kit$Switch,{})})]}),(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-input__advanced-description",children:t("Use your own styles instead of defaults for states such as error, focus, and success.")})]}),(0,e.jsxs)("div",{className:"form-editor-input__advanced-block",children:[(0,e.jsxs)("div",{className:"form-editor-input__advanced-switch-row",children:[(0,e.jsx)(i.ui_kit$Typography.Text,{className:"form-editor-input__advanced-switch-label",children:t("High contrast mode")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"highContrastMode",valuePropName:"checked",noStyle:!0,children:(0,e.jsx)(i.ui_kit$Switch,{})})]}),(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-input__advanced-description",children:t("Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.")})]})]})}function Ie(){const{__:t}=r.useI18n(),l=r.useAppConfig().iconStrokeWidth;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Visibility"),children:(0,e.jsxs)("div",{className:"form-editor-input__visibility-row",children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"fieldVisibility",className:"form-editor-input__visibility-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-input__visibility-segment",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"always",children:t("Always")}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"desktop",title:t("Desktop"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DesktopOutlined",component:i.icons$DesktopOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"mobile",title:t("Mobile"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"MobileOutlined",component:i.icons$MobileOutlined,size:16,strokeWidth:l})})]})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"fieldDirection",className:"form-editor-input__direction-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-input__icon-toggle-group",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"ltr",title:t("Left to right"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"ArrowLeftOutlined",component:i.icons$ArrowLeftOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"rtl",title:t("Right to left"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"ArrowRightOutlined",component:i.icons$ArrowRightOutlined,size:16,strokeWidth:l})})]})})]})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Visibility in AMP"),children:(0,e.jsx)(i.ui_kit$Form.Item,{name:"ampVisibility",className:"form-editor-input__align-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-input__visibility-amp",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"always",children:t("Always")}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"amp",children:"AMP"}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"html",children:"HTML"})]})})})]})}function Ne(){const{__:t}=r.useI18n();return i.ui_kit$Form.useWatch("limitLength")?(0,e.jsx)(i.ui_kit$Form.Item,{name:"maxLength",label:t("Maximum length"),children:(0,e.jsx)(i.ui_kit$DraggableInputNumber,{min:1,max:9999,placeholder:t("Characters"),addonAfter:t("chars")})}):null}function ye(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("inputType"),a=(0,d.useMemo)(()=>[{value:"minLength8",label:t("Minimum length 8 characters")},{value:"lowercase",label:t("Lowercase letters (a-z)")},{value:"uppercase",label:t("Uppercase letters (A-Z)")},{value:"digits",label:t("Digits (0-9)")},{value:"special",label:t("Special characters")}],[t]),o=(0,d.useMemo)(()=>[{value:"https",label:"HTTPS"},{value:"http",label:"HTTP"},{value:"mailto",label:"mailto:"},{value:"ftp",label:"FTP"}],[]);return l?(0,e.jsxs)(e.Fragment,{children:[l===F.TEXT&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"limitLength",label:t("Character limit")}),(0,e.jsx)(Ne,{})]}),l===F.PHONE&&(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"countryCodeSelector",label:t("Country selector (flag+code)")}),l===F.URL&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"urlAutoPrependProtocol",label:t("Auto-prepend protocol on blur")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"allowedProtocols",label:t("Allowed protocols"),children:(0,e.jsx)(i.ui_kit$Select,{mode:"multiple",className:"form-editor-input__full-width",placeholder:t("Choose allowed protocols"),options:o,getPopupContainer:q,allowClear:!0})})]}),l===F.PASSWORD&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"showPasswordEye",label:t("Show eye icon")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"passwordComplexityRules",label:t("Complexity rules"),children:(0,e.jsx)(i.ui_kit$Select,{mode:"multiple",className:"form-editor-input__full-width",placeholder:t("Choose complexity rules"),options:a,getPopupContainer:q,allowClear:!0})})]})]}):null}var Le=()=>{const{__:t}=r.useI18n(),l=r.useDispatch(),a=r.useAppConfig(),[o]=i.ui_kit$Form.useForm(),[c,_]=(0,d.useState)(!1),[m,$]=(0,d.useState)(!0),b=(0,d.useMemo)(()=>[{value:F.TEXT,label:t("Text")},{value:F.EMAIL,label:t("Email")},{value:F.PHONE,label:t("Phone number")},{value:F.NAME,label:t("Name")},{value:F.URL,label:t("URL")},{value:F.PASSWORD,label:t("Password")}],[t]),g=(0,d.useMemo)(()=>({placeholder:"",required:!1,limitLength:!1,maxLength:100,hintText:"",countryCodeSelector:!1,urlAutoPrependProtocol:!1,allowedProtocols:[],showPasswordEye:!1,passwordComplexityRules:[],paddingHorizontal:16,customStylesForStates:!1,highContrastMode:!1,fieldVisibility:"always",fieldDirection:"ltr",ampVisibility:"always",fieldBackground:"#ffffff",inputValueTextFontFamily:ue,inputValueTextFontSize:14,inputValueTextLineHeight:22,inputValueTextColor:"#333333",inputValueTextStrong:!1,inputValueTextItalic:!1,inputValueTextStrikethrough:!1,inputValueTextUnderline:!1,placeholderTextFontFamily:ue,placeholderTextFontSize:14,placeholderTextLineHeight:22,placeholderTextColor:"rgba(0, 0, 0, 0.25)",placeholderTextStrong:!1,placeholderTextItalic:!1,placeholderTextStrikethrough:!1,placeholderTextUnderline:!1,[`${p}borderPosition`]:`${p}borderAll`,[`${p}borderAll`]:{width:1,style:"solid",color:"#d9d9d9"},[`${p}borderTop`]:{...u.NULL_BORDER},[`${p}borderBottom`]:{...u.NULL_BORDER},[`${p}borderRight`]:{...u.NULL_BORDER},[`${p}borderLeft`]:{...u.NULL_BORDER},[le]:5,[U]:null,[H]:null,[M]:null,[G]:null}),[]),v=(0,d.useCallback)(()=>{l(r.setActiveSettingsTab(r.BUILD))},[l]),R=(0,d.useCallback)(()=>{const s=o.getFieldsValue(!0);if(m){const n=s[le]??0;o.setFieldsValue({[U]:n,[H]:n,[M]:n,[G]:n})}else{const n=s[U];n===s[H]&&n===s[M]&&n===s[G]?o.setFieldsValue({[le]:n}):o.setFieldsValue({[U]:null,[H]:null,[M]:null,[G]:null})}$(n=>!n)},[o,m]),C=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Remove"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:18,strokeWidth:a.iconStrokeWidth})})}),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Link"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"LinkOutlined",component:i.icons$LinkOutlined,size:18,strokeWidth:a.iconStrokeWidth})})})]}),T=(0,e.jsx)("div",{className:"form-editor-input-panel__inner",children:(0,e.jsxs)(i.ui_kit$Form,{form:o,layout:"vertical",className:"element-controls form-editor-input",autoComplete:"off",initialValues:g,children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"inputType",label:t("Type"),children:(0,e.jsx)(i.ui_kit$Select,{className:"form-editor-input__full-width",placeholder:t("Choose input type"),options:b,allowClear:!0,getPopupContainer:q})}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"required",label:t("Field required")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"placeholder",label:t("Placeholder"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Text visible at the start"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"hintText",label:t("Hint text"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Come up with a hint"),allowClear:!0})}),(0,e.jsx)(ye,{}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-input__section-divider"}),(0,e.jsx)(i.ui_kit$Button,{type:c?"primary":"default",block:!0,className:"form-editor-input__more-btn",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"SettingOutlined",component:i.icons$SettingOutlined,size:16}),onClick:()=>_(s=>!s),children:t(c?"Fewer settings":"More settings")}),c&&(0,e.jsxs)("div",{className:"form-editor-input__expanded",children:[(0,e.jsx)(Se,{}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Size"),collapsible:!0,defaultOpen:!1,children:(0,e.jsx)(i.ui_kit$Form.Item,{name:"fieldMaxWidth",label:t("Max width"),children:(0,e.jsx)(i.ui_kit$DraggableInputNumber,{min:0,max:2e3,placeholder:t("Not set"),addonAfter:"px"})})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Background"),children:(0,e.jsx)(i.ui_kit$FormColorField,{name:"fieldBackground",label:t("Background color")})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Input field text"),children:(0,e.jsx)(me,{namePrefix:"inputValueText",microLabel:t("Font")})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Placeholder text"),collapsible:!0,defaultOpen:!0,children:(0,e.jsx)(me,{namePrefix:"placeholderText",microLabel:t("Font")})}),(0,e.jsx)(Te,{}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Border radius"),collapsible:!0,defaultOpen:!0,children:(0,e.jsx)(i.ui_kit$FormBorderRadiusInputs,{namePrefix:p,typeOfForm:"desktop",oneBorderRadiusValue:m,onToggle:R,borderRadiusIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"RadiusUpleftOutlined",component:i.icons$RadiusUpleftOutlined,className:"selected-td-form__icon-radius"}),labels:{borderRadius:t("Border radius"),topLeft:t("Top left corner"),topRight:t("Top right corner"),bottomLeft:t("Bottom left corner"),bottomRight:t("Bottom right corner")}})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Border"),children:(0,e.jsx)(u.SelectedElementFormBorder,{form:o,namePrefix:p})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-input__section",title:t("Accessibility"),children:(0,e.jsx)(Be,{})}),(0,e.jsx)(Ie,{})]})]})});return(0,e.jsxs)(i.ui_kit$PanelForm,{className:"form-editor-input-panel",children:[(0,e.jsx)(i.ui_kit$PanelForm.Header,{onClose:v,closeIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Close",component:i.icons$Close,size:24,strokeWidth:a.iconStrokeWidth}),extra:C,children:(0,e.jsx)(i.ui_kit$PanelForm.HeaderTitle,{className:"form-editor-input-panel__title",children:t("Input")})}),(0,e.jsx)(i.ui_kit$PanelForm.Body,{className:"form-editor-input-panel__body",padding:{horizontal:0,vertical:0},children:T})]})},f="radio_",re=`${f}borderRadiusAll`,Y=`${f}borderRadiusTopLeft`,X=`${f}borderRadiusTopRight`,K=`${f}borderRadiusBottomLeft`,Z=`${f}borderRadiusBottomRight`,we="Segoe UI, Helvetica Neue, Helvetica, Arial, sans-serif",pe=t=>t.closest(".email-pane__collapse-wrapper")||t.closest(".email-pane__content-col")||document.body;function _e({namePrefix:t,microLabel:l}){const a=u.useGoogleFontsLoader(),{__:o}=r.useI18n(),c=r.useSelector(r.selectEmailSettings)?.usedColors;return(0,e.jsx)(i.ui_kit$FormTypographyFields,{namePrefix:t,microLabel:l,usedColors:c,loadGoogleFonts:a,getPopupContainer:pe,formatLabels:{bold:o("Strong ( Ctrl+B )"),italic:o("Italic ( Ctrl+I )"),strikethrough:o("Strikethrough ( Alt+Shift+5 )"),underline:o("Underline ( Ctrl+U )")},inputLabels:{fontSize:o("Font size"),lineHeight:o("Line height"),textColor:o("Text color")}})}_e.propTypes={namePrefix:S.default.string.isRequired,microLabel:S.default.node.isRequired};function Oe(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("appearanceBackground"),a=i.ui_kit$Form.useWatch("appearanceStrokeColor"),o=i.ui_kit$Form.useWatch("appearanceDotColor");return(0,e.jsx)("div",{className:"form-editor-radio__bg-preview","aria-hidden":!0,children:(0,e.jsxs)("div",{className:"form-editor-radio__preview-panel",children:[(0,e.jsxs)("div",{className:"form-editor-radio__preview-row",style:{background:l},children:[(0,e.jsx)("span",{className:"form-editor-radio__preview-dot form-editor-radio__preview-dot--selected",style:{borderColor:a,background:o}}),(0,e.jsxs)("span",{className:"form-editor-radio__preview-label",children:[t("Value")," 1"]})]}),(0,e.jsxs)("div",{className:"form-editor-radio__preview-row",style:{background:l},children:[(0,e.jsx)("span",{className:"form-editor-radio__preview-dot",style:{borderColor:a,background:"transparent"}}),(0,e.jsxs)("span",{className:"form-editor-radio__preview-label",children:[t("Value")," 2"]})]})]})})}function Ee(){const{__:t}=r.useI18n(),l=i.ui_kit$Form.useWatch("markerShape");return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"markerShape",label:t("Marker shape"),children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-radio__shape-radios",children:[(0,e.jsx)(i.ui_kit$Radio,{value:"round",children:t("Round")}),(0,e.jsx)(i.ui_kit$Radio,{value:"custom",children:t("Custom icon")})]})}),l==="custom"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"customIconUrl",label:t("Icon URL"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:"https://",allowClear:!0})}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"customIconAlt",label:t("Icon description"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Accessibility text"),allowClear:!0})})]}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-radio__inner-section-divider"}),(0,e.jsxs)(i.ui_kit$Space,{orientation:"vertical",size:16,className:"form-editor-radio__full-width",children:[(0,e.jsx)(i.ui_kit$FormColorField,{name:"appearanceBackground",label:t("Background color")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"appearanceStrokeColor",label:t("Stroke color")}),(0,e.jsx)(i.ui_kit$FormColorField,{name:"appearanceDotColor",label:t("Dot color")})]}),(0,e.jsx)(Oe,{})]})}function Ae(){const{__:t}=r.useI18n(),l=r.useAppConfig().iconStrokeWidth;return(0,e.jsxs)(i.ui_kit$FormSection,{className:"form-editor-radio__section",title:t("Position in cell"),children:[(0,e.jsxs)(i.ui_kit$Row,{gutter:[12,16],className:"form-editor-radio__position-block",children:[(0,e.jsxs)(i.ui_kit$Col,{xs:24,sm:10,md:9,children:[(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-radio__micro-label",children:t("Layout")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"radioLayout",className:"form-editor-radio__layout-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-radio__icon-toggle-group",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"horizontal",title:t("Horizontal"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"MenuOutlined",component:i.icons$MenuOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"vertical",title:t("Vertical"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Column",component:i.icons$Column,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"grid",title:t("Grid"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Grid01Icon",component:i.icons$Grid01Icon,size:16,strokeWidth:l})})]})})]}),(0,e.jsx)(i.ui_kit$Col,{xs:24,sm:14,md:15,children:(0,e.jsx)(i.ui_kit$Form.Item,{name:"radioOptionGap",label:t("Spacing"),children:(0,e.jsx)(i.ui_kit$DraggableInputNumber,{min:0,max:120,placeholder:t("Spacing"),addonAfter:"px"})})})]}),(0,e.jsxs)("div",{className:"form-editor-radio__align-block",children:[(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-radio__micro-label",children:t("Horizontal alignment")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"alignHorizontal",className:"form-editor-radio__align-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-radio__icon-toggle-group",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"left",title:t("Align left"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignLeftOutlined",component:i.icons$AlignLeftOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"center",title:t("Align center"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignCenterOutlined",component:i.icons$AlignCenterOutlined,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"right",title:t("Align right"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignRightOutlined",component:i.icons$AlignRightOutlined,size:16,strokeWidth:l})})]})})]}),(0,e.jsxs)("div",{className:"form-editor-radio__align-block",children:[(0,e.jsx)(i.ui_kit$Typography.Text,{type:"secondary",className:"form-editor-radio__micro-label",children:t("Vertical alignment")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"alignVertical",className:"form-editor-radio__align-form-item",children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-radio__icon-toggle-group",children:[(0,e.jsx)(i.ui_kit$Radio.Button,{value:"top",title:t("Align top"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignVerticalTop",component:i.icons$AlignVerticalTop,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"middle",title:t("Align middle"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignVerticalCenter",component:i.icons$AlignVerticalCenter,size:16,strokeWidth:l})}),(0,e.jsx)(i.ui_kit$Radio.Button,{value:"bottom",title:t("Align bottom"),children:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"AlignVerticalBottom",component:i.icons$AlignVerticalBottom,size:16,strokeWidth:l})})]})})]})]})}var Pe=()=>{const{__:t}=r.useI18n(),l=r.useDispatch(),a=r.useAppConfig(),[o]=i.ui_kit$Form.useForm(),[c,_]=(0,d.useState)(!1),[m,$]=(0,d.useState)(!0),b=(0,d.useMemo)(()=>[{value:"v1",label:`${t("Value")} 1`},{value:"v2",label:`${t("Value")} 2`},{value:"custom",label:t("Custom")}],[t]),g=(0,d.useMemo)(()=>({placeholder:"",options:[{title:"",boundValue:void 0},{title:"",boundValue:void 0}],allowShuffle:!1,required:!1,defaultState:"enabled",radioLayout:"vertical",radioOptionGap:20,alignHorizontal:"left",alignVertical:"top",markerShape:"round",customIconUrl:"",customIconAlt:"",appearanceBackground:"#ffffff",appearanceStrokeColor:"#01bca6",appearanceDotColor:"#01bca6",labelTextFontFamily:we,labelTextFontSize:19,labelTextLineHeight:24,labelTextColor:"#333333",labelTextStrong:!1,labelTextItalic:!1,labelTextStrikethrough:!1,labelTextUnderline:!1,[`${f}borderPosition`]:`${f}borderAll`,[`${f}borderAll`]:{width:1,style:"solid",color:"#d9d9d9"},[`${f}borderTop`]:{...u.NULL_BORDER},[`${f}borderBottom`]:{...u.NULL_BORDER},[`${f}borderRight`]:{...u.NULL_BORDER},[`${f}borderLeft`]:{...u.NULL_BORDER},[re]:5,[Y]:null,[X]:null,[K]:null,[Z]:null}),[]),v=(0,d.useCallback)(()=>{l(r.setActiveSettingsTab(r.BUILD))},[l]),R=(0,d.useCallback)(()=>{const s=o.getFieldsValue(!0);if(m){const n=s[re]??0;o.setFieldsValue({[Y]:n,[X]:n,[K]:n,[Z]:n})}else{const n=s[Y];n===s[X]&&n===s[K]&&n===s[Z]?o.setFieldsValue({[re]:n}):o.setFieldsValue({[Y]:null,[X]:null,[K]:null,[Z]:null})}$(n=>!n)},[o,m]),C=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Remove"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"DeleteOutlined",component:i.icons$DeleteOutlined,size:18,strokeWidth:a.iconStrokeWidth})})}),(0,e.jsx)(i.ui_kit$Tooltip,{title:t("Link"),placement:"bottom",children:(0,e.jsx)(i.ui_kit$Button,{type:"text",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"LinkOutlined",component:i.icons$LinkOutlined,size:18,strokeWidth:a.iconStrokeWidth})})})]}),T=(0,e.jsx)("div",{className:"form-editor-radio-panel__inner",children:(0,e.jsxs)(i.ui_kit$Form,{form:o,layout:"vertical",className:"element-controls form-editor-radio",autoComplete:"off",initialValues:g,children:[(0,e.jsx)(i.ui_kit$Form.Item,{name:"placeholder",label:t("Placeholder"),children:(0,e.jsx)(i.ui_kit$Input,{placeholder:t("Text visible at the start"),allowClear:!0})}),(0,e.jsx)(i.ui_kit$FormOptionsList,{name:"options",boundValueOptions:b,getPopupContainer:pe,labels:{itemTitle:s=>`${t("Value")} ${s}`,headingLabel:t("Heading"),valueLabel:t("Value"),valueTooltip:t("Stored or bound value for this option"),addLabel:t("Add value"),removeTooltip:t("Remove"),headingPlaceholder:t("Enter heading"),valuePlaceholder:t("Enter value")}}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"allowShuffle",label:t("Shuffle options")}),(0,e.jsx)(i.ui_kit$FormSwitchRow,{name:"required",label:t("Required field")}),(0,e.jsx)(i.ui_kit$Form.Item,{name:"defaultState",label:t("Default value"),children:(0,e.jsxs)(i.ui_kit$Radio.Group,{className:"form-editor-radio__default-radios",children:[(0,e.jsx)(i.ui_kit$Radio,{value:"enabled",children:t("Enabled")}),(0,e.jsx)(i.ui_kit$Radio,{value:"disabled",children:t("Disabled")})]})}),(0,e.jsx)(i.ui_kit$Divider,{className:"form-editor-radio__section-divider"}),(0,e.jsx)(i.ui_kit$Button,{type:c?"primary":"default",block:!0,className:"form-editor-radio__more-btn",icon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"SettingOutlined",component:i.icons$SettingOutlined,size:16}),onClick:()=>_(s=>!s),children:t(c?"Fewer settings":"More settings")}),c&&(0,e.jsxs)("div",{className:"form-editor-radio__expanded",children:[(0,e.jsx)(Ae,{}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-radio__section",title:t("Appearance"),children:(0,e.jsx)(Ee,{})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-radio__section",title:t("Label text style"),children:(0,e.jsx)(_e,{namePrefix:"labelText",microLabel:t("Caption next to options")})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-radio__section",title:t("Border radius"),collapsible:!0,defaultOpen:!0,children:(0,e.jsx)(i.ui_kit$FormBorderRadiusInputs,{namePrefix:f,typeOfForm:"desktop",oneBorderRadiusValue:m,onToggle:R,borderRadiusIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"RadiusUpleftOutlined",component:i.icons$RadiusUpleftOutlined,className:"selected-td-form__icon-radius"}),labels:{borderRadius:t("Border radius"),topLeft:t("Top left corner"),topRight:t("Top right corner"),bottomLeft:t("Bottom left corner"),bottomRight:t("Bottom right corner")}})}),(0,e.jsx)(i.ui_kit$FormSection,{className:"form-editor-radio__section",title:t("Border"),children:(0,e.jsx)(u.SelectedElementFormBorder,{form:o,namePrefix:f})})]})]})});return(0,e.jsxs)(i.ui_kit$PanelForm,{className:"form-editor-radio-panel",children:[(0,e.jsx)(i.ui_kit$PanelForm.Header,{onClose:v,closeIcon:(0,e.jsx)(i.ui_kit$EmIcons,{icon:"Close",component:i.icons$Close,size:24,strokeWidth:a.iconStrokeWidth}),extra:C,children:(0,e.jsx)(i.ui_kit$PanelForm.HeaderTitle,{className:"form-editor-radio-panel__title",children:t("Radio button")})}),(0,e.jsx)(i.ui_kit$PanelForm.Body,{className:"form-editor-radio-panel__body",padding:{horizontal:0,vertical:0},children:T})]})};I.FormEditorCalendarPanel=ke,I.FormEditorCheckboxPanel=Fe,I.FormEditorDropdownListPanel=Ce,I.FormEditorInputPanel=Le,I.FormEditorRadioPanel=Pe});
|
|
3
|
+
|
|
4
|
+
__useblocks__.define("static/core/36f4021e.js",["require","exports","module","static/core/2ff39ddf.js","static/core/41d2fa95.js","static/core/caadce3e.js","vite/preload-helper"],function(d,v,W){const D=d("./2ff39ddf.js"),n=d("./41d2fa95.js"),p=d("./caadce3e.js");let U=d("vite/preload-helper");var P=D.__exportAll({createDocumentProcessor:()=>R,createFileProcessor:()=>M,ensureFileExtension:()=>b,extractUploadResult:()=>E,fetchFileData:()=>I,getExt:()=>j,handleUploadResult:()=>A,importEmail:()=>C,importHtml:()=>_,importZip:()=>N,splitFileName:()=>$,uploadFile:()=>n.uploadFile});function j(e){const t=e.split(".");return t[t.length-1].toLowerCase()}function $(e){const t=e.split(".");return t[t.length-1].toLowerCase()}var y="index.html";function w(e,t){return e.find(r=>r.toLowerCase().endsWith(t))}async function N(e,t,r){const a=await n.readZip(e),l=Object.keys(a),i=a[y]&&y||w(l,y)||w(l,".html")||w(l,".htm");if(i){const u=i.split("/"),c=document.location.pathname.split("/"),s=document.location.origin+c.slice(0,c.length-u.length).join("/")+"/",{html:x,hasBrowserExtensionArtifacts:f}=n.prepareEmailHtmlForEditor(n.zipEntryToText(a[i])),h=u.slice(0,u.length-1).join("/");return{html:await p.changeHtml(x,async g=>{const m=g.document;await p.replaceImagesInDocument(m,async o=>{o=o.replace("\\","/"),o.startsWith(".")&&(o=o.substring(1)),o.startsWith("/")&&(o=o.substring(1)),o.startsWith(s)&&(o=o.substring(s.length)),h&&!o.match("^(ht|f)tp(s?)://")&&(o=`${h}/${o}`);const F=a[o];if(F)return t(n.zipEntryToBlob(F),o);const H=p.getFileNameWithExt(o);return t(o,H)}),r&&r(g)}),hasBrowserExtensionArtifacts:f}}}async function _(e,t,r){const{html:a,hasBrowserExtensionArtifacts:l}=n.prepareEmailHtmlForEditor(e);return{html:await p.changeHtml(a,async i=>{const u=i.document;await p.replaceImagesInDocument(u,async c=>{c=c.replace("\\","/");const s=p.getFileNameWithExt(c);return t(c,s)}),r&&r(i)}),hasBrowserExtensionArtifacts:l}}async function C(e,t,r){if(e)switch(j(e.name)){case"zip":return N(e,t,r);case"eml":{const a=await e.arrayBuffer(),{default:l}=await(0,U.__vitePreload)(async()=>{const{default:u}=await Promise.resolve().then(()=>d("./6561b34a.js"));return{default:u}},void 0,{}.url),i=(await l.parse(a)).html??void 0;if(typeof i>"u")throw new Error("Eml does not contain text/html");return _(i,t,r)}default:return _(await e.text(),t,r)}}async function I(e,t){if(typeof e!="string")return e;try{const r=await t({url:n.normalizeUrl(e)});return r?.data,r?.data||null}catch{return null}}async function b(e,t){if(!e||typeof e!="string")return`default.${await n.getMimeExtension(t)||"bin"}`;if(e.split(".").length<2){const r=await n.getMimeExtension(t);if(r)return`${e}.${r}`}return e}function E(e){if(e&&typeof e=="object"&&!Array.isArray(e)&&"code"in e&&"message"in e&&e.data){if(e.data.status===400)return{file_url:null,error:{code:e.code,message:e.message,status:e.data.status}};if(e.data.file_url)return{file_url:e.data.file_url,error:null}}if(Array.isArray(e)&&e.length>0){const t=e[0];if(t&&typeof t=="object"){if("code"in t&&"message"in t&&t.data?.status===400)return{file_url:null,error:{code:t.code,message:t.message,status:t.data.status}};if("file_url"in t&&t.file_url)return{file_url:t.file_url,error:null}}}if(e&&typeof e=="object"&&!Array.isArray(e)&&0 in e){if(e.data?.status===400)return{file_url:null,error:{status:e.data.status}};if(e[0]?.file_url)return{file_url:e[0].file_url,error:null}}return{file_url:null,error:null}}function A(e,t){if(!e||e.error)return typeof t=="string"?t:"";const r=E(e.data);return r.error?typeof t=="string"?t:"":r.file_url?r.file_url:typeof t=="string"?t:""}var M=(e,t,r,a,l)=>{const{maxSizeMB:i,maxWidthOrHeight:u}=n.resolveImageCompressionLimits(l),c=n.getBrowserImageCompressionLibUrl();return async(s,x)=>{try{const f=await I(s,e);if(!f)return typeof s=="string"?s:"";const h=await b(x,f.type),g=f.type?.trim()||n.inferImageMimeFromFileName(h)||"";let m=new File([f],h.toLowerCase(),{type:g});if(n.isAllowedImageUploadFile(m)){const o=m.type?.trim()||n.inferImageMimeFromFileName(m.name)||f.type||"";try{m=await n.prepareImageForUpload(m,{maxSizeMB:i,maxWidthOrHeight:u,mimeType:o||f.type,fileName:m.name,libURL:c,enableCompression:n.shouldEnableImageCompression(l,o),convertSvgToPng:!0})}catch{}}return A(await t({user_id:r.id,folder:a.id,file:m}),s)}catch{return typeof s=="string"?s:""}}},R=e=>t=>{const r=t.document;r.title=(r.querySelector("title")?.textContent??"").replace(/\s+/g," ").trim()||p.getFileNameAndExt(e.name)[0]};Object.defineProperty(v,"extractUploadResult",{enumerable:!0,get:function(){return E}}),Object.defineProperty(v,"import_exports",{enumerable:!0,get:function(){return P}})});
|
|
5
|
+
|
|
6
|
+
__useblocks__.define("static/core/5ae1e3a3.js",["require","exports","module","static/core/2ff39ddf.js","static/core/41d2fa95.js","react","react/jsx-runtime","__delivery__/libs"],function(t,e,S){const i=t("./2ff39ddf.js"),o=t("./41d2fa95.js");let r=t("react");r=i.__toESM(r);let l=t("react/jsx-runtime"),d=t("__delivery__/libs");function n(){return o.usePlanFeatureGate("google_fonts").isLocked?void 0:o.loadGFonts}var u=c=>{const{form:g,namePrefix:s="",typeOfForm:I="desktop"}=c,E=o.useSelector(o.selectEmailSettings).usedColors;return(0,l.jsx)(d.ui_kit$FormBorderInputs,{form:g,namePrefix:s,typeOfForm:I,usedColors:E})},b={paddingTop:"top",paddingLeft:"left",paddingRight:"right",paddingBottom:"bottom",mobilePaddingTop:"top",mobilePaddingLeft:"left",mobilePaddingRight:"right",mobilePaddingBottom:"bottom"},m={borderRadiusAll:"all",borderRadiusTopLeft:"topLeft",borderRadiusBottomLeft:"bottomLeft",borderRadiusTopRight:"topRight",borderRadiusBottomRight:"bottomRight"},R={mobileBorderRadiusAll:"all",mobileBorderRadiusTopLeft:"topLeft",mobileBorderRadiusBottomLeft:"bottomLeft",mobileBorderRadiusTopRight:"topRight",mobileBorderRadiusBottomRight:"bottomRight"},a={all:"borderAll",top:"borderTop",right:"borderRight",bottom:"borderBottom",left:"borderLeft"},O={all:"mobileBorderAll",top:"mobileBorderTop",right:"mobileBorderRight",bottom:"mobileBorderBottom",left:"mobileBorderLeft"},_={width:null,style:null,color:null},B={borderAll:"all",borderTop:"top",borderRight:"right",borderBottom:"bottom",borderLeft:"left"},f={mobileBorderAll:"all",mobileBorderTop:"top",mobileBorderRight:"right",mobileBorderBottom:"bottom",mobileBorderLeft:"left"};Object.defineProperty(e,"BORDER_POSITIONS",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"BORDER_RADIUS_POSITION",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"MOBILE_BORDER_POSITIONS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"MOBILE_BORDER_RADIUS_POSITION",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"MOBILE_REVERSE_BORDER_POSITIONS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"NULL_BORDER",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"PADDING_POSITION",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"REVERSE_BORDER_POSITIONS",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"SelectedElementFormBorder",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"useGoogleFontsLoader",{enumerable:!0,get:function(){return n}})});
|
|
7
|
+
|
|
8
|
+
(function(){try{if(typeof document<"u"){var t='.blocks-app .upload-bg-image{margin-bottom:calc(var(--ub-formItemMarginBottomXS) * 1px)}.blocks-app .upload-bg-image__inner-wrap{border:calc(var(--ub-borderWidth) * 1px) solid var(--ub-colorFillSecondaryDarken);border-radius:calc(var(--ub-borderRadius) * 1px);cursor:pointer;background-color:var(--ub-colorBgContainer);justify-content:space-between;align-items:center;transition:all .2s linear .2s;display:flex}.blocks-app .upload-bg-image__inner-wrap:hover{border-color:var(--ub-borderColorHover)}.blocks-app .upload-bg-image__uploader{width:calc((var(--ub-formControlHeight) - var(--ub-borderWidth) * 2 + 1) * 1px);height:calc((var(--ub-formControlHeight) - var(--ub-borderWidth) * 2) * 1px);border-radius:calc(var(--ub-borderRadius) * .8px);border:none;border-right:1px solid var(--ub-colorFillSecondaryDarken);flex-shrink:0;margin-right:10px;overflow:hidden}.blocks-app .upload-bg-image__uploader-content{background:0 0;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;font-size:11px;display:flex}.blocks-app .upload-bg-image__uploader-content-inner{width:inherit;height:inherit;position:relative}.blocks-app .upload-bg-image__uploader-img-wrap{width:inherit;height:inherit;z-index:1;border:none;position:absolute;overflow:hidden}.blocks-app .upload-bg-image__uploader-img-wrap:after{opacity:0;content:"";transition:opacity .3s;position:absolute;inset:0}.blocks-app .upload-bg-image__uploader-content:hover .upload-bg-image__uploader-img-wrap:after{opacity:1}.blocks-app .upload-bg-image .upload-bg-image__empty{border-top:2px solid var(--ub-colorError);z-index:2;width:27px;position:absolute;top:16px;left:3px;transform:rotate(-45deg)}.blocks-app .upload-bg-image .inputGroup{flex-direction:column;width:100%;display:flex}.blocks-app .upload-bg-image .image-size{color:var(--ub-colorTextTertiary);padding-right:15px;font-size:12px}.blocks-app .upload-bg-image .image-empty-text,.blocks-app .upload-bg-image .image-size-splitter{color:var(--ub-colorTextQuaternary)}.blocks-app .upload-bg-image__edit,.blocks-app .upload-bg-image__edit-menu{color:var(--ub-colorLink);right:calc((var(--ub-borderWidth) + 2) * 1px);padding:6px;line-height:1;position:absolute}.blocks-app .upload-bg-image__edit{right:calc((var(--ub-borderWidth) + 32) * 1px);position:absolute}.blocks-app .upload-bg-image__uploader-icons-wrap{z-index:2;width:inherit;height:inherit;opacity:1;cursor:pointer;justify-content:center;align-items:center;transition:opacity .3s;display:flex;position:relative}.blocks-app .upload-bg-image__uploader-content:hover .upload-bg-image__uploader-icons-wrap{opacity:.85}.blocks-app .upload-bg-image__uploader-icons-wrap-upload{z-index:1;width:inherit;height:inherit;opacity:.8;cursor:pointer;justify-content:center;align-items:center;transition:opacity .3s;display:flex;position:relative}.blocks-app .upload-bg-image__uploader-content:hover .upload-bg-image__uploader-icons-wrap-upload{opacity:.85}.blocks-app .upload-bg-image__uploader-icons-wrap-upload .upload-bg-image__uploader-content:empty{background-color:var(--ub-colorFillSecondary);border-radius:calc(var(--ub-borderRadius) * 1px)}.blocks-app .upload-bg-image__uploader-link,.blocks-app .upload-bg-image__uploader-link:hover{color:#fff}.blocks-app .upload-bg-image__uploader-icon{color:#fff;margin:0 3px;font-size:14px}.blocks-app .upload-bg-image__uploader-img{object-fit:cover;width:100%;height:100%;display:block!important}.blocks-app .upload-bg-image__uploader-img-placeholder{width:100%;height:100%;display:block}.blocks-app .upload-bg-image__uploader-icon-btn{cursor:pointer;background:0 0;border:0;margin:0;padding:0}.blocks-app .upload-bg-image__input{border-color:var(--ub-colorFillSecondaryDarken)}.blocks-app .upload-bg-image__uploader .ant-upload-select{cursor:pointer;width:100%;height:100%;display:block}.blocks-app .upload-bg-image__uploader .ant-upload-select .ant-upload{width:100%;height:100%;display:block}.dark .blocks-app .upload-bg-image__uploader{border-right:1px solid var(--ub-colorBorder)}.blocks-app .countdown-color .color-picker-input__picker-holder{z-index:auto;left:auto;right:-10px}.blocks-app .email-pane .box-shadow-control .ant-collapse-panel,.blocks-app .email-pane .border-control .ant-collapse-panel,.blocks-app .box-shadow-control.ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body,.blocks-app .border-control.ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body{overflow:visible}.blocks-app .selected-image-form_busy{position:relative}.blocks-app .selected-image-form__loader{z-index:5;background-color:color-mix(in srgb, var(--ub-colorBgContainer) 60%, transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);box-shadow:28px 0 0 0 color-mix(in srgb, var(--ub-colorBgContainer) 60%, transparent), -28px 0 0 0 color-mix(in srgb, var(--ub-colorBgContainer) 60%, transparent);position:absolute;inset:0}.blocks-app .selected-image-form__loader-body{flex-direction:column;justify-content:center;align-items:center;gap:16px;height:100%;display:flex;position:absolute;top:0;left:0;right:0}.blocks-app .selected-image-form__loader-title{color:var(--ub-colorTextSecondary);text-align:center;padding:0 24px;font-size:13px}.blocks-app .selected-text-common-form__border-radio{position:relative}.blocks-app .selected-text-common-form__border-radio:after{content:"·";border:3px solid var(--ub-colorPrimary);border-radius:50%;font-size:0;line-height:0;position:absolute;top:2px;right:2px}.blocks-app .selected-text-common-form__border-col{margin-top:22px;margin-bottom:10px}@media (width<=1840px){.blocks-app .selected-text-common-form__border-col{margin-top:0}}.blocks-app .selected-text-common-form__border-item.ant-form-item .ant-row{flex-direction:row;align-items:center}.blocks-app .selected-text-common-form__border-item.ant-form-item .ant-row .ant-col.ant-form-item-label{white-space:nowrap;padding-top:6px}.blocks-app .selected-text-common-form__padding-input{max-width:46px;margin-bottom:0}.blocks-app .selected-text-common-form__padding-input input{text-align:center;padding:4px 8px}.blocks-app .selected-text-common-form__padding-input .ant-input-number-focused input{text-align:left}.blocks-app .selected-text-common-form__button--active,.blocks-app .selected-text-common-form__button--active:focus{color:#40a9ff;border-color:#40a9ff}.blocks-app .selected-text-common-form__br-input{margin-bottom:10px}.blocks-app .selected-text-common-form__tooltip{margin-left:4px}.blocks-app .selected-text-common-form__icon-radius{width:16px;height:100%}.blocks-app .selected-text-common-form__block{margin-bottom:24px}.blocks-app .selected-text-common-form__button_style{padding-left:10px;padding-right:10px;transition:none}.blocks-app .selected-text-common-form__format-toolbar{flex-wrap:wrap;align-items:flex-start;gap:10px;display:flex}.blocks-app .selected-text-common-form__format-toolbar .ant-form-item{margin-bottom:0}.blocks-app .ant-app .bullet-type .ant-select-selector{padding-left:5px}.blocks-app .selected_text_common_form_mobile .ant-form-item{margin:0}.blocks-app .selected_text_common_form_mobile .ant-input-number-affix-wrapper{padding-inline-start:7px}.blocks-app .selected_text_common_form_mobile .ant-select-single:not(.ant-select-customize-input) .ant-select-selector,.blocks-app .selected_text_common_form_mobile .ant-input-number-group .ant-input-number-group-addon{padding:0 7px}.blocks-app .selected_text_common_form_mobile .ant-input-number .ant-input-number-handler-wrap{width:16px}.blocks-app .selected_text_common_form_mobile .ant-select .ant-select-arrow{inset-inline-end:7px;font-size:10px!important}.blocks-app .selected_text_common_form_mobile .ant-divider-vertical{height:46px;top:0}.blocks-app .selected_text_common_form_mobile .selected_text_common_form_mobile__group{padding:6px 0}.blocks-app .selected_text_common_form_mobile .selected-td-form__button{background:var(--ub-colorFillSecondary);width:34px;height:34px;border:1px solid #0000!important}.blocks-app .selected_text_common_form_mobile .ant-btn-default:not(:disabled,.ant-btn-disabled,.email-pane__content-col .selected-td-form__button--active):hover{background:var(--ub-colorFillSecondaryDarken);color:inherit;border-color:#0000}.blocks-app .selected_text_common_form_mobile .selected-td-form__button--active{background:var(--ub-colorPrimaryBg);color:var(--ub-colorPrimary);border-color:#0000}.blocks-app .selected_text_common_form_mobile .selected-td-form__button--active:hover{background:var(--ub-colorPrimaryBgHover)!important;color:var(--ub-colorPrimaryTextHover)!important}.blocks-app .selected_text_common_form_mobile .color-picker-input{width:34px;height:34px}.blocks-app .selected_text_common_form_mobile .color-picker-input .ant-input-affix-wrapper{display:none}.blocks-app .selected_text_common_form_mobile .color-picker-input__control-wrap .ant-color-picker-trigger{border:1px solid var(--ub-colorFillSecondaryDarken);width:34px;height:34px;top:0;left:0}.blocks-app .selected_text_common_form_mobile .ant-radio-button-wrapper{background:var(--ub-colorFillSecondary);height:34px;padding:0 9px;border:1px solid #0000!important}.blocks-app .selected_text_common_form_mobile .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover{color:inherit;background:var(--ub-colorFillSecondaryDarken)}.blocks-app .selected_text_common_form_mobile .ant-radio-button-wrapper.ant-radio-button-wrapper-checked{background:var(--ub-colorPrimaryBg);color:var(--ub-colorPrimary)}.blocks-app .selected_text_common_form_mobile .ant-radio-button-wrapper.ant-radio-button-wrapper-checked:hover{background:var(--ub-colorPrimaryBgHover);color:var(--ub-colorPrimaryTextHover)}.blocks-app .selected_text_common_form_mobile .codemode-textalign-dropdown{background-color:var(--ub-colorBgContainer);border-radius:calc(var(--ub-borderRadius) * 1px);box-shadow:var(--ub-boxShadowSecondary);padding:6px}.blocks-app .mobile-background-image-field .upload-bg-image{margin-bottom:0}.blocks-app .selected_element_vindent_values{font-size:12px}.blocks-app .selected_element_vindent_values span{cursor:pointer;margin-right:10px}.blocks-app .selected_element_vindent_values span:hover{color:#40a9ff}.blocks-app .selected-td-form__border-side-wrapper{display:inline-flex;position:relative}.blocks-app .selected-td-form__border-side-wrapper label{border-radius:calc(var(--ub-borderRadius) * 1px)}.blocks-app .selected-td-form__border-side-wrapper:hover .selected-td-form__border-side-clear{opacity:1}.blocks-app .selected-td-form__border-side-clear{z-index:1;opacity:0;cursor:pointer;color:var(--ub-colorTextSecondary);background-color:var(--ub-colorBgLayout);border-radius:50%;width:20px;height:20px;transition:opacity .15s;position:absolute;top:-6px;right:-4px}.blocks-app .selected-td-form__border-side-clear:hover{color:var(--ub-colorError)}.blocks-app .selected-td-form__border-radio:after{content:"·";border:3px solid var(--ub-colorPrimary);border-radius:50%;font-size:0;line-height:0;position:absolute;top:2px;right:2px}@media (width<=1840px){.blocks-app .selected-td-form__border-col{margin-top:0}}.blocks-app .selected-td-form__border-item.ant-form-item .ant-row{flex-direction:row;align-items:center}.blocks-app .selected-td-form__border-item.ant-form-item .ant-row .ant-col.ant-form-item-label{white-space:nowrap;padding-top:6px}.blocks-app .selected-td-form__padding-input input{text-align:center;padding:4px 8px}.blocks-app .selected-td-form__padding-input .ant-input-number-focused input{text-align:left}.blocks-app .selected-td-form__button--active,.blocks-app .selected-td-form__button--active:focus{color:#40a9ff;border-color:#40a9ff}.blocks-app .selected-td-form__tooltip{margin-left:4px}.blocks-app .selected-td-form__icon-radius{flex-shrink:0;justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}.blocks-app .selected-td-form__button_style{padding-left:10px;padding-right:10px;transition:none}.blocks-app .selected-td-form__border-radio{position:relative}.blocks-app .selected-td-form__border-radio:after{content:"·";border:3px solid var(--ub-colorPrimary);border-radius:50%;font-size:0;line-height:0;position:absolute;top:2px;left:2px;right:auto}.blocks-app .selected-td-form__border-col{margin-top:0;margin-bottom:0}@media (width<=1840px){.blocks-app .selected-td-form__border-col{margin-top:0}}.blocks-app .selected-td-form__border-item.ant-form-item .ant-col.ant-form-item-label{white-space:nowrap;padding-top:6px}.blocks-app .selected-td-form__padding-input{max-width:50px;margin-bottom:0}.blocks-app .selected-td-form__padding-input input{padding:4px 8px}.blocks-app .selected-td-form__br-input{margin-bottom:10px}.blocks-app .selected-td-form__tooltip{vertical-align:baseline;margin-left:4px}.blocks-app .selected-td-form__icon-radius{width:16px;height:100%}.blocks-app .selected-td-form__block{margin-bottom:24px}.blocks-app .carousel__slide{background-color:var(--ub-colorFillQuaternary);border-radius:calc(var(--ub-borderRadius) * 1px);margin-bottom:calc(var(--ub-formItemMarginBottomXS) * 1px);border:calc(var(--ub-borderWidth) * 1px) solid var(--ub-colorFillSecondaryDarken);padding:10px}.blocks-app .email-pane .box-shadow-control .ant-collapse-panel,.blocks-app .email-pane .border-control .ant-collapse-panel,.blocks-app .box-shadow-control.ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body,.blocks-app .border-control.ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body{overflow:visible}.blocks-app .selected-image-form__add-title{margin-top:-15px;margin-bottom:30px}.blocks-app .selected-image-form__add-title span{cursor:pointer}.blocks-app .selected-image-form__add-title span:hover{color:#40a9ff}.blocks-app .email-pane .box-shadow-control .ant-collapse-panel,.blocks-app .email-pane .border-control .ant-collapse-panel,.blocks-app .box-shadow-control.ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body,.blocks-app .border-control.ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body{overflow:visible}.blocks-app .selected-social-form{box-sizing:border-box;min-width:0;padding:0 0 16px}.blocks-app .selected-social-form .selected-social-form__form{padding:0 0 8px}.blocks-app .selected-social-form .selected-social-form__align-block{margin-bottom:16px}.blocks-app .selected-social-form .selected-social-form__align-block .ant-form-item,.blocks-app .selected-social-form .selected-social-form__section{margin-bottom:0}.blocks-app .selected-social-form .selected-social-form__section--bordered{border-top:1px solid var(--ub-colorBorderSecondary,#f0f0f0);margin-top:16px;padding-top:16px}.blocks-app .selected-social-form .selected-social-form__section-title{color:var(--ub-colorText,#000000e0);margin:0 0 16px;font-size:14px;font-weight:400;line-height:1.2}.blocks-app .selected-social-form .selected-social-form__field-row{margin-bottom:0}.blocks-app .selected-social-form .selected-social-form__field-icon{color:var(--ub-colorTextSecondary,#8c8c8c)}.blocks-app .selected-social-form .selected-social-form__input-full{width:100%}.blocks-app .selected-social-form .selected-social-form__items{flex-direction:column;gap:6px;margin-bottom:6px;display:flex}.blocks-app .selected-social-form .selected-social-form__card{border:1px solid var(--ub-colorBorderSecondary,#f0f0f0);background:var(--ub-colorFillTertiary,#f8f8f8);border-radius:6px;padding:12px;transition:border-color .15s,box-shadow .15s,opacity .15s}.blocks-app .selected-social-form .selected-social-form__card--dragging{opacity:.72}.blocks-app .selected-social-form .selected-social-form__card--drag-over{border-color:var(--ub-colorPrimary);box-shadow:0 0 0 1px var(--ub-colorPrimary)}.blocks-app .selected-social-form .selected-social-form__card-head{justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px;display:flex}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__card-head-main{flex:auto;align-items:center;gap:8px;min-width:0;display:flex}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__drag-handle{width:24px;height:24px;color:var(--ub-colorTextSecondary,#8c8c8c);cursor:grab;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;margin:0;padding:0;transition:color .15s,background-color .15s;display:inline-flex}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__drag-handle:hover{color:var(--ub-colorText,#000000e0);background:var(--ub-colorFillSecondary,#f0f0f0)}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__drag-handle:active{cursor:grabbing}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__drag-handle:focus-visible{outline:2px solid var(--ub-colorPrimary);outline-offset:1px}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__drag-handle .anticon{font-size:14px;transform:rotate(90deg)}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__card-head-remove.ant-btn{box-sizing:border-box;aspect-ratio:1;width:24px;min-width:24px;max-width:24px;height:24px;min-height:24px;max-height:24px;color:var(--ub-colorTextSecondary,#8c8c8c);background:0 0;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;padding:0;line-height:1;transition:color .15s,background-color .15s;display:inline-flex}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__card-head-remove.ant-btn .anticon{justify-content:center;align-items:center;line-height:0;display:inline-flex}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__card-head-remove.ant-btn svg{width:18px;height:18px;display:block}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__card-head-remove.ant-btn:hover{color:var(--ub-colorText,#000000e0);background:var(--ub-colorFillSecondary,#f0f0f0)}.blocks-app .selected-social-form .selected-social-form__card-head .selected-social-form__card-head-remove.ant-btn:focus-visible{outline:2px solid var(--ub-colorPrimary);outline-offset:1px}.blocks-app .selected-social-form .selected-social-form__card-title{min-width:0;color:var(--ub-colorText,#000000e0);flex:auto;font-size:14px;font-weight:300;line-height:1.2}.blocks-app .selected-social-form .selected-social-form__card-field.ant-row{margin-bottom:8px}.blocks-app .selected-social-form .selected-social-form__card-field.ant-row:last-child{margin-bottom:0}.blocks-app .selected-social-form .selected-social-form__bg-color-row{width:100%;margin-bottom:0}.blocks-app .selected-social-form .selected-social-form__bg-color-row .ant-col .ant-form-item{max-width:none;margin-bottom:0}.blocks-app .selected-social-form .selected-social-form__bg-color-row .ant-form-item-control-input-content,.blocks-app .selected-social-form .selected-social-form__meta-block{width:100%}.blocks-app .selected-social-form .selected-social-form__meta-toggle-row{flex-wrap:wrap;align-items:center;display:flex}.blocks-app .selected-social-form .selected-social-form__meta-fields.is-hidden,.blocks-app .selected-social-form .selected-social-form__card-field.is-hidden{display:none}.blocks-app .selected-social-form .selected-social-form__meta-fields{flex-direction:column;gap:6px;width:100%;display:flex}.blocks-app .selected-social-form .selected-social-form__meta-fields .ant-form-item{margin-bottom:0}.blocks-app .selected-social-form .selected-social-form__meta-fields .ant-form-item-control-input-content{width:100%}.blocks-app .selected-social-form .selected-social-form__platform-row{align-items:flex-start;gap:8px;width:100%;margin-bottom:8px;display:flex}.blocks-app .selected-social-form .selected-social-form__platform-field{flex:auto;min-width:0;margin-bottom:0!important}.blocks-app .selected-social-form .selected-social-form__platform-edit.ant-btn{box-sizing:border-box;width:calc(var(--ub-formControlHeight) * 1px);min-width:calc(var(--ub-formControlHeight) * 1px);max-width:calc(var(--ub-formControlHeight) * 1px);height:calc(var(--ub-formControlHeight) * 1px);min-height:calc(var(--ub-formControlHeight) * 1px);max-height:calc(var(--ub-formControlHeight) * 1px);line-height:calc((var(--ub-formControlHeight) - 2) * 1px);color:var(--ub-colorTextSecondary,#8c8c8c);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;margin:0;padding:0;display:inline-flex}.blocks-app .selected-social-form .selected-social-form__platform-edit.ant-btn.ant-btn-icon-only .ant-btn-icon{justify-content:center;align-items:center;width:100%;height:100%;line-height:0;display:inline-flex}.blocks-app .selected-social-form .selected-social-form__platform-edit.ant-btn.ant-btn-icon-only .ant-btn-icon svg{display:block}.blocks-app .selected-social-form .selected-social-form__platform-edit.ant-btn:hover{color:var(--ub-colorText,#000000e0);background:var(--ub-colorFillSecondary,#f0f0f0)}.blocks-app .selected-social-form .selected-social-form__platform-edit.ant-btn:focus-visible{outline:2px solid var(--ub-colorPrimary);outline-offset:1px}.blocks-app .selected-social-form .selected-social-form__platform-select{width:100%}.blocks-app .selected-social-form .selected-social-form__platform-select.ant-select-single .ant-select-selector .ant-select-selection-item{align-self:center;align-items:center;line-height:1.2;display:flex}.blocks-app .selected-social-form .selected-social-form__platform-select .ant-select-arrow{color:var(--ub-colorTextSecondary,#8c8c8c)}.blocks-app .selected-social-form .selected-social-form__platform-select .ant-select-arrow svg{width:16px;height:16px}.blocks-app .selected-social-form .selected-social-form__platform-option{align-items:center;gap:4px;min-width:0;line-height:1.2;display:flex}.blocks-app .selected-social-form .selected-social-form__platform-option img{flex-shrink:0;width:30px;height:30px;margin-left:-6px;display:block}.blocks-app .selected-social-form .selected-social-form__platform-option-text{white-space:nowrap;text-overflow:ellipsis;line-height:1.2;overflow:hidden}.blocks-app .selected-social-form .selected-social-form__add-bar{background:var(--ub-colorFillTertiary,#f8f8f8);height:32px;color:var(--ub-colorText,#000000e0);border-radius:6px;justify-content:center;align-items:center;gap:8px;margin-top:0;padding:8px 12px;font-size:14px;font-weight:300;line-height:1.2;display:flex}.blocks-app .selected-social-form .selected-social-form__add-bar:not(:disabled):hover{background:var(--ub-colorFillSecondary,#f0f0f0);color:var(--ub-colorText,#000000e0)}.blocks-app .selected-social-form__platform-dropdown .ant-select-item-option{align-items:center}.blocks-app .selected-social-form__platform-dropdown .ant-select-item-option-content{align-items:center;min-height:0;line-height:1.2;display:flex}.blocks-app .selected-social-form__platform-dropdown .selected-social-form__platform-option{gap:0}.blocks-app .selected-social-form__platform-dropdown .selected-social-form__platform-option img{width:30px;height:30px;margin-left:-6px}.blocks-app .selected-social-form .ant-input-affix-wrapper .ant-input-suffix{flex-shrink:0;align-items:center;display:inline-flex}.blocks-app .selected-social-form .ant-input-affix-wrapper .ant-input-clear-icon:not(.ant-input-clear-icon-hidden){color:var(--ub-colorTextSecondary,#8c8c8c)}.blocks-app .selected-social-form .ant-input-affix-wrapper .ant-input-clear-icon:not(.ant-input-clear-icon-hidden) .anticon{vertical-align:0;justify-content:center;align-items:center;line-height:0;display:inline-flex}.blocks-app .selected-social-form .ant-input-affix-wrapper .ant-input-clear-icon:not(.ant-input-clear-icon-hidden) svg{width:16px;height:16px;display:block}.blocks-app .selected-social-form .ant-input-affix-wrapper .ant-input-clear-icon:not(.ant-input-clear-icon-hidden):hover{color:var(--ub-colorText,#000000e0)}.blocks-app .ant-app .email-pane__content-col .selected-social-form .ant-form-item.selected-social-form__card-field{margin-bottom:8px}.blocks-app .ant-app .email-pane__content-col .selected-social-form .ant-form-item.selected-social-form__card-field:last-child{margin-bottom:0}.blocks-app .email-pane .selected-social-form form.selected-social-form__form.element-controls,.blocks-app .email-pane .email-pane__collapse-wrapper.mobile-properties .selected-social-form form.selected-social-form__form.element-controls{height:auto;max-height:none}.blocks-app .ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-header{padding:20px 0;font-size:14px}.blocks-app .ant-collapse.hidden-props>.ant-collapse-item>.ant-collapse-panel>.ant-collapse-body{padding-left:0;padding-right:0}.blocks-app .ant-collapse.hidden-props .ant-alert{margin-bottom:24px}.blocks-app .selected_form-mobile-props{padding:24px 14px 0 24px}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .selected-element-panel-content.selected-element-panel__hidden{visibility:hidden;opacity:0;height:0}.blocks-app .email-properties__collapse-panel .selected-element-panel-content{height:100%}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .selected-element-panel-content{width:auto;box-shadow:var(--ub-boxShadowSecondary);border-radius:calc(var(--ub-borderRadius) * 1px);border:none;margin:0;padding:0 6px;transition:opacity .2s;position:absolute;top:-60px;left:50%;transform:translate(-50%)}.blocks-app .em-analytics__email-tab-properties,.blocks-app .em-analytics__email-tab-history{z-index:999;position:absolute}.blocks-app .em-analytics__email-tab-properties .email-pane__collapse-wrapper,.blocks-app .em-analytics__email-tab-history .email-pane__collapse-wrapper{z-index:999;box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #0000000f}.blocks-app .email-pane__col-wrapper_pinch .em-analytics__email-tab-properties .email-pane__collapse-wrapper,.blocks-app .email-pane__col-wrapper_pinch .em-analytics__email-tab-history .email-pane__collapse-wrapper{box-shadow:none}.blocks-app .selected-element-panel{height:100%;overflow:visible}.blocks-app .selected-element-panel button.selected-element-panel__extra-btn,.blocks-app .selected-element-panel__extra-btn button{height:24px;padding:0 7px}.blocks-app .selected-element-panel-content{position:relative}.blocks-app .selected-element-panel-content.column-settings-show_onecol{padding-top:75px}.blocks-app .selected-element-panel__columns-settings{z-index:1;width:100%;position:relative}.blocks-app .selected-element-panel__columns-settings__header{justify-content:space-between;align-items:center;gap:12px;margin-bottom:15px;display:flex}.blocks-app .selected-element-panel__columns-settings__header-title{color:var(--ub-colorText);font-size:14px;line-height:1.5}.blocks-app .selected-element-panel__columns-settings__title{white-space:nowrap;text-overflow:ellipsis;margin-bottom:20px;font-size:16px;font-weight:500;line-height:20px;overflow:hidden}.blocks-app .selected-element-panel__columns-settings__links{white-space:nowrap;justify-content:flex-end;align-items:center;gap:8px;margin-left:auto;font-size:14px;display:flex}.blocks-app .selected-element-panel__columns-settings__links span{color:var(--ub-colorLink);cursor:pointer}.blocks-app .selected-element-panel__columns-settings__links span:hover{color:#40a9ff}.blocks-app .selected-element-panel__columns-settings__links__add{align-items:center;gap:4px;display:inline-flex}.blocks-app .selected-element-panel__columns-settings__links__add.noactive,.blocks-app .selected-element-panel__columns-settings__links__add.noactive span{color:#00000073;cursor:not-allowed}.blocks-app .selected-element-panel__columns-settings__controls{align-items:center;gap:8px;display:flex}.blocks-app .selected-element-panel__columns-settings__controls__column{align-items:center;min-width:40px;display:flex;position:relative}.blocks-app .selected-element-panel__columns-settings__controls__column:first-child .selected-element-panel__columns-settings__controls__divider{visibility:hidden}.blocks-app .selected-element-panel__columns-settings__controls__column__remove,.blocks-app .selected-element-panel__columns-settings__controls__column__copy,.blocks-app .selected-element-panel__columns-settings__controls__column__swap{text-align:center;box-sizing:border-box;cursor:pointer;z-index:1;color:#000000d9;background-color:#fff;border:none;border-radius:50%;justify-content:center;align-items:center;width:25px;height:25px;padding:0;font-size:14px;display:none;position:absolute;left:-10px;box-shadow:0 0 7px -2px #00000059}.blocks-app .selected-element-panel__columns-settings__controls__column__remove{top:-11px}.blocks-app .selected-element-panel__columns-settings__controls__column__copy{color:#000000a6;top:20px}.blocks-app .selected-element-panel__columns-settings__controls__column__swap{color:#000000a6;top:10px;left:-16px}.blocks-app .selected-element-panel__columns-settings__controls__column__remove:hover,.blocks-app .selected-element-panel__columns-settings__controls__column__copy:hover,.blocks-app .selected-element-panel__columns-settings__controls__column__swap:hover{box-shadow:0 0 7px -2px #000000b3}.blocks-app .selected-element-panel__columns-settings__controls:hover .selected-element-panel__columns-settings__controls__column__swap,:is(.blocks-app .selected-element-panel__columns-settings__controls__column:hover:not(:has(.selected-element-panel__columns-settings__controls__column__swap:hover)) .selected-element-panel__columns-settings__controls__column__remove,.blocks-app .selected-element-panel__columns-settings__controls__column:hover:not(:has(.selected-element-panel__columns-settings__controls__column__swap:hover)) .selected-element-panel__columns-settings__controls__column__copy){display:flex}.blocks-app .selected-element-panel__columns-settings__controls__column:hover:not(:has(.selected-element-panel__columns-settings__controls__column__swap:hover)) .selected-element-panel__columns-settings__controls__column__swap{display:none}.blocks-app .selected-element-panel__columns-settings__controls__field{text-align:center;border-radius:6px;width:100%;height:45px}.blocks-app .selected-element-panel__columns-settings__controls__field .ant-input-number{background:0 0;border:none}.blocks-app .selected-element-panel__columns-settings__controls__field .ant-input-number .ant-input-number-input{text-align:center;height:43px}.blocks-app .selected-element-panel__columns-settings__controls__divider{cursor:w-resize}.blocks-app .selected-element-panel__columns-settings__divider-wrapper{display:none}.blocks-app .selected-element-panel .selected-element-panel__columns-settings__divider-wrapper{display:block;position:relative}.blocks-app .selected-element-panel .selected-element-panel__columns-settings__divider{width:calc(100% + 80px);height:20px;margin:24px -40px 0;position:absolute;bottom:-20px}.blocks-app .selected-element-panel__content_abs{border:1px solid var(--ub-colorBorder);z-index:100;background-color:var(--ub-colorBgContainer);border-top:none;border-radius:0 0 8px 8px;width:100%;max-width:1400px;min-height:15px;margin-bottom:15px;transition:all .5s;display:flex;position:sticky;top:0;left:0}.blocks-app .selected-element-panel__mobile-switch{background-color:var(--ub-colorPrimary)}.blocks-app .selected-element-panel__mobile-switch.ant-switch-checked{background-color:var(--ub-colorInfo)}.blocks-app #selected_element_form_desktop_props .ant-alert-info .ant-alert-title{color:var(--ub-colorInfoText)}.blocks-app .ant-app .selected_form-mobile-switch{margin-bottom:20px;font-size:16px;font-weight:500}.blocks-app .ant-app .selected_form-mobile-props{--ub-colorPrimaryBorder:var(--ub-colorInfo);--ub-controlOutline:var(--ub-colorInfoBgHover)}.blocks-app .ant-app .selected_form-mobile-props .ant-input-number:focus,.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-focused,.blocks-app .ant-app .selected_form-mobile-props .ant-input:focus,.blocks-app .ant-app .selected_form-mobile-props .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector,.blocks-app .ant-app .selected_form-mobile-props .ant-input-affix-wrapper:focus,.blocks-app .ant-app .selected_form-mobile-props .ant-input-affix-wrapper-focused{border-color:var(--ub-colorInfo);box-shadow:0 0 0 calc(var(--ub-controlOutlineWidth) * 1px) var(--ub-controlOutline)!important}:is(.blocks-app .ant-app .selected_form-mobile-props .ant-input-affix-wrapper>.ant-input:focus,.blocks-app .ant-app .selected_form-mobile-props .ant-space-compact:has(>.ant-input-number):focus-within>.ant-input-number,.blocks-app .ant-app .selected_form-mobile-props .input-select:focus-within .ant-input-affix-wrapper){box-shadow:none!important}.blocks-app .ant-app .selected_form-mobile-props .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:var(--ub-colorInfo)}.blocks-app .ant-app .selected_form-mobile-props .ant-select-item-option-selected:not(.ant-select-item-option-disabled){background-color:#edd3ed}.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group:not(.ant-input-number-wrapper-disabled):focus-within{box-shadow:var(--ub-colorInfoBg) 0 0 0 2px!important}.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group:not(.ant-input-number-wrapper-disabled):focus-within .ant-input-number-affix-wrapper:not(:last-child),.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group:not(.ant-input-number-wrapper-disabled):focus-within .ant-input-number-group-addon:last-child,.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group:not(.ant-input-number-wrapper-disabled):focus-within>.ant-input-number:first-child{border-color:var(--ub-colorInfo)}.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group:not(.ant-input-number-wrapper-disabled):focus-within .ant-input-number-affix-wrapper:not(:last-child){border-right-color:var(--ub-colorFillSecondaryDarken)}.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group-addon .ant-select-open .ant-select-selector,.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-group-addon .ant-select-focused .ant-select-selector,.blocks-app .ant-app .selected_form-mobile-props .ant-radio-button-wrapper:hover,.blocks-app .ant-app .selected_form-mobile-props .ant-collapse>.ant-collapse-item>.ant-collapse-header:hover{color:var(--ub-colorInfo)}.blocks-app .ant-app .selected_form-mobile-props .ant-btn-background-ghost.ant-btn-primary{color:var(--ub-colorInfo);border-color:var(--ub-colorInfo)}.blocks-app .ant-app .selected_form-mobile-props .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child,.blocks-app .ant-app .selected_form-mobile-props .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled),.blocks-app .ant-app .selected_form-mobile-props .selected-td-form__button--active{background-color:var(--ub-colorInfoBg)!important;color:var(--ub-colorInfoText)!important}.blocks-app .ant-app .selected_form-mobile-props .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):before,.blocks-app .ant-app .selected_form-mobile-props .ant-switch-checked{background-color:var(--ub-colorInfoTextActive)}.blocks-app .ant-app .selected_form-mobile-props .ant-switch.ant-switch-checked:hover:not(.ant-switch-disabled){background-color:var(--ub-colorInfoHover)}.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-action:hover .ant-input-number-action-up-inner,.blocks-app .ant-app .selected_form-mobile-props .ant-input-number-action:hover .ant-input-number-action-down-inner{color:var(--ub-colorInfo)}.blocks-app .ant-app .selected_form-mobile-props .ant-alert-info{background-color:var(--ub-colorInfoBg);border:none}.blocks-app .ant-app .selected_form-mobile-props .ant-alert-info .ant-alert-title{color:var(--ub-colorInfoText)}.blocks-app .selected-element-panel__extra-btn-container{position:absolute;top:13px;right:50px}.blocks-app .selected-element-panel__extra-btn-container .ant-btn-text:disabled{color:var(--ub-colorTextQuaternary)}.blocks-app .email-properties__collapse .ant-tabs-content>.ant-tabs-tabpane{height:100%}.blocks-app .ant-app .columns-presets{width:100%;margin-bottom:calc(var(--ub-formItemMarginBottomMD) * 1px);align-items:center;gap:7px;display:flex}.blocks-app .ant-app .columns-presets .ant-btn{flex:1;min-width:0;padding:7px 9px;line-height:1!important}.blocks-app .email-pane__collapse-wrapper .ant-modal-close{width:24px;height:24px;font-size:16px}.blocks-app .email-pane__collapse-wrapper .ant-modal-close .anticon{line-height:0}.blocks-app .groups-management__group-select label{width:100%}.blocks-app .groups-management__group-select label:after{display:none}.blocks-app .groups-management__group_menu{border-color:var(--ub-colorFillSecondaryDarken)}.blocks-app .annotations-preview{z-index:1100;pointer-events:auto;background:#fff;border-radius:8px;width:300px;padding:16px;position:absolute;top:0;box-shadow:0 4px 12px #00000026}.blocks-app .annotations-preview--popover{opacity:1;z-index:1;pointer-events:auto;width:420px;max-height:calc(100vh - 48px);position:absolute;top:0;left:-15px;overflow:hidden;transform:translate(-100%)}.blocks-app .annotations-preview__content{pointer-events:none}.blocks-app .annotations-preview__type{color:#202124;margin-bottom:10px;font-size:13px;font-weight:600}.blocks-app .annotations-preview__footer{pointer-events:auto;justify-content:space-between;align-items:center;gap:8px;margin-top:12px;display:flex}.blocks-app .annotations-preview__apply-wrap{margin-left:auto;display:inline-flex}.blocks-app .email-pane__col-wrapper_reverse .annotations-preview--popover{left:auto;right:-15px;transform:translate(100%)}.blocks-app .preview-skeleton{background:linear-gradient(90deg,#f1f3f4 25%,#e8eaed 50%,#f1f3f4 75%) 0 0/200% 100%;border-radius:4px;flex-shrink:0;animation:1.4s ease-in-out infinite preview-skeleton-shimmer;display:block}.blocks-app .preview-skeleton--circle{border-radius:50%}.blocks-app .preview-skeleton--block{border-radius:0}@keyframes preview-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.blocks-app .product-carousel-preview__header{margin-bottom:12px}.blocks-app .product-carousel-preview__header-main{align-items:flex-start;gap:12px;display:flex}.blocks-app .product-carousel-preview__logo{object-fit:cover;border:1px solid #f0f0f0;border-radius:50%;flex-shrink:0;width:40px;height:40px}.blocks-app .product-carousel-preview__logo-skeleton{border:none}.blocks-app .product-carousel-preview__subject-skeleton{flex:1;min-width:0;max-width:220px}.blocks-app .product-carousel-preview__header-text{flex:1;min-width:0}.blocks-app .product-carousel-preview__header-row{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .product-carousel-preview__header-row--subject{align-items:flex-start;margin-top:2px}.blocks-app .product-carousel-preview__brand-name{color:#202124;font-size:14px;font-weight:600;line-height:20px}.blocks-app .product-carousel-preview__time{color:#5f6368;flex-shrink:0;font-size:11px;line-height:16px}.blocks-app .product-carousel-preview__subject-line{color:#202124;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:13px;line-height:18px;overflow:hidden}.blocks-app .product-carousel-preview__star-icon{color:#5f6368;flex-shrink:0}.blocks-app .product-carousel-preview__carousel{gap:8px;margin:0 -2px;padding-bottom:4px;display:flex;overflow-x:auto}.blocks-app .product-carousel-preview__carousel::-webkit-scrollbar{display:none}.blocks-app .product-carousel-preview__carousel{-ms-overflow-style:none;scrollbar-width:none}.blocks-app .product-carousel-preview__card{background:#fff;border:1px solid #dadce0;border-radius:8px;flex:0 0 128px;width:128px;overflow:hidden}.blocks-app .product-carousel-preview__card-image{aspect-ratio:1;background-color:#f1f3f4;background-position:50%;background-size:cover;width:100%}.blocks-app .product-carousel-preview__card-image-skeleton{aspect-ratio:1;width:100%}.blocks-app .product-carousel-preview__card-body{padding:8px}.blocks-app .product-carousel-preview__card-headline{color:#3c4043;-webkit-line-clamp:2;-webkit-box-orient:vertical;min-height:32px;font-size:12px;line-height:16px;display:-webkit-box;overflow:hidden}.blocks-app .product-carousel-preview__card-headline-skeleton{flex-direction:column;gap:4px;min-height:32px;display:flex}.blocks-app .product-carousel-preview__card-prices{flex-wrap:wrap;align-items:baseline;gap:6px;margin-top:6px;display:flex}.blocks-app .product-carousel-preview__card-sale-price{color:#202124;font-size:13px;font-weight:600;line-height:16px}.blocks-app .product-carousel-preview__card-original-price{color:#5f6368;font-size:12px;line-height:16px;text-decoration:line-through}.blocks-app .single-image-preview__header{margin-bottom:10px}.blocks-app .single-image-preview__header-main{align-items:flex-start;gap:12px;display:flex}.blocks-app .single-image-preview__logo{object-fit:cover;border:1px solid #f0f0f0;border-radius:50%;flex-shrink:0;width:40px;height:40px}.blocks-app .single-image-preview__logo-skeleton{border:none}.blocks-app .single-image-preview__header-text{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.blocks-app .single-image-preview__header-row{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .single-image-preview__brand-name{color:#202124;font-size:14px;font-weight:600;line-height:20px}.blocks-app .single-image-preview__time{color:#5f6368;flex-shrink:0;font-size:11px;line-height:16px}.blocks-app .single-image-preview__subject-line{color:#202124;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:18px;overflow:hidden}.blocks-app .single-image-preview__subject-skeleton{max-width:100%}.blocks-app .single-image-preview__promo-row{justify-content:space-between;align-items:center;gap:8px;min-height:18px;display:flex}.blocks-app .single-image-preview__promo-content{flex:1;align-items:center;gap:4px;min-width:0;display:flex}.blocks-app .single-image-preview__promo-icon{color:#188038;flex-shrink:0}.blocks-app .single-image-preview__promo-icon-skeleton{border-radius:4px;flex-shrink:0}.blocks-app .single-image-preview__promo-badge{color:#188038;flex-shrink:0;font-size:13px;font-weight:500;line-height:16px}.blocks-app .single-image-preview__promo-separator{color:#5f6368;flex-shrink:0;font-size:13px;line-height:16px}.blocks-app .single-image-preview__promo-code{text-overflow:ellipsis;white-space:nowrap;color:#5f6368;min-width:0;font-size:13px;line-height:16px;overflow:hidden}.blocks-app .single-image-preview__promo-skeleton{flex-shrink:0}.blocks-app .single-image-preview__star-icon{color:#5f6368;flex-shrink:0}.blocks-app .single-image-preview__card{background:#fff;border:1px solid #dadce0;border-radius:10px;width:calc(100% - 76px);max-width:100%;margin-left:52px;margin-right:24px;overflow:hidden}.blocks-app .single-image-preview__card-image{aspect-ratio:1.91;background-color:#f1f3f4;background-position:50%;background-size:cover;width:100%}.blocks-app .single-image-preview__card-image-skeleton{aspect-ratio:1.91;width:100%}.blocks-app .single-image-preview__card-body{padding:10px 12px 12px}.blocks-app .single-image-preview__card-description{color:#3c4043;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:14px;line-height:16px;display:-webkit-box;overflow:hidden}.blocks-app .single-image-preview__card-description-skeleton{flex-direction:column;gap:6px;min-height:34px;display:flex}.blocks-app .deal-annotation-preview__header-main{align-items:flex-start;gap:12px;display:flex}.blocks-app .deal-annotation-preview__logo{object-fit:cover;border:1px solid #f0f0f0;border-radius:50%;flex-shrink:0;width:40px;height:40px}.blocks-app .deal-annotation-preview__logo-skeleton{border:none}.blocks-app .deal-annotation-preview__header-text{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.blocks-app .deal-annotation-preview__header-row{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .deal-annotation-preview__brand-name{color:#202124;font-size:14px;font-weight:600;line-height:20px}.blocks-app .deal-annotation-preview__time{color:#5f6368;flex-shrink:0;font-size:11px;line-height:16px}.blocks-app .deal-annotation-preview__subject-line{color:#202124;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:18px;overflow:hidden}.blocks-app .deal-annotation-preview__subject-skeleton{max-width:100%}.blocks-app .deal-annotation-preview__promo-row{justify-content:space-between;align-items:center;gap:8px;min-height:18px;display:flex}.blocks-app .deal-annotation-preview__promo-content{flex:1;align-items:center;gap:4px;min-width:0;display:flex}.blocks-app .deal-annotation-preview__promo-icon{color:#188038;flex-shrink:0}.blocks-app .deal-annotation-preview__promo-icon-skeleton{border-radius:4px;flex-shrink:0}.blocks-app .deal-annotation-preview__promo-badge{color:#188038;flex-shrink:0;font-size:13px;font-weight:500;line-height:16px}.blocks-app .deal-annotation-preview__promo-separator{color:#5f6368;flex-shrink:0;font-size:13px;line-height:16px}.blocks-app .deal-annotation-preview__promo-code{text-overflow:ellipsis;white-space:nowrap;color:#5f6368;min-width:0;font-size:13px;line-height:16px;overflow:hidden}.blocks-app .deal-annotation-preview__promo-skeleton{flex-shrink:0}.blocks-app .deal-annotation-preview__star-icon{color:#5f6368;flex-shrink:0}.blocks-app .deal-card-preview{background:#f1f3f4;border-radius:12px;flex-direction:column;gap:12px;padding:16px;display:flex}.blocks-app .deal-card-preview__sender{color:#202124;font-size:12px;font-weight:600;line-height:16px}.blocks-app .deal-card-preview__headline{color:#202124;word-break:break-word;font-size:22px;font-weight:400;line-height:28px}.blocks-app .deal-card-preview__headline-skeleton{max-width:100%}.blocks-app .deal-card-preview__details{align-items:flex-start;gap:24px;display:flex}.blocks-app .deal-card-preview__expires{align-items:flex-start;gap:8px;min-width:0;display:flex}.blocks-app .deal-card-preview__clock-icon{color:#5f6368;flex-shrink:0;margin-top:1px}.blocks-app .deal-card-preview__code{min-width:0}.blocks-app .deal-card-preview__detail-text{flex-direction:column;gap:2px;min-width:0;display:flex}.blocks-app .deal-card-preview__detail-label{color:#202124;font-size:12px;font-weight:600;line-height:16px}.blocks-app .deal-card-preview__detail-value{color:#5f6368;word-break:break-word;font-size:12px;font-weight:400;line-height:16px}.blocks-app .deal-card-preview__detail-skeleton{margin-top:1px}.blocks-app .deal-card-preview__actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.blocks-app .deal-card-preview__button{color:#001d35;white-space:nowrap;background:#c2e7ff;border-radius:999px;justify-content:center;align-items:center;padding:8px 16px;font-size:13px;font-weight:500;line-height:16px;display:inline-flex}.blocks-app .annotations-panel .selected-social-form__section-title{align-items:baseline;gap:6px;display:flex}.blocks-app .annotations-panel__docs-hint{color:var(--ub-colorTextSecondary,#8c8c8c);margin-top:16px;font-size:12px;font-weight:300;line-height:1.4}.blocks-app .annotations-panel__section-hint{color:var(--ub-colorTextSecondary,#8c8c8c);font-size:12px;font-weight:300}.blocks-app .annotations-panel__field-tooltip-wrap{width:100%;margin-bottom:8px;display:block}.blocks-app .annotations-panel__cards-section{margin-top:16px}.blocks-app .email-pane__content-col .selected-social-form.annotations-panel .selected-social-form__form .ant-form-item.selected-social-form__card-field:last-child{margin-bottom:8px}.blocks-app .email-settings{height:100%;display:flex}.blocks-app .email-settings__collapse{flex-direction:column;width:100%;height:100%;min-height:0;max-height:100%;display:flex;overflow:hidden}.blocks-app .email-settings__collapse.ant-collapse{border:0}.blocks-app .email-settings__collapse.secondary-tabs.ant-tabs .ant-tabs-content-holder{flex:1;min-height:0;overflow:hidden auto}.blocks-app .email-settings__collapse.secondary-tabs.ant-tabs .ant-tabs-content,.blocks-app .email-settings__collapse.secondary-tabs.ant-tabs .ant-tabs-tabpane-active{overflow:visible}.blocks-app .email-settings__collapse-panel:last-child.ant-collapse-item-active{padding-bottom:12px}.blocks-app .email-settings__collapse-panel.ant-collapse-item{min-height:50px;overflow:hidden}.blocks-app .email-settings__collapse-panel-content{width:100%}.blocks-app .email-settings .ant-collapse-body{padding:0 2px 0 12px;overflow:hidden}.blocks-app #content_appearance_panel_form button.ant-btn:not(.ant-btn-primary):hover{border-color:#d9d9d9}.blocks-app .section-title-bull{color:var(--ub-colorTextQuaternary)}.blocks-app .appearance-panel__content-styles{flex-direction:column;height:100%;min-height:0;display:flex}.blocks-app .appearance-panel__content-styles.ant-tabs{height:100%;min-height:0}.blocks-app .appearance-panel__content-styles .ant-tabs-content-holder,.blocks-app .appearance-panel__content-styles .ant-tabs-content,.blocks-app .appearance-panel__content-styles .ant-tabs-tabpane,.blocks-app .appearance-panel__content-styles .ant-tabs-tabpane-active,.blocks-app .appearance-panel__content-styles .email-settings__collapse-panel-content,.blocks-app .appearance-panel__content-styles .appearance-panel,.blocks-app .appearance-panel__content-styles .element-controls{min-height:0}.blocks-app .appearance-panel__content-styles .ant-tabs-content-holder,.blocks-app .appearance-panel__content-styles .ant-tabs-content,.blocks-app .appearance-panel__content-styles .ant-tabs-tabpane-active,.blocks-app .appearance-panel__content-styles .email-settings__collapse-panel-content,.blocks-app .appearance-panel__content-styles .appearance-panel{flex-direction:column;flex:1;display:flex}.blocks-app .appearance-panel__content-styles .ant-tabs-content-holder{overflow:hidden auto}.blocks-app .appearance-panel__content-styles .ant-tabs-content,.blocks-app .appearance-panel__content-styles .ant-tabs-tabpane-active{overflow:visible}.blocks-app .modal-select-role__cards-grid{grid-gap:20px;grid-template-columns:repeat(auto-fit,322px);padding:10px 24px 24px;display:grid}.blocks-app .modal-select-role .element-card__select-role{cursor:pointer;height:300px}.blocks-app .modal-select-role .element-card__select-role img{cursor:pointer;background-color:#fff;width:100%}.blocks-app .modal-select-role .element-card__select-role .ant-card-body{height:50px}.blocks-app .modal-select-role__title-wrapper{display:inline-block}.blocks-app .ai-response-paragraph{margin-bottom:16px}.blocks-app .em-analytics__email-tab-discuss{overflow:auto!important}.blocks-app .discuss-ai-wrapper{flex-direction:column;flex:1;height:100%;min-height:0;display:flex}.blocks-app .discuss-ai-wrapper .ant-tabs-content-holder,.blocks-app .discuss-ai-wrapper .ant-tabs-content,.blocks-app .discuss-ai-wrapper .ant-tabs-tabpane,.blocks-app .discuss-ai-wrapper .ant-tabs-tabpane-active{flex-direction:column;flex:1;min-height:0;display:flex}.blocks-app .discuss-ai-wrapper .ant-tabs-content{overflow:hidden auto}.blocks-app .discuss-ai-wrapper .discuss-main{min-height:0}.blocks-app .ant-tabs-content .discuss-ai{background-color:#fafafa;border:1px solid #f1ebeb;border-radius:8px;margin:0 0 20px;padding:24px 36px 0}.dark .blocks-app .ant-tabs-content .discuss-ai{background-color:#181818;border-color:#262626}.blocks-app .discuss-main{margin:0}.blocks-app .discuss-main__form{position:relative}.blocks-app .discuss-main__buttons{justify-content:space-between;display:flex}.blocks-app .discuss-main>.comment-list{margin-bottom:16px}.blocks-app .discuss-main>form{padding-bottom:20px}.blocks-app .discuss-main .ant-comment-actions{opacity:.6;transition:all .3s cubic-bezier(.645,.045,.355,1)}.blocks-app .discuss-main .replyEditMode{opacity:.5}.blocks-app .modal-select-role{max-height:1400px}.blocks-app .modal-select-role .element-card.element-card_select-role .ant-card-cover{border:none;height:auto}.blocks-app .modal-select-role .element-card .ant-card-body{height:auto}.blocks-app .modal-select-role__cards-grid{grid-gap:20px;grid-template-columns:repeat(3,260px);width:auto;padding:10px 24px 24px;display:grid}.blocks-app .modal-select-role .element-card_select-role{cursor:pointer}.blocks-app .modal-select-role .element-card_select-role img,.blocks-app .modal-select-role .element-card__no-img{background-color:#fff}@media (width<=1200px){.blocks-app .modal-select-role__cards-grid{grid-template-columns:repeat(4,240px);width:auto}.blocks-app .modal-select-role .element-card__title{font-size:15px}}.blocks-app .ant-comment .ant-comment-avatar{cursor:auto}.blocks-app .ant-comment .ant-comment-avatar .anticon-robot{background:var(--ub-colorInfo)}.blocks-app .ant-comment .ant-comment-avatar .anticon-user{background:var(--ub-colorPrimary)}.blocks-app .ant-comment.ai-comment .ant-comment-avatar .anticon-robot{background:var(--ub-colorInfo)}.blocks-app .ant-comment.ai-comment .ant-comment-avatar .anticon-user{background:var(--ub-colorPrimary)}.blocks-app .ant-comment.ai-comment .ai-guide__example{border-left:1px solid #3b91ff;padding-left:15px;font-style:italic}.blocks-app .ant-comment.ai-comment .ai-guide__example strong{font-weight:500}.blocks-app .ant-comment-content-detail{margin-top:16px;margin-left:-30px}.blocks-app .ant-comment-content-detail p{white-space:normal;margin:16px 0;line-height:1.4}.blocks-app .ant-comment-content-detail ul{margin:16px 0}.blocks-app .ant-comment-content-detail .buttons-variants{white-space:normal;margin-left:0;padding-left:0}.blocks-app body.dark .ant-comment-content-detail .buttons-variants .ant-btn-default:hover{background:#e6f7ff}.blocks-app .ant-comment-content-detail .buttons-variants li{white-space:normal;margin-bottom:4px}.blocks-app .ant-comment-content-detail .buttons-variants .ant-btn.ant-btn-sm{text-align:left;height:auto;padding:4px 7px;line-height:1.4}.blocks-app .ant-comment-content-detail .ai-response-variant{margin:15px 0}.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-title,.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-preheader,.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-copy{cursor:pointer;background-color:#1890ff33;border-radius:4px;margin:4px 0;padding:3px 8px;line-height:1.4;transition:all .3s;display:block}.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-title:hover,.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-preheader:hover,.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-copy:hover{color:#000}.blocks-app body.dark .ant-comment-content-detail .ai-response-variant .ai-response-title:hover,.blocks-app body.dark .ant-comment-content-detail .ai-response-variant .ai-response-preheader:hover,.blocks-app body.dark .ant-comment-content-detail .ai-response-variant .ai-response-copy:hover{color:#fff}.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-title:hover,.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-preheader:hover,.blocks-app .ant-comment-content-detail .ai-response-variant .ai-response-copy:hover{background-color:#1890ff55}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--ub-colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{z-index:1;box-sizing:border-box;justify-content:flex-end;align-items:center;display:flex;position:absolute;top:20px;right:20px}.blocks-app .limit-upgrade-modal__close{background:var(--ub-colorBgContainer);width:34px;height:34px;color:var(--ub-colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--ub-colorFillTertiary);color:var(--ub-colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:44px 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--ub-colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--ub-colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--ub-colorText);width:34px;height:34px;color:var(--ub-colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--ub-colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--ub-colorBorder);min-width:147px;height:32px;color:var(--ub-colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}.blocks-app .optimise-wrapper{flex-direction:column;flex:1;height:100%;min-height:0;display:flex}.blocks-app .optimise-wrapper .ant-tabs-content-holder,.blocks-app .optimise-wrapper .ant-tabs-content,.blocks-app .optimise-wrapper .ant-tabs-tabpane,.blocks-app .optimise-wrapper .ant-tabs-tabpane-active{flex-direction:column;flex:1;min-height:0;display:flex}.blocks-app .optimise-wrapper .ant-tabs-content{overflow:hidden auto}.blocks-app .optimise{background:0 0;border:none;min-height:0}.blocks-app .optimise.ant-collapse>.ant-collapse-item:last-child{border-bottom:none!important}.blocks-app .optimise .ant-list-item-meta-title{-webkit-user-select:text;user-select:text}.blocks-app .optimise__summary{justify-content:space-between;width:100%;display:flex}.blocks-app .optimise__summary>div:not(:last-child){margin-right:10px}.blocks-app .optimise__summary h4{line-height:1}.blocks-app .optimise .ant-divider.ant-divider-horizontal{border-top:1px solid var(--ub-colorBorderSecondary);background:linear-gradient(180deg, var(--ub-colorBgContainerDisabled), transparent 40%);width:calc(100% + 50px);margin:26px -25px}.blocks-app .optimise.ant-collapse>.ant-collapse-item{border-bottom:1px solid var(--ub-colorBorderSecondary)}.blocks-app .optimise.ant-collapse>.ant-collapse-item .ant-collapse-header{padding:12px 0 12px 24px}.blocks-app .optimise.ant-collapse>.ant-collapse-item .ant-collapse-panel{border-top:none}.blocks-app .optimise.ant-collapse>.ant-collapse-item .ant-collapse-body{padding:24px 14px 12px 24px;overflow-y:hidden;padding-top:0!important;padding-right:24px!important}.blocks-app .optimise .valid{white-space:nowrap;color:var(--ub-colorSuccessText)}.blocks-app .optimise .error{white-space:nowrap;color:var(--ub-colorErrorText)}.blocks-app .optimise .warning{white-space:nowrap;color:var(--ub-colorWarningText)}.blocks-app .optimise__title-wrapper{justify-content:space-between;align-items:flex-start;width:100%;display:flex}.blocks-app .optimise__title-wrapper h5{width:70%}.blocks-app .optimise__link{-webkit-user-select:text;user-select:text}.blocks-app .optimise__link:hover{color:var(--ub-colorLinkHover)!important}.blocks-app .email-pane .optimise .ant-collapse-panel{height:calc(100% - 184px)}.blocks-app .optimise__image-item .image-item__meta_fail .ant-list-item-meta-avatar{background:linear-gradient(45deg, var(--ub-colorBorder) 25%, transparent 0, transparent 75%, var(--ub-colorBorder) 0), linear-gradient(45deg, var(--ub-colorBorder) 25%, transparent 0, transparent 75%, var(--ub-colorBorder) 0);background-position:0 0,4px 4px;background-size:8px 8px;border-radius:6px}.blocks-app .optimise__image-item .image-item__meta.ant-list-item-meta{align-items:stretch}.blocks-app .optimise__image-item .image-item__image{cursor:pointer;object-fit:contain;border-radius:calc(var(--ub-borderRadius) * 1px);background:linear-gradient(45deg, var(--ub-colorBorder) 25%, transparent 0, transparent 75%, var(--ub-colorBorder) 0), linear-gradient(45deg, var(--ub-colorBorder) 25%, transparent 0, transparent 75%, var(--ub-colorBorder) 0);background-position:0 0,4px 4px;background-size:8px 8px}.blocks-app .optimise__image-item .image-item__image+.ant-image-mask{border-radius:calc(var(--ub-borderRadius) * 1px)}.blocks-app .optimise__image-item .image-item__image_fail{height:92px!important}.blocks-app .optimise .ant-list .ant-list-item .ant-list-item-meta .ant-list-item-meta-avatar{margin-inline-end:12px}.blocks-app .optimise .warnings{color:var(--ub-colorWarningText)}.blocks-app .optimise .errors{color:var(--ub-colorErrorText)}.blocks-app .optimise .valid{color:var(--ub-colorSuccessText)}.blocks-app .optimise__button.warnings{border-color:var(--ub-colorWarningBorder);background:var(--ub-colorWarningBg)}.blocks-app .optimise__button.warnings:not(.ant-tag-checkable-checked):hover{border-color:var(--ub-colorWarningBorderHover);color:var(--ub-colorWarningTextHover);background:var(--ub-colorWarningBgHover)}.blocks-app .optimise__button.warnings_active{color:#fff;background-color:var(--ub-colorWarningActive);border-color:var(--ub-colorWarningActive)}.blocks-app .optimise__button.errors{border-color:var(--ub-colorErrorBorder);background:var(--ub-colorErrorBg)}.blocks-app .optimise__button.errors:not(.ant-tag-checkable-checked):hover{border-color:var(--ub-colorErrorBorderHover);color:var(--ub-colorErrorTextHover);background:var(--ub-colorErrorBgHover)}.blocks-app .optimise__button.errors_active{color:#fff;background-color:var(--ub-colorErrorActive);border-color:var(--ub-colorErrorActive)}.blocks-app .optimise__button.valid{border-color:var(--ub-colorSuccessBorder);background:var(--ub-colorSuccessBg)}.blocks-app .optimise__button.valid:not(.ant-tag-checkable-checked):hover{border-color:var(--ub-colorSuccessBorderHover);color:var(--ub-colorSuccessTextHover);background:var(--ub-colorSuccessBgHover)}.blocks-app .optimise__button.valid_active{color:#fff;background-color:var(--ub-colorSuccessActive);border-color:var(--ub-colorSuccessActive)}.blocks-app .optimise .ant-alert-info{width:100%;margin-top:5px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__divider-no-margin.selected-td-form__divider{margin-top:0;margin-bottom:0}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-col.optimise__col-align-right{text-align:right}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-row.optimise__row-mb-24{margin-bottom:24px}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-row.optimise__row-mb-16{margin-bottom:16px}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-row.optimise__row-mb-14{margin-bottom:14px}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-row.optimise__row-mb-12{margin-bottom:12px}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-row.optimise__row-mb-8{margin-bottom:8px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__link-blue.ant-typography{color:#177ddc;text-decoration:underline}.blocks-app .ant-app .email-pane .ant-tabs .optimise .ant-image.optimise__image-auto-height{height:auto}.blocks-app .ant-app .email-pane .ant-tabs .optimise__text-clickable.ant-typography{cursor:pointer}.blocks-app .ant-app .email-pane .ant-tabs .optimise__valid-title.ant-typography{margin:0;font-size:14px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__valid-title-space.ant-space{flex-wrap:wrap}.blocks-app .ant-app .email-pane .ant-tabs .optimise__alert-custom.ant-alert{width:100%;padding:14px 14px 10px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__summary-title.ant-typography{margin-bottom:0}.blocks-app .ant-app .email-pane .ant-tabs .optimise__summary-label{font-size:12px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__spam-score-title.ant-typography{margin:0}.blocks-app .ant-app .email-pane .ant-tabs .optimise__spam-score-value{margin-right:12px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__spam-score-text.ant-typography{margin-right:12px;font-size:20px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__spam-report-score.ant-typography{font-size:20px}.blocks-app .ant-app .email-pane .ant-tabs .optimise__spam-report-description{margin-left:12px}.blocks-app .img-preview{background-color:var(--ub-colorBgContainer);border-radius:calc(var(--ub-borderRadiusXL) * 1px);box-shadow:var(--ub-boxShadow);opacity:0;border:1px solid #fff;max-width:668px;padding:3px;transition:opacity .3s,transform .3s;position:absolute;top:0;left:-15px;transform:translate(-99%)}.blocks-app .img-preview-content{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadiusLG) * 1px);background:linear-gradient(45deg, var(--ub-colorBorder) 25%, transparent 25%, transparent 75%, var(--ub-colorBorder) 75%), linear-gradient(45deg, var(--ub-colorBorder) 25%, transparent 25%, transparent 75%, var(--ub-colorBorder) 75%);background-position:0 0,4px 4px;background-size:8px 8px;overflow:hidden}.blocks-app .img-preview-content table{border-collapse:initial}.dark .blocks-app .img-preview{border-color:#4f4f4f}.blocks-app .indexing-tray{z-index:4010;width:360px;max-width:calc(100vw - 40px);position:fixed;bottom:20px;right:20px}.blocks-app .indexing-tray__card{box-shadow:0 6px 16px #0000001f}.blocks-app .indexing-tray__title{font-size:14px;margin:0!important}.blocks-app .blocks-search{height:100%;min-height:0;overflow:visible}.blocks-app .blocks-search .ant-select-clear{right:30px}.blocks-app .blocks-search form{z-index:1;width:85%;padding:16px 0 0 24px;position:absolute;top:0;left:0}.blocks-app .blocks-search__form{display:none}.blocks-app .blocks-search__form.is_search{display:block}.blocks-app .blocks-search__divider-wrapper{z-index:1;margin-top:12px;position:relative}.blocks-app .blocks-search__divider{pointer-events:none;width:auto;height:20px;margin:24px 0 0;position:absolute;bottom:-20px;left:-24px;right:-13px}.blocks-app .blocks-search__type-wrapper{min-width:35%;min-height:0;padding:20px 24px 14px 0;overflow-y:auto}.blocks-app .blocks-search__type-wrapper ul{padding:0}.blocks-app .blocks-search__type-wrapper li{cursor:pointer;color:var(--ub-colorTextSecondary);text-align:left;margin-bottom:12px;line-height:1.2;list-style:none}.blocks-app .blocks-search__type-wrapper li.active{color:var(--ub-colorLink)}.blocks-app .blocks-search__type-wrapper li:hover{color:var(--ub-colorLinkHover)}.blocks-app .blocks-search__result-wrapper{height:100%;min-height:0;margin-left:0;margin-right:0;padding-left:24px;display:flex;position:relative}.blocks-app .blocks-search__result-wrapper:after{content:"";background:linear-gradient(180deg, var(--ub-colorBgContainerDisabled), transparent 40%);z-index:1;width:100%;height:20px;position:absolute;top:0;left:0}.blocks-app .blocks-search__result-wrapper.is_search:after{top:72px}.dark .blocks-app .blocks-search__result-wrapper:after{background:linear-gradient(180deg, var(--ub-colorBgBase) -100%, transparent 50%)}.blocks-app .blocks-search__result-wrapper.is_search{flex:auto;min-width:0;margin-left:0;margin-right:0;padding-top:20px;padding-left:0;padding-right:6px;display:block;position:static;overflow:hidden auto}.blocks-app .blocks-search__blocks-wrapper{min-width:65%;min-height:0;padding-top:20px;padding-left:10px;padding-right:14px;overflow-y:scroll}.blocks-app .blocks-search__result-holder{opacity:0}.blocks-app .blocks-search__blocks-wrapper{overflow-anchor:none}.blocks-app .blocks-search__blocks-wrapper.is_search{box-sizing:border-box;width:100%;min-width:0;padding-top:0;padding-left:4px;padding-right:0}.blocks-app .blocks-search__result{margin-bottom:14px}.blocks-app .ant-dropdown .ant-dropdown-menu .blocks-search__result__menu-item{padding:9px}.blocks-app .blocks-search__result-header{z-index:2;justify-content:space-between;padding:4px 10px;font-size:13px;display:none;position:relative;box-shadow:0 5px 20px #00000012}.blocks-app .blocks-search__result-global-mark{z-index:10;pointer-events:none;position:absolute;top:1px;right:1px}.blocks-app .blocks-search__result-body{background:var(--ub-colorBgElevated);border:1px solid var(--ub-colorBorder);border-radius:calc(var(--ub-borderRadiusSM) * 1px);text-align:center;cursor:grab;background-color:var(--ub-controlTmpOutline);min-height:13px;padding:0;transition:border-color .3s cubic-bezier(.645,.045,.355,1),background-color .3s cubic-bezier(.645,.045,.355,1),box-shadow .3s cubic-bezier(.645,.045,.355,1);position:relative;overflow:hidden}.blocks-app .blocks-search__result-body:hover{border-color:var(--ub-colorTextDisabled);cursor:grab!important}.blocks-app .blocks-search__result-body:active{cursor:grabbing}.blocks-app .blocks-search__result-body:not([data-preview-measured]){min-height:180px}.blocks-app .blocks-search__result-body:after{content:"";z-index:1;width:100%;height:100%;display:block;position:absolute;top:0;left:0}.blocks-app .blocks-search__result-html{transform-origin:0 0;text-align:left;min-width:660px;height:100%;overflow-x:visible}.blocks-app .blocks-search__result-body:not([data-preview-measured]) .blocks-search__result-html{min-height:1px}.blocks-app .blocks-search .em-dragging-element .blocks-search__result-body{background-color:var(--ub-controlTmpOutline)}.blocks-app .blocks-search .em-ghost-element{border-radius:calc(var(--ub-borderRadiusXL) * 1px);overflow:hidden;background-color:var(--ub-colorBgContainer)!important}.blocks-app .email-pane .ant-tabs .blocks-search__result-divider.ant-divider-horizontal{width:100%;margin-left:0;margin-right:0}.blocks-app .blocks-search.is_search{display:flex}.blocks-app .blocks-search.is_search .blocks-search__type-wrapper{min-width:33%;padding-left:24px;padding-right:0}.blocks-app .block-search__preview{background-color:var(--ub-colorBgContainer);border-radius:calc(var(--ub-borderRadiusXL) * 1px);box-shadow:var(--ub-boxShadow);opacity:0;border:1px solid #fff;width:668px;padding:3px;transition:opacity .3s,transform .3s;position:absolute;top:0;left:-15px;transform:translate(-99%)}.blocks-app .block-search__preview-title{color:var(--ub-colorTextSecondary);padding:8px 15px;font-size:14px}.blocks-app .block-search__preview-content{border:1px solid var(--ub-colorBorderSecondary);border-radius:calc(var(--ub-borderRadiusLG) * 1px);overflow:hidden}.blocks-app .block-search__preview-content table{border-collapse:initial}.dark .blocks-app .block-search__preview{border-color:#4f4f4f}.blocks-app .email-pane__col-wrapper_reverse .block-search__preview{left:auto;right:-15px;transform:translate(99%)}.blocks-app .block-global-badge{color:var(--ub-colorTextSecondary);pointer-events:auto;justify-content:center;align-items:center;line-height:0;display:inline-flex}.blocks-app .block-global-badge svg{display:block}.blocks-app .block-global-badge--tile{box-sizing:border-box;background-color:#ffffffb8;border-radius:6px;width:24px;min-width:24px;height:24px;min-height:24px;padding:0;box-shadow:0 1px 2px #0000001a}.blocks-app .block-global-badge--tile svg{flex-shrink:0}.blocks-app body.dark .block-global-badge--tile,.dark .blocks-app .block-global-badge--tile{color:#ffffffe0;background-color:#0000008c;box-shadow:0 1px 3px #00000059}.blocks-app .discuss-wrapper{flex-direction:column;flex:1;height:100%;min-height:0;display:flex}.blocks-app .discuss-wrapper .ant-tabs-content-holder,.blocks-app .discuss-wrapper .ant-tabs-content,.blocks-app .discuss-wrapper .ant-tabs-tabpane,.blocks-app .discuss-wrapper .ant-tabs-tabpane-active{flex-direction:column;flex:1;min-height:0;display:flex}.blocks-app .discuss-wrapper .ant-tabs-tabpane-active{overflow:hidden}.blocks-app .discuss-wrapper .discuss-main{flex-direction:column;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}.blocks-app .discuss-main>.comment-list{flex:auto;min-height:0;margin-bottom:24px;overflow:hidden auto}.blocks-app .discuss-main>form{flex-shrink:0}.blocks-app .discuss-main .ant-comment-content{flex:1;min-width:0}.blocks-app .discuss-main .ant-comment-content-author{flex-wrap:wrap;align-items:baseline;gap:8px;margin-bottom:4px;display:flex}.blocks-app .discuss-main .ant-comment .ant-comment-content-author-name{color:var(--ub-colorTextBase);font-weight:500;transition:color .3s;font-size:14px!important;line-height:1.4!important}.blocks-app .discuss-main .ant-comment-content-author-time{color:var(--ub-colorTextSecondary);white-space:nowrap;font-size:12px;line-height:1.4}.blocks-app .discuss-main .comment-item-noavatar .ant-comment-content-detail{margin-left:0}.blocks-app .discuss-main .ant-comment-content-detail p{white-space:normal;color:var(--ub-colorText);margin:0 0 16px;line-height:1.4}.blocks-app .discuss-main .ant-comment-content-detail :not(.ant-btn,.buttons-variants,.buttons-variants *){-webkit-user-select:text;user-select:text}.blocks-app .discuss-main .ant-dropdown-trigger{z-index:1;color:var(--ub-colorText);margin:-36px 0 -1px -24px;padding:36px 0 1px 24px;position:relative}.blocks-app .discuss-main .ant-comment-nested .ant-dropdown-trigger{margin-left:-18px;padding-left:18px}.blocks-app .discuss-main .ant-comment-inner{transition:all .5s}.blocks-app .discuss-main .ant-comment.active>.ant-comment-inner{background:#efdbff}.blocks-app .discuss-main .targetted-comment-item>.ant-comment-inner{background:var(--ub-colorInfoBg);cursor:pointer}.blocks-app .discuss-main .ant-comment-actions{opacity:.6;margin-top:6px;transition:all .3s cubic-bezier(.645,.045,.355,1);display:none}.blocks-app .discuss-main .ant-form-item-control-input-content{margin-left:2px}.blocks-app .discuss-main .ant-tooltip-container{text-align:center}.blocks-app .discuss-main .ant-comment-content:hover .ant-comment-actions{opacity:1}.blocks-app .discuss-main .replyEditMode{opacity:.5;display:none}.blocks-app .discuss-main .icon-target{font-size:16px;transform:translateY(5%)}.blocks-app .discuss-main .comment-icon-target{border-radius:8px;margin-left:5px;padding:0 8px 2px}.blocks-app .discuss-main .comment-icon-target:hover{cursor:pointer}.blocks-app .discuss-main .ant-btn.ant-btn-primary.button-target.button-target_choose{background:var(--ub-colorInfo)}.blocks-app .discuss-main .ant-space button{margin-right:0}.blocks-app .anticon-history{transform:scaleX(-1)}.blocks-app .history-panel{border-right:1px solid var(--ub-colorBorder);flex-direction:column;justify-content:space-between;height:100%;display:flex;box-shadow:-12px 0 48px 16px #00000008,-9px 0 28px #0000000d,-6px 0 16px -8px #00000014}.blocks-app .history-panel__sider{z-index:11;background:var(--ub-colorBgContainer);height:100%;position:absolute;top:0;bottom:0;left:80px}.blocks-app .history-panel__list-header,.blocks-app .history-panel__header{justify-content:space-between;align-items:center;padding:0 24px 9px;font-weight:500;display:flex}.blocks-app .history-panel__list-header :last-child{min-width:60px}.blocks-app .history-panel__header{padding-left:24px;padding-right:24px}.blocks-app .history-panel__list-header:before{background:linear-gradient(180deg, var(--ub-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--ub-colorBorderSecondary);content:"";z-index:1;background-position:0 -2px;background-repeat:no-repeat;border-bottom:none;height:20px;position:absolute;inset:30px 0 -20px}.dark .blocks-app .history-panel__list-header:before{background:linear-gradient(180deg, var(--ub-colorBgBase), transparent 40%)}.blocks-app .history-panel__header-title{font-size:14px;font-style:normal;line-height:24px}.blocks-app body.dark .history-panel__header-title{color:#fff}.blocks-app .history-panel__header-close{color:#00000073;margin-right:-16px}.blocks-app body.dark .history-panel__header-close{color:#fff}.blocks-app .history-panel__list{height:100%;margin:10px -24px 0}.blocks-app .history-panel__list .ant-list-header{border:none;margin-bottom:5px;padding:0;font-weight:500}.blocks-app .history-panel__list .ant-spin-nested-loading,.blocks-app .history-panel__list .ant-spin-container{height:100%}.blocks-app .history-panel__list .ant-list-items{height:calc(100% - 30px);overflow:auto}.blocks-app .history-panel__list .ant-list-item{cursor:pointer;border:none;padding:9px 24px}.blocks-app .history-panel__list .ant-list-item:hover{background-color:var(--ub-colorFillQuaternary)}.blocks-app .history-panel__list .ant-btn.ant-btn-sm{border:none;height:22px;line-height:1;padding:0!important}.blocks-app .history-panel .ant-list-item{padding:9px 0}.blocks-app .history-panel__list-date,.blocks-app .history-panel__list-header .history-panel__list-date{min-width:130px}.blocks-app .history-panel__list-author{white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.blocks-app .history-panel__restore{opacity:0;visibility:hidden}.blocks-app .history-panel__item_active{background-color:var(--ub-colorFillSecondary)}.blocks-app body.dark .history-panel__item_active{background:#111b26}.blocks-app .history-panel__item_active .history-panel__restore{opacity:1;visibility:visible}.blocks-app .ant-layout-sider.history-panel__sider .ant-layout-sider-children{opacity:1;width:500px;height:100%;transition:opacity .5s;position:absolute;right:0}.blocks-app .ant-layout-sider-collapsed.history-panel__sider .ant-layout-sider-children{opacity:0}.blocks-app .add-new-block-modal__save-btn .ant-btn-icon .anticon{font-size:22px;line-height:0}.blocks-app .add-new-block-modal__save-btn .ant-btn-icon .anticon svg{width:22px;height:22px}.blocks-app .modal-footer{justify-content:flex-end;padding:8px 0;display:flex}.blocks-app .modal-spinner{justify-content:center;align-items:center;height:108px;display:flex}',e=window.__useblocks_styles__||(window.__useblocks_styles__={sheets:{},order:[]}),p=t;if(!e.sheets[p]){var a=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(a=new CSSStyleSheet,a.replaceSync(t))}catch{a=null}if(a){if(!e.host||!e.host.isConnected||!e.host.sheet){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),document.head.appendChild(o),e.host=o}for(var i=e.host.sheet,r=0;r<a.cssRules.length;r++)try{i.insertRule(a.cssRules[r].cssText,i.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(t),(e.listeners||[]).forEach(function(l){try{l(t)}catch{}})}else{var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(t)),document.head.appendChild(o)}e.sheets[p]=!0,e.order.push(p)}}}catch(l){console.error("vite-plugin-css-injected-by-js",l)}})();
|
|
9
|
+
__useblocks__.define("static/core/7052d050.js",["require","exports","module","static/core/2ff39ddf.js","static/core/734b5dbf.js","static/core/41d2fa95.js","static/core/727fabd0.js","static/core/caadce3e.js","static/core/36f4021e.js","static/core/5ae1e3a3.js","react","react/jsx-runtime","__delivery__/libs","react-dom","vite/preload-helper","classnames","dayjs"],function(fo,no,Nm){const to=fo("./2ff39ddf.js"),xo=fo("./734b5dbf.js"),r=fo("./41d2fa95.js"),wo=fo("./727fabd0.js"),di=fo("./caadce3e.js"),Oa=fo("./36f4021e.js"),z=fo("./5ae1e3a3.js");let n=fo("react");n=to.__toESM(n);let o=fo("react/jsx-runtime"),t=fo("__delivery__/libs"),$a=fo("react-dom"),Lt=fo("vite/preload-helper"),De=fo("classnames");De=to.__toESM(De);let Oo=fo("dayjs");Oo=to.__toESM(Oo);var g=to.__toESM(r.require_prop_types());async function Sr(e){if(typeof createImageBitmap=="function")try{const i=await createImageBitmap(e);try{return{width:i.width,height:i.height}}finally{i.close?.()}}catch{}return new Promise((i,l)=>{const s=URL.createObjectURL(e),a=new Image;a.onload=()=>{URL.revokeObjectURL(s);const d=a.naturalWidth||a.width,c=a.naturalHeight||a.height;d>0&&c>0?i({width:d,height:c}):l(new Error("Could not read image dimensions"))},a.onerror=()=>{URL.revokeObjectURL(s),l(new Error("Could not decode image"))},a.src=s})}function ft(e){return e.trim()}var Fa=67108864,Ma=2e3;function Ot(e){e.abandonTimer!==void 0&&(clearTimeout(e.abandonTimer),e.abandonTimer=void 0)}function Tr(e,i){return i?new Promise((l,s)=>{if(i.aborted){s(new DOMException("Aborted","AbortError"));return}const a=()=>{s(new DOMException("Aborted","AbortError"))};i.addEventListener("abort",a,{once:!0}),e.then(d=>{i.removeEventListener("abort",a),l(d)},d=>{i.removeEventListener("abort",a),s(d)})}):e}function Da(e={}){const i=e.maxCacheBytes??Fa,l=e.abandonDelayMs??Ma,s=new Map,a=new Map;let d=0;function c(_){const E=s.get(_);E&&(d-=E.size,s.delete(_))}function p(_,E){if(c(_),!(E.size>i)){s.set(_,E),d+=E.size;for(const w of s.keys()){if(d<=i)break;c(w)}}}function f(_){const E=a.get(_);E&&(Ot(E),a.delete(_))}function x(_,E){E.waiters-=1,!(E.waiters>0||E.abandonTimer!==void 0||a.get(_)!==E)&&(E.abandonTimer=setTimeout(()=>{E.abandonTimer=void 0,!(a.get(_)!==E||E.waiters>0)&&(a.delete(_),E.controller.abort())},l))}function k(_,E,w){return E.waiters+=1,Ot(E),w.then(()=>x(_,E),()=>x(_,E)),w}async function b(_,E,w){const v=ft(_);if(!v)throw new Error("Empty image URL");const P=s.get(v);if(P){if(E?.aborted)throw new DOMException("Aborted","AbortError");return s.delete(v),s.set(v,P),P}const j=a.get(v);if(j)return k(v,j,Tr(j.promise,E));const C=new AbortController,I={promise:w(v,C.signal).then(K=>(f(v),p(v,K),K)).catch(K=>{throw f(v),K}),controller:C,waiters:0,abandonTimer:void 0};return a.set(v,I),k(v,I,Tr(I.promise,E))}function h(_){const E=ft(_);if(!E)return;const w=a.get(E);w&&(Ot(w),w.controller.abort(),a.delete(E)),c(E)}function T(){for(const[,_]of a)Ot(_),_.controller.abort();a.clear(),s.clear(),d=0}return{resolve:b,abandonKey:h,invalidateAll:T}}async function Rr(e,i){if(!e||typeof e.findFileByUrl!="function")return null;const l=await e.findFileByUrl(i);if(!l)return null;const s=typeof e.getFileById=="function"&&l.id&&await e.getFileById(l.id)||l,a=s.url||i,d=s.thumbnailUrl||s.thumbnail||a||(typeof e.getThumbnailUrl=="function"?await e.getThumbnailUrl(s):"")||"";return d?{file:s,previewUrl:d}:null}function $t(e){if(!e)return!1;try{return new URL(e,typeof window<"u"&&window.location?window.location.origin:"http://localhost").pathname.includes("/static/media/")}catch{return!1}}function Va(e){if(!(e instanceof Blob)||e.size===0)throw new r.e("Failed to download file from the URL.","UploadUrlDownloadFailed");const i=e.type?.split(";")[0]?.trim()||"image/png";if(!i.startsWith("image/"))throw new r.e("Content type at the URL is not allowed.","UploadUrlContentTypeNotAllowed");return{blob:e,mimeType:i}}async function Ha(e,i){const l=await fetch(e,i);if(!l.ok)throw new Error(`Server returned ${l.status}`);return l.blob()}async function Ua(e,i,l){const s=l?{signal:l}:void 0,{blob:a}=await r.ie(e,{handleFileProxy:async d=>{const c=await i.fireFileProxy(d);return r.pickFileProxyBlobFromFireResults(c)??null},handleProxyUrl:async d=>{const c=await i.fireProxyUrl(d);return r.pickProxyUrlOverrideFromFireResults(c,d)},fetchWithProxy:(d,c,p)=>xo.fetchWithResourceProxy(d,{config:i.appConfig,standalone:i.isStandalone,intent:p?.intent||"downloadBlob",validateBlob:async f=>!f.type||f.type.startsWith("image/"),init:c})},d=>Ha(d,s),Va,{fetchInit:s});return a}function yr(){const e=r.useAppConfig(),i=r.useIsStandalone(),l=r.useProjectData(),s=r.useEditorProjectId(),a=l?.id!==void 0?String(l.id):s||"",d=r.useEventEmitter(xo.events.FILE_PROXY_EVENT_ID),c=r.useEventEmitter(xo.events.PROXY_URL_EVENT_ID);return(0,n.useCallback)(async(p,f)=>Ua(p,{appConfig:e,isStandalone:i,fireFileProxy:x=>d.fire({url:x,project:a}),fireProxyUrl:x=>c.fire({url:x,project:a})},f),[e,a,i,d,c])}function Wa(e){return xo.getContainer(e).getOrCreateInstance(xo.IMAGE_BLOB_RESOLVER_ID,()=>Da())}function wr(){const e=r.useStore();return(0,n.useMemo)(()=>Wa(e),[e])}function Ft(e){const i=String(e??"").split(";")[0].trim();if(!i)return"";const l=i.toLowerCase(),s=l.indexOf("/");if(s===-1)return l;const a=l.slice(s+1);return a==="svg+xml"?"svg":a}var jr=e=>typeof e=="string"&&/^https?:\/\//i.test(e.trim()),ci=({onChange:e,value:i,validateStatus:l,placeholder:s,disabled:a,name:d,elementSettings:c,imageInfo:p,previewReloadSignal:f,onRemotePreviewValidate:x})=>{const k=r.useCurrentUser(),b=r.useProjectData(),h=r.useAppConfig(),T=r.useIsStandalone(),{__:_}=r.useI18n();r.useSendPostMessage();const E=r.useSendPostMessageEx(),{openImagePicker:w}=r.useImagePicker(),v=r.useStorageProvider(),P=r.useRestClient(),j=b?.id!==void 0?String(b?.id):"",C=k?.id!=="0"?String(k.id):"",{dataProvider:I}=(0,n.useMemo)(()=>r.buildResolvedFileManagerProviders({storageProvider:v,projectId:j,restApi:P,i18n:{__:_},pathPostfix:C,appConfig:h,isStandalone:T}),[h,T,j,P,v,C,_]),K=yr(),[U]=r.useLazyGetImageInfoQuery(),[O,L]=(0,n.useState)({width:"",height:"",size:""}),[R,G]=(0,n.useState)(!1),[J,te]=(0,n.useState)(0),[oe,he]=(0,n.useState)(""),be=(0,n.useRef)(""),ae=(0,n.useRef)(f?.counter||0),ke=wr(),Ce=(0,n.useRef)(""),de=(0,n.useRef)(""),[Fe,je]=(0,n.useState)(0),re=r.usePlanFeatureGate("image_editor"),Be=()=>{Ce.current&&(URL.revokeObjectURL(Ce.current),Ce.current="")};(0,n.useEffect)(()=>{if(!i){L({width:"",height:"",size:"",format:""}),be.current="",he(""),Be();return}if(i.startsWith("data:")||i.startsWith("blob:")){Be(),be.current=i,he(i),L({width:"",height:"",size:"",format:""});return}const Z=r.stripEmVersionFromUrlString(i);de.current=Z;const Q=ft(Z),W=new AbortController;let q=!1;const se=async ge=>{Be();const Ne=Fe?r.appendEmVersionForPreviewReload(ge):ge;be.current=Ne,he(Ne);try{const{data:ye}=await U(Z);return q||!ye?!1:(L({width:ye?.width,height:ye?.height,size:ye?.fileSize!=null?(ye.fileSize/1024).toFixed(0):"",format:Ft(ye?.format)}),!0)}catch{return!1}},xe=async()=>{const ge=await ke.resolve(Q,W.signal,K);if(q)return;const{width:Ne,height:ye}=await Sr(ge);if(q)return;Be();const $e=URL.createObjectURL(ge);Ce.current=$e,be.current=$e,he($e),L({width:Ne,height:ye,size:(ge.size/1024).toFixed(0),format:Ft(ge.type)})};return(async()=>{try{if(!T){const ge=await Rr(I,Z);if(ge?.previewUrl&&await se(ge.previewUrl))return}await xe()}catch{q||(Be(),be.current="",he(""),L({width:"",height:"",size:"",format:""}))}})(),()=>{q=!0,W.abort()}},[i,I,K,U,T,ke,Fe]);const ce=(0,n.useCallback)(()=>{const Z=de.current;Z&&ke.abandonKey(ft(Z)),je(Date.now())},[ke]);(0,n.useEffect)(()=>{!f?.counter||f.name!==d||f.counter!==ae.current&&(ae.current=f.counter,ce())},[d,f,ce]),(0,n.useEffect)(()=>()=>Be(),[]);const ee=async(Z=null)=>{const Q=d.startsWith("src"),W=Z||(Q?r.MODALS.UPLOAD_IMAGE_MODAL:r.MODALS.UPLOAD_BACKGROUND_MODAL),q=r.stripEmVersionFromUrlString(i||""),se=await w({kind:Q?"img":"background",currentUrl:$t(q)?"":q,entryModal:W});if(!se?.url)return;const xe=q===r.stripEmVersionFromUrlString(se.url);(!xe||se.url!==i)&&e(se.url),se.meta?.mode==="save"&&xe&&(ce(),Q&&E(r.EVENT_TYPES.SANDBOX_IMAGE_RESET,{url:String(se.url)}))},me=[{label:_("Upload"),key:"Upload",onClick:()=>ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD:r.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];h.imageCenterStockEnabled&&me.push({label:_("Stock"),key:"Stock",onClick:()=>ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_STOCK:r.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK)}),h.imageCenterGifEnabled&&me.push({label:_("GIF"),key:"GIF",onClick:()=>ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_GIF:r.MODALS.UPLOAD_BACKGROUND_MODAL_GIF)}),h.elementAIimageEnabled&&me.push({label:_("AI"),key:"AI",onClick:()=>ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_AI:r.MODALS.UPLOAD_BACKGROUND_MODAL_AI)});const ue=()=>{G(!1)};return(0,o.jsxs)("div",{className:(0,De.default)("upload-bg-image",{"upload-bg-image_disabled":a}),children:[i?(0,o.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:Z=>{Z.target?.closest(".upload-bg-image__edit")||Z.target?.closest(".upload-bg-image__edit-menu")||Z.target?.closest(".upload-bg-image__menu")||Z.target?.closest(".inputGroup")||ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD:r.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,o.jsx)(t.ui_kit$Dropdown,{arrow:!0,popupRender:()=>h.imagePathDropdownEnabled?(0,o.jsx)("div",{className:"inputGroup",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Image",component:t.icons$Image,size:20,strokeWidth:h.iconStrokeWidth,style:{verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:i,placeholder:s,name:d,disabled:a,className:"upload-bg-image__input"})}):(0,o.jsx)(o.Fragment,{}),classNames:{root:"upload-bg-image__dropdown-overlay"},styles:{root:{top:32,marginTop:"8px",width:347,left:0}},trigger:["hover"],placement:"bottom",getPopupContainer:Z=>Z.closest(".upload-bg-image__inner-wrap"),children:(0,o.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,o.jsx)("div",{className:"upload-bg-image__uploader",children:(0,o.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,o.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,o.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:oe?(0,o.jsx)("img",{className:"upload-bg-image__uploader-img",src:oe,alt:"",onLoad:()=>{x&&jr(r.stripEmVersionFromUrlString(i||""))&&x("success")},onError:()=>{const Z=de.current,Q=r.stripEmVersionFromUrlString(oe||""),W=r.stripEmVersionFromUrlString(Z||"");if(Z&&Q!==W){be.current=Z,he(Z);return}x&&jr(W)&&x("error")}}):(0,o.jsx)("div",{className:"upload-bg-image__uploader-img-placeholder","aria-hidden":!0})}),(0,o.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,o.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),O.width&&O.height?(0,o.jsxs)("div",{className:"image-size",children:[O.width," × ",O.height,!!c&&(c.type===r.ELEMENT_TYPES.IMG||c.type===r.ELEMENT_TYPES.CAROUSEL)&&" → "+p.renderedWidth+" × "+p.renderedHeight,(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsxs)("span",{children:[O.size," ",_("kB")]}),O.format&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsx)("span",{className:"image-size-format",children:O.format})]})]}):(0,o.jsx)(t.ui_kit$Text,{type:"secondary",className:"image-empty-text",children:s})]})}),(0,o.jsx)("div",{style:{flexGrow:1}}),O.format!=="gif"&&h.imageCenterEditorEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:_("Edit"),children:(0,o.jsx)(t.ui_kit$Text,{type:"link",className:"upload-bg-image__edit",children:(0,o.jsx)(r.EmIcons,{icon:"Edit",component:t.icons$Edit,size:16,strokeWidth:h.iconStrokeWidth,onClick:()=>{re.isLocked?(G(!0),te(r.FEATURE_UPSELL_SLIDE.image_editor)):ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_EDIT:r.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT)}})})}),(0,o.jsx)(t.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:me},classNames:{root:"upload-bg-image__menu"},children:(0,o.jsx)(t.ui_kit$Text,{type:"link",className:"upload-bg-image__edit-menu image-change",children:i?(0,o.jsx)(r.EmIcons,{size:16,strokeWidth:h.iconStrokeWidth,icon:"SyncOutlined",component:t.icons$SyncOutlined,onClick:()=>ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD:r.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD)}):_("Upload")})},"Actions")]}):(0,o.jsx)(t.ui_kit$Button,{type:"default",block:!0,onClick:()=>ee(d.startsWith("src")?r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD:r.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD),icon:(0,o.jsx)(r.EmIcons,{icon:"Image",component:t.icons$Image,size:16,strokeWidth:h.iconStrokeWidth}),children:_("Add image")}),(0,o.jsx)(r.PlanUpgradePrompt,{open:R,onCancel:ue,initialSlide:J})]})};ci.propTypes={};var za=e=>typeof e=="string"&&/^https?:\/\//i.test(e.trim()),Ga=(e,i,l)=>i||(l?.type===r.ELEMENT_TYPES.CAROUSEL?["images",e]:Array.isArray(e)?e:[e]),vr=e=>Array.isArray(e)?e.join("_"):e,No=({form:e,label:i,name:l,watchPath:s,disabled:a=!1,elementSettings:d,previewReloadSignal:c=void 0})=>{const{token:p}=(0,t.ui_kit$useToken)(),[f,x]=(0,n.useState)("success"),k=(0,n.useMemo)(()=>({marginBottom:p.formItemMarginBottomXS}),[p.formItemMarginBottomXS]),b=t.ui_kit$Form.useWatch(Ga(l,s,d),e);return(0,n.useEffect)(()=>{if(!b){x("");return}if(typeof b=="string"&&(b.startsWith("data:")||b.startsWith("blob:"))){x("success");return}if(za(b)){x("validating");return}x("success")},[b]),(0,o.jsx)(t.ui_kit$Form.Item,{name:l,validateStatus:f,style:k,children:(0,o.jsx)(ci,{validateStatus:f,placeholder:i,name:vr(l),disabled:a,elementSettings:d,imageInfo:d?.type===r.ELEMENT_TYPES.CAROUSEL?d?.carouselImages?.[vr(l).split("_")[1]]:d,previewReloadSignal:c,onRemotePreviewValidate:x})})};No.propTypes={label:g.default.string.isRequired,name:g.default.oneOfType([g.default.string,g.default.arrayOf(g.default.oneOfType([g.default.string,g.default.number]))]).isRequired,watchPath:g.default.arrayOf(g.default.oneOfType([g.default.string,g.default.number])),tooltipTitle:g.default.string,disabled:g.default.bool,previewReloadSignal:g.default.shape({name:g.default.string,counter:g.default.number}),form:g.default.shape({getFieldValue:g.default.func.isRequired}).isRequired},No.defaulProps={disabled:!1,previewReloadSignal:null};var So=({form:e,oneBorderRadiusValue:i,setOneBorderRadiusValue:l,elementSettings:s,namePrefix:a="",typeOfForm:d="desktop"})=>{const c=r.useSendPostMessage(),p=d==="mobile",f=p?"mobileBorderRadius":"borderRadius",x=p?"mobileBorderRadiusAll":"borderRadiusAll",k=p?"mobileBorderRadiusTopLeft":"borderRadiusTopLeft",b=p?"mobileBorderRadiusTopRight":"borderRadiusTopRight",h=p?"mobileBorderRadiusBottomRight":"borderRadiusBottomRight",T=p?"mobileBorderRadiusBottomLeft":"borderRadiusBottomLeft",_=p?z.MOBILE_BORDER_RADIUS_POSITION:z.BORDER_RADIUS_POSITION,E=()=>{const w=e.getFieldsValue(!0);let v;i?(e.setFieldsValue({[k]:w[x]||null,[T]:w[x]||null,[b]:w[x]||null,[h]:w[x]||null}),v={[f]:{[_[k]]:w[x]||0,[_[T]]:w[x]||0,[_[b]]:w[x]||0,[_[h]]:w[x]||0}}):w[k]===w[T]&&w[k]===w[b]&&w[k]===w[h]?(e.setFieldsValue({[x]:w[k]}),v={[f]:{[_[x]]:w[k]}}):(e.setFieldsValue({[k]:null,[T]:null,[b]:null,[h]:null}),v={[f]:{[_[x]]:0,[_[k]]:0,[_[T]]:0,[_[b]]:0,[_[h]]:0}});const P=p?{mobileBorderRadius:{all:w.mobileBorderRadiusAll||null,classNamePrefix:"em-mob-border_radius_all-"}}:{[`${a}${f}`]:{...s[`${a}${f}`],...v[`${a}${f}`]}};c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:s.type,settings:P}),l(j=>!j)};return(0,o.jsx)(t.ui_kit$FormBorderRadiusInputs,{namePrefix:a,typeOfForm:d,oneBorderRadiusValue:i,onToggle:E,borderRadiusIcon:(0,o.jsx)(t.ui_kit$EmIcons,{icon:"BorderRadius",component:t.icons$BorderRadius,className:"selected-td-form__icon-radius"})})};So.displayName="SelectedElementFormBorderRadius";var Ya="em-mob-text_align-",Xa=({value:e,onChange:i,onSync:l,fieldName:s,...a})=>{const d=(typeof e=="object"?e?.value:e)??"",c=p=>{const f={classNamePrefix:Ya,value:p};i?.(f),l?.({[s]:f})};return(0,o.jsx)(t.ui_kit$FormAlignControl,{value:d,onChange:c,...a})},Uo=({form:e,elementSettings:i,imgParent:l=!1,name:s="align",tooltipTitle:a,typeOfForm:d="desktop"})=>{const c=r.useSendPostMessage(),p=r.useAppConfig(),f=d==="mobile",x=f?"mobileAlign":s;if(f){const k=b=>{c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:b})};return(0,o.jsx)(t.ui_kit$Form.Item,{name:x,children:(0,o.jsx)(Xa,{fieldName:x,onSync:k,disabled:l&&!i.parent,strokeWidth:p.iconStrokeWidth,tooltipTitle:a})})}return(0,o.jsx)(t.ui_kit$Form.Item,{name:x,children:(0,o.jsx)(t.ui_kit$FormAlignControl,{disabled:l&&!i.parent,strokeWidth:p.iconStrokeWidth,tooltipTitle:a})})},Mo=({form:e,elementSettings:i,tooltipTitle:l,disabled:s=!1,isNewIconType:a=!1,typeOfForm:d="desktop"})=>{const c=r.useSendPostMessage(),p=r.useAppConfig(),f=d==="mobile",x=f?"mobileVerticalAlign":"valign",k=b=>{e.setFieldsValue({[x]:b}),f||c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:{[x]:b}})};return(0,o.jsx)(t.ui_kit$Form.Item,{name:x,children:(0,o.jsx)(t.ui_kit$FormVerticalAlignControl,{...!f&&{value:i.valign,onChange:k},disabled:s,isNewIconType:a,strokeWidth:p.iconStrokeWidth})})},Ka=["mobileBoxShadowHOffset","mobileBoxShadowVOffset","mobileBoxShadowBlurRadius","mobileBoxShadowSpreadRadius","mobileBoxShadowColor","mobileBoxShadowInset"],qa=({form:e,elementSettings:i,enableSwitch:l,usedColors:s,withoutShadowLabel:a})=>{const d=r.useSendPostMessage(),c=i.mobileBoxShadow,[p,f]=(0,n.useState)(!c||c.hOffset===0&&c.vOffset===0&&c.blurRadius===0&&c.spreadRadius===0),x=t.ui_kit$Form.useWatch(Ka,e);(0,n.useEffect)(()=>{if(!x)return;const[b,h,T,_,E,w]=x;(b===0||b===void 0||b===null)&&(h===0||h===void 0||h===null)&&(T===0||T===void 0||T===null)&&(_===0||_===void 0||_===null)&&(E===""||E===void 0||E===null)&&(w===!1||w===void 0)||f(!1)},[x]);const k=()=>{f(b=>!b),e.setFieldsValue({mobileBoxShadowHOffset:p?"":0,mobileBoxShadowVOffset:p?"":0,mobileBoxShadowBlurRadius:p?"":0,mobileBoxShadowSpreadRadius:p?"":0,mobileBoxShadowColor:"",mobileBoxShadowInset:!1}),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:{mobileBoxShadow:{classNamePrefix:"em-mob-box_shadow-",hOffset:p?null:0,vOffset:p?null:0,blurRadius:p?null:0,spreadRadius:p?null:0,color:null,inset:!1}}})};return(0,o.jsxs)(o.Fragment,{children:[l&&(0,o.jsx)("div",{style:{float:"right",marginTop:-9,marginRight:50},children:(0,o.jsx)(t.ui_kit$Switch,{id:"without-shadow",label:a,labelSize:"small",size:"small",checked:p,onChange:k})}),(0,o.jsx)("p",{style:{paddingBottom:"8px",margin:"-30px 0 0"},children:" "}),(0,o.jsx)(t.ui_kit$FormBoxShadowInputs,{typeOfForm:"mobile",usedColors:s})]})},jo=({typeOfForm:e="desktop",form:i,elementSettings:l,enableSwitch:s=!0})=>{const{__:a}=r.useI18n(),d=r.useSelector(r.selectEmailSettings).usedColors;return e==="mobile"&&i&&l?(0,o.jsx)(qa,{form:i,elementSettings:l,enableSwitch:s,usedColors:d,withoutShadowLabel:a("Without shadow")}):(0,o.jsx)(t.ui_kit$FormBoxShadowInputs,{typeOfForm:e,usedColors:d})};jo.displayName="SelectedElementFormBoxShadow";var vo=({form:e,elementSettings:i,directionControl:l})=>{const{__:s}=r.useI18n();return(0,o.jsx)(t.ui_kit$FormDisplayControl,{directionControl:l,className:"selected-element-form-show",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"show",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$Radio.Group,{children:(0,o.jsxs)(t.ui_kit$Space,{size:8,children:[(0,o.jsx)(t.ui_kit$Radio.Button,{value:"all",children:s("Both")}),(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:s("Desktop"),children:(0,o.jsx)(t.ui_kit$Radio.Button,{value:"desktop",children:(0,o.jsx)(r.EmIcons,{icon:"DesktopOutlined",component:t.icons$DesktopOutlined})})}),(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:s("Mobile"),children:(0,o.jsx)(t.ui_kit$Radio.Button,{value:"mobile",children:(0,o.jsx)(r.EmIcons,{icon:"MobileOutlined",component:t.icons$MobileOutlined})})})]})})})})},ui=({form:e,elementSettings:i,handleChangeValues:l})=>{const{__:s}=r.useI18n(),a=(0,n.useRef)(),{token:d}=(0,t.ui_kit$useToken)(),[c,p]=(0,n.useState)(!1),[f,x]=(0,n.useState)(!1),[k,b]=(0,n.useState)(!1),[h,T]=(0,n.useState)(!1),[_,E]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let L=new URL("https://emailmaker.ru/?"+i.countdown);p(L.searchParams.get("font1").endsWith("-b")||L.searchParams.get("font1").endsWith("-bi")),x(L.searchParams.get("font1").endsWith("-i")||L.searchParams.get("font1").endsWith("-bi")),b(L.searchParams.get("font2").endsWith("-b")||L.searchParams.get("font2").endsWith("-bi")),T(L.searchParams.get("font2").endsWith("-i")||L.searchParams.get("font2").endsWith("-bi")),E(L.searchParams.get("tp")==="true")},[i]);const w=[{value:"-12",label:s("-12:00 Apia")},{value:"-11",label:s("-11:00 Pago Pago, Midway Atoll")},{value:"-10",label:s("-10:00 Honolulu, Anchorage")},{value:"-9",label:s("-9:00 Anchorage, Yukon")},{value:"-8",label:s("-8:00 Los Angeles, Vancouver")},{value:"-7",label:s("-7:00 Denver, Phoenix")},{value:"-6",label:s("-6:00 Mexico City, Guadalajara")},{value:"-5",label:s("-5:00 New York, Toronto, Havana")},{value:"-4",label:s("-4:00 Caracas, Santo Domingo")},{value:"-3",label:s("-3:00 Buenos Aires, Santiago, Montevideo")},{value:"-2",label:s("-2:00 South Georgia, Saint Helena")},{value:"-1",label:s("-1:00 Azores, Cape Verde")},{value:"0",label:s("+0:00 London, Lisbon, Dublin")},{value:"1",label:s("+1:00 Paris, Berlin, Rome")},{value:"2",label:s("+2:00 Athens, Kiev, Istanbul")},{value:"3",label:s("+3:00 Istanbul, Doha, Baghdad")},{value:"4",label:s("+4:00 Baku, Dubai, Tbilisi")},{value:"5",label:s("+5:00 Karachi, Tashkent, Islamabad")},{value:"6",label:s("+6:00 Almaty, Dhaka, Bishkek")},{value:"7",label:s("+7:00 Bangkok, Ho Chi Minh City, Jakarta")},{value:"8",label:s("+8:00 Beijing, Hong Kong, Singapore")},{value:"9",label:s("+9:00 Tokyo, Seoul, Jayapura")},{value:"10",label:s("+10:00 Sydney, Melbourne, Port Moresby")},{value:"11",label:s("+11:00 Honiara, Nuku'alofa, Apia")}],v=[{value:"20",label:s("20 s")},{value:"40",label:s("40 s")},{value:"60",label:s("60 s")}],P=[{value:"arial",label:"Arial"},{value:"courier-new",label:"Courier New"},{value:"georgia",label:"Georgia"},{value:"helvetica",label:"Helvetica"},{value:"tahoma",label:"Tahoma"},{value:"times-new-roman",label:"Times New Roman"},{value:"trebuchet-ms",label:"Trebuchet MS"},{value:"verdana",label:"Verdana"},{value:"open-sans",label:"Open Sans"},{value:"roboto",label:"Roboto"}],j=L=>L&&L<(0,Oo.default)().endOf("day")-864e5,C=L=>{E(L)},I=()=>{const L=!c;e.setFieldValue("countdownNumbersStrong",L),l({countdownNumbersStrong:L}),p(L)},K=()=>{const L=!f;e.setFieldValue("countdownNumbersItalic",L),l({countdownNumbersItalic:L}),x(L)},U=()=>{const L=!k;e.setFieldValue("countdownLabelsStrong",L),l({countdownLabelsStrong:L}),b(L)},O=()=>{const L=!h;e.setFieldValue("countdownLabelsItalic",L),l({countdownLabelsItalic:L}),T(L)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:s("End time"),name:"countdownTime",children:(0,o.jsx)(t.ui_kit$DatePicker,{ref:a,format:"MM/DD/YYYY HH:mm",disabledDate:j,showTime:!0,placement:"bottomRight",getPopupContainer:L=>{const R=L?.closest(".blocks-app");return R||(L?.ownerDocument?.body??document.body)},allowClear:!1,allowEmpty:!1})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:s("Time zone"),name:"countdownTimeZone",style:{width:"100%"},children:(0,o.jsx)(t.ui_kit$Select,{placeholder:s("Select the time zone"),getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),children:w.map(L=>(0,o.jsx)(t.ui_kit$Select.Option,{value:L.value,children:L.label},L.value))})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:20,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:s("Background color"),name:"countdownBackgroundColor",className:"countdown-color",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:s("Background color"),usedColors:i.usedColors})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownTransparency",valuePropName:"checked",style:{paddingTop:29},children:(0,o.jsx)(t.ui_kit$Switch,{id:"countdownTransparency",label:s("Transparency"),labelSize:"small",size:"small",onChange:C})})})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:s("Countdown font settings"),compact:!0,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownNumbersFont",style:{marginBottom:d.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Select,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:P})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownNumbersColor",className:"countdown-color",style:{marginBottom:d.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{usedColors:i.usedColors})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownNumbersFontSize",children:(0,o.jsx)(t.ui_kit$InputNumber,{min:12,placeholder:s("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:s("Strong"),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownNumbersStrong",children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:I,children:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-td-form__icon-radius"})})})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:s("Italic"),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownNumbersItalic",children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":f}),onClick:K,children:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-td-form__icon-radius"})})})})})]})}),(0,o.jsx)(t.ui_kit$FormSection,{title:s("Time units font settings"),compact:!0,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownLabelsFont",style:{marginBottom:d.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Select,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:P})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownLabelsColor",className:"countdown-color",style:{marginBottom:d.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{usedColors:i.usedColors})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownLabelsFontSize",children:(0,o.jsx)(t.ui_kit$InputNumber,{min:8,placeholder:s("Font size"),addonAfter:"px",prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined})})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:s("Strong"),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownLabelsStrong",children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":k}),onClick:U,children:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-td-form__icon-radius"})})})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:s("Italic"),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"countdownLabelsItalic",children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":h}),onClick:O,children:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-td-form__icon-radius"})})})})})]})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:s("Language"),name:"countdownLanguage",style:{width:"100%"},children:(0,o.jsx)(t.ui_kit$Select,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:[{value:"ru_RU",label:"Русский"},{value:"en_US",label:"English"},{value:"uk_UA",label:"Українська"},{value:"pt_BR",label:"Português"},{value:"fr-CA",label:"Français"},{value:"de_DE",label:"Deutsch"},{value:"pl_PL",label:"Polski"},{value:"es_ES",label:"Español"},{value:"tr_TR",label:"Türkçe"},{value:"lt_LT",label:"Lietuvių kalba"},{value:"lv_LV",label:"Latviešu valoda"},{value:"et_EE",label:"Eesti keel"},{value:"hu_HU",label:"Magyar"},{value:"el_GR",label:"Ελληνικά"},{value:"it_IT",label:"Italiano"}]})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:s("Duration"),name:"countdownDuration",style:{width:"100%"},children:(0,o.jsx)(t.ui_kit$Select,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:v})})})]})]})};ui.propTypes={form:g.default.shape({setFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired,tooltipTitle:g.default.string};var mi=({form:e,elementSettings:i})=>{const{__:l}=r.useI18n(),{token:s}=(0,t.ui_kit$useToken)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("URL of the video clip."),placement:"right",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:["video","source"],className:"selected-image-form__alt",children:(0,o.jsx)(t.ui_kit$Input,{allowClear:!0,placeholder:l("Video URL"),prefix:(0,o.jsx)(r.EmIcons,{icon:"VideoCameraOutlined",component:t.icons$VideoCameraOutlined})})})}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("Play button"),name:["video","playButton"],style:{width:"100%",marginBottom:s.formItemMarginBottomMD+4},children:(0,o.jsxs)(t.ui_kit$Select,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),children:[(0,o.jsxs)(t.ui_kit$Select.Option,{value:"youtube_red",children:[(0,o.jsx)(r.EmIcons,{icon:"YoutubeOutlined",component:t.icons$YoutubeOutlined,style:{color:"#FF0000"}})," ",l("Youtube Red")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"youtube_black",children:[(0,o.jsx)(r.EmIcons,{icon:"YoutubeOutlined",component:t.icons$YoutubeOutlined})," ",l("Youtube Black")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"youtube_white",children:[(0,o.jsx)(r.EmIcons,{icon:"YoutubeOutlined",component:t.icons$YoutubeOutlined,style:{color:"#aaa"}})," ",l("Youtube White")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"vimeo",children:[(0,o.jsx)(r.EmIcons,{icon:"Vimeo",component:t.icons$Vimeo})," ",l("Vimeo")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"white_circle",children:[(0,o.jsx)(r.EmIcons,{icon:"PlayCircleOutlined",component:t.icons$PlayCircleOutlined,style:{color:"#aaa"}})," ",l("White circle")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"black_circle",children:[(0,o.jsx)(r.EmIcons,{icon:"PlayCircleOutlined",component:t.icons$PlayCircleOutlined})," ",l("Black circle")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"white_circle_outlined",children:[(0,o.jsx)(r.EmIcons,{icon:"RightCircleOutlined",component:t.icons$RightCircleOutlined,style:{color:"#aaa"}})," ",l("White circle outlined")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"black_circle_outlined",children:[(0,o.jsx)(r.EmIcons,{icon:"RightCircleOutlined",component:t.icons$RightCircleOutlined})," ",l("Black circle outlined")]}),(0,o.jsxs)(t.ui_kit$Select.Option,{value:"none",children:[" ",l("Without button")]})]})})]})};mi.propTypes={form:g.default.shape({setFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired,tooltipTitle:g.default.string};var Ja={marginBottom:10},Io=()=>{const{__:e}=r.useI18n();return(0,o.jsx)(t.ui_kit$Row,{gutter:20,style:Ja,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"ampShow",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$Radio.Group,{children:(0,o.jsxs)(t.ui_kit$Space,{size:8,children:[(0,o.jsx)(t.ui_kit$Radio.Button,{value:"all",children:e("Both")}),(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:e("AMP"),children:(0,o.jsx)(t.ui_kit$Radio.Button,{value:"amp",children:"AMP"})}),(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:e("HTML"),children:(0,o.jsx)(t.ui_kit$Radio.Button,{value:"html",children:"HTML"})})]})})})})})},{Option:pi}=t.ui_kit$Select,{mobileBorderRadiusAll:Qa,mobileBorderRadiusTopLeft:hi,mobileBorderRadiusBottomLeft:bi,mobileBorderRadiusTopRight:fi,mobileBorderRadiusBottomRight:gi,borderRadiusBottomRight:_i,borderRadiusTopRight:xi,borderRadiusBottomLeft:ki,borderRadiusTopLeft:Ei,alt:Za,src:en,title:on,link:lt,borderRadiusAll:Ir,imgReplacer:tn,expanded:rn}={link:"link",borderRadiusBottomRight:"borderRadiusBottomRight",borderRadiusTopRight:"borderRadiusTopRight",borderRadiusBottomLeft:"borderRadiusBottomLeft",borderRadiusTopLeft:"borderRadiusTopLeft",mobileBorderRadiusAll:"mobileBorderRadiusAll",mobileBorderRadiusTopLeft:"mobileBorderRadiusTopLeft",mobileBorderRadiusBottomLeft:"mobileBorderRadiusBottomLeft",mobileBorderRadiusTopRight:"mobileBorderRadiusTopRight",mobileBorderRadiusBottomRight:"mobileBorderRadiusBottomRight",alt:"alt",imgReplacer:"imgReplacer",src:"src",title:"title",borderRadiusAll:"borderRadiusAll",expanded:"expanded"},Qo=({linkProtocol:e})=>{switch(e){case"https://":return(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined});case"mailto:":return(0,o.jsx)(r.EmIcons,{icon:"MailOutlined",component:t.icons$MailOutlined});case"tel:":return(0,o.jsx)(r.EmIcons,{icon:"PhoneOutlined",component:t.icons$PhoneOutlined});case"sms:":return(0,o.jsx)(r.EmIcons,{icon:"CommentOutlined",component:t.icons$CommentOutlined});case"ftp://":return(0,o.jsx)(r.EmIcons,{icon:"FileOutlined",component:t.icons$FileOutlined});case"#":return(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined});default:return(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined})}},ln=e=>[{value:"https://",label:e("Site")},{value:"mailto:",label:e("E-mail")},{value:"tel:",label:e("Phone")},{value:"sms:",label:e("SMS")},{value:"ftp://",label:e("File")},{value:"#",label:e("Anchor")},{value:"",label:e("Other")}],Zo=({handleLinkProtocolsChange:e,linkProtocol:i,__:l})=>{const s=n.default.useMemo(()=>ln(l),[l]);return(0,o.jsx)(t.ui_kit$Select,{style:{width:90,textAlign:"left"},value:i,onChange:e,options:s,popupMatchSelectWidth:!1,listHeight:320})},et=({show:e,__:i,style:l,className:s})=>{const a=n.default.useMemo(()=>({marginBottom:8,...l}),[l]);return e?(0,o.jsx)(t.ui_kit$Alert,{className:s,title:i("Anchor links do not work in Outlook, Gmail, and several other email clients."),type:"warning",showIcon:!0,style:a}):null},Bi=e=>!(!e.startsWith("#")||e.indexOf("#",1)!==-1),sn=/^(?:<\s*[a-z][\w:-]*\b[^>]*\s+)?href\s*=\s*(["'])((?:\\.|(?!\1).)*?)\1(?:\s*\/?>)?\s*$/i,an=/^(?:<\s*[a-z][\w:-]*\b[^>]*\s+)?href\s*=\s*([^\s/>]+)(?:\s*\/?>)?\s*$/i;function ot(e){if(typeof e!="string")return e;let i=e.trim();if(!i)return i;const l=i.match(sn);if(l)i=l[2];else{const s=i.match(an);s&&(i=s[1])}return i.startsWith("https://http")&&(i=i.substring(8)),i}var Mt=(e,i="https://")=>e?e.startsWith("https://")||e.startsWith("http://")?"https://":e.startsWith("mailto:")?"mailto:":e.startsWith("tel:")?"tel:":e.startsWith("sms:")?"sms:":e.startsWith("ftp://")?"ftp://":Bi(e)?"#":"":i,Wo=(e,i)=>{const l=Mt(e,"");return i(l),l},Cr=e=>{if(!e||!e.startsWith("mailto:"))return{subject:"",body:"",baseEmail:e||""};try{const i=new URL(e),l=e.split("?")[0];return{subject:i.searchParams.get("subject")||"",body:i.searchParams.get("body")||"",baseEmail:l}}catch{return{subject:"",body:"",baseEmail:e.split("?")[0]}}},Si=(e,i,l)=>{if(!e||!e.startsWith("mailto:"))return e;const s=e.split("?")[0],a=[];return i&&a.push(`subject=${encodeURIComponent(i)}`),l&&a.push(`body=${encodeURIComponent(l)}`),a.length>0?`${s}?${a.join("&")}`:s},u=e=>e||(e===0?"0":""),po=e=>e&&e!=="auto"?e:e===0?"0":"",Pr=(e,i)=>{if(typeof e=="object"&&e!==null&&"value"in e){if(e.value)return e.value;if(e.value==="")return""}return typeof e=="string"&&e?e:i||""};function Ti(e){const i={...e,link:e.link==null?"https://":e.link,borderRadiusAll:u(e.borderRadius?.all),borderRadiusTopLeft:u(e.borderRadius?.topLeft),borderRadiusBottomLeft:u(e.borderRadius?.bottomLeft),borderRadiusTopRight:u(e.borderRadius?.topRight),borderRadiusBottomRight:u(e.borderRadius?.bottomRight),mobileBorderRadiusAll:u(e.mobileBorderRadius?.all),mobileBorderRadiusTopLeft:u(e.mobileBorderRadius?.topLeft!==null?e.mobileBorderRadius?.topLeft:e.mobileBorderRadius?.all),mobileBorderRadiusBottomLeft:u(e.mobileBorderRadius?.bottomLeft!==null?e.mobileBorderRadius?.bottomLeft:e.mobileBorderRadius?.all),mobileBorderRadiusTopRight:u(e.mobileBorderRadius?.topRight!==null?e.mobileBorderRadius?.topRight:e.mobileBorderRadius?.all),mobileBorderRadiusBottomRight:u(e.mobileBorderRadius?.bottomRight!==null?e.mobileBorderRadius?.bottomRight:e.mobileBorderRadius?.all),show:e.show?e.show:"all",altSrc:e.src};if(e.video&&(i.videoPlayButton=e.video.playButton??"youtube_red",i.videoSource=e.video.source??""),e.carouselImages?.length>0){const l={};e.carouselImages?.map((s,a)=>(Object.keys(s).forEach(d=>{l[d+"_"+a]=s[d]}),!0)),i.images=l}if(e.sections?.length>0){const l=[];e.sections?.map((s,a)=>(l.push({[`expanded_${a}`]:s.expanded}),!0)),i.sections=l}return i}function Ar(e,i,l){const s=l.hasOwnProperty("images"),a=l.hasOwnProperty("sections"),d=Object.keys(s?l.images:a?l.sections:l)[0],c=s?l.images:a?l.sections:l;let p={};const f=i.getFieldsValue(!0);switch(d.split("_")[0]){case on:case en:case Za:case tn:if(s){const k=[...e.carouselImages];k[d.split("_")[1]][d.split("_")[0]]=c[d],p={carouselImages:k}}else p=c;break;case rn:if(a){const k=[...e.sections];k[d.split("_")[1]][d.split("_")[0]]=c[d],p={sections:k}}break;case lt:let x=ot(c[d]);e.type===r.ELEMENT_TYPES.CAROUSEL?(p.carouselImages=e.carouselImages,s?(i.setFieldValue(["images",[lt+"_"+d.split("_")[1]]],x),p.carouselImages[d.split("_")[1]].link=x,p.link="",i.setFieldValue(lt,"")):(e.carouselImages.forEach((k,b)=>{i.setFieldValue(["images",lt+"_"+b],x),p.carouselImages[b].link=x,p.link=x}),i.setFieldValue(lt,x))):(i.setFieldValue(lt,x),p.link=x);break;case Ir:p={borderRadius:{...e.borderRadius,[z.BORDER_RADIUS_POSITION[Ei]]:f[Ei],[z.BORDER_RADIUS_POSITION[ki]]:f[ki],[z.BORDER_RADIUS_POSITION[xi]]:f[xi],[z.BORDER_RADIUS_POSITION[_i]]:f[_i],[z.BORDER_RADIUS_POSITION[d]]:+c[d]}};break;case Ei:case ki:case xi:case _i:p={borderRadius:{...e.borderRadius,[z.BORDER_RADIUS_POSITION[Ir]]:null,[z.BORDER_RADIUS_POSITION[d]]:+c[d]}};break;case Qa:case hi:case bi:case fi:case gi:p={mobileBorderRadius:{...e.mobileBorderRadius,[z.MOBILE_BORDER_RADIUS_POSITION[hi]]:f[hi],[z.MOBILE_BORDER_RADIUS_POSITION[bi]]:f[bi],[z.MOBILE_BORDER_RADIUS_POSITION[fi]]:f[fi],[z.MOBILE_BORDER_RADIUS_POSITION[gi]]:f[gi],[z.MOBILE_BORDER_RADIUS_POSITION[d]]:c[d],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[d]+"-"}};break;default:p=c}return{...e,...p}}var $o=(0,o.jsxs)(t.ui_kit$Select,{className:"select-after",children:[(0,o.jsx)(pi,{value:"px",children:"px"}),(0,o.jsx)(pi,{value:"%",children:"%"})]}),nn=(0,o.jsx)(t.ui_kit$Select,{className:"select-after",children:(0,o.jsx)(pi,{value:"px",children:"px"})}),Nr=({form:e,elementSettings:i,boxShadow:l,bordersShow:s,borderRadiusShow:a,boxShadowShow:d,oneBorderRadiusValue:c,setOneBorderRadiusValue:p,hasLink:f,hasAlt:x,hasTitle:k,isOpenSrcReplacer:b,mergeTagItems:h,mergeMenuOpen:T,setMergeMenuOpen:_,cascaderRef:E,linkInputRef:w,linkButtonRef:v,altInputRef:P,altButtonRef:j,titleInputRef:C,titleButtonRef:I,srcReplacerInputRef:K,srcReplacerButtonRef:U,linkProtocol:O,handleLinkProtocolsChange:L,linkButtonHandler:R,linkInputHandler:G,altButtonHandler:J,altInputHandler:te,titleButtonHandler:oe,titleInputHandler:he,srcReplacerButtonHandler:be,srcInputHandler:ae,handleSelect:ke,onChange:Ce,filter:de,renderSearchOption:Fe,handleChangeValues:je,toggleShowBorderHandler:re,toggleShowBorderRadiusHandler:Be,toggleShowBoxShadowHandler:ce})=>{const{__:ee}=r.useI18n(),{token:me}=(0,t.ui_kit$useToken)(),ue=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Uo,{form:e,elementSettings:i,imgParent:!0})}),ue.formImageFieldVerticalAlignEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:12,align:"right",children:(0,o.jsx)(Mo,{form:e,elementSettings:i})})]}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:i.type==="countdown"?15:24}}),i.type==="countdown"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ui,{form:e,elementSettings:i,handleChangeValues:je}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:24}})]}),ue.mergeTagsShow&&h&&(0,o.jsx)(t.ui_kit$Col,{span:24,id:"merge_tags_wrapper",children:(0,o.jsxs)(t.ui_kit$Form.Item,{style:{marginBottom:24},children:[(0,o.jsx)(t.ui_kit$Button,{id:"merge_tags_button",icon:(0,o.jsx)(r.EmIcons,{icon:"MergeTags",component:t.icons$MergeTags}),style:{width:"100%",display:T?"none":"inline-flex"},onClick:()=>_(!0),children:ee("Merge tags")}),(0,o.jsx)(t.ui_kit$Cascader,{ref:E,classNames:{popup:{root:"merge-tags"}},options:h,placeholder:ee("Start typing the title"),showSearch:{filter:de,render:Fe},spellCheck:"false",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),onChange:Ce,style:{display:T?"block":"none"},open:T,onKeyDown:Z=>{Z.key==="Escape"&&_(!1)}})]})}),i.type==="video"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(mi,{form:e,elementSettings:i}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:24}})]}),(i.type==="img"||i.type==="video")&&(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:0},children:(0,o.jsx)(No,{form:e,label:ee("Image path"),name:"src",placeholder:ee("Image path"),elementSettings:i,tooltipTitle:""})}),(0,o.jsxs)(t.ui_kit$Space,{size:8,style:{marginBottom:!x&&!f&&!k&&!b?me.formItemMarginBottomMD+4:me.formItemMarginBottomXS},children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:x||ee("Alternative text"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!x}),onClick:J,ref:j,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"})})}),ue.formFieldImageTitleEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:k||ee("Tooltip text"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!k}),onClick:oe,ref:I,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"})})}),(0,o.jsx)(t.ui_kit$Tooltip,{title:f||ee("Hyperlink URL"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!f}),icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-td-form__icon-radius"}),onClick:R,ref:v})}),ue.formImageFieldReplacerEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:ee("Image replacer"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":b}),icon:(0,o.jsx)(r.EmIcons,{icon:"Replacer",component:t.icons$Replacer,className:"selected-td-form__icon-radius"}),onClick:be,ref:U})})]}),(!!f||!!x||!!k||!!b)&&(0,o.jsxs)("div",{style:{marginBottom:me.formItemMarginBottomMD+4},children:[!!f&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(et,{show:O==="#",__:ee,style:{marginBottom:me.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:ee("Hyperlink URL"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:me.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{addonBefore:(0,o.jsx)(Zo,{linkProtocol:O,handleLinkProtocolsChange:L,__:ee}),placeholder:ee("Hyperlink URL"),allowClear:!0,ref:w,onChange:G,onSelect:ke,prefix:(0,o.jsx)(Qo,{linkProtocol:O})})})})]}),!!x&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:ee("Alternative text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:me.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:ee("Alternative text"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"}),onChange:te,ref:P,onSelect:ke})})}),ue.formFieldImageTitleEnabled&&!!k&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:ee("Tooltip text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:me.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:ee("Enter the title of the image"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"}),onChange:he,ref:C,onSelect:ke})})}),!!b&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:ee("Image src"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"imgReplacer",className:"selected-image-form__alt",style:{marginBottom:me.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:ee("Code that will replace the image `src`"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:ee("Image src")}),onChange:ae,ref:K,onSelect:ke})})})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:ee("Size"),dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormSizeInputs,{maxWidth:i.maxWidth,showHeight:ue.formImageFieldHeightEnabled,showMinMax:!1,gutter:me.marginSM,rowStyle:{marginBottom:ue.formImageFieldHeightEnabled?4:24},labels:{width:ee("Width"),height:ee("Height"),minWidth:ee("Minimum width"),maxWidth:ee("Maximum width")}})}),ue.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ee("Borders"),collapsible:!0,open:s,onToggle:re,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,elementSettings:i})}),ue.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ee("Border radius"),collapsible:!0,open:a,onToggle:Be,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:c,setOneBorderRadiusValue:p,elementSettings:i})}),ue.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ee("Box shadow"),collapsible:!0,open:d,onToggle:ce,dividerTop:!0,children:(0,o.jsx)(jo,{})}),ue.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ee("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})}),ue.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:ee("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};Nr.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,bordersShow:g.default.bool,borderRadiusShow:g.default.bool,boxShadowShow:g.default.bool,oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,hasLink:g.default.string,hasAlt:g.default.string,hasTitle:g.default.string,isOpenSrcReplacer:g.default.oneOfType([g.default.bool,g.default.number]),mergeTagItems:g.default.array,mergeMenuOpen:g.default.bool,setMergeMenuOpen:g.default.func,cascaderRef:g.default.object,linkInputRef:g.default.object,linkButtonRef:g.default.object,altInputRef:g.default.object,altButtonRef:g.default.object,titleInputRef:g.default.object,titleButtonRef:g.default.object,srcReplacerInputRef:g.default.object,srcReplacerButtonRef:g.default.object,linkProtocol:g.default.string,handleLinkProtocolsChange:g.default.func,linkButtonHandler:g.default.func,linkInputHandler:g.default.func,altButtonHandler:g.default.func,altInputHandler:g.default.func,titleButtonHandler:g.default.func,titleInputHandler:g.default.func,srcReplacerButtonHandler:g.default.func,srcInputHandler:g.default.func,handleSelect:g.default.func,onChange:g.default.func,filter:g.default.func,renderSearchOption:g.default.func,handleChangeValues:g.default.func,toggleShowBorderHandler:g.default.func,toggleShowBorderRadiusHandler:g.default.func,toggleShowBoxShadowHandler:g.default.func};var zo=({form:e,name:i,elementSettings:l,isPicture:s,tooltipTitle:a})=>{const{__:d}=r.useI18n(),c=r.useSendPostMessage(),p=(0,n.useRef)(),[f,x]=(0,n.useState)(l[i]?.value==="auto"),{token:k}=(0,t.ui_kit$useToken)(),[b,h]=(0,n.useState)(""),T=E=>{p.current.value=null,e.setFieldsValue({[i]:"",[i+"Dim"]:"px"}),x(w=>!w),c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{[i]:{classNamePrefix:"em-mob-width-",value:f?null:"auto",dim:""}}})},_=E=>{x(!1),h(e.getFieldsValue(!0)[i+"Dim"]==="%"?100:"")};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:a,placement:"bottom",children:(0,o.jsx)("div",{children:(0,o.jsx)(t.ui_kit$Form.Item,{name:i,style:{marginBottom:k.formItemMarginBottomXS/2},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{ref:p,min:0,max:b,placeholder:d("Width"),onChange:_,prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:(0,o.jsx)(t.ui_kit$Form.Item,{name:i+"Dim",noStyle:!0,children:$o})})})})}),!s&&(0,o.jsx)(t.ui_kit$Switch,{id:"auto-width",label:d("Auto"),labelSize:"small",size:"small",checked:f,onChange:T})]})};zo.propTypes={form:g.default.shape({setFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired,tooltipTitle:g.default.string};var tt=({form:e,name:i,elementSettings:l,isPicture:s,tooltipTitle:a})=>{const{__:d}=r.useI18n(),c=r.useSendPostMessage(),p=(0,n.useRef)(),[f,x]=(0,n.useState)(l.mobileHeight?.value==="auto"),{token:k}=(0,t.ui_kit$useToken)(),b=T=>{p.current.value=null,e.setFieldsValue({mobileHeight:"",mobileHeightDim:"px"}),x(_=>!_),c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{mobileHeight:{classNamePrefix:"em-mob-height-",value:f?null:"auto",dim:""}}})},h=T=>{x(!1)};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:a,placement:"bottom",children:(0,o.jsx)("div",{children:(0,o.jsx)(t.ui_kit$Form.Item,{name:i,style:{marginBottom:k.formItemMarginBottomXS/2},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{ref:p,min:0,placeholder:d("Height"),onChange:h,prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnHeightOutlined",component:t.icons$ColumnHeightOutlined}),addonAfter:"px"})})})}),!s&&(0,o.jsx)(t.ui_kit$Switch,{id:"auto-height",label:d("Auto"),labelSize:"small",size:"small",checked:f,onChange:b})]})};tt.propTypes={form:g.default.shape({setFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired,tooltipTitle:g.default.string};var Lr=({form:e,elementSettings:i,boxShadow:l,mobileBordersShow:s,mobileBorderRadiusShow:a,mobileBoxShadowShow:d,mobileSizeShow:c,oneMobileBorderRadiusValue:p,setOneMobileBorderRadiusValue:f,hasLink:x,hasAlt:k,hasTitle:b,linkInputRef:h,linkButtonRef:T,altInputRef:_,altButtonRef:E,titleInputRef:w,titleButtonRef:v,linkInputHandler:P,altButtonHandler:j,altInputHandler:C,titleButtonHandler:I,titleInputHandler:K,linkButtonHandler:U,toggleShowMobileBorderHandler:O,toggleShowMobileBorderRadiusHandler:L,toggleShowMobileBoxShadowHandler:R,toggleShowMobileSizeHandler:G})=>{const{__:J}=r.useI18n(),{token:te}=(0,t.ui_kit$useToken)(),oe=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:30,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Uo,{form:e,elementSettings:i,imgParent:!0,typeOfForm:"mobile"})}),oe.formImageFieldVerticalAlignEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:12,align:"right",children:(0,o.jsx)(Mo,{form:e,elementSettings:i,typeOfForm:"mobile"})})]}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:i.type==="countdown"?15:24}}),i.type==="countdown"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ui,{form:e,elementSettings:i}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:24}})]}),i.type==="video"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(mi,{form:e,elementSettings:i}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:24}})]}),(i.type==="img"||i.type==="video")&&(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:0},children:(0,o.jsx)(No,{form:e,label:J("Image path"),name:"src",placeholder:J("Image path"),elementSettings:i,tooltipTitle:""})}),(0,o.jsxs)(t.ui_kit$Space,{size:8,style:{marginBottom:!k&&!x&&!b?te.formItemMarginBottomMD+4:te.formItemMarginBottomXS},children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:k||J("Alternative text"),placement:"bottom",getPopupContainer:he=>he.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!k}),onClick:j,ref:E,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"})})}),oe.formFieldImageTitleEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:b||J("Tooltip text"),placement:"bottom",getPopupContainer:he=>he.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!b}),onClick:I,ref:v,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"})})}),(0,o.jsx)(t.ui_kit$Tooltip,{title:x||J("Hyperlink URL"),placement:"bottom",getPopupContainer:he=>he.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!x}),icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-td-form__icon-radius"}),onClick:U,ref:T})})]}),(!!x||!!k||!!b)&&(0,o.jsxs)("div",{style:{marginBottom:te.formItemMarginBottomMD+4},children:[!!x&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:J("Hyperlink URL"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:te.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{ref:h,allowClear:!0,placeholder:J("Hyperlink URL"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined}),onChange:P})})}),!!k&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:J("Alternative text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:te.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:J("Alternative text"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"}),onChange:C,ref:_})})}),oe.formFieldImageTitleEnabled&&!!b&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:J("Tooltip text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:te.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:J("Tooltip text"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"}),onChange:K,ref:w})})})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:J("Size"),collapsible:!0,open:c,onToggle:G,dividerTop:!0,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:24},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:i,isPicture:"true",tooltipTitle:J("Width")})}),oe.formImageFieldHeightEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(tt,{form:e,name:"mobileHeight",elementSettings:i,isPicture:"true",tooltipTitle:J("Height")})})]})}),oe.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:J("Borders"),collapsible:!0,open:s,onToggle:O,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,typeOfForm:"mobile"})}),oe.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:J("Border radius"),collapsible:!0,open:a,onToggle:L,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:p,setOneBorderRadiusValue:f,elementSettings:i,typeOfForm:"mobile"})}),oe.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:J("Box shadow"),collapsible:!0,open:d,onToggle:R,dividerTop:!0,children:(0,o.jsx)(jo,{typeOfForm:"mobile"})}),oe.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:J("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})}),oe.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:J("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};Lr.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,mobileBordersShow:g.default.bool,mobileBorderRadiusShow:g.default.bool,mobileBoxShadowShow:g.default.bool,mobileSizeShow:g.default.bool,oneMobileBorderRadiusValue:g.default.bool,setOneMobileBorderRadiusValue:g.default.func,hasLink:g.default.string,hasAlt:g.default.string,hasTitle:g.default.string,linkInputRef:g.default.object,linkButtonRef:g.default.object,altInputRef:g.default.object,altButtonRef:g.default.object,titleInputRef:g.default.object,titleButtonRef:g.default.object,linkInputHandler:g.default.func,altButtonHandler:g.default.func,altInputHandler:g.default.func,titleButtonHandler:g.default.func,titleInputHandler:g.default.func,linkButtonHandler:g.default.func,toggleShowMobileBorderHandler:g.default.func,toggleShowMobileBorderRadiusHandler:g.default.func,toggleShowMobileBoxShadowHandler:g.default.func,toggleShowMobileSizeHandler:g.default.func};var dn=e=>typeof e=="object"&&e!==null?e.path:void 0;function Fo(){const e=(0,n.useRef)(!1),i=(0,n.useRef)(null),l=(0,n.useCallback)(a=>{e.current=!a},[]),s=(0,n.useCallback)((a,d)=>{const c=JSON.stringify(dn(a)??null);return i.current!==c&&(i.current=c,e.current=!1),d?e.current:(e.current=!1,!1)},[]);return(0,n.useMemo)(()=>({markBorderToggled:l,isStaleBorderSnapshot:s}),[l,s])}function st(e){const i=(0,n.useRef)(null),l=(0,n.useRef)(e);return l.current=e,{remember:(0,n.useCallback)(s=>{i.current=s},[]),fillFields:(0,n.useCallback)((s,a)=>{l.current!==i.current&&s.setFieldsValue(a)},[])}}var cn=1e3,un=2e4,Or="https://useblocks.io/app/",$r=({elementSettings:e})=>{const{__:i}=r.useI18n(),[l]=t.ui_kit$Form.useForm(),s=Fo(),a=Fo();let d=r.useDispatch();const c=r.useAppConfig(),p=r.useEditorProjectId(),f=r.useNotification(),x=r.useSendPostMessage(),k=r.useSendPostMessageEx(),{openImagePicker:b}=r.useImagePicker(),h=r.useSelector(r.selectEmailViewType),T=r.useSelector(r.selectMobileViewActive),_=r.useCurrentUser(),E=r.useSelector(r.selectIsCodeMode),w=r.useSelector(r.selectCodeModeDirection),[v]=r.useUploadImageMutation(),[P,j]=r.useSendShortLinkMutation(),[C,I]=(0,n.useState)({name:"",counter:0}),K=(0,n.useRef)(null),U=(0,n.useRef)(null),O=(0,n.useRef)(null),L=(0,n.useRef)(null),R=(0,n.useRef)(null),G=(0,n.useRef)(null),J=(0,n.useRef)(null),te=(0,n.useRef)(null),oe=(0,n.useRef)(null),[he,be]=(0,n.useState)({}),[ae,ke]=(0,n.useState)(!0),[Ce,de]=(0,n.useState)(!0),[Fe,je]=(0,n.useState)(""),[re,Be]=(0,n.useState)(""),[ce,ee]=(0,n.useState)(""),[me,ue]=(0,n.useState)(!1),[Z,Q]=(0,n.useState)(!1),[W,q]=(0,n.useState)(!1),[se,xe]=(0,n.useState)(!1),[ge,Ne]=(0,n.useState)(!1),[ye,$e]=(0,n.useState)(!1),[X,ne]=(0,n.useState)(!1),[we,V]=(0,n.useState)(!1),[Te,Ie]=(0,n.useState)("https://"),ve=(0,n.useRef)(!1),Ve=(0,n.useRef)(),Me=e,He=(0,n.useRef)(Me);He.current=Me;const le=(0,n.useCallback)(()=>l.getFieldsValue(!0).video,[l]),[Y,D]=(0,n.useState)(),[ie,Ee]=(0,n.useState)(!1),[Ae,We]=(0,n.useState)(null),[Ge,Ye]=(0,n.useState)({start:0,end:0}),[$,N]=(0,n.useState)(!1),[y,M]=(0,n.useState)(!1),[fe,Le]=(0,n.useState)(!1),[eo,Xe]=(0,n.useState)(!1),lo=(0,n.useRef)(void 0),Qe=(0,n.useRef)(null),uo=(0,n.useRef)(null),Eo=eo||fe||we;(0,n.useEffect)(()=>()=>clearTimeout(lo.current),[]);const B=(0,n.useRef)(null);(0,n.useEffect)(()=>{const A=B.current,Pe=A?.firstElementChild??null;if(!Eo||!A||!Pe)return;const Se=[];for(let oo=A.parentElement;oo;oo=oo.parentElement)getComputedStyle(oo).overflowY!=="visible"&&Se.push(oo);let _e=0,Oe="";const Ke=()=>{const oo=A.getBoundingClientRect(),Je=A.offsetHeight>0?oo.height/A.offsetHeight:1;let ho=Math.max(oo.top,0),ao=Math.min(oo.bottom,window.innerHeight);Se.forEach(Jo=>{const bt=Jo.getBoundingClientRect();ho=Math.max(ho,bt.top),ao=Math.min(ao,bt.bottom)});const bo=(ho-oo.top)/(Je||1),Po=Math.max(ao-ho,0)/(Je||1),yo=`${Math.round(bo)}/${Math.round(Po)}`;yo!==Oe&&(Oe=yo,Pe.style.top=`${bo}px`,Pe.style.height=`${Po}px`),_e=requestAnimationFrame(Ke)};return Ke(),()=>cancelAnimationFrame(_e)},[Eo]);const S=()=>{const A=Qe.current;uo.current=A?.isConnected&&typeof A.selectionStart=="number"?{element:A,start:A.selectionStart,end:A.selectionEnd??A.selectionStart}:null},m=E&&w!=="bottom",F=r.useElementEntityKind();(0,n.useEffect)(()=>{ie&&oe.current&&oe.current.focus()},[ie]);const H=(A,Pe)=>{const Se=document.getElementById(Pe);if(Se){const _e=Pe.substring(Pe.indexOf("selected_image_form_")+20),Oe=Se.value?.substring(0,Ge.start),Ke=Se.value?.substring(Ge.end);x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{...e,[_e]:Oe+A+Ke}}),l.setFieldValue(_e,Oe+A+Ke),Se.focus(),setTimeout(()=>{Se.selectionStart=Ge.start,Se.selectionEnd=Ge.start+A.length},400),N(!0)}},Re=r.useAppConfig().mergeTags;(0,n.useEffect)(()=>{Re?.items?.length&&D(r.mapMargeTags(Re.items,i,(A,Pe)=>{Ee(!1),k(r.EVENT_TYPES.SANDBOX_ADD_MERGETAG,A),Pe.stopPropagation(),Pe.preventDefault()}))},[Re,D,i,Ee,k]);const pe=(A,Pe)=>{if(Ee(!1),A){const Se=Re.syntax.length>1?Y.findIndex(Oe=>Oe.key===Pe[0].key):0,_e=Re.syntax[Se].replace("%value%",A[A.length-1]);Ae?.getAttribute("id")==="selected_image_form_title"||Ae?.getAttribute("id")==="selected_image_form_alt"||Ae?.getAttribute("id")==="selected_image_form_link"||Ae?.getAttribute("id")==="selected_image_form_imgReplacer"?H(_e,Ae?.getAttribute("id")):(l.setFieldValue("imgReplacer",_e),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:_e}}))}},ze=(A,Pe)=>Pe.some(Se=>Se.label.toLowerCase().indexOf(A.toLowerCase())>-1),co=(A,Pe)=>{const Se=Pe.map((_e,Oe)=>{const Ke=_e.label.split(new RegExp(`(${A})`,"gi"));return(0,o.jsxs)("span",{children:[Oe!==0&&(0,o.jsx)("span",{children:" / "}),Ke.map((oo,Je)=>oo.toLowerCase()===A.toLowerCase()?(0,o.jsx)("span",{style:{color:"red"},children:oo},Je):oo)]},_e.value)});return(0,o.jsx)("div",{title:Pe.map(_e=>_e.label).join(" / "),children:Se})},so=r.useRootElement();(0,n.useEffect)(()=>{const A=({target:_e})=>{_e.closest('[id="merge_tags_wrapper"]')||(Qe.current=_e,We(_e))},Pe=({target:_e})=>{!_e.closest(".merge-tags")&&!_e.closest("#merge_tags_button")&&Ee(!1)},Se=new xo.Disposable;return Se.addDisposable(r.addWindowListenerFromShadow(so,"focusin",A)),Se.addDisposable(r.addWindowListenerFromShadow(so,"click",Pe)),()=>{Se.dispose()}},[so]);const mo=({target:A})=>{if(A&&!$){const{selectionStart:Pe,selectionEnd:Se}=A;Ye({start:Pe,end:Se})}N(!1)},ko=e.border,qo=e.mobileBorder,Co=Object.keys(ko).find(A=>ko[A]?.width||ko[A]?.style||ko[A]?.color),Bo=Object.keys(qo).find(A=>qo[A]?.width||qo[A]?.style||qo[A]?.color),ro=A=>A&&(A?.width||A?.style||A?.color)?A:"",{remember:Ro,fillFields:Vo}=st(e);(0,n.useEffect)(()=>{if(e){e.src!==Ve.current&&(Ve.current=e.src,ve.current=!1);const A=e.boxShadow;if(be(A),e.link&&Ie(Mt(e.link,"https://")),Vo(l,{...e,link:e.link==null?"https://":e.link,width:e.width?.value,widthDim:e.width?.dim,height:e.height?.value,heightDim:e.height?.dim,borderAll:u(e.border.all),borderTop:u(e.border.top),borderBottom:u(e.border.bottom),borderRight:u(e.border.right),borderLeft:u(e.border.left),mobileBorderAll:ro(e.mobileBorder.all)||!(ro(e.mobileBorder.top)||ro(e.mobileBorder.bottom)||ro(e.mobileBorder.right)||ro(e.mobileBorder.left))&&ro(e.border.all),mobileBorderTop:ro(e.mobileBorder.top)||!ro(e.mobileBorder.all)&&ro(e.border.top),mobileBorderBottom:ro(e.mobileBorder.bottom)||!ro(e.mobileBorder.all)&&ro(e.border.bottom),mobileBorderRight:ro(e.mobileBorder.right)||!ro(e.mobileBorder.all)&&ro(e.border.right),mobileBorderLeft:ro(e.mobileBorder.left)||!ro(e.mobileBorder.all)&&ro(e.border.left),borderRadiusAll:u(e.borderRadius.all),borderRadiusTopLeft:u(e.borderRadius.topLeft),borderRadiusBottomLeft:u(e.borderRadius.bottomLeft),borderRadiusTopRight:u(e.borderRadius.topRight),borderRadiusBottomRight:u(e.borderRadius.bottomRight),boxShadowInset:u(e.boxShadow?.inset)||!1,boxShadowHOffset:u(e.boxShadow?.hOffset),boxShadowVOffset:u(e.boxShadow?.vOffset),boxShadowBlurRadius:u(e.boxShadow?.blurRadius),boxShadowSpreadRadius:u(e.boxShadow?.spreadRadius),boxShadowColor:u(e.boxShadow?.color),mobileWidth:po(e.mobileWidth?.value)||e.width?.value,mobileWidthDim:po(e.mobileWidth?.value)?e.mobileWidth?.dim:e.width?.dim,mobileHeight:po(e.mobileHeight?.value)||e.height?.value,mobileHeightDim:po(e.mobileHeight?.value)?e.mobileHeight?.dim:e.height?.dim,mobileBorderRadiusAll:u(e.mobileBorderRadius.all)||u(e.borderRadius.all),mobileBorderRadiusTopLeft:u(e.mobileBorderRadius?.topLeft)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.topLeft)||u(e.borderRadius?.all),mobileBorderRadiusBottomLeft:u(e.mobileBorderRadius?.bottomLeft)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.bottomLeft)||u(e.borderRadius?.all),mobileBorderRadiusTopRight:u(e.mobileBorderRadius?.topRight)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.topRight)||u(e.borderRadius?.all),mobileBorderRadiusBottomRight:u(e.mobileBorderRadius?.bottomRight)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.bottomRight)||u(e.borderRadius?.all),mobileBoxShadowInset:e.mobileBoxShadow?.inset!=null?e.mobileBoxShadow.inset:e.boxShadow?.inset||!1,mobileBoxShadowHOffset:u(e.mobileBoxShadow?.hOffset)||u(e.boxShadow?.hOffset),mobileBoxShadowVOffset:u(e.mobileBoxShadow?.vOffset)||u(e.boxShadow?.vOffset),mobileBoxShadowBlurRadius:u(e.mobileBoxShadow?.blurRadius)||u(e.boxShadow?.blurRadius),mobileBoxShadowSpreadRadius:u(e.mobileBoxShadow?.spreadRadius)||u(e.boxShadow?.spreadRadius),mobileBoxShadowColor:u(e.mobileBoxShadow?.color||e.boxShadow?.color),mobileAlign:u(e.mobileAlign?.value)||e.align,mobileVerticalAlign:u(e.mobileVerticalAlign?.value||e.valign),show:e.show?e.show:"all",altSrc:e.src,video:{source:"",playButton:"youtube_red",...Me.video}}),e.countdown){let _e=new URL("https://emailmaker.ru/?"+e.countdown),Oe=_e.searchParams.get("font1"),Ke=!1,oo=!1;Oe.endsWith("-b")?(Oe=Oe.substring(0,Oe.length-2),Ke=!0):Oe.endsWith("-i")?(Oe=Oe.substring(0,Oe.length-2),oo=!0):Oe.endsWith("-bi")&&(Oe=Oe.substring(0,Oe.length-3),Ke=!0,oo=!0);let Je=_e.searchParams.get("font2"),ho=!1,ao=!1;Je.endsWith("-b")?(Je=Je.substring(0,Je.length-2),ho=!0):Je.endsWith("-i")?(Je=Je.substring(0,Je.length-2),ao=!0):Je.endsWith("-bi")&&(Je=Je.substring(0,Je.length-3),ho=!0,ao=!0),Vo(l,{countdownTime:(0,Oo.default)(new Date(Date.parse(_e.searchParams.get("time"))+_e.searchParams.get("timezone")*36e5+new Date().getTimezoneOffset()/60*36e5).toISOString()),countdownDuration:_e.searchParams.get("frames")||20,countdownTimeZone:_e.searchParams.get("timezone"),countdownLanguage:_e.searchParams.get("locale").replace("-","_"),countdownBackgroundColor:"#"+_e.searchParams.get("bg"),countdownTransparency:_e.searchParams.get("tp")==="true"?"checked":"",countdownNumbersFont:Oe,countdownNumbersFontSize:_e.searchParams.get("size1")/2,countdownNumbersFontSizeDim:"px",countdownNumbersColor:"#"+_e.searchParams.get("color1"),countdownLabelsFont:Je,countdownLabelsFontSize:_e.searchParams.get("size2")/2,countdownLabelsFontSizeDim:"px",countdownLabelsColor:"#"+_e.searchParams.get("color2"),countdownNumbersStrong:Ke,countdownNumbersItalic:oo,countdownLabelsStrong:ho,countdownLabelsItalic:ao})}!u(e.borderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?ke(!1):ke(!0),!u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))||u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))||!u(e.borderRadius.all)&&!u(e.mobileBorderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?de(!1):de(!0);const Pe=s.isStaleBorderSnapshot(e,!!Co),Se=a.isStaleBorderSnapshot(e,!!Bo);Pe&&l.setFieldsValue({border:r.RESET_BORDER_PARAMS,borderAll:null,borderTop:null,borderBottom:null,borderRight:null,borderLeft:null}),(Se||Pe&&!Bo)&&l.setFieldsValue({mobileBorder:r.RESET_BORDER_PARAMS,mobileBorderAll:null,mobileBorderTop:null,mobileBorderBottom:null,mobileBorderRight:null,mobileBorderLeft:null}),ue(_e=>Co&&!Pe?!0:_e),Q(_e=>Co&&!Pe||Bo&&!Se?!0:_e),q(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),xe(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),Ne(!!e.boxShadow),$e(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),ne(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value||!!e.height.value),e.link?je(e.link):je(ve.current?"...":""),Be(e.alt),ee(e.title),M(e.imgReplacer?.length)}},[l,e,Vo,Me,Co,Bo,s,a]),(0,n.useEffect)(()=>{if(Eo)return;const A=uo.current;uo.current=null,!(!A||!A.element.isConnected||A.element.disabled)&&Qe.current===A.element&&(A.element.focus(),A.element.setSelectionRange(A.start,A.end))},[Eo]);const _o=async(A,Pe,Se)=>{const _e={};_e.user_id=_.id,_e.folder=A,Pe&&(Pe=await r.prepareImageForEditorUpload(Pe,c),_e.file=Pe),Se&&(_e.page_url=Se);const Oe=await v(_e);if(Oe.error)f.fromError("IMAGE_UPLOAD_ERROR",Pe,Oe.error,!0);else{const Ke=Oa.extractUploadResult(Oe.data);if(Ke.error)return;if(Ke.file_url)return Ke.file_url}},Ho=(A,Pe)=>new Promise((Se,_e)=>{const Oe=new Image,Ke=new Image;Oe.crossOrigin="Anonymous",Ke.crossOrigin="Anonymous";let oo=Pe?2:1;const Je=()=>{clearTimeout(ao),_e(new Error("video preview images are not loaded"))},ho=()=>{oo-=1,oo===0&&(clearTimeout(ao),Se({frame:Oe,button:Pe?Ke:null}))},ao=setTimeout(Je,un);Oe.onload=ho,Oe.onerror=Je,Oe.src=A,Pe&&(Ke.onload=ho,Ke.onerror=Je,Ke.src=Pe)}),vt=(A,Pe,Se,_e)=>{const Oe=document.createElement("canvas"),Ke=Oe.getContext("2d");if(Oe.width=A.width,Oe.height=A.height,Ke.clearRect(0,0,Oe.width,Oe.height),Ke.drawImage(A,0,0,A.width,A.height),!Pe)return Oe;const oo=Math.min(Oe.width,Oe.height);let Je;if(A.height>A.width)Je=.3;else{const bt=A.width/A.height;Je=Math.min(_e,.3+(bt-1)/(Se-1)*.1)}const ho=oo*Je,ao=Pe.width/Pe.height;let bo,Po;ao>=1?(bo=ho,Po=ho/ao):(Po=ho,bo=ho*ao);const yo=(Oe.width-bo)/2,Jo=(Oe.height-Po)/2;return Ke.drawImage(Pe,yo,Jo,bo,Po),Oe},Lo=A=>new Promise(Pe=>{A.toBlob(Se=>Pe(Se?new File([Se],"image.jpeg",{type:"image/jpeg"}):null),"image/jpg",1)}),It=async A=>{const Pe=l.getFieldsValue(!0).video?.playButton||e.video?.playButton;if(!(!A||!Pe||Pe==="none"||fe)){S(),Le(!0);try{const{frame:Se,button:_e}=await Ho(A,`${Or}${Pe}.png`),Oe=await Lo(vt(Se,_e,2,.4)),Ke=Oe&&await _o(p,Oe);if(!Ke)return;x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:He.current.type,settings:{src:Ke}}),Pt({...He.current,src:Ke,video:le()||He.current.video,activateSection:null,changeKey:"src"}),setTimeout(()=>{l.setFieldValue("src",Ke)},100)}catch{}finally{Le(!1)}}},Er=async()=>{const A=le(),Pe=A?.source,Se=A?.playButton;if(!Pe)return;const _e=()=>le()?.source!==Pe;S(),Xe(!0);try{const Oe=await _o("tmp",null,Pe);if(!Oe||_e())return;const{frame:Ke,button:oo}=await Ho(Oe,Se&&Se!=="none"?`${Or}${Se}.png`:null);if(_e())return;const Je=await Lo(vt(Ke,oo,2.5,.35)),ho=Je&&await _o(p,Je);ho&&!_e()&&Br(ho)}catch{}finally{Xe(!1)}},Ct=A=>{clearTimeout(lo.current),lo.current=setTimeout(()=>{A()},cn)},ni=()=>{const A=l.getFieldsValue(!0);let Pe=new URL("https://cdt3.useblocks.io/rndt?"+e.countdown),Se=A.countdownNumbersFont;A.countdownNumbersStrong&&A.countdownNumbersItalic?Se+="-bi":A.countdownNumbersStrong?Se+="-b":A.countdownNumbersItalic&&(Se+="-i");let _e=A.countdownLabelsFont;A.countdownLabelsStrong&&A.countdownLabelsItalic?_e+="-bi":A.countdownLabelsStrong?_e+="-b":A.countdownLabelsItalic&&(_e+="-i"),Pe.searchParams.set("time",new Date(A.countdownTime.$d-A.countdownTimeZone*36e5-new Date().getTimezoneOffset()/60*36e5).toISOString()),Pe.searchParams.set("bg",A.countdownBackgroundColor.substring(1)||"#FFFFFF"),Pe.searchParams.set("tp",!!A.countdownTransparency),Pe.searchParams.set("font1",Se),Pe.searchParams.set("size1",A.countdownNumbersFontSize*2||12),Pe.searchParams.set("color1",A.countdownNumbersColor.substring(1)||"#000000"),Pe.searchParams.set("font2",_e),Pe.searchParams.set("size2",A.countdownLabelsFontSize*2||8),Pe.searchParams.set("color2",A.countdownLabelsColor.substring(1)||"#959595"),Pe.searchParams.set("spacing",Math.round(A.countdownNumbersFontSize*.4)||5),Pe.searchParams.set("locale",A.countdownLanguage.replace("_","-")),Pe.searchParams.set("timezone",A.countdownTimeZone),Pe.searchParams.set("frames",A.countdownDuration),P({link:JSON.stringify({target:Pe.href})}),S(),V(!0)},Pt=(0,n.useCallback)(A=>{Ro(A),d(F==="email"?r.setElementSettings$1(A):r.setElementSettings(A))},[d,F,Ro]),Br=(0,n.useCallback)((A,Pe)=>{const Se=He.current,_e=r.stripEmVersionFromUrlString(Se.src||"")===r.stripEmVersionFromUrlString(A||"");(!_e||A!==Se.src)&&(x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:Se.type,settings:{src:A}}),Pt({...Se,src:A,...Se.type==="video"?{video:le()||Se.video}:{},activateSection:null,changeKey:"src"}),l.setFieldValue("src",A)),Pe?.mode==="save"&&_e&&(I(Oe=>({name:"src",counter:Oe.counter+1})),k(r.EVENT_TYPES.SANDBOX_IMAGE_RESET,{url:String(A)}))},[l,le,Pt,x,k]),At=(0,n.useCallback)(async A=>{const Pe=e.src||"",Se=r.stripEmVersionFromUrlString(Pe),_e=await b({kind:"img",currentUrl:$t(Se)?"":Se,entryModal:A});_e?.url&&Br(_e.url,_e.meta)},[Br,e.src,b]),va=(A,...Pe)=>{const Se=l.getFieldsValue(!0),_e=Object.keys(A)[0];let Oe;switch(_e){case"link":let Ke=ot(A[_e]);Ke!==A[_e]&&l.setFieldValue("link",Ke),Oe={link:Ke};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":Oe={boxShadow:{hOffset:Se.boxShadowHOffset,vOffset:Se.boxShadowVOffset,blurRadius:Se.boxShadowBlurRadius,spreadRadius:Se.boxShadowSpreadRadius,color:Se.boxShadowColor,inset:Se.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":Se.borderPosition==="borderAll"?(Oe={border:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...Se.borderAll}}},l.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER})):Se.borderAll?.width||Se.borderAll?.style||Se.borderAll?.color?(Oe={border:{all:null,left:Se.borderAll,right:Se.borderAll,top:Se.borderAll,bottom:Se.borderAll,[z.REVERSE_BORDER_POSITIONS[_e]]:{...Se[_e],...A[_e]}}},l.setFieldsValue({borderAll:null,borderLeft:Se.borderAll,borderRight:Se.borderAll,borderTop:Se.borderAll,borderBottom:Se.borderAll,[_e]:{...Se[_e],...A[_e]}})):(Oe={border:{all:null,left:Se.borderLeft,right:Se.borderRight,top:Se.borderTop,bottom:Se.borderBottom,[z.REVERSE_BORDER_POSITIONS[_e]]:{...Se[_e],...A[_e]}}},l.setFieldsValue({border:Oe.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":if(Se.mobileBorderPosition==="mobileBorderAll")Oe={mobileBorder:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...Se.mobileBorderAll,classNamePrefix:"em-mob-border_"+z.MOBILE_REVERSE_BORDER_POSITIONS[_e]+"-"}}},l.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER});else{const ao=z.MOBILE_REVERSE_BORDER_POSITIONS[_e],bo={...Se[_e],...A[_e]},Po=!bo?.width&&!bo?.style&&!bo?.color;if(Se.mobileBorder?.all?.width||Se.mobileBorder?.all?.style||Se.mobileBorder?.all?.color){const yo=Se.mobileBorderAll;Oe={mobileBorder:{all:null,left:yo,right:yo,top:yo,bottom:yo,[ao]:Po?null:{...bo,classNamePrefix:"em-mob-border_"+ao+"-"}}},l.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:yo,mobileBorderRight:yo,mobileBorderTop:yo,mobileBorderBottom:yo,[_e]:bo})}else{const yo=e.mobileBorder||{},Jo=bt=>{const Nt=yo[bt];return Nt&&(Nt?.width||Nt?.style||Nt?.color)?Nt:null};Oe={mobileBorder:{all:null,left:ao==="left"?Po?null:{...bo,classNamePrefix:"em-mob-border_left-"}:Jo("left"),right:ao==="right"?Po?null:{...bo,classNamePrefix:"em-mob-border_right-"}:Jo("right"),top:ao==="top"?Po?null:{...bo,classNamePrefix:"em-mob-border_top-"}:Jo("top"),bottom:ao==="bottom"?Po?null:{...bo,classNamePrefix:"em-mob-border_bottom-"}:Jo("bottom")}},l.setFieldsValue({[_e]:bo})}}break;case"width":Oe={[_e]:{value:A[_e],dim:Se.widthDim}};break;case"widthDim":Oe={width:{value:Se.width,dim:A[_e]}};break;case"height":Oe={[_e]:{value:A[_e],dim:Se.heightDim}};break;case"heightDim":Oe={height:{value:Se.height,dim:A[_e]}};break;case"borderRadiusAll":Oe={borderRadius:{[z.BORDER_RADIUS_POSITION[_e]]:+A[_e]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":Oe={borderRadius:{topLeft:Se.borderRadiusTopLeft,bottomLeft:Se.borderRadiusBottomLeft,topRight:Se.borderRadiusTopRight,bottomRight:Se.borderRadiusBottomRight,[z.BORDER_RADIUS_POSITION[_e]]:+A[_e]}};break;case"mobileWidth":Oe={[_e]:{classNamePrefix:"em-mob-width-",value:A[_e],dim:Se.mobileWidthDim}};break;case"mobileWidthDim":Oe={mobileWidth:{classNamePrefix:"em-mob-width-",value:Se.mobileWidth||100,dim:A[_e]}};break;case"mobileHeight":Oe={[_e]:{classNamePrefix:"em-mob-height-",value:A[_e],dim:Se.mobileHeightDim}};break;case"mobileHeightDim":Oe={mobileHeight:{classNamePrefix:"em-mob-height-",value:Se.mobileHeight,dim:A[_e]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":Oe={mobileBorderRadius:{[z.MOBILE_BORDER_RADIUS_POSITION[_e]]:A[_e],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[_e]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":Oe={mobileBoxShadow:{hOffset:Se.mobileBoxShadowHOffset,vOffset:Se.mobileBoxShadowVOffset,blurRadius:Se.mobileBoxShadowBlurRadius,spreadRadius:Se.mobileBoxShadowSpreadRadius,color:Se.mobileBoxShadowColor,inset:Se.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":Oe={[_e]:{classNamePrefix:"em-mob-text_align-",value:A[_e]}};break;case"mobileVerticalAlign":Oe={[_e]:{classNamePrefix:"em-mob-vertical_align-",value:A[_e]}};break;case"countdownTime":case"countdownTimeZone":case"countdownBackgroundColor":case"countdownNumbersFont":case"countdownNumbersFontSize":case"countdownNumbersColor":case"countdownLabelsFont":case"countdownLabelsFontSize":case"countdownLabelsColor":case"countdownLanguage":case"countdownDuration":case"countdownTransparency":case"countdownNumbersStrong":case"countdownNumbersItalic":case"countdownLabelsStrong":case"countdownLabelsItalic":Ct(ni);break;case"video":{const ao={...e.video,...Se.video,...A.video},bo=ao.source??Se.link;Ct(Er),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"video",settings:{video:ao,link:bo}}),Pt({...e,video:ao,link:bo,activateSection:null,changeKey:"video"});break}case"src":const oo=A[_e],Je=e.src,ho=Se.video?.playButton||e.video?.playButton;if(e.type==="video"&&ho&&ho!=="none"&&!fe&&oo&&(!Je||oo!==Je)){Ct(()=>It(oo));return}Oe=A;break;default:Oe=A}_e!=="borderPosition"&&_e!=="mobileBorderPosition"&&_e.indexOf("countdown")===-1&&_e!=="video"&&(x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:Oe}),_e!=="video"&&_e.indexOf("countdown")===-1&&_e!=="mobileBorderRadiusAll"&&_e!=="mobileBorderRadiusTopLeft"&&_e!=="mobileBorderRadiusTopRight"&&_e!=="mobileBorderRadiusBottomLeft"&&_e!=="mobileBorderRadiusBottomRight"&&Pt({...e,...Oe,mobileBorderRadius:{...e.mobileBorderRadius,...Oe?.mobileBorderRadius},activateSection:null,changeKey:_e}))};(0,n.useEffect)(()=>{j.isError&&(f.error(j),V(!1))},[j]),(0,n.useEffect)(()=>{if(j.isSuccess&&we){if(j.data.data?.status===400)f.error({title:j.data.code,description:j.data.message});else{let A=new URL(j.data.target),Pe={countdown:{link:j.data.link,params:A.search.substring(1)}};x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:Pe})}V(!1)}},[j,we,e,f,x]);const Sm=A=>{A.data.operation===r.EVENT_TYPES.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(d(r.closeSecondModal()),d(r.closeModal$1()))};r.useListenPostMessage(Sm),r.useImageControlRequest(e.src,A=>{A===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_AI_POPUP?At(r.MODALS.UPLOAD_IMAGE_MODAL_AI):A===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?At(r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD):A===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_EDIT_POPUP?At(r.MODALS.UPLOAD_IMAGE_MODAL_EDIT):A===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_GIF_POPUP?At(r.MODALS.UPLOAD_IMAGE_MODAL_GIF):A===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_STOCK_POPUP&&At(r.MODALS.UPLOAD_IMAGE_MODAL_STOCK)});const Tm=()=>{const A=l.getFieldsValue(!0);s.markBorderToggled(!me),setTimeout(()=>{ue(Pe=>!Pe),me?(A.borderAll=z.NULL_BORDER,A.borderTop=z.NULL_BORDER,A.borderBottom=z.NULL_BORDER,A.borderRight=z.NULL_BORDER,A.borderLeft=z.NULL_BORDER):A.borderAll={width:1,color:"#E5E5E5",style:"solid"},x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:A.borderAll.color,style:A.borderAll.style,width:A.borderAll.width}}}})})},Rm=()=>{const A=l.getFieldsValue(!0);a.markBorderToggled(!Z),setTimeout(()=>{Q(Pe=>!Pe),Z?(A.mobileBorderAll=z.NULL_BORDER,A.mobileBorderTop=z.NULL_BORDER,A.mobileBorderBottom=z.NULL_BORDER,A.mobileBorderRight=z.NULL_BORDER,A.mobileBorderLeft=z.NULL_BORDER):A.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:A.mobileBorderAll.color,style:A.mobileBorderAll.style,width:A.mobileBorderAll.width}}}})})},ym=()=>{const A=l.getFieldsValue(!0);setTimeout(()=>{q(Pe=>!Pe),W?(A.borderRadiusAll=0,ke(!0)):A.borderRadiusAll=5,x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:A.borderRadiusAll}}})})},wm=()=>{const A=l.getFieldsValue(!0);setTimeout(()=>{xe(Pe=>!Pe),se?(A.mobileBorderRadiusAll=null,de(!0)):A.mobileBorderRadiusAll=5,x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:A.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})},jm=()=>{const A=l.getFieldsValue(!0);setTimeout(()=>{Ne(Pe=>!Pe),ge?(A.boxShadowInset=!1,A.boxShadowHOffset=null,A.boxShadowVOffset=null,A.boxShadowBlurRadius=null,A.boxShadowSpreadRadius=null,A.boxShadowColor=""):(A.boxShadowInset=!1,A.boxShadowHOffset=5,A.boxShadowVOffset=5,A.boxShadowBlurRadius=10,A.boxShadowSpreadRadius=-5,A.boxShadowColor="#000000"),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:A.boxShadowBlurRadius,color:A.boxShadowColor,hOffset:A.boxShadowHOffset,inset:A.boxShadowInset,spreadRadius:A.boxShadowSpreadRadius,vOffset:A.boxShadowVOffset}}})})},vm=()=>{const A=l.getFieldsValue(!0);setTimeout(()=>{$e(Pe=>!Pe),ye?(A.mobileBoxShadowInset=!1,A.mobileBoxShadowHOffset=null,A.mobileBoxShadowVOffset=null,A.mobileBoxShadowBlurRadius=null,A.mobileBoxShadowSpreadRadius=null,A.mobileBoxShadowColor=""):(A.mobileBoxShadowInset=!1,A.mobileBoxShadowHOffset=5,A.mobileBoxShadowVOffset=5,A.mobileBoxShadowBlurRadius=10,A.mobileBoxShadowSpreadRadius=-5,A.mobileBoxShadowColor="#000000"),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:A.mobileBoxShadowBlurRadius,color:A.mobileBoxShadowColor,hOffset:A.mobileBoxShadowHOffset,inset:A.mobileBoxShadowInset,spreadRadius:A.mobileBoxShadowSpreadRadius,vOffset:A.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})},Im=()=>{const A=l.getFieldsValue(!0);setTimeout(()=>{ne(Pe=>!Pe),X&&(A.mobileWidth="",A.mobileHeight="",x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))})},Ia=()=>{Fe?(ve.current=!1,je(""),l.setFieldValue("link",""),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{link:""}})):(ve.current=!0,je(K.current&&K.current.input.value?K.current.input.value:"..."),setTimeout(()=>{K.current.focus()}))},Ca=A=>{A.target.value===""?je("..."):(U.current.classList.add("selected-td-form__button--active"),je(A.target.value)),Wo(A.target.value,Ie)},Pa=()=>{const A=l.getFieldsValue(!0);re?(Be(""),A.alt="",x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{alt:""}})):(Be(O.current&&O.current.input.value?O.current.input.value:"..."),setTimeout(()=>{O.current.focus()}))},Aa=A=>{A.target.value===""?Be("..."):(L.current.classList.add("selected-td-form__button--active"),Be(A.target.value))},Na=()=>{const A=l.getFieldsValue(!0);ce?(ee(""),A.title="",x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{title:""}})):(ee(R.current&&R.current.input.value?R.current.input.value:"..."),setTimeout(()=>{R.current.focus()}))},Cm=()=>{M(!y),y?(l.setFieldValue("imgReplacer",""),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:""}})):setTimeout(()=>J.current.focus())},Pm=A=>{A.target.value!==""&&te.current.classList.add("selected-td-form__button--active")},La=A=>{A.target.value===""?ee("..."):(G.current.classList.add("selected-td-form__button--active"),ee(A.target.value))},Am=A=>{l.setFieldValue("link",A!=="mergetag"?A:""),Ie(A)};return(0,o.jsxs)(t.ui_kit$Form,{form:l,layout:"vertical",name:"selected_image_form",initialValues:{src:"",width:"",height:"",widthDim:"",heightDim:"",alt:"",align:"left",border:"",boxShadow:"",show:"all",borderPosition:z.BORDER_POSITIONS[Co]||"borderAll",mobileBorderPosition:z.MOBILE_BORDER_POSITIONS[Bo]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"left",mobileVerticalAlign:"",link:"https://",imgReplacer:"",countdownNumbersStrong:!1,countdownNumbersItalic:!1,countdownLabelsStrong:!1,countdownLabelsItalic:!1,video:{source:"",playButton:"youtube_red"}},onValuesChange:va,autoComplete:"off",disabled:Eo,className:Eo?"element-controls selected-image-form_busy":"element-controls",children:[Eo&&(0,o.jsx)("div",{className:"selected-image-form__loader",ref:B,children:(0,o.jsxs)("div",{className:"selected-image-form__loader-body",children:[(0,o.jsx)(t.ui_kit$Spin,{size:"large"}),(0,o.jsx)("div",{className:"selected-image-form__loader-title",children:Me.type==="countdown"?i("Preparing countdown preview…"):i("Preparing video preview…")})]})}),!m&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),h==="mobile"&&T.styles?(0,o.jsxs)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:[(0,o.jsx)(Lr,{form:l,elementSettings:e,boxShadow:he,mobileBordersShow:Z,mobileBorderRadiusShow:se,mobileBoxShadowShow:ye,mobileSizeShow:X,oneMobileBorderRadiusValue:Ce,setOneMobileBorderRadiusValue:de,hasLink:Fe,hasAlt:re,hasTitle:ce,linkInputRef:K,linkButtonRef:U,altInputRef:O,altButtonRef:L,titleInputRef:R,titleButtonRef:G,linkInputHandler:Ca,altButtonHandler:Pa,altInputHandler:Aa,titleButtonHandler:Na,titleInputHandler:La,linkButtonHandler:Ia,toggleShowMobileBorderHandler:Rm,toggleShowMobileBorderRadiusHandler:wm,toggleShowMobileBoxShadowHandler:vm,toggleShowMobileSizeHandler:Im})," "]}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(Nr,{form:l,elementSettings:e,boxShadow:he,bordersShow:me,borderRadiusShow:W,boxShadowShow:ge,oneBorderRadiusValue:ae,setOneBorderRadiusValue:ke,hasLink:Fe,hasAlt:re,hasTitle:ce,isOpenSrcReplacer:y,mergeTagItems:Y,mergeMenuOpen:ie,setMergeMenuOpen:Ee,cascaderRef:oe,linkInputRef:K,linkButtonRef:U,altInputRef:O,altButtonRef:L,titleInputRef:R,titleButtonRef:G,srcReplacerInputRef:J,srcReplacerButtonRef:te,linkProtocol:Te,handleLinkProtocolsChange:Am,linkButtonHandler:Ia,linkInputHandler:Ca,altButtonHandler:Pa,altInputHandler:Aa,titleButtonHandler:Na,titleInputHandler:La,srcReplacerButtonHandler:Cm,srcInputHandler:Pm,handleSelect:mo,onChange:pe,filter:ze,renderSearchOption:co,handleChangeValues:va,toggleShowBorderHandler:Tm,toggleShowBorderRadiusHandler:ym,toggleShowBoxShadowHandler:jm})})]})};$r.propTypes={elementSettings:g.default.object.isRequired};var Fr=()=>{const{__:e}=r.useI18n();return(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:e("The font-size CSS property sets the size of the font."),placement:"top",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileFontSize",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:8,max:90,placeholder:e("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})},it=({form:e,elementSettings:i,imgParent:l=!1,name:s="align",setAlignStateHandle:a=()=>{},withHotKeys:d=!0})=>{const{__:c}=r.useI18n(),p=r.useSendPostMessage(),f=r.useAppConfig(),[x,k]=(0,n.useState)(null);(0,n.useEffect)(()=>{globalThis?.navigator?.userAgent.includes("Macintosh")&&k(!0)},[]);const b=v=>{a(v),e.setFieldsValue({[s]:v}),p({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:{[s]:v}})},h=d?{alignLeft:c("Text align left ( ⌘+Shift+L )"),alignCenter:c("Text align center ( ⌘+Shift+E )"),alignRight:c("Text align right ( ⌘+Shift+R )"),alignJustify:c("Text align justify ( ⌘+Shift+J )")}:void 0,T=d?{alignLeft:c("Text align left ( Ctrl+Shift+L )"),alignCenter:c("Text align center ( Ctrl+Shift+E )"),alignRight:c("Text align right ( Ctrl+Shift+R )"),alignJustify:c("Text align justify ( Ctrl+Shift+J )")}:void 0,_=d?x?h:T:void 0,E=i[s],w=typeof E=="string"?E:"";return(0,o.jsx)(t.ui_kit$Form.Item,{name:s,children:(0,o.jsx)(t.ui_kit$FormAlignTextControl,{value:w,onChange:b,disabled:l&&!i.parent,strokeWidth:f?.iconStrokeWidth,labels:_})})},qe=({form:e,elementSettings:i,name:l,icon:s,tooltipTitle:a=null,showTooltip:d=!0,forceInactive:c=!1})=>{const{__:p}=r.useI18n(),f=e.getFieldValue(l),x=r.useSendPostMessage(),[k,b]=(0,n.useState)(i[l]);(0,n.useEffect)(()=>{i[l]!==e.getFieldValue(l)&&(e.setFieldValue(l,i[l]),b(i[l]))},[i,e,l]),(0,n.useEffect)(()=>{k!==f&&b(f)},[f,k,l]);const h=()=>{const T={[l]:!k};e.setFieldValue(l,!k),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:T}),l==="textSuperscript"?e.setFieldValue("textSubscript",!1):l==="textSubscript"&&e.setFieldValue("textSuperscript",!1),b(_=>!_)};return(0,o.jsx)(t.ui_kit$Form.Item,{name:l,children:d?(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:a||p(l.substring(4)),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":k&&!c}),onClick:h,children:s})}):(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":k&&!c}),onClick:h,children:s})})};qe.propTypes={form:g.default.shape({setFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired,tooltipTitle:g.default.string,imgParent:g.default.bool};var Mr=()=>{const{__:e}=r.useI18n();return[{symbol:"•",code:"•",description:e("Bullet")},{symbol:"+",code:"+",description:e("Plus")},{symbol:"»",code:"»",description:e("Double quotation")},{symbol:"×",code:"×",description:e("Cross")},{symbol:"–",code:"—",description:e("Dash")},{symbol:"›",code:"›",description:e("Single quotation")},{symbol:"→",code:"→",description:e("Arrow")},{symbol:"⇒",code:"⇒",description:e("Double arrow")},{symbol:"►",code:"▸",description:e("Pointer")},{symbol:"−",code:"−",description:e("Minus")},{symbol:"∗",code:"∗",description:e("Star")},{symbol:"♦",code:"♦",description:e("Diamond")}]},mn=(e,i="#c6c3c3",l={},s)=>{const{symbolSize:a="25px",marginRight:d="5px",marginBottom:c="5px",textStyle:p={whiteSpace:"normal",lineHeight:"1.2"}}=l;return e.map(f=>({value:f.code,label:(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,o.jsx)("span",{style:{color:i||"#c6c3c3",marginRight:d,marginBottom:c,fontSize:a,lineHeight:"0.7",width:a,textAlign:"center",...p},children:f.symbol}),(0,o.jsx)("span",{style:p,children:f.description})]})}))},gt=({form:e,fillFields:i,elementSettings:l,showAddParagraph:s=!0,isButton:a=!1,linkProtocol:d,setLinkProtocol:c,linkTarget:p,isBulletFontColorChecked:f=!1,setIsBulletFontColorChecked:x=()=>{},showTopDivider:k=!0})=>{const{__:b}=r.useI18n(),h=z.useGoogleFontsLoader(),{token:T}=(0,t.ui_kit$useToken)(),_=r.useNotification(),E=r.useSendPostMessage(),w=r.useSendPostMessageEx(),v=r.useAppConfig(),P=(0,n.useRef)(),j=(0,n.useRef)(null),C=(0,n.useRef)(null),I=(0,n.useRef)(null),K=(0,n.useRef)(!1),U=l,[O,L]=(0,n.useState)(!!U.textReplacer?.length),[R,G]=(0,n.useState)(!!U.textAnchor?.length),[J,te]=(0,n.useState)(null),[oe,he]=(0,n.useState)({start:0,end:0}),[be,ae]=(0,n.useState)(!1),[ke,Ce]=(0,n.useState)([]),[de,Fe]=(0,n.useState)(U.list?.bulletsColor),[je,re]=(0,n.useState)(l);l!==je&&(re(l),Fe(U.list?.bulletsColor),L(!!U.textReplacer?.length),G(!!U.textAnchor?.length));const[Be,ce]=(0,n.useState)(!1),[ee,me]=(0,n.useState)(!1),ue=(0,n.useRef)(null),Z=(0,n.useRef)(""),Q=Mr(),W=(0,n.useMemo)(()=>Q,[]),q={textColor:t.ui_kit$Form.useWatch("textColor",e),textLink:t.ui_kit$Form.useWatch("textLink",e),linkHref:t.ui_kit$Form.useWatch("linkHref",e),listUL:t.ui_kit$Form.useWatch("listUL",e),listOL:t.ui_kit$Form.useWatch("listOL",e)};(0,n.useEffect)(()=>{a&&l?.textColor!==void 0&&e.setFieldValue("textColor",l.textColor)},[a,l?.textColor,e]);let se=null;(0,n.useEffect)(()=>{if(q?.textColor&&f){const N=e.getFieldValue("textColor");E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{ColorBullets:N}})}},[q?.textColor]),(0,n.useEffect)(()=>{const N=e.getFieldValue("textLink");typeof l.linkHref=="string"&&ce(!0),ue&&!N&&(ce(!1),e.setFieldsValue({linkHref:null})),ue.current=N||null},[q?.textLink,q?.linkHref,l.linkHref,e]),(0,n.useEffect)(()=>{const N=e.getFieldValue("listUL"),y=e.getFieldValue("listOL");N&&Z.current!=="listUL"?(e.setFieldValue("listOL",!1),Z.current="listUL"):y&&Z.current!=="listOL"&&(e.setFieldValue("listUL",!1),Z.current="listOL"),!N&&!y&&(Z.current="")},[q?.listUL,q?.listOL,e]);const xe=N=>{N.data.operation===r.EVENT_TYPES.APPLICATION_FOCUS_IN_IFRAME&&te(null)};r.useListenPostMessage(xe);const[ge,Ne]=(0,n.useState)(null);(0,n.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&Ne(!0)},[]);const ye=(0,n.useRef)(null);function $e(N){const y=N.key.toLowerCase();let M=!1;return((se==="control"||se==="meta")&&(y==="a"||y==="A")||(se==="a"||se==="A")&&(y==="control"||y==="meta"))&&(M=!0),se=y,y!=="control"&&y!=="a"&&y!=="A"&&y!=="meta"&&(se=null),M}const X=N=>{E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_TEXT,action:N,locale:"en_US"}),_.success({title:b("It`s done!")})},ne=[{key:"1",label:b("This element"),onClick:()=>X("typograf")},{key:"2",label:b("The whole email"),onClick:()=>X("typograf_all")}],[we,V]=(0,n.useState)(),[Te,Ie]=(0,n.useState)(!1);(0,n.useEffect)(()=>{const N=mn(W,de,{});Ce(N)},[W,de]),(0,n.useEffect)(()=>{const N=l.linkHref||l.href;N&&Wo(N,c);const y=l.linkHref||l.href,M=y&&Bi(y)?y.slice(1):y||"https://";(i??((fe,Le)=>fe.setFieldsValue(Le)))(e,{linkHref:M})},[e,l,c,i]);const ve=r.useAppConfig().mergeTags;(0,n.useEffect)(()=>{ve?.items?.length&&V(r.mapMargeTags(ve.items,b,(N,y)=>{Ie(!1),w(r.EVENT_TYPES.SANDBOX_ADD_MERGETAG,N),y.stopPropagation(),y.preventDefault()}))},[ve,V,b,Ie,w]);const Ve=N=>{e.setFieldValue("linkHref",N!=="mergetag"?N:""),c(N)},Me=(N,y)=>{if(Ie(!1),N){const M=ve.syntax.length>1?we.findIndex(Le=>Le.key===y[0].key):0,fe=ve.syntax[M].replace("%value%",N[N.length-1]);if(J?.getAttribute("id")==="selected_button_form_href"||J?.getAttribute("id")==="selected_text_form_linkHref"||J?.getAttribute("id")==="selected_text_form_textReplacer")Ee(fe,J?.getAttribute("id"));else{e.setFieldValue("textReplacer",fe);const Le=Date.now();E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{textReplacer:`${fe}~~${Le}`}})}}},He=(N,y)=>y.some(M=>M.label.toLowerCase().indexOf(N.toLowerCase())>-1),le=(N,y)=>{const M=y.map((fe,Le)=>{const eo=fe.label.split(new RegExp(`(${N})`,"gi"));return(0,o.jsxs)("span",{children:[Le!==0&&(0,o.jsx)("span",{children:" / "}),eo.map((Xe,lo)=>Xe.toLowerCase()===N.toLowerCase()?(0,o.jsx)("span",{style:{color:"red"},children:Xe},lo):Xe)]},fe.value)});return(0,o.jsx)("div",{title:y.map(fe=>fe.label).join(" / "),children:M})};(0,n.useEffect)(()=>{Te&&ye.current&&ye.current.focus()},[Te]);const Y=r.useRootElement();(0,n.useEffect)(()=>{const N=({target:fe})=>{fe.closest('[id="merge_tags_wrapper"]')||te(fe)},y=({target:fe})=>{!fe.closest(".merge-tags")&&!fe.closest("#merge_tags_button")&&Ie(!1)},M=new xo.Disposable;return M.addDisposable(r.addWindowListenerFromShadow(Y,"focusin",N)),M.addDisposable(r.addWindowListenerFromShadow(Y,"click",y)),()=>{M.dispose()}},[Y]);const D=(0,n.useCallback)(()=>{const N=window.getSelection();N&&N.toString().length>0&&(K.current=!0)},[]),ie=(0,n.useCallback)(({target:N})=>{if(N&&!be){const{selectionStart:y,selectionEnd:M}=N;he({start:y,end:M})}ae(!1)},[be]);(0,n.useEffect)(()=>ie({target:p?.target}),[p,ie]);const Ee=(N,y)=>{const M=document.getElementById(y);if(M){const fe=M.value?.substring(0,oe.start),Le=M.value?.substring(oe.end),eo=y.substring(y.lastIndexOf("_")+1);E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{[eo]:fe+N+Le}}),e.setFieldValue(eo,fe+N+Le),M.focus(),setTimeout(()=>{M.selectionStart=oe.start,M.selectionEnd=oe.start+N.length},400),ae(!0)}},Ae=()=>{L(!O),O?(e.setFieldValue("textReplacer",""),E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{textReplacer:""}})):setTimeout(()=>j.current.focus())},We=N=>{N.target.value!==""&&C.current?.classList.add("selected-td-form__button--active")},Ge=(N="unknown")=>{G(!R),R?(e.setFieldValue("textAnchor",""),E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{textAnchor:""}})):setTimeout(()=>I.current?.focus())},Ye=N=>{const y=N.target,M=y.value,fe=y.selectionStart,Le=$e(N);if(K.current&&fe===0&&E({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{textReplacer:`${M}~`}}),K.current=Le,fe===0&&N.key===" "){N.preventDefault();return}if(N.key===" "){if(fe!==M.length){N.preventDefault();return}M.endsWith(" ")&&N.preventDefault()}},$=N=>{Fe(N),f&&x(!1)};return(0,o.jsxs)(o.Fragment,{children:[s&&!l.showOnMobile&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(t.ui_kit$Row,{gutter:20,style:{paddingBottom:4},children:(0,o.jsx)(t.ui_kit$Col,{span:12,gutter:20,children:(0,o.jsx)(it,{form:e,elementSettings:l,name:"textAlign"})})})}),v.formTextFieldTypografEnabled&&!a||v.mergeTagsShow&&we?(0,o.jsx)(t.ui_kit$FormSection,{title:null,dividerTop:k,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginTop:4},children:[v.formTextFieldTypografEnabled&&!a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"AddImage",style:{marginBottom:T.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"AddImage",component:t.icons$AddImage}),onClick:()=>X("add_img"),style:{width:"100%"},children:b("Add image")})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"Typography",style:{marginBottom:T.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Dropdown,{arrow:!0,menu:{items:ne},trigger:["hover"],placement:"bottom",getPopupContainer:N=>N.closest(".selected-element-panel"),children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"Typograf",component:t.icons$Typograf}),onClick:()=>X("typograf"),style:{width:"100%"},children:b("Typography")})})})})]}),v.mergeTagsShow&&we&&(0,o.jsxs)(t.ui_kit$Col,{span:24,id:"merge_tags_wrapper",style:{marginBottom:T.formItemMarginBottomXS},children:[(0,o.jsx)(t.ui_kit$Button,{id:"merge_tags_button",icon:(0,o.jsx)(r.EmIcons,{icon:"MergeTags",component:t.icons$MergeTags}),style:{width:"100%",display:Te?"none":"inline-flex"},onClick:()=>Ie(!0),children:b("Merge tags")}),(0,o.jsx)(t.ui_kit$Cascader,{ref:ye,classNames:{popup:{root:"merge-tags"}},options:we,placeholder:b("Start typing the title"),showSearch:{filter:He,render:le},spellCheck:"false",getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper"),onChange:Me,style:{display:Te?"block":"none",width:"100%"},open:Te,onKeyDown:N=>{N.key==="Escape"&&Ie(!1)}})]})]})}):null,(0,o.jsxs)(t.ui_kit$FormSection,{title:null,dividerTop:k||v.formTextFieldTypografEnabled&&!a,bodyStyle:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Text font"),placement:"bottom",zIndex:1,getPopupContainer:N=>N.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontFamily",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{textEditor:!0,loadGoogleFonts:h,getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper")})})}),!l.showOnMobile&&(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Font size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontSize",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:8,max:90,placeholder:b("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Line height"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"lineHeight",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:10,max:110,placeholder:b("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})})]}),(0,o.jsx)(t.ui_kit$Row,{gutter:10,style:{marginBottom:10,marginTop:5},children:(0,o.jsxs)(t.ui_kit$Col,{span:24,children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:-10},children:[a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsxs)("div",{className:"selected-text-common-form__format-toolbar",children:[(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textStrong",tooltipTitle:b(ge?"Strong ( ⌘B )":"Strong ( Ctrl+B )"),icon:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-text-common-form__icon-radius"})}),(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textItalic",tooltipTitle:b(ge?"Italic ( ⌘I )":"Italic ( Ctrl+I )"),icon:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-text-common-form__icon-radius"})}),(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textUnderline",tooltipTitle:b(ge?"Underline ( ⌘U )":"Underline ( Ctrl+U )"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined,className:"selected-text-common-form__icon-radius"})})]})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Text color"),placement:"bottom",zIndex:1,getPopupContainer:N=>N.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textColor",rules:[{message:b("Please set the font color")}],className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:b("Color"),usedColors:l.usedColors})})})})]}),!a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textStrong",tooltipTitle:b(ge?"Strong ( ⌘B )":"Strong ( Ctrl+B )"),icon:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textItalic",tooltipTitle:b(ge?"Italic ( ⌘I )":"Italic ( Ctrl+I )"),icon:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textUnderline",tooltipTitle:b(ge?"Underline ( ⌘U )":"Underline ( Ctrl+U )"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined,className:"selected-text-common-form__icon-radius"})})}),l?.list?.isList&&(0,o.jsxs)(t.ui_kit$Col,{span:3,children:[" ",(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textStrikethrough",tooltipTitle:b(ge?"Strikethrough ( ⌘+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,o.jsx)(r.EmIcons,{icon:"StrikethroughOutlined",component:t.icons$StrikethroughOutlined,className:"selected-text-common-form__icon-radius"})})]}),!l?.list?.isList&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"listUL",tooltipTitle:b("Unordered list"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnorderedListOutlined",component:t.icons$UnorderedListOutlined,className:"selected-td-form__icon-radius"}),onSelect:ie})}),!l?.list?.isList&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"listOL",tooltipTitle:b("Ordered list"),icon:(0,o.jsx)(r.EmIcons,{icon:"OrderedListOutlined",component:t.icons$OrderedListOutlined,className:"selected-td-form__icon-radius"}),onSelect:ie})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textSuperscript",tooltipTitle:b("Text superscript"),icon:(0,o.jsx)(r.EmIcons,{icon:"Superscript",component:t.icons$Superscript})})}),l?.list?.isList&&(0,o.jsxs)(t.ui_kit$Col,{span:3,children:[" ",(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textSubscript",tooltipTitle:b("Text subscript"),icon:(0,o.jsx)(r.EmIcons,{icon:"Subscript",component:t.icons$Subscript})})]}),s&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,className:(0,De.default)("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":typeof l.linkHref=="string"}),elementSettings:l,name:"textLink",forceInactive:!!l.textAnchor,tooltipTitle:b("Link"),icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-text-common-form__icon-radius"}),onSelect:ie})}),l?.list?.isList&&v.formTextFieldReplacerEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:b("Text replacer"),placement:"bottom",getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button ant-form-item",{"selected-td-form__button--active":O}),icon:(0,o.jsx)(r.EmIcons,{icon:"Replacer",component:t.icons$Replacer,className:"selected-td-form__icon-radius"}),onClick:Ae,ref:C})})}),(!l?.list?.isList||s&&l?.list?.isList)&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:b("More options"),placement:"bottom",getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button ant-form-item",{"selected-td-form__button--active":ee||R}),icon:(0,o.jsx)(r.EmIcons,{icon:"DotsHoriz",component:t.icons$DotsHoriz,className:"selected-td-form__icon-radius"}),onClick:()=>me(!ee)})})})]})]}),!a&&ee&&(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[!l?.list?.isList&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Col,{span:3,children:[" ",(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textStrikethrough",tooltipTitle:b(ge?"Strikethrough ( ⌘+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,o.jsx)(r.EmIcons,{icon:"StrikethroughOutlined",component:t.icons$StrikethroughOutlined,className:"selected-text-common-form__icon-radius"})})]}),(0,o.jsxs)(t.ui_kit$Col,{span:3,children:[" ",(0,o.jsx)(qe,{form:e,elementSettings:l,name:"textSubscript",tooltipTitle:b("Text subscript"),icon:(0,o.jsx)(r.EmIcons,{icon:"Subscript",component:t.icons$Subscript})})]}),v.formTextFieldReplacerEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:b("Text replacer"),placement:"bottom",getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button ant-form-item",{"selected-td-form__button--active":O}),icon:(0,o.jsx)(r.EmIcons,{icon:"Replacer",component:t.icons$Replacer,className:"selected-td-form__icon-radius"}),onClick:Ae,ref:C})})})]}),s&&(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:b("Anchor"),placement:"bottom",getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button ant-form-item",{"selected-td-form__button--active":R}),icon:(0,o.jsx)(r.EmIcons,{icon:"Anchor",component:t.icons$Anchor,className:"selected-text-common-form__icon-radius"}),onMouseDown:N=>{N.preventDefault(),Ge("mouseDown")}})})})]}),s&&typeof l.linkHref=="string"&&Be&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(et,{show:d==="#",__:b,style:{marginBottom:T.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b(d==="#"?"Anchor name":"The URL that the hyperlink directs to."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"linkHref",style:{marginBottom:d==="mailto:"?T.formItemMarginBottomXS:""},children:(0,o.jsx)(t.ui_kit$Input,{ref:P,addonBefore:(0,o.jsx)(Zo,{linkProtocol:d,handleLinkProtocolsChange:Ve,__:b}),allowClear:!0,placeholder:b(d==="#"?"Anchor name":"Hyperlink URL"),autoFocus:l?.isNewLink,onSelect:ie,prefix:(0,o.jsx)(Qo,{linkProtocol:d})})})}),d==="mailto:"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:"subject",style:{marginBottom:T.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:b("Subject"),onSelect:ie})}),(0,o.jsx)(t.ui_kit$Form.Item,{name:"body",style:{marginBottom:T.formItemMarginBottomMD},children:(0,o.jsx)(t.ui_kit$TextArea,{rows:3,placeholder:b("Body"),onSelect:ie})})]})]}),s&&R&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Anchor name"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textAnchor",children:(0,o.jsx)(t.ui_kit$Input,{placeholder:b("Anchor name"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content addon-text-content--icon",title:b("Anchor"),"aria-hidden":!0,children:(0,o.jsx)(r.EmIcons,{icon:"Anchor",component:t.icons$Anchor,className:"selected-text-common-form__icon-radius",size:18})}),ref:I,onSelect:ie,onBlur:()=>{e.getFieldValue("textAnchor")?.trim()||G(!1)}})})}),!a&&O&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textReplacer",children:(0,o.jsx)(t.ui_kit$Input,{placeholder:b("The code that will replace this text"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:b("Text")}),onChange:We,onKeyDown:Ye,onDoubleClick:D,ref:j,onSelect:ie})})})]})}),!a&&(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Text color"),placement:"bottom",zIndex:1,getPopupContainer:N=>N.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textColor",rules:[{message:b("Please set the font color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:b("Color"),usedColors:l.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Text background"),placement:"bottom",zIndex:1,getPopupContainer:N=>N.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textBackgroundColor",rules:[{message:b("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:b("Background color"),usedColors:l.usedColors})})})})]})]}),!a&&l?.list?.isList&&(0,o.jsxs)(t.ui_kit$FormSection,{title:b("List settings"),dividerTop:!0,children:[l?.list?.listType==="OL"&&(0,o.jsx)(t.ui_kit$Row,{children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Bullets font"),placement:"bottom",zIndex:1,getPopupContainer:N=>N.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"BulletsFontFamily",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{textEditor:!0,loadGoogleFonts:h,getPopupContainer:N=>N.closest(".email-pane__collapse-wrapper"),style:{marginTop:"-9px"}})})})})}),(0,o.jsx)(t.ui_kit$Row,{gutter:[10],children:l?.list?.listType==="UL"&&(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Bullets type"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"BulletType",className:"bullet-type",children:(0,o.jsx)(t.ui_kit$Select,{size:"medium",placeholder:b("Bullets type"),onClick:N=>N.stopPropagation(),options:ke})})})})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:[10],children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Bullets color"),placement:"bottom",zIndex:1,getPopupContainer:N=>N.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"ColorBullets",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:b("Bullets color"),usedColors:l.usedColors,disabled:f,onChange:$,externalValue:f?q?.textColor:void 0})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Bullets size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"BulletsSize",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:8,max:90,defaultValue:l?.list?.bulletFontSize,placeholder:b("Bullets size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})})]}),l?.list?.listType==="OL"&&(0,o.jsxs)(t.ui_kit$Row,{children:[(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"BulletTextStrong",tooltipTitle:b(ge?"Strong ( ⌘B )":"Strong ( Ctrl+B )"),icon:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"BulletTextItalic",tooltipTitle:b(ge?"Italic ( ⌘I )":"Italic ( Ctrl+I )"),icon:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"BulletTextStrikethrough",tooltipTitle:b(ge?"Strikethrough ( ⌘+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,o.jsx)(r.EmIcons,{icon:"StrikethroughOutlined",component:t.icons$StrikethroughOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:l,name:"BulletTextUnderline",tooltipTitle:b(ge?"Underline ( ⌘U )":"Underline ( Ctrl+U )"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined,className:"selected-text-common-form__icon-radius"})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:[10],style:{marginTop:"-8px"},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Between list items"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"SpacingBetweenParagraphs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:5,max:100,placeholder:b("Between list items"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnHeightOutlined",component:t.icons$ColumnHeightOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:b("Between bullets and text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"SpacingBetweenBulletsAndText",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:1,max:100,placeholder:b("Between bullets and text"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:"px"})})})})]})]})]})},Ri=({form:e,elementSettings:i,showAddParagraph:l=!0,isButton:s=!1})=>{const{__:a}=r.useI18n(),d=z.useGoogleFontsLoader(),c=r.useSendPostMessage(),p=r.useDispatch(),f=r.useElementEntityKind(),x=r.useAppConfig(),[k,b]=(0,n.useState)(null);(0,n.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&b(!0)},[]);const h=P=>{c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_TEXT,action:P,locale:"en_US"})},[T,_]=(0,n.useState)(i.textAlign),[E,w]=(0,n.useState)(i.linkHref),v=P=>_(P);return(0,n.useEffect)(()=>{_(i.textAlign),w(i.linkHref)},[i]),(0,o.jsx)("div",{className:"selected_text_common_form_mobile",children:(0,o.jsxs)(t.ui_kit$Space,{size:"8",separator:(0,o.jsx)(t.ui_kit$Divider,{orientation:"vertical"}),children:[(0,o.jsxs)(t.ui_kit$Space,{size:8,className:"selected_text_common_form_mobile__group",children:[(0,o.jsx)("div",{style:{width:190},children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Text font"),placement:"bottom",zIndex:1,getPopupContainer:P=>P.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontFamily",children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{textEditor:!0,loadGoogleFonts:d,getPopupContainer:P=>P.closest(".selected_text_common_form_mobile")})})})}),(0,o.jsx)("div",{style:{width:90},children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Font size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontSize",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:8,max:90,placeholder:a("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)("div",{style:{width:90},children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Line height"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"lineHeight",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:10,max:110,placeholder:a("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})})]}),(0,o.jsxs)(t.ui_kit$Space,{size:8,className:"selected_text_common_form_mobile__group",children:[(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textStrong",tooltipTitle:a(k?"Strong ( ⌘B )":"Strong ( Ctrl+B )"),icon:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-td-form__icon-radius"})}),(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textItalic",tooltipTitle:a(k?"Italic ( ⌘I )":"Italic ( Ctrl+I )"),icon:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-td-form__icon-radius"})}),(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textStrikethrough",tooltipTitle:a(k?"Strikethrough ( ⌘+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,o.jsx)(r.EmIcons,{icon:"StrikethroughOutlined",component:t.icons$StrikethroughOutlined,className:"selected-td-form__icon-radius"})}),(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textUnderline",tooltipTitle:a(k?"Underline ( ⌘U )":"Underline ( Ctrl+U )"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined,className:"selected-td-form__icon-radius"})})]}),(0,o.jsxs)(t.ui_kit$Space,{size:8,className:"selected_text_common_form_mobile__group",children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Text color"),placement:"bottom",zIndex:1,getPopupContainer:P=>P.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textColor",rules:[{message:a("Please set the font color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:a("Color"),usedColors:i.usedColors,getPopupContainer:P=>P.closest(".selected_text_common_form_mobile")})})}),!s&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Text background"),placement:"bottom",zIndex:1,getPopupContainer:P=>P.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textBackgroundColor",rules:[{message:a("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:a("Background color"),usedColors:i.usedColors})})})})]}),l&&(0,o.jsx)(t.ui_kit$Space,{size:8,className:"selected_text_common_form_mobile__group",children:(0,o.jsxs)(o.Fragment,{children:[typeof E=="string"?(0,o.jsx)(t.ui_kit$Dropdown,{arrow:!0,popupRender:()=>(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("The URL that the hyperlink directs to."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"linkHref",children:(0,o.jsx)(t.ui_kit$Input,{allowClear:!0,placeholder:a("Hyperlink URL"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined}),autoFocus:i?.isNewLink})})}),classNames:{root:"codemode-textalign-dropdown"},styles:{root:{left:520,top:52,transform:"translateX(0)",marginLeft:57}},trigger:["hover"],placement:"bottom",getPopupContainer:P=>P.closest(".selected_text_common_form_mobile"),children:(0,o.jsx)("div",{children:(0,o.jsx)(qe,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:i,name:"textLink",icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-td-form__icon-radius"}),showTooltip:!1})})}):(0,o.jsx)(qe,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:i,name:"textLink",tooltipTitle:a("Link"),icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-td-form__icon-radius"})}),(0,o.jsx)(t.ui_kit$Dropdown,{arrow:!0,popupRender:()=>(0,o.jsx)(it,{form:e,elementSettings:i,name:"textAlign",setAlignStateHandle:v}),classNames:{root:"codemode-textalign-dropdown"},styles:{root:{left:615,top:52,transform:"translateX(0)",marginLeft:57}},trigger:["hover"],placement:"bottom",getPopupContainer:P=>P.closest(".selected_text_common_form_mobile"),children:(0,o.jsx)(t.ui_kit$Button,{icon:T==="right"?(0,o.jsx)(r.EmIcons,{icon:"AlignRightOutlined",component:t.icons$AlignRightOutlined,size:18,strokeWidth:x.iconStrokeWidth}):T==="center"?(0,o.jsx)(r.EmIcons,{icon:"AlignCenterOutlined",component:t.icons$AlignCenterOutlined,size:18,strokeWidth:x.iconStrokeWidth}):(0,o.jsx)(r.EmIcons,{icon:"AlignLeftOutlined",component:t.icons$AlignLeftOutlined,size:18,strokeWidth:x.iconStrokeWidth}),className:"selected-td-form__button"})})]})}),(0,o.jsxs)(t.ui_kit$Space,{size:8,className:"selected_text_common_form_mobile__group",children:[l&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Add paragraph"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"Paragraph",component:t.icons$Paragraph}),onClick:()=>h("add_p"),className:"selected-td-form__button"})}),!s&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:a("Add inline image"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"ImageAdd",component:t.icons$ImageAdd,size:16,strokeWidth:x.iconStrokeWidth}),onClick:()=>h("add_img"),className:"selected-td-form__button"})}),(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"Typograf",component:t.icons$Typograf}),className:"selected-td-form__button"})]}),(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"CloseOutlined",component:t.icons$CloseOutlined}),type:"icon",style:{marginLeft:26},onClick:()=>{c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),p(r.resetToLastActiveSettingsTab()),setTimeout(()=>{p(f==="block"?r.setElementSettings({type:null}):r.setElementSettings$1({type:null}))},300)}})]})]})})},Dt=({elementSettings:e,imgParent:i=!1,name:l="mobileAlign"})=>{const{__:s}=r.useI18n(),a=r.useAppConfig();return(0,o.jsx)(t.ui_kit$Form.Item,{name:l,children:(0,o.jsx)(t.ui_kit$FormAlignTextControl,{disabled:i&&!e.parent,strokeWidth:a?.iconStrokeWidth,labels:{alignLeft:s("Text align left"),alignCenter:s("Text align center"),alignRight:s("Text align right"),alignJustify:s("Text align justify")}})})};Dt.propTypes={elementSettings:g.default.object.isRequired,imgParent:g.default.bool,name:g.default.string};var pn=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useDispatch(),s=r.useSendPostMessage(),[a]=t.ui_kit$Form.useForm(),d=r.useSelector(r.selectEmailViewType),c=r.useSelector(r.selectMobileViewActive),p=r.useSelector(r.selectIsCodeMode),f=r.useSelector(r.selectCodeModeDirection),x=p&&f!=="bottom",[k,b]=(0,n.useState)("https://"),[h,T]=(0,n.useState)(!1),_=Mr(),E=(0,n.useMemo)(()=>_,[]),w=r.useElementEntityKind(),{remember:v,fillFields:P}=st(e),j=(0,n.useCallback)(I=>{v(I),l(w==="email"?r.setElementSettings$1(I):r.setElementSettings(I))},[l,w,v]);(0,n.useEffect)(()=>{if(e){const{subject:I,body:K,baseEmail:U}=Cr(e.linkHref),O=e.linkHref,L=typeof O=="string"&&Bi(O),R=typeof O=="string"&&O.startsWith("mailto:")?U:L?O.slice(1):typeof O=="string"?O:"https://";b(Mt(O||"","https://")),P(a,{...e,lineHeight:u(e.lineHeight),linkHref:R,subject:I,body:K,mobileFontSize:u(e.mobileFontSize?.value||e.fontSize),mobileFontSizeDim:e.mobileFontSize?.dim||e.fontSizeDim,mobileLineHeight:u(e.mobileLineHeight?.value??e.lineHeight),mobileLineHeightDim:e.mobileLineHeight?.dim||e.lineHeightDim,mobileTextAlign:Pr(e.mobileTextAlign,e.textAlign),SpacingBetweenBulletsAndText:e?.list?.betweenRowCell,SpacingBetweenParagraphs:e?.list?.betweenParagraphs,BulletsSize:e?.list?.bulletFontSize,ColorBullets:e?.list?.bulletsColor,BulletTextStrong:e?.list?.bulletFontBold,BulletTextItalic:e?.list?.bulletFontItalic,CheckboxColor:h,BulletsFontFamily:e?.list?.bulletFontFamily,BulletTextUnderline:e?.list?.bulletFontUnderline,BulletTextStrikethrough:e?.list?.bulletFontStrikethrough,BulletType:E.find(G=>G.symbol===e?.list?.bulletType)?.code??E[0].code,textSuperscript:e?.textSuperscript,textSubscript:e?.textSubscript,listOL:e?.standardList?.listTypeOL,listUL:e?.standardList?.listTypeUL})}},[a,e]);const C=I=>{const K=a.getFieldsValue(!0),U=Object.keys(I)[0];let O;switch(U){case"mobileFontSize":O={[U]:{classNamePrefix:"em-mob-font_size-",value:I[U],dim:K.mobileFontSizeDim}};break;case"mobileLineHeight":O={[U]:{classNamePrefix:"em-mob-line_height-",value:I[U],dim:K.mobileLineHeightDim}};break;case"mobileTextAlign":O={[U]:{classNamePrefix:"em-mob-text_align-",value:I[U]}};break;case"linkHref":let L=ot(I[U]);if(L!==I[U]&&a.setFieldValue("linkHref",L),k==="#"&&L&&!L.startsWith("#")&&(L="#"+L),L.startsWith("mailto:")){const G=a.getFieldValue("subject"),J=a.getFieldValue("body");O={[U]:Si(L,G,J)}}else O={[U]:L};Wo(L,b);break;case"subject":case"body":const R=a.getFieldValue("linkHref")||"";if(R.substring(0,7)==="mailto:"){const G=R.split("?")[0],J=U==="subject"?I[U]:a.getFieldValue("subject"),te=U==="body"?I[U]:a.getFieldValue("body"),oe=[];J&&oe.push(`subject=${encodeURIComponent(J)}`),te&&oe.push(`body=${encodeURIComponent(te)}`),O={linkHref:oe.length>0?`${G}?${oe.join("&")}`:G}}else return;break;default:O=I}s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:O}),j({...e,list:{...e.list,bulletsColor:a.getFieldValue("ColorBullets"),bulletFontFamily:a.getFieldValue("BulletsFontFamily"),bulletFontSize:a.getFieldValue("BulletsSize"),betweenParagraphs:a.getFieldValue("SpacingBetweenParagraphs"),betweenRowCell:a.getFieldValue("SpacingBetweenBulletsAndText"),bulletType:E.find(L=>L.code===a.getFieldValue("BulletType"))?.symbol??E[0].symbol},...O,activateSection:null,changeKey:U})};return(0,o.jsxs)(t.ui_kit$Form,{form:a,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:C,className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:"",textAnchor:"",subject:"",body:"",SpacingBetweenBulletsAndText:0,SpacingBetweenParagraphs:0,BulletsSize:0,ColorBullets:"",BulletTextStrong:!1,BulletTextItalic:!1,CheckboxColor:!1,BulletsFontFamily:"",BulletTextUnderline:!1,BulletTextStrikethrough:!1,BulletType:"",textSuperscript:!1,textSubscript:!1,listOL:!1,listUL:!1},children:[!x&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),!(d==="mobile"&&!x&&c.styles)&&(0,o.jsx)("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0},children:x?(0,o.jsx)(Ri,{form:a,elementSettings:e}):(0,o.jsx)(gt,{form:a,fillFields:P,elementSettings:e,linkProtocol:k,setLinkProtocol:b,isBulletFontColorChecked:h,setIsBulletFontColorChecked:T})}),!x&&(0,o.jsxs)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:d==="mobile"&&c.styles?"block":"none"},children:[(0,o.jsx)(t.ui_kit$Row,{gutter:20,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Dt,{form:a,elementSettings:e,name:"mobileTextAlign"})})}),!!e.showOnMobile&&(0,o.jsx)(gt,{form:a,fillFields:P,elementSettings:e,linkProtocol:k,setLinkProtocol:b}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Fr,{})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileLineHeight",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})]})]})]})},yi=(e,i)=>{const{__:l}=r.useI18n();return(0,o.jsx)(t.ui_kit$Tooltip,{title:l("During export, the element is converted into an image."),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"exportAsPicture",valuePropName:"checked",className:"form-item-margin-xs",style:{marginBottom:10},children:(0,o.jsx)(t.ui_kit$Switch,{id:"convert-in-image",label:l("Convert into an image"),size:"small",labelStyle:{position:"relative",top:2}})})},"exportAsPicture")},Dr={marginBottom:10},Vr={position:"relative",top:2};function hn(e){return Array.isArray(e)?!!e[0]?.value:typeof e=="string"?e.trim()!=="":!!e}var rt=({form:e,showRounding:i=!1,showBackground:l=!1})=>{const{__:s}=r.useI18n(),a=hn(t.ui_kit$Form.useWatch("backgroundImage",e));return(0,o.jsxs)(o.Fragment,{children:[i&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Adds bulletproof VML markup so the button keeps rounded corners in Outlook."),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"outlookRounding",valuePropName:"checked",className:"form-item-margin-xs",style:Dr,children:(0,o.jsx)(t.ui_kit$Switch,{id:"outlook-rounding",label:s("Rounded corners in Outlook (VML)"),size:"small",labelStyle:Vr})})},"outlookRounding"),l&&a&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Adds VML markup so the background image is visible in Outlook."),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"outlookBackground",valuePropName:"checked",className:"form-item-margin-xs",style:Dr,children:(0,o.jsx)(t.ui_kit$Switch,{id:"outlook-background",label:s("Background image in Outlook (VML)"),size:"small",labelStyle:Vr})})},"outlookBackground")]})};rt.propTypes={form:g.default.object,showRounding:g.default.bool,showBackground:g.default.bool};var Hr=({form:e,elementSettings:i,boxShadow:l,bordersShow:s,borderRadiusShow:a,boxShadowShow:d,backgroundShow:c,backgroundImageEmpty:p,backgroundRepeatOptions:f,backgroundSizeOptions:x,sizeShow:k,modificationShow:b,oneBorderRadiusValue:h,setOneBorderRadiusValue:T,toggleShowBorderHandler:_,toggleShowBorderRadiusHandler:E,toggleShowBoxShadowHandler:w,toggleShowSizeHandler:v,toggleShowBackgroundHandler:P,toggleShowModificationHandler:j})=>{const{__:C}=r.useI18n(),I=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{style:{paddingBottom:4},children:(0,o.jsx)(Uo,{form:e,elementSettings:i,tooltipTitle:C("The align attribute sets the horizontal alignment of the table.")})}),(0,o.jsx)(t.ui_kit$FormSection,{title:C("Size"),collapsible:!0,open:k,onToggle:v,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormSizeInputs,{showHeight:!1,showMinMax:!0,columnsPerRow:2,dimensionSelect:$o,minWidthDimensionSelect:$o,maxWidthDimensionSelect:$o,rowStyle:{marginBottom:4},labels:{width:C("Width"),height:C("Height"),minWidth:C("Minimum width"),maxWidth:C("Maximum width")}})}),(0,o.jsxs)(t.ui_kit$FormSection,{title:C("Background"),collapsible:!0,open:c,onToggle:P,dividerTop:!0,children:[(0,o.jsx)(t.ui_kit$FormBackgroundSettings,{imageEnabled:I.formTableFieldBackgroundImageEnabled,backgroundImageEmpty:p,usedColors:i.usedColors,colorPlaceholder:C("Background color"),horizontalPositionPlaceholder:C("Horizontal position"),horizontalPositionTooltip:C("Horizontal position"),verticalPositionPlaceholder:C("Vertical position"),verticalPositionTooltip:C("Vertical position"),backgroundRepeatTooltip:C("Background image repeat"),backgroundSizeTooltip:C("Background image size"),selectPlaceholder:C("Please choose"),backgroundRepeatOptions:f,backgroundSizeOptions:x,imageUploadSlot:I.formTableFieldBackgroundImageEnabled?(0,o.jsx)(No,{form:e,label:C("Background image"),name:"backgroundImage",tooltipTitle:C("Background image"),placeholder:C("Background image link/route")}):void 0}),(0,o.jsx)(rt,{form:e,showBackground:!0})]}),I.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:C("Borders"),collapsible:!0,open:s,onToggle:_,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,elementSettings:i})}),I.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:C("Border radius"),collapsible:!0,open:a,onToggle:E,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:h,setOneBorderRadiusValue:T,elementSettings:i})}),I.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:C("Box shadow"),collapsible:!0,open:d,onToggle:w,dividerTop:!0,children:(0,o.jsx)(jo,{})}),I.formFieldExportAsPictureEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:C("Export settings"),collapsible:!0,open:b,onToggle:j,dividerTop:!0,children:(0,o.jsx)(yi,{form:e,elementSettings:i})}),I.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:C("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})}),I.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:C("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};Hr.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,bordersShow:g.default.bool,borderRadiusShow:g.default.bool,boxShadowShow:g.default.bool,backgroundShow:g.default.bool,backgroundImageEmpty:g.default.bool,backgroundRepeatOptions:g.default.array,backgroundSizeOptions:g.default.array,sizeShow:g.default.bool,modificationShow:g.default.bool,oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,toggleShowBorderHandler:g.default.func,toggleShowBorderRadiusHandler:g.default.func,toggleShowBoxShadowHandler:g.default.func,toggleShowSizeHandler:g.default.func,toggleShowBackgroundHandler:g.default.func,toggleShowModificationHandler:g.default.func};var Ur=({form:e,elementSettings:i,label:l})=>{const{__:s}=r.useI18n();(0,n.useRef)();const[a,d]=(0,n.useState)(i.mobileBackgroundColor?.value==="none"),{token:c}=(0,t.ui_kit$useToken)(),p=r.useSendPostMessage(),f=k=>{e.setFieldsValue({mobileBackgroundColor:""}),d(b=>!b),p({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:a?"":"none"}}})},x=k=>{d(!1)};return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(t.ui_kit$Tooltip,{trigger:["hover"],title:s("Background color"),placement:"left",children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileBackgroundColor",style:{marginBottom:c.formItemMarginBottomXS/2},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{onChange:x,placeholder:l,usedColors:i.usedColors})}),(0,o.jsx)(t.ui_kit$Switch,{id:"without-background-color",label:s("Without background color"),labelSize:"small",size:"small",checked:a,onChange:f})]})})};Ur.propTypes={form:g.default.shape({setFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired};var Vt={horizontal:[{value:"left",label:"left"},{value:"center",label:"center"},{value:"right",label:"right"}],vertical:[{value:"top",label:"top"},{value:"center",label:"center"},{value:"bottom",label:"bottom"}]},wi={mobileBackgroundColor:"em-mob-background_color-",mobileBackgroundImage:"em-mob-background_image-",mobileBackgroundPositionX:"em-mob-background_position_x-",mobileBackgroundPositionY:"em-mob-background_position_y-",mobileBackgroundRepeat:"em-mob-background_repeat-",mobileBackgroundSize:"em-mob-background_size-"},at="none",bn=/^(https?:)?\/\//i,fn=/^(\d*\.?\d+)(%|px)$/;function gn(e){return e in wi}function Wr(e){return bn.test(e.trim())}function ji(e,i){const l=wi[e],s=typeof i=="string"?i:"";return e==="mobileBackgroundImage"?s&&s!==at&&!Wr(s)?null:{[e]:[{classNamePrefix:l,value:s,type:"url"}]}:e==="mobileBackgroundRepeat"?{[e]:{classNamePrefix:l,value:s||at}}:{[e]:{classNamePrefix:l,value:s}}}function _t(e){const[i]=Object.keys(e??{});return!i||!gn(i)?null:ji(i,e[i])}function _n(){return Object.keys(wi).reduce((e,i)=>({...e,...ji(i,"")}),{})}function zr(e){const i=(e??"").trim(),l=i.match(fn);return l?{position:l[1],unit:l[2]}:{position:i,unit:"px"}}function Gr(e,i){return e?isNaN(parseFloat(e))?e:e+i:""}function Go(e){const i=e??{},l=i.customTable??i;return{type:i.type,usedColors:i.usedColors,mobileBackgroundColor:l.mobileBackgroundColor,mobileBackgroundImage:l.mobileBackgroundImage,mobileBackgroundPositionX:l.mobileBackgroundPositionX,mobileBackgroundPositionY:l.mobileBackgroundPositionY,mobileBackgroundRepeat:l.mobileBackgroundRepeat,mobileBackgroundSize:l.mobileBackgroundSize}}function xt(e){const i=e??{},l=i.customTable??i,s=l.backgroundSize??"";return{image:l.backgroundImage?.[0]?.value??"",positionX:l.backgroundPositionX??"",positionY:l.backgroundPositionY??"",repeat:l.backgroundRepeat??"",size:s==="auto"?"":s}}function nt(e){const i=Go(e),l=i.mobileBackgroundImage?.[0]?.value??"";return{mobileBackgroundImage:l===at?"":l,mobileBackgroundPositionX:i.mobileBackgroundPositionX?.value??"",mobileBackgroundPositionY:i.mobileBackgroundPositionY?.value??"",mobileBackgroundRepeat:i.mobileBackgroundRepeat?.value||at,mobileBackgroundSize:i.mobileBackgroundSize?.value??""}}function kt(e){const i=Go(e),l=i.mobileBackgroundRepeat?.value;return!!i.mobileBackgroundColor?.value||!!i.mobileBackgroundImage?.[0]?.value||!!i.mobileBackgroundPositionX?.value||!!i.mobileBackgroundPositionY?.value||!!l&&l!==at||!!i.mobileBackgroundSize?.value}function xn(e,i){return e===at?!1:!!e||!!i}function Et(e,i,l){e.setFieldsValue({...nt({}),mobileBackgroundColor:""}),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:Go(i).type,settings:_n()})}var kn=/^\d*\.?\d+$/,En={bottom:"auto"},Yr={marginBottom:0},Bn=(0,o.jsx)(r.EmIcons,{icon:"BgPositionHorizontal",component:t.icons$BgPositionHorizontal}),Sn=(0,o.jsx)(r.EmIcons,{icon:"BgPositionVertical",component:t.icons$BgPositionVertical}),Tn=e=>e.closest(".email-pane__collapse-wrapper")??e.parentNode,Xr=({value:e,onChange:i,inheritedValue:l,options:s,placeholder:a,prefix:d})=>{const c=e||l,[p,f]=(0,n.useState)(()=>zr(c));(0,n.useEffect)(()=>{f(h=>Gr(h.position,h.unit)===c?h:zr(c))},[c]);const x=(0,n.useCallback)((h,T)=>{f({position:h,unit:T});const _=s.some(E=>E.value===h);(h===""||_||kn.test(h))&&i?.(Gr(h,T))},[i,s]),k=(0,n.useCallback)(h=>x(h,p.unit),[x,p.unit]),b=(0,n.useCallback)(h=>x(p.position,h),[x,p.position]);return(0,o.jsx)(t.ui_kit$InputSelect,{options:s,position:p.position,setPosition:k,unit:p.unit,setUnit:b,placeholder:a,prefix:d,dropdownStyle:En,tooltipTitle:a,getTooltipPopupContainer:Tn})},Rn=({desktopPositionX:e,desktopPositionY:i})=>{const{__:l}=r.useI18n(),{token:s}=(0,t.ui_kit$useToken)(),a=s.formItemMarginBottomXS,d=(0,n.useMemo)(()=>({marginBottom:a}),[a]);return(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:d,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileBackgroundPositionX",style:Yr,children:(0,o.jsx)(Xr,{inheritedValue:e,options:Vt.horizontal,placeholder:l("Horizontal position"),prefix:Bn})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileBackgroundPositionY",style:Yr,children:(0,o.jsx)(Xr,{inheritedValue:i,options:Vt.vertical,placeholder:l("Vertical position"),prefix:Sn})})})]})},Kr=["hover"],qr=e=>document.querySelector(".email-properties__collapse-panel")??e.parentNode,Jr=({value:e,emptyValue:i,inheritedValue:l,...s})=>{const a=!!e&&e!==i,d=s.options.some(c=>c.value===l)?l:i;return(0,o.jsx)(t.ui_kit$Select,{...s,value:a?e:d})},yn=({desktopPositionX:e,desktopPositionY:i,desktopRepeat:l,desktopSize:s,backgroundRepeatOptions:a,backgroundSizeOptions:d})=>{const{__:c}=r.useI18n(),{token:p}=(0,t.ui_kit$useToken)(),f=p.formItemMarginBottomXS,x=(0,n.useMemo)(()=>({marginBottom:f}),[f]),k=(0,n.useMemo)(()=>({marginBottom:(f??0)*1.5}),[f]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Rn,{desktopPositionX:e,desktopPositionY:i}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:k,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:Kr,title:c("Background image repeat"),placement:"top",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileBackgroundRepeat",style:x,children:(0,o.jsx)(Jr,{emptyValue:"none",inheritedValue:l,options:a,placeholder:c("Please choose"),getPopupContainer:qr})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:Kr,title:c("Background image size"),placement:"top",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"mobileBackgroundSize",style:x,children:(0,o.jsx)(Jr,{emptyValue:"",inheritedValue:s,options:d,placeholder:c("Please choose"),getPopupContainer:qr})})})})]})]})},wn=ci,jn=({value:e,inheritedImage:i,...l})=>(0,o.jsx)(wn,{...l,value:e||i}),vn=e=>/^https?:\/\//i.test(e.trim()),In=({form:e,name:i="mobileBackgroundImage",placeholder:l="",disabled:s=!1,elementSettings:a,inheritedImage:d="",isImageNone:c=!1,onImageNoneChange:p})=>{const{__:f}=r.useI18n(),{token:x}=(0,t.ui_kit$useToken)(),k=t.ui_kit$Form.useWatch(i,e),[b,h]=(0,n.useState)(""),T=k||d,_=x.formItemMarginBottomXS??0,E=(0,n.useMemo)(()=>({marginBottom:_/2}),[_]);(0,n.useEffect)(()=>{if(!T){h("");return}h(vn(T)?"validating":"success")},[T]);const w=!!k&&!Wr(k),v=w?"error":b;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:i,className:"mobile-background-image-field",validateStatus:v,help:w?f("Enter a URL starting with http:// or https://"):void 0,style:E,children:(0,o.jsx)(jn,{inheritedImage:d,validateStatus:v,placeholder:l,name:i,disabled:s,elementSettings:a,imageInfo:a,onRemotePreviewValidate:h})}),(0,o.jsx)(t.ui_kit$Switch,{label:f("Without image"),labelSize:"small",size:"small",checked:c,onChange:p})]})},Cn={image:"",positionX:"",positionY:"",repeat:"",size:""},Bt=({elementSettings:e,imageEnabled:i=!1,desktopBackground:l=Cn})=>{const{__:s}=r.useI18n(),{token:a}=(0,t.ui_kit$useToken)(),d=t.ui_kit$Form.useFormInstance(),c=a.formItemMarginBottomMD,p=r.useSendPostMessage(),f=e.mobileBackgroundImage?.[0]?.value,[x,k]=(0,n.useState)(f==="none"),b=t.ui_kit$Form.useWatch("mobileBackgroundImage",d);(0,n.useEffect)(()=>{k(f==="none")},[f]),(0,n.useEffect)(()=>{b&&k(!1)},[b]);const h=(0,n.useCallback)(C=>{k(C),d.setFieldsValue({mobileBackgroundImage:""}),p({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:ji("mobileBackgroundImage",C?"none":"")})},[e.type,d,p]),T=(0,n.useMemo)(()=>[{label:s("Not defined"),value:"none"},{label:s("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:s("Repeat background (repeat)"),value:"repeat"},{label:s("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:s("Repeat background vertically (repeat-y)"),value:"repeat-y"}],[s]),_=(0,n.useMemo)(()=>[{label:s("Not defined"),value:""},{label:s("Contain"),value:"contain"},{label:s("Cover"),value:"cover"}],[s]),E=xn(x?"none":b,l.image),w=(0,n.useMemo)(()=>({marginBottom:E?c:0}),[c,E]),v=(0,n.useMemo)(()=>(0,o.jsx)("div",{style:w,children:(0,o.jsx)(Ur,{form:d,elementSettings:e,label:s("Background color")})}),[s,e,d,w]),P=(0,n.useMemo)(()=>(0,o.jsx)("div",{style:w,children:(0,o.jsx)(In,{form:d,placeholder:s("Background image"),elementSettings:e,inheritedImage:x?"":l.image,isImageNone:x,onImageNoneChange:h})}),[s,l.image,e,d,h,x,w]),j=(0,n.useMemo)(()=>(0,o.jsx)(yn,{desktopPositionX:l.positionX,desktopPositionY:l.positionY,desktopRepeat:l.repeat,desktopSize:l.size,backgroundRepeatOptions:T,backgroundSizeOptions:_}),[T,_,l.positionX,l.positionY,l.repeat,l.size]);return(0,o.jsx)(t.ui_kit$FormBackgroundSettings,{colorFieldName:"mobileBackgroundColor",colorSlot:v,imageEnabled:i,backgroundImageEmpty:!E,imageUploadSlot:P,imageControlsSlot:j,usedColors:e.usedColors})},Qr=({form:e,elementSettings:i,mobileBoxShadow:l,mobileBordersShow:s,mobileBorderRadiusShow:a,mobileBoxShadowShow:d,mobileSizeShow:c,mobileBackgroundShow:p,oneMobileBorderRadiusValue:f,setOneMobileBorderRadiusValue:x,toggleShowMobileBorderHandler:k,toggleShowMobileBorderRadiusHandler:b,toggleShowMobileBoxShadowHandler:h,toggleShowMobileSizeHandler:T,toggleShowMobileBackgroundHandler:_})=>{const{__:E}=r.useI18n(),{token:w}=(0,t.ui_kit$useToken)(),v=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{style:{paddingBottom:4},children:(0,o.jsx)(Uo,{form:e,elementSettings:i,typeOfForm:"mobile"})}),(0,o.jsx)(t.ui_kit$FormSection,{title:E("Size"),collapsible:!0,open:c,onToggle:T,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:E("Table width"),placement:"left",children:(0,o.jsx)("div",{style:{marginBottom:w.formItemMarginBottomMD+4},children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:i})})})})})}),(0,o.jsx)(t.ui_kit$FormSection,{title:E("Background"),collapsible:!0,open:p,onToggle:_,dividerTop:!0,children:(0,o.jsx)(Bt,{elementSettings:Go(i),imageEnabled:v.formTableFieldBackgroundImageEnabled,desktopBackground:xt(i)})}),v.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:E("Borders"),collapsible:!0,open:s,onToggle:k,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,typeOfForm:"mobile"})}),v.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:E("Border radius"),collapsible:!0,open:a,onToggle:b,dividerTop:!0,children:(0,o.jsx)(So,{form:e,typeOfForm:"mobile",oneBorderRadiusValue:f,setOneBorderRadiusValue:x,elementSettings:i})}),v.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:E("Box shadow"),collapsible:!0,open:d,onToggle:h,dividerTop:!0,children:(0,o.jsx)(jo,{typeOfForm:"mobile",form:e,elementSettings:i})}),v.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:E("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})}),v.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:E("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};Qr.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,mobileBoxShadow:g.default.object,mobileBordersShow:g.default.bool,mobileBorderRadiusShow:g.default.bool,mobileBoxShadowShow:g.default.bool,mobileSizeShow:g.default.bool,mobileBackgroundShow:g.default.bool,oneMobileBorderRadiusValue:g.default.bool,setOneMobileBorderRadiusValue:g.default.func,toggleShowMobileBorderHandler:g.default.func,toggleShowMobileBorderRadiusHandler:g.default.func,toggleShowMobileBoxShadowHandler:g.default.func,toggleShowMobileSizeHandler:g.default.func,toggleShowMobileBackgroundHandler:g.default.func};var Zr=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),[s]=t.ui_kit$Form.useForm(),a=Fo(),d=Fo(),c=r.useDispatch(),p=r.useElementEntityKind(),[f,x]=(0,n.useState)({}),[k,b]=(0,n.useState)(!0),[h,T]=(0,n.useState)({}),[_,E]=(0,n.useState)(!0),w=r.useSelector(r.selectEmailViewType),v=r.useSelector(r.selectMobileViewActive);r.useAppConfig();const[P,j]=(0,n.useState)(e.backgroundImage[0].value===""),C=r.useSelector(r.selectIsCodeMode),I=r.useSelector(r.selectCodeModeDirection),K=C&&I!=="bottom",[U,O]=(0,n.useState)(!1),[L,R]=(0,n.useState)(!1),[G,J]=(0,n.useState)(!1),[te,oe]=(0,n.useState)(!1),[he,be]=(0,n.useState)(!1),[ae,ke]=(0,n.useState)(!1),[Ce,de]=(0,n.useState)(!1),[Fe,je]=(0,n.useState)(!1),[re,Be]=(0,n.useState)(!1),[ce,ee]=(0,n.useState)(!1),[me,ue]=(0,n.useState)(!1),Z=[{label:i("Not defined"),value:"none"},{label:i("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:i("Repeat background (repeat)"),value:"repeat"},{label:i("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:i("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Q=[{label:i("Not defined"),value:""},{label:i("Contain"),value:"contain"},{label:i("Cover"),value:"cover"}],W=D=>D&&(D?.width||D?.style||D?.color)?D:"",q=e.border,se=e.mobileBorder,xe=Object.keys(q).find(D=>q[D]?.width||q[D]?.style||q[D]?.color),ge=Object.keys(se).find(D=>se[D]?.width||se[D]?.style||se[D]?.color),{remember:Ne,fillFields:ye}=st(e);(0,n.useEffect)(()=>{if(e){const D=e.boxShadow,ie=e.mobileBoxShadow;x(D),T(ie),ye(s,{...e,width:e.width?.value,widthDim:e.width?.dim,maxWidth:e.maxWidth?.value,maxWidthDim:e.maxWidth?.dim,minWidth:e.minWidth?.value,minWidthDim:e.minWidth?.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderAll:u(e.border.all),borderTop:u(e.border.top),borderBottom:u(e.border.bottom),borderRight:u(e.border.right),borderLeft:u(e.border.left),borderRadiusAll:u(e.borderRadius.all),borderRadiusTopLeft:u(e.borderRadius.topLeft),borderRadiusBottomLeft:u(e.borderRadius.bottomLeft),borderRadiusTopRight:u(e.borderRadius.topRight),borderRadiusBottomRight:u(e.borderRadius.bottomRight),boxShadowInset:u(e.boxShadow?.inset)||!1,boxShadowHOffset:u(e.boxShadow?.hOffset),boxShadowVOffset:u(e.boxShadow?.vOffset),boxShadowBlurRadius:u(e.boxShadow?.blurRadius),boxShadowSpreadRadius:u(e.boxShadow?.spreadRadius),boxShadowColor:u(e.boxShadow?.color),mobileWidth:po(e.mobileWidth?.value),mobileWidthDim:e.mobileWidth?.dim,mobileAlign:e.mobileAlign?.value,mobileBorderAll:W(e.mobileBorder.all)||!(W(e.mobileBorder.top)||W(e.mobileBorder.bottom)||W(e.mobileBorder.right)||W(e.mobileBorder.left))&&W(e.border.all),mobileBorderTop:W(e.mobileBorder.top)||!W(e.mobileBorder.all)&&W(e.border.top),mobileBorderBottom:W(e.mobileBorder.bottom)||!W(e.mobileBorder.all)&&W(e.border.bottom),mobileBorderRight:W(e.mobileBorder.right)||!W(e.mobileBorder.all)&&W(e.border.right),mobileBorderLeft:W(e.mobileBorder.left)||!W(e.mobileBorder.all)&&W(e.border.left),mobileBorderRadiusAll:u(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:u(e.mobileBorderRadius.topLeft!==null?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:u(e.mobileBorderRadius.bottomLeft!==null?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:u(e.mobileBorderRadius.topRight!==null?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:u(e.mobileBorderRadius.bottomRight!==null?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:u(e.mobileBoxShadow?.inset)||!1,mobileBoxShadowHOffset:u(e.mobileBoxShadow?.hOffset),mobileBoxShadowVOffset:u(e.mobileBoxShadow?.vOffset),mobileBoxShadowBlurRadius:u(e.mobileBoxShadow?.blurRadius),mobileBoxShadowSpreadRadius:u(e.mobileBoxShadow?.spreadRadius),mobileBoxShadowColor:u(e.mobileBoxShadow?.color),mobileBackgroundColor:u(e.mobileBackgroundColor?.value!=="none"?e.mobileBackgroundColor?.value:""),...nt(e),exportAsPicture:e?.exportAsPicture}),!u(e.borderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?b(!1):b(!0),u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight)?E(!1):E(!0),j(e.backgroundImage[0].value==="");const Ee=a.isStaleBorderSnapshot(e,!!xe),Ae=d.isStaleBorderSnapshot(e,!!ge);Ee&&s.setFieldsValue({border:r.RESET_BORDER_PARAMS,borderAll:null,borderTop:null,borderBottom:null,borderRight:null,borderLeft:null}),(Ae||Ee&&!ge)&&s.setFieldsValue({mobileBorder:r.RESET_BORDER_PARAMS,mobileBorderAll:null,mobileBorderTop:null,mobileBorderBottom:null,mobileBorderRight:null,mobileBorderLeft:null}),O(We=>xe&&!Ee?!0:We),R(We=>xe&&!Ee||ge&&!Ae?!0:We),J(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),oe(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),be(!!e.boxShadow),ke(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),de(!!e.width?.value||!!e.minWidth?.value||!!e.maxWidth?.value),je(!!e.mobileWidth.value),Be(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||e.backgroundRepeat!=="repeat"||!e.backgroundRepeat,!!e.backgroundSize),ee(kt(e)),ue(!!e.exportAsPicture)}},[s,e,xe,ge,a,d,ye]);const $e=(0,n.useCallback)(D=>{Ne(D),c(p==="email"?r.setElementSettings$1(D):r.setElementSettings(D))},[c,p,Ne]),X=D=>{const ie=s.getFieldsValue(!0),Ee=Object.keys(D)[0];let Ae;switch(Ee){case"exportAsPicture":Ae={exportAsPicture:ie.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":Ae={boxShadow:{hOffset:ie.boxShadowHOffset,vOffset:ie.boxShadowVOffset,blurRadius:ie.boxShadowBlurRadius,spreadRadius:ie.boxShadowSpreadRadius,color:ie.boxShadowColor,inset:ie.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":ie.borderPosition==="borderAll"?(Ae={border:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...ie.borderAll}}},s.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER})):ie.borderAll?.width||ie.borderAll?.style||ie.borderAll?.color?(Ae={border:{all:null,left:ie.borderAll,right:ie.borderAll,top:ie.borderAll,bottom:ie.borderAll,[z.REVERSE_BORDER_POSITIONS[Ee]]:{...ie[Ee],...D[Ee]}}},s.setFieldsValue({borderAll:null,borderLeft:ie.borderAll,borderRight:ie.borderAll,borderTop:ie.borderAll,borderBottom:ie.borderAll,[Ee]:{...ie[Ee],...D[Ee]}})):(Ae={border:{all:null,left:ie.borderLeft,right:ie.borderRight,top:ie.borderTop,bottom:ie.borderBottom,[z.REVERSE_BORDER_POSITIONS[Ee]]:{...ie[Ee],...D[Ee]}}},s.setFieldsValue({border:Ae.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":if(ie.mobileBorderPosition==="mobileBorderAll")Ae={mobileBorder:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...ie.mobileBorderAll,classNamePrefix:"em-mob-border_"+z.MOBILE_REVERSE_BORDER_POSITIONS[Ee]+"-"}}},s.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER});else{const We=z.MOBILE_REVERSE_BORDER_POSITIONS[Ee],Ge={...ie[Ee],...D[Ee]},Ye=!Ge?.width&&!Ge?.style&&!Ge?.color;if(ie.mobileBorder?.all?.width||ie.mobileBorder?.all?.style||ie.mobileBorder?.all?.color){const $=ie.mobileBorderAll;Ae={mobileBorder:{all:null,left:$,right:$,top:$,bottom:$,[We]:Ye?null:{...Ge,classNamePrefix:"em-mob-border_"+We+"-"}}},s.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:$,mobileBorderRight:$,mobileBorderTop:$,mobileBorderBottom:$,[Ee]:Ge})}else{const $=e.mobileBorder||{},N=y=>{const M=$[y];return M&&(M?.width||M?.style||M?.color)?M:null};Ae={mobileBorder:{all:null,left:We==="left"?Ye?null:{...Ge,classNamePrefix:"em-mob-border_left-"}:N("left"),right:We==="right"?Ye?null:{...Ge,classNamePrefix:"em-mob-border_right-"}:N("right"),top:We==="top"?Ye?null:{...Ge,classNamePrefix:"em-mob-border_top-"}:N("top"),bottom:We==="bottom"?Ye?null:{...Ge,classNamePrefix:"em-mob-border_bottom-"}:N("bottom")}},s.setFieldsValue({[Ee]:Ge})}}break;case"width":Ae={[Ee]:{value:D[Ee],dim:ie.widthDim}};break;case"widthDim":Ae={width:{value:ie.width,dim:D[Ee]}};break;case"maxWidth":Ae={[Ee]:{value:D[Ee],dim:ie.maxWidthDim}};break;case"maxWidthDim":Ae={maxWidth:{value:ie.maxWidth,dim:D[Ee]}};break;case"minWidth":Ae={[Ee]:{value:D[Ee],dim:ie.minWidthDim}};break;case"minWidthDim":Ae={minWidth:{value:ie.minWidth,dim:D[Ee]}};break;case"backgroundImage":j(D[Ee]===""),Ae={[Ee]:[{...e.backgroundImage[0],value:D[Ee]}],backgroundSize:"cover"};break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":Ae={borderRadius:{[z.BORDER_RADIUS_POSITION[Ee]]:+D[Ee]}};break;case"mobileWidth":Ae={[Ee]:{classNamePrefix:"em-mob-width-",value:D[Ee],dim:ie.mobileWidthDim}};break;case"mobileWidthDim":Ae={mobileWidth:{classNamePrefix:"em-mob-width-",value:ie.mobileWidth||100,dim:D[Ee]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":Ae={mobileBorderRadius:{[z.MOBILE_BORDER_RADIUS_POSITION[Ee]]:D[Ee],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[Ee]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":Ae={mobileBoxShadow:{hOffset:ie.mobileBoxShadowHOffset,vOffset:ie.mobileBoxShadowVOffset,blurRadius:ie.mobileBoxShadowBlurRadius,spreadRadius:ie.mobileBoxShadowSpreadRadius,color:ie.mobileBoxShadowColor,inset:ie.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileBackgroundColor":case"mobileBackgroundImage":case"mobileBackgroundPositionX":case"mobileBackgroundPositionY":case"mobileBackgroundRepeat":case"mobileBackgroundSize":if(Ae=_t(D),!Ae)return;break;case"mobileAlign":Ae={[Ee]:{classNamePrefix:"em-mob-table_align-",value:D[Ee]}};break;default:Ae=D}Ee!=="borderPosition"&&Ee!=="mobileBorderPosition"&&(l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:Ae}),Ee!=="mobileBorderRadiusAll"&&Ee!=="mobileBorderRadiusTopLeft"&&Ee!=="mobileBorderRadiusTopRight"&&Ee!=="mobileBorderRadiusBottomLeft"&&Ee!=="mobileBorderRadiusBottomRight"&&$e({...e,...Ae,mobileBorderRadius:{...e.mobileBorderRadius,...Ae?.mobileBorderRadius},activateSection:null,changeKey:Ee}))},ne=()=>{const D=s.getFieldsValue(!0);a.markBorderToggled(!U),setTimeout(()=>{O(ie=>!ie),U?(D.borderAll=z.NULL_BORDER,D.borderTop=z.NULL_BORDER,D.borderBottom=z.NULL_BORDER,D.borderRight=z.NULL_BORDER,D.borderLeft=z.NULL_BORDER):D.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:D.borderAll.color,style:D.borderAll.style,width:D.borderAll.width}}}})})},we=()=>{const D=s.getFieldsValue(!0);d.markBorderToggled(!L),setTimeout(()=>{R(ie=>!ie),L?(D.mobileBorderAll=z.NULL_BORDER,D.mobileBorderTop=z.NULL_BORDER,D.mobileBorderBottom=z.NULL_BORDER,D.mobileBorderRight=z.NULL_BORDER,D.mobileBorderLeft=z.NULL_BORDER):D.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:D.mobileBorderAll.color,style:D.mobileBorderAll.style,width:D.mobileBorderAll.width}}}})})},V=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{J(ie=>!ie),G?(D.borderRadiusAll=0,b(!0)):D.borderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:D.borderRadiusAll}}})})},Te=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{oe(ie=>!ie),te?(D.mobileBorderRadiusAll=null,E(!0)):D.mobileBorderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:D.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})},Ie=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{be(ie=>!ie),he?(D.boxShadowInset=!1,D.boxShadowHOffset=null,D.boxShadowVOffset=null,D.boxShadowBlurRadius=null,D.boxShadowSpreadRadius=null,D.boxShadowColor=""):(D.boxShadowInset=!1,D.boxShadowHOffset=5,D.boxShadowVOffset=5,D.boxShadowBlurRadius=10,D.boxShadowSpreadRadius=-5,D.boxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:D.boxShadowBlurRadius,color:D.boxShadowColor,hOffset:D.boxShadowHOffset,inset:D.boxShadowInset,spreadRadius:D.boxShadowSpreadRadius,vOffset:D.boxShadowVOffset}}})})},ve=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{ke(ie=>!ie),ae?(D.mobileBoxShadowInset=!1,D.mobileBoxShadowHOffset=null,D.mobileBoxShadowVOffset=null,D.mobileBoxShadowBlurRadius=null,D.mobileBoxShadowSpreadRadius=null,D.mobileBoxShadowColor=""):(D.mobileBoxShadowInset=!1,D.mobileBoxShadowHOffset=5,D.mobileBoxShadowVOffset=5,D.mobileBoxShadowBlurRadius=10,D.mobileBoxShadowSpreadRadius=-5,D.mobileBoxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:D.mobileBoxShadowBlurRadius,color:D.mobileBoxShadowColor,hOffset:D.mobileBoxShadowHOffset,inset:D.mobileBoxShadowInset,spreadRadius:D.mobileBoxShadowSpreadRadius,vOffset:D.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})},Ve=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{de(ie=>!ie),Ce&&(D.width="",D.minWidth="",D.maxWidth="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},minWidth:{value:null,dim:"px"},maxWidth:{value:null,dim:"px"}}}))})},Me=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{je(ie=>!ie),Fe&&(D.mobileWidth="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"}}}))})},He=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{Be(ie=>!ie),re?(D.backgroundColor="",D.backgroundImage="",D.backgroundPositionX="",D.backgroundPositionY="",D.backgroundRepeat="none",D.backgroundSize="",j(!0)):(D.backgroundColor="#E5E5E5",D.backgroundSize="",D.backgroundRepeat="none"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:D.backgroundColor,backgroundImage:[{type:"url",value:D.backgroundImage}],backgroundPositionX:D.backgroundPositionX,backgroundPositionY:D.backgroundPositionY,backgroundRepeat:D.backgroundRepeat,backgroundSize:D.backgroundSize}})})},le=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{ee(ie=>!ie),ce?D.mobileBackgroundColor="":D.mobileBackgroundColor="#E5E5E5",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:D.mobileBackgroundColor}}}),ce&&Et(s,e,l)})},Y=()=>{const D=s.getFieldsValue(!0);setTimeout(()=>{ue(ie=>!ie),me&&(D.exportAsPicture=!1,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))})};return(0,o.jsxs)(t.ui_kit$Form,{form:s,layout:"vertical",name:"selected_table_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,show:"all",width:{value:"",dim:""},maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",mobileAlign:"",border:"",boxShadow:"",borderPosition:z.BORDER_POSITIONS[xe]||"borderAll",mobileBorderPosition:z.MOBILE_BORDER_POSITIONS[ge]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileBackgroundColor:"",mobileBackgroundImage:""},onValuesChange:X,autoComplete:"off",className:"element-controls",children:[!K&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),w==="mobile"&&v.styles?(0,o.jsxs)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:[(0,o.jsx)(Qr,{form:s,elementSettings:e,mobileBoxShadow:h,mobileBordersShow:L,mobileBorderRadiusShow:te,mobileBoxShadowShow:ae,mobileSizeShow:Fe,mobileBackgroundShow:ce,oneMobileBorderRadiusValue:_,setOneMobileBorderRadiusValue:E,toggleShowMobileBorderHandler:we,toggleShowMobileBorderRadiusHandler:Te,toggleShowMobileBoxShadowHandler:ve,toggleShowMobileSizeHandler:Me,toggleShowMobileBackgroundHandler:le})," "]}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(Hr,{form:s,elementSettings:e,boxShadow:f,bordersShow:U,borderRadiusShow:G,boxShadowShow:he,backgroundShow:re,backgroundImageEmpty:P,backgroundRepeatOptions:Z,backgroundSizeOptions:Q,sizeShow:Ce,modificationShow:me,oneBorderRadiusValue:k,setOneBorderRadiusValue:b,toggleShowBorderHandler:ne,toggleShowBorderRadiusHandler:V,toggleShowBoxShadowHandler:Ie,toggleShowSizeHandler:Ve,toggleShowBackgroundHandler:He,toggleShowModificationHandler:Y})})]})};Zr.propTypes={elementSettings:g.default.object.isRequired};var el=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),[s]=t.ui_kit$Form.useForm(),a=r.useAppConfig(),d=r.useSelector(r.selectIsCodeMode),c=r.useSelector(r.selectCodeModeDirection),[p,f]=(0,n.useState)({}),[x,k]=(0,n.useState)("https://"),b=({target:_})=>{const{selectionStart:E,selectionEnd:w}=_;_&&f({target:_,selection:{start:E,end:w}})};(0,n.useEffect)(()=>{if(e){let _="",E="",w=e.href==null?"https://":e.href;if(w&&w.substring(0,7)==="mailto:"){const v=new URL(e.href);_=v.searchParams.get("subject")||"",E=v.searchParams.get("body")||"",w=e.href.split("?")[0],k("mailto:")}else e.href&&(e.href.substring(0,8)==="https://"||e.href.substring(0,7)==="http://"?k("https://"):e.href.substring(0,4)==="tel:"?k("tel:"):e.href.substring(0,4)==="sms:"?k("sms:"):e.href.substring(0,6)==="ftp://"?k("ftp://"):k(""));s.setFieldsValue({...e,href:w,subject:_,body:E})}},[s,e]);const h=_=>{const E=Object.keys(_)[0];let w=_;if(E==="href"){const v=ot(_[E]);if(v!==_[E]&&s.setFieldValue("href",v),v.substring(0,7)==="mailto:"){const P=s.getFieldValue("subject"),j=s.getFieldValue("body"),C=[];P&&C.push(`subject=${encodeURIComponent(P)}`),j&&C.push(`body=${encodeURIComponent(j)}`),w={href:C.length>0?`${v}?${C.join("&")}`:v}}else w={href:v}}if(E==="subject"||E==="body"){const v=s.getFieldValue("href")||"";if(v.substring(0,7)==="mailto:"){const P=v.split("?")[0],j=E==="subject"?_[E]:s.getFieldValue("subject"),C=E==="body"?_[E]:s.getFieldValue("body"),I=[];j&&I.push(`subject=${encodeURIComponent(j)}`),C&&I.push(`body=${encodeURIComponent(C)}`),w={href:I.length>0?`${P}?${I.join("&")}`:P}}else return}l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:w})},T=_=>{l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_TEXT,action:_})};return(0,o.jsx)(t.ui_kit$Form,{form:s,layout:"vertical",name:"selected_link_form",initialValues:{href:"https://",target:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textReplacer:"",subject:"",body:""},onValuesChange:h,autoComplete:"off",className:"element-controls",children:!d||c==="bottom"?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Hyperlink URL"),placement:"left",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"href",style:{marginBottom:24,paddingRight:10},children:(0,o.jsx)(t.ui_kit$Input,{allowClear:!0,placeholder:i("Hyperlink URL"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined}),onSelect:b})})}),a.formLinkFieldInsertImageEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:i("Actions with the chosen text"),dividerTop:!0,children:(0,o.jsx)(t.ui_kit$Form.Item,{children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"PicLeftOutlined",component:t.icons$PicLeftOutlined}),onClick:()=>T("add_img"),children:i("Add inline image")})})}),(0,o.jsx)(gt,{form:s,elementSettings:e,showAddParagraph:!1,linkTarget:p,linkProtocol:x,setLinkProtocol:k})]}):(0,o.jsx)(Ri,{form:s,elementSettings:e,showAddParagraph:!1})})};el.propTypes={elementSettings:g.default.object.isRequired};var ol=()=>{const{__:e}=r.useI18n();return(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsx)(t.ui_kit$Col,{span:14,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"height",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:e("Indent height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnHeightOutlined",component:t.icons$ColumnHeightOutlined}),addonAfter:"px"})})})})};ol.propTypes={};var tl=({form:e,elementSettings:i})=>(0,o.jsx)(t.ui_kit$Row,{gutter:10,style:{marginBottom:20},children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(tt,{form:e,name:"mobileHeight",elementSettings:i})})});tl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired};var il=({elementSettings:e})=>{const{__:i}=r.useI18n(),[l]=t.ui_kit$Form.useForm(),s=r.useDispatch(),a=r.useSendPostMessage(),d=r.useSelector(r.selectEmailViewType),c=r.useSelector(r.selectMobileViewActive),p=r.useSelector(r.selectIsCodeMode),f=r.useSelector(r.selectCodeModeDirection),x=p&&f!=="bottom",k=r.useElementEntityKind(),{remember:b,fillFields:h}=st(e);(0,n.useEffect)(()=>{e&&h(l,{...e,height:e.height?.value,heightDim:e.height?.dim,mobileHeight:po(e.mobileHeight?.value||e.height?.value),mobileHeightDim:e.mobileHeight?.dim||e.height?.dim})},[l,e,h]);const T=(0,n.useCallback)(E=>{b(E),s(k==="email"?r.setElementSettings$1(E):r.setElementSettings(E))},[s,k,b]),_=E=>{const w=l.getFieldsValue(!0),v=Object.keys(E)[0];let P;switch(v){case"height":P={[v]:{value:E[v],dim:w.heightDim}};break;case"heightDim":P={height:{value:w.height,dim:E[v]}};break;case"mobileHeight":P={[v]:{classNamePrefix:"em-mob-height-",value:E[v],dim:w.mobileHeightDim}};break;case"mobileHeightDim":P={mobileHeight:{classNamePrefix:"em-mob-height-",value:w.mobileHeight,dim:E[v]}};break;default:P=E}a({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:P}),T({...e,...P,activateSection:null,changeKey:v})};return(0,o.jsxs)(t.ui_kit$Form,{form:l,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:_,autoComplete:"off",children:[!x&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),d==="mobile"&&c.styles?(0,o.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:d==="mobile"&&c.styles?"block":"none",marginBottom:10},children:(0,o.jsx)(tl,{form:l,elementSettings:e})}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",style:{display:d==="mobile"&&c.styles?"none":"block"},children:(0,o.jsx)(ol,{})})]})};il.propTypes={elementSettings:g.default.object.isRequired};var Ht=({form:e,elementSettings:i,typeOfForm:l="desktop"})=>{const s=r.useSendPostMessage(),a=l==="mobile",d=a?"mobileDirection":"direction",c=f=>{e.setFieldsValue({[d]:f}),s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:{[d]:f}})},p=a?i.mobileDirection?.value??"":i.direction??"";return(0,o.jsx)(t.ui_kit$Form.Item,{name:d,className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$FormDirectionControl,{value:p,onChange:c})})},Ut=e=>e.closest(".email-pane__collapse-wrapper")||e.parentNode,vi=({form:e,backgroundImageEmpty:i,appConfig:l,token:s,elementSettings:a,backgroundRepeatOptions:d,handleChangeValues:c})=>{const{__:p}=r.useI18n(),[f,x]=(0,n.useState)(""),[k,b]=(0,n.useState)("px"),[h,T]=(0,n.useState)(""),[_,E]=(0,n.useState)("px"),w=[{label:p("Not defined"),value:""},{label:p("Contain"),value:"contain"},{label:p("Cover"),value:"cover"}],v=C=>{if(!C||typeof C!="string")return{value:"",unit:"px"};C=C.trim();const I=C.match(/^(\d*\.?\d+)(%|px)$/);return I?{value:I[1],unit:I[2]}:{value:C,unit:"px"}};(0,n.useEffect)(()=>{const C=e.getFieldValue("backgroundPositionX"),I=e.getFieldValue("backgroundPositionY"),K=v(C),U=v(I);x(String(K.value)),b(K.unit),T(String(U.value)),E(U.unit)},[e]);const P=(C,I)=>{x(String(C)),b(I),c&&c({backgroundPositionX:{position:C,unit:I}})},j=(C,I)=>{T(String(C)),E(I),c&&c({backgroundPositionY:{position:C,unit:I}})};return(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:8},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:p("Background color"),placement:"bottom",getPopupContainer:Ut,children:(0,o.jsx)("div",{children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"backgroundColor",style:{marginBottom:s.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:p("Background color"),usedColors:a.usedColors,placement:"bottomLeft"})})})})}),l.formCellFieldBackgroundImageEnabled&&(0,o.jsxs)(t.ui_kit$Col,{span:i?12:24,children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:p("Background image"),placement:"bottom",getPopupContainer:Ut,children:(0,o.jsx)("div",{children:(0,o.jsx)(No,{form:e,label:p("Background image"),name:"backgroundImage",tooltipTitle:p("Background image"),placeholder:p("Background image link/route")})})}),!i&&(0,o.jsxs)(t.ui_kit$Form.Item,{style:{marginBottom:"0"},children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:s.formItemMarginBottomXS},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$InputSelect,{options:Vt.horizontal,position:f,setPosition:C=>P(C,k),unit:k,setUnit:C=>P(f,C),placeholder:p("Horizontal position"),prefix:(0,o.jsx)(r.EmIcons,{icon:"BgPositionHorizontal",component:t.icons$BgPositionHorizontal}),dropdownStyle:{bottom:"auto"},tooltipTitle:p("Horizontal position"),getTooltipPopupContainer:Ut})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$InputSelect,{options:Vt.vertical,position:h,setPosition:C=>j(C,_),unit:_,setUnit:C=>j(h,C),placeholder:p("Vertical position"),prefix:(0,o.jsx)(r.EmIcons,{icon:"BgPositionVertical",component:t.icons$BgPositionVertical}),dropdownStyle:{bottom:"auto"},tooltipTitle:p("Vertical position"),getTooltipPopupContainer:Ut})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:p("Background image repeat"),placement:"top",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"backgroundRepeat",style:{marginBottom:s.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Select,{placeholder:p("Please choose"),options:d,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:p("Background image size"),placement:"top",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"backgroundSize",style:{marginBottom:s.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Select,{placeholder:p("Please choose"),options:w,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})})})})]})]})]})]})},Pn=({form:e,elementSettings:i,__:l,appConfig:s})=>{const a=z.useGoogleFontsLoader(),[d,c]=(0,n.useState)(null);return(0,n.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&c(!0)},[]),(0,o.jsxs)("div",{style:{marginBottom:"-15px"},children:[s.formTextFieldTypografEnabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Text font"),placement:"bottom",zIndex:1,getPopupContainer:p=>p.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontFamily",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{textEditor:!0,loadGoogleFonts:a,getPopupContainer:p=>p.closest(".email-pane__collapse-wrapper")})})}),!i.showOnMobile&&(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Font size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontSize",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:8,max:90,placeholder:l("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Line height"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"lineHeight",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:10,max:110,placeholder:l("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})})]})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textStrong",tooltipTitle:l(d?"Strong ( ⌘B )":"Strong ( Ctrl+B )"),icon:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textItalic",tooltipTitle:l(d?"Italic ( ⌘I )":"Italic ( Ctrl+I )"),icon:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textStrikethrough",tooltipTitle:l(d?"Strikethrough ( ⌘+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,o.jsx)(r.EmIcons,{icon:"StrikethroughOutlined",component:t.icons$StrikethroughOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:i,name:"textUnderline",tooltipTitle:l(d?"Underline ( ⌘U )":"Underline ( Ctrl+U )"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined,className:"selected-text-common-form__icon-radius"})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Text color"),placement:"bottom",zIndex:2,getPopupContainer:p=>p.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textColor",rules:[{message:l("Please set the font color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:l("Color"),usedColors:i.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Text background"),placement:"bottom",zIndex:2,getPopupContainer:p=>p.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textBackgroundColor",rules:[{message:l("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:l("Background color"),usedColors:i.usedColors})})})})]})]})},rl=({form:e,elementSettings:i,boxShadow:l,bordersShow:s,borderRadiusShow:a,boxShadowShow:d,backgroundShow:c,backgroundImageEmpty:p,backgroundRepeatOptions:f,sizeShow:x,maxWidthValue:k,modificationShow:b,paddingsExt:h,oneBorderRadiusValue:T,setOneBorderRadiusValue:_,elementListShow:E,togglePaddingHandler:w,toggleShowBorderHandler:v,toggleShowBorderRadiusHandler:P,toggleShowBoxShadowHandler:j,toggleShowSizeHandler:C,toggleShowBackgroundHandler:I,toggleShowModificationHandler:K,handleChangeValues:U})=>{const{__:O}=r.useI18n(),{token:L}=(0,t.ui_kit$useToken)(),R=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(it,{form:e,elementSettings:i})}),R.formCellFieldVerticalAlignEnabled&&i.type!=="group"&&(i.type!=="structure"||i.type==="structure"&&i.floatBlocks.items.length===1)&&(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(Mo,{form:e,elementSettings:i})})]}),R.formCellFieldPaddingsEnabled&&(0,o.jsxs)(o.Fragment,{children:[E&&(0,o.jsx)("div",{style:{marginTop:"15px"},children:(0,o.jsx)(Pn,{form:e,elementSettings:i,appConfig:R,__:O})}),(0,o.jsx)(t.ui_kit$FormSection,{title:O("Padding"),dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormPaddingInputs,{extended:h,onToggleExtended:w,showHorizontal:i.type!=="group"&&i.type!=="column",rowStyle:{paddingBottom:4},labels:{horizontal:O("Horizontal padding"),vertical:O("Vertical padding"),left:O("Left padding"),right:O("Right padding"),top:O("Top padding"),bottom:O("Bottom padding"),individual:O("Individual padding")}})})]}),i.type!=="group"&&R.formCellFieldSizeEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:O("Size"),collapsible:!0,open:x,onToggle:C,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormSizeInputs,{showWidth:i.type!=="structure"&&i.type!=="column",maxWidth:k,dimensionSelect:$o,rowStyle:{paddingBottom:4},labels:{width:O("Width"),height:O("Height"),minWidth:O("Minimum width"),maxWidth:O("Maximum width")}})}),(0,o.jsxs)(t.ui_kit$FormSection,{title:O("Background"),collapsible:!0,open:c,onToggle:I,dividerTop:!0,children:[(0,o.jsx)(vi,{form:e,backgroundImageEmpty:p,appConfig:R,token:L,elementSettings:i,backgroundRepeatOptions:f,handleChangeValues:U}),(0,o.jsx)(rt,{form:e,showBackground:!0})]}),R.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:O("Borders"),collapsible:!0,open:s,onToggle:v,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,elementSettings:i})}),R.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:O("Border radius"),collapsible:!0,open:a,onToggle:P,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:T,setOneBorderRadiusValue:_,elementSettings:i})}),R.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:O("Box shadow"),collapsible:!0,open:d,onToggle:j,dividerTop:!0,children:(0,o.jsx)(jo,{})}),R.formFieldExportAsPictureEnabled&&i.type!=="group"&&(0,o.jsxs)(t.ui_kit$FormSection,{title:O("Settings"),collapsible:!0,open:b,onToggle:K,dividerTop:!0,children:[i.type==="structure"&&(0,o.jsx)(t.ui_kit$Tooltip,{title:O("The block will change its colors to contrasting colors. You can change them in the Content Styles section."),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"isContrastBlock",valuePropName:"checked",style:{marginBottom:0},children:(0,o.jsx)(t.ui_kit$Switch,{id:"contrast-colors",label:O("Contrast block"),size:"small",labelStyle:{position:"relative",top:2}})})},"isContrastBlock"),(0,o.jsx)(yi,{form:e,elementSettings:i})]}),R.formFieldVisibilityEnabled&&i.type!=="column"&&(0,o.jsx)(t.ui_kit$FormSection,{title:O(i.type!=="group"?"Display control & Direction":"Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e,directionControl:i.type!=="group"?(0,o.jsx)(Ht,{elementSettings:i,form:e}):void 0})}),R.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:O("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};rl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,bordersShow:g.default.bool,borderRadiusShow:g.default.bool,boxShadowShow:g.default.bool,backgroundShow:g.default.bool,backgroundImageEmpty:g.default.bool,backgroundRepeatOptions:g.default.array,sizeShow:g.default.bool,maxWidthValue:g.default.oneOfType([g.default.string,g.default.number]),modificationShow:g.default.bool,paddingsExt:g.default.bool,oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,elementListShow:g.default.bool,togglePaddingHandler:g.default.func,toggleShowBorderHandler:g.default.func,toggleShowBorderRadiusHandler:g.default.func,toggleShowBoxShadowHandler:g.default.func,toggleShowSizeHandler:g.default.func,toggleShowBackgroundHandler:g.default.func,toggleShowModificationHandler:g.default.func,handleChangeValues:g.default.func};var Wt=({form:e,elementSettings:i,mobilePaddingsExt:l,setMobilePaddingsExt:s,rowStyle:a})=>{const{__:d}=r.useI18n(),c=r.useSendPostMessage(),p=()=>{s(x=>!x);const f=e.getFieldsValue(!0);l||(f.mobilePaddingLeftRight=f.mobilePaddingLeft,f.mobilePaddingTopBottom=f.mobilePaddingTop,f.mobilePaddingRight=f.mobilePaddingLeft,f.mobilePaddingBottom=f.mobilePaddingTop,c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:i.type,settings:{mobilePadding:{top:f.mobilePaddingTop!==""?f.mobilePaddingTop:null,bottom:f.mobilePaddingTopBottom!==""?f.mobilePaddingTopBottom:null,left:f.mobilePaddingLeft!==""?f.mobilePaddingLeft:null,right:f.mobilePaddingRight!==""?f.mobilePaddingRight:null,classNamePrefix:"em-mob-padding_"}}}))};return(0,o.jsx)(t.ui_kit$FormPaddingInputs,{typeOfForm:"mobile",extended:l,onToggleExtended:p,showHorizontal:!0,gutter:10,rowStyle:a,labels:{horizontal:d("Horizontal padding"),vertical:d("Vertical padding"),left:d("Left padding"),right:d("Right padding"),top:d("Top padding"),bottom:d("Bottom padding"),individual:d("Individual padding")}})};Wt.propTypes={form:g.default.shape({getFieldsValue:g.default.func.isRequired}).isRequired,elementSettings:g.default.object.isRequired,mobilePaddingsExt:g.default.bool.isRequired,setMobilePaddingsExt:g.default.func.isRequired,rowStyle:g.default.object};var ll=({form:e,elementSettings:i,boxShadow:l,mobileBordersShow:s,mobileBorderRadiusShow:a,mobileBoxShadowShow:d,mobileSizeShow:c,mobileBackgroundShow:p,mobilePaddingShow:f,mobilePaddingsExt:x,setMobilePaddingsExt:k,oneMobileBorderRadiusValue:b,setOneMobileBorderRadiusValue:h,toggleShowMobileBorderHandler:T,toggleShowMobileBorderRadiusHandler:_,toggleShowMobileBoxShadowHandler:E,toggleShowMobileSizeHandler:w,toggleShowMobileBackgroundHandler:v,toggleShowMobilePaddingHandler:P})=>{const{__:j}=r.useI18n(),C=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:20,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Uo,{form:e,elementSettings:i,imgParent:!0,typeOfForm:"mobile"})}),C.formCellFieldVerticalAlignEnabled&&i.type!=="group"&&(i.type!=="structure"||i.type==="structure"&&i.floatBlocks.items.length===1)&&(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(Mo,{form:e,elementSettings:i,typeOfForm:"mobile"})})]}),C.formCellFieldPaddingsEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Padding"),collapsible:!0,open:f,onToggle:P,dividerTop:!0,children:(0,o.jsx)(Wt,{form:e,elementSettings:i,mobilePaddingsExt:x,setMobilePaddingsExt:k,rowStyle:{paddingBottom:4}})}),i.type!=="group"&&C.formCellFieldSizeEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Size"),collapsible:!0,open:c,onToggle:w,dividerTop:!0,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:9},children:[i.type!=="structure"&&(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)("div",{style:{marginBottom:15},children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:i})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)("div",{style:{marginBottom:15},children:(0,o.jsx)(tt,{form:e,name:"mobileHeight",elementSettings:i})})})]})}),(0,o.jsx)(t.ui_kit$FormSection,{title:j("Background"),collapsible:!0,open:p,onToggle:v,dividerTop:!0,children:(0,o.jsx)(Bt,{elementSettings:Go(i),imageEnabled:C.formCellFieldBackgroundImageEnabled,desktopBackground:xt(i)})}),C.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Borders"),collapsible:!0,open:s,onToggle:T,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,typeOfForm:"mobile"})}),C.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Border radius"),collapsible:!0,open:a,onToggle:_,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:b,setOneBorderRadiusValue:h,elementSettings:i,typeOfForm:"mobile"})}),C.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Box shadow"),collapsible:!0,open:d,onToggle:E,dividerTop:!0,children:(0,o.jsx)(jo,{typeOfForm:"mobile"})}),C.formFieldVisibilityEnabled&&i.type!=="column"&&(0,o.jsx)(t.ui_kit$FormSection,{title:j(i.type!=="group"?"Display control & Direction":"Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e,directionControl:i.type!=="group"?(0,o.jsx)(Ht,{elementSettings:i,form:e,typeOfForm:"mobile"}):void 0})}),C.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};ll.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,mobileBordersShow:g.default.bool,mobileBorderRadiusShow:g.default.bool,mobileBoxShadowShow:g.default.bool,mobileSizeShow:g.default.bool,mobileBackgroundShow:g.default.bool,mobilePaddingShow:g.default.bool,mobilePaddingsExt:g.default.bool,setMobilePaddingsExt:g.default.func,oneMobileBorderRadiusValue:g.default.bool,setOneMobileBorderRadiusValue:g.default.func,toggleShowMobileBorderHandler:g.default.func,toggleShowMobileBorderRadiusHandler:g.default.func,toggleShowMobileBoxShadowHandler:g.default.func,toggleShowMobileSizeHandler:g.default.func,toggleShowMobileBackgroundHandler:g.default.func,toggleShowMobilePaddingHandler:g.default.func};var sl=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),s=r.useDispatch(),[a]=t.ui_kit$Form.useForm(),d=Fo(),c=Fo(),[p,f]=(0,n.useState)(""),[x,k]=(0,n.useState)({}),[b,h]=(0,n.useState)(!0),[T,_]=(0,n.useState)(!0),E=r.useSelector(r.selectEmailViewType),w=r.useSelector(r.selectMobileViewActive);r.useAppConfig();const[v,P]=(0,n.useState)(e.backgroundImage[0].value===""),j=r.useSelector(r.selectIsCodeMode),C=r.useSelector(r.selectCodeModeDirection),I=j&&C!=="bottom",[K,U]=(0,n.useState)(!1),[O,L]=(0,n.useState)(!1),[R,G]=(0,n.useState)(!1),[J,te]=(0,n.useState)(!1),[oe,he]=(0,n.useState)(!1),[be,ae]=(0,n.useState)(!1),[ke,Ce]=(0,n.useState)(!1),[de,Fe]=(0,n.useState)(!1),[je,re]=(0,n.useState)(!1),[Be,ce]=(0,n.useState)(!1),[ee,me]=(0,n.useState)(!1),[ue,Z]=(0,n.useState)(!1),[Q,W]=(0,n.useState)(!1),[q,se]=(0,n.useState)(!1),[xe,ge]=(0,n.useState)(!1),Ne=r.useElementEntityKind(),ye=[{label:i("Not defined"),value:"none"},{label:i("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:i("Repeat background (repeat)"),value:"repeat"},{label:i("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:i("Repeat background vertically (repeat-y)"),value:"repeat-y"}],$e=e.border,X=e.mobileBorder,ne=Object.keys($e).find(y=>$e[y]?.width||$e[y]?.style||$e[y]?.color),we=Object.keys(X).find(y=>X[y]?.width||X[y]?.style||X[y]?.color),V=y=>y&&(y?.width||y?.style||y?.color)?y:"",{remember:Te,fillFields:Ie}=st(e);(0,n.useEffect)(()=>{if(e){const y=e.boxShadow;k(y),Ie(a,{...e,width:e.width?.value,widthDim:e.width?.dim,height:e.height?.value,heightDim:e.height?.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",isContrastBlock:e.isContrastBlock,borderAll:u(e.border.all),borderTop:u(e.border.top),borderBottom:u(e.border.bottom),borderRight:u(e.border.right),borderLeft:u(e.border.left),mobileBorderAll:V(e.mobileBorder.all)||!(V(e.mobileBorder.top)||V(e.mobileBorder.bottom)||V(e.mobileBorder.right)||V(e.mobileBorder.left))&&V(e.border.all),mobileBorderTop:V(e.mobileBorder.top)||!V(e.mobileBorder.all)&&V(e.border.top),mobileBorderBottom:V(e.mobileBorder.bottom)||!V(e.mobileBorder.all)&&V(e.border.bottom),mobileBorderRight:V(e.mobileBorder.right)||!V(e.mobileBorder.all)&&V(e.border.right),mobileBorderLeft:V(e.mobileBorder.left)||!V(e.mobileBorder.all)&&V(e.border.left),paddingTop:u(e.padding?.all)||u(e.padding?.top),paddingLeft:u(e.padding?.all)||u(e.padding?.left),paddingRight:u(e.padding?.all)||u(e.padding?.right),paddingBottom:u(e.padding?.all)||u(e.padding?.bottom),paddingLeftRight:u(e.padding?.left)||u(e.padding?.right),paddingTopBottom:u(e.padding?.top)||u(e.padding?.bottom),borderRadiusAll:u(e.borderRadius.all),borderRadiusTopLeft:u(e.borderRadius.topLeft),borderRadiusBottomLeft:u(e.borderRadius.bottomLeft),borderRadiusTopRight:u(e.borderRadius.topRight),borderRadiusBottomRight:u(e.borderRadius.bottomRight),boxShadowInset:u(e.boxShadow?.inset)||!1,boxShadowHOffset:u(e.boxShadow?.hOffset),boxShadowVOffset:u(e.boxShadow?.vOffset),boxShadowBlurRadius:u(e.boxShadow?.blurRadius),boxShadowSpreadRadius:u(e.boxShadow?.spreadRadius),boxShadowColor:u(e.boxShadow?.color),mobileWidth:po(e.mobileWidth?.value)||po(e.width?.value),mobileWidthDim:po(e.mobileWidth?.value)?e.mobileWidth?.dim:e.width?.dim,mobileHeight:po(e.mobileHeight?.value)||po(e.height?.value),mobileHeightDim:po(e.mobileHeight?.value)?e.mobileHeight?.dim:e.height?.dim,mobileBorderRadiusAll:u(e.mobileBorderRadius?.all)||u(e.borderRadius?.all),mobileBorderRadiusTopLeft:u(e.mobileBorderRadius?.topLeft)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.topLeft)||u(e.borderRadius?.all),mobileBorderRadiusBottomLeft:u(e.mobileBorderRadius?.bottomLeft)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.bottomLeft)||u(e.borderRadius?.all),mobileBorderRadiusTopRight:u(e.mobileBorderRadius?.topRight)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.topRight)||u(e.borderRadius?.all),mobileBorderRadiusBottomRight:u(e.mobileBorderRadius?.bottomRight)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.bottomRight)||u(e.borderRadius?.all),mobileBoxShadowInset:e.mobileBoxShadow?.inset!=null?e.mobileBoxShadow.inset:e.boxShadow?.inset||!1,mobileBoxShadowHOffset:u(e.mobileBoxShadow?.hOffset)||u(e.boxShadow?.hOffset),mobileBoxShadowVOffset:u(e.mobileBoxShadow?.vOffset)||u(e.boxShadow?.vOffset),mobileBoxShadowBlurRadius:u(e.mobileBoxShadow?.blurRadius)||u(e.boxShadow?.blurRadius),mobileBoxShadowSpreadRadius:u(e.mobileBoxShadow?.spreadRadius)||u(e.boxShadow?.spreadRadius),mobileBoxShadowColor:u(e.mobileBoxShadow?.color)||u(e.boxShadow?.color),mobileAlign:u(e.mobileAlign?.value)||e.align,mobileVerticalAlign:u(e.mobileVerticalAlign?.value||e.valign),mobileDirection:u(e.mobileDirection?.value),mobileBackgroundColor:u(e.mobileBackgroundColor?.value||e.backgroundColor||""),...nt(e),mobilePaddingTop:u(e.mobilePadding.all)||u(e.mobilePadding.top)||u(e.padding?.all)||u(e.padding?.top),mobilePaddingLeft:u(e.mobilePadding.all)||u(e.mobilePadding.left)||u(e.padding?.all)||u(e.padding?.left),mobilePaddingRight:u(e.mobilePadding.all)||u(e.mobilePadding.right)||u(e.padding?.all)||u(e.padding?.right),mobilePaddingBottom:u(e.mobilePadding.all)||u(e.mobilePadding.bottom)||u(e.padding?.all)||u(e.padding?.bottom),mobilePaddingTopBottom:u(e.mobilePadding.top)||u(e.mobilePadding.bottom)||u(e.padding?.top)||u(e.padding?.bottom),mobilePaddingLeftRight:u(e.mobilePadding.left)||u(e.mobilePadding.right)||u(e.padding?.left)||u(e.padding?.right),exportAsPicture:e?.exportAsPicture}),!u(e.borderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?h(!1):h(!0),!u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))||u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))||!u(e.borderRadius.all)&&!u(e.mobileBorderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?_(!1):_(!0),P(e.backgroundImage[0].value===""),!u(e.padding.all)&&(u(e.padding.top)||u(e.padding.right)||u(e.padding.bottom)||u(e.padding.left))&&(e.padding.top!==e.padding.bottom||e.padding.right!==e.padding.left)?U(!1):U(!0),!u(e.mobilePadding.all)&&(u(e.mobilePadding.top)||u(e.mobilePadding.right)||u(e.mobilePadding.bottom)||u(e.mobilePadding.left))&&(e.mobilePadding.top!==e.mobilePadding.bottom||e.mobilePadding.right!==e.mobilePadding.left)||!u(e.padding?.all)&&(u(e.padding?.top)||u(e.padding?.right)||u(e.padding?.bottom)||u(e.padding?.left))&&(e.padding?.top!==e.padding?.bottom||e.padding?.right!==e.padding?.left)?L(!1):L(!0);const M=d.isStaleBorderSnapshot(e,!!ne),fe=c.isStaleBorderSnapshot(e,!!we);M&&a.setFieldsValue({border:r.RESET_BORDER_PARAMS,borderAll:null,borderTop:null,borderBottom:null,borderRight:null,borderLeft:null}),(fe||M&&!we)&&a.setFieldsValue({mobileBorder:r.RESET_BORDER_PARAMS,mobileBorderAll:null,mobileBorderTop:null,mobileBorderBottom:null,mobileBorderRight:null,mobileBorderLeft:null}),G(Le=>ne&&!M?!0:Le),te(Le=>ne&&!M||we&&!fe?!0:Le),he(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ae(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),Ce(!!e.boxShadow),Fe(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),re(!!e.width.value&&e.type!=="column"||!!e.height.value),ce(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value&&e.type!=="column"||!!e.height.value),me(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||e.backgroundRepeat!=="repeat"||!e.backgroundRepeat,!!e.backgroundSize),Z(!!e.mobileBackgroundColor.value||!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||e.backgroundRepeat!=="repeat"||!e.backgroundRepeat,!!e.backgroundSize),kt(e)&&Z(!0),W(!!e.exportAsPicture||!!e.isContrastBlock),se(!!e.mobilePadding.all||e.mobilePadding.all===0||!!e.mobilePadding.top||e.mobilePadding.top===0||!!e.mobilePadding.bottom||e.mobilePadding.bottom===0||!!e.mobilePadding.left||e.mobilePadding.left===0||!!e.mobilePadding.right||e.mobilePadding.right===0||!!e.padding.all||e.padding.all===0||!!e.padding.top||e.padding.top===0||!!e.padding.bottom||e.padding.bottom===0||!!e.padding.left||e.padding.left===0||!!e.padding.right||e.padding.right===0),e.elementName==="List"?ge(!0):ge(!1)}},[a,e,ne,we,d,c,Ie]);const ve=(0,n.useCallback)(y=>{Te(y),s(Ne==="email"?r.setElementSettings$1(y):r.setElementSettings(y))},[s,Ne,Te]),Ve=y=>{const M=a.getFieldsValue(!0),fe=Object.keys(y)[0];let Le;switch(f(a.getFieldsValue(!0).widthDim==="%"?100:""),fe){case"exportAsPicture":Le={exportAsPicture:M.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":Le={boxShadow:{hOffset:M.boxShadowHOffset,vOffset:M.boxShadowVOffset,blurRadius:M.boxShadowBlurRadius,spreadRadius:M.boxShadowSpreadRadius,color:M.boxShadowColor,inset:M.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":M.borderPosition==="borderAll"?(Le={border:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...M.borderAll}}},a.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER})):M.borderAll?.width||M.borderAll?.style||M.borderAll?.color?(Le={border:{all:null,left:M.borderAll,right:M.borderAll,top:M.borderAll,bottom:M.borderAll,[z.REVERSE_BORDER_POSITIONS[fe]]:{...M[fe],...y[fe]}}},a.setFieldsValue({borderAll:null,borderLeft:M.borderAll,borderRight:M.borderAll,borderTop:M.borderAll,borderBottom:M.borderAll,[fe]:{...M[fe],...y[fe]}})):(Le={border:{all:null,left:M.borderLeft,right:M.borderRight,top:M.borderTop,bottom:M.borderBottom,[z.REVERSE_BORDER_POSITIONS[fe]]:{...M[fe],...y[fe]}}},a.setFieldsValue({border:Le.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":if(M.mobileBorderPosition==="mobileBorderAll")Le={mobileBorder:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...M.mobileBorderAll,classNamePrefix:"em-mob-border_"+z.MOBILE_REVERSE_BORDER_POSITIONS[fe]+"-"}}},a.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER});else{const eo=z.MOBILE_REVERSE_BORDER_POSITIONS[fe],Xe={...M[fe],...y[fe]},lo=!Xe?.width&&!Xe?.style&&!Xe?.color;if(M.mobileBorder?.all?.width||M.mobileBorder?.all?.style||M.mobileBorder?.all?.color){const Qe=M.mobileBorderAll;Le={mobileBorder:{all:null,left:Qe,right:Qe,top:Qe,bottom:Qe,[eo]:lo?null:{...Xe,classNamePrefix:"em-mob-border_"+eo+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:Qe,mobileBorderRight:Qe,mobileBorderTop:Qe,mobileBorderBottom:Qe,[fe]:Xe})}else{const Qe=e.mobileBorder||{},uo=Eo=>{const B=Qe[Eo];return B&&(B?.width||B?.style||B?.color)?B:null};Le={mobileBorder:{all:null,left:eo==="left"?lo?null:{...Xe,classNamePrefix:"em-mob-border_left-"}:uo("left"),right:eo==="right"?lo?null:{...Xe,classNamePrefix:"em-mob-border_right-"}:uo("right"),top:eo==="top"?lo?null:{...Xe,classNamePrefix:"em-mob-border_top-"}:uo("top"),bottom:eo==="bottom"?lo?null:{...Xe,classNamePrefix:"em-mob-border_bottom-"}:uo("bottom")}},a.setFieldsValue({[fe]:Xe})}}break;case"width":Le={[fe]:{value:y[fe],dim:M.widthDim}};break;case"height":Le={[fe]:{value:y[fe],dim:M.heightDim}};break;case"widthDim":Le={width:{value:M.width,dim:y[fe]}};break;case"heightDim":Le={height:{value:M.height,dim:y[fe]}};break;case"backgroundImage":P(y[fe]===""),Le={[fe]:[{...e.backgroundImage[0],value:y[fe]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":Le={padding:{left:M.paddingLeft,right:M.paddingRight,top:M.paddingTop,bottom:M.paddingBottom,[z.PADDING_POSITION[fe]]:+y[fe]}};break;case"paddingTopBottom":Le={padding:{left:M.paddingLeft,right:M.paddingRight,top:+y[fe],bottom:+y[fe]}},M.paddingTop=M.paddingBottom=+y[fe];break;case"paddingLeftRight":Le={padding:{top:M.paddingTop,bottom:M.paddingBottom,left:+y[fe],right:+y[fe]}},M.paddingLeft=M.paddingRight=+y[fe];break;case"borderRadiusAll":Le={borderRadius:{[z.BORDER_RADIUS_POSITION[fe]]:+y[fe]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":Le={borderRadius:{topLeft:M.borderRadiusTopLeft,bottomLeft:M.borderRadiusBottomLeft,topRight:M.borderRadiusTopRight,bottomRight:M.borderRadiusBottomRight,[z.BORDER_RADIUS_POSITION[fe]]:+y[fe]}};break;case"mobileWidth":Le={[fe]:{classNamePrefix:"em-mob-width-",value:y[fe],dim:M.mobileWidthDim}};break;case"mobileWidthDim":Le={mobileWidth:{classNamePrefix:"em-mob-width-",value:M.mobileWidth||100,dim:y[fe]}};break;case"mobileHeight":Le={[fe]:{classNamePrefix:"em-mob-height-",value:y[fe],dim:M.mobileHeightDim}};break;case"mobileHeightDim":Le={mobileHeight:{classNamePrefix:"em-mob-height-",value:M.mobileHeight,dim:y[fe]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":Le={mobileBorderRadius:{[z.MOBILE_BORDER_RADIUS_POSITION[fe]]:y[fe],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[fe]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":Le={mobileBoxShadow:{hOffset:M.mobileBoxShadowHOffset,vOffset:M.mobileBoxShadowVOffset,blurRadius:M.mobileBoxShadowBlurRadius,spreadRadius:M.mobileBoxShadowSpreadRadius,color:M.mobileBoxShadowColor,inset:M.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":Le={[fe]:{classNamePrefix:"em-mob-text_align-",value:y[fe]}};break;case"mobileVerticalAlign":Le={[fe]:{classNamePrefix:"em-mob-vertical_align-",value:y[fe]}};break;case"mobileDirection":Le={[fe]:{classNamePrefix:"em-mob-direction-",value:y[fe]}};break;case"mobileBackgroundColor":case"mobileBackgroundImage":case"mobileBackgroundPositionX":case"mobileBackgroundPositionY":case"mobileBackgroundRepeat":case"mobileBackgroundSize":if(Le=_t(y),!Le)return;break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":Le={mobilePadding:{all:null,top:M.mobilePaddingTop!==""?M.mobilePaddingTop:null,right:M.mobilePaddingRight!==""?M.mobilePaddingRight:null,bottom:M.mobilePaddingBottom!==""?M.mobilePaddingBottom:null,left:M.mobilePaddingLeft!==""?M.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":M.mobilePaddingTop=M.mobilePaddingBottom=y[fe],Le={mobilePadding:{all:null,top:M.mobilePaddingTop!==""?M.mobilePaddingTop:null,right:M.mobilePaddingRight!==""?M.mobilePaddingRight:null,bottom:M.mobilePaddingBottom!==""?M.mobilePaddingBottom:null,left:M.mobilePaddingLeft!==""?M.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":M.mobilePaddingLeft=M.mobilePaddingRight=y[fe],Le={mobilePadding:{all:null,top:M.mobilePaddingTop!==""?M.mobilePaddingTop:null,right:M.mobilePaddingRight!==""?M.mobilePaddingRight:null,bottom:M.mobilePaddingBottom!==""?M.mobilePaddingBottom:null,left:M.mobilePaddingLeft!==""?M.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"backgroundPositionX":case"backgroundPositionY":Le={[fe]:isNaN(parseFloat(y[fe].position))?y[fe].position:y[fe].position+y[fe].unit};break;default:Le=y}fe!=="borderPosition"&&fe!=="mobileBorderPosition"&&(l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:Le}),fe!=="mobileBorderRadiusAll"&&fe!=="mobileBorderRadiusTopLeft"&&fe!=="mobileBorderRadiusTopRight"&&fe!=="mobileBorderRadiusBottomLeft"&&fe!=="mobileBorderRadiusBottomRight"&&ve({...e,...Le,mobileBorderRadius:{...e.mobileBorderRadius,...Le?.mobileBorderRadius},activateSection:null,changeKey:fe}))},Me=()=>{U(M=>!M);const y=a.getFieldsValue(!0);K||(y.paddingLeftRight=y.paddingLeft,y.paddingTopBottom=y.paddingTop,y.paddingRight=y.paddingLeft,y.paddingBottom=y.paddingTop,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:y.paddingTopBottom,bottom:y.paddingTopBottom,left:y.paddingLeftRight,right:y.paddingLeftRight}}}))},He=()=>{const y=a.getFieldsValue(!0);d.markBorderToggled(!R),setTimeout(()=>{G(M=>!M),R?(y.borderAll=z.NULL_BORDER,y.borderTop=z.NULL_BORDER,y.borderBottom=z.NULL_BORDER,y.borderRight=z.NULL_BORDER,y.borderLeft=z.NULL_BORDER):y.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:y.borderAll.color,style:y.borderAll.style,width:y.borderAll.width}}}})})},le=()=>{const y=a.getFieldsValue(!0);c.markBorderToggled(!J),setTimeout(()=>{te(M=>!M),J?(y.mobileBorderAll=z.NULL_BORDER,y.mobileBorderTop=z.NULL_BORDER,y.mobileBorderBottom=z.NULL_BORDER,y.mobileBorderRight=z.NULL_BORDER,y.mobileBorderLeft=z.NULL_BORDER):y.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:y.mobileBorderAll.color,style:y.mobileBorderAll.style,width:y.mobileBorderAll.width}}}})})},Y=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{he(M=>!M),oe?(y.borderRadiusAll=0,h(!0)):y.borderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:y.borderRadiusAll}}})})},D=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{ae(M=>!M),be?(y.mobileBorderRadiusAll=null,_(!0)):y.mobileBorderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:y.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})},ie=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{Ce(M=>!M),ke?(y.boxShadowInset=!1,y.boxShadowHOffset=null,y.boxShadowVOffset=null,y.boxShadowBlurRadius=null,y.boxShadowSpreadRadius=null,y.boxShadowColor=""):(y.boxShadowInset=!1,y.boxShadowHOffset=5,y.boxShadowVOffset=5,y.boxShadowBlurRadius=10,y.boxShadowSpreadRadius=-5,y.boxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:y.boxShadowBlurRadius,color:y.boxShadowColor,hOffset:y.boxShadowHOffset,inset:y.boxShadowInset,spreadRadius:y.boxShadowSpreadRadius,vOffset:y.boxShadowVOffset}}})})},Ee=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{Fe(M=>!M),de?(y.mobileBoxShadowInset=!1,y.mobileBoxShadowHOffset=null,y.mobileBoxShadowVOffset=null,y.mobileBoxShadowBlurRadius=null,y.mobileBoxShadowSpreadRadius=null,y.mobileBoxShadowColor=""):(y.mobileBoxShadowInset=!1,y.mobileBoxShadowHOffset=5,y.mobileBoxShadowVOffset=5,y.mobileBoxShadowBlurRadius=10,y.mobileBoxShadowSpreadRadius=-5,y.mobileBoxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:y.mobileBoxShadowBlurRadius,color:y.mobileBoxShadowColor,hOffset:y.mobileBoxShadowHOffset,inset:y.mobileBoxShadowInset,spreadRadius:y.mobileBoxShadowSpreadRadius,vOffset:y.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})},Ae=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{re(M=>!M),je&&(y.width="",y.height="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},height:{value:null,dim:"px"}}}))})},We=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{ce(M=>!M),Be&&(y.mobileWidth="",y.mobileHeight="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))})},Ge=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{me(M=>!M),ee?(y.backgroundColor="",y.backgroundImage="",y.backgroundPositionX="",y.backgroundPositionY="",y.backgroundRepeat="none",y.backgroundSize="",P(!0)):(y.backgroundColor="#E5E5E5",y.backgroundSize="",y.backgroundRepeat="none"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:y.backgroundColor,backgroundImage:[{type:"url",value:y.backgroundImage}],backgroundPositionX:y.backgroundPositionX,backgroundPositionY:y.backgroundPositionY,backgroundRepeat:y.backgroundRepeat,backgroundSize:y.backgroundSize}})})},Ye=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{Z(M=>!M),ue?y.mobileBackgroundColor="":y.mobileBackgroundColor="#E5E5E5",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:y.mobileBackgroundColor}}}),ue&&Et(a,e,l)})},$=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{W(M=>!M),Q&&(y.exportAsPicture=!1,y.isContrastBlock=!1,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1,isContrastBlock:!1}}))})},N=()=>{const y=a.getFieldsValue(!0);setTimeout(()=>{se(M=>!M),q&&(y.mobilePaddingLeftRight="",y.mobilePaddingLeft="",y.mobilePaddingRight="",y.mobilePaddingTopBottom="",y.mobilePaddingTop="",y.mobilePaddingBottom="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))})};return(0,o.jsx)(t.ui_kit$Form,{form:a,layout:"vertical",name:"selected_td_form",initialValues:{horizontalPosition:"",horizontalUnit:"px",backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",show:"all",borderPosition:z.BORDER_POSITIONS[ne]||"borderAll",mobileBorderPosition:z.MOBILE_BORDER_POSITIONS[we]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",boxShadowInset:"",boxShadowHOffset:"",boxShadowVOffset:"",boxShadowBlurRadius:"",boxShadowSpreadRadius:"",boxShadowColor:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1},onValuesChange:Ve,autoComplete:"off",className:"element-controls",children:E==="mobile"&&w.styles?(0,o.jsxs)("div",{className:"selected_form-mobile-props-wrapper",style:{display:E==="mobile"&&w.styles?"flex":"none"},children:[(0,o.jsx)("div",{className:"selected_form-mobile-props-header",children:!I&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})})}),(0,o.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:(0,o.jsx)(ll,{form:a,elementSettings:e,boxShadow:x,mobileBordersShow:J,mobileBorderRadiusShow:be,mobileBoxShadowShow:de,mobileSizeShow:Be,mobileBackgroundShow:ue,mobilePaddingShow:q,mobilePaddingsExt:O,setMobilePaddingsExt:L,oneMobileBorderRadiusValue:T,setOneMobileBorderRadiusValue:_,toggleShowMobileBorderHandler:le,toggleShowMobileBorderRadiusHandler:D,toggleShowMobileBoxShadowHandler:Ee,toggleShowMobileSizeHandler:We,toggleShowMobileBackgroundHandler:Ye,toggleShowMobilePaddingHandler:N})})]}):(0,o.jsxs)(o.Fragment,{children:[!I&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(rl,{form:a,elementSettings:e,boxShadow:x,bordersShow:R,borderRadiusShow:oe,boxShadowShow:ke,backgroundShow:ee,backgroundImageEmpty:v,backgroundRepeatOptions:ye,sizeShow:je,maxWidthValue:p,modificationShow:Q,paddingsExt:K,oneBorderRadiusValue:b,setOneBorderRadiusValue:h,elementListShow:xe,togglePaddingHandler:Me,toggleShowBorderHandler:He,toggleShowBorderRadiusHandler:Y,toggleShowBoxShadowHandler:ie,toggleShowSizeHandler:Ae,toggleShowBackgroundHandler:Ge,toggleShowModificationHandler:$,handleChangeValues:Ve})})]})})};sl.propTypes={elementSettings:g.default.object.isRequired};var al=({form:e,elementSettings:i,boxShadow:l,bordersShow:s,borderRadiusShow:a,boxShadowShow:d,backgroundShow:c,backgroundImageEmpty:p,backgroundRepeatOptions:f,sizeShow:x,maxWidthValue:k,modificationShow:b,paddingShow:h,paddingsExt:T,oneBorderRadiusValue:_,setOneBorderRadiusValue:E,togglePaddingHandler:w,toggleShowPaddingHandler:v,toggleShowBorderHandler:P,toggleShowBorderRadiusHandler:j,toggleShowBoxShadowHandler:C,toggleShowSizeHandler:I,toggleShowBackgroundHandler:K,toggleShowModificationHandler:U,handleChangeValues:O})=>{const{__:L}=r.useI18n(),{token:R}=(0,t.ui_kit$useToken)(),G=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-desktop-props-title",title:L("Appearance on mobile devices"),type:"info"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:20,style:{marginBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(it,{form:e,elementSettings:i})}),(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(Mo,{form:e,elementSettings:i})})]}),G.formCellFieldPaddingsEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("Padding"),collapsible:!0,open:h,onToggle:v,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormPaddingInputs,{extended:T,onToggleExtended:w,labels:{horizontal:L("Horizontal padding"),vertical:L("Vertical padding"),left:L("Left padding"),right:L("Right padding"),top:L("Top padding"),bottom:L("Bottom padding"),individual:L("Individual padding")}})}),(0,o.jsx)(t.ui_kit$FormSection,{title:L("Size"),collapsible:!0,open:x,onToggle:I,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormSizeInputs,{maxWidth:k,dimensionSelect:$o,showMinMax:!0,minWidthDimensionSelect:$o,maxWidthDimensionSelect:$o,labels:{width:L("Width"),height:L("Height"),minWidth:L("Minimum width"),maxWidth:L("Maximum width")}})}),(0,o.jsxs)(t.ui_kit$FormSection,{title:L("Background"),collapsible:!0,open:c,onToggle:K,dividerTop:!0,children:[(0,o.jsx)(vi,{form:e,backgroundImageEmpty:p,appConfig:G,token:R,elementSettings:i,backgroundRepeatOptions:f,handleChangeValues:O}),(0,o.jsx)(rt,{form:e,showBackground:!0})]}),G.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("Borders"),collapsible:!0,open:s,onToggle:P,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,elementSettings:i})}),G.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("Border radius"),collapsible:!0,open:a,onToggle:j,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:_,setOneBorderRadiusValue:E,elementSettings:i})}),G.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("Box shadow"),collapsible:!0,open:d,onToggle:C,dividerTop:!0,children:(0,o.jsx)(jo,{})}),G.formFieldExportAsPictureEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("Export settings"),collapsible:!0,open:b,onToggle:U,dividerTop:!0,children:(0,o.jsx)(yi,{form:e,elementSettings:i})}),G.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("Display control & Direction"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e,directionControl:(0,o.jsx)(Ht,{elementSettings:i,form:e})})}),G.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:L("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};al.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,bordersShow:g.default.bool,borderRadiusShow:g.default.bool,boxShadowShow:g.default.bool,backgroundShow:g.default.bool,backgroundImageEmpty:g.default.bool,backgroundRepeatOptions:g.default.array,sizeShow:g.default.bool,maxWidthValue:g.default.oneOfType([g.default.string,g.default.number]),modificationShow:g.default.bool,paddingShow:g.default.bool,paddingsExt:g.default.bool,oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,togglePaddingHandler:g.default.func,toggleShowPaddingHandler:g.default.func,toggleShowBorderHandler:g.default.func,toggleShowBorderRadiusHandler:g.default.func,toggleShowBoxShadowHandler:g.default.func,toggleShowSizeHandler:g.default.func,toggleShowBackgroundHandler:g.default.func,toggleShowModificationHandler:g.default.func,handleChangeValues:g.default.func};var nl=({form:e,elementSettings:i,mobileBoxShadow:l,mobileBordersShow:s,mobileBorderRadiusShow:a,mobileBoxShadowShow:d,mobileSizeShow:c,mobileBackgroundShow:p,mobilePaddingShow:f,mobilePaddingsExt:x,setMobilePaddingsExt:k,oneMobileBorderRadiusValue:b,setOneMobileBorderRadiusValue:h,toggleShowMobileBorderHandler:T,toggleShowMobileBorderRadiusHandler:_,toggleShowMobileBoxShadowHandler:E,toggleShowMobileSizeHandler:w,toggleShowMobileBackgroundHandler:v,toggleShowMobilePaddingHandler:P})=>{const{__:j}=r.useI18n(),{token:C}=(0,t.ui_kit$useToken)(),I=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:20,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Dt,{form:e,elementSettings:i,imgParent:!0})}),(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(Mo,{form:e,elementSettings:i,typeOfForm:"mobile"})})]}),I.formCellFieldPaddingsEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Padding"),collapsible:!0,open:f,onToggle:P,dividerTop:!0,children:(0,o.jsx)(Wt,{form:e,elementSettings:i,mobilePaddingsExt:x,setMobilePaddingsExt:k})}),(0,o.jsx)(t.ui_kit$FormSection,{title:j("Size"),collapsible:!0,open:c,onToggle:w,dividerTop:!0,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:8},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)("div",{style:{marginBottom:C.formItemMarginBottomXS*2},children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:i})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)("div",{style:{marginBottom:C.formItemMarginBottomXS},children:(0,o.jsx)(tt,{form:e,name:"mobileHeight",elementSettings:i})})})]})}),(0,o.jsx)(t.ui_kit$FormSection,{title:j("Background"),collapsible:!0,open:p,onToggle:v,dividerTop:!0,children:(0,o.jsx)(Bt,{elementSettings:Go(i),imageEnabled:I.formDivFieldBackgroundImageEnabled,desktopBackground:xt(i)})}),I.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Borders"),collapsible:!0,open:s,onToggle:T,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,typeOfForm:"mobile"})}),I.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Border radius"),collapsible:!0,open:a,onToggle:_,dividerTop:!0,children:(0,o.jsx)(So,{form:e,typeOfForm:"mobile",oneBorderRadiusValue:b,setOneBorderRadiusValue:h,elementSettings:i})}),I.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Box shadow"),collapsible:!0,open:d,onToggle:E,dividerTop:!0,children:(0,o.jsx)(jo,{typeOfForm:"mobile",form:e,elementSettings:i})}),I.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Display control & Direction"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e,directionControl:(0,o.jsx)(Ht,{elementSettings:i,form:e,typeOfForm:"mobile"})})}),I.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};nl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,mobileBoxShadow:g.default.object,mobileBordersShow:g.default.bool,mobileBorderRadiusShow:g.default.bool,mobileBoxShadowShow:g.default.bool,mobileSizeShow:g.default.bool,mobileBackgroundShow:g.default.bool,mobilePaddingShow:g.default.bool,mobilePaddingsExt:g.default.bool,setMobilePaddingsExt:g.default.func,oneMobileBorderRadiusValue:g.default.bool,setOneMobileBorderRadiusValue:g.default.func,toggleShowMobileBorderHandler:g.default.func,toggleShowMobileBorderRadiusHandler:g.default.func,toggleShowMobileBoxShadowHandler:g.default.func,toggleShowMobileSizeHandler:g.default.func,toggleShowMobileBackgroundHandler:g.default.func,toggleShowMobilePaddingHandler:g.default.func};var dl=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),[s]=t.ui_kit$Form.useForm(),a=Fo(),d=Fo(),[c,p]=(0,n.useState)({}),[f,x]=(0,n.useState)(!0),[k,b]=(0,n.useState)({}),[h,T]=(0,n.useState)(!0),_=r.useSelector(r.selectEmailViewType),E=r.useSelector(r.selectMobileViewActive);r.useAppConfig();const[w,v]=(0,n.useState)(e.backgroundImage[0].value===""),P=r.useSelector(r.selectIsCodeMode),j=r.useSelector(r.selectCodeModeDirection),C=P&&j!=="bottom",[I,K]=(0,n.useState)(!1),[U,O]=(0,n.useState)(!1),[L,R]=(0,n.useState)(!1),[G,J]=(0,n.useState)(!1),[te,oe]=(0,n.useState)(!1),[he,be]=(0,n.useState)(!1),[ae,ke]=(0,n.useState)(!1),[Ce,de]=(0,n.useState)(!1),[Fe,je]=(0,n.useState)(!1),[re,Be]=(0,n.useState)(!1),[ce,ee]=(0,n.useState)(!1),[me,ue]=(0,n.useState)(!1),[Z,Q]=(0,n.useState)(!1),[W,q]=(0,n.useState)(!1),[se,xe]=(0,n.useState)(!1),[ge,Ne]=(0,n.useState)(""),ye=[{label:i("Not defined"),value:"none"},{label:i("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:i("Repeat background (repeat)"),value:"repeat"},{label:i("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:i("Repeat background vertically (repeat-y)"),value:"repeat-y"}];i("Not defined"),i("Contain"),i("Cover");const $e=e.border,X=e.mobileBorder,ne=Object.keys($e).find($=>$e[$]?.width||$e[$]?.style||$e[$]?.color),we=Object.keys(X).find($=>X[$]?.width||X[$]?.style||X[$]?.color),V=$=>$&&($?.width||$?.style||$?.color)?$:"";(0,n.useEffect)(()=>{if(e){const $=e.boxShadow,N=e.mobileBoxShadow;p($),b(N),s.setFieldsValue({...e,width:e.width?.value,widthDim:e.width?.dim,height:e.height?.value,heightDim:e.height?.dim,maxWidth:e.maxWidth?.value,maxWidthDim:e.maxWidth?.dim,minWidth:e.minWidth?.value,minWidthDim:e.minWidth?.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderAll:u(e.border.all),borderTop:u(e.border.top),borderBottom:u(e.border.bottom),borderRight:u(e.border.right),borderLeft:u(e.border.left),mobileBorderAll:V(e.mobileBorder.all)||!(V(e.mobileBorder.top)||V(e.mobileBorder.bottom)||V(e.mobileBorder.right)||V(e.mobileBorder.left))&&V(e.border.all),mobileBorderTop:V(e.mobileBorder.top)||!V(e.mobileBorder.all)&&V(e.border.top),mobileBorderBottom:V(e.mobileBorder.bottom)||!V(e.mobileBorder.all)&&V(e.border.bottom),mobileBorderRight:V(e.mobileBorder.right)||!V(e.mobileBorder.all)&&V(e.border.right),mobileBorderLeft:V(e.mobileBorder.left)||!V(e.mobileBorder.all)&&V(e.border.left),paddingTop:u(e.padding.all)||u(e.padding.top),paddingLeft:u(e.padding.all)||u(e.padding.left),paddingRight:u(e.padding.all)||u(e.padding.right),paddingBottom:u(e.padding.all)||u(e.padding.bottom),paddingLeftRight:u(e.padding?.left)||u(e.padding?.right),paddingTopBottom:u(e.padding?.top)||u(e.padding?.bottom),borderRadiusAll:u(e.borderRadius.all),borderRadiusTopLeft:u(e.borderRadius.topLeft),borderRadiusBottomLeft:u(e.borderRadius.bottomLeft),borderRadiusTopRight:u(e.borderRadius.topRight),borderRadiusBottomRight:u(e.borderRadius.bottomRight),boxShadowInset:u(e.boxShadow?.inset)||!1,boxShadowHOffset:u(e.boxShadow?.hOffset),boxShadowVOffset:u(e.boxShadow?.vOffset),boxShadowBlurRadius:u(e.boxShadow?.blurRadius),boxShadowSpreadRadius:u(e.boxShadow?.spreadRadius),boxShadowColor:u(e.boxShadow?.color),mobileWidth:po(e.mobileWidth?.value),mobileWidthDim:e.mobileWidth?.dim,mobileHeight:po(e.mobileHeight?.value),mobileHeightDim:e.mobileHeight?.dim,mobileBorderRadiusAll:u(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:u(e.mobileBorderRadius.topLeft!==null?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:u(e.mobileBorderRadius.bottomLeft!==null?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:u(e.mobileBorderRadius.topRight!==null?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:u(e.mobileBorderRadius.bottomRight!==null?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:u(e.mobileBoxShadow?.inset)||!1,mobileBoxShadowHOffset:u(e.mobileBoxShadow?.hOffset),mobileBoxShadowVOffset:u(e.mobileBoxShadow?.vOffset),mobileBoxShadowBlurRadius:u(e.mobileBoxShadow?.blurRadius),mobileBoxShadowSpreadRadius:u(e.mobileBoxShadow?.spreadRadius),mobileBoxShadowColor:u(e.mobileBoxShadow?.color),mobileAlign:u(e.mobileAlign?.value),mobileVerticalAlign:u(e.mobileVerticalAlign?.value),mobileDirection:u(e.mobileDirection?.value),mobileBackgroundColor:u(e.mobileBackgroundColor?.value!=="none"?e.mobileBackgroundColor?.value:""),...nt(e),mobilePaddingTop:u(e.mobilePadding.all)||u(e.mobilePadding.top),mobilePaddingLeft:u(e.mobilePadding.all)||u(e.mobilePadding.left),mobilePaddingRight:u(e.mobilePadding.all)||u(e.mobilePadding.right),mobilePaddingBottom:u(e.mobilePadding.all)||u(e.mobilePadding.bottom),mobilePaddingTopBottom:u(e.mobilePadding.top)||u(e.mobilePadding.bottom),mobilePaddingLeftRight:u(e.mobilePadding.left)||u(e.mobilePadding.right),exportAsPicture:e?.exportAsPicture}),!u(e.borderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?x(!1):x(!0),!u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))?T(!1):T(!0),v(e.backgroundImage[0].value===""),!u(e.padding.all)&&(u(e.padding.top)||u(e.padding.right)||u(e.padding.bottom)||u(e.padding.left))&&(e.padding.top!==e.padding.bottom||e.padding.right!==e.padding.left)?K(!1):K(!0),!u(e.mobilePadding.all)&&(u(e.mobilePadding.top)||u(e.mobilePadding.right)||u(e.mobilePadding.bottom)||u(e.mobilePadding.left))&&(e.mobilePadding.top!==e.mobilePadding.bottom||e.mobilePadding.right!==e.mobilePadding.left)?O(!1):O(!0);const y=a.isStaleBorderSnapshot(e,!!ne),M=d.isStaleBorderSnapshot(e,!!we);y&&s.setFieldsValue({border:r.RESET_BORDER_PARAMS,borderAll:null,borderTop:null,borderBottom:null,borderRight:null,borderLeft:null}),(M||y&&!we)&&s.setFieldsValue({mobileBorder:r.RESET_BORDER_PARAMS,mobileBorderAll:null,mobileBorderTop:null,mobileBorderBottom:null,mobileBorderRight:null,mobileBorderLeft:null}),R(fe=>ne&&!y?!0:fe),J(fe=>ne&&!y||we&&!M?!0:fe),oe(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),be(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),ke(!!e.boxShadow),de(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),je(!!e.width.value||!!e.height.value||!!e.minWidth.value||!!e.maxWidth.value),Be(!!e.mobileWidth.value||!!e.mobileHeight.value),ee(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||e.backgroundRepeat!=="repeat"||!e.backgroundRepeat,!!e.backgroundSize),ue(kt(e)),Q(!!e.exportAsPicture),q(!!e.padding?.all||!!e.padding?.top||!!e.padding?.bottom||!!e.padding?.left||!!e.padding?.right),xe(!!e.mobilePadding.all||!!e.mobilePadding.top||!!e.mobilePadding.bottom||!!e.mobilePadding.left||!!e.mobilePadding.right)}},[s,e,ne,we,a,d]);const Te=$=>{const N=s.getFieldsValue(!0),y=Object.keys($)[0];let M;switch(Ne(s.getFieldsValue(!0).widthDim==="%"?100:""),y){case"exportAsPicture":M={exportAsPicture:N.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":M={boxShadow:{hOffset:N.boxShadowHOffset,vOffset:N.boxShadowVOffset,blurRadius:N.boxShadowBlurRadius,spreadRadius:N.boxShadowSpreadRadius,color:N.boxShadowColor,inset:N.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":N.borderPosition==="borderAll"?(M={border:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...N.borderAll}}},s.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER})):N.borderAll?.width||N.borderAll?.style||N.borderAll?.color?(M={border:{all:null,left:N.borderAll,right:N.borderAll,top:N.borderAll,bottom:N.borderAll,[z.REVERSE_BORDER_POSITIONS[y]]:{...N[y],...$[y]}}},s.setFieldsValue({borderAll:null,borderLeft:N.borderAll,borderRight:N.borderAll,borderTop:N.borderAll,borderBottom:N.borderAll,[y]:{...N[y],...$[y]}})):(M={border:{all:null,left:N.borderLeft,right:N.borderRight,top:N.borderTop,bottom:N.borderBottom,[z.REVERSE_BORDER_POSITIONS[y]]:{...N[y],...$[y]}}},s.setFieldsValue({border:M.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":if(N.mobileBorderPosition==="mobileBorderAll")M={mobileBorder:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...N.mobileBorderAll,classNamePrefix:"em-mob-border_"+z.MOBILE_REVERSE_BORDER_POSITIONS[y]+"-"}}},s.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER});else{const fe=z.MOBILE_REVERSE_BORDER_POSITIONS[y],Le={...N[y],...$[y]},eo=!Le?.width&&!Le?.style&&!Le?.color;if(N.mobileBorder?.all?.width||N.mobileBorder?.all?.style||N.mobileBorder?.all?.color){const Xe=N.mobileBorderAll;M={mobileBorder:{all:null,left:Xe,right:Xe,top:Xe,bottom:Xe,[fe]:eo?null:{...Le,classNamePrefix:"em-mob-border_"+fe+"-"}}},s.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:Xe,mobileBorderRight:Xe,mobileBorderTop:Xe,mobileBorderBottom:Xe,[y]:Le})}else{const Xe=e.mobileBorder||{},lo=Qe=>{const uo=Xe[Qe];return uo&&(uo?.width||uo?.style||uo?.color)?uo:null};M={mobileBorder:{all:null,left:fe==="left"?eo?null:{...Le,classNamePrefix:"em-mob-border_left-"}:lo("left"),right:fe==="right"?eo?null:{...Le,classNamePrefix:"em-mob-border_right-"}:lo("right"),top:fe==="top"?eo?null:{...Le,classNamePrefix:"em-mob-border_top-"}:lo("top"),bottom:fe==="bottom"?eo?null:{...Le,classNamePrefix:"em-mob-border_bottom-"}:lo("bottom")}},s.setFieldsValue({[y]:Le})}}break;case"width":M={[y]:{value:$[y],dim:N.widthDim}};break;case"height":M={[y]:{value:$[y],dim:N.heightDim}};break;case"widthDim":M={width:{value:N.width,dim:$[y]}};break;case"heightDim":M={height:{value:N.height,dim:$[y]}};break;case"maxWidth":M={[y]:{value:$[y],dim:N.maxWidthDim}};break;case"maxWidthDim":M={maxWidth:{value:N.maxWidth,dim:$[y]}};break;case"minWidth":M={[y]:{value:$[y],dim:N.minWidthDim}};break;case"minWidthDim":M={minWidth:{value:N.minWidth,dim:$[y]}};break;case"backgroundImage":v($[y]===""),M={[y]:[{...e.backgroundImage[0],value:$[y]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":M={padding:{[z.PADDING_POSITION[y]]:+$[y]}};break;case"paddingTopBottom":M={padding:{top:+$[y],bottom:+$[y]}},N.paddingTop=N.paddingBottom=+$[y];break;case"paddingLeftRight":M={padding:{left:+$[y],right:+$[y]}},N.paddingLeft=N.paddingRight=+$[y];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":M={borderRadius:{[z.BORDER_RADIUS_POSITION[y]]:+$[y]}};break;case"mobileWidth":M={[y]:{classNamePrefix:"em-mob-width-",value:$[y],dim:N.mobileWidthDim}};break;case"mobileWidthDim":M={mobileWidth:{classNamePrefix:"em-mob-width-",value:N.mobileWidth||100,dim:$[y]}};break;case"mobileHeight":M={[y]:{classNamePrefix:"em-mob-height-",value:$[y],dim:N.mobileHeightDim}};break;case"mobileHeightDim":M={mobileHeight:{classNamePrefix:"em-mob-height-",value:N.mobileHeight,dim:$[y]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":M={mobileBorderRadius:{[z.MOBILE_BORDER_RADIUS_POSITION[y]]:$[y],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[y]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":M={mobileBoxShadow:{hOffset:N.mobileBoxShadowHOffset,vOffset:N.mobileBoxShadowVOffset,blurRadius:N.mobileBoxShadowBlurRadius,spreadRadius:N.mobileBoxShadowSpreadRadius,color:N.mobileBoxShadowColor,inset:N.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":M={[y]:{classNamePrefix:"em-mob-text_align-",value:$[y]}};break;case"mobileVerticalAlign":M={[y]:{classNamePrefix:"em-mob-vertical_align-",value:$[y]}};break;case"mobileBackgroundColor":case"mobileBackgroundImage":case"mobileBackgroundPositionX":case"mobileBackgroundPositionY":case"mobileBackgroundRepeat":case"mobileBackgroundSize":if(M=_t($),!M)return;break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":M={mobilePadding:{all:null,top:N.mobilePaddingTop!==""?N.mobilePaddingTop:null,right:N.mobilePaddingRight!==""?N.mobilePaddingRight:null,bottom:N.mobilePaddingBottom!==""?N.mobilePaddingBottom:null,left:N.mobilePaddingLeft!==""?N.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":N.mobilePaddingTop=N.mobilePaddingBottom=$[y],M={mobilePadding:{all:null,top:N.mobilePaddingTop!==""?N.mobilePaddingTop:null,right:N.mobilePaddingRight!==""?N.mobilePaddingRight:null,bottom:N.mobilePaddingBottom!==""?N.mobilePaddingBottom:null,left:N.mobilePaddingLeft!==""?N.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":N.mobilePaddingLeft=N.mobilePaddingRight=$[y],M={mobilePadding:{all:null,top:N.mobilePaddingTop!==""?N.mobilePaddingTop:null,right:N.mobilePaddingRight!==""?N.mobilePaddingRight:null,bottom:N.mobilePaddingBottom!==""?N.mobilePaddingBottom:null,left:N.mobilePaddingLeft!==""?N.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileDirection":M={[y]:{classNamePrefix:"em-mob-direction-",value:$[y]}};break;case"backgroundPositionX":case"backgroundPositionY":M={[y]:isNaN(parseFloat($[y].position))?$[y].position:$[y].position+$[y].unit};break;default:M=$}y!=="borderPosition"&&y!=="mobileBorderPosition"&&l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:M})},Ie=()=>{K(N=>!N);const $=s.getFieldsValue(!0);I||($.paddingLeftRight=$.paddingLeft,$.paddingTopBottom=$.paddingTop,$.paddingRight=$.paddingLeft,$.paddingBottom=$.paddingTop,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:$.paddingTopBottom,bottom:$.paddingTopBottom,left:$.paddingLeftRight,right:$.paddingLeftRight}}}))},ve=()=>{const $=s.getFieldsValue(!0);a.markBorderToggled(!L),setTimeout(()=>{R(N=>!N),L?($.borderAll=z.NULL_BORDER,$.borderTop=z.NULL_BORDER,$.borderBottom=z.NULL_BORDER,$.borderRight=z.NULL_BORDER,$.borderLeft=z.NULL_BORDER):$.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:$.borderAll.color,style:$.borderAll.style,width:$.borderAll.width}}}})})},Ve=()=>{const $=s.getFieldsValue(!0);d.markBorderToggled(!G),setTimeout(()=>{J(N=>!N),G?($.mobileBorderAll=z.NULL_BORDER,$.mobileBorderTop=z.NULL_BORDER,$.mobileBorderBottom=z.NULL_BORDER,$.mobileBorderRight=z.NULL_BORDER,$.mobileBorderLeft=z.NULL_BORDER):$.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:$.mobileBorderAll.color,style:$.mobileBorderAll.style,width:$.mobileBorderAll.width}}}})})},Me=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{oe(N=>!N),te?($.borderRadiusAll=0,x(!0)):$.borderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:$.borderRadiusAll}}})})},He=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{be(N=>!N),he?($.mobileBorderRadiusAll=null,T(!0)):$.mobileBorderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:$.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})},le=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{ke(N=>!N),ae?($.boxShadowInset=!1,$.boxShadowHOffset=null,$.boxShadowVOffset=null,$.boxShadowBlurRadius=null,$.boxShadowSpreadRadius=null,$.boxShadowColor=""):($.boxShadowInset=!1,$.boxShadowHOffset=5,$.boxShadowVOffset=5,$.boxShadowBlurRadius=10,$.boxShadowSpreadRadius=-5,$.boxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:$.boxShadowBlurRadius,color:$.boxShadowColor,hOffset:$.boxShadowHOffset,inset:$.boxShadowInset,spreadRadius:$.boxShadowSpreadRadius,vOffset:$.boxShadowVOffset}}})})},Y=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{de(N=>!N),Ce?($.mobileBoxShadowInset=!1,$.mobileBoxShadowHOffset=null,$.mobileBoxShadowVOffset=null,$.mobileBoxShadowBlurRadius=null,$.mobileBoxShadowSpreadRadius=null,$.mobileBoxShadowColor=""):($.mobileBoxShadowInset=!1,$.mobileBoxShadowHOffset=5,$.mobileBoxShadowVOffset=5,$.mobileBoxShadowBlurRadius=10,$.mobileBoxShadowSpreadRadius=-5,$.mobileBoxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:$.mobileBoxShadowBlurRadius,color:$.mobileBoxShadowColor,hOffset:$.mobileBoxShadowHOffset,inset:$.mobileBoxShadowInset,spreadRadius:$.mobileBoxShadowSpreadRadius,vOffset:$.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})},D=()=>{setTimeout(()=>{je($=>!$)})},ie=()=>{setTimeout(()=>{Be($=>!$)})},Ee=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{ee(N=>!N),ce?($.backgroundColor="",$.backgroundImage="",$.backgroundPositionX="",$.backgroundPositionY="",$.backgroundRepeat="none",$.backgroundSize="",v(!0)):($.backgroundColor="#E5E5E5",$.backgroundSize="",$.backgroundRepeat="none"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:$.backgroundColor,backgroundImage:[{type:"url",value:$.backgroundImage}],backgroundPositionX:$.backgroundPositionX,backgroundPositionY:$.backgroundPositionY,backgroundRepeat:$.backgroundRepeat,backgroundSize:$.backgroundSize}})})},Ae=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{ue(N=>!N),me?$.mobileBackgroundColor="":$.mobileBackgroundColor="#E5E5E5",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:$.mobileBackgroundColor}}}),me&&Et(s,e,l)})},We=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{Q(N=>!N),Z&&($.exportAsPicture=!1,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))})},Ge=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{q(N=>!N),W&&($.paddingLeftRight="",$.paddingLeft="",$.paddingRight="",$.paddingTopBottom="",$.paddingTop="",$.paddingBottom="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))})},Ye=()=>{const $=s.getFieldsValue(!0);setTimeout(()=>{xe(N=>!N),se&&($.mobilePaddingLeftRight="",$.mobilePaddingLeft="",$.mobilePaddingRight="",$.mobilePaddingTopBottom="",$.mobilePaddingTop="",$.mobilePaddingBottom="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))})};return(0,o.jsxs)(t.ui_kit$Form,{form:s,layout:"vertical",name:"selected_div_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:z.BORDER_POSITIONS[ne]||"borderAll",mobileBorderPosition:z.MOBILE_BORDER_POSITIONS[we]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:""},onValuesChange:Te,autoComplete:"off",className:"element-controls",children:[!C&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),_==="mobile"&&E.styles?(0,o.jsxs)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:[(0,o.jsx)(nl,{form:s,elementSettings:e,mobileBoxShadow:k,mobileBordersShow:G,mobileBorderRadiusShow:he,mobileBoxShadowShow:Ce,mobileSizeShow:re,mobileBackgroundShow:me,mobilePaddingShow:se,mobilePaddingsExt:U,setMobilePaddingsExt:O,oneMobileBorderRadiusValue:h,setOneMobileBorderRadiusValue:T,toggleShowMobileBorderHandler:Ve,toggleShowMobileBorderRadiusHandler:He,toggleShowMobileBoxShadowHandler:Y,toggleShowMobileSizeHandler:ie,toggleShowMobileBackgroundHandler:Ae,toggleShowMobilePaddingHandler:Ye})," "]}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(al,{form:s,elementSettings:e,boxShadow:c,bordersShow:L,borderRadiusShow:te,boxShadowShow:ae,backgroundShow:ce,backgroundImageEmpty:w,backgroundRepeatOptions:ye,sizeShow:Fe,maxWidthValue:ge,modificationShow:Z,paddingShow:W,paddingsExt:I,oneBorderRadiusValue:f,setOneBorderRadiusValue:x,togglePaddingHandler:Ie,toggleShowPaddingHandler:Ge,toggleShowBorderHandler:ve,toggleShowBorderRadiusHandler:Me,toggleShowBoxShadowHandler:le,toggleShowSizeHandler:D,toggleShowBackgroundHandler:Ee,toggleShowModificationHandler:We,handleChangeValues:Te})})]})};dl.propTypes={elementSettings:g.default.object.isRequired};var cl=({form:e,elementSettings:i})=>{const{__:l}=r.useI18n(),s=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:"0"},children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Float block width"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"width",children:(0,o.jsx)(t.ui_kit$InputNumber,{min:0,placeholder:l("Float block width"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:(0,o.jsx)(t.ui_kit$Form.Item,{name:"widthDim",noStyle:!0,children:$o})})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:l("Column gap"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"gap",children:(0,o.jsx)(t.ui_kit$InputNumber,{min:0,placeholder:l("Column gap"),prefix:(0,o.jsx)(r.EmIcons,{icon:"SplitCellsOutlined",component:t.icons$SplitCellsOutlined}),addonAfter:(0,o.jsx)(t.ui_kit$Form.Item,{name:"widthDim",noStyle:!0,children:nn})})})})})]})}),(0,o.jsx)(t.ui_kit$FormSection,{title:l("Vertical alignment"),dividerTop:!0,children:(0,o.jsx)(Mo,{form:e,elementSettings:i})}),(0,o.jsx)(t.ui_kit$FormSection,{title:l("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})}),s.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:l("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};cl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired};var ul=({form:e,elementSettings:i})=>{const{__:l}=r.useI18n(),s=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:l("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:l("Appearance on mobile devices"),type:"info"})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{marginBottom:20},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:i})}),(0,o.jsx)(t.ui_kit$Col,{span:12})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:l("Alignments"),dividerTop:!0,children:(0,o.jsx)(Mo,{form:e,elementSettings:i,typeOfForm:"mobile"})}),(0,o.jsx)(t.ui_kit$FormSection,{title:l("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})}),s.formFieldAmpVisibilityEnabled&&i.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:l("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};ul.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired};var Ii=0,ml=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),[s]=t.ui_kit$Form.useForm(),a=r.useSelector(r.selectEmailViewType),d=r.useSelector(r.selectMobileViewActive),c=r.useSelector(r.selectIsCodeMode),p=r.useSelector(r.selectCodeModeDirection),f=c&&p!=="bottom";(0,n.useEffect)(()=>{e&&(s.setFieldsValue({...e,width:e.width?.value,widthDim:e.width?.dim,gap:e.gap?.value,gapDim:e.gap?.dim,maxWidth:e.maxWidth?.value,maxWidthDim:e.maxWidth?.dim,minWidth:e.minWidth?.value,minWidthDim:e.minWidth?.dim,show:e.show?e.show:"all",mobileWidth:po(e.mobileWidth?.value),mobileWidthDim:e.mobileWidth?.dim,mobileContentWidth:po(e.mobileContentWidth?.value),mobileContentWidthDim:e.mobileContentWidth?.dim,mobileVerticalAlign:u(e.mobileVerticalAlign?.value)}),Ii=e.width.value+e.gap.value)},[s,e]);const x=k=>{const b=s.getFieldsValue(!0),h=Object.keys(k)[0];let T;switch(h){case"width":Ii=k[h]+b.gap,T={[h]:{value:k[h],dim:b.widthDim},gap:{value:b.gap}};break;case"widthDim":T={width:{value:b.width,dim:k[h]},gap:{value:b.gap}};break;case"gap":b.width=Ii-k[h],T={[h]:{value:k[h],dim:"px"}};break;case"mobileWidth":T={[h]:{classNamePrefix:"em-mob-width-",value:k[h],dim:b.mobileWidthDim}};break;case"mobileWidthDim":T={mobileWidth:{classNamePrefix:"em-mob-width-",value:b.mobileWidth||100,dim:k[h]}};break;case"mobileContentWidth":T={[h]:{classNamePrefix:"em-mob-width-",value:k[h],dim:b.mobileContentWidthDim}};break;case"mobileContentWidthDim":T={mobileContentWidth:{classNamePrefix:"em-mob-width-",value:100,dim:k[h]}};break;case"mobileVerticalAlign":T={[h]:{classNamePrefix:"em-mob-vertical_align-",value:k[h]}};break;default:T=k}l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:T})};return(0,o.jsxs)(t.ui_kit$Form,{form:s,layout:"vertical",name:"selected_float_block_form",initialValues:{width:{value:"",dim:""},gap:{value:"",dim:"px"},valign:"",show:"all",mobileWidth:"",mobileWidthDim:"",mobileContentWidth:"",mobileContentWidthDim:"",mobileVerticalAlign:""},onValuesChange:x,autoComplete:"off",className:"element-controls",children:[f&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),a==="mobile"&&d.styles?(0,o.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:a==="mobile"&&d.styles?"block":"none"},children:(0,o.jsx)(ul,{form:s,elementSettings:e})}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(cl,{form:s,elementSettings:e})})]})};ml.propTypes={elementSettings:g.default.object.isRequired};var pl=({form:e,fillFields:i,elementSettings:l,boxShadow:s,bordersShow:a,borderRadiusShow:d,boxShadowShow:c,backgroundShow:p,backgroundImageEmpty:f,backgroundRepeatOptions:x,paddingShow:k,paddingsExt:b,maxWidthValue:h,oneBorderRadiusValue:T,setOneBorderRadiusValue:_,linkProtocol:E,linkTarget:w,isOpenTextReplacer:v,textReplacerButtonRef:P,textReplacerInputRef:j,handleLinkProtocolsChange:C,handleSelect:I,textReplacerInputHandler:K,handleTextReplacerKeyDown:U,srcButtonHandler:O,togglePaddingHandler:L,toggleShowPaddingHandler:R,toggleShowBackgroundHandler:G,toggleShowBorderHandler:J,toggleShowBorderRadiusHandler:te,toggleShowBoxShadowHandler:oe,setLinkProtocol:he,handleChangeValues:be})=>{const{__:ae}=r.useI18n(),{token:ke}=(0,t.ui_kit$useToken)(),Ce=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-desktop-props-title",title:ae("Appearance on mobile devices"),type:"info"}),(0,o.jsxs)("div",{className:"selected_form-props-wrapper",children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:20,style:{marginBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Uo,{form:e,elementSettings:l})}),Ce.formButtonFieldTextAlignEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(it,{form:e,name:"textAlign",elementSettings:l})})]}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:24}}),(0,o.jsx)(et,{show:E==="#",__:ae,style:{marginBottom:ke.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:ae("Hyperlink URL"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"href",style:{marginBottom:Ce.formButtonFieldReplacerEnabled?ke.formItemMarginBottomXS:ke.formItemMarginBottomMD+4},children:(0,o.jsx)(t.ui_kit$Input,{addonBefore:(0,o.jsx)(Zo,{linkProtocol:E,handleLinkProtocolsChange:C,__:ae}),placeholder:ae("Hyperlink URL"),allowClear:!0,onSelect:I,prefix:(0,o.jsx)(Qo,{linkProtocol:E})})})}),E==="mailto:"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:"subject",style:{marginBottom:ke.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:ae("Subject")})}),(0,o.jsx)(t.ui_kit$Form.Item,{name:"body",style:{marginBottom:ke.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$TextArea,{rows:3,placeholder:ae("Body")})})]}),Ce.formButtonFieldReplacerEnabled&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:ae("Text replacer"),placement:"bottom",getPopupContainer:de=>de.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button ant-form-item",{"selected-td-form__button--active":v}),icon:(0,o.jsx)(r.EmIcons,{icon:"Replacer",component:t.icons$Replacer,className:"selected-td-form__icon-radius"}),onClick:O,ref:P})})}),(0,o.jsx)(t.ui_kit$Col,{span:21,children:v&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:ae("Text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textReplacer",children:(0,o.jsx)(t.ui_kit$Input,{placeholder:ae("The code that will replace this text"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:ae("Text")}),onChange:K,onKeyDown:U,ref:j,onSelect:I})})})})]})}),Ce.formButtonFieldPaddingsEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ae("Padding"),collapsible:!0,open:k,onToggle:R,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormPaddingInputs,{extended:b,onToggleExtended:L,gutter:ke.marginSM,labels:{horizontal:ae("Horizontal padding"),vertical:ae("Vertical padding"),left:ae("Left padding"),right:ae("Right padding"),top:ae("Top padding"),bottom:ae("Bottom padding"),individual:ae("Individual padding")}})}),(0,o.jsx)(t.ui_kit$FormSection,{title:ae("Size"),dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormSizeInputs,{maxWidth:h,dimensionSelect:$o,gutter:ke.marginSM,labels:{width:ae("Width"),height:ae("Height"),minWidth:ae("Minimum width"),maxWidth:ae("Maximum width")}})}),(0,o.jsx)(gt,{form:e,fillFields:i,elementSettings:l,showAddParagraph:!1,isButton:!0,setLinkProtocol:he,linkProtocol:E,linkTarget:w}),(0,o.jsxs)(t.ui_kit$FormSection,{title:ae("Background"),collapsible:!0,open:p,onToggle:G,dividerTop:!0,children:[(0,o.jsx)(vi,{form:e,backgroundImageEmpty:f,appConfig:Ce,token:ke,elementSettings:l,backgroundRepeatOptions:x,handleChangeValues:be}),(0,o.jsx)(rt,{form:e,showBackground:!0})]}),Ce.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ae("Borders"),collapsible:!0,open:a,onToggle:J,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,elementSettings:l})}),Ce.formFieldBorderRadiusEnabled&&(0,o.jsxs)(t.ui_kit$FormSection,{title:ae("Border radius"),collapsible:!0,open:d,onToggle:te,dividerTop:!0,children:[(0,o.jsx)(So,{form:e,oneBorderRadiusValue:T,setOneBorderRadiusValue:_,elementSettings:l}),(0,o.jsx)(rt,{form:e,showRounding:!0})]}),Ce.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ae("Box shadow"),collapsible:!0,open:c,onToggle:oe,dividerTop:!0,children:(0,o.jsx)(jo,{})}),Ce.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:ae("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:l,form:e})}),Ce.formFieldAmpVisibilityEnabled&&l.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:ae("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})]})};pl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,bordersShow:g.default.bool,borderRadiusShow:g.default.bool,boxShadowShow:g.default.bool,backgroundShow:g.default.bool,backgroundImageEmpty:g.default.bool,backgroundRepeatOptions:g.default.array,paddingShow:g.default.bool,paddingsExt:g.default.bool,maxWidthValue:g.default.oneOfType([g.default.string,g.default.number]),oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,linkProtocol:g.default.string,linkTarget:g.default.object,isOpenTextReplacer:g.default.bool,textReplacerButtonRef:g.default.object,textReplacerInputRef:g.default.object,handleLinkProtocolsChange:g.default.func,handleSelect:g.default.func,textReplacerInputHandler:g.default.func,handleTextReplacerKeyDown:g.default.func,srcButtonHandler:g.default.func,togglePaddingHandler:g.default.func,toggleShowPaddingHandler:g.default.func,toggleShowBackgroundHandler:g.default.func,toggleShowBorderHandler:g.default.func,toggleShowBorderRadiusHandler:g.default.func,toggleShowBoxShadowHandler:g.default.func,setLinkProtocol:g.default.func,handleChangeValues:g.default.func};var hl=({form:e,fillFields:i,elementSettings:l,boxShadow:s,mobileBordersShow:a,mobileBorderRadiusShow:d,mobileBoxShadowShow:c,mobileSizeShow:p,mobileBackgroundShow:f,mobilePaddingShow:x,mobilePaddingsExt:k,setMobilePaddingsExt:b,oneMobileBorderRadiusValue:h,setOneMobileBorderRadiusValue:T,linkProtocol:_,handleLinkProtocolsChange:E,setLinkProtocol:w,toggleShowMobileBorderHandler:v,toggleShowMobileBorderRadiusHandler:P,toggleShowMobileBoxShadowHandler:j,toggleShowMobileSizeHandler:C,toggleShowMobileBackgroundHandler:I,toggleShowMobilePaddingHandler:K})=>{const{__:U}=r.useI18n(),{token:O}=(0,t.ui_kit$useToken)(),L=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:20,style:{marginBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Uo,{form:e,elementSettings:l,imgParent:!0,typeOfForm:"mobile"})}),L.formButtonFieldTextAlignEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(Dt,{form:e,name:"mobileTextAlign",elementSettings:l,imgParent:!0})})]}),!!l.showOnMobile&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:24}}),(0,o.jsx)(et,{show:_==="#",__:U,style:{marginBottom:O.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:U("Hyperlink URL"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"href",style:{marginBottom:_==="mailto:"?O.formItemMarginBottomXS:O.formItemMarginBottomMD},children:(0,o.jsx)(t.ui_kit$Input,{addonBefore:(0,o.jsx)(Zo,{linkProtocol:_,handleLinkProtocolsChange:E,__:U}),placeholder:U("Hyperlink URL"),allowClear:!0,prefix:(0,o.jsx)(Qo,{linkProtocol:_})})})}),_==="mailto:"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:"subject",children:(0,o.jsx)(t.ui_kit$Input,{placeholder:U("Subject")})}),(0,o.jsx)(t.ui_kit$Form.Item,{name:"body",style:{marginBottom:O.formItemMarginBottomMD},children:(0,o.jsx)(t.ui_kit$TextArea,{rows:3,placeholder:U("Body")})})]})]}),!!l.showOnMobile&&(0,o.jsx)(gt,{form:e,fillFields:i,elementSettings:l,setLinkProtocol:w,linkProtocol:_,showAddParagraph:!1,isButton:!0}),(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(Fr,{})})}),L.formButtonFieldPaddingsEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:U("Padding"),collapsible:!0,open:x,onToggle:K,dividerTop:!0,children:(0,o.jsx)(Wt,{form:e,elementSettings:l,mobilePaddingsExt:k,setMobilePaddingsExt:b})}),(0,o.jsx)(t.ui_kit$FormSection,{title:U("Size"),collapsible:!0,open:p,onToggle:C,dividerTop:!0,bodyStyle:{paddingBottom:O.formItemMarginBottomMD},children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:U("Width"),placement:"bottom",children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:l})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:U("Height"),placement:"bottom",children:(0,o.jsx)(tt,{form:e,name:"mobileHeight",elementSettings:l})})})]})}),(0,o.jsx)(t.ui_kit$FormSection,{title:U("Background"),collapsible:!0,open:f,onToggle:I,dividerTop:!0,bodyStyle:{paddingBottom:O.formItemMarginBottomMD},children:(0,o.jsx)(Bt,{elementSettings:Go(l),imageEnabled:L.formButtonFieldBackgroundImageEnabled,desktopBackground:xt(l)})}),L.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:U("Borders"),collapsible:!0,open:a,onToggle:v,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,typeOfForm:"mobile"})}),L.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:U("Border radius"),collapsible:!0,open:d,onToggle:P,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:h,setOneBorderRadiusValue:T,elementSettings:l,typeOfForm:"mobile"})}),L.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:U("Box shadow"),collapsible:!0,open:c,onToggle:j,dividerTop:!0,children:(0,o.jsx)(jo,{typeOfForm:"mobile"})}),L.formFieldAmpVisibilityEnabled&&l.ampShow&&(0,o.jsx)(t.ui_kit$FormSection,{title:U("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})}),L.formFieldAmpVisibilityEnabled&&l.isAmp&&(0,o.jsx)(t.ui_kit$FormSection,{title:U("AMP visibility"),dividerTop:!0,children:(0,o.jsx)(Io,{})})]})};hl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,boxShadow:g.default.object,mobileBordersShow:g.default.bool,mobileBorderRadiusShow:g.default.bool,mobileBoxShadowShow:g.default.bool,mobileSizeShow:g.default.bool,mobileBackgroundShow:g.default.bool,mobilePaddingShow:g.default.bool,mobilePaddingsExt:g.default.bool,setMobilePaddingsExt:g.default.func,oneMobileBorderRadiusValue:g.default.bool,setOneMobileBorderRadiusValue:g.default.func,linkProtocol:g.default.string,handleLinkProtocolsChange:g.default.func,setLinkProtocol:g.default.func,toggleShowMobileBorderHandler:g.default.func,toggleShowMobileBorderRadiusHandler:g.default.func,toggleShowMobileBoxShadowHandler:g.default.func,toggleShowMobileSizeHandler:g.default.func,toggleShowMobileBackgroundHandler:g.default.func,toggleShowMobilePaddingHandler:g.default.func};var bl=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),[s]=t.ui_kit$Form.useForm(),a=Fo(),d=Fo(),c=r.useDispatch(),[p,f]=(0,n.useState)({}),[x,k]=(0,n.useState)(!0),[b,h]=(0,n.useState)(!0),T=r.useSelector(r.selectEmailViewType),_=r.useSelector(r.selectMobileViewActive),[E,w]=(0,n.useState)(e.backgroundImage?.[0].value===""),v=r.useSelector(r.selectIsCodeMode),P=r.useSelector(r.selectCodeModeDirection),j=v&&P!=="bottom",C=(0,n.useRef)(null),I=(0,n.useRef)(null),[K,U]=(0,n.useState)(!1),[O,L]=(0,n.useState)(!1),[R,G]=(0,n.useState)(!1),[J,te]=(0,n.useState)(!1),[oe,he]=(0,n.useState)(!1),[be,ae]=(0,n.useState)(!1),[ke,Ce]=(0,n.useState)(!1),[de,Fe]=(0,n.useState)(!1),[je,re]=(0,n.useState)(!1),[Be,ce]=(0,n.useState)(!1),[ee,me]=(0,n.useState)(!1),[ue,Z]=(0,n.useState)(!1),[Q,W]=(0,n.useState)(!1),[q,se]=(0,n.useState)(""),[xe,ge]=(0,n.useState)("https://"),[Ne,ye]=(0,n.useState)({}),$e=e,[X,ne]=(0,n.useState)(!!$e.textReplacer?.length),[we,V]=(0,n.useState)(e);e!==we&&(V(e),ne(!!$e.textReplacer?.length));const Te=r.useElementEntityKind(),Ie=[{label:i("Not defined"),value:"none"},{label:i("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:i("Repeat background (repeat)"),value:"repeat"},{label:i("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:i("Repeat background vertically (repeat-y)"),value:"repeat-y"}],ve=e.border,Ve=e.mobileBorder,Me=Object.keys(ve).find(S=>ve[S]?.width||ve[S]?.style||ve[S]?.color),He=Object.keys(Ve).find(S=>Ve[S]?.width||Ve[S]?.style||Ve[S]?.color),le=S=>S&&(S?.width||S?.style||S?.color)?S:"",{remember:Y,fillFields:D}=st(e);(0,n.useEffect)(()=>{if(e){const S=e.boxShadow||{},m=e.mobilePadding||{},F=e.mobileAlign||{};f(S);let H="",Re="",pe=e.href||"https://";if(e.href){if(e.href.startsWith("mailto:")){const so=Cr(e.href);H=so.subject,Re=so.body,pe=so.baseEmail}Wo(e.href,ge)}D(s,{...e,href:pe,subject:H,body:Re,width:e.width?.value,widthDim:e.width?.dim,height:e.height?.value,heightDim:e.height?.dim,backgroundImage:e.backgroundImage?.[0].value,show:e.show?e.show:"all",textAlign:e.textAlign,borderAll:u(e.border.all),borderTop:u(e.border.top),borderBottom:u(e.border.bottom),borderRight:u(e.border.right),borderLeft:u(e.border.left),mobileBorderAll:le(e.mobileBorder.all)||!(le(e.mobileBorder.top)||le(e.mobileBorder.bottom)||le(e.mobileBorder.right)||le(e.mobileBorder.left))&&le(e.border.all),mobileBorderTop:le(e.mobileBorder.top)||!le(e.mobileBorder.all)&&le(e.border.top),mobileBorderBottom:le(e.mobileBorder.bottom)||!le(e.mobileBorder.all)&&le(e.border.bottom),mobileBorderRight:le(e.mobileBorder.right)||!le(e.mobileBorder.all)&&le(e.border.right),mobileBorderLeft:le(e.mobileBorder.left)||!le(e.mobileBorder.all)&&le(e.border.left),paddingTop:u(e.padding?.all)||u(e.padding?.top),paddingLeft:u(e.padding?.all)||u(e.padding?.left),paddingRight:u(e.padding?.all)||u(e.padding?.right),paddingBottom:u(e.padding?.all)||u(e.padding?.bottom),paddingLeftRight:u(e.padding?.left)||u(e.padding?.right),paddingTopBottom:u(e.padding?.top)||u(e.padding?.bottom),borderRadiusAll:u(e.borderRadius?.all),borderRadiusTopLeft:u(e.borderRadius?.topLeft),borderRadiusBottomLeft:u(e.borderRadius?.bottomLeft),borderRadiusTopRight:u(e.borderRadius?.topRight),borderRadiusBottomRight:u(e.borderRadius?.bottomRight),boxShadowInset:u(e.boxShadow?.inset)||!1,boxShadowHOffset:u(e.boxShadow?.hOffset),boxShadowVOffset:u(e.boxShadow?.vOffset),boxShadowBlurRadius:u(e.boxShadow?.blurRadius),boxShadowSpreadRadius:u(e.boxShadow?.spreadRadius),boxShadowColor:u(e.boxShadow?.color),mobileWidth:po(e.mobileWidth?.value)||e.width?.value,mobileWidthDim:po(e.mobileWidth?.value)?e.mobileWidth?.dim:e.width?.dim,mobileHeight:po(e.mobileHeight?.value)||e.height?.value,mobileHeightDim:po(e.mobileHeight?.value)?e.mobileHeight?.dim:e.height?.dim,mobileBorderRadiusAll:u(e.mobileBorderRadius?.all)||u(e.borderRadius?.all),mobileBorderRadiusTopLeft:u(e.mobileBorderRadius?.topLeft)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.topLeft)||u(e.borderRadius?.all),mobileBorderRadiusBottomLeft:u(e.mobileBorderRadius?.bottomLeft)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.bottomLeft)||u(e.borderRadius?.all),mobileBorderRadiusTopRight:u(e.mobileBorderRadius?.topRight)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.topRight)||u(e.borderRadius?.all),mobileBorderRadiusBottomRight:u(e.mobileBorderRadius?.bottomRight)||u(e.mobileBorderRadius?.all)||u(e.borderRadius?.bottomRight)||u(e.borderRadius?.all),mobileBoxShadowInset:e.mobileBoxShadow?.inset!=null?e.mobileBoxShadow.inset:e.boxShadow?.inset||!1,mobileBoxShadowHOffset:u(e.mobileBoxShadow?.hOffset)||u(e.boxShadow?.hOffset),mobileBoxShadowVOffset:u(e.mobileBoxShadow?.vOffset)||u(e.boxShadow?.vOffset),mobileBoxShadowBlurRadius:u(e.mobileBoxShadow?.blurRadius)||u(e.boxShadow?.blurRadius),mobileBoxShadowSpreadRadius:u(e.mobileBoxShadow?.spreadRadius)||u(e.boxShadow?.spreadRadius),mobileBoxShadowColor:u(e.mobileBoxShadow?.color)||u(e.boxShadow?.color),mobileAlign:u(F?.value)||e.align,mobileVerticalAlign:u(e.mobileVerticalAlign?.value||e.valign),mobileBackgroundColor:u(e.mobileBackgroundColor?.value||e.backgroundColor||""),...nt(e),mobilePaddingTop:u(m.all)||u(m.top)||u(e.padding?.all)||u(e.padding?.top),mobilePaddingLeft:u(m.all)||u(m.left)||u(e.padding?.all)||u(e.padding?.left),mobilePaddingRight:u(m.all)||u(m.right)||u(e.padding?.all)||u(e.padding?.right),mobilePaddingBottom:u(m.all)||u(m.bottom)||u(e.padding?.all)||u(e.padding?.bottom),mobilePaddingTopBottom:u(m.top)||u(m.bottom)||u(e.padding?.top)||u(e.padding?.bottom),mobilePaddingLeftRight:u(m.left)||u(m.right)||u(e.padding?.left)||u(e.padding?.right),mobileTextAlign:Pr(e.mobileTextAlign,e.textAlign),exportAsPicture:e?.exportAsPicture,mobileFontSize:u(e.mobileFontSize?.value||e.fontSize)}),!u(e.borderRadius?.all)&&(u(e.borderRadius?.topLeft)||u(e.borderRadius?.bottomLeft)||u(e.borderRadius?.topRight)||u(e.borderRadius?.bottomRight))?k(!1):k(!0),!u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))||u(e.mobileBorderRadius.all)&&(u(e.mobileBorderRadius.topLeft)||u(e.mobileBorderRadius.bottomLeft)||u(e.mobileBorderRadius.topRight)||u(e.mobileBorderRadius.bottomRight))||!u(e.borderRadius.all)&&!u(e.mobileBorderRadius.all)&&(u(e.borderRadius.topLeft)||u(e.borderRadius.bottomLeft)||u(e.borderRadius.topRight)||u(e.borderRadius.bottomRight))?h(!1):h(!0),w(e.backgroundImage?.[0].value===""),!u(e.padding?.all)&&(u(e.padding?.top)||u(e.padding?.right)||u(e.padding?.bottom)||u(e.padding?.left))&&(e.padding?.top!==e.padding?.bottom||e.padding?.right!==e.padding?.left)?U(!1):U(!0),!u(m.all)&&(u(m.top)||u(m.right)||u(m.bottom)||u(m.left))&&(m.top!==m.bottom||m.right!==m.left)||!u(e.padding?.all)&&(u(e.padding?.top)||u(e.padding?.right)||u(e.padding?.bottom)||u(e.padding?.left))&&(e.padding?.top!==e.padding?.bottom||e.padding?.right!==e.padding?.left)?L(!1):L(!0);const ze=a.isStaleBorderSnapshot(e,!!Me),co=d.isStaleBorderSnapshot(e,!!He);ze&&s.setFieldsValue({border:r.RESET_BORDER_PARAMS,borderAll:null,borderTop:null,borderBottom:null,borderRight:null,borderLeft:null}),(co||ze&&!He)&&s.setFieldsValue({mobileBorder:r.RESET_BORDER_PARAMS,mobileBorderAll:null,mobileBorderTop:null,mobileBorderBottom:null,mobileBorderRight:null,mobileBorderLeft:null}),G(so=>Me&&!ze?!0:so),te(so=>Me&&!ze||He&&!co?!0:so),he(!!e.borderRadius?.all||!!e.borderRadius?.topLeft||!!e.borderRadius?.bottomLeft||!!e.borderRadius?.topRight||!!e.borderRadius?.bottomRight),ae(!!e.mobileBorderRadius?.all||!!e.mobileBorderRadius?.topLeft||!!e.mobileBorderRadius?.bottomLeft||!!e.mobileBorderRadius?.topRight||!!e.mobileBorderRadius?.bottomRight||!!e.borderRadius?.all||!!e.borderRadius?.topLeft||!!e.borderRadius?.bottomLeft||!!e.borderRadius?.topRight||!!e.borderRadius?.bottomRight),Ce(!!e.boxShadow),Fe(!!e.mobileBoxShadow?.blurRadius||!!e.mobileBoxShadow?.color||!!e.mobileBoxShadow?.hOffset||!!e.mobileBoxShadow?.inset||!!e.mobileBoxShadow?.spreadRadius||!!e.mobileBoxShadow?.vOffset||!!e.boxShadow),re(!!e.mobileWidth?.value||!!e.mobileHeight?.value||!!e.width.value||!!e.height.value),ce(!!e.backgroundColor||!!e.backgroundImage?.[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||e.backgroundRepeat!=="repeat"||!e.backgroundRepeat,!!e.backgroundSize),me(!!e.mobileBackgroundColor?.value||!!e.backgroundColor||!!e.backgroundImage?.[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||e.backgroundRepeat!=="repeat"||!e.backgroundRepeat,!!e.backgroundSize),kt(e)&&me(!0),Z(!!e.padding?.all||!!e.padding?.top||!!e.padding?.bottom||!!e.padding?.left||!!e.padding?.right),W(!!e.mobilePadding?.all||!!e.mobilePadding?.top||!!e.mobilePadding?.bottom||!!e.mobilePadding?.left||!!e.mobilePadding?.right||!!e.padding?.all||!!e.padding?.top||!!e.padding?.bottom||!!e.padding?.left||!!e.padding?.right)}},[s,e,j,Me,He,a,d,D]);const ie=(0,n.useCallback)(S=>{Y(S),c(Te==="email"?r.setElementSettings$1(S):r.setElementSettings(S))},[c,Te,Y]),Ee=S=>{const m=s.getFieldsValue(!0),F=Object.keys(S)[0];let H;switch(se(s.getFieldsValue(!0).widthDim==="%"?100:""),F){case"exportAsPicture":H={exportAsPicture:m.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":H={boxShadow:{hOffset:m.boxShadowHOffset,vOffset:m.boxShadowVOffset,blurRadius:m.boxShadowBlurRadius,spreadRadius:m.boxShadowSpreadRadius,color:m.boxShadowColor,inset:m.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":m.borderPosition==="borderAll"?(H={border:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...m.borderAll}}},s.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER})):m.borderAll?.width||m.borderAll?.style||m.borderAll?.color?(H={border:{all:null,left:m.borderAll,right:m.borderAll,top:m.borderAll,bottom:m.borderAll,[z.REVERSE_BORDER_POSITIONS[F]]:{...m[F],...S[F]}}},s.setFieldsValue({borderAll:null,borderLeft:m.borderAll,borderRight:m.borderAll,borderTop:m.borderAll,borderBottom:m.borderAll,[F]:{...m[F],...S[F]}})):(H={border:{all:null,left:m.borderLeft,right:m.borderRight,top:m.borderTop,bottom:m.borderBottom,[z.REVERSE_BORDER_POSITIONS[F]]:{...m[F],...S[F]}}},s.setFieldsValue({border:H.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":if(m.mobileBorderPosition==="mobileBorderAll")H={mobileBorder:{...r.RESET_BORDER_PARAMS,all:{...z.NULL_BORDER,...m.mobileBorderAll,classNamePrefix:"em-mob-border_"+z.MOBILE_REVERSE_BORDER_POSITIONS[F]+"-"}}},s.setFieldsValue({borderLeft:z.NULL_BORDER,borderRight:z.NULL_BORDER,borderTop:z.NULL_BORDER,borderBottom:z.NULL_BORDER});else{const ze=z.MOBILE_REVERSE_BORDER_POSITIONS[F],co={...m[F],...S[F]},so=!co?.width&&!co?.style&&!co?.color;if(m.mobileBorder?.all?.width||m.mobileBorder?.all?.style||m.mobileBorder?.all?.color){const mo=m.mobileBorderAll;H={mobileBorder:{all:null,left:mo,right:mo,top:mo,bottom:mo,[ze]:so?null:{...co,classNamePrefix:"em-mob-border_"+ze+"-"}}},s.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:mo,mobileBorderRight:mo,mobileBorderTop:mo,mobileBorderBottom:mo,[F]:co})}else{const mo=e.mobileBorder||{},ko=qo=>{const Co=mo[qo];return Co&&(Co?.width||Co?.style||Co?.color)?Co:null};H={mobileBorder:{all:null,left:ze==="left"?so?null:{...co,classNamePrefix:"em-mob-border_left-"}:ko("left"),right:ze==="right"?so?null:{...co,classNamePrefix:"em-mob-border_right-"}:ko("right"),top:ze==="top"?so?null:{...co,classNamePrefix:"em-mob-border_top-"}:ko("top"),bottom:ze==="bottom"?so?null:{...co,classNamePrefix:"em-mob-border_bottom-"}:ko("bottom")}},s.setFieldsValue({[F]:co})}}break;case"width":H={[F]:{value:S[F],dim:m.widthDim}};break;case"height":H={[F]:{value:S[F],dim:m.heightDim}};break;case"widthDim":H={width:{value:m.width,dim:S[F]}};break;case"heightDim":H={height:{value:m.height,dim:S[F]}};break;case"backgroundImage":w(S[F]===""),H={[F]:[{...e.backgroundImage[0],value:S[F]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":H={padding:{left:m.paddingLeft,right:m.paddingRight,top:m.paddingTop,bottom:m.paddingBottom,[z.PADDING_POSITION[F]]:+S[F]}};break;case"paddingTopBottom":H={padding:{left:m.paddingLeft,right:m.paddingRight,top:+S[F],bottom:+S[F]}},m.paddingTop=m.paddingBottom=+S[F];break;case"paddingLeftRight":H={padding:{top:m.paddingTop,bottom:m.paddingBottom,left:+S[F],right:+S[F]}},m.paddingLeft=m.paddingRight=+S[F];break;case"borderRadiusAll":H={borderRadius:{[z.BORDER_RADIUS_POSITION[F]]:+S[F]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":H={borderRadius:{topLeft:m.borderRadiusTopLeft,bottomLeft:m.borderRadiusBottomLeft,topRight:m.borderRadiusTopRight,bottomRight:m.borderRadiusBottomRight,[z.BORDER_RADIUS_POSITION[F]]:+S[F]}};break;case"mobileWidth":H={[F]:{classNamePrefix:"em-mob-width-",value:S[F],dim:m.mobileWidthDim}};break;case"mobileWidthDim":H={mobileWidth:{classNamePrefix:"em-mob-width-",value:m.mobileWidth||100,dim:S[F]}};break;case"mobileHeight":H={[F]:{classNamePrefix:"em-mob-height-",value:S[F],dim:m.mobileHeightDim},mobileLineHeight:{classNamePrefix:"em-mob-line_height-",value:S[F],dim:m.mobileHeightDim}};break;case"mobileHeightDim":H={mobileHeight:{classNamePrefix:"em-mob-height-",value:m.mobileHeight,dim:S[F]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":H={mobileBorderRadius:{[z.MOBILE_BORDER_RADIUS_POSITION[F]]:S[F],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[F]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":H={mobileBoxShadow:{hOffset:m.mobileBoxShadowHOffset,vOffset:m.mobileBoxShadowVOffset,blurRadius:m.mobileBoxShadowBlurRadius,spreadRadius:m.mobileBoxShadowSpreadRadius,color:m.mobileBoxShadowColor,inset:m.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":H={[F]:{classNamePrefix:"em-mob-table_align-",value:S[F]}};break;case"mobileTextAlign":H={[F]:{classNamePrefix:"em-mob-text_align-",value:S[F]}};break;case"mobileVerticalAlign":H={[F]:{classNamePrefix:"em-mob-vertical_align-",value:S[F]}};break;case"mobileBackgroundColor":case"mobileBackgroundImage":case"mobileBackgroundPositionX":case"mobileBackgroundPositionY":case"mobileBackgroundRepeat":case"mobileBackgroundSize":if(H=_t(S),!H)return;break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":H={mobilePadding:{all:null,top:m.mobilePaddingTop!==""?m.mobilePaddingTop:null,right:m.mobilePaddingRight!==""?m.mobilePaddingRight:null,bottom:m.mobilePaddingBottom!==""?m.mobilePaddingBottom:null,left:m.mobilePaddingLeft!==""?m.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":m.mobilePaddingTop=m.mobilePaddingBottom=S[F],H={mobilePadding:{all:null,top:m.mobilePaddingTop!==""?m.mobilePaddingTop:null,right:m.mobilePaddingRight!==""?m.mobilePaddingRight:null,bottom:m.mobilePaddingBottom!==""?m.mobilePaddingBottom:null,left:m.mobilePaddingLeft!==""?m.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":m.mobilePaddingLeft=m.mobilePaddingRight=S[F],H={mobilePadding:{all:null,top:m.mobilePaddingTop!==""?m.mobilePaddingTop:null,right:m.mobilePaddingRight!==""?m.mobilePaddingRight:null,bottom:m.mobilePaddingBottom!==""?m.mobilePaddingBottom:null,left:m.mobilePaddingLeft!==""?m.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileFontSize":H={[F]:{classNamePrefix:"em-mob-font_size-",value:S[F],dim:m.mobileFontSizeDim}};break;case"href":let Re=ot(S[F]);Re!==S[F]&&(s.setFieldValue("href",Re),m.href=Re),Re.startsWith("mailto:")?H={[F]:Si(Re,m.subject,m.body)}:H={[F]:Re},Wo(S[F],ge);break;case"subject":case"body":const pe=m.href||"";if(pe.startsWith("mailto:")){const ze=F==="subject"?S[F]:m.subject,co=F==="body"?S[F]:m.body;H={href:Si(pe,ze,co)}}else return;break;case"backgroundPositionX":case"backgroundPositionY":H={[F]:isNaN(parseFloat(S[F].position))?S[F].position:S[F].position+S[F].unit};break;default:H=S}F!=="borderPosition"&&F!=="mobileBorderPosition"&&(l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:H}),F!=="mobileBorderRadiusAll"&&F!=="mobileBorderRadiusTopLeft"&&F!=="mobileBorderRadiusTopRight"&&F!=="mobileBorderRadiusBottomLeft"&&F!=="mobileBorderRadiusBottomRight"&&ie({...e,...H,mobileBorderRadius:{...e.mobileBorderRadius,...H?.mobileBorderRadius},activateSection:null,changeKey:F}))},Ae=()=>{U(m=>!m);const S=s.getFieldsValue(!0);K||(S.paddingLeftRight=S.paddingLeft,S.paddingTopBottom=S.paddingTop,S.paddingRight=S.paddingLeft,S.paddingBottom=S.paddingTop,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:S.paddingTopBottom,bottom:S.paddingTopBottom,left:S.paddingLeftRight,right:S.paddingLeftRight}}}))},We=()=>{const S=s.getFieldsValue(!0);a.markBorderToggled(!R),setTimeout(()=>{G(m=>!m),R?(S.borderAll=z.NULL_BORDER,S.borderTop=z.NULL_BORDER,S.borderBottom=z.NULL_BORDER,S.borderRight=z.NULL_BORDER,S.borderLeft=z.NULL_BORDER):S.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:S.borderAll.color,style:S.borderAll.style,width:S.borderAll.width}}}})})},Ge=()=>{const S=s.getFieldsValue(!0);d.markBorderToggled(!J),setTimeout(()=>{te(m=>!m),J?(S.mobileBorderAll=z.NULL_BORDER,S.mobileBorderTop=z.NULL_BORDER,S.mobileBorderBottom=z.NULL_BORDER,S.mobileBorderRight=z.NULL_BORDER,S.mobileBorderLeft=z.NULL_BORDER):S.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:S.mobileBorderAll.color,style:S.mobileBorderAll.style,width:S.mobileBorderAll.width}}}})})},Ye=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{he(m=>!m),oe?(S.borderRadiusAll=0,k(!0)):S.borderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:S.borderRadiusAll}}})})},$=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{ae(m=>!m),be?(S.mobileBorderRadiusAll=null,h(!0)):S.mobileBorderRadiusAll=5,l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:S.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})})},N=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{Ce(m=>!m),ke?(S.boxShadowInset=!1,S.boxShadowHOffset=null,S.boxShadowVOffset=null,S.boxShadowBlurRadius=null,S.boxShadowSpreadRadius=null,S.boxShadowColor=""):(S.boxShadowInset=!1,S.boxShadowHOffset=5,S.boxShadowVOffset=5,S.boxShadowBlurRadius=10,S.boxShadowSpreadRadius=-5,S.boxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:S.boxShadowBlurRadius,color:S.boxShadowColor,hOffset:S.boxShadowHOffset,inset:S.boxShadowInset,spreadRadius:S.boxShadowSpreadRadius,vOffset:S.boxShadowVOffset}}})})},y=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{Fe(m=>!m),de?(S.mobileBoxShadowInset=!1,S.mobileBoxShadowHOffset=null,S.mobileBoxShadowVOffset=null,S.mobileBoxShadowBlurRadius=null,S.mobileBoxShadowSpreadRadius=null,S.mobileBoxShadowColor=""):(S.mobileBoxShadowInset=!1,S.mobileBoxShadowHOffset=5,S.mobileBoxShadowVOffset=5,S.mobileBoxShadowBlurRadius=10,S.mobileBoxShadowSpreadRadius=-5,S.mobileBoxShadowColor="#000000"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:S.mobileBoxShadowBlurRadius,color:S.mobileBoxShadowColor,hOffset:S.mobileBoxShadowHOffset,inset:S.mobileBoxShadowInset,spreadRadius:S.mobileBoxShadowSpreadRadius,vOffset:S.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})},M=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{re(m=>!m),je&&(S.mobileWidth="",S.mobileHeight="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))})},fe=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{ce(m=>!m),Be?(S.backgroundColor="",S.backgroundImage="",S.backgroundPositionX="",S.backgroundPositionY="",S.backgroundRepeat="none",S.backgroundSize="",w(!0)):(S.backgroundColor="#E5E5E5",S.backgroundSize="",S.backgroundRepeat="none"),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:S.backgroundColor,backgroundImage:[{type:"url",value:S.backgroundImage}],backgroundPositionX:S.backgroundPositionX,backgroundPositionY:S.backgroundPositionY,backgroundRepeat:S.backgroundRepeat,backgroundSize:S.backgroundSize}})})},Le=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{me(m=>!m),ee?S.mobileBackgroundColor="":S.mobileBackgroundColor=e.commonStyles.buttons.backgroundColor||"#1C52DC",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:S.mobileBackgroundColor}}}),ee&&Et(s,e,l)})},eo=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{Z(m=>!m),ue&&(S.paddingLeftRight="",S.paddingLeft="",S.paddingRight="",S.paddingTopBottom="",S.paddingTop="",S.paddingBottom="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))})},Xe=()=>{const S=s.getFieldsValue(!0);setTimeout(()=>{W(m=>!m),Q&&(S.mobilePaddingLeftRight="",S.mobilePaddingLeft="",S.mobilePaddingRight="",S.mobilePaddingTopBottom="",S.mobilePaddingTop="",S.mobilePaddingBottom="",l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))})},lo=S=>{s.setFieldValue("href",S!=="mergetag"?S:""),ge(S)},Qe=({target:S})=>{const{selectionStart:m,selectionEnd:F}=S;S&&ye({target:S,selection:{start:m,end:F}})},uo=S=>{S.target.value!==""&&I.current.classList.add("selected-td-form__button--active")},Eo=()=>{ne(!X),X?(s.setFieldValue("textReplacer",""),l({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{textReplacer:""}})):setTimeout(()=>C.current.focus())},B=S=>{const m=S.target,F=m.value,H=m.selectionStart;if(H===0&&S.key===" "){S.preventDefault();return}if(S.key===" "){if(H!==F.length){S.preventDefault();return}F.endsWith(" ")&&S.preventDefault()}};return(0,o.jsxs)(t.ui_kit$Form,{form:s,layout:"vertical",name:"selected_button_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:z.BORDER_POSITIONS[Me]||"borderAll",mobileBorderPosition:z.MOBILE_BORDER_POSITIONS[He]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",href:"https://",subject:"",body:""},onValuesChange:Ee,autoComplete:"off",className:"element-controls",children:[!j&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),j?(0,o.jsx)(Ri,{form:s,elementSettings:e,showAddParagraph:!1,isButton:!0}):(0,o.jsx)(o.Fragment,{children:T==="mobile"&&_.styles?(0,o.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:(0,o.jsx)(hl,{form:s,fillFields:D,elementSettings:e,boxShadow:p,mobileBordersShow:J,mobileBorderRadiusShow:be,mobileBoxShadowShow:de,mobileSizeShow:je,mobileBackgroundShow:ee,mobilePaddingShow:Q,mobilePaddingsExt:O,setMobilePaddingsExt:L,oneMobileBorderRadiusValue:b,setOneMobileBorderRadiusValue:h,linkProtocol:xe,handleLinkProtocolsChange:lo,setLinkProtocol:ge,toggleShowMobileBorderHandler:Ge,toggleShowMobileBorderRadiusHandler:$,toggleShowMobileBoxShadowHandler:y,toggleShowMobileSizeHandler:M,toggleShowMobileBackgroundHandler:Le,toggleShowMobilePaddingHandler:Xe})}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(pl,{form:s,fillFields:D,elementSettings:e,boxShadow:p,bordersShow:R,borderRadiusShow:oe,boxShadowShow:ke,backgroundShow:Be,backgroundImageEmpty:E,backgroundRepeatOptions:Ie,paddingShow:ue,paddingsExt:K,maxWidthValue:q,oneBorderRadiusValue:x,setOneBorderRadiusValue:k,linkProtocol:xe,linkTarget:Ne,isOpenTextReplacer:X,textReplacerButtonRef:I,textReplacerInputRef:C,handleLinkProtocolsChange:lo,handleSelect:Qe,textReplacerInputHandler:uo,handleTextReplacerKeyDown:B,srcButtonHandler:Eo,togglePaddingHandler:Ae,toggleShowPaddingHandler:eo,toggleShowBackgroundHandler:fe,toggleShowBorderHandler:We,toggleShowBorderRadiusHandler:Ye,toggleShowBoxShadowHandler:N,setLinkProtocol:ge,handleChangeValues:Ee})})})]})};bl.propTypes={elementSettings:g.default.object.isRequired};var fl=({elementSettings:e})=>{const{__:i}=r.useI18n(),[l]=t.ui_kit$Form.useForm(),s=r.useSendPostMessage();(0,n.useEffect)(()=>{e&&l.setFieldsValue({...e})},[l,e]);const a=d=>{s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:d})};return(0,o.jsx)(t.ui_kit$Form,{form:l,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:a,autoComplete:"off",children:(0,o.jsx)(t.ui_kit$Form.Item,{label:i("Variable value"),name:"value",tooltip:{title:i("Type the output parameters of your platform. E.g., ")+"${Recipient.FirstName}",icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},style:{marginBottom:35},children:(0,o.jsx)(t.ui_kit$TextArea,{rows:4,placeholder:i("Variable value")})})})};fl.propTypes={elementSettings:g.default.object.isRequired};var gl=({elementSettings:e,setElementSettings:i,postfix:l="",form:s,handleSelect:a,previewReloadSignal:d})=>{const{__:c}=r.useI18n(),{token:p}=(0,t.ui_kit$useToken)(),f=r.useAppConfig(),x=r.useSendPostMessage(),k="src"+l,b="title"+l,h="alt"+l,T="link"+l,_="imgReplacer"+l,E=(0,n.useRef)(null),w=(0,n.useRef)(null),v=(0,n.useRef)(null),P=(0,n.useRef)(null),j=(0,n.useRef)(null),C=(0,n.useRef)(null),I=(0,n.useRef)(null),K=(0,n.useRef)(null),[U,O]=(0,n.useState)(""),[L,R]=(0,n.useState)(""),[G,J]=(0,n.useState)(""),[te,oe]=(0,n.useState)(!1),[he,be]=(0,n.useState)("https://"),ae=(0,n.useRef)(!1),ke=(0,n.useRef)(l);(0,n.useEffect)(()=>{l!==ke.current&&(ke.current=l,ae.current=!1),R(e.images?.[h]),J(e.images?.[b]);const Z=e.images?.[T];O(Z||(ae.current?"...":""))},[e,h,b,T,l]);const Ce=()=>{U?(ae.current=!1,O(""),s.setFieldValue(T,""),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[T]:""}})):(ae.current=!0,O(E.current&&E.current.input.value?E.current.input.value:"..."),setTimeout(()=>{E.current.focus()}))},de=Z=>{Z.target.value===""?O("..."):(w.current.classList.add("selected-td-form__button--active"),O(Z.target.value));const Q=Z.target.value;Wo(Q,be)},Fe=()=>{L?(R(""),s.setFieldValue("alt",""),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[h]:""}})):(R(v.current&&v.current.input.value?v.current.input.value:"..."),setTimeout(()=>{v.current.focus()}))},je=Z=>{Z.target.value===""?R("..."):(P.current.classList.add("selected-td-form__button--active"),R(Z.target.value))},re=()=>{G?(J(!1),s.setFieldValue("title",""),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[b]:""}})):(J(j.current&&j.current.input.value?j.current.input.value:"..."),setTimeout(()=>{j.current.focus()}))},Be=()=>{oe(!te),te?(s.setFieldValue(_,""),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[_]:""}})):setTimeout(()=>I.current.focus())},ce=Z=>{Z.target.value!==""&&K.current.classList.add("selected-td-form__button--active")},ee=Z=>{Z.target.value===""?J("..."):(C.current.classList.add("selected-td-form__button--active"),J(Z.target.value))},me=Z=>{s.setFieldValue("LinkName",Z!=="mergetag"?Z:""),be(Z)},ue=Z=>{const Q=s.getFieldsValue(!0),W=+l.substring(1),q=Object.keys(Q?.images).reduce((xe,ge)=>(ge.includes(l)||(xe[ge]=Q[ge]),xe),{}),se=e.carouselImages?.filter((xe,ge)=>ge!==W);i(xe=>({...xe,settings:{...xe.settings,carouselImages:se}})),x({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.CAROUSEL,caption:e.caption,settings:{...e,carouselImages:se}}),s.setFieldsValue({images:q})};return(0,o.jsxs)(o.Fragment,{children:[(e.type==="img"||e.type==="video"||e.type==="carousel")&&(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:0},children:(0,o.jsx)(No,{form:s,label:c("Image path"),name:k,placeholder:c("Image path"),elementSettings:e,previewReloadSignal:d,tooltipTitle:""})}),(0,o.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,o.jsxs)(t.ui_kit$Space,{size:8,children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:L||c("Alternative text"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!L}),onClick:Fe,ref:P,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"})})}),f.formFieldImageTitleEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:G||c("Tooltip text"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!G}),onClick:re,ref:C,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"})})}),(0,o.jsx)(t.ui_kit$Tooltip,{title:U||c("Hyperlink URL"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":!!U}),icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-td-form__icon-radius"}),onClick:Ce,ref:w})}),(0,o.jsx)(t.ui_kit$Tooltip,{title:c("Image replacer"),placement:"bottom",getPopupContainer:Z=>Z.closest(".email-pane__collapse-wrapper"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":te}),icon:(0,o.jsx)(r.EmIcons,{icon:"Replacer",component:t.icons$Replacer,className:"selected-td-form__icon-radius"}),onClick:Be,ref:K})})]}),(0,o.jsx)(t.ui_kit$Space,{size:8,children:(0,o.jsx)(t.ui_kit$Tooltip,{title:c("Remove slide"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Button,{type:"text",onClick:ue,icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:16})})})})]}),(!!U||!!L||!!G||!!te)&&(0,o.jsxs)("div",{children:[!!U&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(et,{show:he==="#",__:c,style:{marginBottom:p.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Hyperlink URL"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:T,className:"selected-image-form__alt",style:{marginTop:p.formItemMarginBottomXS,marginBottom:0},children:(0,o.jsx)(t.ui_kit$Input,{addonBefore:(0,o.jsx)(Zo,{linkProtocol:he,handleLinkProtocolsChange:me,__:c}),placeholder:c("Hyperlink URL"),allowClear:!0,ref:E,onChange:de,onSelect:a,prefix:(0,o.jsx)(Qo,{linkProtocol:he})})})})]}),!!L&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Alternative text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:h,className:"selected-image-form__alt",style:{marginTop:p.formItemMarginBottomXS,marginBottom:0},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:c("Alternative text"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"}),onChange:je,ref:v,onSelect:a})})}),f.formFieldImageTitleEnabled&&!!G&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Tooltip text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:b,className:"selected-image-form__alt",style:{marginTop:p.formItemMarginBottomXS,marginBottom:0},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:c("Enter the title of the image"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"}),onChange:ee,ref:j,onSelect:a})})}),!!te&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Image src"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:_,className:"selected-image-form__alt",style:{marginTop:p.formItemMarginBottomXS,marginBottom:0},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:c("Code that will replace the image `src`"),allowClear:!0,prefix:(0,o.jsx)("span",{className:"addon-text-content",children:c("Image src")}),onChange:ce,ref:I,onSelect:a})})})]})]})};gl.propTypes={};var _l=({form:e,elementSettings:i,formFields:l,setElementSettings:s,borderRadiusShow:a,oneBorderRadiusValue:d,setOneBorderRadiusValue:c,linkProtocol:p,mergeTagItems:f,mergeMenuOpen:x,setMergeMenuOpen:k,cascaderRef:b,handleLinkProtocolsChange:h,handleSelect:T,onChange:_,filter:E,renderSearchOption:w,toggleShowBorderRadiusHandler:v,setNewSlide:P})=>{const{__:j}=r.useI18n(),{token:C}=(0,t.ui_kit$useToken)(),I=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(et,{show:p==="#",__:j,style:{marginBottom:C.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:j("Link for all slides"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"link",children:(0,o.jsx)(t.ui_kit$Input,{addonBefore:(0,o.jsx)(Zo,{linkProtocol:p,handleLinkProtocolsChange:h,__:j}),placeholder:j("Link for all slides"),allowClear:!0,onSelect:T,prefix:(0,o.jsx)(Qo,{linkProtocol:p})})})}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"}),I.mergeTagsShow&&f&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Col,{span:24,id:"merge_tags_wrapper",children:(0,o.jsxs)(t.ui_kit$Form.Item,{style:{marginBottom:C.formItemMarginBottomMD,marginTop:C.formItemMarginBottomMD},children:[(0,o.jsx)(t.ui_kit$Button,{id:"merge_tags_button",icon:(0,o.jsx)(r.EmIcons,{icon:"MergeTags",component:t.icons$MergeTags}),style:{width:"100%",display:x?"none":"inline-flex"},onClick:()=>k(!0),children:j("Merge tags")}),(0,o.jsx)(t.ui_kit$Cascader,{ref:b,classNames:{popup:{root:"merge-tags"}},options:f,placeholder:j("Start typing the title"),showSearch:{filter:E,render:w},spellCheck:"false",getPopupContainer:K=>K.closest(".email-pane__collapse-wrapper"),onChange:_,style:{display:x?"block":"none"},open:x,onKeyDown:K=>{K.key==="Escape"&&k(!1)}})]})}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"})]}),(0,o.jsx)(t.ui_kit$Form.List,{name:"images",initialValue:l?.images,children:()=>(0,o.jsx)("div",{style:{paddingTop:C.formItemMarginBottomMD+4},children:i?.settings?.carouselImages?.map((K,U)=>(0,o.jsx)("div",{className:"carousel__slide",children:(0,o.jsx)(gl,{elementSettings:l,setElementSettings:s,postfix:"_"+U,form:e,handleSelect:T})},U))})}),(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:C.formItemMarginBottomMD},children:(0,o.jsx)(t.ui_kit$Button,{id:"add_slide_button",icon:(0,o.jsx)(r.EmIcons,{icon:"AddSlide",component:t.icons$AddSlide}),style:{width:"100%"},onClick:()=>P(),children:j("Add slide")})})}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:20,style:{marginTop:C.formItemMarginBottomMD-10},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"loop",valuePropName:"checked",style:{marginBottom:C.formItemMarginBottomMD-6},children:(0,o.jsx)(t.ui_kit$Switch,{id:"Loop",label:j("Loop"),size:"small",labelStyle:{position:"relative",top:2}})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"autoplay",valuePropName:"checked",style:{marginBottom:C.formItemMarginBottomMD-6},children:(0,o.jsx)(t.ui_kit$Switch,{id:"Autoplay",label:j("Autoplay"),size:"small",labelStyle:{position:"relative",top:2}})})})]}),I.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:j("Border radius"),collapsible:!0,open:a,onToggle:v,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:d,setOneBorderRadiusValue:c,elementSettings:i.settings})})]})};_l.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,formFields:g.default.object,setElementSettings:g.default.func,borderRadiusShow:g.default.bool,oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,linkProtocol:g.default.string,mergeTagItems:g.default.array,mergeMenuOpen:g.default.bool,setMergeMenuOpen:g.default.func,cascaderRef:g.default.object,handleLinkProtocolsChange:g.default.func,handleSelect:g.default.func,onChange:g.default.func,filter:g.default.func,renderSearchOption:g.default.func,toggleShowBorderRadiusHandler:g.default.func,setNewSlide:g.default.func};var xl=()=>{const{__:e}=r.useI18n();return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("p",{children:e("No properties to edit.")})})};xl.propTypes={};var kl=2e3;function An(e){const i=(0,n.useRef)([]),l=(0,n.useRef)(e);return l.current=e,{remember:(0,n.useCallback)(s=>{const a=Date.now(),d=i.current.filter(c=>a-c.at<kl);d.push({key:JSON.stringify(l.current(s)),at:a}),i.current=d.slice(-10)},[]),isOwnEcho:(0,n.useCallback)(s=>{if(!s)return!1;const a=Date.now(),d=JSON.stringify(l.current(s));return i.current.some(c=>a-c.at<kl&&c.key===d)},[])}}function Nn(e,i){const l=`selected_${e}_form_images_`,s=i.startsWith(l)?l:`selected_${e}_form_`;return i.startsWith(s)?i.slice(s.length):i}function Ln(e){const i=/^(.+)_(\d+)$/.exec(e);return i?{key:i[1],index:Number(i[2])}:void 0}function On(e,i,l){return(e??[]).map((s,a)=>a===i.index?{...s,[i.key]:l}:s)}var $n={loop:!1,autoplay:!1,borderRadiusAll:0,borderRadiusTopLeft:0,borderRadiusBottomLeft:0,borderRadiusTopRight:0,borderRadiusBottomRight:0,link:"https://",images:{},src_0:"",renderedHeight_0:0,renderedWidth_0:0,imgReplacer_0:"",title_0:"",alt_0:""};function Fn(e){const i={...Ti(e)};return delete i.parent,delete i.path,i}var El=({elementSettings:e})=>{const{__:i}=r.useI18n(),[l]=t.ui_kit$Form.useForm();let s=r.useDispatch();r.useAppConfig();const a=r.useSendPostMessageEx(),d=r.useSendPostMessage(),{openImagePicker:c}=r.useImagePicker(),p=r.useSelector(r.selectEmailViewType),f=r.useSelector(r.selectMobileViewActive),[x,k]=(0,n.useState)(!0),[b,h]=(0,n.useState)(!0),[T,_]=(0,n.useState)(!1),[E,w]=(0,n.useState)(!1),[v,P]=(0,n.useState)("https://"),[j,C]=(0,n.useState)(l?.getFieldsValue(!0)),[I,K]=(0,n.useState)(e),{remember:U,isOwnEcho:O}=An(Fn),[L,R]=(0,n.useState)(e);e!==L&&(R(e),O(e?.settings)||K(e));const[G,J]=(0,n.useState)({name:"",counter:0}),[te,oe]=(0,n.useState)(null),[he,be]=(0,n.useState)(),[ae,ke]=(0,n.useState)(!1),[Ce,de]=(0,n.useState)(!1),[Fe,je]=(0,n.useState)({start:0,end:0}),re=(0,n.useRef)(null),Be=`selected_${I.type}_form_link`,ce=r.useSelector(r.selectIsCodeMode),ee=r.useSelector(r.selectCodeModeDirection),me=ce&&ee!=="bottom";(0,n.useEffect)(()=>{ae&&re.current&&re.current.focus()},[ae]);const ue=(V,Te)=>{const Ie=document.getElementById(Te);if(Ie){const ve=I,Ve=Nn(ve.type,Te),Me=Ln(Ve),He=Ie.value?.substring(0,Fe.start),le=Ie.value?.substring(Fe.end);let Y={[Ve]:He+V+le};Me?Y={carouselImages:On(ve.settings?.carouselImages,Me,He+V+le)}:I.type===r.ELEMENT_TYPES.CAROUSEL&&Be===Te&&(Y={[Ve]:He+V+le,carouselImages:[...I.settings?.carouselImages.map(D=>({...D,link:He+V+le}))||[]]}),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.CAROUSEL,settings:{...I.settings,...Y}}),K(D=>({...D,settings:{...D.settings,...Y}})),l.setFieldValue(Ve,He+V+le),Ie.focus(),setTimeout(()=>{Ie.selectionStart=Fe.start,Ie.selectionEnd=Fe.start+V.length},400),de(!0)}},Z=r.useAppConfig().mergeTags;(0,n.useEffect)(()=>{Z?.items?.length&&be(r.mapMargeTags(Z.items,i,(V,Te)=>{ke(!1),a(r.EVENT_TYPES.SANDBOX_ADD_MERGETAG,V),Te.stopPropagation(),Te.preventDefault()}))},[Z,be,i,ke,a]);const Q=(V,Te)=>{if(ke(!1),V){const Ie=Z.syntax.length>1?he.findIndex(Me=>Me.key===Te[0].key):0,ve=Z.syntax[Ie].replace("%value%",V[V.length-1]),Ve=`selected_${I.type}_form${I.type==="carousel"?"_images":""}`;["imgReplacer","title","alt","src","link"].some(Me=>te?.getAttribute("id").includes(`${Ve}_${Me}`))||te?.getAttribute("id").includes(Be)?ue(ve,te?.getAttribute("id")):(l.setFieldValue("imgReplacer",ve),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.CAROUSEL,settings:{...I.settings,imgReplacer:ve}}),K(Me=>({...Me,settings:{...Me.settings,imgReplacer:ve}})))}},W=r.useRootElement();(0,n.useEffect)(()=>{const V=({target:ve})=>{ve.closest('[id="merge_tags_wrapper"]')||oe(ve)},Te=({target:ve})=>{!ve.closest(".merge-tags")&&!ve.closest("#merge_tags_button")&&ke(!1)},Ie=new xo.Disposable;return Ie.addDisposable(r.addWindowListenerFromShadow(W,"focusin",V)),Ie.addDisposable(r.addWindowListenerFromShadow(W,"click",Te)),()=>{Ie.dispose()}},[W]);const q=(V,Te)=>Te.some(Ie=>Ie.label.toLowerCase().indexOf(V.toLowerCase())>-1),se=(V,Te)=>{const Ie=Te.map((ve,Ve)=>{const Me=ve.label.split(new RegExp(`(${V})`,"gi"));return(0,o.jsxs)("span",{children:[Ve!==0&&(0,o.jsx)("span",{children:" / "}),Me.map((He,le)=>He.toLowerCase()===V.toLowerCase()?(0,o.jsx)("span",{style:{color:"red"},children:He},le):He)]},ve.value)});return(0,o.jsx)("div",{title:Te.map(ve=>ve.label).join(" / "),children:Ie})};(0,n.useEffect)(()=>{const V=l?.getFieldsValue(!0);C(V)},[l]);const xe=({target:V})=>{if(V&&!Ce){const{selectionStart:Te,selectionEnd:Ie}=V;je({start:Te,end:Ie})}de(!1)};(0,n.useEffect)(()=>{if(I.settings){const V=I.settings,Te=Ti(V);l?.setFieldsValue(Te),C(Te),V.link&&P(Mt(V.link,"https://")),u(V.borderRadius?.all)||(u(V.borderRadius?.topLeft)||u(V.borderRadius?.bottomLeft)||u(V.borderRadius?.topRight)||u(V.borderRadius?.bottomRight)?k(!1):u(V.borderRadius?.all)||k(!0)),u(V.mobileBorderRadius?.topLeft)||u(V.mobileBorderRadius?.bottomLeft)||u(V.mobileBorderRadius?.topRight)||u(V.mobileBorderRadius?.bottomRight)?h(!1):h(!0),_(!!V.borderRadius?.all||!!V.borderRadius?.topLeft||!!V.borderRadius?.bottomLeft||!!V.borderRadius?.topRight||!!V.borderRadius?.bottomRight),w(!!V.mobileBorderRadius?.all||!!V.mobileBorderRadius?.topLeft||!!V.mobileBorderRadius?.bottomLeft||!!V.mobileBorderRadius?.topRight||!!V.mobileBorderRadius?.bottomRight)}},[l,I]);const ge=V=>{const Te=Ar(I.settings,l,V);d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.CAROUSEL,caption:Te.caption,settings:Te}),U({...I.settings,...Te}),K(Ie=>({...Ie,settings:{...Ie.settings,...Te}}))},Ne=(V,Te)=>{const Ie=r.stripEmVersionFromUrlString(I.settings?.src||"")===r.stripEmVersionFromUrlString(V||"");(!Ie||V!==I.settings?.src)&&ge({src:V}),Te?.mode==="save"&&Ie&&(J(ve=>({name:"src",counter:ve.counter+1})),a(r.EVENT_TYPES.SANDBOX_IMAGE_RESET,{url:String(V)}))},ye=async V=>{const Te=I.settings?.src||"",Ie=r.stripEmVersionFromUrlString(Te),ve=await c({kind:"img",currentUrl:$t(Ie)?"":Ie,entryModal:V});ve?.url&&Ne(ve.url,ve.meta)},$e=V=>{const Te=V.data.operation;Te===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_AI_POPUP?ye(r.MODALS.UPLOAD_IMAGE_MODAL_AI):Te===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?ye(r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD):Te===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_EDIT_POPUP?ye(r.MODALS.UPLOAD_IMAGE_MODAL_EDIT):Te===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_GIF_POPUP?ye(r.MODALS.UPLOAD_IMAGE_MODAL_GIF):Te===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_STOCK_POPUP?ye(r.MODALS.UPLOAD_IMAGE_MODAL_STOCK):Te===r.EVENT_TYPES.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(s(r.closeSecondModal()),s(r.closeModal$1()))};r.useListenPostMessage($e);const X=()=>{setTimeout(()=>{_(V=>!V),l.setFieldValue("borderRadiusAll",T?0:5),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.CAROUSEL,settings:{...I.settings,borderRadius:{all:T?"":5}}}),K(V=>({...V,settings:{...V.settings,borderRadius:{all:T?null:5}}}))})},ne=V=>{l.setFieldValue("link",V!=="mergetag"?V:""),P(V)},we=()=>{const{width:V,height:Te,renderedWidth:Ie,renderedHeight:ve}=I?.settings?.carouselImages[0]||{width:{value:600},height:{value:600},renderedWidth:600,renderedHeight:600},Ve={src:"https://emcdn.ru/1865/231031_17_BGU9Mso.png",width:{value:V.value,dim:"px"},height:{value:Te.value,dim:"px"},alt:"",title:"",link:null,renderedWidth:Ie,renderedHeight:ve,imgReplacer:"",mobileWidth:{value:null,dim:"px"},mobileHeight:{value:null,dim:"px"},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}},Me=[...I?.settings?.carouselImages,Ve];d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.CAROUSEL,settings:{...I.settings,carouselImages:Me}}),K(He=>({...He,settings:{...He.settings,carouselImages:Me}}))};return(0,o.jsxs)(t.ui_kit$Form,{form:l,layout:"vertical",name:"selected_carousel_form",initialValues:$n,onValuesChange:ge,autoComplete:"off",className:"element-controls",children:[!me&&(0,o.jsx)(t.ui_kit$Tooltip,{title:i("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:i("Appearance on mobile devices"),type:"info"})}),p==="mobile"&&f.styles?(0,o.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:(0,o.jsx)(xl,{})}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(_l,{form:l,elementSettings:I,formFields:j,setElementSettings:K,borderRadiusShow:T,oneBorderRadiusValue:x,setOneBorderRadiusValue:k,linkProtocol:v,mergeTagItems:he,mergeMenuOpen:ae,setMergeMenuOpen:ke,cascaderRef:re,handleLinkProtocolsChange:ne,handleSelect:xe,onChange:Q,filter:q,renderSearchOption:se,toggleShowBorderRadiusHandler:X,setNewSlide:we})})]})};El.propTypes={};var Mn={animate:!0,expandSingleSection:!0,sections:[{expanded:!1,index:0}]},Bl=({elementSettings:e})=>{const{__:i}=r.useI18n(),{token:l}=(0,t.ui_kit$useToken)(),[s]=t.ui_kit$Form.useForm(),a=r.useSendPostMessage(),d=r.useAppConfig(),[c,p]=(0,n.useState)(e),[f,x]=(0,n.useState)(e);e!==f&&(x(e),p(e)),(0,n.useEffect)(()=>{if(c.settings){const T=c.settings,_=Ti(T);s?.setFieldsValue(_)}},[s,c]);const k=T=>{const _=Ar(c.settings,s,T);a({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:c.type,caption:_.caption,settings:_}),p(E=>({...E,settings:{...E.settings,..._}}))},b=()=>{p(T=>({...T,sections:c?.settings?.sections.push({expanded:!1})})),a({operation:r.EVENT_TYPES.SANDBOX_ACCORDION_ADD_SECTION,settings:{section:i("Section title"),text:i("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}})},h=T=>{p(_=>({..._,settings:{..._.settings,sections:c.settings.sections?.filter((E,w)=>w!==T)}})),a({operation:r.EVENT_TYPES.SANDBOX_ACCORDION_REMOVE_SECTION,settings:{index:T}})};return(0,o.jsx)(t.ui_kit$Form,{form:s,layout:"vertical",name:"selected_carousel_form",initialValues:Mn,onValuesChange:k,autoComplete:"off",className:"element-controls",children:(0,o.jsxs)("div",{id:"selected_element_form_desktop_props",children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:20,children:[(0,o.jsx)(t.ui_kit$Col,{span:15,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"expandSingleSection",valuePropName:"checked",children:(0,o.jsx)(t.ui_kit$Switch,{id:"ExpandSingleSection",label:i("Expand only one section"),size:"small",labelStyle:{position:"relative",top:2}})})}),(0,o.jsx)(t.ui_kit$Col,{span:9,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"animate",valuePropName:"checked",children:(0,o.jsx)(t.ui_kit$Switch,{id:"Animate",label:i("Animate"),size:"small",labelStyle:{position:"relative",top:2}})})})]}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"}),(0,o.jsx)(t.ui_kit$Form.List,{name:"sections",children:()=>(0,o.jsx)("div",{style:{paddingTop:l.formItemMarginBottomMD+4},children:c?.settings?.sections?.map((T,_)=>(0,o.jsxs)(t.ui_kit$Row,{gutter:24,children:[(0,o.jsx)(t.ui_kit$Col,{span:20,children:(0,o.jsxs)(t.ui_kit$Space,{size:10,align:"baseline",children:[(0,o.jsx)("span",{style:{position:"relative",top:2},children:i("Section ")+(_+1)}),(0,o.jsx)(t.ui_kit$Form.Item,{name:`expanded_${_}`,valuePropName:"checked",children:(0,o.jsx)(t.ui_kit$Switch,{id:`expanded_${_}`,label:i("expanded"),labelSize:"small",size:"small"})})]})}),(0,o.jsx)(t.ui_kit$Col,{children:c?.settings?.sections?.length>1&&(0,o.jsx)(t.ui_kit$Button,{type:"text",icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:16}),style:{marginRight:"auto"},onClick:()=>h(_)})})]},`expanded_${_}`))})}),(0,o.jsx)(t.ui_kit$Row,{gutter:20,children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:l.formItemMarginBottomMD},children:(0,o.jsx)(t.ui_kit$Button,{style:{display:"inline-flex",alignItems:"center",width:"100%"},icon:(0,o.jsx)(r.EmIcons,{icon:"PlusCircleOutlined",component:t.icons$PlusCircleOutlined,size:16,strokeWidth:d.iconStrokeWidth}),onClick:()=>b(),children:i(" Add section")})})})}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"})]})})};Bl.propTypes={};var{Text:Dn}=t.ui_kit$Typography,Vn="blocks",Sl="text/plain",Hn=(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"}),Un=(0,o.jsx)("span",{className:"addon-text-content",children:"Title"});function Ao(e){return e.closest(".email-pane__collapse-wrapper")}function zt({form:e,name:i,placeholder:l,usedColors:s,onColorChange:a}){const d=t.ui_kit$Form.useWatch(i,e);return(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:l,usedColors:s,value:typeof d=="string"?d:"",onChange:c=>a(i,c)})}var Wn=/^[a-z][a-z0-9+.-]*:/i;function Tl(e){const i=ot(typeof e=="string"?e:String(e??""));return i?Wn.test(i)?i:`https://${i}`:""}function zn(e){const i=typeof e=="string"?e.trim():String(e??"").trim();if(!i)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(i))return i;try{return new URL(i,typeof window<"u"&&window.location?window.location.origin:"http://localhost").href}catch{return i}}function Gn(e){const i=Tl(e);if(!i)return!1;try{const l=new URL(i);return!(l.protocol!=="http:"&&l.protocol!=="https:"||!l.hostname)}catch{return!1}}async function Rl(e,i){if(i===r.MODALS.UPLOAD_IMAGE_MODAL_EDIT&&$t(e)){try{const l=new URL(e,typeof window<"u"&&window.location?window.location.origin:"http://localhost").href,s=await fetch(l);if(s.ok){const a=await s.blob();return{entryModal:i,currentUrl:"",imageDataUrl:await new Promise((d,c)=>{const p=new FileReader;p.onload=()=>d(p.result),p.onerror=c,p.readAsDataURL(a)})}}}catch{}return{entryModal:r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD,currentUrl:""}}return{entryModal:i,currentUrl:e}}function Yn(){const e=r.useSelector(r.selectEditorThemeColor$1),[i,l]=(0,n.useState)(()=>typeof document<"u"&&document.body.classList.contains("dark"));return(0,n.useEffect)(()=>{const s=()=>l(document.body.classList.contains("dark"));s();const a=new MutationObserver(s);return a.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[]),e==="vs-dark"||i?"dark":"light"}function Xn(e){const i=String(e?.bgColor??"").trim();return{blockBgEnabled:!!(e?.bgEnabled&&i),blockBgColor:i}}function Gt(e,i,l){return{...e,buttonBgColor:i,hostCellBgForIconLuminance:String(l??"").trim()}}function yl(e){const i=e?.settings||{};return JSON.stringify({type:e?.type??null,caption:e?.caption??null,parent:e?.parent??i.parent??null,path:i.path??null,blockIndex:i.blockIndex??null})}function wl(e){if(!Array.isArray(e)||e.length===0)return"";const i=e.map(s=>s.customIcon?"":String(s?.itemBorderColor??"").trim()),l=i[0];return i.every(s=>s===l)?l:""}function Yt(e,i){const l=String(e??"").trim(),s=String(i??"").trim();return s||l}function Kn(e,i){const l=String(e??"").trim(),s=String(i??"").trim();return!s||l&&s===l?"":s}function qn(e,i,l){const s=String(e??"").trim(),a=String(i??"").trim(),d=String(l??"").trim();return d&&(!s||d!==s)?d:a}function Jn(e,i){return(e||[]).map(l=>({...l,itemBorderColor:l.customIcon?"":i}))}function Qn(e,i,l){return(e||[]).map(s=>({...s,buttonBgColor:s.customIcon?"":qn(i,l,s.buttonBgColor)}))}function Zn(e,i){if(e==null)return;const l=(s,a)=>{if(!a||!Object.prototype.hasOwnProperty.call(a,"platform"))return;const d=a.platform;d==null||d===""||i(s,d)};if(Array.isArray(e))e.forEach((s,a)=>{l(a,s)});else if(typeof e=="object")for(const s of Object.keys(e)){const a=Number.parseInt(s,10);Number.isNaN(a)||l(a,e[s])}}function jl({__:e,form:i,fieldName:l,pushSettingsToIframe:s,onMetaActiveChange:a}){const{token:d}=(0,t.ui_kit$useToken)(),c=t.ui_kit$Form.useWatch(["items",l],i),p=c&&typeof c=="object"?c:{},f=typeof p.alt=="string"?p.alt:"",x=typeof p.title=="string"?p.title:"",[k,b]=(0,n.useState)(!1),[h,T]=(0,n.useState)(!1),_=(0,n.useRef)(null),E=(0,n.useRef)(null),w=(0,n.useMemo)(()=>({clearIcon:(0,o.jsx)(t.ui_kit$ColorPickerClearGlyph,{})}),[]);(0,n.useEffect)(()=>{f.trim()&&b(!0)},[f]);const v=!!(f.trim()||k),P=!!(x.trim()||h),j=v||P;(0,n.useLayoutEffect)(()=>{a(l,{alt:v,title:P})},[v,l,a,P]);const C=(0,n.useMemo)(()=>({marginBottom:j?d.formItemMarginBottomXS:0}),[j,d.formItemMarginBottomXS]),I=(0,n.useMemo)(()=>[l,"alt"],[l]),K=(0,n.useMemo)(()=>[l,"title"],[l]),U=j?"selected-social-form__meta-fields":"selected-social-form__meta-fields is-hidden",O=v?"selected-social-form__card-field":"selected-social-form__card-field is-hidden",L=P?"selected-social-form__card-field":"selected-social-form__card-field is-hidden",R=(0,n.useMemo)(()=>f.trim()?f.trim():e("Alternative text"),[e,f]),G=(0,n.useMemo)(()=>x.trim()?x.trim():e("Tooltip text"),[e,x]),J=(0,n.useMemo)(()=>(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":v}),[v]),te=(0,n.useMemo)(()=>(0,De.default)("selected-td-form__button",{"selected-td-form__button--active":P}),[P]),oe=(0,n.useCallback)(ae=>{setTimeout(()=>{const ke=ae.current;if(ke){if(typeof ke.focus=="function"){ke.focus();return}ke.input&&typeof ke.input.focus=="function"&&ke.input.focus()}},0)},[]),he=(0,n.useCallback)(()=>{v?(b(!1),f.trim()&&(i.setFieldValue(["items",l,"alt"],""),setTimeout(()=>s(),0))):(b(!0),oe(_))},[v,f,l,oe,i,s]),be=(0,n.useCallback)(()=>{if(P)a(l,{title:!1}),T(!1),x.trim()&&(i.setFieldValue(["items",l,"title"],""),setTimeout(()=>s(),0));else{T(!0),a(l,{title:!0});const ae=f.trim();i.setFieldValue(["items",l,"title"],ae),setTimeout(()=>s(),0),oe(E)}},[f,l,oe,i,a,s,P,x]);return(0,o.jsxs)("div",{className:"selected-social-form__meta-block",children:[(0,o.jsxs)(t.ui_kit$Space,{size:8,className:"selected-social-form__meta-toggle-row",style:C,children:[(0,o.jsx)(t.ui_kit$Tooltip,{title:R,placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Button,{type:"default",className:J,onClick:he,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Alt"})})}),(0,o.jsx)(t.ui_kit$Tooltip,{title:G,placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Button,{type:"default",className:te,onClick:be,children:(0,o.jsx)("span",{className:"addon-text-content",children:"Title"})})})]}),(0,o.jsxs)("div",{className:U,children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:I,className:O,children:(0,o.jsx)(t.ui_kit$Input,{ref:_,placeholder:e("Alternative text"),allowClear:w,prefix:Hn})}),(0,o.jsx)(t.ui_kit$Form.Item,{name:K,className:L,children:(0,o.jsx)(t.ui_kit$Input,{ref:E,placeholder:e("Social network name"),allowClear:w,prefix:Un})})]})]})}jl.propTypes={__:g.default.func.isRequired,form:g.default.object.isRequired,fieldName:g.default.oneOfType([g.default.number,g.default.string]).isRequired,pushSettingsToIframe:g.default.func.isRequired,onMetaActiveChange:g.default.func.isRequired};function ed(e,i){if(!Array.isArray(e)||e.length===0)return i;let l=null;for(const s of e){const a=s.iconWidth;if(a==null||Number.isNaN(a)||a<=0)return i;if(l===null)l=a;else if(a!==l)return i}return l??i}function od(e){if(!e)return{align:"center",iconSize:40,borderRadius:0,gap:8,globalBgColor:"",globalItemBorderColor:"",buttonBorderWidth:0,showLabel:!1,items:[]};const i=Xn(e),l=String(e?.hostCellBgForIconLuminance??"").trim(),s=ed(e.items,e.iconSize??40),a=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:0,d=e.bgEnabled&&e.bgColor?String(e.bgColor).trim():"";return{align:e.align??"center",iconSize:s,borderRadius:e.borderRadius??0,gap:e.gap??8,globalBgColor:d,globalItemBorderColor:wl(e.items),buttonBorderWidth:a,showLabel:e.showLabel??!1,items:Array.isArray(e.items)?e.items.map(c=>{const p=!!c.customIcon,f=p?"":Yt(d,c.buttonBgColor),x=c.platform&&!p?r.getSocialIconForBlockCell(c.platform,Gt(i,f,l)):null;return{...c,customIcon:p,title:String(c.title??"").trim(),...x?{iconSrc:x}:{},iconWidth:null,iconHeight:null,buttonBgColor:f,itemBorderColor:p?"":String(c.itemBorderColor??"").trim()}}):[]}}var vl=({elementSettings:e})=>{const{__:i}=r.useI18n(),l=r.useAppConfig(),s=r.useDispatch(),[a]=t.ui_kit$Form.useForm(),d=r.useSendPostMessage(),c=r.useSendPostMessageEx(),{openImagePicker:p}=r.useImagePicker(),[f,x]=(0,n.useState)(e),[k,b]=(0,n.useState)(null),[h,T]=(0,n.useState)(null),_=(0,n.useRef)(null),E=(0,n.useRef)(null),w=(0,n.useRef)(null),v=(0,n.useRef)(yl(e)),P=r.useSelector(r.selectEmailSettings),j=(0,n.useRef)(null),C=(0,n.useRef)(!1),I=(0,n.useRef)(""),K=(0,n.useRef)({}),U=Yn(),O=P?.usedColors??[],L=t.ui_kit$Form.useWatch("items",a)||[],R=(0,n.useCallback)(()=>{j.current&&(document.removeEventListener("dragover",j.current,!0),j.current=null)},[]),G=(0,n.useCallback)(()=>{if(j.current)return;const X=ne=>{ne.preventDefault(),ne.dataTransfer&&(ne.dataTransfer.dropEffect="move")};document.addEventListener("dragover",X,!0),j.current=X},[]),J=(0,n.useMemo)(()=>r.getSocialPresetsForBrand(Vn).filter(X=>r.SOCIAL_ICON_ORIGINAL_BY_PLATFORM[X.id]),[]),te=(0,n.useMemo)(()=>J.map(X=>({value:X.id,label:(0,o.jsxs)("span",{className:"selected-social-form__platform-option",children:[(0,o.jsx)("img",{src:r.getSocialIcon(X.id,U),alt:""}),(0,o.jsx)("span",{className:"selected-social-form__platform-option-text",children:i(X.labelMsgid)})]})})),[i,J,U]),oe=(0,n.useCallback)((X,ne)=>{K.current={...K.current,[X]:{...K.current[X],...ne}}},[]);(0,n.useEffect)(()=>{const X=yl(e);v.current!==X&&(v.current=X,K.current={},x(e))},[e]);const he=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(f?.settings){if(he.current){he.current=!1;return}const X=f.settings;I.current=X.bgEnabled&&X.bgColor?String(X.bgColor).trim():"",a.setFieldsValue(od(f.settings))}},[f,a]),(0,n.useEffect)(()=>()=>R(),[R]);const be=(0,n.useCallback)(()=>{const X=a.getFieldsValue(!0),ne=f.settings||{},we=String(ne.hostCellBgForIconLuminance??"").trim(),V=(X.globalBgColor||"").trim(),Te=typeof X.iconSize=="number"&&!Number.isNaN(X.iconSize)?X.iconSize:ne.iconSize??40,Ie=typeof X.borderRadius=="number"&&!Number.isNaN(X.borderRadius)?X.borderRadius:ne.borderRadius??0,ve=typeof X.gap=="number"&&!Number.isNaN(X.gap)?X.gap:ne.gap??8,Ve={blockBgEnabled:!!V,blockBgColor:V},Me=(X.globalItemBorderColor||"").trim();let He=typeof X.buttonBorderWidth=="number"&&!Number.isNaN(X.buttonBorderWidth)?X.buttonBorderWidth:0;He=Math.max(0,Math.min(24,Math.round(He)));const le={...ne,type:"social",align:X.align??ne.align??"center",iconSize:Te,borderRadius:Ie,gap:ve,bgEnabled:!!V,bgColor:V,hostCellBgForIconLuminance:we,borderWidth:typeof ne.borderWidth=="number"?ne.borderWidth:0,borderColor:typeof ne.borderColor=="string"?ne.borderColor:"",buttonBorderColor:"",buttonBorderWidth:He,showLabel:X.showLabel,items:(X.items||[]).filter(Boolean).map((Y,D)=>{const ie=!!Y.customIcon,Ee=K.current[D]||{},Ae=ie?"":Kn(V,(Y.buttonBgColor||"").trim()),We=typeof Y.href=="string"?Tl(Y.href):Y.href,Ge=ie?"":Yt(V,Ae),Ye=!ie&&Y.platform?r.getSocialIconForBlockCell(Y.platform,Gt(Ve,Ge,we)):null,$=ie?"":Me||String(Y.itemBorderColor??"").trim(),N=zn(ie?Y.iconSrc||"":Ye||Y.iconSrc||"");return{...Y,customIcon:ie,href:We,iconSrc:N,iconWidth:null,iconHeight:null,buttonBgColor:Ae,itemBorderColor:$,title:Ee.title?String(Y.title??"").trim():""}})};d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.SOCIAL,caption:f.caption,settings:le}),I.current=V,he.current=!0,x(Y=>({...Y,settings:le}))},[f.caption,f.settings,a,d]),ae=(0,n.useCallback)(X=>{if(X==null||X==="")return-1;const ne=r.stripEmVersionFromUrlString(String(X));return(a.getFieldValue("items")||[]).findIndex(we=>r.stripEmVersionFromUrlString(we&&we.iconSrc||"")===ne)},[a]),ke=(0,n.useCallback)((X,ne,we,V)=>{const Te=[...a.getFieldValue("items")||[]];if(X<0||X>=Te.length)return;const Ie=r.stripEmVersionFromUrlString(String(V||""))===r.stripEmVersionFromUrlString(String(ne||""));(!Ie||ne!==Te[X]?.iconSrc)&&(Te[X]={...Te[X],iconSrc:ne,customIcon:!0,buttonBgColor:"",itemBorderColor:""},a.setFieldValue("items",Te),setTimeout(()=>be(),0)),we?.mode==="save"&&Ie&&c(r.EVENT_TYPES.SANDBOX_IMAGE_RESET,{url:String(ne)})},[a,be,c]),Ce=(0,n.useCallback)(async(X,ne)=>{const we=r.stripEmVersionFromUrlString(String(ne||"")),V=ae(ne);if(V<0)return;const Te=(a.getFieldValue("items")||[])[V]?.iconSrc,{entryModal:Ie,currentUrl:ve,imageDataUrl:Ve}=await Rl(we,X),Me=await p({kind:"img",currentUrl:ve,entryModal:Ie,imageDataUrl:Ve});Me?.url&&ke(V,Me.url,Me.meta,Te)},[ke,ae,a,p]),de=(0,n.useCallback)(async X=>{const ne=(a.getFieldValue("items")||[])[X];if(!ne)return;const{entryModal:we,currentUrl:V,imageDataUrl:Te}=await Rl(r.stripEmVersionFromUrlString(String(ne.iconSrc||"")),r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD),Ie=ne.iconSrc,ve=await p({kind:"img",currentUrl:V,entryModal:we,imageDataUrl:Te});ve?.url&&ke(X,ve.url,ve.meta,Ie)},[ke,a,p]),Fe=(0,n.useCallback)(X=>{const ne=parseInt(X.currentTarget.dataset.socialEditIndex??"",10);Number.isNaN(ne)||de(ne)},[de]),je=(0,n.useCallback)(X=>{const ne=X.data?.operation,we=X.data?.src;ne===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_AI_POPUP?Ce(r.MODALS.UPLOAD_IMAGE_MODAL_AI,we):ne===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?Ce(r.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD,we):ne===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_EDIT_POPUP?Ce(r.MODALS.UPLOAD_IMAGE_MODAL_EDIT,we):ne===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_GIF_POPUP?Ce(r.MODALS.UPLOAD_IMAGE_MODAL_GIF,we):ne===r.EVENT_TYPES.APPLICATION_OPEN_IMAGE_STOCK_POPUP?Ce(r.MODALS.UPLOAD_IMAGE_MODAL_STOCK,we):ne===r.EVENT_TYPES.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(s(r.closeSecondModal()),s(r.closeModal$1()))},[s,Ce]);r.useListenPostMessage(je);const re=(0,n.useCallback)(()=>{const X=a.getFieldValue("items")||[],ne=J[0],we=(a.getFieldValue("globalItemBorderColor")||"").trim(),V=(a.getFieldValue("globalBgColor")||"").trim();if(!ne)a.setFieldsValue({items:[...X,{platform:void 0,customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:V,itemBorderColor:we}]});else{const Te=String(f?.settings?.hostCellBgForIconLuminance??"").trim(),Ie=Yt(V,V),ve=r.getSocialIconForBlockCell(ne.id,Gt({blockBgEnabled:!!V,blockBgColor:V},Ie,Te)),Ve=i(ne.labelMsgid);a.setFieldsValue({items:[...X,{platform:ne.id,customIcon:!1,href:"",alt:Ve,title:"",iconSrc:ve,iconWidth:null,iconHeight:null,buttonBgColor:V,itemBorderColor:we}]})}setTimeout(()=>be(),0)},[i,f?.settings?.hostCellBgForIconLuminance,a,J,be]),Be=(0,n.useCallback)((X,ne)=>{X.dataTransfer.setData(Sl,String(ne)),X.dataTransfer.setData(r.DND_SOCIAL_LIST_REORDER_MIME,String(ne)),X.dataTransfer.effectAllowed="move",_.current=ne,b(ne),G()},[G]),ce=(0,n.useCallback)(()=>{R(),_.current=null,b(null),T(null)},[R]),ee=(0,n.useCallback)((X,ne,we)=>{if(we<2)return;X.preventDefault(),X.dataTransfer.dropEffect="move";const V=_.current;V!==null&&V!==ne&&T(ne)},[]),me=(0,n.useCallback)((X,ne)=>{X.currentTarget.contains(X.relatedTarget)||T(we=>we===ne?null:we)},[]),ue=(0,n.useCallback)((X,ne,we)=>{X.preventDefault(),T(null);const V=X.dataTransfer.getData(Sl),Te=parseInt(V,10);if(Number.isNaN(Te)||Te===ne){R();return}we(Te,ne),R(),setTimeout(()=>be(),0)},[R,be]),Z=(0,n.useCallback)(X=>{const ne=X.currentTarget,we=parseInt(ne.dataset.itemIndex??"",10);Number.isNaN(we)||Be(X,we)},[Be]),Q=(0,n.useCallback)(X=>{const ne=X.currentTarget,we=parseInt(ne.dataset.itemIndex??"",10),V=parseInt(ne.dataset.listLength??"",10);Number.isNaN(we)||Number.isNaN(V)||V<2||(X.preventDefault(),X.dataTransfer&&(X.dataTransfer.dropEffect="move"))},[]),W=(0,n.useCallback)(X=>{const ne=X.currentTarget,we=parseInt(ne.dataset.itemIndex??"",10),V=parseInt(ne.dataset.listLength??"",10);Number.isNaN(we)||Number.isNaN(V)||ee(X,we,V)},[ee]),q=(0,n.useCallback)(X=>{const ne=parseInt(X.currentTarget.dataset.itemIndex??"",10);Number.isNaN(ne)||me(X,ne)},[me]),se=(0,n.useCallback)(X=>{const ne=parseInt(X.currentTarget.dataset.itemIndex??"",10),we=E.current;Number.isNaN(ne)||typeof we!="function"||ue(X,ne,we)},[ue]),xe=(0,n.useCallback)(X=>{X.stopPropagation();const ne=parseInt(X.currentTarget.dataset.fieldName??"",10),we=w.current;Number.isNaN(ne)||typeof we!="function"||(we(ne),queueMicrotask(be))},[be]),ge=(0,n.useCallback)((X,ne)=>{const we=J.find(le=>le.id===ne);if(!we)return;const V=i(we.labelMsgid),Te=K.current[X]||{},Ie=String(a.getFieldValue(["items",X,"alt"])??"").trim();(Te.alt||Ie)&&a.setFieldValue(["items",X,"alt"],V),Te.title&&a.setFieldValue(["items",X,"title"],V);const ve=(a.getFieldValue("globalBgColor")||"").trim(),Ve=Yt(ve,(a.getFieldValue(["items",X,"buttonBgColor"])||"").trim()),Me=String(f?.settings?.hostCellBgForIconLuminance??"").trim(),He=r.getSocialIconForBlockCell(ne,Gt({blockBgEnabled:!!ve,blockBgColor:ve},Ve,Me));He&&(a.setFieldValue(["items",X,"customIcon"],!1),a.setFieldValue(["items",X,"iconSrc"],He))},[i,f?.settings?.hostCellBgForIconLuminance,a,J]),Ne=(0,n.useCallback)(X=>{if(Object.prototype.hasOwnProperty.call(X,"globalItemBorderColor")){if(!C.current){const ne=String(X.globalItemBorderColor??"").trim(),we=a.getFieldValue("items")||[];a.setFieldsValue({items:Jn(we,ne)})}}else if(Object.prototype.hasOwnProperty.call(X,"globalBgColor")){const ne=I.current,we=String(X.globalBgColor??"").trim(),V=a.getFieldValue("items")||[];a.setFieldsValue({items:Qn(V,ne,we)})}else if(X?.items!=null){const ne=a.getFieldValue("items")||[],we=wl(ne);we!==(a.getFieldValue("globalItemBorderColor")||"").trim()&&(C.current=!0,a.setFieldValue("globalItemBorderColor",we),queueMicrotask(()=>{C.current=!1}));const V=f.settings?.items||[];ne.forEach((Te,Ie)=>{const ve=Te?.platform,Ve=V[Ie]?.platform;ve&&ve!==Ve&&ge(Ie,ve)})}Zn(X?.items,ge),be()},[f.settings?.items,a,be,ge]),ye=(0,n.useCallback)((X,ne)=>{if(a.setFieldValue(X,ne),Array.isArray(X)&&X[0]==="items"){Ne({items:{[X[1]]:{[X[2]]:ne}}});return}Ne({[X]:ne})},[a,Ne]),$e=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"selected-social-form__section",children:[(0,o.jsx)("div",{className:"selected-social-form__section-title",children:i("General settings")}),(0,o.jsx)("div",{className:"selected-social-form__align-block",children:(0,o.jsx)(Uo,{form:a,elementSettings:{...f,type:r.ELEMENT_TYPES.SOCIAL}})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,className:"selected-social-form__field-row",children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Button size"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"iconSize",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:16,max:64,prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:"px",placeholder:i("Button size"),className:"selected-social-form__input-full"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Corner radius"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"borderRadius",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,max:48,prefix:(0,o.jsx)(r.EmIcons,{icon:"BorderRadius",component:t.icons$BorderRadius,className:"selected-td-form__icon-radius"}),addonAfter:"px",placeholder:i("Corner radius"),className:"selected-social-form__input-full"})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,className:"selected-social-form__field-row",children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Spacing"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"gap",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,max:48,prefix:(0,o.jsx)(r.EmIcons,{icon:"PaddingLeftRight",component:t.icons$PaddingLeftRight}),addonAfter:"px",placeholder:i("Spacing"),className:"selected-social-form__input-full"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Background color"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"globalBgColor",className:"form-item-margin-xs",children:(0,o.jsx)(zt,{form:a,name:"globalBgColor",placeholder:i("Background color"),usedColors:O,onColorChange:ye})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,className:"selected-social-form__field-row",children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Border"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonBorderWidth",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,max:24,prefix:(0,o.jsx)(r.EmIcons,{icon:"BorderOuterOutlined",component:t.icons$BorderOuterOutlined}),addonAfter:"px",placeholder:i("Border"),className:"selected-social-form__input-full"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Border color"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"globalItemBorderColor",className:"form-item-margin-xs",children:(0,o.jsx)(zt,{form:a,name:"globalItemBorderColor",placeholder:i("Border color"),usedColors:O,onColorChange:ye})})})})]})]}),(0,o.jsxs)("div",{className:"selected-social-form__section selected-social-form__section--bordered",children:[(0,o.jsx)("div",{className:"selected-social-form__section-title",children:i("Social buttons")}),(0,o.jsx)(t.ui_kit$Form.List,{name:"items",children:(X,{remove:ne,move:we})=>(E.current=we,w.current=ne,(0,o.jsx)("div",{className:"selected-social-form__items",children:X.map((V,Te)=>{const Ie=!!(L[Te]?.customIcon??L[V.name]?.customIcon);return(0,o.jsxs)("div",{className:(0,De.default)("selected-social-form__card",k===Te&&"selected-social-form__card--dragging",h===Te&&k!==Te&&"selected-social-form__card--drag-over"),"data-item-index":Te,"data-list-length":X.length,onDragEnterCapture:Q,onDragOverCapture:W,onDragLeave:q,onDropCapture:se,children:[(0,o.jsxs)("div",{className:"selected-social-form__card-head",children:[(0,o.jsxs)("div",{className:"selected-social-form__card-head-main",children:[X.length>1?(0,o.jsx)("span",{className:"selected-social-form__drag-handle",draggable:!0,"data-item-index":Te,onDragStart:Z,onDragEnd:ce,role:"button",tabIndex:0,"aria-label":i("Drag to reorder"),children:(0,o.jsx)(r.EmIcons,{icon:"HolderOutlined",component:t.icons$HolderOutlined})}):null,(0,o.jsxs)(Dn,{className:"selected-social-form__card-title",children:[i("Button")," ",Te+1]})]}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Delete"),placement:"top",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Button,{type:"text",className:"selected-social-form__card-head-remove",icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:18,strokeWidth:l.iconStrokeWidth}),"aria-label":i("Delete"),"data-field-name":V.name,onClick:xe})})]}),(0,o.jsx)(t.ui_kit$Form.Item,{name:[V.name,"iconSrc"],hidden:!0,children:(0,o.jsx)(t.ui_kit$Input,{})}),(0,o.jsx)(t.ui_kit$Form.Item,{name:[V.name,"customIcon"],valuePropName:"checked",hidden:!0,children:(0,o.jsx)(t.ui_kit$Checkbox,{})}),(0,o.jsxs)("div",{className:"selected-social-form__platform-row",children:[(0,o.jsx)(t.ui_kit$Form.Item,{name:[V.name,"platform"],className:"selected-social-form__platform-field selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Select,{options:te,className:"selected-social-form__platform-select",classNames:{popup:{root:"selected-social-form__platform-dropdown"}},placeholder:i("Select"),suffixIcon:(0,o.jsx)(r.EmIcons,{icon:"ChevronDownCustom",component:t.icons$ChevronDownCustom,className:"ant-select-suffix"})})}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Edit icon"),placement:"top",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Button,{type:"text",className:"selected-social-form__platform-edit","data-social-edit-index":Te,icon:(0,o.jsx)(r.EmIcons,{icon:"EditOutlined",component:t.icons$EditOutlined,size:18,strokeWidth:l.iconStrokeWidth}),"aria-label":i("Edit icon"),onClick:Fe})})]}),(0,o.jsx)(t.ui_kit$Form.Item,{name:[V.name,"href"],className:"selected-social-form__card-field",rules:[{required:!0,whitespace:!0,message:i("Please enter the URL.")},{validator:async(ve,Ve)=>{const Me=typeof Ve=="string"?Ve.trim():String(Ve??"").trim();if(Me&&!Gn(Me))throw new Error(i("Please enter the correct URL."))}}],children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Link03",component:t.icons$Link03,className:"selected-social-form__field-icon"}),placeholder:i("Enter link"),allowClear:{clearIcon:(0,o.jsx)(t.ui_kit$ColorPickerClearGlyph,{})}})}),Ie?null:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,className:"selected-social-form__card-field selected-social-form__bg-color-row",children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Background color"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:[V.name,"buttonBgColor"],className:"selected-social-form__card-field",children:(0,o.jsx)(zt,{form:a,name:["items",V.name,"buttonBgColor"],placeholder:i("Background color"),usedColors:O,onColorChange:ye})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Border color"),placement:"bottom",getPopupContainer:Ao,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:[V.name,"itemBorderColor"],className:"selected-social-form__card-field",children:(0,o.jsx)(zt,{form:a,name:["items",V.name,"itemBorderColor"],placeholder:i("Border color"),usedColors:O,onColorChange:ye})})})})]}),(0,o.jsx)(jl,{__:i,form:a,fieldName:V.name,pushSettingsToIframe:be,onMetaActiveChange:oe})]},V.key)})}))}),(0,o.jsx)(t.ui_kit$Button,{type:"text",block:!0,className:"selected-social-form__add-bar",icon:(0,o.jsx)(r.EmIcons,{icon:"PlusSquareOutlined",component:t.icons$PlusSquareOutlined}),onClick:re,children:i("Add button")})]})]});return(0,o.jsx)("div",{className:"selected-social-form",children:(0,o.jsx)(t.ui_kit$Form,{form:a,layout:"vertical",className:"selected-social-form__form element-controls",onValuesChange:Ne,autoComplete:"off",children:(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:$e})})})};vl.propTypes={elementSettings:g.default.shape({settings:g.default.object,type:g.default.string,caption:g.default.string})};var Il=r.BASIC_BORDER_COLOR,td=(e,i,l,s,a,d,c="")=>{const p=e.getFieldsValue(!0),f=i?"cell_":c;setTimeout(()=>{i?s(x=>!x):l(x=>!x),a&&(p[f+"borderWidth"]=null,p[f+"borderColor"]="",p[f+"borderStyle"]=""),d(x=>({...r.RESET_BORDER_PARAMS,[p[f+"borderPosition"]]:{...x[p[f+"borderPosition"]],width:p[f+"borderWidth"],color:p[f+"borderColor"],style:p[f+"borderStyle"]}}))})},id=(e,i,l,s,a,d,c)=>{const p=e.getFieldsValue(!0);setTimeout(()=>{i(f=>!f),!l&&!s[p?.mobileBorderPosition]?.color&&(p.mobileBorderStyle="solid",p.mobileBorderWidth=1,p.mobileBorderColor=Il,a(f=>({...s,[p?.mobileBorderPosition]:{color:Il,style:"solid",width:1}}))),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:c.type,settings:{mobileBorder:{...s,[p?.mobileBorderPosition]:{color:p.mobileBorderColor,style:p.mobileBorderStyle,width:p.mobileBorderWidth}}}})})},rd=(e,i,l,s,a,d,c="")=>{const p=e.getFieldsValue(!0);setTimeout(()=>{i(f=>!f),l?(p[c+"borderRadiusAll"]=0,s(!0)):p[c+"borderRadiusAll"]||(p[c+"borderRadiusAll"]=0),a({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:d.type,settings:{borderRadius:{all:p[c+"borderRadiusAll"]}}})})},ld=(e,i,l,s,a)=>{const d=e.getFieldsValue(!0);setTimeout(()=>{i(c=>!c),!l&&!d.mobileBorderRadiusAll&&!d.mobileBorderRadiusTopLeft&&!d.mobileBorderRadiusTopRight&&!d.mobileBorderRadiusBottomRight&&!d.mobileBorderRadiusBottomLeft&&(d.mobileBorderRadiusAll=0),["all","topLeft","topRight","bottomRight","bottomLeft"].forEach(c=>{if(!d.mobileBorderRadius?.[c])return;const p=`mobileBorderRadius${c[0].toUpperCase()}${c.slice(1)}`;s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBorderRadius:{[c]:d[p],classNamePrefix:`em-mob-border_radius_${c}-`}}})})})},sd=(e,i,l,s,a)=>{const d=e.getFieldsValue(!0);setTimeout(()=>{i(c=>!c),!l&&!d.boxShadowColor?(d.boxShadowInset=!1,d.boxShadowHOffset=5,d.boxShadowVOffset=5,d.boxShadowBlurRadius=10,d.boxShadowSpreadRadius=-5,d.boxShadowColor="#000000"):l&&(d.boxShadowInset=!1,d.boxShadowHOffset=null,d.boxShadowVOffset=null,d.boxShadowBlurRadius=null,d.boxShadowSpreadRadius=null,d.boxShadowColor=""),s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{boxShadow:{blurRadius:d.boxShadowBlurRadius,color:d.boxShadowColor,hOffset:d.boxShadowHOffset,inset:d.boxShadowInset,spreadRadius:d.boxShadowSpreadRadius,vOffset:d.boxShadowVOffset}}})})},ad=(e,i,l,s,a)=>{const d=e.getFieldsValue(!0);setTimeout(()=>{i(c=>!c),!l&&!d.mobileBoxShadowColor&&(d.mobileBoxShadowInset=!1,d.mobileBoxShadowHOffset=5,d.mobileBoxShadowVOffset=5,d.mobileBoxShadowBlurRadius=10,d.mobileBoxShadowSpreadRadius=-5,d.mobileBoxShadowColor="#000000"),s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBoxShadow:{blurRadius:d.mobileBoxShadowBlurRadius,color:d.mobileBoxShadowColor,hOffset:d.mobileBoxShadowHOffset,inset:d.mobileBoxShadowInset,spreadRadius:d.mobileBoxShadowSpreadRadius,vOffset:d.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})})},nd=(e,i,l,s,a)=>{const d=e.getFieldsValue(!0);setTimeout(()=>{i(c=>!c),!l&&!d.mobileWidth&&(d.mobileWidth=""),s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileWidth:{value:d.mobileWidth,dim:d.mobileWidthDim,classNamePrefix:"em-mob-width-"}}})})},dd=e=>{setTimeout(()=>{e(i=>!i)})},cd=(e,i,l,s,a)=>{const d=e.getFieldsValue(!0);setTimeout(()=>{i(c=>!c),!l&&!d.mobileBackgroundColor&&(d.mobileBackgroundColor="#E5E5E5"),s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:d.mobileBackgroundColor}}}),l&&Et(e,a,s)})},ud=(e,i,l,s,a)=>{const d=e.getFieldsValue(!0);setTimeout(()=>{i(c=>!c),l&&(d.paddingLeftRight="",d.paddingLeft="",d.paddingRight="",d.paddingTopBottom="",d.paddingTop="",d.paddingBottom="",s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{padding:{all:0}}}))})},md=(e,i,l,s,a)=>{i(c=>!c);const d=e.getFieldsValue(!0);l||(d.paddingLeftRight=d.paddingLeft,d.paddingTopBottom=d.paddingTop,d.paddingRight=d.paddingLeft,d.paddingBottom=d.paddingTop,s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{padding:{top:d.paddingTopBottom,bottom:d.paddingTopBottom,left:d.paddingLeftRight,right:d.paddingLeftRight}}}))},pd=e=>{setTimeout(()=>{e(i=>!i)})},hd=(e,i,l,s,a)=>{i(c=>!c);const d=e.getFieldsValue(!0);l||(d.cell_paddingLeftRight=d.cell_paddingLeft,d.cell_paddingTopBottom=d.cell_paddingTop,d.cell_paddingRight=d.cell_paddingLeft,d.cell_paddingBottom=d.cell_paddingTop,s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{cell_padding:{top:d.cell_paddingTopBottom,bottom:d.cell_paddingTopBottom,left:d.cell_paddingLeftRight,right:d.cell_paddingLeftRight}}})),(l&&d.cell_paddingLeftRight||d.cell_paddingLeftRight===0)&&(d.cell_paddingLeft=d.cell_paddingLeftRight,d.cell_paddingRight=d.cell_paddingLeftRight),(l&&d.cell_paddingTopBottom||d.cell_paddingTopBottom===0)&&(d.cell_paddingTop=d.cell_paddingTopBottom,d.cell_paddingBottom=d.cell_paddingTopBottom)},bd=({form:e,onBorderSideClear:i,formName:l,elementSettings:s,formValues:a,isMacOS:d,__:c,token:p,appConfig:f,typografItems:x,backgroundRepeatOptions:k,backgroundSizeOptions:b,sendAction:h,handleToggleShowPaddingCell:T,handleTogglePaddingCell:_,handleToggleBackground:E,handleToggleBorder:w,handleToggleBorderRadius:v,paddingCellShow:P,paddingsExt:j,backgroundShow:C,cellBordersShow:I,borderRadiusShow:K,oneBorderRadiusValue:U,setOneBorderRadiusValue:O,textInputRef:L,linkProtocol:R,handleLinkProtocolsChange:G,backgroundImageEmpty:J})=>{const te=z.useGoogleFontsLoader();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$FormSection,{title:c("Text"),dividerTop:!1,children:[f.formTextFieldTypografEnabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"AddImage",style:{marginBottom:p.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"AddImage",component:t.icons$AddImage}),onClick:()=>h("add_img"),style:{width:"100%"},children:c("Add image")})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"Typography",style:{marginBottom:p.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Dropdown,{arrow:!0,menu:{items:x},trigger:["hover"],placement:"bottom",getPopupContainer:oe=>oe.closest(".selected-element-panel"),children:(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"Typograf",component:t.icons$Typograf}),onClick:()=>h("typograf"),style:{width:"100%"},children:c("Typography")})})})})]}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Text font"),placement:"bottom",zIndex:1,getPopupContainer:oe=>oe.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontFamily",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{textEditor:!0,loadGoogleFonts:te,getPopupContainer:oe=>oe.closest(".email-pane__collapse-wrapper")})})}),!s.showOnMobile&&(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Font size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"fontSize",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:8,max:90,placeholder:c("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Line height"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"lineHeight",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:10,max:110,placeholder:c("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})})]})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:s,name:"textStrong",tooltipTitle:c(d?"Strong ( ⌘B )":"Strong ( Ctrl+B )"),icon:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:s,name:"textItalic",tooltipTitle:c(d?"Italic ( ⌘I )":"Italic ( Ctrl+I )"),icon:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:s,name:"textStrikethrough",tooltipTitle:c(d?"Strikethrough ( ⌘+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,o.jsx)(r.EmIcons,{icon:"StrikethroughOutlined",component:t.icons$StrikethroughOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,elementSettings:s,name:"textUnderline",tooltipTitle:c(d?"Underline ( ⌘U )":"Underline ( Ctrl+U )"),icon:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined,className:"selected-text-common-form__icon-radius"})})}),(0,o.jsx)(t.ui_kit$Col,{span:3,children:(0,o.jsx)(qe,{form:e,className:(0,De.default)("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":typeof s.linkHref=="string"}),elementSettings:s,name:"textLink",tooltipTitle:c("Link"),icon:(0,o.jsx)(r.EmIcons,{icon:"LinkOutlined",component:t.icons$LinkOutlined,className:"selected-text-common-form__icon-radius"})})})]}),a?.textLink&&(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsxs)(t.ui_kit$Col,{span:24,children:[(0,o.jsx)(et,{show:R==="#",__:c,style:{marginBottom:p.formItemMarginBottomXS}}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("The URL that the hyperlink directs to."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"linkHref",children:(0,o.jsx)(t.ui_kit$Input,{ref:L,addonBefore:(0,o.jsx)(Zo,{linkProtocol:R,handleLinkProtocolsChange:G,__:c}),allowClear:!0,placeholder:c("Hyperlink URL"),autoFocus:s?.customTable?.isNewLink,prefix:(0,o.jsx)(Qo,{linkProtocol:R})})})})]})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Text color"),placement:"bottom",zIndex:2,getPopupContainer:oe=>oe.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textColor",rules:[{message:c("Please set the font color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:c("Color"),usedColors:s.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:c("Text background"),placement:"bottom",zIndex:2,getPopupContainer:oe=>oe.parentNode,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textBackgroundColor",rules:[{message:c("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:c("Background color"),usedColors:s.usedColors})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(it,{form:e,elementSettings:s,name:"textAlign"})}),(0,o.jsx)(t.ui_kit$Col,{span:12,style:{textAlign:"right"},children:(0,o.jsx)(Mo,{form:e,elementSettings:s,name:"valign",isNewIconType:!0})})]})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:c("Padding"),collapsible:!0,open:P,onToggle:T,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormPaddingInputs,{namePrefix:"cell_",extended:j,onToggleExtended:_,gutter:p.marginSM,rowStyle:{paddingBottom:4},labels:{horizontal:c("Horizontal padding"),vertical:c("Vertical padding"),left:c("Left padding"),right:c("Right padding"),top:c("Top padding"),bottom:c("Bottom padding"),individual:c("Individual padding")}})}),(0,o.jsx)(t.ui_kit$FormSection,{title:c("Background"),collapsible:!0,open:C,onToggle:E,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormBackgroundSettings,{colorFieldName:"cellBackgroundColor",imageEnabled:f.formTableFieldBackgroundImageEnabled&&!1,backgroundImageEmpty:J,usedColors:s.usedColors,colorPlaceholder:c("Background color"),horizontalPositionPlaceholder:c("Horizontal position"),horizontalPositionTooltip:c("Horizontal position"),verticalPositionPlaceholder:c("Vertical position"),verticalPositionTooltip:c("Vertical position"),backgroundRepeatTooltip:c("Background image repeat"),backgroundSizeTooltip:c("Background image size"),selectPlaceholder:c("Please choose"),backgroundRepeatOptions:k,backgroundSizeOptions:b,imageUploadSlot:(f.formTableFieldBackgroundImageEnabled,void 0)})}),(0,o.jsx)(t.ui_kit$FormSection,{title:c("Borders"),collapsible:!0,open:I,onToggle:w,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,namePrefix:"cell_"})}),f.formFieldBorderRadiusEnabled&&!1]})},Cl=({form:e,onBorderSideClear:i,elementSettings:l,paddingShow:s,paddingsExt:a,backgroundShow:d,bordersShow:c,borderRadiusShow:p,boxShadowShow:f,handleToggleShowPadding:x,handleTogglePadding:k,handleToggleBackground:b,handleToggleBorder:h,handleToggleBorderRadius:T,handleToggleBoxShadow:_,backgroundRepeatOptions:E,backgroundSizeOptions:w,backgroundImageEmpty:v,oneBorderRadiusValue:P,setOneBorderRadiusValue:j,boxShadow:C})=>{const{__:I}=r.useI18n(),K=r.useAppConfig(),{token:U}=(0,t.ui_kit$useToken)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$FormSection,{title:I("Padding"),collapsible:!0,open:s,onToggle:x,children:(0,o.jsx)(t.ui_kit$FormPaddingInputs,{extended:a,onToggleExtended:k,gutter:U.marginSM,labels:{horizontal:I("Horizontal padding"),vertical:I("Vertical padding"),left:I("Left padding"),right:I("Right padding"),top:I("Top padding"),bottom:I("Bottom padding"),individual:I("Individual padding")}})}),(0,o.jsxs)(t.ui_kit$FormSection,{title:I("Background"),collapsible:!0,open:d,onToggle:b,dividerTop:!0,children:[(0,o.jsx)(t.ui_kit$FormBackgroundSettings,{imageEnabled:K.formTableFieldBackgroundImageEnabled,backgroundImageEmpty:v,usedColors:l.usedColors,colorPlaceholder:I("Background color"),horizontalPositionPlaceholder:I("Horizontal position"),horizontalPositionTooltip:I("Horizontal position"),verticalPositionPlaceholder:I("Vertical position"),verticalPositionTooltip:I("Vertical position"),backgroundRepeatTooltip:I("Background image repeat"),backgroundSizeTooltip:I("Background image size"),selectPlaceholder:I("Please choose"),backgroundRepeatOptions:E,backgroundSizeOptions:w,imageUploadSlot:K.formTableFieldBackgroundImageEnabled?(0,o.jsx)(No,{form:e,label:I("Background image"),name:"backgroundImage",tooltipTitle:I("Background image"),placeholder:I("Background image link/route")}):void 0}),(0,o.jsx)(rt,{form:e,showBackground:!0})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:I("Borders"),collapsible:!0,open:c,onToggle:h,dividerTop:!0,children:(0,o.jsx)(z.SelectedElementFormBorder,{form:e,onBorderSideClear:i})}),K.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:I("Border radius"),collapsible:!0,open:p,onToggle:T,dividerTop:!0,children:(0,o.jsx)(So,{form:e,oneBorderRadiusValue:P,setOneBorderRadiusValue:j,elementSettings:l})}),K.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:I("Box shadow"),collapsible:!0,open:f,onToggle:_,dividerTop:!0,children:(0,o.jsx)(jo,{})}),K.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:I("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:l,form:e})})]})};Cl.propTypes={form:g.default.object.isRequired,onBorderSideClear:g.default.func,elementSettings:g.default.object.isRequired,paddingShow:g.default.bool,paddingsExt:g.default.bool,backgroundShow:g.default.bool,bordersShow:g.default.bool,borderRadiusShow:g.default.bool,boxShadowShow:g.default.bool,handleToggleShowPadding:g.default.func,handleTogglePadding:g.default.func,handleToggleBackground:g.default.func,handleToggleBorder:g.default.func,handleToggleBorderRadius:g.default.func,handleToggleBoxShadow:g.default.func,backgroundRepeatOptions:g.default.array,backgroundSizeOptions:g.default.array,backgroundImageEmpty:g.default.bool,oneBorderRadiusValue:g.default.bool,setOneBorderRadiusValue:g.default.func,boxShadow:g.default.object};var Pl=({form:e,elementSettings:i,mobileSizeShow:l,mobileBackgroundShow:s,mobileBordersShow:a,mobileBorderRadiusShow:d,mobileBoxShadowShow:c,handleToggleMobileSize:p,handleToggleMobileBackground:f,handleToggleMobileBorder:x,handleToggleMobileBorderRadius:k,handleToggleMobileBoxShadow:b,oneMobileBorderRadiusValue:h,setOneMobileBorderRadiusValue:T,mobileBorders:_,mobileBoxShadow:E})=>{const{__:w,_x:v}=r.useI18n(),P=r.useAppConfig(),{token:j}=(0,t.ui_kit$useToken)(),C=r.useSelector(r.selectEmailSettings);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$FormSection,{title:w("Size"),collapsible:!0,open:l,onToggle:p,dividerTop:!0,children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:w("Table width"),placement:"left",children:(0,o.jsx)("div",{style:{marginBottom:j.formItemMarginBottomMD+4},children:(0,o.jsx)(zo,{form:e,name:"mobileWidth",elementSettings:i})})})})}),(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)("div",{style:{marginBottom:j.formItemMarginBottomXS*2},children:(0,o.jsx)(t.ui_kit$Tooltip,{title:w("Height"),placement:"bottom",children:(0,o.jsx)(tt,{form:e,name:"mobileHeight",elementSettings:i})})})})})]})}),(0,o.jsx)(t.ui_kit$FormSection,{title:w("Background"),collapsible:!0,open:s,onToggle:f,dividerTop:!0,children:(0,o.jsx)(Bt,{elementSettings:Go(i),imageEnabled:P.formTableFieldBackgroundImageEnabled,desktopBackground:xt(i)})}),P.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:w("Borders"),collapsible:!0,open:a,onToggle:x,dividerTop:!0,children:(0,o.jsx)(t.ui_kit$FormBorderInputs,{form:e,fieldStructure:"flat",borderValues:_,usedColors:C.usedColors,labels:{color:w("Color"),width:v("Width","border"),none:w("None"),solid:w("Solid"),dashed:w("Dashed"),dotted:w("Dotted"),above:w("Above"),below:w("Below"),onLeft:w("On the left"),onRight:w("On the right"),around:w("Around"),usedColors:w("Used"),recommendedColors:w("Recommended")}})}),P.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:w("Border radius"),collapsible:!0,open:d,onToggle:k,dividerTop:!0,children:(0,o.jsx)(So,{form:e,typeOfForm:"mobile",oneBorderRadiusValue:h,setOneBorderRadiusValue:T,elementSettings:i})}),P.formFieldBoxShadowEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:w("Box shadow"),collapsible:!0,open:c,onToggle:b,dividerTop:!0,children:(0,o.jsx)(jo,{typeOfForm:"mobile",form:e,elementSettings:i,enableSwitch:!1})}),P.formFieldVisibilityEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:w("Display control"),dividerTop:!0,children:(0,o.jsx)(vo,{elementSettings:i,form:e})})]})};Pl.propTypes={form:g.default.object.isRequired,elementSettings:g.default.object.isRequired,mobileSizeShow:g.default.bool,mobileBackgroundShow:g.default.bool,mobileBordersShow:g.default.bool,mobileBorderRadiusShow:g.default.bool,mobileBoxShadowShow:g.default.bool,handleToggleMobileSize:g.default.func,handleToggleMobileBackground:g.default.func,handleToggleMobileBorder:g.default.func,handleToggleMobileBorderRadius:g.default.func,handleToggleMobileBoxShadow:g.default.func,oneMobileBorderRadiusValue:g.default.bool,setOneMobileBorderRadiusValue:g.default.func,mobileBorders:g.default.object,mobileBoxShadow:g.default.object};var fd=({form:e,onBorderSideClear:i,elementViewType:l,mobileViewActive:s,elementSettings:a,paddingShow:d,paddingsExt:c,backgroundShow:p,bordersShow:f,borderRadiusShow:x,boxShadowShow:k,mobileSizeShow:b,mobileBackgroundShow:h,mobileBordersShow:T,mobileBorderRadiusShow:_,mobileBoxShadowShow:E,handleToggleShowPadding:w,handleTogglePadding:v,handleToggleBackground:P,handleToggleBorder:j,handleToggleBorderRadius:C,handleToggleBoxShadow:I,handleToggleMobileSize:K,handleToggleMobileBackground:U,handleToggleMobileBorder:O,handleToggleMobileBorderRadius:L,handleToggleMobileBoxShadow:R,backgroundRepeatOptions:G,backgroundSizeOptions:J,backgroundImageEmpty:te,oneBorderRadiusValue:oe,setOneBorderRadiusValue:he,oneMobileBorderRadiusValue:be,setOneMobileBorderRadiusValue:ae,boxShadow:ke,mobileBorders:Ce,mobileBoxShadow:de})=>(0,o.jsx)(o.Fragment,{children:l==="mobile"&&s.styles?(0,o.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",children:(0,o.jsx)(Pl,{form:e,elementSettings:a,mobileSizeShow:b,mobileBackgroundShow:h,mobileBordersShow:T,mobileBorderRadiusShow:_,mobileBoxShadowShow:E,handleToggleMobileSize:K,handleToggleMobileBackground:U,handleToggleMobileBorder:O,handleToggleMobileBorderRadius:L,handleToggleMobileBoxShadow:R,oneMobileBorderRadiusValue:be,setOneMobileBorderRadiusValue:ae,mobileBorders:Ce,mobileBoxShadow:de})}):(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(Cl,{form:e,onBorderSideClear:i,elementSettings:a,paddingShow:d,paddingsExt:c,backgroundShow:p,bordersShow:f,borderRadiusShow:x,boxShadowShow:k,handleToggleShowPadding:w,handleTogglePadding:v,handleToggleBackground:P,handleToggleBorder:j,handleToggleBorderRadius:C,handleToggleBoxShadow:I,backgroundRepeatOptions:G,backgroundSizeOptions:J,backgroundImageEmpty:te,oneBorderRadiusValue:oe,setOneBorderRadiusValue:he,boxShadow:ke})})}),gd=["borderTop","borderBottom","borderLeft","borderRight"],Al=({elementSettings:e,formName:i})=>{const{__:l}=r.useI18n(),s=r.useSendPostMessage(),[a]=t.ui_kit$Form.useForm(),{token:d}=(0,t.ui_kit$useToken)(),c=r.useAppConfig(),p=r.useSelector(r.selectEmailViewType),f=r.useSelector(r.selectMobileViewActive),x=r.useSelector(r.selectIsCodeMode),k=r.useSelector(r.selectCodeModeDirection),[b,h]=(0,n.useState)({}),[T,_]=(0,n.useState)(!0),[E,w]=(0,n.useState)({}),[v,P]=(0,n.useState)({}),[j,C]=(0,n.useState)(!0),[I,K]=(0,n.useState)(e.customTable?.backgroundImage[0].value===""),[U,O]=(0,n.useState)(),[L,R]=(0,n.useState)(!1),[G,J]=(0,n.useState)(!1),[te,oe]=(0,n.useState)(!1),[he,be]=(0,n.useState)(!1),[ae,ke]=(0,n.useState)(!1),[Ce,de]=(0,n.useState)(!1),[Fe,je]=(0,n.useState)(!1),[re,Be]=(0,n.useState)(!1),[ce,ee]=(0,n.useState)(!0),[me,ue]=(0,n.useState)(!0),[Z,Q]=(0,n.useState)(!0),[W,q]=(0,n.useState)(!1),[se,xe]=(0,n.useState)("https://"),[ge,Ne]=(0,n.useState)({}),[ye,$e]=(0,n.useState)(!1),[X,ne]=(0,n.useState)(!1),[we,V]=(0,n.useState)(!1),[Te,Ie]=(0,n.useState)({}),ve=(0,n.useRef)(null),Ve=(0,n.useRef)(),Me=t.ui_kit$Form.useWatch([],a),He=[{label:l("Not defined"),value:"none"},{label:l("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:l("Repeat background (repeat)"),value:"repeat"},{label:l("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:l("Repeat background vertically (repeat-y)"),value:"repeat-y"}],le=[{label:l("Not defined"),value:""},{label:l("Contain"),value:"contain"},{label:l("Cover"),value:"cover"}],Y={width:"",style:"",color:""},D=x&&k!=="bottom",ie=r.BASIC_BORDER_COLOR,Ee=i==="Edit selected table cells"||!1,[Ae,We]=(0,n.useState)(null);(0,n.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&We(!0)},[]);const Ge=H=>{s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_TEXT,action:H,locale:"en_US"})},Ye=[{key:"1",label:l("This element"),onClick:()=>Ge("typograf")},{key:"2",label:l("The whole email"),onClick:()=>Ge("typograf_all")}];let $="";(0,n.useEffect)(()=>{if(e){kt(e)&&Be(!0);const H=e.border,Re=e.boxShadow,pe=e.customTable?.mobileBorder,ze=e.customTable?.mobileBoxShadow,co=e.customTable?.cellBorders;Ie(H),h(Re),w(pe),P(ze),Ne(co);const so=Ee?e?.customTable?.cell_borderPosition:e?.customTable?.borderPosition,mo=Object.keys(pe).find(ko=>pe[ko]?.width||pe[ko]?.style||pe[ko]?.color);a.setFieldsValue({...e,width:e.width?.value,widthDim:e.width?.dim,maxWidth:e.maxWidth?.value,maxWidthDim:e.maxWidth?.dim,minWidth:e.minWidth?.value,minWidthDim:e.minWidth?.dim,show:e.show?e.show:"all",mobileAlign:e.mobileAlign?.value,mobileBorderPosition:mo||"all",mobileBorderWidth:pe[mo]?.width!==null?pe[mo]?.width:"",mobileBorderColor:pe[mo]?.color||"",mobileBorderStyle:pe[mo]?.style||"",...nt(e),exportAsPicture:e?.exportAsPicture,paddingLeftRight:u(e.customTable?.paddingLeftRight.replace(/px$/,"")),paddingTopBottom:u(e.customTable?.paddingTopBottom.replace(/px$/,"")),paddingRight:u(e.customTable?.paddingRight.replace(/px$/,"")),paddingLeft:u(e.customTable?.paddingLeft.replace(/px$/,"")),paddingTop:u(e.customTable?.paddingTop.replace(/px$/,"")),paddingBottom:u(e.customTable?.paddingBottom.replace(/px$/,"")),backgroundColor:u(e.customTable?.backgroundColor),backgroundImage:u(e.customTable?.backgroundImage[0].value),backgroundPositionX:u(e.customTable?.backgroundPositionX),backgroundPositionY:u(e.customTable?.backgroundPositionY),backgroundRepeat:u(e.customTable?.backgroundRepeat),backgroundSize:u(e.customTable?.backgroundSize),borderAll:u(e.customTable?.borderAll),borderRadiusAll:u(e.customTable?.borderRadius.all),borderRadiusTopLeft:u(e.customTable?.borderRadius.topLeft),borderRadiusBottomLeft:u(e.customTable?.borderRadius.bottomLeft),borderRadiusTopRight:u(e.customTable?.borderRadius.topRight),borderRadiusBottomRight:u(e.customTable?.borderRadius.bottomRight),borderRadius:{all:u(e.customTable?.borderRadius.all),topLeft:u(e.customTable?.borderRadius.topLeft),topRight:u(e.customTable?.borderRadius.topRight),bottomLeft:u(e.customTable?.borderRadius.bottomLeft),bottomRight:u(e.customTable?.borderRadius.bottomRight)},borderTop:u(e.customTable?.borderTop),borderBottom:u(e.customTable?.borderBottom),borderLeft:u(e.customTable?.borderLeft),borderRight:u(e.customTable?.borderRight),borderPosition:so||"borderAll",boxShadowInset:u(e.customTable?.boxShadow?.inset)||!1,boxShadowHOffset:u(e.customTable?.boxShadow?.hOffset),boxShadowVOffset:u(e.customTable?.boxShadow?.vOffset),boxShadowBlurRadius:u(e.customTable?.boxShadow?.blurRadius),boxShadowSpreadRadius:u(e.customTable?.boxShadow?.spreadRadius),boxShadowColor:u(e.customTable?.boxShadow?.color),mobileBoxShadowInset:u(e.customTable?.mobileBoxShadow?.inset)||!1,mobileBoxShadowHOffset:u(e.customTable?.mobileBoxShadow?.hOffset),mobileBoxShadowVOffset:u(e.customTable?.mobileBoxShadow?.vOffset),mobileBoxShadowBlurRadius:u(e.customTable?.mobileBoxShadow?.blurRadius),mobileBoxShadowSpreadRadius:u(e.customTable?.mobileBoxShadow?.spreadRadius),mobileBoxShadowColor:u(e.customTable?.mobileBoxShadow?.color),mobileBackgroundColor:u(e.customTable?.mobileBackgroundColor?.value!=="none"?e.customTable?.mobileBackgroundColor?.value:""),mobileWidth:po(e.customTable?.mobileWidth?.value),mobileWidthDim:e.customTable?.mobileWidth?.dim,mobileHeight:po(e.customTable?.mobileHeight?.value),mobileHeightDim:e.customTable?.mobileHeight?.dim,mobileBorderRadiusAll:u(e.customTable?.mobileBorderRadius.all),mobileBorderRadiusTopLeft:u(e.customTable?.mobileBorderRadius.topLeft!==null?e.customTable?.mobileBorderRadius.topLeft:e.customTable?.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:u(e.customTable?.mobileBorderRadius.bottomLeft!==null?e.customTable?.mobileBorderRadius.bottomLeft:e.customTable?.mobileBorderRadius.all),mobileBorderRadiusTopRight:u(e.customTable?.mobileBorderRadius.topRight!==null?e.customTable?.mobileBorderRadius.topRight:e.customTable?.mobileBorderRadius.all),mobileBorderRadiusBottomRight:u(e.customTable?.mobileBorderRadius.bottomRight!==null?e.customTable?.mobileBorderRadius.bottomRight:e.customTable?.mobileBorderRadius.all),cellBackgroundColor:u(e.customTable?.cellBackgroundColor),cell_borderPosition:u("cell_borderAll"),cell_borderAll:u(e.customTable?.cell_borderAll),cell_borderTop:u(e.customTable?.cell_borderTop),cell_borderBottom:u(e.customTable?.cell_borderBottom),cell_borderLeft:u(e.customTable?.cell_borderLeft),cell_borderRight:u(e.customTable?.cell_borderRight),cell_paddingLeftRight:u(e.customTable?.cell_paddingLeftRight?.replace(/px$/,"")),cell_paddingTopBottom:u(e.customTable?.cell_paddingTopBottom?.replace(/px$/,"")),cell_paddingRight:u(e.customTable?.cell_paddingRight?.replace(/px$/,"")),cell_paddingLeft:u(e.customTable?.cell_paddingLeft?.replace(/px$/,"")),cell_paddingTop:u(e.customTable?.cell_paddingTop?.replace(/px$/,"")),cell_paddingBottom:u(e.customTable?.cell_paddingBottom?.replace(/px$/,"")),fontFamily:u(e.customTable?.fontFamily),fontSize:u(e.customTable?.fontSize),lineHeight:u(e.customTable?.lineHeight),textStrong:u(e.customTable?.textStrong),textItalic:u(e.customTable?.textItalic),textStrikethrough:u(e.customTable?.textStrikethrough),textUnderline:u(e.customTable?.textUnderline),textLink:u(e.customTable?.textLink),linkHref:u(e.customTable?.linkHref),linkTarget:u(e.customTable?.linkTarget),textColor:u(e.customTable?.textColor),textBackgroundColor:u(e.customTable?.textBackgroundColor),textAlign:u(e.customTable?.textAlign),valign:u(e.customTable?.textValign)}),!u(e.customTable?.borderRadius.all)&&(u(e.customTable?.borderRadius.topLeft)||u(e.customTable?.borderRadius.bottomLeft)||u(e.customTable?.borderRadius.topRight)||u(e.customTable?.borderRadius.bottomRight))?_(!1):_(!0),!u(e.customTable?.mobileBorderRadius.all)&&u(e.customTable?.mobileBorderRadius.topLeft)||u(e.customTable?.mobileBorderRadius.bottomLeft)||u(e.customTable?.mobileBorderRadius.topRight)||u(e.customTable?.mobileBorderRadius.bottomRight)?C(!1):C(!0),K(e.customTable?.backgroundImage[0].value===""),O(ko=>H[so]?.width||H[so]?.style||H[so]?.color?!0:ko),J(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),be(!!e.boxShadow),V(!!e.width?.value||!!e.minWidth?.value||!!e.maxWidth?.value),de(!!e.customTable?.mobileWidth.value),ne(!!e.exportAsPicture)}},[a,e]),(0,n.useEffect)(()=>{const H=a.getFieldValue("linkHref");typeof e.customTable?.linkHref=="string"&&$e(!0),ve&&!H&&($e(!1),a.setFieldsValue({linkHref:null})),ve.current=H||null},[Me?.textLink,Me?.linkHref,e.customTable?.linkHref,a]),(0,n.useEffect)(()=>{e.customTable?.linkHref&&Wo(e.customTable?.linkHref||"",xe),a.setFieldsValue({linkHref:typeof e.customTable?.linkHref=="string"?e.customTable.linkHref:"https://"})},[a,e,xe]);const N=H=>{a.setFieldValue("linkHref",H!=="mergetag"?H:""),xe(H)},y=H=>{const Re=a.getFieldsValue(!0),pe=Object.keys(H)[0];let ze;const co=gd.includes(pe)&&Re[pe]?{...Re[pe],width:Re[pe].width===""?Re.borderAll?.width||"1":Re[pe].width,color:Re[pe].color===""?Re.borderAll?.color||ie:Re[pe].color,style:Re[pe].style===""?Re.borderAll?.style||"solid":Re[pe].style}:null,so=["top","right","bottom","left"],mo="em-mob-border_",ko=Bo=>({...r.RESET_BORDER_PARAMS[Bo],classNamePrefix:`${mo}${Bo}-`}),qo=(Bo,ro,Ro,Vo)=>so.reduce((_o,Ho)=>(_o[Ho]={...Bo,[Ro]:Ho===ro?Vo:Bo[Ro],classNamePrefix:`${mo}${Ho}-`},_o),{}),Co=(Bo,ro,Ro,Vo)=>{const _o=Vo.mobileBorderPosition,Ho=_o==="all",vt=ro===""||ro==null;let Lo;Ho?Lo={all:{...Ro.all,[Bo]:vt?null:ro,classNamePrefix:`${mo}all-`},...so.reduce((Ct,ni)=>({...Ct,[ni]:ko(ni)}),{})}:vt?Lo={...Ro,[_o]:ko(_o),all:{...r.RESET_BORDER_PARAMS.all}}:Ro.all?.color!=null&&Ro.all?.width!=null&&Ro.all?.style!=null?Lo={...qo(Ro.all,_o,Bo,ro),all:{...r.RESET_BORDER_PARAMS.all}}:Lo={...Ro,[_o]:{...Ro[_o],[Bo]:ro,classNamePrefix:`${mo}${_o}-`},all:{...r.RESET_BORDER_PARAMS.all}};const It=Ho?Lo.all:Lo[_o],Er={mobileBorderColor:It?.color??ie,mobileBorderWidth:It?.width??1,mobileBorderStyle:It?.style??"solid"};return{newBorders:Lo,sending:{mobileBorder:Lo},formUpdates:Er}};switch(pe){case"exportAsPicture":ze={exportAsPicture:Re.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":ze={boxShadow:{hOffset:Re.boxShadowHOffset,vOffset:Re.boxShadowVOffset,blurRadius:Re.boxShadowBlurRadius,spreadRadius:Re.boxShadowSpreadRadius,color:Re.boxShadowColor,inset:Re.boxShadowInset}};break;case"width":ze={[pe]:{value:H[pe],dim:Re.widthDim}};break;case"widthDim":ze={width:{value:Re.width,dim:H[pe]}};break;case"maxWidth":ze={[pe]:{value:H[pe],dim:Re.maxWidthDim}};break;case"maxWidthDim":ze={maxWidth:{value:Re.maxWidth,dim:H[pe]}};break;case"minWidth":ze={[pe]:{value:H[pe],dim:Re.minWidthDim}};break;case"minWidthDim":ze={minWidth:{value:Re.minWidth,dim:H[pe]}};break;case"backgroundImage":K(H[pe]===""),ze={[pe]:[{...e.customTable?.backgroundImage[0],value:H[pe]}],backgroundSize:"cover"},a.setFieldsValue({backgroundColor:""});break;case"backgroundColor":K(!0),ze=H,a.setFieldsValue({backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:""});break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":ze={borderRadius:{[z.BORDER_RADIUS_POSITION[pe]]:+H[pe]}};break;case"mobileWidth":ze={[pe]:{classNamePrefix:"em-mob-width-",value:H[pe],dim:Re.mobileWidthDim}};break;case"mobileWidthDim":ze={mobileWidth:{classNamePrefix:"em-mob-width-",value:Re.mobileWidth||100,dim:H[pe]}};break;case"mobileHeight":ze={[pe]:{classNamePrefix:"em-mob-height-",value:H[pe],dim:Re.mobileHeightDim}};break;case"mobileBorderStyle":case"mobileBorderColor":case"mobileBorderWidth":const Bo={mobileBorderStyle:"style",mobileBorderColor:"color",mobileBorderWidth:"width"}[pe],{newBorders:ro,sending:Ro,formUpdates:Vo}=Co(Bo,H[pe],E,Re);Object.assign(Re,Vo),w(ro),ze=Ro;break;case"mobileBorderPosition":a.setFieldsValue({mobileBorderWidth:E[H[pe]].width||"",mobileBorderColor:E[H[pe]].color||"",mobileBorderStyle:E[H[pe]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":ze={mobileBorderRadius:{[z.MOBILE_BORDER_RADIUS_POSITION[pe]]:H[pe],classNamePrefix:"em-mob-border_radius_"+z.MOBILE_BORDER_RADIUS_POSITION[pe]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":ze={mobileBoxShadow:{hOffset:Re.mobileBoxShadowHOffset,vOffset:Re.mobileBoxShadowVOffset,blurRadius:Re.mobileBoxShadowBlurRadius,spreadRadius:Re.mobileBoxShadowSpreadRadius,color:Re.mobileBoxShadowColor,inset:Re.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileBackgroundColor":case"mobileBackgroundImage":case"mobileBackgroundPositionX":case"mobileBackgroundPositionY":case"mobileBackgroundRepeat":case"mobileBackgroundSize":if(ze=_t(H),!ze)return;break;case"mobileAlign":ze={[pe]:{classNamePrefix:"em-mob-table_align-",value:H[pe]}};break;case"borderPosition":ze=H,s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:ze});break;case"borderAll":H[pe]?.style===""?a.setFieldsValue({borderAll:Y}):a.setFieldsValue({borderTop:Y,borderBottom:Y,borderLeft:Y,borderRight:Y}),ze=H;break;case"borderTop":a.setFieldsValue({borderTop:co}),H[pe]?.style===""?a.setFieldsValue({borderTop:Y}):a.setFieldsValue({borderAll:Y}),ze=H;break;case"borderBottom":a.setFieldsValue({borderBottom:co}),H[pe]?.style===""?a.setFieldsValue({borderBottom:Y}):a.setFieldsValue({borderAll:Y}),ze=H;break;case"borderLeft":a.setFieldsValue({borderLeft:co}),H[pe]?.style===""?a.setFieldsValue({borderLeft:Y}):a.setFieldsValue({borderAll:Y}),ze=H;break;case"borderRight":a.setFieldsValue({borderRight:co}),H[pe]?.style===""?a.setFieldsValue({borderRight:Y}):a.setFieldsValue({borderAll:Y}),ze=H;break;case"cell_borderPosition":ze=H,s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:ze});break;case"fontSize":case"lineHeight":if(H[pe]===null||H[pe]===""||H[pe]===void 0)return;ze=H;break;case"linkHref":{const _o=ot(H[pe]);_o!==H[pe]&&a.setFieldValue("linkHref",_o),ze={linkHref:_o},Wo(_o,xe);break}default:ze=H}pe!=="borderPosition"&&s({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:ze})},M=(0,n.useCallback)(()=>{td(a,Ee,O,q,U,Ie,$)},[a,Ee,U,$]),fe=(0,n.useCallback)(()=>{id(a,R,L,E,w,s,e)},[a,L,E,s,e]),Le=(0,n.useCallback)(()=>{rd(a,J,G,_,s,e,$)},[a,G,_,s,e,$]),eo=(0,n.useCallback)(()=>{ld(a,oe,te,s,e)},[a,te,s,e]),Xe=(0,n.useCallback)(()=>{sd(a,be,he,s,e)},[a,he,s,e]),lo=(0,n.useCallback)(()=>{ad(a,ke,ae,s,e)},[a,ae,s,e]),Qe=(0,n.useCallback)(()=>{nd(a,de,Ce,s,e)},[a,Ce,s,e]),uo=(0,n.useCallback)(()=>{dd(je)},[je]),Eo=(0,n.useCallback)(()=>{cd(a,Be,re,s,e)},[a,re,s,e]),B=(0,n.useCallback)(()=>{ud(a,ee,ce,s,e)},[a,ce,s,e]),S=(0,n.useCallback)(()=>{md(a,ue,me,s,e)},[a,me,s,e]),m=(0,n.useCallback)(()=>{pd(Q)},[Q]),F=(0,n.useCallback)(()=>{hd(a,ue,me,s,e)},[a,me,s,e]);return(0,o.jsxs)(t.ui_kit$Form,{form:a,layout:"vertical",name:i,initialValues:{paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",cell_paddingTop:"",cell_paddingLeft:"",cell_paddingRight:"",cell_paddingBottom:"",cell_paddingLeftRight:"",cell_paddingTopBottom:"",borderAll:{width:"",style:"",color:""},borderTop:{width:"",style:"",color:""},borderBottom:{width:"",style:"",color:""},borderLeft:{width:"",style:"",color:""},borderRight:{width:"",style:"",color:""},cellBackgroundColor:"",backgroundImageForCell:"",cellBackgroundPositionX:"",cellBackgroundPositionY:"",cellBackgroundRepeat:"",cellBackgroundSize:"",backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,show:"all",width:{value:"",dim:""},maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",mobileAlign:"",border:"",boxShadow:"",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"px",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBorderAll:"",mobileBorderTop:"",mobileBorderBottom:"",mobileBorderLeft:"",mobileBorderRight:"",mobileBoxShadow:"",mobileBackgroundColor:"",mobileBackgroundImage:"",cell_border:"",cell_borderColor:"",cell_borderWidth:"",cell_borderStyle:"",cell_borderPosition:"cell_borderAll",cell_borderAll:{color:"",width:"",style:""},cell_borderTop:{color:"",width:"",style:""},cell_borderBottom:{color:"",width:"",style:""},cell_borderLeft:{color:"",width:"",style:""},cell_borderRight:{color:"",width:"",style:""},cell_borderRadiusAll:"",cell_RadiusTopLeft:"",cell_RadiusBottomLeft:"",cell_RadiusTopRight:"",cell_RadiusBottomRight:"",fontFamily:"",fontSize:"",lineHeight:"",textStrong:"",textItalic:"",textStrikethrough:"",textUnderline:"",textLink:"",linkHref:"",textColor:"",textAlign:"",verticalAlign:"",textBackgroundColor:"",valign:""},onValuesChange:y,autoComplete:"off",className:"element-controls",style:{padding:0,display:"flex",flexDirection:"column"},children:[!D&&(0,o.jsx)(t.ui_kit$Tooltip,{title:l("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Alert,{className:"selected_form-mobile-props-title",title:l("Appearance on mobile devices"),type:"info"})}),Ee?(0,o.jsx)("div",{id:"selected_element_form_desktop_props",children:(0,o.jsx)(bd,{form:a,onBorderSideClear:y,formValues:Me,elementSettings:e,appConfig:c,token:d,isMacOS:Ae,__:l,handleToggleShowPaddingCell:m,handleTogglePaddingCell:F,handleToggleBackground:uo,handleToggleBorder:M,handleToggleBorderRadius:Le,paddingCellShow:Z,paddingsExt:me,backgroundShow:Fe,cellBordersShow:W,borderRadiusShow:G,oneBorderRadiusValue:T,setOneBorderRadiusValue:_,backgroundImageEmpty:I,backgroundRepeatOptions:He,backgroundSizeOptions:le,sendAction:Ge,typografItems:Ye,textInputRef:Ve,linkProtocol:se,handleLinkProtocolsChange:N,isCodeVision:D})}):(0,o.jsx)(fd,{form:a,onBorderSideClear:y,elementSettings:e,handleToggleShowPadding:B,handleTogglePadding:S,handleToggleBackground:uo,handleToggleBorder:M,handleToggleBorderRadius:Le,handleToggleBoxShadow:Xe,handleToggleMobileSize:Qe,handleToggleMobileBackground:Eo,handleToggleMobileBorder:fe,handleToggleMobileBorderRadius:eo,handleToggleMobileBoxShadow:lo,paddingShow:ce,paddingsExt:me,backgroundShow:Fe,bordersShow:U,borderRadiusShow:G,boxShadowShow:he,mobileSizeShow:Ce,mobileBackgroundShow:re,mobileBordersShow:L,mobileBorderRadiusShow:te,mobileBoxShadowShow:ae,oneBorderRadiusValue:T,setOneBorderRadiusValue:_,oneMobileBorderRadiusValue:j,setOneMobileBorderRadiusValue:C,backgroundImageEmpty:I,backgroundRepeatOptions:He,backgroundSizeOptions:le,boxShadow:b,mobileBorders:E,mobileBoxShadow:v,elementViewType:p,mobileViewActive:f})," "]})};Al.propTypes={elementSettings:g.default.object.isRequired};var dt=({className:e=null,formSettings:i,emailElementType:l,formName:s})=>{const a=r.useDispatch(),d=wo.useSendStyleToggleToIframe(),c=(0,n.useRef)(),p=r.useSelector(r.selectActiveSettingsTab),f=r.useSelector(r.selectElementSettings$1),x=r.useSelector(r.selectElementSettings),k=r.useContainer(),b=r.getComponentRegistry(k),h=l==="email"?f:x,T=h.type,_=T===r.ELEMENT_TYPES.CAROUSEL||T===r.ELEMENT_TYPES.IMG?i.settings:h,[E,w]=(0,n.useState)(_),[v,P]=(0,n.useState)(_);_!==v&&(P(_),w(_));const j=C=>{const I=C.data.operation,K=C.data.action;if(I===r.EVENT_TYPES.APPLICATION_ACTION){let O=function(L,R=null){const G={[L]:R||!E[L]};d(G,E.type),a(r.setEmailSettings(G)),w(J=>({...J,...G}))};var U=O;K==="toggle_strong"&&O("textStrong"),K==="toggle_italic"&&O("textItalic"),K==="toggle_underline"&&O("textUnderline"),K==="toggle_strikethrough"&&O("textStrikethrough"),K==="textAlign_left"&&O("textAlign","left"),K==="textAlign_right"&&O("textAlign","right"),K==="textAlign_center"&&O("textAlign","center")}};return r.useListenPostMessage(j),(0,o.jsx)("div",{className:"selected-element-panel",children:(0,o.jsx)(r.CSSTransition,{nodeRef:c,in:p===r.PROPERTIES,timeout:300,classNames:"transition",children:(0,o.jsxs)("div",{ref:c,className:(0,De.default)("selected-element-panel-content",{[e]:e}),children:[i?.type==="advanced"&&i?.content?(0,o.jsx)(n.Fragment,{children:b.getReactElement(i.content)},i.instanceKey):null,(h.type===r.ELEMENT_TYPES.IMG||h.type===r.ELEMENT_TYPES.COUNTDOWN||h.type===r.ELEMENT_TYPES.VIDEO)&&(0,o.jsx)($r,{elementSettings:h}),h.type===r.ELEMENT_TYPES.TEXT&&(0,o.jsx)(pn,{elementSettings:h}),h.type===r.ELEMENT_TYPES.LINK&&(0,o.jsx)(el,{elementSettings:h}),h.type===r.ELEMENT_TYPES.TABLE&&(0,o.jsx)(Zr,{elementSettings:h}),h.type===r.ELEMENT_TYPES.CUSTOM_TABLE&&(0,o.jsx)(Al,{elementSettings:h,formName:s}),(h.type===r.ELEMENT_TYPES.TD||h.type===r.ELEMENT_TYPES.STRUCTURE||h.type===r.ELEMENT_TYPES.GROUP||h.type===r.ELEMENT_TYPES.COLUMN)&&(0,o.jsx)(sl,{elementSettings:h}),h.type===r.ELEMENT_TYPES.VAR&&(0,o.jsx)(fl,{elementSettings:h}),h.type===r.ELEMENT_TYPES.BUTTON&&(0,o.jsx)(bl,{elementSettings:h}),h.type===r.ELEMENT_TYPES.DIV&&(0,o.jsx)(dl,{elementSettings:h}),h.type===r.ELEMENT_TYPES.VINDENT&&(0,o.jsx)(il,{elementSettings:h}),h.type===r.ELEMENT_TYPES.FLOAT_BLOCK&&(0,o.jsx)(ml,{elementSettings:h}),i.type===r.ELEMENT_TYPES.CAROUSEL&&(0,o.jsx)(El,{elementSettings:i}),i.type===r.ELEMENT_TYPES.ACCORDION&&(0,o.jsx)(Bl,{elementSettings:i}),i.type===r.ELEMENT_TYPES.SOCIAL&&(0,o.jsx)(vl,{elementSettings:i})]})})})};dt.propTypes={className:g.default.string,formName:g.default.string};function Yo(){return!!document.querySelector(".selected-element-panel__columns-settings__links__add")?.closest(".selected-element-panel")}var Nl=({emailElementType:e,isSelectedElement:i=!1,selectedElement:l={parent:!1}})=>{const{__:s}=r.useI18n(),a=r.useDispatch(),d=r.useSendPostMessage(),[c]=t.ui_kit$Form.useForm(),p=(0,n.useRef)(),f=(0,n.useRef)(),x=r.useSelector(r.selectElementSettings$1),k=r.useSelector(r.selectElementSettings),b=r.useAppConfig(),h=l||(e==="email"?x:k),[T,_]=(0,n.useState)(h.floatBlocks?.wrap),[E,w]=(0,n.useState)(h.floatBlocks?.dirRevers),[v,P]=(0,n.useState)(null),[j,C]=(0,n.useState)(0),[I,K]=(0,n.useState)([]),U=r.useSelector(r.selectEmailViewType),O=(0,n.useCallback)(re=>{a(e==="email"?r.setElementSettings$1(re):r.setElementSettings(re))},[a,e]);(0,n.useEffect)(()=>{if(h&&JSON.stringify(h)!=="{}"&&c._init){if(c.resetFields(),c.setFieldsValue({gap:h.floatBlocks?.gap,gapMobile:h.floatBlocks?.gapMobile,gapDim:"px",valign:h.floatBlocks?.valign}),h.floatBlocks?.items.length>0){let ee=function(me,ue){if(me.length!==ue.length)return!1;for(let Z=0;Z<me.length;Z++)if(me[Z]!==ue[Z])return!1;return!0};var re=ee;const Be=h.floatBlocks.items.reduce((me,ue)=>me+ue.width,0),ce=h.floatBlocks.items.map(me=>((me.width||0)/Be*100).toFixed(1));C(Be),!ee(ce,I)&&h.changeKey!=="gap"&&K(ce),h.floatBlocks.items.forEach((me,ue)=>c.setFieldsValue({["width-"+ue]:me.width||0})),h.floatBlocks.items.length>=8?document.querySelector(".selected-element-panel__columns-settings__links__add")?.classList.add("noactive"):document.querySelector(".selected-element-panel__columns-settings__links__add")?.classList.contains("noactive")&&document.querySelector(".selected-element-panel__columns-settings__links__add")?.classList.remove("noactive")}_(h.floatBlocks?.wrap)}},[c,h,v,I]);let L=0;h.floatBlocks?.items.length>0&&(L=h.floatBlocks.items.length);const R=(re,Be)=>{Object.keys(Be).forEach(ce=>{if(ce.includes("width")){const ee=parseInt(ce.match(/\d+/));c.setFieldsValue({[ce]:re.items[ee]})}})},[G,J]=(0,n.useState)(!1);(0,n.useEffect)(()=>{const re=()=>J(!0),Be=()=>J(!1);return document.addEventListener("keyup",Be),document.addEventListener("keydown",re),()=>{document.removeEventListener("keyup",Be),document.removeEventListener("keydown",re)}},[]);const te=re=>{f.current&&G&&clearTimeout(f.current),f.current=setTimeout(()=>Be(re),50);function Be(ce){const ee=c.getFieldsValue(!0),me=Object.keys(ce)[0];if(P(me),me.includes("width")){if(ee[me]&&ee[me]>=30){let ue={items:[],gap:ee.gap,valign:ee.valign,activateSection:i?void 0:"structure"},Z=0;if(document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").length>1){Z=parseFloat(Object.keys(ce)[0].substring(Object.keys(ce)[0].length-1));const Q=ee["width-"+(Z+1)]?Z+1:0;let W=j;Object.keys(ee).forEach(q=>{q.includes("width")&&q.indexOf("width-"+Q)===-1&&(W-=ee[q])}),ee["width-"+Q]=W}Object.keys(ee).forEach(Q=>{Q.includes("width")&&ue.items.push(ee[Q])}),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksWidths",settings:ue}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,...ue,items:h.floatBlocks.items.map((Q,W)=>({...h.floatBlocks.items[W],width:ue.items[W]}))},changeKey:me})}}else if(me==="gap"){const ue={items:h.floatBlocks.items.map(q=>q.width),gap:h.floatBlocks.gap},Z=ue.items.reduce((q,se)=>q+se,0)+(ue.items.length-1)*ue.gap,Q=ee.gap,W=Z-(ue.items.length-1)*Q;if(W>ue.items.length*30||h.floatBlocks.gap-ce>=0){const q=(Ne,ye)=>Math.round(ye*Ne/100);let se=ue.items.map((Ne,ye)=>q(I[ye],W));const xe=Z-(se.reduce((Ne,ye)=>Ne+ye,0)+(ue.items.length-1)*Q);if(xe!==0){const Ne=se.length-Math.abs(xe);se=se.map((ye,$e)=>Ne<=$e?ye+(xe>0?1:-1):ye)}let ge={items:se,gap:Q||0};R(ge,ee),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksGap",settings:ge,editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,...ge,items:h.floatBlocks.items.map((Ne,ye)=>({...Ne,width:ge.items[ye]}))},changeKey:me})}}else if(me==="valign"){let ue={valign:ee.valign};d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksValign",settings:ue,editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,...ue},changeKey:me})}else if(me==="gapMobile"){let ue={mobileHeight:{classNamePrefix:"em-mob-height-",value:ce[me],dim:"px"}};d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksGapMobile",settings:ue}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,gapMobile:ue.mobileHeight.value},changeKey:me})}setTimeout(()=>p?.current&&p.current.focus({cursor:"end"}),600)}},oe=()=>{const re=c.getFieldsValue(!0),Be=h.floatBlocks.items.map(W=>W.width);let ce={items:[],gap:re.gap};const ee=Be.reduce((W,q)=>W+q,0),me=Be.length,ue=Math.ceil(j/me)*me,Z=ue/me,Q=ee-ue;if(ce.items=Array(me).fill(Z),Q!==0){const W=Be.length-Math.abs(Q);ce.items=ce.items.map((q,se)=>W<=se?q+(Q>0?1:-1):q)}R(ce,re),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksWidths",settings:ce,editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,...ce,items:h.floatBlocks.items.map((W,q)=>({...W,width:ce.items[q]}))},changeKey:"width"})},he=re=>{const Be=c.getFieldsValue(!0),ce=h.floatBlocks.items.map(ge=>ge.width),ee=h.floatBlocks.gap||20,me=re.cols-ce.length;let ue=[],Z=ce.reduce((ge,Ne)=>ge+Ne,0);re.cols>=ce.length?Z-=ee*me:Z+=ee*Math.abs(me);const Q=Math.round(Z/re.cols);function W(ge,Ne){const ye=[];for(let $e=0;$e<ge;$e++)ye.push(re.width?.[$e]?Math.round(Z/100*re.width?.[$e]):Ne);return ye}ue=W(re.cols,Q);const q=Z-ue.reduce((ge,Ne)=>ge+Ne,0);if(q!==0){let ge=ue.map((ye,$e)=>[$e,ye]).filter(ye=>ye[1]>30);const Ne=ge.length-Math.abs(q);ge=ge.map((ye,$e)=>{const X=Ne<=$e?ye[1]+(q>0?1:-1):ye[1];return[ye[0],X]}),ge.map(ye=>(ue[ye[0]]=ye[1],ye))}let se={items:ue,gap:Be.gap||20};const xe=ue.reduce((ge,Ne)=>ge+Ne,0);K(ue.map(ge=>(ge/xe*100).toFixed(1))),d({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksPreset",settings:se,editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,...se,items:se.items.map((ge,Ne)=>({width:ge,current:!1}))},changeKey:"width"})},be=()=>{const re=c.getFieldsValue(!0);if(L<8){const Be=h.floatBlocks.items.map(W=>W.width),ce=h.floatBlocks.gap,ee=Be.reduce((W,q)=>W+(q>30?q:0),0),me=(ee-30-ce)/ee,ue=Be.map(W=>W>30?Math.round(W*me):W).reduce((W,q)=>W+(q>30?q:0),0);let Z=Be.map(W=>W>30?Math.round(W*me):W);Z.push(30);const Q=ee-ue-30-ce;if(Q!==0){let W=Z.map((se,xe)=>[xe,se]).filter(se=>se[1]>30);const q=W.length-Math.abs(Q);W=W.map((se,xe)=>{const ge=q<=xe?se[1]+(Q>0?1:-1):se[1];return[se[0],ge]}),W.map(se=>(Z[se[0]]=se[1],se))}d({operation:r.EVENT_TYPES.SANDBOX_FLOATBLOCK_ADD,settings:{gap:re.gap,gapMobile:re.gapMobile,minWidth:30},editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,items:Z.map((W,q)=>({width:W,current:h.floatBlocks.items[q]?.current||!1}))},changeKey:"width"})}else document.querySelector(".selected-element-panel__columns-settings__links__add")?.classList.add("noactive")},ae=re=>{const Be=c.getFieldsValue(!0);let ce=0;document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").forEach((ge,Ne)=>{ge===re.target.closest(".selected-element-panel__columns-settings__controls__column")&&(ce=Ne)});const ee=+h.floatBlocks.gap,me=+h.floatBlocks.items[ce].width+ee,ue=h.floatBlocks.items.map(ge=>+ge.width),Z=(ue.length-1)*ee,Q=ue.reduce((ge,Ne)=>ge+Ne,0)+Z,W=ue.length-1,q=Math.floor(me/W);let se=ue.filter((ge,Ne)=>Ne!==ce).map(ge=>ge+q);const xe=Q-(se.reduce((ge,Ne)=>ge+Ne,0)+(ue.length-2)*ee);if(xe!==0){const ge=se.length-Math.abs(xe);se=se.map((Ne,ye)=>ge<=ye?Ne+(xe>0?1:-1):Ne)}d({operation:r.EVENT_TYPES.SANDBOX_FLOATBLOCK_REMOVE,settings:{removedBlockIndex:ce,gap:Be.gap},editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,items:se.map((ge,Ne)=>({width:ge,current:h.floatBlocks.items.filter((ye,$e)=>$e!==ce)[Ne].current}))},changeKey:"width"})},ke=re=>{if(L>=8)return;const Be=c.getFieldsValue(!0);let ce=0;document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").forEach((ye,$e)=>{ye===re.target.closest(".selected-element-panel__columns-settings__controls__column")&&(ce=$e)});const ee=parseFloat(Be.gap)||0,me=h.floatBlocks.items.map(ye=>+ye.width),ue=me[ce],Z=me.reduce((ye,$e)=>ye+$e,0),Q=Z-ee,W=Z+ue,q=W>0?Q/W:1;let se=[];const xe=[];me.forEach((ye,$e)=>{se.push(Math.max(30,Math.round(ye*q))),xe.push(h.floatBlocks.items[$e]?.current||!1),$e===ce&&(se.push(Math.max(30,Math.round(ue*q))),xe.push(!1))});const ge=Q-se.reduce((ye,$e)=>ye+$e,0);if(ge!==0){let ye=se.map((X,ne)=>[ne,X]).filter(X=>X[1]>30);const $e=ye.length-Math.abs(ge);ye=ye.map((X,ne)=>[X[0],$e<=ne?X[1]+(ge>0?1:-1):X[1]]),ye.forEach(X=>se[X[0]]=X[1])}d({operation:r.EVENT_TYPES.SANDBOX_FLOATBLOCK_COPY,settings:{copiedBlockIndex:ce,gap:Be.gap,widths:se},editFromStructure:Yo()});const Ne=se.reduce((ye,$e)=>ye+$e,0);K(se.map(ye=>(ye/Ne*100).toFixed(1))),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,items:se.map((ye,$e)=>({width:ye,current:xe[$e]||!1}))},changeKey:"width"})},Ce=(0,n.useCallback)(re=>{const Be=".selected-element-panel__columns-settings__controls__column",ce=Array.from(document.querySelectorAll(Be)).indexOf(re.target.closest(Be)),ee=ce-1;if(ee<0)return;const me=h.floatBlocks,ue=me.items.map(({width:Z,current:Q})=>({width:Z,current:Q||!1}));[ue[ee],ue[ce]]=[ue[ce],ue[ee]],d({operation:r.EVENT_TYPES.SANDBOX_FLOATBLOCK_SWAP,settings:{indexA:ee,indexB:ce},editFromStructure:Yo()}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...me,items:ue},changeKey:"width"})},[h,O,i,d]),de=re=>{_(re),d({operation:r.EVENT_TYPES.SANDBOX_FLOATBLOCK_WRAP,settings:{wrap:!T}}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,wrap:!T},changeKey:"wrap"})},Fe=re=>{w(re),d({operation:r.EVENT_TYPES.SANDBOX_FLOATBLOCK_DIR,settings:{dirRevert:!E}}),O({...h,activateSection:i?void 0:"structure",floatBlocks:{...h.floatBlocks,dirRevert:!E},changeKey:"dir"})},je=()=>setTimeout(()=>p?.current&&p.current.focus({cursor:"end"}),300);return h.floatBlocks&&h.floatBlocks.items.length>0&&(0,o.jsx)(t.ui_kit$Form,{layout:"vertical",form:c,name:"float_blocks_settings_form",autoComplete:"off",initialValues:{gap:h.floatBlocks?.gap||0,gapDim:"px",gapMobile:h.floatBlocks?.gapMobile||0,valign:h.floatBlocks?.valign||"top",...h.floatBlocks?.items.reduce((re,{width:Be},ce)=>(re[`width-${ce}`]=Be,re),{})},onValuesChange:te,onFieldsChange:je,className:"element-controls",children:(0,o.jsxs)("div",{className:"selected-element-panel__columns-settings",style:{paddingTop:b.switchDesktopMobilePropsEnabled||b.stepToOtherElementEnabled||b.deleteButtonEnabled||h.type==="structure"?0:24},children:[h.floatBlocks.items.length===1&&(0,o.jsx)(t.ui_kit$Alert,{style:{marginBottom:10},title:s('The selected element is in the block that supports a multicolumn structure. To add a new column, click the "Add a column" button.'),type:"info"}),U!=="mobile"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"selected-element-panel__columns-settings__header",children:[(0,o.jsx)("span",{className:"selected-element-panel__columns-settings__header-title",children:s("Columns")}),(0,o.jsxs)("div",{className:"selected-element-panel__columns-settings__links",children:[(0,o.jsxs)("span",{className:"selected-element-panel__columns-settings__links__add",onClick:be,children:[(0,o.jsx)(r.EmIcons,{icon:"PlusCircleOutlined",component:t.icons$PlusCircleOutlined,size:16,strokeWidth:b.iconStrokeWidth})," ",s("Add column")]}),h.floatBlocks.items.length>1&&(0,o.jsx)("span",{onClick:oe,children:(0,o.jsxs)(t.ui_kit$Tooltip,{title:s("Make columns the same width."),children:[(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined})," ",s("Equalize")]})})]})]}),h.floatBlocks.items.length>1&&(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:16},children:(0,o.jsx)("div",{className:"selected-element-panel__columns-settings__controls",children:h.floatBlocks.items.map((re,Be)=>(0,o.jsxs)("div",{className:"selected-element-panel__columns-settings__controls__column "+(re.current?"current":""),style:{width:re.width/j*100+"%"},children:[Be>0&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Swap columns"),children:(0,o.jsx)("button",{type:"button",className:"selected-element-panel__columns-settings__controls__column__swap",onClick:Ce,children:(0,o.jsx)(r.EmIcons,{icon:"SwapHorizontalIcon",component:t.icons$SwapHorizontalIcon,size:15,strokeWidth:b.iconStrokeWidth})})}),h.floatBlocks.items.length>1&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Delete column"),children:(0,o.jsx)("button",{type:"button",className:"selected-element-panel__columns-settings__controls__column__remove",onClick:ae,children:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:15,strokeWidth:b.iconStrokeWidth,style:{color:"#ff4d4f"}})})}),h.floatBlocks.items.length<8&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Copy column"),children:(0,o.jsx)("button",{type:"button",className:"selected-element-panel__columns-settings__controls__column__copy",onClick:ke,children:(0,o.jsx)(r.EmIcons,{icon:"CopyOutlined",component:t.icons$CopyOutlined,size:15,strokeWidth:b.iconStrokeWidth})})}),(0,o.jsx)("div",{className:"selected-element-panel__columns-settings__controls__field",children:(0,o.jsx)(t.ui_kit$Form.Item,{label:"",name:"width-"+Be,children:(0,o.jsx)(t.ui_kit$InputNumber,{min:30,value:re.width||0,placeholder:s("Width"),ref:v==="width-"+Be&&p})})})]},"floatblock-"+Be))})}),(0,o.jsxs)("div",{className:"columns-presets",children:[(0,o.jsx)(t.ui_kit$Button,{onClick:()=>{he({cols:1})},children:(0,o.jsx)(r.EmIcons,{icon:"LayoutCol1",component:t.icons$LayoutCol1})}),(0,o.jsx)(t.ui_kit$Button,{onClick:()=>{he({cols:2})},children:(0,o.jsx)(r.EmIcons,{icon:"LayoutCol2",component:t.icons$LayoutCol2})}),(0,o.jsx)(t.ui_kit$Button,{onClick:()=>{he({cols:2,width:[66,34]})},children:(0,o.jsx)(r.EmIcons,{icon:"LayoutCol2WideLeft",component:t.icons$LayoutCol2WideLeft})}),(0,o.jsx)(t.ui_kit$Button,{onClick:()=>{he({cols:2,width:[34,66]})},children:(0,o.jsx)(r.EmIcons,{icon:"LayoutCol2WideRight",component:t.icons$LayoutCol2WideRight})}),(0,o.jsx)(t.ui_kit$Button,{onClick:()=>{he({cols:3})},children:(0,o.jsx)(r.EmIcons,{icon:"LayoutCol3",component:t.icons$LayoutCol3})}),(0,o.jsx)(t.ui_kit$Button,{onClick:()=>{he({cols:4})},children:(0,o.jsx)(r.EmIcons,{icon:"LayoutCol4",component:t.icons$LayoutCol4})})]})]}),h.floatBlocks.items.length>1&&(0,o.jsxs)(o.Fragment,{children:[U==="mobile"&&(0,o.jsx)("div",{style:{marginBottom:24},children:(0,o.jsx)(t.ui_kit$Switch,{id:"column-wrap",label:s("Line break on mobile devices"),size:"small",disabled:h.floatBlocks?.wrap===void 0,checked:T,onChange:de,labelStyle:{position:"relative",top:2}})}),U!=="mobile"&&(0,o.jsx)("div",{style:{marginBottom:24},children:(0,o.jsx)(t.ui_kit$Switch,{id:"column-dir-revers",label:s("Reverse order on desktop"),size:"small",disabled:h.floatBlocks?.wrap===void 0,checked:E,onChange:Fe,labelStyle:{position:"relative",top:2}})})]}),h.floatBlocks.items.length>1&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$FormSection,{title:s("Vertical alignment"),titleStyle:{paddingTop:20},children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"valign",style:{marginBottom:0},children:(0,o.jsx)(t.ui_kit$FormVerticalAlignControl,{disabled:h.floatBlocks.items.length<=1,strokeWidth:b.iconStrokeWidth,labels:{alignTop:s("Align top"),alignMiddle:s("Center vertically"),alignBottom:s("Align bottom")}})})})}),(0,o.jsxs)(o.Fragment,{children:[U!=="mobile"&&(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$FormSection,{title:s("Indent between columns"),titleStyle:{paddingTop:20},children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"gap",style:{marginBottom:20},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,disabled:h.floatBlocks.items.length<=1,placeholder:s("Indent between columns"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:"px",ref:v==="gap"&&p})})})}),U==="mobile"&&(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$FormSection,{title:s("Indent in mobile"),titleStyle:{paddingTop:20},children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"gapMobile",style:{marginBottom:20},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,disabled:h.floatBlocks.items.length<=1,placeholder:s("Indent in mobile"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnHeightOutlined",component:t.icons$ColumnHeightOutlined}),addonAfter:"px"})})})})]})]})]})]})})};Nl.propTypes={selectedElement:g.default.shape({parent:g.default.string})};var _d=()=>{},Ll=({email:e,formSettings:i={},onClosePanel:l=_d})=>{const{__:s}=r.useI18n(),a=r.useRootElement(),d=r.useDispatch(),c=r.useSendPostMessage(),p=Object.prototype.hasOwnProperty.call(e,"type")?r.BLOCK:r.EMAIL,f=r.useSelector(r.selectElementSettings$1),x=r.useSelector(r.selectElementSettings),k=r.useSelector(r.selectPropertiesPanelKey),b=p==="email"?f:x,h=Object.keys(i).length>0?i.settings:b,T=i?.type==="advanced"&&!!i?.content,_=!!i?.extraTabs?.length,E=r.useAppConfig(),w=h.type==="customTable",v=!!h.type&&!!h.floatBlocks?.items.length>0&&!!h.floatBlocks?.items.filter(R=>!!R.width).length>0,P=(0,n.useRef)(null);(0,n.useEffect)(()=>{const R=Object.values(r.ELEMENT_TYPES),G=h.type&&R.includes(h.type)?`${h.type}-${JSON.stringify(h.path||[])}`:null;if(T||_){const J=a.querySelector(".email-pane .panel-form__body");J&&(J.scrollTop=0),d(r.setPropertiesPanelKey(r.EDIT_SELECTED_ELEMENT))}else if(h.type&&R.includes(h.type)){const J=P.current!==G;if(P.current=G,h.activateSection!=="structure"){if(J){const te=a.querySelector(".email-pane .panel-form__body");te&&(te.scrollTop=0)}d(r.setPropertiesPanelKey(r.EDIT_SELECTED_ELEMENT))}else d(r.setPropertiesPanelKey(r.STRUCTURE))}else JSON.stringify(h)!=="{}"&&(P.current=null,d(r.setPropertiesPanelKey("")))},[h,d,a,T,_]);const j=(0,n.useMemo)(()=>{const R=[{key:r.EDIT_SELECTED_ELEMENT,label:(0,o.jsx)("span",{style:{textTransform:"capitalize"},children:h.caption?h.caption:s("Edit element")})}];return v&&R.push({key:r.STRUCTURE,label:s("Columns")}),R},[h.caption,v,s]),C=(0,n.useMemo)(()=>[{key:r.EDIT_SELECTED_ELEMENT,label:s("Cell")},{key:r.TABLE_PROPERTIES,label:s("Table")}],[s]),I=R=>{R.stopPropagation(),c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_REMOVE}),d(p==="email"?r.setElementSettings$1({}):r.setElementSettings({}))},K=R=>{R.stopPropagation(),c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_PARENT_GET})},U=()=>{l(h),d(r.resetToLastActiveSettingsTab()),setTimeout(()=>{d(p==="block"?r.setElementSettings({type:null}):r.setElementSettings$1({type:null}))},300),c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET})},O=(0,o.jsxs)(o.Fragment,{children:[E.deleteButtonEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Remove element by Delete Key"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Button,{type:"text",onClick:I,disabled:!h.deletable,icon:(0,o.jsx)(t.ui_kit$EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:18,strokeWidth:E.iconStrokeWidth})})}),E.stepToOtherElementEnabled&&(0,o.jsx)(t.ui_kit$Tooltip,{title:s("Up to parent element"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Button,{type:"text",onClick:K,disabled:!h.parent,icon:(0,o.jsx)(t.ui_kit$EmIcons,{icon:"GoToParent",component:t.icons$GoToParent,size:18,strokeWidth:E.iconStrokeWidth})})})]}),L=E.switchDesktopMobilePropsEnabled||E.stepToOtherElementEnabled||E.deleteButtonEnabled;return(0,o.jsxs)(t.ui_kit$PanelForm,{children:[(0,o.jsx)(t.ui_kit$PanelForm.Header,{onClose:U,closeIcon:(0,o.jsx)(t.ui_kit$EmIcons,{icon:"Close",component:t.icons$Close,size:24,strokeWidth:E.iconStrokeWidth}),extra:L?O:void 0,children:(0,o.jsx)(t.ui_kit$Tabs,{items:w?C:j,activeKey:k,onChange:R=>d(r.setPropertiesPanelKey(R||""))})}),(0,o.jsx)(t.ui_kit$PanelForm.Body,{children:w?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{style:{display:k==="Edit selected element"?void 0:"none"},children:(0,o.jsx)(dt,{className:"email-properties__collapse-panel selected-element-panel__content",formSettings:i,emailElementType:p,formName:`${r.EDIT_SELECTED_TABLE_CELLS}`})}),(0,o.jsx)("div",{style:{display:k==="Table properties"?void 0:"none"},children:(0,o.jsx)(dt,{className:"email-properties__collapse-panel selected-element-panel__content",formSettings:i,emailElementType:p,formName:`${r.TABLE_PROPERTIES}`})})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{style:{display:k==="Edit selected element"?void 0:"none"},children:(0,o.jsx)(dt,{className:"email-properties__collapse-panel selected-element-panel__content",formSettings:i,emailElementType:p})}),v&&(0,o.jsx)("div",{style:{display:k==="Structure"?void 0:"none"},children:(0,o.jsx)(Nl,{selectedElement:h,emailElementType:p,isSelectedElement:!1})})]})})]})},xd=({taxonomy:e})=>{const{__:i,_x:l}=r.useI18n(),s=r.useDispatch(),[a]=t.ui_kit$Form.useForm(),d=(0,n.useRef)(null),c=r.useSelector(r.selectActiveModal$1)===r.MODALS.ADD_NEW_GROUP_MODAL,p=r.useNotification(),f=r.useProjectData(),x=(0,n.useCallback)(()=>{a.resetFields(),setTimeout(()=>d.current?.focus({cursor:"start"}),0)},[a]);(0,n.useEffect)(()=>{c&&x()},[c,x]);const k=()=>s(r.closeModal$1()),[b,h]=r.useAddTermMutation(),[T,_]=(0,n.useState)(!1),E=()=>{a.validateFields().then(({name:w})=>(_(!0),b({project:f,kind:"group",name:w}).then(v=>{if("error"in v){p.error(v);return}p.success({title:i("The group “")+v.data.name+l("” was successfully created.",e)}),k()}))).catch(w=>{}).finally(()=>_(!1))};return(0,o.jsx)(t.ui_kit$Modal,{title:i("Add a new group"),open:c,onOk:E,onCancel:k,className:"new-group-modal",footer:[(0,o.jsx)(t.ui_kit$Button,{type:"primary",size:"large",loading:h.isLoading||T,onClick:E,children:i("Create group")},"submit")],children:(0,o.jsx)(t.ui_kit$Form,{form:a,layout:"vertical",name:"add_new_group_form",onFinish:E,initialValues:{remember:!1,name:""},autoComplete:"off",style:{paddingTop:10},children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"name",rules:[{required:!0,message:i("Please enter the group name")}],children:(0,o.jsx)(t.ui_kit$Input,{disabled:h.isLoading,size:"large",placeholder:i("Enter the group name"),ref:d,style:{marginBottom:5}})})})})},kd=({group:e,refetch:i})=>{const{__:l,_x:s}=r.useI18n(),a=r.useDispatch(),[d]=t.ui_kit$Form.useForm(),c=(0,n.useRef)(null),p=r.useSelector(r.selectActiveModal$1)===r.MODALS.EDIT_GROUP_NAME_MODAL,f=r.useNotification(),{id:x=null,name:k=""}=e,b=()=>a(r.closeModal$1()),[h,T]=r.useEditTermMutation();(0,n.useEffect)(()=>{p&&d.setFieldsValue({name:k})},[p,k,d]);const _=()=>{d.validateFields().then(({name:E})=>{h({kind:"group",id:x,name:E}).then(({data:w,error:v})=>{v?(f.error({error:v}),d.setFieldValue("name",E)):(i().then(({data:P})=>{if(P){const j=P[0]?.children?.find(C=>C.id===x)?.name;d.setFieldValue("name",j)}}),b(),f.success({title:l("The group “")+E+s("” was successfully changed to “","group")+w.name+l("”.")}))})})};return(0,o.jsx)(t.ui_kit$Modal,{title:l("Change group name"),open:p,onOk:_,onCancel:b,className:"new-group-name-modal",footer:[(0,o.jsx)(t.ui_kit$Button,{type:"primary",size:"large",loading:T.isLoading,onClick:_,children:l("Change name")},"submit")],children:(0,o.jsx)(t.ui_kit$Form,{form:d,layout:"vertical",name:"rename_group_form",onFinish:_,initialValues:{remember:!1,name:k},autoComplete:"off",style:{paddingTop:10},children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"name",rules:[{required:!0,message:l("Please enter the group name")}],children:(0,o.jsx)(t.ui_kit$Input,{disabled:T.isLoading,size:"large",placeholder:l("Enter the group name"),ref:c,style:{marginBottom:5}})})})})},Ed=({className:e,refetchProjectGroups:i,isLoading:l})=>{const{__:s,_x:a}=r.useI18n(),d=r.useDispatch(),c=r.useNotification(),{modal:p}=t.ui_kit$App.useApp(),{confirm:f}=p,{token:x}=(0,t.ui_kit$useToken)(),k=r.useSelector(r.selectProjectGroups),[b]=r.useDeleteTermMutation(),h=(P,j)=>{b({kind:"group",id:Number(P)}).unwrap().then(C=>{C?.deleted&&c.success({title:s("The group “")+j+a("” was successfully deleted.","recovery")})}).catch(C=>{c.error({error:C})})},T=(P,j)=>{f({mask:{closable:!0},centered:!0,title:a("Are you sure to delete “","group")+j+s("” group and all nested groups?"),icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:22,style:{color:t.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:s("Yes"),cancelText:s("No"),onOk:()=>h(String(P),j)})},_=(P,j)=>{d(r.openModal$1(r.MODALS.EDIT_GROUP_NAME_MODAL)),v({id:P,name:j})},E=P=>[{label:s("Rename"),key:"Rename",icon:(0,o.jsx)(r.EmIcons,{icon:"CopyOutlined",component:t.icons$CopyOutlined,size:16}),onClick:()=>_(P.id,P.name)},{label:s("Remove"),icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:16}),key:"Remove",style:{color:"#ff4d4f"},onClick:()=>T(P.id,P.name)}],[w,v]=(0,n.useState)({id:null,name:""});return(0,o.jsxs)("div",{className:(0,De.default)("groups-management",{[e]:e}),children:[l?(0,o.jsx)(t.ui_kit$Skeleton,{active:!0}):(0,o.jsxs)(t.ui_kit$Row,{children:[!!k?.length&&k?.map((P,j)=>(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:`group_${P.id}`,style:{marginBottom:x.formItemMarginBottomMD},label:(0,o.jsxs)(t.ui_kit$Flex,{justify:"space-between",align:"center",style:{width:"100%"},children:[(0,o.jsx)("span",{children:P.name}),(0,o.jsx)(t.ui_kit$Button,{type:"text",className:"groups-management__group_menu","data-group-id":P.id,size:"large",children:(0,o.jsx)(t.ui_kit$Dropdown,{className:"groups-management__group_menu-inner",placement:"bottomLeft",menu:{items:E(P)},trigger:["hover"],children:(0,o.jsx)("span",{className:"groups-management__actions",children:(0,o.jsx)(r.EmIcons,{icon:"MoreOutlined",component:t.icons$MoreOutlined})})})})]}),className:"groups-management__group-select",rules:[{message:"Please input category name!",type:"array"}],children:(0,o.jsx)(t.ui_kit$Select,{mode:"tags",style:{width:"100%"},placeholder:s("Type category here"),options:P.children?.map(C=>({label:C.name,value:String(C.id)})),tagRender:C=>{const{label:I,closable:K,onClose:U}=C,O=L=>{L.preventDefault(),L.stopPropagation()};return(0,o.jsx)(t.ui_kit$Tag,{variant:"solid",color:x.colorPrimary,onMouseDown:O,closable:K,onClose:U,style:{borderRadius:6},children:I})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})},P.id)),(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:x.formItemMarginBottomMD},children:(0,o.jsx)(t.ui_kit$Button,{id:"add_group_button",icon:(0,o.jsx)(r.EmIcons,{icon:"AddSlide",component:t.icons$AddSlide}),style:{width:"100%"},onClick:()=>d(r.openModal$1(r.MODALS.ADD_NEW_GROUP_MODAL)),children:s("Add group")})})})]}),(0,o.jsx)(xd,{taxonomy:r.ELEMENT_TYPES.GROUP}),(0,o.jsx)(kd,{group:w,refetch:i})]})},{title:Ci,description:Xt,tags:Kt,type:Pi,is_template:Bd,group:Sd}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},Td={[Ci]:"",[Xt]:"",[Kt]:[],[Bd]:!1},Rd={[Xt]:"",[Kt]:[],[Pi]:""};function yd(e){const i=new Set;return e?.filter(l=>i.has(l.name)?!1:(i.add(l.name),!0))}var Ol=({className:e="",element:i})=>{const{__:l}=r.useI18n(),s=r.useDispatch(),a=r.useEmailAttributesWriter(),[d]=t.ui_kit$Form.useForm(),{token:c}=(0,t.ui_kit$useToken)(),p=r.useAppConfig(),f=r.useSelector(r.selectProjectGroups),{data:x}=r.useGetBlocksSchemaQuery(),k=r.useProjectData(),b=i.hasOwnProperty("type")?r.BLOCK:r.EMAIL,h=i.hasOwnProperty("type")?r.BLOCK_TAGS:r.EMAIL_TAGS,{data:T,refetch:_,isLoading:E,isFetching:w,isUninitialized:v,isSuccess:P}=r.useGetTermsQuery({project:k,kind:"group"},{skip:!k?.id});(0,n.useEffect)(()=>{T&&s(r.projectGroupsLoaded(T,b==="email"?i.group??[]:void 0))},[s,T,b,i.group]),(0,n.useEffect)(()=>{!v&&_()},[v,_]);const[j,C]=(0,n.useState)([]),[I,K]=(0,n.useState)([]),[U,O]=(0,n.useState)(i.is_template||!1),L=r.useProjectData();(0,n.useEffect)(()=>{!v&&_()},[i.group,_,v]),(0,n.useEffect)(()=>{if(P&&i.is_template&&i.group.length){const te=i.group;let oe={};te.length&&f.length&&te?.forEach(be=>{f?.forEach(ae=>{let ke=ae.children.find(Ce=>Ce.id===be);ke&&(oe.hasOwnProperty(ae.id)||(oe[ae.id]=[]),oe[ae.id].push({label:ke.name,value:ke.id}))})});let he={};for(let be in oe)oe.hasOwnProperty(+be)&&(he[`group_${be}`]=oe[be].map(ae=>({...ae,value:String(ae.value)})));d.setFieldsValue(he)}},[d,f,i.is_template,i.group,P]);const{data:R}=r.useGetTermsQuery({project:L,kind:h},{skip:!L?.id});(0,n.useEffect)(()=>{K(yd(R)?.map(te=>({value:te.name,key:te.id})))},[R]),(0,n.useEffect)(()=>{if(i){const te=wo.getTaxonomy(i,h)?.map(be=>be.name),oe=i.emailtags||i.blocktags,he=wo.getTaxonomy(i,h)?.filter(be=>oe.includes(be.id)).map(be=>be.name);d.setFieldsValue({title:i.title,description:i.description,tags:i.tags||he||te,type:i.type})}},[d,i,h]);const G=te=>{const oe=Object.keys(te)[0],he=te,be=oe.split("_")[0];if(be===Ci)a({title:he[oe]});else if(be===Xt)a({description:he[oe]});else if(be===Kt){const ae=he[oe];a({tags:ae?.map(ke=>ke.trim())})}else be==="is"&&b==="email"&&a({is_template:he[oe]});switch(oe.split("_")[0]){case Sd:s(r.setEmailGroups({[oe.split("_")[1]]:te[oe]}));break;case Pi:s(r.blocksApi.util.updateQueryData("getBlock",i.id,ae=>{Object.assign(ae,{type:te[oe]})}));break;default:return}};(0,n.useEffect)(()=>{if(x){const te=x.schema.properties.acf.properties.type.items.enum;let oe=[];const he={Applications:l("Apps"),Articles:l("Article"),Banners:l("Banners"),Buttons:l("Buttons"),"Call to Action":l("Call to Action"),Contacts:l("Contacts"),Content:l("Content"),"E-Commerce":l("E-Commerce"),Feature:l("Features"),Footer:l("Footers"),Header:l("Headers"),Lists:l("Lists"),Menu:l("Menus"),Other:l("Others"),Polls:l("Polls"),Promocodes:l("Promocodes"),Separators:l("Separators")};for(let be in te)oe.push({label:he[te[be]],value:te[be]});C(oe)}},[x,l]);const J=te=>{O(te)};return(0,o.jsx)("div",{className:(0,De.default)("settings-panel",{[e]:e}),children:(0,o.jsxs)(t.ui_kit$Form,{form:d,layout:"vertical",name:"settings_panel_form",initialValues:b==="email"?{EmailInitialValues:Td}:Rd,onValuesChange:G,autoComplete:"off",children:[p.subjectEnabled&&b==="email"&&(0,o.jsx)(t.ui_kit$Form.Item,{label:l("Title"),name:Ci,tooltip:{title:l("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$TextArea,{placeholder:l("Type title here"),autoSize:{minRows:1}})}),p.descriptionEnabled&&(0,o.jsx)(t.ui_kit$Form.Item,{label:l("Description"),name:Xt,tooltip:{title:l("Description is used in other sections of the service."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$TextArea,{placeholder:l("Type your description here"),autoSize:{minRows:2}})}),p.tagsEnabled&&(0,o.jsx)(t.ui_kit$Form.Item,{label:l("Tags"),name:Kt,tooltip:{title:l("Tags help you find the block in the list."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},rules:[{message:l("Please input tags!"),type:"array"}],children:(0,o.jsx)(t.ui_kit$Select,{mode:"tags",style:{width:"100%"},placeholder:l("Type your tags here"),options:I,tagRender:te=>{const{label:oe,closable:he,onClose:be}=te,ae=ke=>{ke.preventDefault(),ke.stopPropagation()};return(0,o.jsx)(t.ui_kit$Tag,{variant:"solid",color:c.colorPrimary,onMouseDown:ae,closable:he,onClose:be,style:{borderRadius:6},children:oe})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),b==="email"&&p.isTemplateEnabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider",style:{marginBottom:16}}),(0,o.jsx)(t.ui_kit$Tooltip,{title:i.isNew?l("Save email first."):l("Use this email as a template for creating future emails."),children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"is_template",valuePropName:"checked",initialValue:U,children:(0,o.jsx)(t.ui_kit$Switch,{id:"setIsTemplate",label:l("Is a template"),size:"small",onChange:J,disabled:i.isNew,labelStyle:{position:"relative",top:2,fontSize:14,color:c.colorText}})})},"isTemplate")]}),U&&(0,o.jsx)(Ed,{element:i,refetchProjectGroups:_,isLoading:E||w}),b==="block"&&(0,o.jsx)(t.ui_kit$Form.Item,{name:Pi,label:l("Type"),tooltip:{title:l("Select the block type to find any block on the list faster."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},rules:[{message:l("Please input type!")}],children:(0,o.jsx)(t.ui_kit$Select,{placeholder:l("Choose block type"),options:j,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};Ol.propTypes={className:g.default.string,email:g.default.object};var{utm_source:$l,utm_medium:Fl,utm_campaign:Ml,utm_term:Dl,utm_content:Vl}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},wd={[$l]:"",[Fl]:"",[Ml]:"",[Dl]:"",[Vl]:""},Hl=({className:e="",email:i=void 0})=>{const{__:l}=r.useI18n(),s=r.useEmailAttributesWriter(),[a]=t.ui_kit$Form.useForm();(0,n.useEffect)(()=>{i&&a.setFieldsValue({utm_source:i.utm_parameters?.utm_source||"",utm_medium:i.utm_parameters?.utm_medium||"",utm_campaign:i.utm_parameters?.utm_campaign||"",utm_term:i.utm_parameters?.utm_term||"",utm_content:i.utm_parameters?.utm_content||""})},[a,i]);const d=c=>{const p=Object.keys(c)[0],f=c;s({utm_parameters:{...i?.utm_parameters,[p]:f[p]}})};return(0,o.jsx)("div",{className:(0,De.default)("settings-panel",{[e]:e}),children:(0,o.jsxs)(t.ui_kit$Form,{form:a,layout:"vertical",name:"settings_panel_form_utm",initialValues:wd,onValuesChange:d,autoComplete:"off",children:[(0,o.jsx)(t.ui_kit$Alert,{title:l("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("utm_source"),name:$l,tooltip:{title:l("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:l("google")})}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("utm_medium"),name:Fl,tooltip:{title:l("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:l("cpc")})}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("utm_campaign"),name:Ml,tooltip:{title:l("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:l("spring_sale")})}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("utm_term"),name:Dl,tooltip:{title:l("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:l("running+shoes")})}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("utm_content"),name:Vl,tooltip:{title:l("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:l("textlink")})})]})})};Hl.propTypes={className:g.default.string,email:g.default.object};var Ue={PRODUCT_CAROUSEL:"productCarousel",SINGLE_IMAGE_PREVIEW:"singleImagePreview",DEAL_ANNOTATION:"dealAnnotation",DEAL_CARD:"dealCard"},Ul="emailmaker-gmail-annotations";function Ai(e){return/^[A-Za-z]{3}$/.test((e??"").trim())}function jd(e){return typeof e=="object"&&e!==null}function qt(e,i){const l=e[i];return typeof l=="string"?l:""}var vd=new Set(["PromotionCard","DiscountOffer","Organization"]);function Wl(e){let i;try{i=JSON.parse(e)}catch{return!1}const l=Array.isArray(i)?i:[i];return l.length===0?!1:l.every(s=>typeof s=="object"&&s!==null&&vd.has(String(s["@type"])))}function Id(){let e=new Date().getTime(),i=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,l=>{let s=Math.random()*16;return e>0?(s=(e+s)%16|0,e=Math.floor(e/16)):(s=(i+s)%16|0,i=Math.floor(i/16)),(l==="x"?s:s&3|8).toString(16)})}function Jt(e){return e.annotationType||Ue.PRODUCT_CAROUSEL}function ct(e){return!!(e?.image||e?.url||e?.headline||e?.price||e?.priceCurrency||e?.discountValue)}function Ni(e){return!e.description&&!e.discountCode&&!e.availabilityStarts&&!e.availabilityEnds}function Qt(e){return typeof e=="string"&&e.trim().length>0}function Li(e){return Qt(e)?/^https?:\/\//i.test(e.trim()):!1}function zl(e){return Qt(e?.image)&&Li(e?.url)}function Cd(e){switch(Jt(e)){case Ue.SINGLE_IMAGE_PREVIEW:return zl(e.cards?.[0]);case Ue.DEAL_ANNOTATION:return!Ni(e);case Ue.DEAL_CARD:return Qt(e.description)&&(Li(e.offerPageUrl)||Li(e.merchantHomepageUrl));case Ue.PRODUCT_CAROUSEL:default:return!!e.cards?.some(zl)}}function Pd(e){switch(Jt(e)){case Ue.SINGLE_IMAGE_PREVIEW:return!ct(e.cards?.[0])&&!Qt(e.discountCode);case Ue.DEAL_ANNOTATION:return Ni(e);case Ue.DEAL_CARD:return Ni(e)&&!e.offerPageUrl&&!e.merchantHomepageUrl;case Ue.PRODUCT_CAROUSEL:default:return!e.cards?.some(ct)}}function Ad(e){switch(Jt(e)){case Ue.DEAL_ANNOTATION:case Ue.DEAL_CARD:return!!(e.description||e.discountCode||e.availabilityStarts||e.availabilityEnds||e.offerPageUrl||e.merchantHomepageUrl);case Ue.SINGLE_IMAGE_PREVIEW:return ct(e.cards?.[0]);case Ue.PRODUCT_CAROUSEL:default:return e.logo?!0:!!e.cards?.some(ct)}}function Nd(e){let i=typeof e.price=="string"||typeof e.price=="number"?String(e.price):"",l=typeof e.discountValue=="string"||typeof e.discountValue=="number"?String(e.discountValue):"";const s=typeof e.em_regularPrice=="string"||typeof e.em_regularPrice=="number"?String(e.em_regularPrice):"",a=typeof e.em_price=="string"||typeof e.em_price=="number"?String(e.em_price):"";if(!i&&s&&(i=s),!l&&i&&a){const d=parseFloat(i),c=parseFloat(a);!isNaN(d)&&!isNaN(c)&&d>=c&&(l=String(d-c))}return{id:Id(),image:typeof e.image=="string"?e.image:"",url:typeof e.url=="string"?e.url:"",headline:typeof e.headline=="string"?e.headline:"",price:i,priceCurrency:typeof e.priceCurrency=="string"?e.priceCurrency:"",discountValue:l}}function Gl(e,i){const l={"@context":"http://schema.org/","@type":"PromotionCard",image:e.image};if(e.url&&(l.url=e.url),e.headline&&(l.headline=e.headline),e.price&&(l.price=e.price),e.priceCurrency){const s=e.priceCurrency.trim();l.priceCurrency=Ai(s)?s.toUpperCase():s}return e.discountValue&&(l.discountValue=e.discountValue),i&&(l.position=i),l}function Oi(e){const i={"@context":"http://schema.org/","@type":"DiscountOffer"};for(const l of["description","discountCode","availabilityStarts","availabilityEnds","offerPageUrl","merchantHomepageUrl"]){const s=e[l];s&&(i[l]=s)}return i}function Yl(e){return{"@context":"http://schema.org/","@type":"Organization",logo:e}}function Ld(e){const i=Jt(e),l=[];if(i===Ue.DEAL_CARD)return[Oi(e)];if(i===Ue.DEAL_ANNOTATION){const s=[];return e.logo&&s.push(Yl(e.logo)),s.push(Oi(e)),s}if(e.logo&&l.push(Yl(e.logo)),i===Ue.SINGLE_IMAGE_PREVIEW){const s=e.cards?.[0];return e.discountCode?.trim()&&l.push(Oi(e)),s&&ct(s)&&l.push(Gl(s)),l}return(e.cards||[]).filter(ct).forEach((s,a)=>{l.push(Gl(s,a+1))}),l}function Od(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function $d(e){if(Pd(e))return null;const i=Od(JSON.stringify(Ld(e),null,2));return`<script type="application/ld+json" id="${Ul}">
|
|
10
|
+
${i}
|
|
11
|
+
<\/script>`}function Xl(e,i){const l=e.toLowerCase().indexOf("<\/script>",i);return l===-1?-1:l+9}function Kl(e,i,l,s){return{range:{start:i,end:s},contentRange:{start:l,end:s-9}}}function $i(e){const i=new RegExp(`<script\\b[^>]*\\bid=["']${Ul}["']`,"i").exec(e);if(i?.index!==void 0){const a=e.indexOf(">",i.index)+1;if(a<=0)return null;const d=Xl(e,a);if(d!==-1)return Kl(e,i.index,a,d)}const l=/<script\b[^>]*type=["']application\/ld\+json["'][^>]*>/gi;let s;for(;(s=l.exec(e))!==null;){const a=s.index+s[0].length,d=Xl(e,a);if(d!==-1&&Wl(e.slice(a,d-9)))return Kl(e,s.index,a,d)}return null}function Fd(e){const i=e.indexOf(">")+1,l=e.toLowerCase().lastIndexOf("<\/script>");return i<=0||l===-1?e:e.slice(i,l)}function Md(e){const i=/<\/head>/i.exec(e);if(i?.index!==void 0)return i.index;const l=/<head\b[^>]*>/i.exec(e);if(l?.index!==void 0)return l.index+l[0].length;const s=/<body\b[^>]*>/i.exec(e);return s?.index!==void 0?s.index:e.length}function ql(e,i){let{start:l,end:s}=i;return l>0&&e[l-1]===`
|
|
12
|
+
`?l-=1:s<e.length&&e[s]===`
|
|
13
|
+
`&&(s+=1),{start:l,end:s}}function Dd(e,i){const l=$i(e),s=$d(i);if(!s&&!l)return null;if(l&&!s){const c=ql(e,l.range);return e.slice(c.start,c.end)?{range:c,text:""}:null}if(l&&s){const c=Fd(s);return e.slice(l.contentRange.start,l.contentRange.end)===c?null:{range:l.contentRange,text:c}}if(!s)return null;const a=Md(e),d=`${a>0&&e[a-1]!==`
|
|
14
|
+
`?`
|
|
15
|
+
`:""}${s}
|
|
16
|
+
`;return{range:{start:a,end:a},text:d}}function Jl(e){const i=$i(e);return i?e.slice(i.contentRange.start,i.contentRange.end):null}function Vd(e){let i=e;for(let l=0;l<50;l++){const s=$i(i);if(!s)return i;const{start:a,end:d}=ql(i,s.range);i=i.slice(0,a)+i.slice(d)}return i}function Hd(e){try{const i=new DOMParser().parseFromString(e,"text/html").querySelectorAll('script[type="application/ld+json"]');for(let l=0;l<i.length;l++){const s=i[l];if(s.id==="emailmaker-gmail-annotations"||Wl(s.textContent||"")){const a=JSON.parse(s.textContent||"[]"),d=(Array.isArray(a)?a:[a]).filter(jd),c={cards:[]};let p=!1,f=!1,x=!1;return d.forEach(k=>{const b=qt(k,"@type");if(b==="Organization"){const h=qt(k,"logo");h&&(c.logo=h);return}if(b==="DiscountOffer"){f=!0;for(const h of["description","discountCode","availabilityStarts","availabilityEnds"]){const T=qt(k,h);T&&(c[h]=T)}for(const h of["offerPageUrl","merchantHomepageUrl"]){const T=qt(k,h);T&&(c[h]=T,p=!0)}return}b==="PromotionCard"&&(k.position!==void 0&&(x=!0),c.cards.push(Nd(k)))}),c.cards.length>1?c.annotationType=Ue.PRODUCT_CAROUSEL:c.cards.length===1?c.annotationType=x?Ue.PRODUCT_CAROUSEL:Ue.SINGLE_IMAGE_PREVIEW:f&&(c.annotationType=p?Ue.DEAL_CARD:Ue.DEAL_ANNOTATION),c}}}catch{}return null}var Ud={USD:"$",EUR:"€",GBP:"£",RUB:"₽",JPY:"¥",CNY:"¥",INR:"₹",KRW:"₩",AUD:"A$",CAD:"C$",CHF:"CHF",BRL:"R$",MXN:"MX$",UAH:"₴",KZT:"₸",PLN:"zł",TRY:"₺",CZK:"Kč",ILS:"₪",SGD:"S$",HKD:"HK$",NZD:"NZ$",ZAR:"R"};function Wd(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Ql(e){const i=e?.trim();return i?Ud[i.toUpperCase()]??i:"$"}function Fi(e,i){return`${Ql(i)}${Wd(e)}`}function zd(e){const i=parseFloat(e.price??""),l=parseFloat(e.discountValue??"");return!Number.isNaN(i)&&!Number.isNaN(l)&&l>0?{sale:Fi(i-l,e.priceCurrency),original:Fi(i,e.priceCurrency)}:Number.isNaN(i)?{}:{sale:Fi(i,e.priceCurrency)}}var io=({variant:e="line",width:i,height:l,className:s})=>{const a=(0,n.useMemo)(()=>({width:i,height:l}),[i,l]);return(0,o.jsx)("span",{className:(0,De.default)("preview-skeleton",`preview-skeleton--${e}`,s),style:a,"aria-hidden":"true"})};function Mi({className:e}){return(0,o.jsx)("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})}function Zl({className:e}){return(0,o.jsxs)("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,o.jsx)("circle",{cx:"7",cy:"7",r:"1.5",fill:"currentColor"})]})}function Gd({className:e}){return(0,o.jsxs)("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,o.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,o.jsx)("path",{d:"M12 12V7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,o.jsx)("path",{d:"M12 12L15.5 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,o.jsx)("path",{d:"M12 3a9 9 0 0 1 7.5 4",fill:"currentColor",fillOpacity:"0.18"})]})}var Yd=2;function Xd({card:e}){const i=zd(e),l=(0,n.useMemo)(()=>({backgroundImage:`url(${e.image})`}),[e.image]),s=!!e.headline?.trim(),a=!!e.image?.trim(),d=!i.sale&&!i.original;return(0,o.jsxs)("div",{className:"product-carousel-preview__card",children:[a?(0,o.jsx)("div",{className:"product-carousel-preview__card-image",style:l}):(0,o.jsx)(io,{variant:"block",className:"product-carousel-preview__card-image-skeleton"}),(0,o.jsxs)("div",{className:"product-carousel-preview__card-body",children:[s?(0,o.jsx)("div",{className:"product-carousel-preview__card-headline",children:e.headline}):(0,o.jsxs)("div",{className:"product-carousel-preview__card-headline-skeleton",children:[(0,o.jsx)(io,{height:12}),(0,o.jsx)(io,{height:12,width:"75%"})]}),d?(0,o.jsxs)("div",{className:"product-carousel-preview__card-prices",children:[(0,o.jsx)(io,{width:48,height:14}),(0,o.jsx)(io,{width:40,height:12})]}):(i.sale||i.original)&&(0,o.jsxs)("div",{className:"product-carousel-preview__card-prices",children:[i.sale&&(0,o.jsx)("span",{className:"product-carousel-preview__card-sale-price",children:i.sale}),i.original&&(0,o.jsx)("span",{className:"product-carousel-preview__card-original-price",children:i.original})]})]})]})}function Kd(){return(0,o.jsxs)("div",{className:"product-carousel-preview__card",children:[(0,o.jsx)(io,{variant:"block",className:"product-carousel-preview__card-image-skeleton"}),(0,o.jsxs)("div",{className:"product-carousel-preview__card-body",children:[(0,o.jsxs)("div",{className:"product-carousel-preview__card-headline-skeleton",children:[(0,o.jsx)(io,{height:12}),(0,o.jsx)(io,{height:12,width:"75%"})]}),(0,o.jsxs)("div",{className:"product-carousel-preview__card-prices",children:[(0,o.jsx)(io,{width:48,height:14}),(0,o.jsx)(io,{width:40,height:12})]})]})]})}var qd=({data:e,subjectLine:i,cards:l})=>{const{__:s}=r.useI18n(),a=!!e.logo?.trim(),d=!!i?.trim();return(0,o.jsxs)("div",{className:"product-carousel-preview",children:[(0,o.jsx)("div",{className:"product-carousel-preview__header",children:(0,o.jsxs)("div",{className:"product-carousel-preview__header-main",children:[a?(0,o.jsx)("img",{src:e.logo,alt:"",className:"product-carousel-preview__logo"}):(0,o.jsx)(io,{variant:"circle",width:40,height:40,className:"product-carousel-preview__logo-skeleton"}),(0,o.jsxs)("div",{className:"product-carousel-preview__header-text",children:[(0,o.jsxs)("div",{className:"product-carousel-preview__header-row",children:[(0,o.jsx)("div",{className:"product-carousel-preview__brand-name",children:s("Your company")}),(0,o.jsx)("div",{className:"product-carousel-preview__time",children:"10:10 AM"})]}),(0,o.jsxs)("div",{className:"product-carousel-preview__header-row product-carousel-preview__header-row--subject",children:[d?(0,o.jsx)("div",{className:"product-carousel-preview__subject-line",children:i}):(0,o.jsx)(io,{height:14,className:"product-carousel-preview__subject-skeleton"}),(0,o.jsx)(Mi,{className:"product-carousel-preview__star-icon"})]})]})]})}),(0,o.jsx)("div",{className:"product-carousel-preview__carousel",children:l.length>0?l.map((c,p)=>(0,o.jsx)(Xd,{card:c},c.id||p)):Array.from({length:Yd},(c,p)=>(0,o.jsx)(Kd,{},`skeleton-${p}`))})]})};function Jd(e){const i=parseFloat(e?.price??""),l=parseFloat(e?.discountValue??"");if(!Number.isNaN(i)&&i>0&&!Number.isNaN(l)&&l>0){const a=Math.round(l/i*100);if(a>0)return`${a}% Off`}const s=e?.discountValue?.trim();return s?/off/i.test(s)||s.includes("%")?s:`${s} Off`:null}function es(e){const i=e?.trim();return i?/^code\s/i.test(i)?i:`Code ${i}`:null}var Qd=({data:e,subjectLine:i,card:l})=>{const{__:s}=r.useI18n(),a=!!e.logo?.trim(),d=!!i?.trim(),c=!!l?.image?.trim(),p=!!l?.headline?.trim(),f=Jd(l),x=es(e.discountCode),k=!!(f||x),b=(0,n.useMemo)(()=>({backgroundImage:`url(${l?.image})`}),[l?.image]);return(0,o.jsxs)("div",{className:"single-image-preview",children:[(0,o.jsx)("div",{className:"single-image-preview__header",children:(0,o.jsxs)("div",{className:"single-image-preview__header-main",children:[a?(0,o.jsx)("img",{src:e.logo,alt:"",className:"single-image-preview__logo"}):(0,o.jsx)(io,{variant:"circle",width:40,height:40,className:"single-image-preview__logo-skeleton"}),(0,o.jsxs)("div",{className:"single-image-preview__header-text",children:[(0,o.jsxs)("div",{className:"single-image-preview__header-row",children:[(0,o.jsx)("div",{className:"single-image-preview__brand-name",children:s("Your company")}),(0,o.jsx)("div",{className:"single-image-preview__time",children:"10:10 AM"})]}),d?(0,o.jsx)("div",{className:"single-image-preview__subject-line",children:i}):(0,o.jsx)(io,{height:14,className:"single-image-preview__subject-skeleton"}),(0,o.jsxs)("div",{className:"single-image-preview__promo-row",children:[(0,o.jsxs)("div",{className:"single-image-preview__promo-content",children:[f?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Zl,{className:"single-image-preview__promo-icon"}),(0,o.jsx)("span",{className:"single-image-preview__promo-badge",children:f})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(io,{width:16,height:16,className:"single-image-preview__promo-icon-skeleton"}),(0,o.jsx)(io,{width:72,height:14})]}),k&&(0,o.jsx)("span",{className:"single-image-preview__promo-separator",children:"·"}),x?(0,o.jsx)("span",{className:"single-image-preview__promo-code",children:x}):(0,o.jsx)(io,{width:96,height:14,className:"single-image-preview__promo-skeleton"})]}),(0,o.jsx)(Mi,{className:"single-image-preview__star-icon"})]})]})]})}),(0,o.jsxs)("div",{className:"single-image-preview__card",children:[c?(0,o.jsx)("div",{className:"single-image-preview__card-image",style:b}):(0,o.jsx)(io,{variant:"block",className:"single-image-preview__card-image-skeleton"}),(0,o.jsx)("div",{className:"single-image-preview__card-body",children:p?(0,o.jsx)("div",{className:"single-image-preview__card-description",children:l?.headline}):(0,o.jsxs)("div",{className:"single-image-preview__card-description-skeleton",children:[(0,o.jsx)(io,{height:12}),(0,o.jsx)(io,{height:12,width:"92%"})]})})]})]})};function Zd(e){const i=e?.trim();if(!i)return null;const l=(0,Oo.default)(i);if(!l.isValid())return null;const s=(0,Oo.default)().startOf("day"),a=l.startOf("day").diff(s,"day");return a===0?"Today":a===1?"Tomorrow":a>1&&a<=7?l.format("MMM D"):l.format("MMM D, YYYY")}function Di(e){const i=e?.trim();return i||null}function ec(e,i){return e?e==="Today"?i("Today"):e==="Tomorrow"?i("Tomorrow"):e:null}function oc(e,i){return ec(Zd(e),i)}var tc=({data:e,subjectLine:i})=>{const{__:l}=r.useI18n(),s=!!e.logo?.trim(),a=!!i?.trim(),d=Di(e.description),c=es(e.discountCode),p=!!(d||c);return(0,o.jsx)("div",{className:"deal-annotation-preview",children:(0,o.jsxs)("div",{className:"deal-annotation-preview__header-main",children:[s?(0,o.jsx)("img",{src:e.logo,alt:"",className:"deal-annotation-preview__logo"}):(0,o.jsx)(io,{variant:"circle",width:40,height:40,className:"deal-annotation-preview__logo-skeleton"}),(0,o.jsxs)("div",{className:"deal-annotation-preview__header-text",children:[(0,o.jsxs)("div",{className:"deal-annotation-preview__header-row",children:[(0,o.jsx)("div",{className:"deal-annotation-preview__brand-name",children:l("Your company")}),(0,o.jsx)("div",{className:"deal-annotation-preview__time",children:"10:10 AM"})]}),a?(0,o.jsx)("div",{className:"deal-annotation-preview__subject-line",children:i}):(0,o.jsx)(io,{height:14,className:"deal-annotation-preview__subject-skeleton"}),(0,o.jsxs)("div",{className:"deal-annotation-preview__promo-row",children:[(0,o.jsxs)("div",{className:"deal-annotation-preview__promo-content",children:[d?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Zl,{className:"deal-annotation-preview__promo-icon"}),(0,o.jsx)("span",{className:"deal-annotation-preview__promo-badge",children:d})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(io,{width:16,height:16,className:"deal-annotation-preview__promo-icon-skeleton"}),(0,o.jsx)(io,{width:72,height:14})]}),p&&(0,o.jsx)("span",{className:"deal-annotation-preview__promo-separator",children:"·"}),c?(0,o.jsx)("span",{className:"deal-annotation-preview__promo-code",children:c}):(0,o.jsx)(io,{width:96,height:14,className:"deal-annotation-preview__promo-skeleton"})]}),(0,o.jsx)(Mi,{className:"deal-annotation-preview__star-icon"})]})]})]})})},ic=({data:e})=>{const{__:i}=r.useI18n(),l=Di(e.description),s=oc(e.availabilityEnds,i),a=Di(e.discountCode);return(0,o.jsxs)("div",{className:"deal-card-preview",children:[(0,o.jsx)("div",{className:"deal-card-preview__sender",children:i("Your company")}),l?(0,o.jsx)("div",{className:"deal-card-preview__headline",children:l}):(0,o.jsx)(io,{height:24,className:"deal-card-preview__headline-skeleton"}),(0,o.jsxs)("div",{className:"deal-card-preview__details",children:[(0,o.jsxs)("div",{className:"deal-card-preview__expires",children:[(0,o.jsx)(Gd,{className:"deal-card-preview__clock-icon"}),(0,o.jsxs)("div",{className:"deal-card-preview__detail-text",children:[(0,o.jsx)("div",{className:"deal-card-preview__detail-label",children:i("Expires")}),s?(0,o.jsx)("div",{className:"deal-card-preview__detail-value",children:s}):(0,o.jsx)(io,{width:72,height:14,className:"deal-card-preview__detail-skeleton"})]})]}),(0,o.jsx)("div",{className:"deal-card-preview__code",children:(0,o.jsxs)("div",{className:"deal-card-preview__detail-text",children:[(0,o.jsx)("div",{className:"deal-card-preview__detail-label",children:i("Code")}),a?(0,o.jsx)("div",{className:"deal-card-preview__detail-value",children:a}):(0,o.jsx)(io,{width:56,height:14,className:"deal-card-preview__detail-skeleton"})]})})]}),(0,o.jsxs)("div",{className:"deal-card-preview__actions",children:[(0,o.jsx)("span",{className:"deal-card-preview__button",children:i("Visit site")}),(0,o.jsx)("span",{className:"deal-card-preview__button",children:i("Copy code")})]})]})};function rc(e){return e.annotationType===Ue.SINGLE_IMAGE_PREVIEW?e.cards?.[0]?[e.cards[0]]:[]:e.annotationType===Ue.PRODUCT_CAROUSEL?e.cards||[]:[]}function lc(e,i){switch(e){case Ue.SINGLE_IMAGE_PREVIEW:return i("Single image preview");case Ue.DEAL_ANNOTATION:return i("Deal Annotation");case Ue.DEAL_CARD:return i("Deal Card");default:return i("Product carousel")}}var Vi=300,Xo=16;function sc(e){if(!e||e.offsetParent===null)return!1;const i=e.getBoundingClientRect();return i.width>0&&i.height>0}function ac(e){const i=Array.from(document.querySelectorAll(e));for(const l of i){if(!(l instanceof HTMLElement))continue;const s=l.getBoundingClientRect(),a=window.getComputedStyle(l);if(s.width>0&&s.height>0&&a.display!=="none"&&a.visibility!=="hidden")return l}return null}var nc=({data:e,subjectLine:i,parentRef:l,overlayTargetSelector:s,onApply:a,applyDisabled:d=!1,applyBlockers:c=[],onRemove:p,visible:f=!0})=>{const{__:x}=r.useI18n(),[k,b]=(0,n.useState)(null),[h,T]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(!f){b(null),T(null);return}const j=()=>{if(!sc(l?.current)){b(null),T(null);return}if(s){const te=l?.current?.closest(".email-pane__col_settings-inner")||ac(".email-pane__col_settings-inner");if(te){T(te),b({type:"popover"});return}}if(!l?.current)return;let R=l.current.getBoundingClientRect();if(R.width===0&&R.height===0){const te=l.current.closest(".email-pane__col");te&&(R=te.getBoundingClientRect())}const G=Math.max(Xo,Math.min(R.top,window.innerHeight-Xo));let J=R.left-Vi-Xo;J<Xo&&(J=R.right+Xo),J+Vi>window.innerWidth-Xo&&(J=window.innerWidth-Vi-Xo),T(document.body),b({type:"side",top:G,left:Math.max(Xo,J)})};j();const C=window.requestAnimationFrame(j),I=[window],K=l?.current?.closest(".email-pane__collapse-wrapper"),U=l?.current?.closest(".email-pane__col");K&&I.push(K),U&&I.push(U),I.forEach(R=>{R.addEventListener("scroll",j,{passive:!0})}),window.addEventListener("resize",j);const O=l?.current,L=O&&typeof ResizeObserver<"u"?new ResizeObserver(j):null;return L?.observe(O),()=>{window.cancelAnimationFrame(C),L?.disconnect(),I.forEach(R=>{R.removeEventListener("scroll",j)}),window.removeEventListener("resize",j)}},[l,e,s,f]);const _=(0,n.useMemo)(()=>k?.type==="side"?{position:"fixed",top:k.top,left:k.left}:void 0,[k]);if(!f||!e||!Ad(e)&&!a||!k)return null;const E=rc(e),w=e.annotationType||Ue.PRODUCT_CAROUSEL,v=(()=>{switch(w){case Ue.PRODUCT_CAROUSEL:return(0,o.jsx)(qd,{data:e,subjectLine:i,cards:E});case Ue.SINGLE_IMAGE_PREVIEW:return(0,o.jsx)(Qd,{data:e,subjectLine:i,card:E[0]});case Ue.DEAL_ANNOTATION:return(0,o.jsx)(tc,{data:e,subjectLine:i});case Ue.DEAL_CARD:return(0,o.jsx)(ic,{data:e});default:return null}})(),P=(0,o.jsxs)("div",{className:`annotations-preview${k.type==="popover"?" annotations-preview--popover":""}`,style:_,children:[(0,o.jsxs)("div",{className:"annotations-preview__content",children:[(0,o.jsxs)("div",{className:"annotations-preview__type",children:[x("Preview"),": ",lc(w,x)]}),v]}),(a||p)&&(0,o.jsxs)("div",{className:"annotations-preview__footer",children:[p&&(0,o.jsx)(t.ui_kit$Button,{type:"text",size:"small",danger:!0,onClick:p,children:x("Remove annotations")}),a&&(0,o.jsx)(t.ui_kit$Tooltip,{title:d&&c.length?c.join(". "):"",children:(0,o.jsx)("span",{className:"annotations-preview__apply-wrap",children:(0,o.jsx)(t.ui_kit$Button,{type:"primary",size:"small",onClick:a,disabled:d,children:x("Apply")})})})]})]});return(0,$a.createPortal)(P,h||document.body)};function os(e){return e.replaceAll(`\r
|
|
17
|
+
`,`
|
|
18
|
+
`)}function dc(e){if(!e)return"";const i=document.createElement("textarea");return i.innerHTML=e,i.value.replace(/\u00A0/g," ").trim()}var cc=["USD","EUR","GBP","JPY","CNY","CAD","AUD","CHF","INR","BRL","MXN","KRW","RUB","UAH","KZT","PLN","TRY","SEK","NOK","DKK","CZK","ILS","AED","SGD","HKD","NZD","ZAR"];function ut(e){let i=(e??"").replace(/[\s\u00A0%]/g,"");return i=i.includes(".")?i.replace(/,/g,""):i.replace(",","."),/^\d+(\.\d+)?$/.test(i)?Number(i):null}function St(e,i=2){return String(Number(e.toFixed(i)))}function Tt(e){const i=ut(e);return i!==null&&i>0&&i<=100?i:null}function ts(e,i){const l=ut(e),s=Tt(i);return l===null||l<=0||s===null?"":St(l*s/100)}function uc(e,i){if(i?.includes("%")){const c=Tt(i);return c===null?"":St(c)}const l=ut(e),s=ut(i);if(l===null||l<=0||s===null||s<=0)return"";const a=s/l*100,d=St(s);for(const c of[0,1,2]){const p=St(a,c);if(ts(e,p)===d)return p}return St(a)}function Zt(){return{id:xo.generateUUID(),image:"",url:"",headline:"",price:"",priceCurrency:"",discountPercent:""}}function mc({discountValue:e,...i}){return{...i,discountPercent:uc(i.price,e)}}function is(e,i){return i?.length?i.map(mc):e===Ue.PRODUCT_CAROUSEL||e===Ue.SINGLE_IMAGE_PREVIEW?[Zt()]:[]}function rs(e=Ue.PRODUCT_CAROUSEL){return{annotationType:e,annotationLogo:"",description:"",discountCode:"",availabilityStarts:null,availabilityEnds:null,offerPageUrl:"",merchantHomepageUrl:"",cards:is(e)}}function pc(e){const i=e.annotationType||Ue.PRODUCT_CAROUSEL;return{annotationType:i,annotationLogo:e.logo||"",description:e.description||"",discountCode:e.discountCode||"",availabilityStarts:e.availabilityStarts?(0,Oo.default)(e.availabilityStarts):null,availabilityEnds:e.availabilityEnds?(0,Oo.default)(e.availabilityEnds):null,offerPageUrl:e.offerPageUrl||"",merchantHomepageUrl:e.merchantHomepageUrl||"",cards:is(i,e.cards)}}function ls(e){const i=e.cards||[];return{annotationType:typeof e.annotationType=="string"?e.annotationType:Ue.PRODUCT_CAROUSEL,logo:typeof e.annotationLogo=="string"?e.annotationLogo:"",description:typeof e.description=="string"?e.description:"",discountCode:typeof e.discountCode=="string"?e.discountCode:"",availabilityStarts:e.availabilityStarts&&Oo.default.isDayjs(e.availabilityStarts)?e.availabilityStarts.toISOString():void 0,availabilityEnds:e.availabilityEnds&&Oo.default.isDayjs(e.availabilityEnds)?e.availabilityEnds.toISOString():void 0,offerPageUrl:typeof e.offerPageUrl=="string"?e.offerPageUrl:"",merchantHomepageUrl:typeof e.merchantHomepageUrl=="string"?e.merchantHomepageUrl:"",cards:i.map(l=>({id:l.id||xo.generateUUID(),image:l.image||"",url:l.url||"",headline:l.headline||"",price:l.price||"",priceCurrency:l.priceCurrency||"",discountValue:ts(l.price,l.discountPercent)}))}}function hc(e,i){const l=e.getValue();if(!l)return!1;const s=Dd(l,i);if(!s||l.slice(s.range.start,s.range.end)===s.text)return!1;const a=e.getPositionAt(s.range.start),d=e.getPositionAt(s.range.end);return e.pushEditOperations([],[{range:{startLineNumber:a.lineNumber,startColumn:a.column,endLineNumber:d.lineNumber,endColumn:d.column},text:s.text}],()=>null),!0}function bc(e,i){return e?e.emailId!==i.emailId||e.markup!==i.markup:!0}function fc(e){const i=e.getValue(),l=Vd(i);if(l===i)return!1;const s=e.getPositionAt(i.length);return e.pushEditOperations([],[{range:{startLineNumber:1,startColumn:1,endLineNumber:s.lineNumber,endColumn:s.column},text:l}],()=>null),!0}function Hi(e){return!!e&&/^https?:\/\//i.test(e.trim())}function gc(e,i){const l=e.annotationType??Ue.PRODUCT_CAROUSEL,s=[];return l===Ue.PRODUCT_CAROUSEL||l===Ue.SINGLE_IMAGE_PREVIEW?(e.cards?.some(a=>!!a.image&&Hi(a.url))||s.push(i("At least one card needs an image and a link starting with https://")),e.cards?.some(a=>!!a.priceCurrency?.trim()&&!Ai(a.priceCurrency))&&s.push(i("Price currency must be a three-letter ISO 4217 code, for example USD")),s):l===Ue.DEAL_CARD?(e.description?.trim()||s.push(i("Discount description is required")),!Hi(e.offerPageUrl)&&!Hi(e.merchantHomepageUrl)&&s.push(i("Offer page or merchant homepage link starting with https:// is required")),s):(!e.description&&!e.discountCode&&!e.availabilityStarts&&!e.availabilityEnds&&s.push(i("Fill in at least one offer field")),s)}function _c(e,i){const l=[],s=e.filter(a=>!!a.discountPercent?.trim());return s.some(a=>Tt(a.discountPercent)===null)&&l.push(i("Discount must be a percentage greater than 0 and up to 100")),s.some(a=>{const d=ut(a.price);return Tt(a.discountPercent)!==null&&(d===null||d<=0)})&&l.push(i("Enter the price as a number to calculate the discount")),l}var{Text:xc}=t.ui_kit$Typography,kc=10,Ec=1,ss={width:"100%"},Bc="https://developers.google.com/workspace/gmail/promotab",To=["hover"],Sc=["annotationLogo"],as=["cards",0,"price"],Tc=["cards",0,"discountPercent"],Rc=["cards",0,"priceCurrency"];function go(e){return e.closest(".email-pane__collapse-wrapper")??document.body}var Do={clearIcon:(0,o.jsx)(t.ui_kit$ColorPickerClearGlyph,{})},yc={optionFilterProp:"label"};function wc(e){return{value:e||void 0}}var jc=cc.map(e=>{const i=Ql(e);return{value:e,label:i===e?e:`${e} (${i})`}}),ns=({name:e,pricePath:i,iconStrokeWidth:l})=>{const{__:s}=r.useI18n(),a=(0,n.useMemo)(()=>[i],[i]),d=(0,n.useMemo)(()=>[({getFieldValue:c})=>({validator:async(p,f)=>{const x=typeof f=="string"?f.trim():"";if(!x)return;if(Tt(x)===null)throw new Error(s("Discount must be a percentage greater than 0 and up to 100"));const k=ut(c(i));if(k===null||k<=0)throw new Error(s("Enter the price as a number to calculate the discount"))}})],[s,i]);return(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Discount, %"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:e,dependencies:a,rules:d,className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Percent02Icon",component:t.icons$Percent02Icon,size:16,strokeWidth:l}),placeholder:s("Discount, %"),inputMode:"decimal",allowClear:Do})})})},ds=({name:e,iconStrokeWidth:i})=>{const{__:l}=r.useI18n(),s=(0,n.useMemo)(()=>[{validator:async(a,d)=>{const c=typeof d=="string"?d.trim():"";if(c&&!Ai(c))throw new Error(l("Price currency must be a three-letter ISO 4217 code, for example USD"))}}],[l]);return(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:l("Price currency"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:e,rules:s,getValueProps:wc,className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Select,{options:jc,placeholder:l("Price currency"),prefix:(0,o.jsx)(r.EmIcons,{icon:"Globe02Icon",component:t.icons$Globe02Icon,size:16,strokeWidth:i}),showSearch:yc,allowClear:!0,getPopupContainer:go})})})},vc=({onAdd:e})=>{const{__:i}=r.useI18n(),l=(0,n.useCallback)(()=>e(Zt()),[e]);return(0,o.jsx)(t.ui_kit$Button,{type:"text",block:!0,className:"selected-social-form__add-bar",icon:(0,o.jsx)(r.EmIcons,{icon:"AddSlide",component:t.icons$AddSlide}),onClick:l,children:i("Add card")})},Ic=({field:e,index:i,form:l,isSingleImagePreview:s,onRemove:a})=>{const{__:d}=r.useI18n(),c=r.useAppConfig(),p=(0,n.useMemo)(()=>[e.name,"image"],[e.name]),f=(0,n.useMemo)(()=>["cards",e.name,"image"],[e.name]),x=(0,n.useMemo)(()=>[e.name,"headline"],[e.name]),k=(0,n.useMemo)(()=>[e.name,"url"],[e.name]),b=(0,n.useMemo)(()=>[e.name,"price"],[e.name]),h=(0,n.useMemo)(()=>["cards",e.name,"price"],[e.name]),T=(0,n.useMemo)(()=>[e.name,"discountPercent"],[e.name]),_=(0,n.useMemo)(()=>[e.name,"priceCurrency"],[e.name]),E=(0,n.useMemo)(()=>[e.name,"id"],[e.name]),w=(0,n.useMemo)(()=>[{validator:async(P,j)=>{const C=typeof j=="string"?j.trim():"";if(C&&!/^https?:\/\//i.test(C))throw new Error(d("Please enter the correct URL."))}}],[d]),v=(0,n.useCallback)(()=>a(e.name),[a,e.name]);return(0,o.jsxs)("div",{className:"selected-social-form__card",children:[(0,o.jsxs)("div",{className:"selected-social-form__card-head",children:[(0,o.jsx)(xc,{className:"selected-social-form__card-title",children:s?d("Single image preview"):`${d("Card")} ${i+1}`}),!s&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:d("Delete"),placement:"top",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Button,{type:"text",className:"selected-social-form__card-head-remove",icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:18,strokeWidth:c.iconStrokeWidth}),"aria-label":d("Delete"),onClick:v})})]}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:d("Image"),placement:"top",getPopupContainer:go,children:(0,o.jsx)("div",{className:"annotations-panel__field-tooltip-wrap",children:(0,o.jsx)(No,{form:l,label:d("Image"),name:p,watchPath:f})})}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:d("Headline"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:x,className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"ElementTitle",component:t.icons$ElementTitle,size:16,strokeWidth:c.iconStrokeWidth}),placeholder:d("Headline"),allowClear:Do})})}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:d("Link"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:k,className:"selected-social-form__card-field",rules:w,children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Link03",component:t.icons$Link03,size:16,strokeWidth:c.iconStrokeWidth}),placeholder:d("Enter link"),allowClear:Do})})}),!s&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:d("Price"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:b,className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"CreditCard02Icon",component:t.icons$CreditCard02Icon,size:16,strokeWidth:c.iconStrokeWidth}),placeholder:d("Price"),allowClear:Do})})}),(0,o.jsx)(ns,{name:T,pricePath:h,iconStrokeWidth:c.iconStrokeWidth}),(0,o.jsx)(ds,{name:_,iconStrokeWidth:c.iconStrokeWidth})]}),(0,o.jsx)(t.ui_kit$Form.Item,{name:E,hidden:!0,children:(0,o.jsx)(t.ui_kit$Input,{})})]})};function cs({iconStrokeWidth:e}){const{__:i}=r.useI18n();return(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:i("Discount code"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"discountCode",className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Sale04Icon",component:t.icons$Sale04Icon,size:16,strokeWidth:e}),placeholder:i("Discount code"),allowClear:Do})})})}var Cc=({className:e="",isActive:i=!0,email:l})=>{const{__:s}=r.useI18n(),a=r.useAppConfig(),d=r.useModel(),c=r.useNotification(),[p]=t.ui_kit$Form.useForm(),f=(0,n.useRef)(null),x=(0,n.useRef)(!1),k=(0,n.useRef)(null),[b,h]=(0,n.useState)(!1),T=t.ui_kit$Form.useWatch("annotationType",p),_=t.ui_kit$Form.useWatch("annotationLogo",p),E=t.ui_kit$Form.useWatch("description",p),w=t.ui_kit$Form.useWatch("discountCode",p),v=t.ui_kit$Form.useWatch("availabilityStarts",p),P=t.ui_kit$Form.useWatch("availabilityEnds",p),j=t.ui_kit$Form.useWatch("offerPageUrl",p),C=t.ui_kit$Form.useWatch("merchantHomepageUrl",p),I=t.ui_kit$Form.useWatch("cards",p),K=JSON.stringify(I??[]),U=(0,n.useMemo)(()=>JSON.parse(K)??[],[K]),O=T||Ue.PRODUCT_CAROUSEL,L=O===Ue.PRODUCT_CAROUSEL||O===Ue.SINGLE_IMAGE_PREVIEW,R=O===Ue.DEAL_ANNOTATION||O===Ue.DEAL_CARD,G=O===Ue.DEAL_CARD,J=O===Ue.DEAL_ANNOTATION,te=O===Ue.SINGLE_IMAGE_PREVIEW,oe=O===Ue.SINGLE_IMAGE_PREVIEW?Ec:kc,he=(0,n.useMemo)(()=>[{value:Ue.PRODUCT_CAROUSEL,label:s("Product carousel")},{value:Ue.SINGLE_IMAGE_PREVIEW,label:s("Single image preview")},{value:Ue.DEAL_ANNOTATION,label:s("Deal Annotation")},{value:Ue.DEAL_CARD,label:s("Deal Card")}],[s]),be=(0,n.useMemo)(()=>{let ce="";d?ce=d.getValue():l?.html&&(ce=l.html);const ee=ce.match(/<title[^>]*>([\s\S]*?)<\/title>/i),me=ee?ee[1].trim():l?.title||l?.subject||"";return dc(me)},[d,l?.html,l?.title,l?.subject]),ae=(0,n.useMemo)(()=>ls({annotationType:O,annotationLogo:_,description:E,discountCode:w,availabilityStarts:v,availabilityEnds:P,offerPageUrl:j,merchantHomepageUrl:C,cards:U}),[O,_,E,w,v,P,j,C,U]),ke=(0,n.useMemo)(()=>L?_c(U,s):[],[L,U,s]),Ce=(0,n.useMemo)(()=>Cd(ae)&&ke.length===0,[ae,ke]),de=(0,n.useMemo)(()=>[...gc(ae,s),...ke],[ae,ke,s]),Fe=(0,n.useMemo)(()=>s("Learn more about %s").split("%s"),[s]),je=(0,n.useCallback)(()=>{!d||!fc(d)||(p.setFieldsValue(rs(O)),k.current={emailId:l?.id,markup:null},h(!1),c.success(s("Gmail annotations were removed from the template code.")))},[d,p,O,l?.id,c,s]);(0,n.useEffect)(()=>{if(!L)return;const ce=p.getFieldValue("cards")??[];if(O===Ue.SINGLE_IMAGE_PREVIEW){if(ce.length>1){p.setFieldsValue({cards:[ce[0]]});return}ce.length===0&&p.setFieldsValue({cards:[Zt()]});return}ce.length===0&&p.setFieldsValue({cards:[Zt()]})},[p,L,O,U]);const re=(0,n.useCallback)(ce=>{if(!ce||!x.current||!d)return!1;const ee=hc(d,ls(ce));if(ee){const me=Jl(os(d.getValue()));k.current={emailId:l?.id,markup:me},h(me!==null)}return ee},[d,l?.id]),Be=(0,n.useCallback)(()=>{re(p.getFieldsValue(!0))&&c.success(s("Gmail annotation was successfully applied to the template code."))},[re,p,c,s]);return(0,n.useEffect)(()=>{if(!i)return;const ce=os(d?.getValue()||l?.html||""),ee={emailId:l?.id,markup:ce?Jl(ce):null};if(h(ee.markup!==null),!bc(k.current,ee))return;k.current=ee,x.current=!1;const me=ce?Hd(ce):null;p.setFieldsValue(me?pc(me):rs()),x.current=!0},[i,l?.id,l?.html,d,p]),(0,o.jsxs)("div",{className:(0,De.default)("selected-social-form","annotations-panel",e),ref:f,children:[(0,o.jsx)(nc,{data:ae,subjectLine:be,parentRef:f,overlayTargetSelector:"#pane-content-iframe",onApply:Be,applyDisabled:!Ce,applyBlockers:de,onRemove:b?je:void 0,visible:i}),(0,o.jsxs)(t.ui_kit$Form,{form:p,layout:"vertical",className:"selected-social-form__form element-controls",autoComplete:"off",children:[(0,o.jsxs)("div",{className:"selected-social-form__section",children:[(0,o.jsx)("div",{className:"selected-social-form__section-title",children:s("General settings")}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Annotation type"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"annotationType",className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Select,{options:he,placeholder:s("Annotation type"),getPopupContainer:go})})}),!G&&(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Organization logo"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)("div",{className:"annotations-panel__field-tooltip-wrap",children:(0,o.jsx)(No,{form:p,label:s("Organization logo"),name:"annotationLogo",watchPath:Sc})})}),(te||J)&&(0,o.jsx)(cs,{iconStrokeWidth:a.iconStrokeWidth}),te&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Price"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:as,className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"CreditCard02Icon",component:t.icons$CreditCard02Icon,size:16,strokeWidth:a.iconStrokeWidth}),placeholder:s("Price"),allowClear:Do})})}),(0,o.jsx)(ns,{name:Tc,pricePath:as,iconStrokeWidth:a.iconStrokeWidth}),(0,o.jsx)(ds,{name:Rc,iconStrokeWidth:a.iconStrokeWidth})]}),R&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Discount description"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"description",className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"CommentOutlined",component:t.icons$CommentOutlined,size:16,strokeWidth:a.iconStrokeWidth}),placeholder:s("Discount description"),allowClear:Do})})}),G&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(cs,{iconStrokeWidth:a.iconStrokeWidth}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Offer page URL"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"offerPageUrl",className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Link03",component:t.icons$Link03,size:16,strokeWidth:a.iconStrokeWidth}),placeholder:s("Offer page URL"),allowClear:Do})})}),(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Merchant homepage URL"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"merchantHomepageUrl",className:"selected-social-form__card-field",children:(0,o.jsx)(t.ui_kit$Input,{prefix:(0,o.jsx)(r.EmIcons,{icon:"Link03",component:t.icons$Link03,size:16,strokeWidth:a.iconStrokeWidth}),placeholder:s("Merchant homepage URL"),allowClear:Do})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,className:"selected-social-form__field-row",children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Starts"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"availabilityStarts",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DatePicker,{showTime:!0,placeholder:s("Starts"),style:ss,getPopupContainer:go})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:To,title:s("Ends"),placement:"bottom",getPopupContainer:go,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"availabilityEnds",className:"form-item-margin-xs",children:(0,o.jsx)(t.ui_kit$DatePicker,{showTime:!0,placeholder:s("Ends"),style:ss,getPopupContainer:go})})})})]})]})]}),L&&(0,o.jsxs)("div",{className:(0,De.default)("selected-social-form__section",{"selected-social-form__section--bordered":!te,"annotations-panel__cards-section":te}),children:[O===Ue.PRODUCT_CAROUSEL&&(0,o.jsxs)("div",{className:"selected-social-form__section-title",children:[s("Promotion cards"),(0,o.jsx)("span",{className:"annotations-panel__section-hint",children:s("max 10")})]}),(0,o.jsx)(t.ui_kit$Form.List,{name:"cards",children:(ce,{add:ee,remove:me})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"selected-social-form__items",children:ce.map((ue,Z)=>(0,o.jsx)(Ic,{field:ue,index:Z,form:p,isSingleImagePreview:te,onRemove:me},ue.key))}),!te&&U.length<oe&&(0,o.jsx)(vc,{onAdd:ee})]})})]}),(0,o.jsxs)("div",{className:"annotations-panel__docs-hint",children:[Fe[0],(0,o.jsx)("a",{href:Bc,target:"_blank",rel:"noopener noreferrer",children:s("Gmail annotations")}),Fe[1]]})]})]})},Ui=({email:e})=>{const{__:i}=r.useI18n(),l=e.hasOwnProperty("type")?r.BLOCK:r.EMAIL,[s,a]=(0,n.useState)(r.SETTINGS),d=r.useAppConfig(),c=T=>a(T||""),p=d.settingsTabEnabled,f=d.UTMEnabled&&l==="email",x=d.annotationsEnabled&&l==="email",k=[p&&"Settings",f&&"UTM parameters",x&&"Annotations parameters"].filter(Boolean),b=k.includes(s)?s:k[0],h=(0,n.useMemo)(()=>{const T=[];return p&&T.push({label:(0,o.jsx)(o.Fragment,{children:i("Settings")}),key:r.SETTINGS,forceRender:!0,className:"email-settings__collapse-panel",children:(0,o.jsx)(Ol,{className:"email-settings__collapse-panel-content",element:e})}),f&&T.push({label:(0,o.jsx)(o.Fragment,{children:i("UTM parameters")}),key:r.UTM_PARAMETERS,forceRender:!0,className:"email-settings__collapse-panel",children:(0,o.jsx)(Hl,{className:"email-settings__collapse-panel-content",email:e})}),x&&T.push({label:(0,o.jsx)(o.Fragment,{children:i("Annotations")}),key:r.ANNOTATIONS_PARAMETERS,forceRender:!0,className:"email-settings__collapse-panel",children:(0,o.jsx)(Cc,{className:"email-settings__collapse-panel-content",email:e,isActive:b===r.ANNOTATIONS_PARAMETERS})}),T},[i,e,p,f,x,b]);return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(t.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse",size:"large",activeKey:b,onChange:c,items:h})})};Ui.propTypes={};var us=320,Pc=1200,Ac=350,{backgroundColor:ms,backgroundImage:Wi,backgroundPositionX:zi,backgroundPositionY:Gi,backgroundRepeat:ei,backgroundSize:Yi,responsive:Nc,backgroundColorContent:Lc,width:Xi}={backgroundColor:"backgroundColor",backgroundImage:"backgroundImage",backgroundPositionX:"backgroundPositionX",backgroundPositionY:"backgroundPositionY",backgroundRepeat:"backgroundRepeat",backgroundSize:"backgroundSize",responsive:"responsive",backgroundColorContent:"backgroundColorContent",width:"width"},Oc={[ms]:"",[Wi]:"",[zi]:"",[Gi]:"",[ei]:"checked",[Yi]:"",[Lc]:"",[Xi]:""};function Ki(e){const i=Number(e);return Number.isNaN(i)?null:{value:i,dim:"px"}}var ps=({className:e=""})=>{const{__:i}=r.useI18n(),{token:l}=(0,t.ui_kit$useToken)(),s=r.useDispatch(),a=r.useAppConfig(),[d]=t.ui_kit$Form.useForm(),c=r.useSendPostMessage(),p=r.useEmailAttribute("common_styles"),f=r.useSelector(r.selectEmailSettings),x=r.useSelector(r.selectIsSettingsDisabled$1),k=r.useSelector(r.selectActiveSettingsTab),b=r.useSelector(r.selectIsNeedUpdateAppearance),[h,T]=(0,n.useState)(!0),_=(0,n.useRef)(!1),E=(0,n.useRef)(null),w=i("Email not yet loaded or global container not found.");(0,n.useEffect)(()=>{b&&(s(r.setIsNeedUpdateAppearance(!1)),c({operation:r.EVENT_TYPES.INIT_PREVIEW}))},[d,b,s,c,p]),(0,n.useEffect)(()=>()=>{E.current&&clearTimeout(E.current)},[]);const v=[{label:i("Not defined"),value:"none"},{label:i("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:i("Repeat background (repeat)"),value:"repeat"},{label:i("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:i("Repeat background vertically (repeat-y)"),value:"repeat-y"}],P=[{label:i("Not defined"),value:""},{label:i("Contain"),value:"contain"},{label:i("Cover"),value:"cover"}];(0,n.useEffect)(()=>{const{width:R,...G}=f,J={...G,backgroundImage:f.backgroundImage?f.backgroundImage[0]?.value:"",backgroundRepeat:f[ei]===""?"repeat":f[ei],backgroundSize:f[Yi],responsive:f.responsive?.shutdown};_.current||(J.width=R?.value,J.widthDim=R?.dim),d.setFieldsValue(J),T(!f.backgroundImage)},[f,d]);const j=(0,n.useCallback)(R=>{const G=Ki(R);!G||G.value<us||c({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:{width:G}})},[c]),C=(0,n.useCallback)(R=>{const G=Ki(R);G&&s(r.setEmailSettings({...f,width:G}))},[s,f]),I=(0,n.useCallback)(R=>{E.current&&clearTimeout(E.current),C(R),E.current=setTimeout(()=>{j(R)},Ac)},[j,C]),K=R=>{const G=d.getFieldsValue(!0),J=Object.keys(R)[0];switch(J){case Xi:I(R[J]);break;case zi:case Gi:c({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:{[J]:R[J]===""?"none":R[J]}});break;case Wi:T(R[J]===""),c({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:{[J]:[{...f?.backgroundImage?.[0],type:"url",value:R[J]}],backgroundSize:"cover"}});break;case Nc:{const te=Ki(G.width);c({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:{responsive:{shutdown:R[J],styles:R[J]},...te?{width:te}:{}}});break}default:c({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:R})}},U=R=>{s(r.setMobileViewActive({shutdown:R,styles:R})),c({operation:r.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:document.querySelector(".email-pane__iframe").getBoundingClientRect().width}})},O=()=>{_.current=!0},L=()=>{E.current&&(clearTimeout(E.current),E.current=null);const R=d.getFieldValue(Xi);C(R),j(R),requestAnimationFrame(()=>{_.current=!1})};return(0,o.jsx)("div",{className:(0,De.default)("appearance-panel",{[e]:e}),children:(0,o.jsxs)(t.ui_kit$Form,{form:d,layout:"vertical",name:"appearance_panel_form",initialValues:{remember:!1,...Oc},onValuesChange:K,autoComplete:"off",className:"element-controls",children:[x?(0,o.jsx)(t.ui_kit$Alert,{style:{marginBottom:"24px"},title:w,type:"error"}):null,(0,o.jsx)(t.ui_kit$FormSection,{title:i("Email layout width"),dividerTop:!1,children:(0,o.jsx)(t.ui_kit$Row,{gutter:10,children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:f.width?.value?i("This field sets the width of the email."):i("Couldn`t determine the email width"),placement:"right",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"width",style:{marginBottom:l.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$InputNumber,{min:us,max:Pc,placeholder:i("Width"),disabled:!f.width?.value,addonAfter:"px",onFocus:O,onBlur:L})})})})})}),a.emailResponsiveControlEnabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Row,{gutter:20,children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"responsive",valuePropName:"checked",children:(0,o.jsx)(t.ui_kit$Switch,{id:"responsive",label:i("Responsive email"),size:"small",name:"responsive",disabled:f.responsive?.shutdown===void 0,onChange:U})})})}),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider"})]}),(0,o.jsx)(t.ui_kit$FormSection,{title:i("Email background color"),dividerTop:!a.emailResponsiveControlEnabled,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:h?16:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Background color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:ms,style:{marginBottom:l.formItemMarginBottomXS},rules:[{message:i("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Background color"),usedColors:f.usedColors,disabled:x})})})}),(0,o.jsx)(t.ui_kit$Col,{span:h?12:24,children:a.formEmailFieldBackgroundImageEnabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(No,{form:d,label:i("Background image"),name:Wi,tooltipTitle:i("Background image"),disabled:x||k!=="Styles",elementSettings:f}),!h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:"0"},children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Horizontal position"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:zi,style:{marginBottom:l.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:i("Horizontal position"),prefix:(0,o.jsx)(r.EmIcons,{icon:"BgPositionHorizontal",component:t.icons$BgPositionHorizontal})})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Vertical position"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:Gi,style:{marginBottom:l.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$Input,{placeholder:i("Vertical position"),prefix:(0,o.jsx)(r.EmIcons,{icon:"BgPositionVertical",component:t.icons$BgPositionVertical})})})})})]})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Background image repeat"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:ei,children:(0,o.jsx)(t.ui_kit$Select,{placeholder:i("Please select"),disabled:x,options:v})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Background image size"),placement:"top",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:Yi,children:(0,o.jsx)(t.ui_kit$Select,{placeholder:i("Please select"),disabled:x,options:P})})})})]})]})]})})]})})]})})};ps.propTypes={className:g.default.string};var{Option:hs}=t.ui_kit$Select,{width:bs,widthDim:$c}={width:"width",widthDim:"widthDim"},Fc={[bs]:"",[$c]:""},fs=({className:e=""})=>{const{__:i}=r.useI18n(),l=r.useSelector(r.selectBlockSettings),s=r.useSelector(r.selectIsSettingsDisabled),[a]=t.ui_kit$Form.useForm(),d=r.useSendPostMessage(),c=i("Block not yet loaded or global container not found.");(0,n.useEffect)(()=>{a.setFieldsValue({width:l.width.value,widthDim:l.width.dim})},[l,a]);const p=f=>{const x=a.getFieldsValue(!0),k=Object.keys(f)[0];let b;switch(k){case"width":b={[k]:{value:f[k],dim:x.widthDim}};break;case"widthDim":b={width:{value:x.width,dim:f[k]}};break;default:return}d({operation:r.EVENT_TYPES.SANDBOX_BLOCK_SETTINGS_SET,settings:b})};return(0,o.jsx)("div",{className:(0,De.default)("block-appearance-panel",{[e]:e}),children:(0,o.jsxs)(t.ui_kit$Form,{form:a,layout:"vertical",name:"block_appearance_panel_form",initialValues:{remember:!1,...Fc},onValuesChange:p,autoComplete:"off",children:[s?(0,o.jsx)(t.ui_kit$Alert,{style:{marginBottom:"24px"},title:c,type:"error"}):null,(0,o.jsx)(t.ui_kit$Form.Item,{label:i("Container width"),name:bs,tooltip:{title:i("Specifies the block width."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},rules:[{message:i("Please input container width")}],children:(0,o.jsx)(t.ui_kit$Input,{disabled:s,placeholder:i("Container width"),addonAfter:(0,o.jsx)(t.ui_kit$Form.Item,{name:"widthDim",noStyle:!0,children:(0,o.jsxs)(t.ui_kit$Select,{className:"select-after",children:[(0,o.jsx)(hs,{value:"px",children:"px"}),(0,o.jsx)(hs,{value:"%",children:"%"})]})})})})]})})};fs.propTypes={className:g.default.string};var Mc=()=>{};function gs(){const e=r.useContainer(),i=(0,n.useCallback)(s=>{if(!e)return Mc;const a=r.provideDefaultCommonStyles(e).watch(s);return()=>a.dispose()},[e]),l=(0,n.useCallback)(()=>r.getDefaultCommonStyles(e),[e]);return(0,n.useSyncExternalStore)(i,l,l)}function _s(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function qi(e,i){const l={...e};for(const s of Object.keys(i)){const a=i[s],d=e[s];_s(a)&&_s(d)?l[s]=qi(d,a):a!==void 0&&(l[s]=a)}return l}function xs(e,i){const l=r.COMMON_STYLES;if(typeof e=="string"){const s=e.trim();if(s.startsWith("{"))try{const a=JSON.parse(s);if(a&&typeof a=="object"&&!Array.isArray(a)&&Object.keys(a).length>0)return qi(l,a)}catch{}}return i&&typeof i=="object"&&!Array.isArray(i)?qi(l,i):l}var ks=e=>({textFontFamily:e.text.fontFamily,textFontSize:e.text.fontSize,textFontSizeDim:e.text.fontSizeDim,textLineHeight:e.text.lineHeight,textLineHeightDim:e.text.lineHeightDim,textColor:e.text.color,textContrastColor:e.text.contrastColor||"#FFFFFF",textAlign:e.text.textAlign,textPaddingBottom:e.text.paddingBottom,textPaddingBottomDim:e.text.paddingBottomDim,headingFontFamily:e.headings.fontFamily,headingFontSize:e.headings.fontSize,headingFontSizeDim:e.headings.fontSizeDim,headingLineHeight:e.headings.lineHeight,headingLineHeightDim:e.headings.lineHeightDim,headingColor:e.headings.color,headingContrastColor:e.headings.contrastColor||"#FFFFFF",headingAlign:e.headings.textAlign,headingPaddingTop:e.headings.paddingTop,headingPaddingTopDim:e.headings.paddingTopDim,headingPaddingBottom:e.headings.paddingBottom,headingPaddingBottomDim:e.headings.paddingBottomDim,headingLetterSpacing:e.headings.letterSpacing,headingLetterSpacingDim:e.headings.letterSpacingDim,headingBold:e.headings.bold,headingItalic:e.headings.italic,linkColor:e.links.color,linkContrastColor:e.links.contrastColor||"#FFFFFF",linkUnderline:e.links.underline,buttonsFontFamily:e.buttons.fontFamily,buttonsFontSize:e.buttons.fontSize,buttonsFontSizeDim:e.buttons.fontSizeDim,buttonsLetterSpacing:e.buttons.letterSpacing,buttonsLetterSpacingDim:e.buttons.letterSpacingDim,buttonsColor:e.buttons.color,buttonsContrastColor:e.buttons.contrastColor||"#1890ff",buttonsBold:e.buttons.bold,buttonsItalic:e.buttons.italic,buttonsBackgroundColor:e.buttons.backgroundColor,buttonsContrastBackgroundColor:e.buttons.contrastBackgroundColor||"#FFFFFF",buttonsMarginTop:e.buttons.marginTop,buttonsMarginTopDim:e.buttons.marginTopDim,buttonsMarginBottom:e.buttons.marginBottom,buttonsMarginBottomDim:e.buttons.marginBottomDim,buttonsBorder:e.buttons.border,buttonsAlign:e.buttons.textAlign,buttonsBorderRadius:e.buttons.borderRadius,buttonsPadding:e.buttons.padding,cardsContrastBackgroundColor:e.cards?.contrastBackgroundColor||"#1890ff",cardsBaseBackgroundColor:e.cards?.baseBackgroundColor||"#F8F8F8",cardsContrastTextColor:e.cards?.contrastTextColor||"#FFFFFF",cardsBaseTextColor:e.cards?.baseTextColor||"#5A5A5A",cardsBorder:e.cards?.border||{all:null,top:null,right:null,bottom:null,left:null},cardsBorderRadius:e.cards?.borderRadius||{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},blockBackgroundColor:e.block?.backgroundColor||"",blockContrastBackgroundColor:e.block?.contrastBackgroundColor||"#1890ff",blockPaddingAll:e.block?.padding?.all,blockPaddingTop:e.block?.padding?.top,blockPaddingRight:e.block?.padding?.right,blockPaddingBottom:e.block?.padding?.bottom,blockPaddingLeft:e.block?.padding?.left}),Dc={buttons_borderRadiusAll:"all",buttons_borderRadiusTopLeft:"topLeft",buttons_borderRadiusBottomLeft:"bottomLeft",buttons_borderRadiusTopRight:"topRight",buttons_borderRadiusBottomRight:"bottomRight"},Vc={cards_borderRadiusAll:"all",cards_borderRadiusTopLeft:"topLeft",cards_borderRadiusBottomLeft:"bottomLeft",cards_borderRadiusTopRight:"topRight",cards_borderRadiusBottomRight:"bottomRight"},Hc={blockPaddingTop:"top",blockPaddingLeft:"left",blockPaddingRight:"right",blockPaddingBottom:"bottom"},Uc=({className:e})=>{const{__:i}=r.useI18n(),l=z.useGoogleFontsLoader(),s=r.useDispatch(),a=r.useSendPostMessage(),[d]=t.ui_kit$Form.useForm(),c=r.useSelector(r.selectEmailSettings),p=r.useSelector(r.selectIsNeedUpdateContentAppearance),f=gs(),x=r.useEmailAttribute("common_styles"),k=r.useAppConfig(),{token:b}=(0,t.ui_kit$useToken)(),[h,T]=(0,n.useState)({}),[_,E]=(0,n.useState)({}),[w,v]=(0,n.useState)(!0),[P,j]=(0,n.useState)(!0),[C,I]=(0,n.useState)(!1),[K,U]=(0,n.useState)(!1),O={buttonsPaddingTop:"top",buttonsPaddingLeft:"left",buttonsPaddingRight:"right",buttonsPaddingBottom:"bottom"},L=xs(x,f),[R,G]=(0,n.useState)(L.headings.bold),[J,te]=(0,n.useState)(L.headings.italic),[oe,he]=(0,n.useState)(L.links.underline),[be,ae]=(0,n.useState)(L.buttons.bold),[ke,Ce]=(0,n.useState)(L.buttons.italic),[de,Fe]=(0,n.useState)(null),je=r.useSelector(r.selectIsPanelHistoryCollapsed);(0,n.useEffect)(()=>{je||Fe(null)},[L,Fe,je]),(0,n.useEffect)(()=>{je&&!de&&Fe(ks(L))},[L,de,je]),(0,n.useEffect)(()=>{p&&(s(r.setIsNeedUpdateContentAppearance(!1)),d.setFieldsValue(ks(L)))},[d,p,s,L]);const[re,Be]=(0,n.useState)(Math.min(L.headings.fontSize-1,19)),[ce,ee]=(0,n.useState)(Math.max(L.text.fontSize+1,20));(0,n.useEffect)(()=>{if(de){const Q=de.buttonsBorder;T(Q);const W=Object.keys(Q).find(xe=>Q[xe]?.width||Q[xe]?.style||Q[xe]?.color),q=de.cardsBorder;E(q);const se=Object.keys(q).find(xe=>q[xe]?.width||q[xe]?.style||q[xe]?.color);d.setFieldsValue({buttons_borderPosition:W||"all",buttons_borderWidth:Q[W]?.width!==null?Q[W]?.width:"",buttons_borderColor:Q[W]?.color||"",buttons_borderStyle:Q[W]?.style||"",cards_borderPosition:se||"all",cards_borderWidth:q[se]?.width!==null?q[se]?.width:"",cards_borderColor:q[se]?.color||"",cards_borderStyle:q[se]?.style||"",buttons_borderRadiusAll:u(de.buttonsBorderRadius.all),buttons_borderRadiusTopLeft:u(de.buttonsBorderRadius.topLeft),buttons_borderRadiusBottomLeft:u(de.buttonsBorderRadius.bottomLeft),buttons_borderRadiusTopRight:u(de.buttonsBorderRadius.topRight),buttons_borderRadiusBottomRight:u(de.buttonsBorderRadius.bottomRight),cards_borderRadiusAll:u(de.cardsBorderRadius.all),cards_borderRadiusTopLeft:u(de.cardsBorderRadius.topLeft),cards_borderRadiusBottomLeft:u(de.cardsBorderRadius.bottomLeft),cards_borderRadiusTopRight:u(de.cardsBorderRadius.topRight),cards_borderRadiusBottomRight:u(de.cardsBorderRadius.bottomRight),blockPaddingAll:u(de.blockPaddingAll),blockPaddingTop:u(de.blockPaddingTop),blockPaddingRight:u(de.blockPaddingRight),blockPaddingBottom:u(de.blockPaddingBottom),blockPaddingLeft:u(de.blockPaddingLeft),blockPaddingLeftRight:u(de.blockPaddingRight)||u(de.blockPaddingLeft),blockPaddingTopBottom:u(de.blockPaddingTop)||u(de.blockPaddingBottom)}),!u(de.blockPaddingAll)&&(u(de.blockPaddingTop)||u(de.blockPaddingRight)||u(de.blockPaddingBottom)||u(de.blockPaddingLeft))&&(de.blockPaddingTop!==de.blockPaddingBottom||de.blockPaddingRight!==de.blockPaddingLeft)?U(!1):U(!0),!u(de.buttonsBorderRadius.all)&&(u(de.buttonsBorderRadius.topLeft)||u(de.buttonsBorderRadius.bottomLeft)||u(de.buttonsBorderRadius.topRight)||u(de.buttonsBorderRadius.bottomRight))?v(!1):v(!0),de.buttonsPadding&&!u(de.buttonsPadding.all)&&(u(de.buttonsPadding.bottom)||u(de.buttonsPadding.right)||u(de.buttonsPadding.left)||u(de.buttonsPadding.top))&&I(!1),!u(de.cardsBorderRadius?.all)&&(u(de.cardsBorderRadius?.topLeft)||u(de.cardsBorderRadius?.bottomLeft)||u(de.cardsBorderRadius?.topRight)||u(de.cardsBorderRadius?.bottomRight))?j(!1):j(!0)}},[d,de]);const me=()=>{U(W=>!W);const Q=d.getFieldsValue(!0);if(!K){Q.blockPaddingLeftRight=Q.blockPaddingLeft,Q.blockPaddingTopBottom=Q.blockPaddingTop,Q.blockPaddingRight=Q.blockPaddingLeft,Q.blockPaddingBottom=Q.blockPaddingTop;const W=Number(Q.blockPaddingTopBottom),q=Number(Q.blockPaddingLeftRight);a({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:{blockPadding:{top:Number.isFinite(W)?W:0,bottom:Number.isFinite(W)?W:0,left:Number.isFinite(q)?q:0,right:Number.isFinite(q)?q:0}}})}},ue=Q=>{const W=Q.target.closest("button");if(!W)return;const q=W.name,se=W.classList.contains("selected-td-form__button--active");W.className=se?"ant-btn ant-btn-default":"ant-btn ant-btn-default selected-td-form__button--active";try{W.blur()}catch{}q==="headingBold"?G(!se):q==="headingItalic"?te(!se):q==="linkUnderline"?he(!se):q==="buttonsBold"?ae(!se):q==="buttonsItalic"&&Ce(!se),a({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:{[q]:!se}})},Z=Q=>{const W=d.getFieldsValue(!0),q=Object.keys(Q)[0];let se={};switch(q){case"headingFontSize":Be(Math.min(W.headingFontSize-1,19)),se=Q;break;case"textFontSize":ee(Math.max(W.textFontSize+1,20)),se=Q;break;case"buttons_borderStyle":se={buttonsBorder:{[W.buttons_borderPosition]:{...h[W.buttons_borderPosition],style:Q[q]}}},W.buttons_borderPosition==="all"?T(xe=>({...r.RESET_BORDER_PARAMS,[W.buttons_borderPosition]:{...xe[W.buttons_borderPosition],style:Q[q]}})):T(xe=>({...xe,[W.buttons_borderPosition]:{...xe[W.buttons_borderPosition],style:Q[q]}}));break;case"buttons_borderColor":se={buttonsBorder:{[W.buttons_borderPosition]:{...h[W.buttonsBorderPosition],color:Q[q]}}},W.buttons_borderPosition==="all"?T(xe=>({...r.RESET_BORDER_PARAMS,[W.buttons_borderPosition]:{...xe[W.buttons_borderPosition],color:Q[q]}})):T(xe=>({...xe,[W.buttons_borderPosition]:{...xe[W.buttons_borderPosition],color:Q[q]}}));break;case"buttons_borderWidth":se={buttonsBorder:{[W.buttons_borderPosition]:{...h[W.buttons_borderPosition],width:Q[q]}}},W.buttonsBorderPosition==="all"?T(xe=>({...r.RESET_BORDER_PARAMS,[W.buttons_borderPosition]:{...xe[W.buttons_borderPosition],width:Q[q]}})):T(xe=>({...xe,[W.buttons_borderPosition]:{...xe[W.buttons_borderPosition],width:Q[q]}}));break;case"buttons_borderPosition":d.setFieldsValue({buttons_borderWidth:h[Q[q]]?.width||"",buttons_borderColor:h[Q[q]]?.color||"",buttons_borderStyle:h[Q[q]]?.style||""});break;case"cards_borderStyle":se={cardsBorder:{[W.cards_borderPosition]:{..._[W.cards_borderPosition],style:Q[q]}}},W.cards_borderPosition==="all"?E(xe=>({...r.RESET_BORDER_PARAMS,[W.cards_borderPosition]:{...xe[W.cards_borderPosition],style:Q[q]}})):E(xe=>({...xe,[W.cards_borderPosition]:{...xe[W.cards_borderPosition],style:Q[q]}}));break;case"cards_borderColor":se={cardsBorder:{[W.cards_borderPosition]:{..._[W.cardsBorderPosition],color:Q[q]}}},W.cards_borderPosition==="all"?E(xe=>({...r.RESET_BORDER_PARAMS,[W.cards_borderPosition]:{...xe[W.cards_borderPosition],color:Q[q]}})):E(xe=>({...xe,[W.cards_borderPosition]:{...xe[W.cards_borderPosition],color:Q[q]}}));break;case"cards_borderWidth":se={cardsBorder:{[W.cards_borderPosition]:{..._[W.cards_borderPosition],width:Q[q]}}},W.cardsBorderPosition==="all"?E(xe=>({...r.RESET_BORDER_PARAMS,[W.cards_borderPosition]:{...xe[W.cards_borderPosition],width:Q[q]}})):E(xe=>({...xe,[W.cards_borderPosition]:{...xe[W.cards_borderPosition],width:Q[q]}}));break;case"cards_borderPosition":d.setFieldsValue({cards_borderWidth:_[Q[q]]?.width||"",cards_borderColor:_[Q[q]]?.color||"",cards_borderStyle:_[Q[q]]?.style||""});break;case"buttons_borderRadiusAll":case"buttons_borderRadiusTopLeft":case"buttons_borderRadiusBottomLeft":case"buttons_borderRadiusTopRight":case"buttons_borderRadiusBottomRight":se={buttonsBorderRadius:{[Dc[q]]:+Q[q]}};break;case"cards_borderRadiusAll":case"cards_borderRadiusTopLeft":case"cards_borderRadiusBottomLeft":case"cards_borderRadiusTopRight":case"cards_borderRadiusBottomRight":se={cardsBorderRadius:{[Vc[q]]:+Q[q]}};break;case"buttonsPaddingTop":case"buttonsPaddingLeft":case"buttonsPaddingRight":case"buttonsPaddingBottom":C?(se={padding:{all:+Q[q]}},d.setFieldsValue({paddingTop:Q[q],paddingLeft:Q[q],paddingRight:Q[q],paddingBottom:Q[q]})):se={buttonsPadding:{[O[q]]:+Q[q]}};break;case"blockPaddingTop":case"blockPaddingLeft":case"blockPaddingRight":case"blockPaddingBottom":se={blockPadding:{[Hc[q]]:+Q[q]}};break;case"blockPaddingTopBottom":se={blockPadding:{top:+Q[q],bottom:+Q[q]}},W.blockPaddingTop=W.blockPaddingBottom=+Q[q];break;case"blockPaddingLeftRight":se={blockPadding:{left:+Q[q],right:+Q[q]}},W.blockPaddingLeft=W.blockPaddingRight=+Q[q];break;default:se=Q}q!=="buttons_borderPosition"&&a({operation:r.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:se})};return de&&(0,o.jsx)("div",{className:(0,De.default)("appearance-panel",{[e]:e}),children:(0,o.jsxs)(t.ui_kit$Form,{form:d,layout:"vertical",name:"content_appearance_panel_form",initialValues:de,onValuesChange:Z,autoComplete:"off",className:"element-controls",children:[null,(0,o.jsxs)(t.ui_kit$FormSection,{title:i("Blocks"),dividerTop:!1,children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Blocks background color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"blockBackgroundColor",style:{marginBottom:b.formItemMarginBottomMD+4},rules:[{message:i("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Background color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Background color of the contrast blocks"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"blockContrastBackgroundColor",style:{marginBottom:b.formItemMarginBottomMD+4},rules:[{message:i("Please set the background color")}],children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Background color"),usedColors:c.usedColors})})})})]}),(0,o.jsx)(t.ui_kit$FormPaddingInputs,{extended:K,onToggleExtended:me,fieldNames:{paddingLeftRight:"blockPaddingLeftRight",paddingLeft:"blockPaddingLeft",paddingRight:"blockPaddingRight",paddingTopBottom:"blockPaddingTopBottom",paddingTop:"blockPaddingTop",paddingBottom:"blockPaddingBottom"},labels:{horizontal:i("Horizontal padding"),vertical:i("Vertical padding"),left:i("Left padding"),right:i("Right padding"),top:i("Top padding"),bottom:i("Bottom padding"),individual:i("Individual padding")},gutter:10,rowStyle:{paddingBottom:4}})]}),(0,o.jsxs)(t.ui_kit$FormSection,{title:i("General text"),dividerTop:!0,children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Font of the general text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textFontFamily",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{loadGoogleFonts:l,getPopupContainer:Q=>Q.closest(".email-pane__content-col")})})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Font size of the general text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textFontSize",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:15,max:re,placeholder:i("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Line height of the general text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textLineHeight",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Color of the general text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Text color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Contrast block text color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textContrastColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Text color"),usedColors:c.usedColors})})})})]}),(0,o.jsx)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Bottom padding of the general text"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"textPaddingBottom",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Bottom padding"),prefix:(0,o.jsx)(r.EmIcons,{icon:"PaddingBottom",component:t.icons$PaddingBottom}),addonAfter:"px"})})})})})]}),(0,o.jsxs)(t.ui_kit$FormSection,{title:i("Headings"),dividerTop:!0,children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Heading font"),placement:"left",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingFontFamily",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{loadGoogleFonts:l,getPopupContainer:Q=>Q.closest(".email-pane__content-col")})})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Heading font size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingFontSize",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:ce,max:40,placeholder:i("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Heading line height"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingLineHeight",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Line height"),prefix:(0,o.jsx)(r.EmIcons,{icon:"LineHeightOutlined",component:t.icons$LineHeightOutlined}),addonAfter:"px"})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Heading letter spacing"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingLetterSpacing",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Letter spacing"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsxs)(t.ui_kit$Space,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:i("Strong"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)({"selected-td-form__button--active":R}),type:"default",name:"headingBold",onClick:ue,children:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined})})}),(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:i("Italic"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)({"selected-td-form__button--active":J}),type:"default",name:"headingItalic",onClick:ue,children:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined})})})]})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Heading color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Heading color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Contrast block header color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingContrastColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Heading color"),usedColors:c.usedColors})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Top padding"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingPaddingTop",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Top padding"),prefix:(0,o.jsx)(r.EmIcons,{icon:"PaddingTop",component:t.icons$PaddingTop}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Bottom padding"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"headingPaddingBottom",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Bottom padding"),prefix:(0,o.jsx)(r.EmIcons,{icon:"PaddingBottom",component:t.icons$PaddingBottom}),addonAfter:"px"})})})})]})]}),(0,o.jsxs)(t.ui_kit$FormSection,{title:i("Links"),dividerTop:!0,children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Link color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"linkColor",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Link color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:i("Underline"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)({"selected-td-form__button--active":oe}),type:"default",name:"linkUnderline",onClick:ue,children:(0,o.jsx)(r.EmIcons,{icon:"UnderlineOutlined",component:t.icons$UnderlineOutlined})})})})]}),(0,o.jsx)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Link color in contrasting blocks"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"linkContrastColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Link color"),usedColors:c.usedColors})})})})})]}),(0,o.jsxs)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Buttons")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Text & background")]}),dividerTop:!0,children:[(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Buttons font"),placement:"left",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsFontFamily",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ControlFontFamily,{loadGoogleFonts:l,getPopupContainer:Q=>Q.closest(".email-pane__content-col")})})}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Buttons font size"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsFontSize",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Font size"),prefix:(0,o.jsx)(r.EmIcons,{icon:"FontSizeOutlined",component:t.icons$FontSizeOutlined}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Buttons letter spacing"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsLetterSpacing",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Letter spacing"),prefix:(0,o.jsx)(r.EmIcons,{icon:"ColumnWidthOutlined",component:t.icons$ColumnWidthOutlined}),addonAfter:"px"})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Buttons text color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsColor",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Buttons text color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Button text color in contrasting blocks"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsContrastColor",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Buttons text color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Buttons background color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsBackgroundColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Background color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Button background color in contrasting blocks"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsContrastBackgroundColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Background color"),usedColors:c.usedColors})})})}),k.formButtonFieldTextAlignEnabled&&(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(it,{form:d,elementSettings:{textAlign:"",type:"email"},imgParent:!1,name:"buttonsAlign",withHotKeys:!1})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsxs)(t.ui_kit$Space,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:i("Strong"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)({"selected-td-form__button--active":be}),type:"default",name:"buttonsBold",onClick:ue,children:(0,o.jsx)(r.EmIcons,{icon:"BoldOutlined",component:t.icons$BoldOutlined})})}),(0,o.jsx)(t.ui_kit$Tooltip,{placement:"bottom",title:i("Italic"),children:(0,o.jsx)(t.ui_kit$Button,{className:(0,De.default)({"selected-td-form__button--active":ke}),type:"default",name:"buttonsItalic",onClick:ue,children:(0,o.jsx)(r.EmIcons,{icon:"ItalicOutlined",component:t.icons$ItalicOutlined})})})]})})]})]}),k.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Buttons")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Borders")]}),dividerTop:!0,children:(0,o.jsx)("div",{style:{paddingBottom:4},children:(0,o.jsx)(z.SelectedElementFormBorder,{form:d,borders:h,namePrefix:"buttons_"})})}),k.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Buttons")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Border radius")]}),dividerTop:!0,children:(0,o.jsx)("div",{style:{paddingBottom:4},children:(0,o.jsx)(So,{form:d,oneBorderRadiusValue:w,setOneBorderRadiusValue:v,elementSettings:de,namePrefix:"buttons_"})})}),(0,o.jsx)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Buttons")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Margins")]}),dividerTop:!0,children:(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Top margin"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsMarginTop",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Top margin"),prefix:(0,o.jsx)(r.EmIcons,{icon:"PaddingTop",component:t.icons$PaddingTop}),addonAfter:"px"})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Bottom margin"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"buttonsMarginBottom",children:(0,o.jsx)(t.ui_kit$DraggableInputNumber,{min:0,placeholder:i("Bottom margin"),prefix:(0,o.jsx)(r.EmIcons,{icon:"PaddingBottom",component:t.icons$PaddingBottom}),addonAfter:"px"})})})})]})}),(0,o.jsxs)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Cards")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Colors")]}),dividerTop:!0,children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:10,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$FormSection,{title:i("Base colors"),compact:!0,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Base background color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"cardsBaseBackgroundColor",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Base background color"),usedColors:c.usedColors})})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$FormSection,{title:i("Contrasting colors"),compact:!0,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Contrasting background color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"cardsContrastBackgroundColor",style:{marginBottom:b.formItemMarginBottomXS},children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Contrasting background color"),usedColors:c.usedColors})})})})})]}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,style:{paddingBottom:4},children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Base text color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"cardsBaseTextColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Base text color"),usedColors:c.usedColors})})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Tooltip,{trigger:["hover"],title:i("Contrasting text color"),placement:"bottom",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:"cardsContrastTextColor",children:(0,o.jsx)(t.ui_kit$ColorPickerInput,{placeholder:i("Contrasting text color"),usedColors:c.usedColors})})})})]})]}),k.formFieldBorderEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Cards")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Borders")]}),dividerTop:!0,children:(0,o.jsx)("div",{style:{paddingBottom:4},children:(0,o.jsx)(z.SelectedElementFormBorder,{form:d,borders:_,namePrefix:"cards_"})})}),k.formFieldBorderRadiusEnabled&&(0,o.jsx)(t.ui_kit$FormSection,{title:(0,o.jsxs)(o.Fragment,{children:[i("Cards")," ",(0,o.jsx)("span",{className:"section-title-bull",children:"•"})," ",i("Border radius")]}),dividerTop:!0,children:(0,o.jsx)("div",{style:{paddingBottom:4},children:(0,o.jsx)(So,{form:d,oneBorderRadiusValue:P,setOneBorderRadiusValue:j,elementSettings:de,namePrefix:"cards_"})})})]})})},Ji=({email:e})=>{const{__:i}=r.useI18n(),l=e.hasOwnProperty("type")?r.BLOCK:r.EMAIL,[s,a]=(0,n.useState)(r.APPEARANCE),d=r.useAppConfig(),c=x=>a(x||"");e.common_styles&&e.common_styles;const p=l==="email"&&d.commonStylesEnabled&&!0;let f=[{label:(0,o.jsx)(o.Fragment,{children:i(l==="email"?"Global styles":"Block styles")}),key:r.APPEARANCE,forceRender:!0,className:"email-settings__collapse-panel",children:l==="email"?(0,o.jsx)(ps,{className:"email-settings__collapse-panel-content"}):(0,o.jsx)(fs,{className:"email-settings__collapse-panel-content"})}];return p&&f.push({label:(0,o.jsx)(o.Fragment,{children:i("Content styles")}),key:"contentStyles",forceRender:!0,className:"email-settings__collapse-panel",children:(0,o.jsx)(Uc,{className:"email-settings__collapse-panel-content"})}),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(t.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse appearance-panel__content-styles",size:"large",activeKey:s,onChange:c,items:f})})};Ji.propTypes={};var Wc=to.__commonJSMin((e=>{var i=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"].reduce((l,s)=>(l[s.toLowerCase()]=s,l),{});e.CASE_SENSITIVE_TAG_NAMES_MAP=i}));function zc(e){return e.type===Ze.Tag||e.type===Ze.Script||e.type===Ze.Style}var Ze,Gc,Yc,Xc,Kc,qc,Jc,Qc,Zc,eu,Es=to.__esmMin((()=>{(function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"})(Ze||(Ze={})),Gc=Ze.Root,Yc=Ze.Text,Xc=Ze.Directive,Kc=Ze.Comment,qc=Ze.Script,Jc=Ze.Style,Qc=Ze.Tag,Zc=Ze.CDATA,eu=Ze.Doctype}));function Bs(e){return zc(e)}function Ss(e){return e.type===Ze.CDATA}function Ts(e){return e.type===Ze.Text}function Rs(e){return e.type===Ze.Comment}function ys(e){return e.type===Ze.Directive}function ws(e){return e.type===Ze.Root}function ou(e){return Object.hasOwn(e,"children")}function Qi(e,i=!1){let l;if(Ts(e))l=new yt(e.data);else if(Rs(e))l=new ti(e.data);else if(Bs(e)){const s=i?Zi(e.children):[],a=new li(e.name,{...e.attribs},s);for(const d of s)d.parent=a;e.namespace!=null&&(a.namespace=e.namespace),e["x-attribsNamespace"]&&(a["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(a["x-attribsPrefix"]={...e["x-attribsPrefix"]}),l=a}else if(Ss(e)){const s=i?Zi(e.children):[],a=new ri(s);for(const d of s)d.parent=a;l=a}else if(ws(e)){const s=i?Zi(e.children):[],a=new jt(s);for(const d of s)d.parent=a;e["x-mode"]&&(a["x-mode"]=e["x-mode"]),l=a}else if(ys(e)){const s=new ii(e.name,e.data);e["x-name"]!=null&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),l=s}else throw new Error(`Not implemented yet: ${e.type}`);return l.startIndex=e.startIndex,l.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(l.sourceCodeLocation=e.sourceCodeLocation),l}function Zi(e){const i=e.map(l=>Qi(l,!0));for(let l=1;l<i.length;l++)i[l].prev=i[l-1],i[l-1].next=i[l];return i}var oi,Rt,yt,ti,ii,wt,ri,jt,li,js=to.__esmMin((()=>{Es(),oi=class{parent=null;prev=null;next=null;startIndex=null;endIndex=null;get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return Qi(this,e)}},Rt=class extends oi{data;constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}},yt=class extends Rt{type=Ze.Text;get nodeType(){return 3}},ti=class extends Rt{type=Ze.Comment;get nodeType(){return 8}},ii=class extends Rt{type=Ze.Directive;name;constructor(e,i){super(i),this.name=e}get nodeType(){return 1}"x-name";"x-publicId";"x-systemId"},wt=class extends oi{children;constructor(e){super(),this.children=e}get firstChild(){return this.children[0]??null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}},ri=class extends wt{type=Ze.CDATA;get nodeType(){return 4}},jt=class extends wt{type=Ze.Root;get nodeType(){return 9}},li=class extends wt{name;attribs;type;constructor(e,i,l=[],s=e==="script"?Ze.Script:e==="style"?Ze.Style:Ze.Tag){super(l),this.name=e,this.attribs=i,this.type=s}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map(e=>({name:e,value:this.attribs[e],namespace:this["x-attribsNamespace"]?.[e],prefix:this["x-attribsPrefix"]?.[e]}))}namespace;"x-attribsNamespace";"x-attribsPrefix"}})),er=to.__exportAll({CDATA:()=>ri,Comment:()=>ti,DataNode:()=>Rt,Document:()=>jt,DomHandler:()=>tr,Element:()=>li,Node:()=>oi,NodeWithChildren:()=>wt,ProcessingInstruction:()=>ii,Text:()=>yt,cloneNode:()=>Qi,default:()=>tr,hasChildren:()=>ou,isCDATA:()=>Ss,isComment:()=>Rs,isDirective:()=>ys,isDocument:()=>ws,isTag:()=>Bs,isText:()=>Ts}),or,tr,ir=to.__esmMin((()=>{Es(),js(),js(),or={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},tr=class{dom=[];root=new jt(this.dom);callback;options;elementCB;done=!1;tagStack=[this.root];lastNode=null;parser=null;constructor(e,i,l){typeof i=="function"&&(l=i,i=or),typeof e=="object"&&(i=e,e=void 0),this.callback=e??null,this.options=i??or,this.elementCB=l??null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new jt(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;const e=this.tagStack.pop();this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,i){const l=this.options.xmlMode?Ze.Tag:void 0,s=new li(e,i,void 0,l);this.addNode(s),this.tagStack.push(s)}ontext(e){const{lastNode:i}=this;if(i&&i.type===Ze.Text)i.data+=e,this.options.withEndIndices&&this.parser&&(i.endIndex=this.parser.endIndex);else{const l=new yt(e);this.addNode(l),this.lastNode=l}}oncomment(e){if(this.lastNode&&this.lastNode.type===Ze.Comment){this.lastNode.data+=e;return}const i=new ti(e);this.addNode(i),this.lastNode=i}oncommentend(){this.lastNode=null}oncdatastart(){const e=new yt(""),i=new ri([e]);this.addNode(i),e.parent=i,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,i){const l=new ii(e,i);this.addNode(l)}handleCallback(e){if(typeof this.callback=="function")this.callback(e,this.dom);else if(e)throw e}addNode(e){const i=this.tagStack[this.tagStack.length-1],l=i.children[i.children.length-1];this.options.withStartIndices&&this.parser&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&this.parser&&(e.endIndex=this.parser.endIndex),i.children.push(e),l&&(e.prev=l,l.next=e),e.parent=i,this.lastNode=null}}})),vs=to.__commonJSMin((e=>{var i=Wc(),l=(ir(),to.__toCommonJS(er)),s="\r",a=new RegExp(s,"g"),d=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now().toString()}__`,c=new RegExp(d,"g");function p(_){return i.CASE_SENSITIVE_TAG_NAMES_MAP[_]}function f(_){const E={};let w=0;const v=_.length;for(;w<v;w++){const P=_[w];E[P.name]=P.value}return E}function x(_){_=_.toLowerCase();const E=p(_);return E||_}function k(_,E){const w="<"+E,v=_.toLowerCase().indexOf(w);if(v===-1)return!1;const P=_[v+w.length];return P===">"||P===" "||P===" "||P===`
|
|
19
|
+
`||P==="\r"||P==="/"}function b(_){return _.replace(a,d)}function h(_){return _.replace(c,s)}function T(_,E=null,w){const v=[];let P,j=0;const C=_.length;for(;j<C;j++){const I=_[j];switch(I.nodeType){case 1:{const U=x(I.nodeName);P=new l.Element(U,f(I.attributes)),P.children=T(U==="template"?I.content.childNodes:I.childNodes,P);break}case 3:P=new l.Text(h(I.nodeValue??""));break;case 8:P=new l.Comment(I.nodeValue??"");break;default:continue}const K=v[j-1]??null;K&&(K.next=P),P.parent=E,P.prev=K,P.next=null,v.push(P)}return w&&(P=new l.ProcessingInstruction(w.substring(0,w.indexOf(" ")).toLowerCase(),w),P.next=v[0]??null,P.parent=E,v.unshift(P),v[1]&&(v[1].prev=v[0])),v}e.escapeSpecialCharacters=b,e.formatDOM=T,e.hasOpenTag=k})),tu=to.__commonJSMin((e=>{var i=vs(),l="html",s="head",a="body",d=/<([a-zA-Z]+[0-9]?)/;function c(_,E){return E?E.createHTML(_):_}var p=(_,E,w)=>{throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},f=(_,E,w)=>{throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},x=typeof window=="object"&&window.DOMParser;if(typeof x=="function"){const _=new x,E="text/html";f=(w,v,P)=>(v&&(w=`<${v}>${w}</${v}>`),_.parseFromString(w,E)),p=f}if(typeof document=="object"&&document.implementation){const _=document.implementation.createHTMLDocument();p=function(E,w,v){if(w){const P=_.documentElement.querySelector(w);return P&&(P.innerHTML=c(E,v)),_}return _.documentElement.innerHTML=c(E,v),_}}var k=typeof document=="object"&&document.createElement("template"),b;k&&k.content&&(b=(_,E)=>(k.innerHTML=c(_,E),k.content.childNodes));var h=()=>document.createDocumentFragment().childNodes;function T(_,E){_=i.escapeSpecialCharacters(_);const w=d.exec(_)?.[1]?.toLowerCase();switch(w){case l:{const v=f(_);if(!i.hasOpenTag(_,s)){const P=v.querySelector(s);P?.parentNode?.removeChild(P)}if(!i.hasOpenTag(_,a)){const P=v.querySelector(a);P?.parentNode?.removeChild(P)}return v.querySelectorAll(l)}case s:case a:{const v=p(_,void 0,E).querySelectorAll(w);return i.hasOpenTag(_,a)&&i.hasOpenTag(_,s)?v[0].parentNode?.childNodes??h():v}default:return b?b(_,E):p(_,a,E).querySelector(a)?.childNodes??h()}}e.default=T})),iu=to.__commonJSMin((e=>{Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var i=vs(),l=tu(),s=/<(![a-zA-Z\s]+)>/;function a(d,c){if(typeof d!="string")throw new TypeError("First argument must be a string");if(!d)return[];const p=s.exec(d),f=p?p[1]:void 0;return i.formatDOM(l.default(d,c?.trustedTypePolicy),null,f)}e.default=a})),ru=to.__commonJSMin((e=>{var i=0;e.SAME=i;var l=1;e.CAMELCASE=l,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),lu=to.__commonJSMin((e=>{var i=0,l=1,s=2,a=3,d=4,c=5,p=6;function f(j){return k.hasOwnProperty(j)?k[j]:null}function x(j,C,I,K,U,O,L){this.acceptsBooleans=C===s||C===a||C===d,this.attributeName=K,this.attributeNamespace=U,this.mustUseProperty=I,this.propertyName=j,this.type=C,this.sanitizeURL=O,this.removeEmptyString=L}var k={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(j=>{k[j]=new x(j,i,!1,j,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([j,C])=>{k[j]=new x(j,l,!1,C,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(j=>{k[j]=new x(j,s,!1,j.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(j=>{k[j]=new x(j,s,!1,j,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(j=>{k[j]=new x(j,a,!1,j.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(j=>{k[j]=new x(j,a,!0,j,null,!1,!1)}),["capture","download"].forEach(j=>{k[j]=new x(j,d,!1,j,null,!1,!1)}),["cols","rows","size","span"].forEach(j=>{k[j]=new x(j,p,!1,j,null,!1,!1)}),["rowSpan","start"].forEach(j=>{k[j]=new x(j,c,!1,j.toLowerCase(),null,!1,!1)});var b=/[\-\:]([a-z])/g,h=j=>j[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(j=>{const C=j.replace(b,h);k[C]=new x(C,l,!1,j,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(j=>{const C=j.replace(b,h);k[C]=new x(C,l,!1,j,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(j=>{const C=j.replace(b,h);k[C]=new x(C,l,!1,j,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(j=>{k[j]=new x(j,l,!1,j.toLowerCase(),null,!1,!1)});var T="xlinkHref";k[T]=new x("xlinkHref",l,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(j=>{k[j]=new x(j,l,!1,j.toLowerCase(),null,!0,!0)});var{CAMELCASE:_,SAME:E,possibleStandardNames:w}=ru(),v=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),P=Object.keys(w).reduce((j,C)=>{const I=w[C];return I===E?j[C]=C:I===_?j[C.toLowerCase()]=C:j[C]=I,j},{});e.BOOLEAN=a,e.BOOLEANISH_STRING=s,e.NUMERIC=c,e.OVERLOADED_BOOLEAN=d,e.POSITIVE_NUMERIC=p,e.RESERVED=i,e.STRING=l,e.getPropertyInfo=f,e.isCustomAttribute=v,e.possibleStandardNames=P}));function su(e,i){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];i=i||{};var l=1,s=1;function a(_){var E=_.match(Cs);E&&(l+=E.length);var w=_.lastIndexOf(Fs);s=~w?_.length-w:s+_.length}function d(){var _={line:l,column:s};return function(E){return E.position=new c(_),x(),E}}function c(_){this.start=_,this.end={line:l,column:s},this.source=i.source}c.prototype.content=e;function p(_){var E=new Error(i.source+":"+l+":"+s+": "+_);if(E.reason=_,E.filename=i.source,E.line=l,E.column=s,E.source=e,!i.silent)throw E}function f(_){var E=_.exec(e);if(E){var w=E[0];return a(w),e=e.slice(w.length),E}}function x(){f(Ps)}function k(_){var E;for(_=_||[];E=b();)E!==!1&&_.push(E);return _}function b(){var _=d();if(!(lr!=e.charAt(0)||sr!=e.charAt(1))){for(var E=2;Ko!=e.charAt(E)&&(sr!=e.charAt(E)||lr!=e.charAt(E+1));)++E;if(E+=2,Ko===e.charAt(E-1))return p("End of comment missing");var w=e.slice(2,E-2);return s+=2,a(w),e=e.slice(E),s+=2,_({type:Ms,comment:w})}}function h(){var _=d(),E=f(As);if(E){if(b(),!f(Ns))return p("property missing ':'");var w=f(Ls),v=_({type:Ds,property:Is(E[0].replace(rr,Ko)),value:w?Is(w[0].replace(rr,Ko)):Ko});return f(Os),v}}function T(){var _=[];k(_);for(var E;E=h();)E!==!1&&(_.push(E),k(_));return _}return x(),T()}function Is(e){return e?e.replace($s,Ko):Ko}var rr,Cs,Ps,As,Ns,Ls,Os,$s,Fs,lr,sr,Ko,Ms,Ds,au=to.__esmMin((()=>{rr=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Cs=/\n/g,Ps=/^\s*/,As=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ns=/^:\s*/,Ls=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Os=/^[;\s]*/,$s=/^\s+|\s+$/g,Fs=`
|
|
20
|
+
`,lr="/",sr="*",Ko="",Ms="comment",Ds="declaration"}));function nu(e,i){let l=null;if(!e||typeof e!="string")return l;const s=su(e),a=typeof i=="function";return s.forEach(d=>{if(d.type!=="declaration")return;const{property:c,value:p}=d;a?i(c,p,d):p&&(l=l??{},l[c]=p)}),l}var du=to.__esmMin((()=>{au()})),cu=to.__exportAll({default:()=>uu});function uu(e,i){const l={};return!e||typeof e!="string"||nu(e,(s,a)=>{s&&a&&(l[Xs(s,i)]=a)}),l}var Vs,Hs,Us,Ws,zs,Gs,Ys,ar,Xs,mu=to.__esmMin((()=>{du(),Vs=/^--[a-zA-Z0-9_-]+$/,Hs=/-([a-z])/g,Us=/^[^-]+$/,Ws=/^-(webkit|moz|ms|o|khtml)-/,zs=/^-(ms)-/,Gs=e=>!e||Us.test(e)||Vs.test(e),Ys=(e,i)=>i.toUpperCase(),ar=(e,i)=>`${i}-`,Xs=(e,i={})=>Gs(e)?e:(e=e.toLowerCase(),i.reactCompat?e=e.replace(zs,ar):e=e.replace(Ws,ar),e.replace(Hs,Ys))})),Ks=to.__commonJSMin((e=>{var i=e&&e.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=d,e.setStyleProp=p;var l=fo("react"),s=i((mu(),to.__toCommonJS(cu))),a=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function d(k,b){return k.includes("-")?!a.has(k):!!(b&&typeof b.is=="string")}var c={reactCompat:!0};function p(k,b){if(typeof k=="string"){if(!k.trim()){b.style={};return}try{b.style=(0,s.default)(k,c)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(l.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var f=k=>!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(k.name);e.canTextBeChildOfNode=f;var x=k=>k;e.returnFirstArg=x})),qs=to.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var i=lu(),l=Ks(),s=["checked","value"],a=["input","select","textarea"],d={reset:!0,submit:!0};function c(f={},x){const k={},b=!!(f.type&&d[f.type]);for(const h in f){const T=f[h];if((0,i.isCustomAttribute)(h)){k[h]=T;continue}const _=h.toLowerCase();let E=p(_);if(E){const w=(0,i.getPropertyInfo)(E);switch(s.includes(E)&&a.includes(x)&&!b&&(E=p("default"+_)),k[E]=T,w?.type){case i.BOOLEAN:k[E]=!0;break;case i.OVERLOADED_BOOLEAN:T===""&&(k[E]=!0)}continue}l.PRESERVE_CUSTOM_ATTRIBUTES&&(k[h]=T)}return(0,l.setStyleProp)(f.style,k),k}function p(f){return i.possibleStandardNames[f]}})),pu=to.__commonJSMin((e=>{var i=e&&e.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=p;var l=(ir(),to.__toCommonJS(er)),s=fo("react"),a=i(qs()),d=Ks(),c={cloneElement:s.cloneElement,createElement:s.createElement,isValidElement:s.isValidElement};function p(k,b={}){var h,T,_,E,w;const v=[],P=typeof b.replace=="function",j=(h=b.transform)!==null&&h!==void 0?h:d.returnFirstArg,{cloneElement:C,createElement:I,isValidElement:K}=(T=b.library)!==null&&T!==void 0?T:c,U=k.length;f(k);for(let O=0;O<U;O++){const L=k[O];if(P){let te=(_=b.replace)===null||_===void 0?void 0:_.call(b,L,O);if(K(te)){U>1&&(te=C(te,{key:(E=te.key)!==null&&E!==void 0?E:O})),v.push(j(te,L,O));continue}}if(L.type==="text"){const te=!L.data.trim().length;if(te&&L.parent&&!(0,d.canTextBeChildOfNode)(L.parent)||b.trim&&te)continue;v.push(j(L.data,L,O));continue}const R=L;let G={};x(R)?((0,d.setStyleProp)(R.attribs.style,R.attribs),G=R.attribs):R.attribs&&(G=(0,a.default)(R.attribs,R.name));let J;switch(L.type){case"script":case"style":L.children[0]&&(G.dangerouslySetInnerHTML={__html:L.children[0].data});break;case"tag":L.name==="textarea"&&L.children[0]?G.defaultValue=L.children[0].data:!((w=L.children)===null||w===void 0)&&w.length&&(J=p(L.children,b));break;default:continue}U>1&&(G.key=O),v.push(j(I(L.name,G,J),L,O))}return v.length===1?v[0]:v}function f(k){for(const b of k)(b.type==="tag"||b.type==="script"||b.type==="style")&&(Object.setPrototypeOf(b,l.Element.prototype),f(b.children))}function x(k){return d.PRESERVE_CUSTOM_ATTRIBUTES&&k.type==="tag"&&(0,d.isCustomComponent)(k.name,k.attribs)}})),hu=to.__commonJSMin((e=>{var i=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=p;var l=i(iu());e.htmlToDOM=l.default;var s=i(qs());e.attributesToProps=s.default;var a=i(pu());e.domToReact=a.default;var d=(ir(),to.__toCommonJS(er));Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return d.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return d.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return d.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return d.Text}});var c={lowerCaseAttributeNames:!1};function p(f,x){var k;if(typeof f!="string")throw new TypeError("First argument must be a string");if(!f)return[];const b=Object.assign(Object.assign({},(k=x?.htmlparser2)!==null&&k!==void 0?k:c),{trustedTypePolicy:x?.trustedTypePolicy});return(0,a.default)((0,l.default)(f,b),x)}})),mt=to.__toESM(hu(),1),bu=mt.default.default||mt.default,fu={subject:"insert_generated_subject",preheader:"insert_generated_preheader"};function Js(e,i,l){l.document&&(r.writeEmailAttributes(l.document,{[e]:i}),l.pushToDataLayer({event:"submit",action:fu[e],entity_type:l.entityType,entity_id:l.entityId,project_id:l.projectId,context:"editor"}))}function nr({limitsInPlugin:e,hostedAiActive:i}){return e&&!i}function Qs({limitsInPlugin:e,hostedAiActive:i,counter:l,limit:s}){return nr({limitsInPlugin:e,hostedAiActive:i})?s>0&&l>=s:!1}function Zs(e,i){if(!i||typeof e!="string")return i||e;const l=i.trim();if(!l)return e;if(/^\s*<!DOCTYPE/i.test(l)||/^\s*<\s*html[\s>]/i.test(l))return i;try{const s=new DOMParser().parseFromString(e,"text/html"),a=s.querySelector("editor");if(a){a.innerHTML=i;const d=e.match(/^[\s\uFEFF]*<!DOCTYPE[^>]*>/i);return`${d?`${d[0]}
|
|
21
|
+
`:""}${s.documentElement.outerHTML}`}}catch{}return i}var gu=e=>{const{__:i}=r.useI18n();return[{key:"📧",label:(0,o.jsxs)("div",{onClick:()=>{e("theme-and-preheader-generator")},children:["📧 ",i("Subject line & preheader generator")]})},{key:"🌎",label:(0,o.jsxs)("div",{onClick:()=>{e("translator")},children:["🌎 ",i("Translator")]})},{key:"📄",label:(0,o.jsxs)("div",{onClick:()=>{e("writer")},children:["📄 ",i("Copywriter")]})},{key:"🔎",label:(0,o.jsxs)("div",{onClick:()=>{e("corrector")},children:["🔎 ",i("Proofreader")]})},{key:"🧠",label:(0,o.jsxs)("div",{onClick:()=>{e("psychologist")},children:["🧠 ",i("Psychologist")]})},{key:"📈",label:(0,o.jsxs)("div",{onClick:()=>{e("marketolog")},children:["📈 ",i("Marketer")]})},{key:"✨",label:(0,o.jsxs)("div",{onClick:()=>{e("email-generator")},children:["✨ ",i("Email generator")]})}]},_u={background:r.emCssVar("colorInfo"),color:"#ffffff"},ea=({messages:e,newEmailAiGeneratorRef:i})=>{const l=r.useElementEntityKind(),{document:s}=r.useDocumentSessionContext(),a=r.useContentReader(),d=r.useContentReplacer(),{__:c,_n:p}=r.useI18n(),f=r.useDispatch(),x=r.useAppNavigate(),k=(0,n.useRef)(null),b=r.useAppConfig(),h=r.useNotification(),T=r.useEditorProjectId(),_=r.useOpenEmailId(),E=r.usePushToDataLayer(),w={document:s,pushToDataLayer:E,entityType:l==="block"?"block":"email",entityId:_,projectId:T},v=r.useEventEmitter(xo.events.ON_LIMIT_ID),[P,j]=(0,n.useState)(null),[C,I]=(0,n.useState)(0),[K,U]=(0,n.useState)(!1),[O,L]=(0,n.useState)(""),[R,G]=(0,n.useState)([]),[J,te]=(0,n.useState)(!1),[oe,he]=(0,n.useState)(!1),[be,ae]=(0,n.useState)(null),[ke,Ce]=(0,n.useState)(0),[de,Fe]=(0,n.useState)(null),je=r.useEmailAttribute("subject"),re=r.useEmailAttribute("preheader"),Be=r.useCurrentUser(),ce=r.toLanguageCode(r.useInterfaceLocale()),ee=Be.avatar_urls?.[24],me=[Be.first_name,Be.last_name].filter(Boolean).join(" ")||Be.username,ue=r.useMessageService(),[Z]=r.useLazyGetDialogQuery(),Q=r.useSendPostMessage(),[W,q]=r.useSendMessageMutation(),[se,{reset:xe}]=r.useGetAiGenerateStatusMutation(),[ge,{data:Ne=[]}]=r.useLazyGetGeneratedContentQuery(),[ye]=r.useLazyGetLimitsStatsByTypeQuery(),$e={cursor:K?"not-allowed":"default",pointerEvents:K?"none":"auto"};(0,n.useEffect)(()=>{de&&J&&(i.current=!0),J||(i.current=!1)},[de,J]);const X=!!(b.limits&&b.counters)&&!0,{limits:ne}=b.limits?b:{limits:{ai_limit:0,ai_generator_limit:0}},{ai_limit:we,ai_generator_limit:V}=ne,Te=r.useEventEmitter(xo.events.AI_TEXT_REQUEST_ID).hasListeners(),Ie=nr({limitsInPlugin:X,hostedAiActive:Te}),ve=Qs({limitsInPlugin:X,hostedAiActive:Te,counter:C,limit:we}),Ve=Qs({limitsInPlugin:X,hostedAiActive:Te,counter:ke,limit:V}),Me=(0,n.useCallback)(()=>{v.fire({name:"AiChatCount",count:C+1})},[v,C]),He=(0,n.useCallback)(()=>{v.fire({name:"AiGeneratorCount",count:ke+1})},[v,ke]),le=(0,n.useCallback)(async B=>!0,[c,ye,h]);(0,n.useEffect)(()=>{X&&(I(b?.counters?.ai_counter||0),Ce(b?.counters?.ai_generator_counter||0))},[b,X]),(0,n.useEffect)(()=>{Fe(R.length<=0?!1:R.toReversed().find(S=>S.data?.context)?.data.context==="email-generator")},[R]);const Y=(0,n.useCallback)(async()=>await ue.sendAsync(r.EVENT_TYPES.SANDBOX_IS_EMAIL_EMPTY),[ue]),D=(0,n.useCallback)(()=>{const B=k.current?.closest(".ant-tabs-content.ant-tabs-content-top");setTimeout(()=>{B?.scrollTo({top:B.scrollHeight,behavior:"smooth"})},0)},[k]),ie=(0,n.useCallback)(()=>{r.swallowPromiseRejection(Z({entity_id:_}).then(B=>{G(B.data.documents),D()}))},[_,Z,G,D]),Ee=(0,n.useCallback)(B=>{if(!B?.data?._eventResult)return!1;const{aiMessage:S,aiHtml:m}=B.data;if(G(F=>{const H=[...F];for(let Re=H.length-1;Re>=0;Re--)if(H[Re]?.data?.isLoading&&H[Re]?.data?.role==="assistant"){H[Re]={data:{role:"assistant",message:S,isLoading:!1}};break}return H}),m){const F=Zs(a(),String(m));d(F,{undoable:!0})}return D(),!0},[a,d,D]),Ae=(0,n.useCallback)(B=>{G(S=>{for(let m=S.length-1;m>=0;m--)if(S[m]?.data?.isLoading&&S[m]?.data?.role==="assistant"){const F=[...S];return B?F[m]={data:{role:"assistant",message:B}}:F.splice(m,1),F}return S})},[]),We=(0,n.useCallback)(B=>{const S=B?.message==="ERROR"?void 0:B?.message;return[B?.data?.message,S].find(m=>typeof m=="string"&&m)||c("Something went wrong.")},[c]),Ge=r.useEventEmitter(xo.events.AI_TEXT_PROGRESS_ID);(0,n.useEffect)(()=>{const B=Ge.event(({progress:S,status:m})=>{const F=m||`${Math.round(S)}%`;G(H=>{const Re=[...H];for(let pe=Re.length-1;pe>=0;pe--)if(Re[pe]?.data?.isLoading&&Re[pe]?.data?.role==="assistant"){Re[pe]={data:{...Re[pe].data,message:F}};break}return Re})});return()=>B.dispose()},[Ge]);const Ye=r.useEventEmitter(xo.events.AI_TEXT_STREAM_ID);(0,n.useEffect)(()=>{const B=Ye.event(({partialHtml:S})=>{const m=Zs(a(),String(S));d(m,{undoable:!0})});return()=>B.dispose()},[Ye,a,d,f]);const $=(0,n.useCallback)(B=>{te(!0),U(!0),r.swallowPromiseRejection(se({task_id:B||P,entity_id:_,status:"started"}).then(()=>{ie()}))},[_,se,P,ie]),N=(0,n.useCallback)(()=>{se({task_id:P,entity_id:_,status:"completed"}).then(B=>{B.data.status===403&&xe(),ie()}).catch(B=>{}),U(!1),te(!1)},[_,se,P,ie,xe]);(0,n.useEffect)(()=>{let B;if(J){const S=Ne[Ne.length-1]?.processing?.email;if(S){let m=Ne[Ne.length-1].status;d(String(S),{undoable:!0}),m===0&&N()}be&&(clearInterval(B),te(!1),ae(!1))}return()=>{clearInterval(B)}},[d,be,f,Ne,J,je,re,_,P,ie,se,q,N]),(0,n.useEffect)(D,[D]),(0,n.useEffect)(()=>{e?.length>0&&G(e),Q({operation:r.EVENT_TYPES.SANDBOX_EMAIL_CONTENT_GET})},[e,Q]),(0,n.useEffect)(()=>{const B=ue.onInit(()=>{ue.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:K}),ue.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_DISCUSS,value:K})});return()=>B.dispose()},[K,ue]);const y=async()=>{if(O){const B=O.replaceAll(/\n/g,"<br>"),S={project_id:T,connection:"chat",entity_id:_,message:B,locale:ce,subject:je||"",preheader:re||"",textContent:di.extractDocumentTextContent(a())};if(de&&Ve||ve){h.error({title:c(de?"You have reached the limit of AI generator usage.":"You have reached the limit of AI chat usage."),description:c("Please upgrade your plan.")});const m={data:{role:"assistant",message:c(de?"You have reached the limit of AI generator usage.":"You have reached the limit of AI chat usage.")}};G(F=>[...F,m])}else{if(!await le(de?"email_generate":"ai")){L("");return}Ie&&(de&&ke!==V?(He(),Ce(F=>F+1)):C!==we&&(Me(),I(F=>F+1))),E({event:"submit_form",action:"chat_whit_ai_assistant",entity_id:S.entity_id,project_id:S.project_id});const m=[{data:{role:"user",message:B,userInfo:{display_name:me,avatar_url:ee}}},{data:{role:"assistant",message:c("Typing..."),isLoading:!0}}];G(F=>[...F,...m]),W({body:S}).then(F=>{if(F?.error)throw F.error;if(!F?.data||F.data.status===401)throw new Error(r.ERROR);if(!Ee(F)){if(E({event:"submit",action:"send_discussion_chat_message",entity_type:l==="block"?"block":"email",entity_id:_,project_id:T,context:"editor"}),F.data.task_id){let H=F.data.task_id;j(H),ge({id:H,setError:ae}),r.swallowPromiseRejection(Y().then(Re=>{Re?$(H):he(!0)}))}ie()}}).catch(F=>{const H=We(F);h.error({title:F?.data?.code||c("Error"),description:H}),Ae(H)})}L("")}},M=async B=>{const S={data:{role:"assistant",message:c("Typing..."),isLoading:!0}};G(F=>[...F,S]);const m={project_id:T,connection:"chat",entity_id:_,context:B,locale:ce,subject:je||"",preheader:re||"",textContent:di.extractDocumentTextContent(a())};if(Ie&&(de&&ke!==V?(He(),Ce(F=>F+1)):C!==we&&(Me(),I(F=>F+1))),ve)h.error({title:c("You have reached the limit of AI chat usage."),description:c("Please upgrade your plan.")}),Ae(c("You have reached the limit of AI chat usage."));else{if(!await le("ai")){Ae();return}E({event:"select",action:"select_ai_assistant_role",context:m.context,entity_id:m.entity_id,project_id:m.project_id}),W({body:m}).then(F=>{if(F?.error)throw F.error;if(!F?.data||F.data.status===401)throw new Error(r.ERROR);Ee(F)||ie()}).catch(F=>{const H=We(F);h.error({title:F?.data?.code||c("Error"),description:H}),Ae(H)})}},fe=(0,n.useCallback)(async B=>{const S={data:{role:"user",message:B,userInfo:{display_name:me,avatar_url:ee}}},m={data:{role:"assistant",message:c("Typing..."),isLoading:!0}};G(H=>[...H,S,m]);const F={project_id:T,connection:"chat",entity_id:_,message:B,locale:ce,subject:je||"",preheader:re||"",textContent:di.extractDocumentTextContent(a())};if(Ve)h.error({title:c("You have reached the limit of AI generator usage."),description:c("Please upgrade your plan.")}),Ae(c("You have reached the limit of AI chat usage."));else{if(!await le(de?"email_generate":"ai")){Ae();return}W({body:F}).then(H=>{if(H?.error)throw H.error;if(!H?.data||H.data.status===401)throw new Error(r.ERROR);if(!Ee(H)){if(E({event:"submit",action:"send_discussion_chat_message",entity_type:l==="block"?"block":"email",entity_id:_,project_id:T,context:"editor"}),H.data.task_id){let Re=H.data.task_id;j(Re),ge({id:Re,setError:ae}),r.swallowPromiseRejection(Y().then(pe=>{pe?$(Re):he(!0)}))}Ie&&(de&&ke!==V?(He(),Ce(Re=>Re+1)):C!==we&&(Me(),I(Re=>Re+1))),ie()}}).catch(H=>{const Re=We(H);h.error({title:H?.data?.code||c("Error"),description:Re}),Ae(Re)})}},[c,C,ke,ee,Y,Ae,$,We,me,we,V,Be,je,re,_,de,Ve,ce,Me,He,Ie,a,h,le,T,W,ge,ie]);(0,n.useEffect)(()=>{const B=new xo.Disposable,S=window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_ai_settings);if((!e?.length||e.length===1&&e[0]?.data?.role==="assistant")&&S&&_){const m={project_id:T,connection:"chat",entity_id:_,context:"email-generator",locale:ce};r.runOnceInFlight(`discuss-ai-generator-context:${_}`,()=>{if(Te){window.localStorage.removeItem(r.LOCAL_STORAGE_ITEMS.em_ai_settings),fe(S);return}r.swallowPromiseRejection(W({body:m}).then(()=>{window.localStorage.removeItem(r.LOCAL_STORAGE_ITEMS.em_ai_settings),B.isDisposed()||fe(S)}))})}return()=>B.dispose()},[e,fe,_,ce,T,W,Te]);const Le=B=>{typeof B.target.className=="string"&&B.target.className.includes("ai-response-change-context")&&(q.isLoading||M(B.target.role))},eo=B=>{const S=B.children[0].data??"";Js("subject",S,w),h.success({id:"EMAIL_TITLE_UPDATED_FROM_AI",title:c("Title copied to email settings"),data:S})},Xe=B=>{const S=B.children[0].data??"";Js("preheader",S,w),h.success({id:"EMAIL_TITLE_UPDATED_FROM_AI",title:c("Preheader copied to email settings"),data:S,duration:300})},lo=B=>{const S=B.children[0].data;navigator.clipboard.writeText(S).then(()=>{h.success({id:"TEXT_COPIED_TO_CLIPBOARD",title:c("Text copied to clipboard"),data:S})}).catch(m=>{})},Qe={replace:B=>{if(B.attribs?.class?.split(" ").includes("ai-response-title"))return(0,o.jsx)(t.ui_kit$Tooltip,{placement:"left",title:c("Replace the title"),children:(0,o.jsx)("div",{onClick:()=>eo(B),children:(0,o.jsx)("span",{className:"ai-response-title",children:(0,mt.domToReact)(B.children,Qe)})})});if(B.attribs?.class?.split(" ").includes("ai-response-preheader"))return(0,o.jsx)(t.ui_kit$Tooltip,{placement:"left",title:c("Replace the preheader"),children:(0,o.jsx)("div",{onClick:()=>Xe(B),children:(0,o.jsx)("span",{className:"ai-response-preheader",children:(0,mt.domToReact)(B.children,Qe)})})});if(B.attribs?.class?.split(" ").includes("ai-response-copy"))return(0,o.jsx)(t.ui_kit$Tooltip,{placement:"left",title:c("Copy to clipboard"),children:(0,o.jsx)("div",{onClick:()=>lo(B),children:(0,o.jsx)("span",{className:"ai-response-copy",children:(0,mt.domToReact)(B.children,Qe)})})});if(B.attribs?.class?.split(" ").includes("ai-response-user-message")){const S=B.attribs?.data||B.children?.[0]?.data;return(0,o.jsx)("li",{className:B.attribs?.class,data:B.attribs?.data,onClick:()=>fe(S),children:(0,mt.domToReact)(B.children,Qe)})}}},uo=()=>{$(),he(!1)},Eo=()=>{N(),he(!1)};return(0,o.jsxs)("div",{ref:k,className:"discuss-main",children:[R.length>0&&(0,o.jsx)(t.ui_kit$List,{onClick:Le,className:"comment-list",itemLayout:"horizontal",dataSource:R,renderItem:B=>(0,o.jsx)("li",{id:B._id,children:(0,o.jsx)(t.ui_kit$Comment,{className:B.data.userInfo?"":"ai-comment",avatar:B.data.role==="assistant"?(0,o.jsx)(r.EmIcons,{icon:"ChatGpt",component:t.icons$ChatGpt,className:"anticon-robot",style:{color:"#ffffff",fontSize:16,width:24,height:24,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"}}):B.data.userInfo&&B.data._modified?B.data.userInfo.avatar_url:ee||(0,o.jsx)(r.EmIcons,{icon:"UserOutlined",component:t.icons$UserOutlined,className:"anticon-user",style:{color:"#ffffff",fontSize:16,width:24,height:24,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center"}}),author:(0,o.jsx)("div",{style:$e,children:B?.data?.role==="user"?Be?.username||c("User"):c("AI Assistant")}),datetime:B._created?(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:wo.formatDate(r.parseISO(B._created),p,!0)}}):null,content:B.data.isLoading?(0,o.jsx)("div",{className:"spin",children:(0,o.jsx)(r.EmIcons,{icon:"LoadingOutlined",component:t.icons$LoadingOutlined,style:{fontSize:24},spin:!0})}):(0,o.jsx)("div",{style:$e,children:bu(B.data.message,Qe)})})},B._id)}),X&&(de?(0,o.jsx)(t.ui_kit$LimitsCounter,{text:`${ke} ${c("of")} ${V>0?V:"∞"} ${c("mail generator")} ${p("was used","were used",ke)}`,exceeded:V>0&&ke>=V,style:{marginTop:-25},extra:(0,o.jsx)("span",{style:{textDecoration:"underline",cursor:"pointer"},onClick:()=>x(b.billingPageUrl||r.APP_ROUTES.billing),children:c("Need more?")})}):(0,o.jsx)(t.ui_kit$LimitsCounter,{text:`${C} ${c("of")} ${we>0?we:"∞"} ${c("messeges")} ${p("was used","were used",C)}`,exceeded:we>0&&C>=we,style:{marginTop:-25},extra:(0,o.jsx)("span",{style:{textDecoration:"underline",cursor:"pointer"},onClick:()=>x(b.billingPageUrl||r.APP_ROUTES.billing),children:c("Need more?")})})),(0,o.jsxs)(t.ui_kit$Form,{onFinish:y,className:"addMode",children:[(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:10},children:(0,o.jsx)(t.ui_kit$TextArea,{disabled:K,value:O,onChange:B=>L(B.target.value),rows:4,placeholder:c("Type your request"),className:"textarea-comment",onPressEnter:B=>B.key==="Enter"&&B.ctrlKey&&y(),spellCheck:"false"})}),(0,o.jsx)(t.ui_kit$Form.Item,{children:(0,o.jsxs)(t.ui_kit$Space,{size:8,children:[(0,o.jsx)(t.ui_kit$Button,{disabled:q.isLoading||K,type:"default",style:_u,className:"button-target",children:(0,o.jsx)(t.ui_kit$Dropdown,{placement:"top",disabled:K,arrow:{pointAtCenter:!0},menu:{items:gu(M)},children:(0,o.jsxs)("div",{disabled:K,style:{margin:0,padding:0,color:"#ffffff",display:"inline-flex",alignItems:"center"},children:[(0,o.jsx)(r.EmIcons,{icon:"ChatGpt",component:t.icons$ChatGpt,style:{marginRight:5}}),c("Role")]})},"Export")}),(0,o.jsxs)(t.ui_kit$Button,{disabled:q.isLoading||K,className:"button-add",type:"primary",htmlType:"submit",children:[c("Send")," ",(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined,size:16,strokeWidth:b.iconStrokeWidth})]})]})})]}),(0,o.jsx)(t.ui_kit$Modal,{title:c("Warning"),open:oe,onOk:uo,onCancel:Eo,children:(0,o.jsx)("p",{children:c("The current template will be changed to the generated one, are you sure about this?")})})]})},xu=[r.VALID,r.ERRORS,r.WARNINGS],oa=({summary:e,__:i,selectedTags:l,setSelectedTags:s})=>{const a=(0,n.useCallback)((c,p)=>{s(p?l.length===2?[]:[...l,c]:l.filter(f=>f!==c))},[l,s]),d=(0,n.useCallback)(c=>i(c==="valid"?"Valid":c==="warnings"?"Warnings":"Errors"),[i]);return(0,o.jsx)(t.ui_kit$Title,{level:5,className:"optimise__valid-title",children:(0,o.jsx)(t.ui_kit$Space,{className:"optimise__valid-title-space",size:8,children:xu.map((c,p)=>(0,o.jsxs)(t.ui_kit$CheckableTag,{checked:l?.includes(c),onChange:f=>a(c,f),className:(0,De.default)(`${c} optimise__button`,{[`${c}_active`]:l.includes(c)}),children:[d(c),": ",e?.[c]||0]},c+p))})})},{LINKS:ku}=r.OPTIMISE_TABS,ta=(0,n.memo)(({__:e,activeTab:i,validateLinksResult:l,validateLinks:s,selectedTags:a,setSelectedTags:d,isLoading:c,disabled:p,iconStrokeWidth:f,onValidate:x,goToLinkHandler:k})=>i!==ku||!l?.links?null:l.links.length===0?(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-24",children:(0,o.jsx)(t.ui_kit$Alert,{title:e("No links found."),type:"info"})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-14",children:(0,o.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,o.jsx)(oa,{__:e,summary:l.summary,setSelectedTags:d,selectedTags:a}),(0,o.jsx)(t.ui_kit$Button,{disabled:p,loading:c,onClick:x,icon:(0,o.jsx)(r.EmIcons,{icon:"SyncOutlined",component:t.icons$SyncOutlined,size:16,strokeWidth:f}),children:e("Refresh")})]})}),(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-24",children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$List,{itemLayout:"horizontal",dataSource:s,renderItem:(b,h)=>(0,o.jsx)(t.ui_kit$List.Item,{className:t.ui_kit$LIST_ITEM_BORDERLESS_CLASS,children:(0,o.jsx)(t.ui_kit$List.Item.Meta,{avatar:b.status==="valid"?(0,o.jsx)(r.EmIcons,{icon:"CheckCircleFilled",component:t.icons$CheckCircleFilled,className:r.VALID}):b.status==="warnings"?(0,o.jsx)(r.EmIcons,{icon:"CheckCircleFilled",component:t.icons$CheckCircleFilled,className:r.WARNINGS}):(0,o.jsx)(r.EmIcons,{icon:"CloseCircleFilled",component:t.icons$CloseCircleFilled,className:r.ERRORS}),title:(0,o.jsx)(t.ui_kit$Link,{className:"optimise__link optimise__link-blue",draggable:!1,onClick:()=>k(b.linkId,600>(b.statusCode||0)&&(b.statusCode||0)>399||!b.statusCode),children:b.url===""?e("empty link"):b.url}),description:(0,o.jsxs)(o.Fragment,{children:[!!b.text?.length&&(0,o.jsx)(t.ui_kit$Text,{type:"secondary",children:b.text}),b.page?.title&&b.page.title,b.page?.secure&&b.status==="valid"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsx)("span",{className:"valid",children:e("secure")})]}),!b.resolvedUrl&&!b.statusCode&&b.type==="url"&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsx)(t.ui_kit$Text,{type:"secondary",children:e("Failed to load")})]})]})})},h+"_"+b.linkId)})})})]}));ta.displayName="LinksSection";var{IMAGES:Eu}=r.OPTIMISE_TABS,ia=(0,n.memo)(({__:e,activeTab:i,validateImagesResult:l,validateImages:s,selectedTags:a,setSelectedTags:d,isLoading:c,disabled:p,iconStrokeWidth:f,onValidate:x,goToImageHandler:k,showImgPreviewHandler:b,hideBlockPreviewHandler:h})=>i!==Eu||!l?.images?null:l.images.length===0?(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-24",children:(0,o.jsx)(t.ui_kit$Alert,{title:e("No images found."),type:"info"})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-16",children:(0,o.jsx)(t.ui_kit$Alert,{className:"optimise__alert-custom",title:(0,o.jsxs)("div",{className:"optimise__summary",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)(t.ui_kit$Title,{level:4,className:"optimise__summary-title",children:[l.images.length," "]}),(0,o.jsx)("span",{className:"optimise__summary-label",children:e("images")})]}),(0,o.jsxs)("div",{children:[(0,o.jsxs)(t.ui_kit$Title,{level:4,className:"optimise__summary-title",children:[l.summaryTime?.value,l.summaryTime?.name]}),(0,o.jsx)("span",{className:"optimise__summary-label",children:e("total size")})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)(t.ui_kit$Title,{level:4,className:"optimise__summary-title",children:(Math.max(...l.images.map(T=>T.image.responseTime))/1e3).toFixed(2)+e("s")}),(0,o.jsx)("span",{className:"optimise__summary-label",children:e("time to load")})]})]}),type:"warning"})}),(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-12",children:(0,o.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,o.jsx)(oa,{__:e,summary:l.summary,setSelectedTags:d,selectedTags:a}),(0,o.jsx)(t.ui_kit$Button,{icon:(0,o.jsx)(r.EmIcons,{icon:"SyncOutlined",component:t.icons$SyncOutlined,size:16,strokeWidth:f}),disabled:p,loading:c,onClick:x,children:e("Refresh")})]})}),(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-12",children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$List,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:s,renderItem:(T,_)=>(0,o.jsx)(t.ui_kit$List.Item,{className:`optimise__image-item image-item ${t.ui_kit$LIST_ITEM_BORDERLESS_CLASS}`,children:(0,o.jsx)(t.ui_kit$List.Item.Meta,{className:(0,De.default)("image-item__meta",{"image-item__meta_fail":!T.resolvedUrl&&!T.statusCode}),avatar:(0,o.jsx)(t.ui_kit$Image,{className:(0,De.default)("image-item__image optimise__image-auto-height",{"image-item__image_fail":!T.resolvedUrl||!T.valid}),width:92,height:"auto",src:T.resolvedUrl||"",preview:!1,onMouseEnter:()=>b(T.url,T.image.dimensions?.width),onMouseLeave:()=>h()}),title:T.url?(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:T.message,children:(0,o.jsx)(t.ui_kit$Link,{className:"optimise__link optimise__link-blue",draggable:!1,onClick:()=>k(T.imageId,600>(T.statusCode||0)&&(T.statusCode||0)>399||!T.statusCode),children:T?.url===""?e("empty src"):T.url})}):T.message,description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"image-size",children:[T.image.dimensions&&(0,o.jsxs)(o.Fragment,{children:[T.image.dimensions.width+" × "+T.image.dimensions.height,(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsxs)("span",{children:[Math.round(T.image.bytes/1024),e("kB")]}),(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsxs)("span",{children:[T.image.responseTime,e("ms")]}),(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsx)("span",{className:"image-size-format",children:Ft(T.image.contentType)})]}),T.image.secure&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"image-size-splitter",children:" • "}),(0,o.jsx)("span",{className:"valid",children:e("secure")})]}),T.resolvedUrl&&!T.valid&&(0,o.jsx)(t.ui_kit$Text,{type:"danger",children:e("not valid")})]}),!T.resolvedUrl&&!T.statusCode&&(0,o.jsx)(t.ui_kit$Text,{type:"danger",children:e("Failed to load")})]})})},_)})})})]}));ia.displayName="ImagesSection";var{SPAM_ASSASSIN:Bu}=r.OPTIMISE_TABS,ra=(0,n.memo)(({__:e,activeTab:i,validateSpamResult:l,isLoading:s,disabled:a,iconStrokeWidth:d,onValidate:c})=>{const p=l?.report?.length||Object.prototype.hasOwnProperty.call(l,"spamScore");if(i!==Bu||!p)return null;const f=l.spamScore||0,x=l.baseSpamScore||0,k=f<2||!l.spamScore||f<=x-1?"success":f<x-1?"warning":"danger";return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Row,{className:"optimise__row-mb-8",children:[(0,o.jsxs)("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam",children:[(0,o.jsxs)(t.ui_kit$Title,{level:1,className:"optimise__spam-score-title",type:k,children:[(0,o.jsx)("span",{className:"optimise__spam-score-value",children:f}),(0,o.jsx)(t.ui_kit$Text,{className:"optimise__spam-score-text",children:"Score"})]}),(0,o.jsx)(t.ui_kit$Button,{disabled:a,icon:(0,o.jsx)(r.EmIcons,{icon:"SyncOutlined",component:t.icons$SyncOutlined,size:16,strokeWidth:d}),loading:s,onClick:c,children:e("Refresh")})]}),f>x-1&&(0,o.jsx)(t.ui_kit$Text,{children:e("Lower scores are better. Aim for a score less than ")+(x-1)+"."})]}),(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-8",children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(l.report?.length||0)>0?(0,o.jsx)(t.ui_kit$List,{itemLayout:"horizontal",dataSource:l.report,renderItem:b=>(0,o.jsx)(t.ui_kit$List.Item,{className:t.ui_kit$LIST_ITEM_BORDERLESS_CLASS,children:(0,o.jsx)(t.ui_kit$List.Item.Meta,{title:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Text,{className:"optimise__spam-report-score",children:b.score}),(0,o.jsx)("span",{className:"optimise__spam-report-description",children:b.description})]})})})}):(0,o.jsx)(o.Fragment,{children:l.spamScore===0&&e("Your email doesn't look like spam.")})})})]})});ra.displayName="SpamSection";var{PROBLEMS:Su}=r.OPTIMISE_TABS,la=(0,n.memo)(({__:e,activeTab:i,problemsList:l,onSetMonacoPosition:s})=>i!==Su?null:l?.length?(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-8",children:(0,o.jsx)(t.ui_kit$Col,{span:24,children:(0,o.jsx)(t.ui_kit$List,{itemLayout:"horizontal",dataSource:l,renderItem:a=>(0,o.jsx)(t.ui_kit$List.Item,{className:t.ui_kit$LIST_ITEM_BORDERLESS_CLASS,children:(0,o.jsx)(t.ui_kit$List.Item.Meta,{avatar:a.severity<6?(0,o.jsx)(r.EmIcons,{icon:"CloseCircleFilled",component:t.icons$CloseCircleFilled,className:r.WARNINGS}):(0,o.jsx)(r.EmIcons,{icon:"CloseCircleFilled",component:t.icons$CloseCircleFilled,className:r.ERRORS}),title:(0,o.jsxs)(t.ui_kit$Text,{onClick:()=>s(a),className:(0,De.default)("optimise__text-clickable",{warning:a.severity<6,error:a.severity>=6}),children:["Line: ",a.startLineNumber," ",a.startLineNumber!==a.endLineNumber&&" – "+a.endLineNumber]}),description:(0,o.jsx)(t.ui_kit$Text,{children:a.message})})})})})}):(0,o.jsx)(t.ui_kit$Row,{className:"optimise__row-mb-24",children:(0,o.jsx)(t.ui_kit$Alert,{title:e("No problems found."),type:"info"})}));la.displayName="ProblemsSection";var Tu={activeTab:"",selectedTags:[],validateLinks:[],validateImages:[],validateSpamResult:{},optimisationCounter:0,linkCheckCounter:0,imageCheckCounter:0,spamCheckCounter:0,validateLinksResult:{},validateImagesResult:{}},Ru=(e,i)=>{switch(i.type){case"SET_ACTIVE_TAB":return{...e,activeTab:i.payload!==e.activeTab?i.payload:""};case"SET_SELECTED_TAGS":return{...e,selectedTags:i.payload};case"SET_VALIDATE_LINKS":return{...e,validateLinks:i.payload};case"SET_VALIDATE_IMAGES":return{...e,validateImages:i.payload};case"SET_VALIDATE_SPAM_RESULT":return{...e,validateSpamResult:i.payload};case"SET_OPTIMISATION_COUNTER":return{...e,optimisationCounter:i.payload};case"INCREMENT_OPTIMISATION_COUNTER":return{...e,optimisationCounter:e.optimisationCounter+1};case"SET_LINK_CHECK_COUNTER":return{...e,linkCheckCounter:i.payload};case"INCREMENT_LINK_CHECK_COUNTER":return{...e,linkCheckCounter:e.linkCheckCounter+1};case"SET_IMAGE_CHECK_COUNTER":return{...e,imageCheckCounter:i.payload};case"INCREMENT_IMAGE_CHECK_COUNTER":return{...e,imageCheckCounter:e.imageCheckCounter+1};case"SET_SPAM_CHECK_COUNTER":return{...e,spamCheckCounter:i.payload};case"INCREMENT_SPAM_CHECK_COUNTER":return{...e,spamCheckCounter:e.spamCheckCounter+1};case"SET_VALIDATE_LINKS_RESULT":return{...e,validateLinksResult:i.payload};case"SET_VALIDATE_IMAGES_RESULT":return{...e,validateImagesResult:i.payload};case"RESET_SELECTED_TAGS":return{...e,selectedTags:[]};default:return e}},si={link_check:"link_check_counter",image_check:"image_check_counter",spam_check:"spam_check_counter"},dr={link_check:"link_check_limit",image_check:"image_check_limit",spam_check:"spam_check_limit"},yu=(e,i)=>{const l=Object.values(si),s=Object.values(dr);return l.some(a=>e?.[a]!==void 0)||s.some(a=>i?.[a]!==void 0)||l.some(a=>i?.[a]!==void 0)||s.some(a=>e?.[a]!==void 0)},pt=(e,i,l=0)=>{const s=e?.[i];return typeof s=="number"&&!Number.isNaN(s)?s:l},wu=(e,i)=>({counter:e,limit:i,disabled:i>0&&e>=i}),ju=({appConfig:e,data:i,isSuccess:l,optimisationCounter:s,linkCheckCounter:a,imageCheckCounter:d,spamCheckCounter:c,setOptimisationCounter:p,setLinkCheckCounter:f,setImageCheckCounter:x,setSpamCheckCounter:k})=>{const b=(0,n.useMemo)(()=>!!(e.limits&&e.counters)&&!0,[e]),h=(0,n.useMemo)(()=>e.counters,[e,i]),T=(0,n.useMemo)(()=>e.limits,[e,i]),_=(0,n.useMemo)(()=>b&&yu(h,T),[b,h,T]),E=(0,n.useMemo)(()=>pt(T,"optimization_limit",0),[T]),w=(0,n.useMemo)(()=>!_&&s>=E&&E>0,[_,s,E]),v=(0,n.useMemo)(()=>{const j={link_check:a,image_check:d,spam_check:c};return Object.keys(dr).reduce((C,I)=>{const K=dr[I],U=_?pt(T,K,0):E,O=_?j[I]:s;return C[I]=wu(O,U),C},{})},[_,T,E,a,d,c,s]),P=j=>_?v[j].disabled:w;return(0,n.useEffect)(()=>{if(!b){const j=i?.counters;l&&j?.optimization_counter&&p(j.optimization_counter);return}p(pt(h,"optimization_counter",0)),_&&(f(pt(h,si.link_check,0)),x(pt(h,si.image_check,0)),k(pt(h,si.spam_check,0)))},[b,_,i,l,h,p,f,x,k]),{limitsInPlugin:b,perTypeAvailable:_,currentBillingOptimisationLimits:E,disableFields:w,typeLimits:v,isTypeDisabled:P}},vu=()=>{const e=(0,n.useRef)(null);return{showImgPreviewHandler:(0,n.useCallback)((i,l)=>{e.current&&clearTimeout(e.current);let s=document.querySelector(".img-preview"),a=document.querySelector(".img-preview-content");document.querySelector(".img-preview")||(s=document.createElement("div"),s.classList.add("img-preview"),a=document.createElement("div"),a.classList.add("img-preview-content"),s.append(a),document.querySelector(".email-pane__col_settings-inner")?.append(s)),a&&(a.innerHTML=`<table cellspacing="0" cellpadding="0" border="0" width="100%"><img height="auto" width=${(l||0)+"px"} alt="" style="max-width: 100%; object-fit: contain" src=${i}></table>`),s&&s.style.opacity!=="1"&&setTimeout(()=>{s&&(s.style.opacity="1",s.style.transform="translateX(-100%)")},10)},[]),hideBlockPreviewHandler:(0,n.useCallback)(()=>{const i=document.querySelector(".img-preview");i&&(e.current=setTimeout(()=>{i&&(i.style.opacity="0",i.style.transform="translateX(-99%)",setTimeout(()=>{i?.remove()},300))},300))},[])}},{LINKS:Iu,IMAGES:Cu}=r.OPTIMISE_TABS,Pu=({activeTab:e,selectedTags:i,validateLinksResult:l,validateImagesResult:s,setValidateLinks:a,setValidateImages:d})=>{(0,n.useEffect)(()=>{e===Iu&&l.links&&a(i.length>0?l.links.filter(c=>i.includes(c.status)):l.links),e===Cu&&s.images&&d(i.length>0?s.images.filter(c=>i.includes(c.status)):s.images)},[l.links,s.images,i,e,a,d])},Au=e=>(e.statusCode!==null?e.statusCode<300&&(e.page?.secure??!0):e.type!=="invalid")?r.VALID:(e.statusCode&&e.statusCode<400||e.statusCode===200&&(e.page?.secure??!0))&&e.type!=="invalid"?r.WARNINGS:r.ERRORS,sa=e=>e.statusCode!==null&&e.statusCode<300?r.VALID:e.statusCode<400&&e.statusCode>=300||e.statusCode===200&&!e.valid?r.WARNINGS:r.ERRORS,aa=e=>({valid:e.filter(i=>i.status===r.VALID).length,warnings:e.filter(i=>i.status===r.WARNINGS).length,errors:e.filter(i=>i.status===r.ERRORS).length}),Nu={ai:(0,o.jsx)(r.EmIcons,{icon:"AIRequests",component:t.icons$AIRequests}),email_generate:(0,o.jsx)(r.EmIcons,{icon:"EmailEnvelope",component:t.icons$EmailEnvelope}),image_generate:(0,o.jsx)(r.EmIcons,{icon:"Image",component:t.icons$Image}),optimization:(0,o.jsx)(r.EmIcons,{icon:"Optimization",component:t.icons$Optimization}),preview:(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined}),test_sends:(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined}),link_check:(0,o.jsx)(r.EmIcons,{icon:"Web",component:t.icons$Web}),image_check:(0,o.jsx)(r.EmIcons,{icon:"Image",component:t.icons$Image}),spam_check:(0,o.jsx)(r.EmIcons,{icon:"Block",component:t.icons$Block}),projects:(0,o.jsx)(r.EmIcons,{icon:"FolderOpen",component:t.icons$FolderOpen}),emails:(0,o.jsx)(r.EmIcons,{icon:"EmailEnvelope",component:t.icons$EmailEnvelope}),blocks:(0,o.jsx)(r.EmIcons,{icon:"Block",component:t.icons$Block}),users:(0,o.jsx)(r.EmIcons,{icon:"SliderGroup",component:t.icons$SliderGroup})};function na(e,i){if(e==null)return null;if(typeof e=="number"||typeof e=="string"){const l=e==="∞"||typeof e=="string"&&e.toLowerCase()==="infinity";return(0,o.jsx)("span",{className:i==="old"?"limit-upgrade-modal__limit-old":`limit-upgrade-modal__limit-new${l?" limit-upgrade-modal__limit-new--infinity":""}`,children:l?"∞":e})}return e}var ai=({open:e,onClose:i,title:l,subtitle:s,usageResource:a,icon:d,previousDisplay:c,nextDisplay:p,onChangePlan:f,secondaryAction:x,changePlanLabel:k})=>{const{__:b}=r.useI18n(),h=k??b("Change plan"),T=!!x,_=a!=null?Nu[a]:d??null;return(0,o.jsx)(t.ui_kit$Modal,{open:e,onCancel:i,footer:null,closable:!1,width:400,centered:!0,className:"limit-upgrade-modal",destroyOnHidden:!0,mask:{closable:!0},children:(0,o.jsxs)("div",{className:"limit-upgrade-modal__wrap",children:[(0,o.jsx)("div",{className:"limit-upgrade-modal__header",children:(0,o.jsx)("button",{type:"button",className:"limit-upgrade-modal__close",onClick:i,"aria-label":b("Close"),children:(0,o.jsx)(r.EmIcons,{icon:"CloseOutlined",component:t.icons$CloseOutlined})})}),(0,o.jsxs)("div",{className:"limit-upgrade-modal__body",children:[(0,o.jsx)("h1",{className:"limit-upgrade-modal__title",children:l}),(0,o.jsx)("p",{className:"limit-upgrade-modal__subtitle",children:s}),(0,o.jsxs)("div",{className:"limit-upgrade-modal__limits-row",children:[(0,o.jsx)("div",{className:"limit-upgrade-modal__icon-circle","aria-hidden":!0,children:_}),na(c,"old"),(0,o.jsx)("div",{className:"limit-upgrade-modal__arrow-btn","aria-hidden":!0,children:(0,o.jsx)(r.EmIcons,{icon:"ArrowUpOutlined",component:t.icons$ArrowUpOutlined,className:"limit-upgrade-modal__arrow-icon"})}),na(p,"new")]})]}),(0,o.jsx)("hr",{className:"limit-upgrade-modal__divider"}),(0,o.jsx)("div",{className:T?"limit-upgrade-modal__footer limit-upgrade-modal__footer--dual":"limit-upgrade-modal__footer",children:x?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Button,{className:"limit-upgrade-modal__cta-secondary",onClick:x.onClick,children:x.label}),(0,o.jsx)(t.ui_kit$Button,{type:"primary",className:"limit-upgrade-modal__cta",onClick:f,children:h})]}):(0,o.jsx)(t.ui_kit$Button,{type:"primary",className:"limit-upgrade-modal__cta",onClick:f,children:h})})]})})},{LINKS:cr,IMAGES:ur,SPAM_ASSASSIN:da,PROBLEMS:mr}=r.OPTIMISE_TABS,ca={textDecoration:"underline",cursor:"pointer",background:"none",border:"none",padding:0,font:"inherit",color:"inherit"},Lu={link_check:"LinkCheckCount",image_check:"ImageCheckCount",spam_check:"SpamCheckCount"},Ou={link_check:"link_check_exceeded",image_check:"image_check_exceeded",spam_check:"spam_check_exceeded"},ua=(e,i,l,s)=>`${e} ${l("of")} ${i>0?i:"∞"} ${s("test","tests",i>0?i:e)} ${s("was used","were used",e)}`,ma=()=>{const{__:e,_n:i}=r.useI18n(),l=r.useDispatch(),s=r.useOpenPlanCatalog(),a=r.useAppNavigate(),d=r.useNotification(),c=r.useContentReader(),p=r.useAppConfig(),f=r.useEditorProjectId(),x=r.useRouteEmailId(),{email:k}=r.useOpenEmail(),b=x||(k?.id!=null?String(k.id):void 0),h=b||k?.renderGuid,T=f||(k?.project!=null?String(k.project):void 0),[_,E]=(0,n.useState)(null),w=(0,n.useRef)(!1),v=(0,n.useRef)({link_check:!1,image_check:!1,spam_check:!1}),P=r.useProjectPlanLimitPreflight(),j=(0,n.useCallback)(Y=>{E(Y)},[]),C=(0,n.useCallback)((Y,D)=>Y?.status===401&&Y?.data?.code==="usage_limit_exceeded"?(j({presetId:{link_check:"link_check_exceeded",image_check:"image_check_exceeded",spam_check:"spam_check_exceeded"}[D],previousDisplay:e("—"),nextDisplay:r.presetLimitDisplay("infinity")}),l(r.limitsApi.util.invalidateTags(["LimitsStats","LimitsWarnings"])),!0):!1,[l,e,j]),I=(0,n.useCallback)((Y,D)=>{C(Y,D)||d.error({error:Y})},[C,d]),K=(0,n.useCallback)(async Y=>!0,[l,P,j]),U=r.useMessageService(),O=r.useSelector(r.selectProblemsList),L=r.useEventEmitter(xo.events.ON_LIMIT_ID),R=r.usePushToDataLayer(),[G,J]=(0,n.useReducer)(Ru,Tu),[te,oe]=r.useEditSpamMutation(),[he,be]=r.useEditLinksMutation(),[ae,ke]=r.useEditImagesMutation(),{data:Ce,isSuccess:de}=r.useGetProjectQuery(+(T||0),{skip:!0}),Fe=r.useInvalidateProject(),je=(0,n.useCallback)(Y=>J({type:"SET_OPTIMISATION_COUNTER",payload:Y}),[]),re=(0,n.useCallback)(Y=>J({type:"SET_LINK_CHECK_COUNTER",payload:Y}),[]),Be=(0,n.useCallback)(Y=>J({type:"SET_IMAGE_CHECK_COUNTER",payload:Y}),[]),ce=(0,n.useCallback)(Y=>J({type:"SET_SPAM_CHECK_COUNTER",payload:Y}),[]),ee=(0,n.useCallback)(Y=>J({type:"SET_VALIDATE_LINKS",payload:Y}),[]),me=(0,n.useCallback)(Y=>J({type:"SET_VALIDATE_IMAGES",payload:Y}),[]),ue=(0,n.useCallback)(Y=>J({type:"SET_SELECTED_TAGS",payload:Y}),[]),{limitsInPlugin:Z,perTypeAvailable:Q,currentBillingOptimisationLimits:W,disableFields:q,typeLimits:se,isTypeDisabled:xe}=ju({appConfig:p,data:Ce,isSuccess:de,optimisationCounter:G.optimisationCounter,linkCheckCounter:G.linkCheckCounter,imageCheckCounter:G.imageCheckCounter,spamCheckCounter:G.spamCheckCounter,setOptimisationCounter:je,setLinkCheckCounter:re,setImageCheckCounter:Be,setSpamCheckCounter:ce});Pu({activeTab:G.activeTab,selectedTags:G.selectedTags,validateLinksResult:G.validateLinksResult,validateImagesResult:G.validateImagesResult,setValidateLinks:ee,setValidateImages:me});const{showImgPreviewHandler:ge,hideBlockPreviewHandler:Ne}=vu(),ye=(0,n.useCallback)(Y=>Y==="link_check"?G.linkCheckCounter:Y==="image_check"?G.imageCheckCounter:G.spamCheckCounter,[G.linkCheckCounter,G.imageCheckCounter,G.spamCheckCounter]),$e=(0,n.useCallback)(Y=>{if(Z){if(Q){J({type:{link_check:"INCREMENT_LINK_CHECK_COUNTER",image_check:"INCREMENT_IMAGE_CHECK_COUNTER",spam_check:"INCREMENT_SPAM_CHECK_COUNTER"}[Y]}),L.fire({name:Lu[Y],count:ye(Y)+1});return}J({type:"INCREMENT_OPTIMISATION_COUNTER"}),L.fire({name:"OptimizationCount",count:G.optimisationCounter+1})}},[Z,Q,L,ye,G.optimisationCounter]),X=(0,n.useCallback)(Y=>{if(Q){const{limit:D}=se[Y];j({presetId:Ou[Y],previousDisplay:D>0?D:r.presetLimitDisplay("infinity"),nextDisplay:r.presetLimitDisplay("infinity")});return}j({presetId:"optimization_exceeded",previousDisplay:W,nextDisplay:r.presetLimitDisplay("infinity")})},[Q,se,j,W]),ne=(0,n.useCallback)(()=>{a(p.billingPageUrl||r.APP_ROUTES.billing)},[p.billingPageUrl,a]),we=Y=>{if(!Z||!Q)return null;const{counter:D,limit:ie,disabled:Ee}=se[Y];return(0,o.jsx)(t.ui_kit$LimitsCounter,{text:ua(D,ie,e,i),exceeded:Ee,extra:(0,o.jsx)("button",{type:"button",style:ca,onClick:ne,children:e("Need more?")})})},V=(0,n.useCallback)((Y,D)=>{U.send({operation:r.EVENT_TYPES.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:Y,isError:D}})},[U]),Te=(0,n.useCallback)((Y,D)=>{U.send({operation:r.EVENT_TYPES.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:Y,isError:D}})},[U]),Ie=(0,n.useCallback)(Y=>{const D={startColumn:Y.startColumn,startLineNumber:Y.startLineNumber,endColumn:Y.endColumn,endLineNumber:Y.endLineNumber};l(r.setActiveProblemRange(D))},[l]),ve=(0,n.useCallback)(Y=>{J({type:"SET_ACTIVE_TAB",payload:Y}),J({type:"RESET_SELECTED_TAGS"}),Y===mr&&O?.length>0&&R({event:"check",action:"check_email_code",email_id:b,project_id:T,problems_count:O?.length||0})},[O,R,b,T]),Ve=(0,n.useCallback)(async()=>{if(!h){d.error({title:"Save the mail first."});return}if(xe("link_check")){X("link_check");return}if(!await K("link_check"))return;$e("link_check");const Y=c(),D=new DOMParser().parseFromString(Y,"text/html"),ie={},Ee={};D.querySelectorAll("a[href]").forEach((Ae,We)=>{ie[`link_${We}`]=Ae.getAttribute("href"),Ee[`link_${We}`]=Ae.textContent||""}),U.send({operation:"sandbox_set_attr_to_links"}),he({entity_id:h,data:ie}).then(({data:Ae,error:We})=>{if(We)I(We,"link_check");else if(Ae?.result){const Ge=[...Ae.result];Ge?.sort((N,y)=>N.linkId-y.linkId);const Ye=Ge.map(N=>({...N,text:Ee[N.linkId],status:Au(N)})),$={links:Ye,summary:aa(Ye)};J({type:"SET_VALIDATE_LINKS_RESULT",payload:$}),d.success(e("Links validation was successfully completed")),Ae.limit_warning&&Ae.limit_remaining!=null&&d.warning({title:`${e("Approaching usage limit. Remaining")}: ${Ae.limit_remaining}`}),R({event:"check",action:"check_email_links",email_id:b,project_id:T,links_count:$.links?.length||0})}else Ae.statusCode>300||!Ae.success?d.error({error:{data:Ae}}):d.error({title:e("Something went wrong.")}),!G.validateLinksResult.links&&ve("")}).catch(Ae=>{I(Ae,"link_check")})},[b,h,xe,X,K,$e,c,U,he,d,e,R,T,Fe,G.validateLinksResult.links,I,ve]),Me=(0,n.useCallback)(async()=>{if(!h){d.error({title:"Save the mail first."});return}if(xe("image_check")){X("image_check");return}if(!await K("image_check"))return;$e("image_check");const Y=c(),D=new DOMParser().parseFromString(Y,"text/html"),ie={};D.querySelectorAll("img").forEach((Ee,Ae)=>ie[`image_${Ae}`]=Ee.src),U.send({operation:"sandbox_set_attr_to_images"}),ae({entity_id:h,data:ie}).then(({data:Ee,error:Ae})=>{let We;if(Ae)I(Ae,"image_check");else if(Ee?.result){const Ge=Object.values(Ee.result);Ge.sort(($,N)=>$.imageId-N.imageId);const Ye=Ge.reduce(($,N)=>$+Math.round(N.image.bytes/1024),0);We={images:Ge.map($=>({...$,status:sa($)}))||[],summary:aa(Ge.map($=>({...$,status:sa($)}))),summaryTime:{value:(Ye>1200?Ye/1e3:Ye).toFixed(1),name:Ye>1200?e("MB"):e("KB")}},We&&J({type:"SET_VALIDATE_IMAGES_RESULT",payload:We}),d.success(e("Images validation was successfully completed")),Ee.limit_warning&&Ee.limit_remaining!=null&&d.warning({title:`${e("Approaching usage limit. Remaining")}: ${Ee.limit_remaining}`}),R({event:"check",action:"check_email_images",email_id:b,project_id:T,images_count:We.images?.length||0})}else Ee.statusCode>300||!Ee.success?d.error({error:{data:Ee}}):d.error({title:e("Something went wrong.")}),!G.validateImagesResult?.images?.length&&ve("")}).catch(Ee=>{I(Ee,"image_check")})},[b,h,xe,X,K,$e,c,U,ae,d,e,R,T,Fe,G.validateImagesResult,I,ve]),He=(0,n.useCallback)(async()=>{if(!h){d.error({title:"Save the mail first."});return}if(xe("spam_check")){X("spam_check");return}await K("spam_check")&&($e("spam_check"),te({entity_id:h,data:{html:c()}}).then(({data:Y,error:D})=>{if(D)I(D,"spam_check");else if(Y&&Y.success){const ie=!!Y.result.report&&Object.values(Y.result.report);ie?(ie.sort((Ee,Ae)=>Ee.score-Ae.score),J({type:"SET_VALIDATE_SPAM_RESULT",payload:{...Y.result,report:ie}})):Y.result&&J({type:"SET_VALIDATE_SPAM_RESULT",payload:{...Y.result,report:ie}}),d.success(e("Spam validation was successfully completed")),Y.limit_warning&&Y.limit_remaining!=null&&d.warning({title:`${e("Approaching usage limit. Remaining")}: ${Y.limit_remaining}`}),R({event:"check",action:"check_email_spam",email_id:b,project_id:T,spam_score:Y.result?.spamScore||0})}else Y.statusCode>300||!Y.success?d.error({error:{data:Y}}):d.error({title:e("Something went wrong.")}),!G.validateSpamResult?.report?.length&&ve("")}).catch(Y=>{I(Y,"spam_check")}))},[b,h,xe,X,K,$e,c,te,d,e,R,T,Fe,G.validateSpamResult,I,ve]);(0,n.useEffect)(()=>{if(Z){if(Q){["link_check","image_check","spam_check"].forEach(Y=>{const{limit:D,counter:ie,disabled:Ee}=se[Y];if(!Ee){v.current[Y]=!1;return}v.current[Y]||D>0&&ie>=D&&(v.current[Y]=!0,X(Y))});return}if(!(W>0&&G.optimisationCounter>=W)){w.current=!1;return}w.current||(w.current=!0,X("link_check"))}},[Z,Q,se,G.optimisationCounter,W,X]);const le=_?r.getLimitUpgradePresetDefinition(_.presetId):null;return(0,o.jsxs)("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize",children:[le&&_?(0,o.jsx)(ai,{open:!0,onClose:()=>E(null),title:e(le.titleKey),subtitle:e(le.subtitleKey),usageResource:le.usageResource,previousDisplay:_.previousDisplay,nextDisplay:_.nextDisplay,onChangePlan:()=>{E(null),s()}}):null,Z&&!Q&&(0,o.jsx)(t.ui_kit$LimitsCounter,{text:ua(G.optimisationCounter,W,e,i),exceeded:q,extra:(0,o.jsx)("button",{type:"button",style:ca,onClick:ne,children:e("Need more?")})}),p.optimizeLinksEnabled&&(0,o.jsxs)(o.Fragment,{children:[we("link_check"),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider optimise__divider-no-margin"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,align:"middle",children:[(0,o.jsx)(t.ui_kit$Col,{span:20,children:(0,o.jsx)("div",{style:{padding:"15px 0"},children:e("Links validation")})}),(0,o.jsx)(t.ui_kit$Col,{span:4,className:"optimise__col-align-right",children:(0,o.jsx)(t.ui_kit$Button,{className:"selected-td-form__button ghost-button",type:"text",onMouseDown:Y=>Y.preventDefault(),onClick:()=>{ve(cr),!G.validateLinksResult?.links?.length&&G.activeTab!==cr&&Ve()},loading:be.isLoading,disabled:xe("link_check")&&!G.validateLinksResult?.links?.length,children:!be.isLoading&&(G.activeTab===cr?(0,o.jsx)(r.EmIcons,{icon:"DownOutlined",component:t.icons$DownOutlined,size:16,strokeWidth:p.iconStrokeWidth}):(0,o.jsx)(r.EmIcons,{icon:"RightOutlined",component:t.icons$RightOutlined,size:16,strokeWidth:p.iconStrokeWidth}))})})]}),(0,o.jsx)(ta,{__:e,activeTab:G.activeTab,validateLinksResult:G.validateLinksResult,validateLinks:G.validateLinks,selectedTags:G.selectedTags,setSelectedTags:ue,isLoading:be.isLoading,disabled:xe("link_check"),iconStrokeWidth:p.iconStrokeWidth,onValidate:Ve,goToLinkHandler:V})]}),p.optimizeImagesEnabled&&(0,o.jsxs)(o.Fragment,{children:[we("image_check"),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider optimise__divider-no-margin"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,align:"middle",children:[(0,o.jsx)(t.ui_kit$Col,{span:20,children:(0,o.jsx)("div",{style:{padding:"15px 0"},children:e("Images validation")})}),(0,o.jsx)(t.ui_kit$Col,{span:4,className:"optimise__col-align-right",children:(0,o.jsx)(t.ui_kit$Button,{className:"selected-td-form__button ghost-button",type:"text",onMouseDown:Y=>Y.preventDefault(),onClick:()=>{ve(ur),!G.validateImagesResult?.images?.length&&G.activeTab!==ur&&Me()},loading:ke.isLoading,children:!ke.isLoading&&(G.activeTab===ur?(0,o.jsx)(r.EmIcons,{icon:"DownOutlined",component:t.icons$DownOutlined,size:16,strokeWidth:p.iconStrokeWidth}):(0,o.jsx)(r.EmIcons,{icon:"RightOutlined",component:t.icons$RightOutlined,size:16,strokeWidth:p.iconStrokeWidth}))})})]}),(0,o.jsx)(ia,{__:e,activeTab:G.activeTab,validateImagesResult:G.validateImagesResult,validateImages:G.validateImages,selectedTags:G.selectedTags,setSelectedTags:ue,isLoading:ke.isLoading,disabled:xe("image_check"),iconStrokeWidth:p.iconStrokeWidth,onValidate:Me,goToImageHandler:Te,showImgPreviewHandler:ge,hideBlockPreviewHandler:Ne})]}),p.optimizeSpamAssassinEnabled&&(0,o.jsxs)(o.Fragment,{children:[we("spam_check"),(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider optimise__divider-no-margin"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,align:"middle",children:[(0,o.jsx)(t.ui_kit$Col,{span:20,children:(0,o.jsx)("div",{style:{padding:"15px 0"},children:e("SpamAssassin")})}),(0,o.jsx)(t.ui_kit$Col,{span:4,className:"optimise__col-align-right",children:(0,o.jsx)(t.ui_kit$Button,{className:"selected-td-form__button ghost-button",type:"text",onMouseDown:Y=>Y.preventDefault(),loading:oe.isLoading,onClick:()=>{ve(da),G.validateSpamResult.report?.length||Object.prototype.hasOwnProperty.call(G.validateSpamResult,"spamScore")||He()},disabled:xe("spam_check")&&!(G.validateSpamResult?.report?.length||Object.prototype.hasOwnProperty.call(G.validateSpamResult,"spamScore")),children:!oe.isLoading&&(G.activeTab===da?(0,o.jsx)(r.EmIcons,{icon:"DownOutlined",component:t.icons$DownOutlined,size:16,strokeWidth:p.iconStrokeWidth}):(0,o.jsx)(r.EmIcons,{icon:"RightOutlined",component:t.icons$RightOutlined,size:16,strokeWidth:p.iconStrokeWidth}))})})]}),(0,o.jsx)(ra,{__:e,activeTab:G.activeTab,validateSpamResult:G.validateSpamResult,isLoading:oe.isLoading,disabled:xe("spam_check"),iconStrokeWidth:p.iconStrokeWidth,onValidate:He})]}),p.optimizeCheckCodeEnabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Divider,{className:"selected-td-form__divider optimise__divider-no-margin"}),(0,o.jsxs)(t.ui_kit$Row,{gutter:10,align:"middle",children:[(0,o.jsx)(t.ui_kit$Col,{span:20,children:(0,o.jsx)("div",{style:{padding:"15px 0"},children:e("Source code validation")})}),(0,o.jsx)(t.ui_kit$Col,{span:4,className:"optimise__col-align-right",children:(0,o.jsx)(t.ui_kit$Button,{className:"selected-td-form__button ghost-button",type:"text",onMouseDown:Y=>Y.preventDefault(),onClick:()=>ve(mr),children:G.activeTab===mr?(0,o.jsx)(r.EmIcons,{icon:"DownOutlined",component:t.icons$DownOutlined,size:16,strokeWidth:p.iconStrokeWidth}):(0,o.jsx)(r.EmIcons,{icon:"RightOutlined",component:t.icons$RightOutlined,size:16,strokeWidth:p.iconStrokeWidth})})})]}),(0,o.jsx)(la,{__:e,activeTab:G.activeTab,problemsList:O,onSetMonacoPosition:Ie})]})]})},$u=({state:e,onCancel:i,onRetry:l,onDismiss:s})=>{const{__:a}=r.useI18n();return e.kind==="hidden"?null:(0,o.jsx)("div",{className:"indexing-tray",role:"status","aria-live":"polite",children:(0,o.jsx)(t.ui_kit$Card,{size:"small",variant:"borderless",className:"indexing-tray__card",children:(0,o.jsxs)(t.ui_kit$Flex,{vertical:!0,gap:8,children:[Fu(e,a),(0,o.jsx)(t.ui_kit$Flex,{justify:"flex-end",children:Mu(e,{onCancel:i,onRetry:l,onDismiss:s},a)})]})})})};function Fu(e,i){switch(e.kind){case"scanning":return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.ui_kit$Flex,{align:"center",gap:8,children:[(0,o.jsx)(t.ui_kit$Spin,{size:"small"}),(0,o.jsx)(t.ui_kit$Title,{level:5,className:"indexing-tray__title",children:i("Moving files from old storage…")})]}),(0,o.jsx)(t.ui_kit$Text,{type:"secondary",children:i("Found so far: %s").replace("%s",String(e.scanned))}),(0,o.jsx)(t.ui_kit$Progress,{percent:100,status:"active",showInfo:!1,strokeColor:r.emCssVar("colorPrimary")})]});case"indexing":{const l=e.total>0?Math.min(100,Math.round(e.scanned/e.total*100)):0;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Title,{level:5,className:"indexing-tray__title",children:i("Indexing files…")}),(0,o.jsx)(t.ui_kit$Text,{type:"secondary",children:`${e.scanned} / ${e.total}`}),(0,o.jsx)(t.ui_kit$Progress,{percent:l,status:"active",strokeColor:r.emCssVar("colorPrimary")})]})}case"done":return(0,o.jsx)(t.ui_kit$Title,{level:5,className:"indexing-tray__title",children:i("Files ready: %s").replace("%s",String(e.files+e.folders+e.trashed))});case"failed":return(0,o.jsx)(t.ui_kit$Title,{level:5,className:"indexing-tray__title",children:i("Could not move files from old storage")});case"cancelled":return(0,o.jsx)(t.ui_kit$Title,{level:5,className:"indexing-tray__title",children:i("Move stopped")});default:return null}}function Mu(e,i,l){switch(e.kind){case"scanning":case"indexing":return(0,o.jsx)(t.ui_kit$Button,{type:"link",size:"small",onClick:i.onCancel,disabled:e.cancelling,children:e.cancelling?l("Stopping…"):l("Cancel")});case"failed":return(0,o.jsx)(t.ui_kit$Button,{type:"link",size:"small",onClick:i.onRetry,children:l("Retry")});case"cancelled":return(0,o.jsx)(t.ui_kit$Button,{type:"link",size:"small",onClick:i.onRetry,children:l("Resume")});case"done":return(0,o.jsx)(t.ui_kit$Button,{type:"link",size:"small",onClick:i.onDismiss,children:l("Close")});default:return null}}var Du=2500,pa=48,Vu=4e3;function Hu(e){switch(e.status){case"running":return e.phase==="indexing"?{kind:"indexing",scanned:e.scanned??0,total:e.total??0,cancelling:!!e.cancelling}:{kind:"scanning",scanned:e.scanned??0,cancelling:!!e.cancelling};case"done":return{kind:"done",files:e.files??0,folders:e.folders??0,trashed:e.trashed??0};case"failed":return{kind:"failed"};case"cancelled":return{kind:"cancelled"};default:return{kind:"hidden"}}}function Uu(e){return e.kind==="done"||e.kind==="failed"||e.kind==="cancelled"}function Wu({projectId:e,api:i,triggered:l,onCompleted:s}){const[a,d]=(0,n.useState)({kind:"hidden"}),c=(0,n.useRef)(!1),p=(0,n.useRef)(!0),f=(0,n.useRef)(e);f.current=e;const x=(0,n.useRef)(l);x.current=l;const k=(0,n.useRef)(s);k.current=s,(0,n.useEffect)(()=>(p.current=!0,()=>{p.current=!1}),[]),(0,n.useEffect)(()=>{d({kind:"hidden"})},[e]);const b=(0,n.useCallback)(async()=>{try{const T=await i.files.backfillList({project_id:e});return!T.ok||T.error?null:Hu(T.data)}catch{return null}},[i,e]),h=(0,n.useCallback)(async()=>{if(c.current)return;c.current=!0;const T=f.current;let _=0;try{for(;p.current&&f.current===T&&x.current;){const E=await b();if(!p.current)break;if(E)if(E.kind==="hidden"){if(_+=1,_>=pa){d({kind:"failed"});break}}else{if(_=0,d(E),E.kind==="done")try{await k.current?.()}catch{}if(Uu(E))break}else if(_+=1,_>=pa){d({kind:"failed"});break}await new Promise(w=>setTimeout(w,Du))}}finally{c.current=!1}},[b]);return(0,n.useEffect)(()=>{l&&h()},[l,h]),(0,n.useEffect)(()=>{if(a.kind!=="done")return;const T=setTimeout(()=>{p.current&&d({kind:"hidden"})},Vu);return()=>clearTimeout(T)},[a.kind]),{state:a,cancel:(0,n.useCallback)(()=>{d(T=>T.kind==="scanning"||T.kind==="indexing"?{...T,cancelling:!0}:T),i.files.backfillCancelCreate({project_id:e})},[i,e]),retry:(0,n.useCallback)(()=>{x.current=!0,i.files.backfillCreate({project_id:e}),h()},[i,e,h]),dismiss:(0,n.useCallback)(()=>d({kind:"hidden"}),[])}}var zu=r.lazyRoute(()=>(0,Lt.__vitePreload)(()=>Promise.resolve().then(()=>fo("./d58ae4ac.js")),void 0,{}.url)),Gu=r.lazyRoute(()=>(0,Lt.__vitePreload)(()=>Promise.resolve().then(()=>fo("./d61988e0.js")),void 0,{}.url)),ha={height:"100%"};function Yu(e){(e?(0,Lt.__vitePreload)(()=>Promise.resolve().then(()=>fo("./bb65f553.js")),void 0,{}.url):(0,Lt.__vitePreload)(()=>Promise.resolve().then(()=>fo("./83c17079.js")),void 0,{}.url)).catch(()=>{})}var Xu=({storageProvider:e,dataProvider:i,pathProxy:l,usesBuiltInStorage:s,contentKey:a})=>{const d=r.useAppConfig(),c=r.isImageEditModal(r.useSelector(r.selectActiveModal$1)),p=!!d.imageCenterFileManagerView;(0,n.useEffect)(()=>{c&&Yu(p)},[c,p]);let f=(0,o.jsx)(t.ui_kit$PageLoader,{style:ha});return e&&i&&d.imageCenterFileManagerView?f=(0,o.jsx)(zu,{storageProvider:e,dataProvider:i,pathProxy:l},a):e&&i&&(f=(0,o.jsx)(Gu,{dataProvider:i,usesBuiltInStorage:s},a)),(0,o.jsx)(n.Suspense,{fallback:(0,o.jsx)(t.ui_kit$PageLoader,{style:ha}),children:f})};function Ku(){const e=r.useAppConfig(),i=r.useIsStandalone(),l=r.useStorageProvider(),s=r.useProjectData(),a=r.useRestClient(r.EM_FILES_MODULES),d=r.useStore(),c=(0,n.useMemo)(()=>r.createRestClientV2(d),[d]),p=r.useI18n(),f=r.useCurrentUser(),x=s?.id?String(s.id):"",k=f?.id!=="0"?String(f.id):"",b=r.isFileManagerV2Enabled(e),[h,T]=(0,n.useState)(null),_=b&&!!x&&h===x,[E,w]=(0,n.useState)(0),[v,P]=(0,n.useState)(0),j=(0,n.useRef)(x);(0,n.useEffect)(()=>{j.current!==x&&(j.current=x,T(null))},[x]);const C=(0,n.useCallback)(O=>{O&&x&&T(x)},[x]),I=(0,n.useMemo)(()=>r.buildResolvedFileManagerProviders({storageProvider:l,projectId:x,restApi:a,restApiV2:c,i18n:p,pathPostfix:k,appConfig:e,isStandalone:i,onIndexingStateChange:C}),[e,C,p,i,x,E,a,c,l,k]),K=(0,n.useCallback)(async()=>{try{typeof I.dataProvider?.clearCache=="function"&&await I.dataProvider.clearCache()}catch{}T(null),w(O=>O+1),P(O=>O+1)},[I.dataProvider]),U=(0,n.useCallback)(()=>{x&&T(x)},[x]);return{...I,projectId:x,restApiV2:c,v2Enabled:b,backfillTriggered:_,contentKey:`${x}:${v}`,handleIndexingCompleted:K,markIndexingStarted:U}}var qu={height:"100%"},ba=()=>{const{storageProvider:e,dataProvider:i,pathProxy:l,usesBuiltInStorage:s,projectId:a,restApiV2:d,v2Enabled:c,backfillTriggered:p,contentKey:f,handleIndexingCompleted:x,markIndexingStarted:k}=Ku(),b=r.useSelector(r.selectActiveModal$1),h=r.isImageCenterModal(b),{state:T,cancel:_,retry:E,dismiss:w}=Wu({projectId:a,api:d,triggered:p,onCompleted:x}),v=n.default.useCallback(()=>{k(),E()},[k,E]);return(0,o.jsxs)(o.Fragment,{children:[h&&(0,o.jsx)(n.Suspense,{fallback:(0,o.jsx)(t.ui_kit$PageLoader,{style:qu}),children:(0,o.jsx)(Xu,{storageProvider:e,dataProvider:i,pathProxy:l,usesBuiltInStorage:s,contentKey:f})}),c&&(0,o.jsx)($u,{state:T,onCancel:_,onRetry:v,onDismiss:w})]})},Ju=(function(){var e=window.__useblocks__;if(e&&e.assetUrl)return e.assetUrl("icon-menu-block-welcome.1c534a003522feadd2e7.png");if(e&&e.publicPath)try{return new URL("static/media/icon-menu-block-welcome.1c534a003522feadd2e7.png",e.publicPath).href}catch{}try{return new URL("/static/media/icon-menu-block-welcome.1c534a003522feadd2e7.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/icon-menu-block-welcome.1c534a003522feadd2e7.png"}})();function Qu(e){return!!(e?.global_block??e?.acf?.global_block)}var Zu=({className:e,size:i=16})=>{const l=r.useAppConfig(),{__:s}=r.useI18n(),a=s("Global block");return(0,o.jsx)(t.ui_kit$Tooltip,{title:a,placement:"top",trigger:["hover"],children:(0,o.jsx)("span",{className:(0,De.default)("block-global-badge",e),"aria-label":a,role:"img",children:(0,o.jsx)(r.EmIcons,{icon:"Globe02Icon",component:t.icons$Globe02Icon,size:i,strokeWidth:l.iconStrokeWidth})})})},fa=new Map;function ga(e){return`<table cellspacing="0" cellpadding="0" border="0" width="100%">${e}</table>`}function pr(e,i){const l=i??"";if(e===void 0)return r.sanitizeHtml(ga(l));const s=String(e),a=fa.get(s);if(a&&a.source===l)return a.markup;const d=r.sanitizeHtml(ga(l));return fa.set(s,{source:l,markup:d}),d}var{name:hr,type:_a,tags:xa}={name:"name",type:"type",tags:"tags"},ka={[hr]:"",[_a]:[],[xa]:[]},ht={Header:10,Menu:20,Banners:30,Content:40,Lists:50,Buttons:60,Promocodes:70,"E-Commerce":80,Transactional:80,Articles:90,Polls:100,Applications:110,Feature:120,Separators:130,Contacts:140,Footer:150},br=({parentEmailId:e,blocksTab:i,search:l,reloadBlockScreens:s,setIsShowAddAllBlocksModal:a})=>{const d=r.parentEmailSource(e),c=r.useEditorProjectId(),p=wo.useSetHtmlElementInIframeHandler(),f=wo.useDragStartBlockToIframeHandler(),[x]=t.ui_kit$Form.useForm(),{data:k}=r.useGetBlocksSchemaQuery(),{token:b}=(0,t.ui_kit$useToken)(),{__:h,_x:T}=r.useI18n(),_=r.useNotification(),{modal:E}=t.ui_kit$App.useApp(),{confirm:w}=E;r.useRoutePathname();const v=r.useSelector(r.selectParentBlocks),P=gs(),j=(0,n.useRef)(null),C=(0,n.useRef)(null),I=r.useRootElement(),K=640,U=207/K,O=B=>Qu(B)?(0,o.jsx)("div",{className:"blocks-search__result-global-mark",children:(0,o.jsx)(Zu,{className:"block-global-badge--tile",size:14})}):null,L=r.useEmailAttribute("common_styles"),R=(0,n.useMemo)(()=>xs(L,P),[L,P]),G=(0,n.useRef)(null),J=(0,n.useRef)(null),te=(0,n.useRef)(null),oe=r.useStore();(0,n.useEffect)(()=>{C.current?.scrollTo({top:0})},[i,l]);const he=r.useProjectData(),{data:be}=r.useGetTermsQuery({project:he,kind:r.BLOCK_TAGS},{skip:!he?.id}),[ae,ke]=(0,n.useState)(()=>r.projectBlocksArgs(c));(0,n.useEffect)(()=>{l||(x.setFieldsValue(ka),le({type:null,name:null}),s())},[l,x,s]),(0,n.useEffect)(()=>{if(k){const B=k.schema.properties.acf.properties.type.items.enum;let S=[];for(let m in B)S.push({label:h(r.TYPES_TRANSLATE[B[m]]),value:B[m]})}},[k,h]);const{isSuccess:Ce,isError:de,isLoading:Fe,isFetching:je,data:re,refetch:Be,error:ce}=r.useGetBlocksQuery({...ae,page:1}),ee=(0,n.useMemo)(()=>{if(Ce&&re)return[...re].sort((B,S)=>ht[B.type]-ht[S.type])},[Ce,re]),[me,ue]=(0,n.useState)([]);r.usePrevious(B=>{B!==de&&_.fromError("BLOCK_GET_ERROR",{},ce,!0)},[de,ce,_]);const[Z,Q]=(0,n.useState)(()=>r.parentEmailBlocksArgs(d)),{isSuccess:W,isError:q,isLoading:se,isFetching:xe}=r.useGetParentEmailBlocksQuery({...Z,emailId:d,page:1},{skip:!d||v.length}),ge=(0,n.useMemo)(()=>{if(W||v.length)return[...v].sort((B,S)=>ht[B.type]-ht[S.type])},[W,v]),[Ne,ye]=(0,n.useState)([]);(0,n.useEffect)(()=>{const B=new Set;if(v.length&&ge){for(const S of ge)S.type&&B.add(S.type);ye(Array.from(B))}else ye([])},[v,ge]);const[$e,X]=(0,n.useState)(r.templateBlocksArgs),{isSuccess:ne,isError:we,isLoading:V,isFetching:Te,data:Ie=[]}=r.useGetTemplateBlocksQuery({...$e,page:1}),ve=(0,n.useMemo)(()=>{if(Ie.length)return[...Ie].sort((B,S)=>ht[B.type]-ht[S.type])},[Ie]),[Ve,Me]=(0,n.useState)([]);(0,n.useEffect)(()=>{const B=new Set;if(ve&&Ie.length){for(const S of ve)S.type&&B.add(S.type);Me(Array.from(B))}},[Ie.length,ve]);const He=(0,n.useMemo)(()=>{const B=new Set;for(const S of me)B.add(S);for(const S of Ne)B.add(S);for(const S of Ve)B.add(S);return Array.from(B)},[Ve,Ne,me]),le=B=>{ke(S=>({...S,...B,page:1})),Q(S=>({...S,...B,page:1})),X(S=>({...S,...B,page:1}))},Y=r.useFitBlockPreviewHeight(U),D=(0,n.useCallback)(()=>{I.querySelector(".blocks-search__result-wrapper.is_search")&&(I.querySelector(".blocks-search__result-wrapper").style.removeProperty("transition"),I.querySelector(".blocks-search__result-wrapper").style.opacity=0,r.measureBlockPreviews(I,207/K),I.querySelector(".blocks-search__result-wrapper").style.transition="opacity 0.2s",I.querySelectorAll(".blocks-search__result-wrapper").forEach(B=>B.style.opacity=1))},[K,I]);(0,n.useEffect)(()=>{!(Te||V)&&ne&&i!=="template"&&(l?D():s())},[Te,V,ne,D,ae.name,s,l,i]),(0,n.useEffect)(()=>{const B=new Set;if(Ce&&ee){for(const S of ee)S.type&&B.add(S.type);ue(Array.from(B))}},[Ce,ee]);const ie=B=>{const S=Object.keys(B)[0],m=x.getFieldsValue(!0);switch(S){case xa:const F=(be||[]).filter(H=>B[S].includes(H.name)).map(H=>H.id)||null;le({tags:F});break;case _a:le({type:m.type||null});break;case hr:j.current&&window.clearTimeout(j.current),j.current=window.setTimeout(function(){le({name:m.name||null})},300)}},Ee=B=>{s(),B.target.getAttribute("data-type")?(B.target.closest(".blocks-search").querySelectorAll(".blocks-search__result").forEach(S=>S.style.display="none"),B.target.closest(".blocks-search").querySelectorAll(`[data-type="${B.target.getAttribute("data-type")}"]`).forEach(S=>S.style.display="block")):B.target.closest(".blocks-search").querySelectorAll(".blocks-search__result").forEach(S=>S.style.display="block"),B.target.parentElement.querySelector(".active").classList.remove("active"),B.target.classList.add("active")};let Ae=null;const We=B=>{clearTimeout(Ae);let S=I.querySelector(".block-search__preview")?I.querySelector(".block-search__preview"):null,m=I.querySelector(".block-search__preview-title")?I.querySelector(".block-search__preview-title"):null,F=I.querySelector(".block-search__preview-content")?I.querySelector(".block-search__preview-content"):null;I.querySelector(".block-search__preview")||(S=document.createElement("div"),S.classList.add("block-search__preview"),m=document.createElement("div"),m.classList.add("block-search__preview-title"),F=document.createElement("div"),F.classList.add("block-search__preview-content"),S.append(F),S.append(m),I.querySelector(".email-pane__col_settings-inner").append(S)),m.innerHTML="",F.innerHTML="",m.innerHTML=B.title;let H=B.html.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();F.innerHTML=r.sanitizeHtml('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+H+"</table>"),S.style.opacity!=="1"&&setTimeout(function(){S.style.opacity="1",S.style.transform=document.querySelector(".email-pane__col-wrapper_reverse")?"translateX(100%)":"translateX(-100%)"},10)},Ge=()=>{let B=I.querySelector(".block-search__preview");B&&(Ae=setTimeout(()=>{B.style.opacity="0",B.style.transform=document.querySelector(".email-pane__col-wrapper_reverse")?"translateX(99%)":"translateX(-99%)",setTimeout(function(){B.remove()},300)},300))};(0,n.useEffect)(()=>{I.querySelectorAll(".blocks-search__result").forEach(B=>{B.style.display="block"})},[i]);const Ye=!re?.length&&(!d||!v?.length)&&!Ie?.length&&(ae.tags||ae.name||ae.type)&&!(Fe||je),$=B=>oe.dispatch(r.blocksApi.endpoints.deleteBlock.initiate(B.id)).then(S=>{S.error&&_.fromError("BLOCK_REMOVING_ERROR",r.getBlockDesc(B),S.error),_.success({id:"BLOCK_REMOVING_SUCCESS",data:r.getBlockDesc(B),title:h('The block "')+S.data.title+T('" was successfully removed.',"block")}),Be()});(0,n.useEffect)(()=>{!Fe&&!je&&s()},[Fe,je,s]),(0,n.useEffect)(()=>{(i==="common"||l)&&setTimeout(s,50)},[re,s,i,l]);const N=B=>{w({mask:{closable:!0},centered:!0,title:T("Are you sure you want to delete the “","block")+B.title+h("” block?"),icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:22,style:{color:t.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:h("Yes"),cancelText:h("No"),onOk:()=>$(B)})},y=B=>[{key:"Delete block",className:"blocks-search__result__menu-item",icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:16,style:{margin:0}}),style:{color:b.colorError},onClick:()=>N(B)}],M=B=>{let S=B.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");if(S.replaceChildren(...r.parseFromString(B.html)),Object.keys(R).length!==0&&(S.querySelectorAll(".em-contrast-card").forEach(m=>{R.cards?.contrastBackgroundColor&&(m.getAttribute("bgcolor")?R.cards.contrastBackgroundColor?m.setAttribute("bgcolor",R.cards.contrastBackgroundColor):m.removeAttribute("bgcolor"):R.cards.contrastBackgroundColor?m.style.backgroundColor=R.cards.contrastBackgroundColor:m.style.removeProperty("background-color")),R.cards?.contrastTextColor&&m.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(F=>{if(Le(F.style.color).toLowerCase()!=="#ffffff"){let H=F.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.cards.contrastTextColor};`);F.setAttribute("style",H)}})}),S.querySelectorAll(".em-card").forEach(m=>{R.cards?.baseBackgroundColor&&(m.getAttribute("bgcolor")?R.cards.baseBackgroundColor?m.setAttribute("bgcolor",R.cards.baseBackgroundColor):m.removeAttribute("bgcolor"):R.cards.baseBackgroundColor?m.style.backgroundColor=R.cards.baseBackgroundColor:m.style.removeProperty("background-color")),R.cards?.baseTextColor&&m.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(F=>{if(Le(F.style.color).toLowerCase()!=="#ffffff"){let H=F.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.cards.baseTextColor};`);F.setAttribute("style",H)}})}),S.querySelectorAll(".em-card, .em-contrast-card").forEach(m=>{R.cards?.border&&Xe({settings:{border:R.cards?.border},elem:m}),R.cards?.borderRadius?.all?(m.style.borderBottomLeftRadius&&m.style.borderBottomLeftRadius!=="0px"&&(m.style.borderBottomLeftRadius=R.cards?.borderRadius.all+"px"),m.style.borderBottomRightRadius&&m.style.borderBottomRightRadius!=="0px"&&(m.style.borderBottomRightRadius=R.cards?.borderRadius.all+"px"),m.style.borderTopLeftRadius&&m.style.borderTopLeftRadius!=="0px"&&(m.style.borderTopLeftRadius=R.cards?.borderRadius.all+"px"),m.style.borderTopRightRadius&&m.style.borderTopRightRadius!=="0px"&&(m.style.borderTopRightRadius=R.cards?.borderRadius.all+"px")):R.cards?.borderRadius?.all===""?m.style.removeProperty("border-radius"):(R.cards?.borderRadius?.topLeft&&m.style.borderTopLeftRadius&&m.style.borderTopLeftRadius!=="0px"?m.style.borderTopLeftRadius=R.cards?.borderRadius.topLeft+"px":R.cards?.borderRadius?.topLeft===""&&m.style.removeProperty("border-top-left-radius"),R.cards?.borderRadius?.topRight&&m.style.borderTopRightRadius&&m.style.borderTopRightRadius!=="0px"?m.style.borderTopRightRadius=R.cards?.borderRadius.topRight+"px":R.cards?.borderRadius?.topRight===""&&m.style.removeProperty("border-top-right-radius"),R.cards?.borderRadius?.bottomRight&&m.style.borderBottomRightRadius&&m.style.borderBottomRightRadius!=="0px"?m.style.borderBottomRightRadius=R.cards?.borderRadius.bottomRight+"px":R.cards?.borderRadius?.bottomRight===""&&m.style.removeProperty("border-bottom-right-radius"),R.cards?.borderRadius?.bottomLeft&&m.style.borderBottomLeftRadius&&m.style.borderBottomLeftRadius!=="0px"?m.style.borderBottomLeftRadius=R.cards?.borderRadius.bottomLeft+"px":R.cards?.borderRadius?.bottomLeft===""&&m.style.removeProperty("border-bottom-left-radius"))}),S.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(m=>{if(!m.style.display&&parseFloat(m.style.fontSize)<=20){let F="",H=R.text.fontFamily;if(parseFloat(m.style.fontSize)>14&&(F=m.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${R.text.fontSize}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${R.text.lineHeight}px`),m.setAttribute("style",F)),!m.closest(".em-contrast-card, .em-card")&&Le(m.style.color).toLowerCase()!=="#ffffff"&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.text.color};`),m.setAttribute("style",F)),m.closest(".em-contrast-block")&&!m.closest(".em-contrast-card, .em-card")&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.text.contrastColor};`),m.setAttribute("style",F)),H[0]==="Safe Fonts"?(m.style.fontFamily=H[1],fe({elem:S})):H[0]==="Google Fonts"&&(H[1]==="Sans Serif"?m.style.fontFamily="Helvetica, Arial, sans-serif":H[1]==="Serif"&&(m.style.fontFamily='"Times New Roman", Times, serif'),m.classList.remove(...[...m.classList].filter(Re=>Re.startsWith("em-font"))),m.classList.add(`em-font-${H[2].replace(/\s/g,"")}-${H[3].replace(/\s/g,"")}`),eo({elem:S,fontFamilyArray:H})),m.closest('[em="atom"] > tr > td')&&m.closest('[em="atom"] > tr > td').style.paddingBottom)m.closest('[em="atom"] > tr > td').style.paddingBottom=R.text.paddingBottom+"px";else if(m.nextElementSibling||m.closest("table")&&m.closest("table").nextElementSibling){let Re=m.nextElementSibling??m.closest("table").nextElementSibling;Re&&Re.tagName==="TABLE"&&(Re.classList.contains("em-vindent-table")||Re.querySelector("td").innerHTML==="")&&Re.querySelector("td").setAttribute("height",R.text.paddingBottom)}}else if(!m.style.display&&parseFloat(m.style.fontSize)>=20&&Le(m.style.color).toLowerCase()!=="#eb3737"){let F="",H=R.headings.fontFamily;parseFloat(m.style.fontSize)<40&&(F=m.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${R.headings.fontSize}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${R.headings.lineHeight}px`),m.setAttribute("style",F)),!m.closest(".em-contrast-card, .em-card")&&Le(m.style.color).toLowerCase()!=="#ffffff"&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.headings.color};`),m.setAttribute("style",F)),m.closest(".em-contrast-block")&&!m.closest(".em-contrast-card, .em-card")&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.headings.contrastColor};`),m.setAttribute("style",F)),H[0]==="Safe Fonts"?(m.style.fontFamily=H[1],fe({elem:S})):H[0]==="Google Fonts"&&(H[1]==="Sans Serif"?m.style.fontFamily="Helvetica, Arial, sans-serif":H[1]==="Serif"&&(m.style.fontFamily='"Times New Roman", Times, serif'),m.classList.remove(...[...m.classList].filter(pe=>pe.startsWith("em-font"))),m.classList.add(`em-font-${H[2].replace(/\s/g,"")}-${H[3].replace(/\s/g,"")}`),eo({elem:S,fontFamilyArray:H}));let Re="";if(R.headings.letterSpacing>0?Re=m.style.letterSpacing?m.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${R.headings.letterSpacing}px`):m.getAttribute("style")+` letter-spacing: ${R.headings.letterSpacing}px;`:Re=m.getAttribute("style").replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,""),m.setAttribute("style",Re),R.headings.bold?m.querySelector("b")?m.querySelector("b").replaceWith(...m.querySelector("b").childNodes):m.querySelector("strong")||(m.innerHTML="<strong>"+m.innerHTML+"</strong>"):m.querySelector("strong")?m.querySelector("strong").replaceWith(...m.querySelector("strong").childNodes):m.querySelector("b")&&m.querySelector("b").replaceWith(...m.querySelector("b").childNodes),m.style.fontWeight){let pe=m.getAttribute("style").replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"");m.setAttribute("style",pe)}if(R.headings.italic?m.querySelector("i")?m.querySelector("i").replaceWith(...m.querySelector("i").childNodes):m.querySelector("em")||(m.innerHTML="<em>"+m.innerHTML+"</em>"):m.querySelector("em")?m.querySelector("em").replaceWith(...m.querySelector("em").childNodes):m.querySelector("i")&&m.querySelector("i").replaceWith(...m.querySelector("i").childNodes),m.style.fontStyle){let pe=m.getAttribute("style").replace(/(\s+)?font-style:(\s+)?.*?;/,"");m.setAttribute("style",pe)}if(m.closest('[em="atom"] > tr > td')&&m.closest('[em="atom"] > tr > td').style.paddingTop)m.closest('[em="atom"] > tr > td').style.paddingTop=R.headings.paddingTop+"px";else if(m.previousElementSibling){let pe=m.previousElementSibling;pe&&pe.tagName==="TABLE"&&(pe.classList.contains("em-vindent-table")||pe.querySelector("td").innerHTML==="")&&pe.querySelector("td").setAttribute("height",R.headings.paddingTop)}if(m.closest('[em="atom"] > tr > td')&&m.closest('[em="atom"] > tr > td').style.paddingBottom)m.closest('[em="atom"] > tr > td').style.paddingBottom=R.headings.paddingBottom+"px";else if(m.nextElementSibling){let pe=m.nextElementSibling;pe&&pe.tagName==="TABLE"&&(pe.classList.contains("em-vindent-table")||pe.querySelector("td").innerHTML==="")&&pe.querySelector("td").setAttribute("height",R.headings.paddingBottom)}}}),S.querySelectorAll('a[style*="color"]').forEach(m=>{if(m.style.display){if(m.style.display&&m.style.display==="block"){let F="";if(F=m.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${R.buttons.fontSize}px`),m.setAttribute("style",F),m.closest("td").style.backgroundColor&&!m.closest("td").style.borderWidth&&!m.closest(".em-contrast-card"))if(m.closest(".em-contrast-block")?F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.contrastColor};`):F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.color};`),m.setAttribute("style",F),m.closest(".em-contrast-block"))if(R.buttons.contrastBackgroundColor){let pe=m.closest("td").getAttribute("style").replace(/background-color:(\s+)?.*?;/,`background-color: ${R.buttons.contrastBackgroundColor};`);m.closest("td").setAttribute("style",pe)}else m.closest("td").style.removeProperty("background-color");else if(R.buttons.backgroundColor){let pe=m.closest("td").getAttribute("style").replace(/background-color:(\s+)?.*?;/,`background-color: ${R.buttons.backgroundColor};`);m.closest("td").setAttribute("style",pe)}else m.closest("td").style.removeProperty("background-color");else if(m.closest("td").style.borderWidth)if(Object.values(R.buttons.border).every(pe=>pe===null)){if(m.closest(".em-contrast-block")){if(R.buttons.contrastBackgroundColor){let pe=m.closest("td").getAttribute("style").replace(/border:\s*\d+px\s+solid\s+#[A-Fa-f0-9]{6}/,ze=>ze.replace(/#[A-Fa-f0-9]{6}/,`${R.buttons.contrastBackgroundColor}`));m.closest("td").setAttribute("style",pe),F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.contrastBackgroundColor};`),m.setAttribute("style",F)}}else if(R.buttons.backgroundColor){let pe=m.closest("td").getAttribute("style").replace(/border:\s*\d+px\s+solid\s+#[A-Fa-f0-9]{6}/,ze=>ze.replace(/#[A-Fa-f0-9]{6}/,`${R.buttons.backgroundColor}`));m.closest("td").setAttribute("style",pe),F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.backgroundColor};`),m.setAttribute("style",F)}}else for(const pe in R.buttons.border)R.buttons.border[pe]&&R.buttons.border[pe].color!==void 0&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.border[pe].color};`),m.setAttribute("style",F));else m.closest(".em-contrast-block")?R.buttons.contrastBackgroundColor&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.contrastBackgroundColor};`),m.setAttribute("style",F)):R.buttons.backgroundColor&&(F=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.buttons.backgroundColor};`),m.setAttribute("style",F));let H=R.buttons.fontFamily;H[0]==="Safe Fonts"?(m.style.fontFamily=H[1],fe({elem:S})):H[0]==="Google Fonts"&&(H[1]==="Sans Serif"?m.style.fontFamily="Helvetica, Arial, sans-serif":H[1]==="Serif"&&(m.style.fontFamily='"Times New Roman", Times, serif'),m.classList.remove(...[...m.classList].filter(pe=>pe.startsWith("em-font"))),m.classList.add(`em-font-${H[2].replace(/\s/g,"")}-${H[3].replace(/\s/g,"")}`),eo({elem:S,fontFamilyArray:H})),m.closest("td").setAttribute("align",R.buttons.textAlign);let Re="";if(R.buttons.letterSpacing>0?Re=m.style.letterSpacing?m.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${R.buttons.letterSpacing}px`):m.getAttribute("style")+` letter-spacing: ${R.buttons.letterSpacing}px;`:Re=m.getAttribute("style").replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,""),m.setAttribute("style",Re),R.buttons.bold?m.querySelector("b")?m.querySelector("b").replaceWith(...m.querySelector("b").childNodes):m.querySelector("strong")||(m.innerHTML="<strong>"+m.innerHTML+"</strong>"):m.querySelector("strong")?m.querySelector("strong").replaceWith(...m.querySelector("strong").childNodes):m.querySelector("b")&&m.querySelector("b").replaceWith(...m.querySelector("b").childNodes),m.style.fontWeight){let pe=m.getAttribute("style").replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"");m.setAttribute("style",pe)}if(R.buttons.italic?m.querySelector("i")?m.querySelector("i").replaceWith(...m.querySelector("i").childNodes):m.querySelector("em")||(m.innerHTML="<em>"+m.innerHTML+"</em>"):m.querySelector("em")?m.querySelector("em").replaceWith(...m.querySelector("em").childNodes):m.querySelector("i")&&m.querySelector("i").replaceWith(...m.querySelector("i").childNodes),m.style.fontStyle){let pe=m.getAttribute("style").replace(/(\s+)?font-style:(\s+)?.*?;/,"");m.setAttribute("style",pe)}if(m.closest('[em="atom"] > tr > td')&&m.closest('[em="atom"] > tr > td').style.paddingTop)m.closest('[em="atom"] > tr > td').style.paddingTop=R.buttons.marginTop+"px";else if(m.closest("table").previousElementSibling){let pe=m.closest("table").previousElementSibling;pe&&pe.tagName==="TABLE"&&(pe.classList.contains("em-vindent-table")||pe.querySelector("td").innerHTML==="")&&pe.querySelector("td").setAttribute("height",R.buttons.marginTop)}if(m.closest('[em="atom"] > tr > td')&&m.closest('[em="atom"] > tr > td').style.paddingBottom)m.closest('[em="atom"] > tr > td').style.paddingBottom=R.buttons.marginBottom+"px";else if(m.closest("table").previousElementSibling){let pe=m.closest("table").nextElementSibling;pe&&pe.tagName==="TABLE"&&(pe.classList.contains("em-vindent-table")||pe.querySelector("td").innerHTML==="")&&pe.querySelector("td").setAttribute("height",R.buttons.marginBottom)}R.buttons.padding.all&&(m.style.padding=R.buttons.padding.all+"px"),R.buttons.padding.top&&(m.style.paddingTop=R.buttons.padding.top+"px"),R.buttons.padding.right&&(m.style.paddingRight=R.buttons.padding.right+"px"),R.buttons.padding.bottom&&(m.style.paddingBottom=R.buttons.padding.bottom+"px"),R.buttons.padding.left&&(m.style.paddingLeft=R.buttons.padding.left+"px"),Xe({settings:{border:R.buttons.border},elem:m.closest("td")}),lo({settings:{borderRadius:R.buttons.borderRadius},elem:m.closest("td")})}}else{let F=R.text.fontFamily;if(Le(m.style.color).toLowerCase()==="#1c52dc"){let Re=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.links.color};`);m.setAttribute("style",Re)}else{let Re=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.text.color};`);m.setAttribute("style",Re)}if(m.closest(".em-contrast-block")){let Re=m.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${R.links.contrastColor};`);m.setAttribute("style",Re)}let H="";R.links.underline?H=m.style.textDecoration?m.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: underline;"):m.getAttribute("style")+" text-decoration: underline;":H=m.style.textDecoration?m.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: none;"):m.getAttribute("style")+" text-decoration: none;",m.setAttribute("style",H),F[0]==="Safe Fonts"?(m.style.fontFamily=F[1],fe({elem:S})):F[0]==="Google Fonts"&&(F[1]==="Sans Serif"?m.style.fontFamily="Helvetica, Arial, sans-serif":F[1]==="Serif"&&(m.style.fontFamily='"Times New Roman", Times, serif'),m.classList.remove(...[...m.classList].filter(Re=>Re.startsWith("em-font"))),m.classList.add(`em-font-${F[2].replace(/\s/g,"")}-${F[3].replace(/\s/g,"")}`),eo({elem:S,fontFamilyArray:F}))}}),S.querySelector('[em="block"]'))){const m=S.querySelectorAll('[em="block"]');R.block?.backgroundColor&&m.forEach(F=>{F.querySelectorAll(":scope > td").forEach(H=>{H.setAttribute("bgcolor",R.block.backgroundColor)})}),R.block?.padding&&m.forEach(F=>{F.querySelectorAll(":scope > td").forEach(H=>{H.style.paddingTop=R.block.padding.top+"px",H.style.paddingRight=R.block.padding.right+"px",H.style.paddingBottom=R.block.padding.bottom+"px",H.style.paddingLeft=R.block.padding.left+"px"})})}return S.tagName==="DIV"?r.getElementInnerHTML(S):r.getElementInnerHTML(S.querySelector("tbody")||S)},fe=B=>{B.elem.querySelectorAll("link[em-class]").forEach(S=>{B.elem.querySelector("."+S.getAttribute("em-class"))||S.remove()})};function Le(B){if(B&&B.charAt(0)==="r"){if(B.charAt(3)==="a")return B=B.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i),B&&B.length===4?"#"+("0"+parseInt(B[1],10).toString(16)).slice(-2)+("0"+parseInt(B[2],10).toString(16)).slice(-2)+("0"+parseInt(B[3],10).toString(16)).slice(-2):"";{B=B.replace("rgb(","").replace(")","").split(",");let S=parseInt(B[0],10).toString(16),m=parseInt(B[1],10).toString(16),F=parseInt(B[2],10).toString(16);return S=S.length===1?"0"+S:S,m=m.length===1?"0"+m:m,F=F.length===1?"0"+F:F,"#"+S+m+F}}else if(B&&B.charAt(0)==="#")return B}const eo=B=>{const S=B.elem.querySelectorAll("link"),m=`em-font-${B.fontFamilyArray[2].replace(/\s/g,"")}-${B.fontFamilyArray[3].replace(/\s/g,"")}`;if(!Array.from(S)?.find(H=>H.getAttribute("em-class")===m)){let H=document.createElement("link");H.setAttribute("rel","stylesheet"),H.setAttribute("href",`https://fonts.googleapis.com/css2?family=${B.fontFamilyArray[2]}:ital,wght@${Qe[B.fontFamilyArray[3]].indexOf("i")>-1?"1":"0"},${Qe[B.fontFamilyArray[3]].replaceAll("i","")}&display=swap`),H.setAttribute("em-class",m),B.elem.insertAdjacentElement("afterbegin",H)}Eo({elem:B.elem});let F=`font-family: '${B.fontFamilyArray[2]}', ${uo[B.fontFamilyArray[1]]}!important;`;F+=` font-weight: ${Qe[B.fontFamilyArray[3]].replaceAll("i","")}!important;`,Qe[B.fontFamilyArray[3]].indexOf("i")>-1&&(F+=" font-style: italic!important;"),B.elem.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
22
|
+
.em-font-${B.fontFamilyArray[2].replace(/\s/g,"")}-${B.fontFamilyArray[3].replace(/\s/g,"")} { ${F} }`),setTimeout(()=>fe({elem:B.elem}),0)},Xe=B=>{B.settings.border.all?B.settings.border.all.width!=null&&(B.settings.border.all.style||B.settings.border.all.color)?(B.elem.style.borderWidth=B.settings.border.all.width+"px",B.elem.style.borderStyle=B.settings.border.all.style,B.elem.style.borderColor=B.settings.border.all.color):B.elem.style.removeProperty("border"):(B.settings.border.top&&(B.settings.border.top.width!=null&&(B.settings.border.top.style||B.settings.border.top.color)?(B.elem.style.borderTopWidth=B.settings.border.top.width+"px",B.elem.style.borderTopStyle=B.settings.border.top.style,B.elem.style.borderTopColor=B.settings.border.top.color):B.elem.style.removeProperty("border-top")),B.settings.border.right&&(B.settings.border.right.width!=null&&(B.settings.border.right.style||B.settings.border.right.color)?(B.elem.style.borderRightWidth=B.settings.border.right.width+"px",B.elem.style.borderRightStyle=B.settings.border.right.style,B.elem.style.borderRightColor=B.settings.border.right.color):B.elem.style.removeProperty("border-right")),B.settings.border.bottom&&(B.settings.border.bottom.width!=null&&(B.settings.border.bottom.style||B.settings.border.bottom.color)?(B.elem.style.borderBottomWidth=B.settings.border.bottom.width+"px",B.elem.style.borderBottomStyle=B.settings.border.bottom.style,B.elem.style.borderBottomColor=B.settings.border.bottom.color):B.elem.style.removeProperty("border-bottom")),B.settings.border.left&&(B.settings.border.left.width!=null&&(B.settings.border.left.style||B.settings.border.left.color)?(B.elem.style.borderLeftWidth=B.settings.border.left.width+"px",B.elem.style.borderLeftStyle=B.settings.border.left.style,B.elem.style.borderLeftColor=B.settings.border.left.color):B.elem.style.removeProperty("border-left")))},lo=B=>{B.settings.borderRadius.all?B.elem.style.borderRadius=B.settings.borderRadius.all+"px":B.settings.borderRadius.all===""?B.elem.style.removeProperty("border-radius"):(B.settings.borderRadius.topLeft?B.elem.style.borderTopLeftRadius=B.settings.borderRadius.topLeft+"px":B.settings.borderRadius.topLeft===""&&B.elem.style.removeProperty("border-top-left-radius"),B.settings.borderRadius.topRight?B.elem.style.borderTopRightRadius=B.settings.borderRadius.topRight+"px":B.settings.borderRadius.topRight===""&&B.elem.style.removeProperty("border-top-right-radius"),B.settings.borderRadius.bottomRight?B.elem.style.borderBottomRightRadius=B.settings.borderRadius.bottomRight+"px":B.settings.borderRadius.bottomRight===""&&B.elem.style.removeProperty("border-bottom-right-radius"),B.settings.borderRadius.bottomLeft?B.elem.style.borderBottomLeftRadius=B.settings.borderRadius.bottomLeft+"px":B.settings.borderRadius.bottomLeft===""&&B.elem.style.removeProperty("border-bottom-left-radius"))},Qe={Thin:"100","Thin Italic":"100i",ExtraLight:"200","ExtraLight Italic":"200i",Light:"300","Light Italic":"300i",Regular:"400","Regular Italic":"400i",Medium:"500","Medium Italic":"500i",SemiBold:"600","SemiBold Italic":"600i",Bold:"700","Bold Italic":"700i",ExtraBold:"800","ExtraBold Italic":"800i",Black:"900","Black Italic":"900i"},uo={"Sans Serif":"sans-serif",Serif:"serif"};function Eo(B){if(!B.elem.querySelector('style[em="styles"]')){let S=document.createElement("style");S.setAttribute("em","styles"),B.elem.append(S)}}return(0,o.jsxs)("div",{className:(0,De.default)("blocks-search",{is_search:l}),children:[(0,o.jsx)(t.ui_kit$Form,{className:(0,De.default)("blocks-search__form",{is_search:l}),form:x,layout:"vertical",name:"blocks_search_form",initialValues:{...ka},onValuesChange:ie,autoComplete:"off",children:(0,o.jsx)(t.ui_kit$Form.Item,{name:hr,children:(0,o.jsx)(t.ui_kit$SearchInput,{placeholder:h("Search by title"),allowClear:!0,enterButton:!1})})}),(de||q||we)&&(0,o.jsx)(t.ui_kit$Alert,{title:h("Error"),description:h("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),l&&!Ye&&(0,o.jsx)("div",{className:"blocks-search__type-wrapper",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{"data-type":"",className:"active",onClick:Ee,children:h("All")},"search_All"),He.map(B=>(0,o.jsx)("li",{"data-type":B,onClick:Ee,children:h(r.TYPES_TRANSLATE[B])},"search_"+B))]})}),(0,o.jsxs)("div",{ref:C,className:(0,De.default)("blocks-search__result-wrapper",{is_search:l}),children:[(i==="project"||l)&&(0,o.jsxs)(o.Fragment,{children:[!!me.length&&!l&&(0,o.jsx)("div",{className:"blocks-search__type-wrapper",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{"data-type":"",className:"active",onClick:Ee,children:h("All")},"blocksSections_All"),me.map(B=>(0,o.jsx)("li",{"data-type":B,onClick:Ee,children:h(r.TYPES_TRANSLATE[B])},"blocksSections_"+B))]})}),(0,o.jsxs)("div",{className:(0,De.default)("blocks-search__blocks-wrapper",{is_search:l}),ref:G,children:[(0,o.jsx)("div",{className:"blocks-search__result-holder project",children:!(Fe||je)&&(ee?.length?ee.map((B,S)=>{const m=pr(B.id,B.html);return(0,o.jsx)("div",{className:"blocks-search__result","data-type":B.type,children:(0,o.jsx)(t.ui_kit$Dropdown,{placement:"leftTop",menu:{items:y(B)},styles:{root:{minWidth:"auto",paddingRight:6}},children:(0,o.jsxs)("div",{className:"ant-card-hoverable blocks-search__result-body",draggable:!0,onClick:F=>p(F,B.html,"project",B.title,B),onDragStart:F=>f(F,B.html,"project",B.title,B),onMouseEnter:()=>We({html:B.html,title:B.title}),onMouseLeave:Ge,children:[O(B),(0,o.jsx)(r.BlockPreviewShadow,{className:"blocks-search__result-html",html:m,onContentLoad:Y,style:{transform:`scale(${U})`}})]})},"commenMenu")},B.id+S.toString())}):!(ae.tags||ae.name||ae.type)&&Ce&&!(Fe||je)&&!l&&(0,o.jsxs)("div",{style:{padding:"10px 0 20px",display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,o.jsxs)("div",{style:{width:"110%"},children:[(0,o.jsx)("h3",{style:{lineHeight:"1.2"},children:h("You don`t have any saved blocks yet.")}),h("To add a block from the dashboard click the"),' "',h("Save to Blocks button."),'" ',(0,o.jsx)(r.EmIcons,{icon:"SaveBlock",component:t.icons$SaveBlock,style:{position:"relative",top:"2px"}}),(0,o.jsx)("br",{}),(0,o.jsx)("br",{}),h("You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving."),(0,o.jsx)("br",{}),(0,o.jsx)("br",{}),(0,o.jsx)(t.ui_kit$Flex,{justify:"left",children:(0,o.jsx)(t.ui_kit$Button,{type:"primary",onClick:()=>a(!0),style:{cursor:"pointer"},children:h("Save all blocks")})})]}),(0,o.jsx)("div",{style:{width:"80px",height:"200px"},children:(0,o.jsx)("img",{src:Ju,style:{display:"block",width:80,position:"absolute",right:5}})})]}))}),(Fe||je)&&(0,o.jsx)(t.ui_kit$Skeleton,{active:!0})]})]}),l&&re?.length>0&&v?.length>0&&(0,o.jsx)(t.ui_kit$Divider,{className:"blocks-search__result-divider"}),(i==="template"||l)&&(0,o.jsxs)(o.Fragment,{children:[!!Ne.length&&!l&&(0,o.jsx)("div",{className:"blocks-search__type-wrapper",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{"data-type":"",className:"active",onClick:Ee,children:h("All")},"templateBlocksSections_All"),Ne.map(B=>(0,o.jsx)("li",{"data-type":B,onClick:Ee,children:h(r.TYPES_TRANSLATE[B])},"templateBlocksSections_"+B))]})}),(0,o.jsxs)("div",{className:(0,De.default)("blocks-search__blocks-wrapper",{is_search:l}),ref:J,children:[(0,o.jsxs)("div",{className:"blocks-search__result-holder template",children:[v&&!(se||xe)&&ge?.length?(0,o.jsx)(o.Fragment,{children:ge.map((B,S)=>{const m=pr(B.id,B.html);return(0,o.jsx)("div",{className:"blocks-search__result","data-type":B.type,children:(0,o.jsxs)("div",{className:"ant-card-hoverable blocks-search__result-body",draggable:!0,onClick:F=>p(F,B.html,"template",B.title,B),onDragStart:F=>f(F,B.html,"template",B.title,B),onMouseEnter:()=>We({html:B.html,title:B.title}),onMouseLeave:()=>Ge(),children:[O(B),(0,o.jsx)(r.BlockPreviewShadow,{className:"blocks-search__result-html",html:m,onContentLoad:Y,style:{transform:`scale(${U})`}})]})},B.id+S.toString())})}):!l&&!V&&!xe&&(0,o.jsx)("div",{className:"blocks-search__type",style:{padding:"10px 0 20px"},children:h("No related blocks found.")})," "]}),(se||xe)&&(0,o.jsx)(t.ui_kit$Skeleton,{active:!0})]})]}),l&&v?.length>0&&Ie?.length>0&&(0,o.jsx)(t.ui_kit$Divider,{className:"blocks-search__result-divider"}),(i==="common"||l)&&(0,o.jsxs)(o.Fragment,{children:[!!Ve?.length&&!l&&(0,o.jsx)("div",{className:"blocks-search__type-wrapper",children:(0,o.jsxs)("ul",{children:[(0,o.jsx)("li",{"data-type":"",className:"active",onClick:Ee,children:h("All")},"commonBlocksSections_All"),Ve.map(B=>(0,o.jsx)("li",{"data-type":B,onClick:Ee,children:h(r.TYPES_TRANSLATE[B])},"commonBlocksSections_"+B))]})}),(0,o.jsxs)("div",{className:(0,De.default)("blocks-search__blocks-wrapper",{is_search:l}),ref:te,children:[(0,o.jsxs)("div",{className:"blocks-search__result-holder common",children:[ne&&!!ve?.length&&!(Te||V)&&(0,o.jsx)(o.Fragment,{children:ve.map((B,S)=>{const m=M({html:pr(B.id,B.html)});return(0,o.jsx)("div",{className:"blocks-search__result","data-type":B.type,children:(0,o.jsxs)("div",{className:"ant-card-hoverable blocks-search__result-body",draggable:!0,onClick:F=>p(F,M({html:B.html}),"common",B.title,B),onDragStart:F=>f(F,M({html:B.html}),"common",B.title,B),onMouseEnter:()=>We({html:M({html:r.sanitizeHtml('<table cellspacing="0" cellpadding="0" border="0" width="100%">'+B.html+"</table>")}),title:B.title}),onMouseLeave:()=>Ge(),children:[O(B),(0,o.jsx)(r.BlockPreviewShadow,{className:"blocks-search__result-html",html:m,onContentLoad:Y,style:{transform:`scale(${U})`}})]})},B.id+S.toString())})})," "]}),(V||Te)&&(0,o.jsx)(t.ui_kit$Skeleton,{active:!0})]})]}),Ye&&(0,o.jsx)("div",{className:"blocks-search__type",style:{padding:"10px 0 20px"},children:h("There are no blocks for this request.")})]})]})};br.propTypes={};var Ea=({comments:e,subjectId:i,isLoggedIn:l,projectTitle:s="",emailElementType:a,email:d})=>{const{__:c,_n:p}=r.useI18n(),f=r.useSendPostMessage(),x=r.useNotification(),{token:k}=(0,t.ui_kit$useToken)(),b=r.useAppConfig(),h=r.usePushToDataLayer(),T=(0,n.useRef)(null),[_,E]=(0,n.useState)(""),[w,v]=(0,n.useState)("ADD"),[P,j]=(0,n.useState)(!1),[C,I]=(0,n.useState)(null),[K,U]=(0,n.useState)(null),[O,L]=(0,n.useState)(""),[R,G]=(0,n.useState)(""),[J,te]=(0,n.useState)(!1),[oe,he]=(0,n.useState)(""),[be,ae]=r.useAddCommentMutation(),[ke,Ce]=r.useDeleteCommentMutation(),[de,Fe]=r.useEditCommentMutation(),[je,re]=r.useDeleteTargetMutation(),[Be]=r.useAutoSaveBlockMutation(),ce=r.useDispatch(),ee=r.useStore(),me=r.useCurrentUser(),ue=r.useCurrentProjectRequested(),Z=r.useContentReader(),Q=le=>{const Y=r.getEmailDocuments(xo.getContainer(ee));Y.save("anchor",{project:le}).then(D=>{const ie=D?Y.revisionFacts()?.lastRevisionAt:void 0;ie!==void 0&&d?.id!=null&&ce(r.rememberAutosaveTime({emailId:d.id,modified:new Date(ie).toISOString()}))})},W=()=>{const le=ue;if(a==="email"){Q(le);return}const Y={...d?.meta!==void 0?{meta:d.meta}:{},title:d?.title,emailId:d?.id,project:le,html:Z(),excerpt:d?.date_gmt};Be({blockId:d?.id,body:Y}).catch(D=>{})};function q(le){te(!1),he(""),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_REMOVE_TARGET,value:oe}),j(!0),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_SET_TARGET,value:!0})}function se(){U(C),e.filter(le=>le.parent===C).length?de({commentId:C,status:"deleted"}).unwrap():ke(C),document.querySelector('.discuss-main li[id="'+C+'"] .comment-icon-target')?.getAttribute("target-id")&&f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_REMOVE_TARGET,value:document.querySelector('.discuss-main li[id="'+C+'"] .comment-icon-target')?.getAttribute("target-id")}),W(),he("")}function xe(le){U(C);const Y=e.find(ie=>ie.id?.toString()===C),D=Y?.target_id?.toString()||"";te(!!D),he(D),G(Y?.content?.slice(3,-5)?.toString()),v("EDIT")}function ge(le){U(C),L(""),v("REPLY")}const Ne=()=>{x.error({mask:{closable:!0},centered:!0,title:c("Please log in"),content:(r.isUseBlocksBuild()?c("To leave comments you must be logged into Blocks and added to the project "):c("To leave comments you must be logged into EmailMaker and added to the project "))+`${s}.`,okText:c("Okay. I'll log in.")})};async function ye(){l?(await de({commentId:K,content:R,targetId:oe}).unwrap(),v("ADD"),G(""),U(0),te(!1),j(!1),he(""),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_RESET})):Ne()}const $e=le=>{v("ADD"),G(""),U(0),te(!1),j(!1),he(""),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_RESET})},X=async()=>{l?((_||O)&&await be({subjectId:i,author:me.id,parent:w==="ADD"?"0":K,content:_||O,author_name:me.name,author_email:me.email,targetId:oe}).then(le=>{le.error?x.error({title:le.error.data.code,description:le.error.data.message}):h({event:"submit",action:"send_discussion_chat_message",entity_type:a==="block"?"block":"email",entity_id:d?.id,project_id:d?.project,context:"editor"})}),he(""),v("ADD"),L(""),E(""),U(0),te(!1),j(!1),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_RESET})):Ne()};function ne(){J?(j(!1),te(!1),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_REMOVE_TARGET,value:oe})):(j(!P),f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_SET_TARGET,value:!P}),P&&te(!1))}function we(le){let Y=JSON.parse(JSON.stringify(le));if(!Y||!Y.length)return[];let D=[],ie=new Map;for(let Ee=0,Ae=Y.length;Ee<Ae;++Ee){let We=Y[Ee],Ge=ie.get(We.id);if((!Ge||Array.isArray(Ge))&&(Ge&&(We.children=Ge),ie.set(We.id,We)),String(We.parent)==="0")D.push(We);else{let Ye=ie.get(We.parent);Ye?(Array.isArray(Ye)?Ye:Ye.children=Ye.children||[]).push(We):ie.set(We.parent,[We])}}return D.forEach(Ee=>{Ee.status==="deleted"&&!Ee.children&&(Ce.isUninitialized||Ce.isSuccess)&&ke(Ee.id).unwrap().catch(Ae=>{})}),D}const V=le=>{const Y=le.data.operation;if(Y===r.EVENT_TYPES.APPLICATION_DISCUSS_SET_ID&&(he(le.data.settings.value),le.data.settings.value!==""?(te(!0),j(!1)):(te(!1),j(!0))),Y===r.EVENT_TYPES.APPLICATION_DISCUSS_SAVE_TARGET&&W(),Y===r.EVENT_TYPES.APPLICATION_DISCUSS_GET_COMMENT)if(document.querySelector('.comment-icon-target[target-id="'+le.data.settings.targetId+'"]')){let D=document.querySelector('.comment-icon-target[target-id="'+le.data.settings.targetId+'"]').closest(".ant-comment");document.querySelector(".comment-block")?document.querySelector(".comment-block").scrollTo(0,D.offsetTop):document.querySelector(".em-analytics__email-tab-discuss .ant-tabs-content").scrollTo(0,D.offsetTop),D.classList.add("active"),setTimeout(()=>{D.classList.remove("active")},2e3)}else f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_REMOVE_TARGET,value:le.data.settings.targetId}),x.error({title:c("There's no such comment.")});Y===r.EVENT_TYPES.APPLICATION_DISCUSS_NO_COMMENT&&x.error({title:c("There's no such element in the email.")})};r.useListenPostMessage(V);const Te=le=>{f({operation:r.EVENT_TYPES.SANDBOX_DISCUSS_GET_TARGET,value:le})},Ie=le=>(le?.sort((Y,D)=>Y.date>D.date?1:-1),(0,o.jsx)(o.Fragment,{children:le&&!!le.length&&(0,o.jsx)(t.ui_kit$List,{className:"comment-list",itemLayout:"horizontal",dataSource:le,renderItem:Y=>(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("li",{id:Y.id,children:(0,o.jsxs)(o.Fragment,{children:[Y.status==="deleted"&&Y.clildren&&(0,o.jsx)(t.ui_kit$Comment,{className:"deletedComment",content:(0,o.jsx)(t.ui_kit$Alert,{description:c("Comment was removed."),type:"info"}),children:Ie(Y.children)}),Y.status!=="deleted"&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(t.ui_kit$Comment,{author_id:Y.author_id,author:Y.author_name,avatar:Y.author_avatar_urls&&Y.author_avatar_urls[48]||"",className:(0,De.default)(Y.target_id&&"targetted-comment-item",(!Y.author_avatar_urls||!Y.author_avatar_urls[48])&&"comment-item-noavatar"),content:(0,o.jsx)(t.ui_kit$Dropdown,{placement:"left",destroyPopupOnHide:!0,onOpenChange:()=>I(Y.id),menu:{items:Y.author===me.id?Me:He},styles:{root:{minWidth:"auto",paddingRight:6}},children:(0,o.jsx)("div",{onClick:()=>Y.target_id&&Te(Y.target_id),dangerouslySetInnerHTML:{__html:Y.content}})},"commenMenu"),datetime:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:Y.date&&wo.formatDate(wo.tryParseISO(Y.date),p,!0)}}),Y.target_id&&(0,o.jsx)("span",{className:"comment-icon-target","target-id":Y.target_id,onClick:()=>Te(Y.target_id),children:(0,o.jsx)(r.EmIcons,{icon:"AimOutlined",component:t.icons$AimOutlined,style:{color:k.colorInfo,top:-2,position:"relative"}})})]}),children:(0,o.jsxs)(o.Fragment,{children:[w==="REPLY"&&K===Y.id&&Ve,w==="EDIT"&&K===Y.id&&ve,Ie(Y.children)]})})})]})})})})})),ve=(0,o.jsxs)(t.ui_kit$Form,{onFinish:ye,className:"commentForm",children:[(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:10},children:(0,o.jsx)(t.ui_kit$TextArea,{className:"textarea-reply",value:R,onChange:le=>G(le.target.value),rows:4,placeholder:c("Editing comments"),onKeyDown:le=>le.key==="Escape"&&$e(),onPressEnter:le=>le.key==="Enter"&&le.ctrlKey&&ye(),ref:T})}),(0,o.jsx)(t.ui_kit$Form.Item,{className:"buttons",children:(0,o.jsxs)(t.ui_kit$Space,{children:[J?(0,o.jsx)(t.ui_kit$Popconfirm,{title:c("Are you sure?"),okText:c("Yes"),cancelText:c("No"),onConfirm:q,children:(0,o.jsx)(t.ui_kit$Button,{loading:re.isLoading,type:P||J&&w==="EDIT"&&oe!==""?"primary":"default",className:"button-target "+(P&&!J?"button-target_choose":""),style:J&&w==="EDIT"&&oe!==""?{background:k.colorInfo}:{},children:(0,o.jsx)(r.EmIcons,{icon:"AimOutlined",component:t.icons$AimOutlined,className:"icon-target"})})}):(0,o.jsx)(t.ui_kit$Button,{onClick:ne,loading:re.isLoading,type:P||J&&w==="EDIT"&&oe!==""?"primary":"default",className:"button-target "+(P&&!J?"button-target_choose":""),style:J&&w==="EDIT"&&oe!==""?{background:k.colorInfo}:{},children:(0,o.jsx)(r.EmIcons,{icon:"AimOutlined",component:t.icons$AimOutlined,className:"icon-target"})}),(0,o.jsxs)(t.ui_kit$Button,{className:"button-reply",type:"primary",loading:Fe.isLoading,htmlType:"submit",children:[c("Save")," ",(0,o.jsx)(r.EmIcons,{icon:"SaveOutlined",component:t.icons$SaveOutlined,size:16,strokeWidth:b.iconStrokeWidth})]}),(0,o.jsx)(t.ui_kit$Button,{onClick:$e,className:"button-reply",children:c("Cancel")})]})})]}),Ve=(0,o.jsxs)(t.ui_kit$Form,{name:"reply",className:"commentForm",onFinish:X,children:[(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:10},children:(0,o.jsx)(t.ui_kit$TextArea,{className:"textarea-reply",value:O,onChange:le=>L(le.target.value),rows:4,placeholder:c("Reply to the comment"),onKeyDown:le=>le.key==="Escape"&&$e(),onPressEnter:le=>le.key==="Enter"&&le.ctrlKey&&X(),ref:T})}),(0,o.jsx)(t.ui_kit$Form.Item,{hidden:!0,name:"targetId",children:(0,o.jsx)(t.ui_kit$Input,{type:"hidden"})}),(0,o.jsx)(t.ui_kit$Form.Item,{className:"buttons",children:(0,o.jsxs)(t.ui_kit$Space,{children:[(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:c("Add a note"),styles:{body:{maxWidth:"150px"}},children:(0,o.jsx)(t.ui_kit$Button,{onClick:ne,type:P||J&&w==="REPLY"&&oe!==""?"primary":"default",className:"button-target "+(P&&!J?"button-target_choose":""),style:J&&w==="REPLY"&&oe!==""?{background:k.colorInfo}:{},children:(0,o.jsx)(r.EmIcons,{icon:"AimOutlined",component:t.icons$AimOutlined,className:"icon-target"})})}),(0,o.jsxs)(t.ui_kit$Button,{className:"button-reply",type:"primary",loading:w==="REPLY"&&ae.isLoading,htmlType:"submit",children:[c("Reply")," ",(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined,size:16,strokeWidth:b.iconStrokeWidth})]}),(0,o.jsx)(t.ui_kit$Button,{onClick:$e,className:"button-reply",ghost:!0,type:"primary",children:c("Cancel")})]})})]});(0,n.useEffect)(()=>{w==="REPLY"&&T.current.focus({cursor:"start"}),w==="EDIT"&&T.current.focus({cursor:"end"})},[w]);let Me=[];Me.push({key:"Reply to comment",icon:(0,o.jsx)(r.EmIcons,{icon:"RollbackOutlined",component:t.icons$RollbackOutlined,style:{fontSize:"16px"}}),label:c("Reply"),onClick:ge},{key:"Edit comment",icon:(0,o.jsx)(r.EmIcons,{icon:"EditOutlined",component:t.icons$EditOutlined,style:{fontSize:"16px"}}),label:c("Edit"),onClick:xe},{key:"Delete comment",icon:(0,o.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:t.icons$DeleteOutlined,size:16}),label:c("Delete"),style:{color:k.colorError},onClick:se});let He=[];return He.push({key:"Reply to comment",icon:(0,o.jsx)(r.EmIcons,{icon:"RollbackOutlined",component:t.icons$RollbackOutlined,style:{fontSize:"16px"}}),label:c("Reply"),onClick:ge}),(0,o.jsxs)("div",{className:"discuss-main",children:[e.length>0&&(0,o.jsx)(t.ui_kit$List,{className:"comment-list",itemLayout:"horizontal",dataSource:we(e),renderItem:le=>(0,o.jsxs)("li",{id:le.id,children:[le.comment_status==="deleted"&&(0,o.jsx)(t.ui_kit$Comment,{className:"deletedComment",content:(0,o.jsx)(t.ui_kit$Alert,{description:c("Comment was removed."),type:"info"}),children:Ie(le.children)}),le.comment_status!=="deleted"&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(t.ui_kit$Comment,{author_id:le.author_id,author:le.author_name,avatar:le.author_avatar_urls&&le.author_avatar_urls[48]||"",className:(0,De.default)(le.target_id&&"targetted-comment-item",(!le.author_avatar_urls||!le.author_avatar_urls[48])&&"comment-item-noavatar"),content:(0,o.jsx)(t.ui_kit$Dropdown,{placement:"left",destroyPopupOnHide:!0,onOpenChange:()=>I(le.id),menu:{items:le.author===me.id?Me:He},styles:{root:{minWidth:"auto"}},children:(0,o.jsx)("div",{onClick:()=>le.target_id&&Te(le.target_id),dangerouslySetInnerHTML:{__html:le.content}})},"commenMenu"),datetime:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:le.date&&wo.formatDate(wo.tryParseISO(le.date),p,!0)}}),le.target_id&&(0,o.jsx)("span",{className:"comment-icon-target","target-id":le.target_id,onClick:()=>Te(le.target_id),children:(0,o.jsx)(r.EmIcons,{icon:"AimOutlined",component:t.icons$AimOutlined,style:{color:k.colorInfo,top:-2,position:"relative"}})})]}),children:(0,o.jsxs)(o.Fragment,{children:[w==="REPLY"&&K===le.id&&Ve,w==="EDIT"&&K===le.id&&ve,Ie(le.children)]})})})]})}),(0,o.jsxs)(t.ui_kit$Form,{onFinish:X,className:w==="ADD"?"addMode":"replyEditMode",children:[(0,o.jsx)(t.ui_kit$Form.Item,{style:{marginBottom:10},children:(0,o.jsx)(t.ui_kit$TextArea,{value:_,onChange:le=>E(le.target.value),rows:4,placeholder:c("Leave your comment"),className:"textarea-comment",onPressEnter:le=>le.key==="Enter"&&le.ctrlKey&&X()})}),(0,o.jsx)(t.ui_kit$Form.Item,{children:(0,o.jsxs)(t.ui_kit$Space,{size:8,children:[(0,o.jsx)(t.ui_kit$Tooltip,{placement:"top",title:c("Add a note"),styles:{body:{maxWidth:"150px"}},children:(0,o.jsx)(t.ui_kit$Button,{onClick:ne,type:P||J&&w==="ADD"&&oe!==""?"primary":"default",className:"button-target "+(P&&!J?"button-target_choose":""),style:J&&w==="ADD"&&oe!==""?{background:k.colorInfo}:{},icon:(0,o.jsx)(r.EmIcons,{icon:"Target",component:t.icons$Target,size:16,strokeWidth:b.iconStrokeWidth,className:"icon-target"})})}),(0,o.jsxs)(t.ui_kit$Button,{className:"button-add",type:"primary",loading:w==="ADD"&&ae.isLoading,htmlType:"submit",children:[c("Send")," ",(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined,size:16,strokeWidth:b.iconStrokeWidth})]})]})})]})]})},em=["common_styles","subject","preheader","meta"];function om(e,i){r.writeSourceReport(e,r.fromRevision(i))}function tm(e){if(!e)return null;const i=e.get().attributes??{},l={};for(const s of em)i[s]!==void 0&&(l[s]=i[s]);return{content:e.getContent(),attributes:l}}function Ba(e,i){i&&r.writeSourceReport(e,{content:i.content,attributes:i.attributes})}var Sa=(e,i)=>({key:e.id,author:e.author,date:wo.formatDate(wo.tryParseISO(e.date||e.modified),i),title:e.title,html:e.html,common_styles:e.common_styles,loading:!1,isAutosave:e.isAutosave===!0}),fr=({emailElement:e})=>{const{__:i}=r.useI18n(),l=r.useSendPostMessage(),s=r.useDispatch(),a=r.useEditorProjectId(),d=r.useEmailAttributesWriter(),c=r.useContentReplacer(),{document:p}=r.useDocumentSessionContext(),f=r.useSelector(r.selectHistoryData),x=r.useDocumentHistoryReader(),k=r.useSelector(r.selectElementHistoryHasMore),b=r.useSelector(r.selectIsPanelHistoryCollapsed),[h,T]=(0,n.useState)(!0),[_,E]=(0,n.useState)(!1),[w,v]=(0,n.useState)([]),[P,j]=(0,n.useState)([]),C=je=>s(r.switchIsPanelHistoryCollapsed(je)),I=(0,n.useCallback)(je=>{if(!je?.html)return;const re=r.fromRevision(je);re?.attributes&&d(re.attributes),s(r.markAppearanceNeedsUpdate());const Be=p?.get().version;c(je.html,{undoable:!0}),p&&p.get().version===Be&&p.markUnsaved()},[c,s,d,p]),K=(0,n.useCallback)(je=>{om(p,je),s(r.markAppearanceNeedsUpdate())},[p,s]),{data:U}=r.projectsApi.useGetProjectQuery(Number(a),{skip:!a}),[O,L]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(U){const{owner:je,admins:re,users:Be}=U?.members;L([je&&{...je},re&&Array.isArray(re)&&re.map(ce=>({...ce})),Be&&Array.isArray(Be)&&Be.map(ce=>({...ce}))].filter(ce=>ce).flat(1).map(ce=>({id:ce.ID,display_name:ce.display_name})))}},[U,U?.members,i]);const[R,G]=(0,n.useState)(1),[J,te]=(0,n.useState)(!1);(0,n.useEffect)(()=>{const je=Array.isArray(f)&&f.length&&f?.map(re=>Sa(re,i));j(je||[]),v(je),T(!1),k||te(!0)},[f,k,i]);const oe=()=>{E(!0),j(w.concat([...new Array(3)].map(()=>({loading:!0})))),x(e.id,R+1).then(je=>{const{data:re,hasMore:Be}=je.data,ce=Array.isArray(re)&&re?.map(me=>Sa(me,i)),ee=w.concat(ce);j(ee),v(ee),E(!1),window.dispatchEvent(new Event("resize")),Be||te(!0),G(R+1)})},he=!h&&!_&&!J?(0,o.jsx)("div",{style:{textAlign:"center",marginTop:24,marginBottom:24,height:32,lineHeight:"32px"},children:(0,o.jsx)(t.ui_kit$Button,{onClick:oe,children:i("loading more")})}):null,[be,ae]=(0,n.useState)(),[ke,Ce]=(0,n.useState)(null),de=(0,n.useCallback)(je=>{I(je),ae(null),Ce(null),l({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),s(r.resetToLastActiveSettingsTab())},[I,l,s]);(0,n.useEffect)(()=>{!b&&!ke&&Ce(tm(p))},[b,Ce,p,ke]),(0,n.useEffect)(()=>{b&&ke&&(Ba(p,ke),s(r.markAppearanceNeedsUpdate()),Ce(null))},[b,ke,p,s]);const Fe=r.useAppConfig();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse secondary-tabs_unset_scroll",size:"large",activeKey:r.HISTORY,items:[{label:(0,o.jsx)(o.Fragment,{children:i("Version history")}),key:r.HISTORY,forceRender:!0,className:"email-settings__collapse-panel",style:{height:"100%"},children:(0,o.jsx)(t.ui_kit$List,{className:"history-panel__list",loading:h,itemLayout:"horizontal",loadMore:he,dataSource:P,header:(0,o.jsxs)("div",{className:"history-panel__list-header",children:[(0,o.jsx)("div",{className:"history-panel__list-date",children:i("Time")}),(0,o.jsx)("div",{className:"history-panel__list-author",children:i("Author")}),(0,o.jsx)("div",{className:"history-panel__restore",children:"Set"})]}),renderItem:(je,re)=>(0,o.jsx)(t.ui_kit$List.Item,{onClick:()=>{re!==be&&(ae(re),K(w[re])),s(r.setBlockSettingsDisable(!0))},className:(0,De.default)("history-panel__item",{"history-panel__item_active":re===be}),children:(0,o.jsxs)(t.ui_kit$Skeleton,{title:!1,loading:je.loading||!1,active:!0,children:[(0,o.jsx)("div",{className:"history-panel__list-date",children:je.date}),(0,o.jsx)("div",{className:"history-panel__list-author",children:Fe.revisionService?je.author:O.find(Be=>Be.id?.toString()===je.author?.toString())?.display_name||"–"}),je.isAutosave&&be!==re&&(0,o.jsx)("div",{style:{opacity:.45},className:"history-panel__list-autosave",children:i("Auto")}),!je.isAutosave&&(0,o.jsx)(t.ui_kit$Button,{size:"small",className:"history-panel__restore",type:"link",onClick:Be=>{be===re&&Be.stopPropagation(),de(w[re])},children:i("Set")}),je.isAutosave&&be===re&&(0,o.jsx)(t.ui_kit$Button,{size:"small",className:"history-panel__restore",type:"link",onClick:Be=>{be===re&&Be.stopPropagation(),de(w[re])},children:i("Set")})]})})})}]}),(0,o.jsx)(t.ui_kit$Button,{type:"text",className:"ant-modal-close","aria-label":"Close",onClick:()=>{s(r.resetToLastActiveSettingsTab()),ke&&Ba(p,ke),Ce(null),C(!0),l({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})},children:(0,o.jsx)(r.EmIcons,{icon:"Close",component:t.icons$Close})})]})};fr.propTypes={};var Ta=async({blockTags:e,projectTagsArray:i,addTerm:l,project:s,notification:a})=>{if(!e||e.length===0)return[];const d=e.map(c=>{const p=i.find(f=>f.name===c);return p?Promise.resolve(p.id):l({project:s,kind:r.BLOCK_TAGS,name:c}).then(({error:f,data:x})=>{if(f?.status===400)return r.existingTermIdFromError(f);if(x)return x.id;if(f)return a.fromError("TAG_CREATING_ERROR",c,f),null})});return(await Promise.all(d)).filter(c=>c!=null)},Ra=()=>{document.querySelector(".blocks-search__blocks-wrapper")&&(document.querySelector(".blocks-search__blocks-wrapper").style.removeProperty("transition"),document.querySelector(".blocks-search__blocks-wrapper").style.opacity=0,document.querySelectorAll(".blocks-search__result-body").forEach(e=>e.style.removeProperty("height")),setTimeout(()=>{document.querySelectorAll(".blocks-search__result-body").forEach(e=>{e.style.height=e.offsetHeight*207/640+"px"}),document.querySelector(".blocks-search__blocks-wrapper")&&(document.querySelector(".blocks-search__blocks-wrapper").style.transition="opacity 0.2s",document.querySelectorAll(".blocks-search__blocks-wrapper").forEach(e=>e.style.opacity=1))},1500))},im=async e=>{const{block:i,form:l,projectData:s,projectTagsArray:a,projectId:d,addBlock:c,editBlock:p,editProject:f,addTerm:x,notification:k,__:b,handleCloseModal:h,htmlContent:T,refetchBlocks:_,reloadBlockScreens:E,onGlobalBlockTemplateSynced:w}=e;try{const{valid:v,values:P,blockTags:j}=await ya({form:l,notification:k,__:b});if(!v)return;const C=await Ta({blockTags:j,projectTagsArray:a,addTerm:x,project:s,notification:k});await ja({block:i,form:l,projectId:d,htmlContent:T,values:P,tagIds:C,addBlock:c,editBlock:p,editProject:f,notification:k,refetchBlocks:_,reloadBlockScreens:E,projectTagsArray:a,__:b,handleCloseModal:h,onGlobalBlockTemplateSynced:w})}catch{}},ya=async({form:e,notification:i,__:l})=>{let s=!0;const a=await e.validateFields(),d=a.tags;return d?.length>10&&(i.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",data:r.getBlockDesc(a),title:l("Maximum 10 tags available.")}),s=!1),{valid:s,values:a,blockTags:d}};function wa(e){if(e!==null&&typeof e=="object"&&"data"in e){const i=e.data;return{code:i?.code,message:i?.message}}return{}}async function rm(e){const{created:i,blockData:l,editBlock:s,onGlobalBlockTemplateSynced:a}=e;if(!i.id)return;const d=new Date,c=r.formatEmBlockVersion(d);if(s){const p=i.html??l.html??"",f=r.injectEmBlockIdIntoBlockHtml(p,String(i.id),d);f!==p&&await s({blockId:String(i.id),html:f})}a?.(String(i.id),c)}function lm(e){const{block:i,projectId:l,htmlContent:s,values:a}=e;return i?{title:i.blockTitle,project:i.projectId,html:i.htmlContent,type:i.blockType||"Other",global_block:!1}:{title:a?.title??"",project:l,html:s||"",type:a?.type||"Other",...a?.global_block===!0?{global_block:!0}:{}}}var ja=async({block:e,form:i,projectId:l,htmlContent:s,values:a,tagIds:d,addBlock:c,editBlock:p,editProject:f,notification:x,refetchBlocks:k,reloadBlockScreens:b,projectTagsArray:h,__:T,handleCloseModal:_,onGlobalBlockTemplateSynced:E})=>{const w=lm({block:e,projectId:l,htmlContent:s,values:a}),v=await c({...w,blocktags:d.join(",")});if(v.error){const I=wa(v.error);throw x.error({id:"BLOCK_CREATING_ERROR",data:{title:w.title,code:w.html},innerException:v.error,message:I.code,description:I.message}),i.resetFields(),_(),new Error("Ошибка создания блока")}const P=v.data;!e&&a?.global_block===!0&&P?.id&&await rm({created:P,blockData:w,editBlock:p,onGlobalBlockTemplateSynced:E}),e||(i.resetFields(),_());const j=h.map(I=>I.id),C=await f({projectId:l,blocktags:[...new Set([...j,...d])].join(",")});if(C.error){const I=wa(C.error);x.error({message:I.message,code:I.code})}else!e&&k&&(x.success({id:"BLOCK_CREATING_SUCCESS",data:r.getBlockDesc(v.data),message:T("The block “")+String(v.data?.title??"")+T("” was successfully created.")}),k());return!e&&b&&b(),v.data},gr=({isModalVisible:e,htmlContent:i,projectId:l,setIsShowAddAllBlocksModal:s,setIsShowAddAllBlocksModalForNewEmail:a})=>{const{__:d}=r.useI18n(),c=r.useDispatch(),[p]=t.ui_kit$Form.useForm(),[f,x]=(0,n.useState)([]),[k,b]=r.useAddBlockMutation(),[h]=r.useEditBlockMutation(),{data:T}=r.useGetBlocksSchemaQuery(),_=r.useNotification(),E=r.useAppConfig(),[w,v]=(0,n.useState)([]),P=r.useProjectData(),{refetch:j}=r.useGetBlocksQuery(r.projectBlocksArgs(l)),[C,I]=r.useAddTermMutation(),[K,U]=r.useEditProjectMutation(),O=r.useSendPostMessage(),L=(0,n.useCallback)((oe,he)=>{O({operation:r.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:oe,...he?{emBlockVersion:he}:{}}})},[O]),{data:R}=r.useGetTermsQuery({project:P,kind:r.BLOCK_TAGS},{skip:!P?.id});(0,n.useEffect)(()=>{v((R||[]).map(oe=>({value:oe.name})))},[R]),(0,n.useEffect)(()=>{if(T){const oe=T.schema.properties.acf.properties.type.items.enum;let he=[];for(let be in oe)he.push({label:d(r.TYPES_TRANSLATE[oe[be]]),value:oe[be]});x(he)}},[T,d]);const G=()=>{c(r.closeModal())},J=()=>{s(!0),a(!1),G()},te=async()=>{await im({form:p,projectData:P,projectTagsArray:R||[],projectId:l,addBlock:k,editBlock:h,editProject:K,addTerm:C,notification:_,__:d,handleCloseModal:G,htmlContent:i,refetchBlocks:j,reloadBlockScreens:Ra,onGlobalBlockTemplateSynced:L})};return(0,o.jsx)(t.ui_kit$Modal,{title:(0,o.jsx)("div",{className:"ant-modal-title",children:d("Save block")}),open:e,onOk:()=>J(),onCancel:G,footer:(0,o.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"8px 0"},children:[(0,o.jsx)(t.ui_kit$Button,{size:"large",onClick:J,children:d("Save all blocks")},"create-all-blocks"),(0,o.jsx)(t.ui_kit$Button,{className:"add-new-block-modal__save-btn",size:"large",type:"primary",loading:b.isLoading,onClick:te,icon:(0,o.jsx)(r.EmIcons,{icon:"CreateBlock",component:t.icons$CreateBlock,style:{fontSize:22}}),children:d("Save block")},"submit")]}),children:(0,o.jsxs)(t.ui_kit$Form,{form:p,layout:"vertical",name:"add_new_block_form",onFinish:te,initialValues:{title:"",type:"",tags:[],global_block:!1},autoComplete:"off",children:[(0,o.jsxs)(t.ui_kit$Row,{gutter:16,children:[(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:d("Block name"),name:"title",rules:[{required:!0,message:d("Please input block name")}],style:{marginBottom:15},children:(0,o.jsx)(t.ui_kit$Input,{disabled:b.isLoading||I.isLoading||U.isLoading,size:"large",placeholder:d("Enter block name"),spellCheck:"false"})})}),(0,o.jsx)(t.ui_kit$Col,{span:12,children:(0,o.jsx)(t.ui_kit$Form.Item,{label:d("Type"),name:"type",rules:[{required:!0,message:d("Please choose block type")}],style:{marginBottom:15},children:(0,o.jsx)(t.ui_kit$Select,{disabled:b.isLoading||I.isLoading||U.isLoading,size:"large",placeholder:d("Choose block type"),options:f})})})]}),E.tagsEnabled&&(0,o.jsx)(t.ui_kit$Form.Item,{label:d("Tags"),name:"tags",children:(0,o.jsx)(t.ui_kit$Select,{size:"large",mode:"tags",placeholder:d("Add some tags"),tooltip:{title:d("Tags help you find the block in the list."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},disabled:b.isLoading||I.isLoading||U.isLoading,options:w})}),E.globalBlockCheckboxEnabled&&(0,o.jsx)(t.ui_kit$Form.Item,{name:"global_block",valuePropName:"checked",style:{marginBottom:15},children:(0,o.jsx)(t.ui_kit$Switch,{label:d("Global block"),disabled:b.isLoading||I.isLoading||U.isLoading})})]})})};gr.propTypes={};var sm="https://app.useblocks.io/api".replace(/\/+$/,""),am=`${sm}/wp-json/ai-generator/v1/identificate_blocks`,nm=["Menu","Header","Content","Banners","Lists","Buttons","Promocodes","Feature","Call to Action","E-Commerce","Articles","Polls","Applications","Separators","Contacts","Footer","Other"];async function dm(e){return await e.getInstance(xo.TOKEN_ID)}async function cm(e,i,l,s,a){const d={blocks:s,types:nm,locale:i};l.current=d;try{const c=await dm(a),p=await fetch(am,{method:"POST",headers:{"Content-Type":"application/json",...c?{Authorization:`Bearer ${c}`}:{}},body:JSON.stringify(d)});if(!p.ok||p.status!==200)throw new Error(`${p.statusText}`);return await p.json()}catch(c){throw c}}var um=(e,i="block")=>{const l=new DOMParser,s=l.parseFromString(e,"text/html"),a=s.querySelectorAll(`[em="${i}"]`),d=s.querySelectorAll("link");return{parser:l,document:s,blockElements:a,styleElement:s.querySelector('[em="styles"]'),linksElements:d}};function mm(e){return Array.from(e).map(i=>i.outerHTML).join("")}var pm=(e,i="block",l=!1)=>{if(!e?.html)return[];const{document:s,blockElements:a,styleElement:d,linksElements:c}=um(e.html,i),p=mm(c);if(!(a instanceof NodeList))return[];const f=s.querySelector("head"),x=f?f.innerHTML:"";return Array.from(a).map((k,b)=>{if(!(k instanceof Element)||!k.outerHTML)return null;const h=d?d.outerHTML:"";return{id:`${e.id}-${b}`,html:l?`<!DOCTYPE html>
|
|
23
|
+
<html>
|
|
24
|
+
<head>${x}</head>
|
|
25
|
+
<body>
|
|
26
|
+
<table>${k.outerHTML}</table>
|
|
27
|
+
</body>
|
|
28
|
+
</html>`:r.minifyHtml(`${p}${h}${k.outerHTML.replace(/class="em-structure"/,'class=""')}`)}}).filter(Boolean)};function hm(e,i,l){const{images:s}=e,{blocks:a}=i;return s?.map(d=>{const c=a.find(p=>p.id===d.block_id);return{blockType:d.classification,blockTitle:d.name,htmlContent:c?.html||"",projectId:l}})}var bm=e=>e.replace(/<div\s+[^>]*style="font-family:[^>]*>(.*?)<\/div>/gs,i=>i.replace(/>(.*?)<\/div>/s,"></div>")),fm=e=>e.replace(/src="[^"]*"/g,'src=""'),gm=e=>/<div\s+[^>]*style="font-family:/i.test(e),_m=e=>{const i=new Set,l=[];for(const s of e)if(gm(s.html)){const a=fm(bm(s.html));i.has(a)||(i.add(a),l.push(s))}else l.push(s);return l},xm=async e=>{const{block:i,form:l,projectData:s,projectId:a,addBlock:d,editProject:c,notification:p,__:f,handleCloseModal:x,htmlContent:k,refetchBlocks:b,reloadBlockScreens:h,values:T,tagIds:_,projectTagsArray:E}=e;try{await ja({block:i,form:l,projectId:a,htmlContent:k,values:T,tagIds:_,addBlock:d,editProject:c,notification:p,refetchBlocks:b,reloadBlockScreens:h,projectTagsArray:E,__:f,handleCloseModal:x})}catch(w){throw w}},km=({projectData:e,addTerm:i,addBlock:l,editProject:s,reloadBlockScreens:a,notification:d,__:c,handleCloseModal:p,setTriggerOpenSavedBlocksTab:f,setTagsOptions:x,form:k,projectId:b})=>{const[h,T]=(0,n.useState)(!1),_=r.useInvalidateProject(),{data:E}=r.useGetTermsQuery({project:e,kind:r.BLOCK_TAGS},{skip:!e?.id});return(0,n.useEffect)(()=>{x((E||[]).map(v=>({value:v.name})))},[E,x]),{bulkSave:async(v,P,j,C)=>{T(!0);try{if(!P)return;const I=await Ta({blockTags:C,projectTagsArray:E||[],addTerm:i,project:e,notification:d});let K=!0,U=0;for(const O of v)try{await xm({block:O,form:k,projectData:e,projectId:b,addBlock:l,editProject:s,notification:d,__:c,handleCloseModal:p,values:j,tagIds:I,projectTagsArray:E||[]})}catch{K=!1,U++}if(K&&d.success({id:"BULK_SAVE_SUCCESS",title:c("All blocks saved successfully."),placement:"bottomRight"}),!K){if(U===v.length)throw new Error;d.warning({id:"BULK_SAVE_PARTIAL_SUCCESS",title:c("Some blocks were not saved successfully."),placement:"bottomRight"})}f(!0),_(b),a()}catch(I){throw I}finally{T(!1),k.resetFields(),p()}},confirmSavingBlocksLoading:h}},_r=({isModalVisible:e,currentEmail:i,setIsShowAddAllBlocksModal:l,setTriggerOpenSavedBlocksTab:s,projectId:a})=>{const{__:d,_n:c,sprintf:p}=r.useI18n(),f=r.useContainer(),x=r.useProjectData(),{tagsEnabled:k}=r.useAppConfig(),[b,h]=(0,n.useState)(!1),[T]=t.ui_kit$Form.useForm(),[_,E]=(0,n.useState)([]),[w,v]=(0,n.useState)([]),P=(0,n.useRef)({}),[j]=r.useAddTermMutation(),[C]=r.useEditProjectMutation(),[I,K]=r.useAddBlockMutation(),U=r.useEditorLocale()||void 0,O=pm(i),L=_m(O).map(be=>be),R=L.length,G=r.useNotification(),J=()=>{b||oe||l(!1)},{bulkSave:te,confirmSavingBlocksLoading:oe}=km({projectData:x,addTerm:j,addBlock:I,editProject:C,reloadBlockScreens:Ra,notification:G,__:d,handleCloseModal:J,setTriggerOpenSavedBlocksTab:s,setTagsOptions:v,form:T,projectId:a}),he=async()=>{try{const{valid:be,values:ae,blockTags:ke}=await ya({form:T,notification:G,__:d});s(!1),h(!0);const Ce=await cm(i,U,P,L,f),de=hm(Ce,P.current,i.project.toString());h(!1),await te(de,be,ae,ke)}catch{h(!1),l(!1),G.error({title:d("Failed to save blocks."),placement:"bottomRight"})}};return(0,o.jsxs)(t.ui_kit$Modal,{title:(0,o.jsx)("div",{className:"ant-modal-title",children:d("Bulk saving of blocks")}),open:e,onOk:he,onCancel:J,footer:(0,o.jsx)("div",{className:"modal-footer",children:!(b||oe)&&(0,o.jsx)(t.ui_kit$Button,{size:"large",type:"primary",disabled:b||oe,onClick:he,children:p(c("Save %d block","Save %d blocks",R),R)},"submit")}),children:[b||oe?(0,o.jsx)("div",{children:d("All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.")}):(0,o.jsx)("div",{children:p(c("Your letter contains %d block that can be saved for future use.","Your letter contains %d blocks that can be saved for future use.",R),R)}),!(b||oe)&&k&&(0,o.jsx)(t.ui_kit$Form,{form:T,name:"add_all_blocks_form",layout:"vertical",onFinish:he,style:{paddingTop:24},children:(0,o.jsx)(t.ui_kit$Form.Item,{label:d("Tags"),name:"tags",labelCol:{span:24},wrapperCol:{span:24},style:{display:"block",marginBottom:0},children:(0,o.jsx)(t.ui_kit$Select,{size:"large",mode:"tags",placeholder:d("Add some tags"),style:{width:"100%"},value:_,onChange:E,disabled:K.isLoading,options:w})})}),(oe||b)&&(0,o.jsx)("div",{className:"modal-spinner",children:(0,o.jsx)(t.ui_kit$Spin,{size:"large"})})]})};_r.propTypes={};var Em=e=>e.replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"),xr=({isModalVisible:e=!1,email:i=null})=>{const{__:l}=r.useI18n(),[s]=t.ui_kit$Form.useForm(),a=r.useDispatch(),d=r.useRouteEmailId(),c=r.useNotification(),p=r.useCurrentUser(),f=r.useProjectData()?.projects_test_emails,[x,k]=r.useSendTestEmailMutation(),{token:b}=(0,t.ui_kit$useToken)(),[h,T]=(0,n.useState)(!1);r.useAppConfig(),r.useCookieManager();const _=i.project,{data:E}=r.useGetProjectTestRecipientsQuery(_??0,{skip:!0}),[w,v]=r.useEditProjectMutation(),[P]=r.usePutProjectTestRecipientsMutation(),j=r.useProjectData(),{testEmails:C}=r.useAppConfig(),I=r.usePushToDataLayer(),[K,U]=(0,n.useState)([]),[O,L]=(0,n.useState)(!1),R=r.useEventEmitter(xo.events.ON_SEND_EMAIL_MODAL_ID);(0,n.useEffect)(()=>{e?R.fire(i).then(he=>{he.some(be=>be===!1)?a(r.closeModal$1()):T(e)}):T(e)},[e,a,T,i,R]),(0,n.useEffect)(()=>{},[j,_,E]),(0,n.useEffect)(()=>{U(C.map(he=>({value:he})))},[C]),(0,n.useEffect)(()=>{const he=localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_test_emails);if(he&&h&&s.getFieldValue("recipients")?.length===0){const be=JSON.parse(he);be?.[_]&&s.setFieldsValue({recipients:be[_]})}},[_,h,s]),(0,n.useEffect)(()=>{s.setFieldsValue({subject:i.subject})},[s,i.subject]);const G=()=>{a(r.closeModal$1()),s.resetFields()},J=r.useContentReader(),te=()=>{s.validateFields().then(()=>{const he={user_id:p.id,project_id:_,email_id:d,subject:s.getFieldValue("subject"),email:s.getFieldValue("recipients").join(","),html:Em(J())};x(he).unwrap().catch(be=>{c.error({error:{data:{code:be?.data?.code,message:be?.data?.message}}})}),L(!0),I({event:"submit",action:"send_test_email",entity_id:d,project_id:_,recipients_count:s.getFieldValue("recipients").length})}).catch(he=>{})},oe=n.default.useRef(f);return oe.current=f,(0,n.useEffect)(()=>{const he=oe.current;if(k.isSuccess&&O){k.data?.status;{const be=[...new Set([...K.map(je=>je.value),...s.getFieldValue("recipients")])],ae=be.map(je=>({projects_test_email:je}));((je,re)=>{if(!je||!re)return je===re;if(je.length!==re.length)return!1;const Be=je.map(ee=>ee.projects_test_email).sort(),ce=re.map(ee=>ee.projects_test_email).sort();return Be.every((ee,me)=>ee===ce[me])})(ae,r.isProjectsV2Enabled()?(E||[]).map(je=>({projects_test_email:je})):he)||(r.isProjectsV2Enabled()?P({projectId:_,emails:be}):w({projectId:_,projects_test_emails:ae}));const Ce=localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_test_emails)?JSON.parse(localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_test_emails)):[];let de=s.getFieldValue("recipients");localStorage.setItem(r.LOCAL_STORAGE_ITEMS.em_test_emails,JSON.stringify({...Ce,[_]:[...new Set(de)]}));const Fe=i.title||i.subject||l("Untitled email.").replace(/\.$/,"");c.success(l("The email “")+Fe+l("” was successfully sent."))}L(!1),s.resetFields(),a(r.closeModal$1())}},[k,s,_,w,P,E,K,O,a,i.title,i.subject,c,v,l]),(0,n.useEffect)(()=>{v.isError&&(c.error(v),L(!1),s.resetFields(),a(r.closeModal$1()))},[a,v,s]),(0,n.useEffect)(()=>{s.setFieldsValue({subject:i.subject||i.title})},[i,s]),(0,o.jsx)(t.ui_kit$Modal,{width:572,title:(0,o.jsxs)("div",{style:{paddingBottom:8},children:[(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined,size:20,strokeWidth:2})," ",l("Send a test email")]}),open:h,onCancel:G,footer:[(0,o.jsx)(t.ui_kit$Button,{size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:v.isLoading,icon:(0,o.jsx)(r.EmIcons,{icon:"SendOutlined",component:t.icons$SendOutlined,size:18,strokeWidth:2,className:"email-preview-menu__list-item-icon"}),onClick:te,disabled:k.isLoading,children:l("Send")},"submit")],forceRender:!0,children:(0,o.jsxs)(t.ui_kit$Form,{form:s,layout:"vertical",name:"send_mail_form",initialValues:{subject:i.subject||i.title,recipients:[]},autoComplete:"off",children:[(0,o.jsx)(t.ui_kit$Form.Item,{label:l("Subject"),name:"subject",rules:[{required:!1,message:l("Please type subject")}],children:(0,o.jsx)(t.ui_kit$Input,{size:"large",placeholder:l("Type subject")})}),(0,o.jsx)(t.ui_kit$Form.Item,{label:l("Recipients"),name:"recipients",tooltip:{title:l("The test email will be sent to the specified addresses."),icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},rules:[{required:!0,validator:(he,be)=>be.length>10?Promise.reject(new Error(l("A test email can be sent to a maximum of 10 addresses."))):be.length!==0?be.every(ae=>wo.emailValidation.test(ae.toLowerCase()))?Promise.resolve():Promise.reject(new Error(l("Please type correct emails"))):Promise.reject(new Error(l("Please type emails")))}],children:(0,o.jsx)(t.ui_kit$Select,{size:"large",mode:"tags",placeholder:l("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:(0,o.jsx)(r.EmIcons,{icon:"InfoCircleOutlined",component:t.icons$InfoCircleOutlined})},options:K,tagRender:he=>{const{label:be,closable:ae,onClose:ke}=he,Ce=de=>{de.preventDefault(),de.stopPropagation()};return(0,o.jsx)(t.ui_kit$Tag,{variant:"solid",color:b.colorPrimary,onMouseDown:Ce,closable:ae,onClose:ke,style:{borderRadius:6},children:be})},getPopupContainer:()=>document.getElementById("send_mail_form")})})]})})};xr.propTypes={isModalVisible:g.default.bool,email:g.default.shape({html:g.default.string,subject:g.default.string})};var kr=({block:e=null,isEditableRights:i,rightCol:l,autoSaveBlockResult:s,disabled:a})=>{const{__:d}=r.useI18n(),{blockId:c}=r.useRouteParams(),p=r.useEditorProjectId();let f=r.useSelector(r.selectIsCodeMode$1),x=r.useSelector(r.selectIsCodeMode$1),k=r.useDispatch();const b=r.useNotification(),h=r.useContentReader(),T=r.useStore(),_=r.useSendPostMessage(),[E,w]=(0,n.useState)(!1),[v,P]=(0,n.useState)(null),[j,C]=(0,n.useState)(!1),[I,K]=(0,n.useState)(!1),U=r.usePushToDataLayer();(0,n.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&P(!0)},[]);const{data:O,refetch:L}=r.useGetProjectQuery(+p,{skip:!+p}),[R]=r.useAddTermMutation(),[G,J]=r.useEditBlockMutation(),[te,oe]=r.useAddBlockMutation(),[he]=r.useEditProjectMutation(),{data:be}=r.useGetTermsQuery({project:O,kind:r.BLOCK_TAGS},{skip:!O?.id}),ae=(0,n.useCallback)(re=>{if(C(!0),!i&&e.lock&&I){b.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",title:d("No access to edit the letter."),data:r.getBlockDesc(e)}),C(!1);return}if((e.tags?.length||e.blocktags?.length)>10&&I){b.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",title:d("Maximum 10 tags available."),data:r.getBlockDesc(e)}),C(!1);return}if(e.type===""){b.error({title:d("Set the type"),description:d("Please set the 'Type' field in the Settings section.")}),C(!1);return}const Be=ce=>{const ee=e.tags?.map(ue=>{const Z=be?.find(Q=>Q.name===ue);return Z?Z.id:R({project:O,kind:r.BLOCK_TAGS,name:ue,parent:ce}).then(({error:Q,data:W})=>{if(Q?.status===400)return r.existingTermIdFromError(Q);if(W)return W.id;Q&&(b.fromError("TAG_CREATING_ERROR",ue,Q),C(!1))})}),me=(ue=null)=>{let Z=null;const Q=q=>{T.dispatch(r.taxonomiesApi.endpoints.getTerms.initiate({project:O,kind:r.BLOCK_TAGS})),L(),q.global_block&&q.id&&_({operation:r.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(q.id),...Z?{emBlockVersion:Z}:{}}}),I&&(b.success({id:"BLOCK_EDITING_SUCCESS",title:d("The block was successfully saved."),data:r.getBlockDesc(e)}),C(!1)),fetch(r.blockPreviewHref(r.BLOCK,p,q.id,q.modified),{mode:"no-cors"}).then(()=>{})},W=wo.getTaxonomy(e,r.EMAIL_TAGS).filter(q=>(ue||e.blocktags).includes(q.id)).map(q=>q.name);if(e.isNew)oe.status!=="pending"&&te({source:re,title:e.title===null?d("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:h(),blocktags:ue?ue.join(","):e.blocktags,tags:W,...r.hasOwnMeta(e)?{meta:e.meta}:{}}).then(async({data:q,error:se})=>{if(se)b.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:h()},se),C(!1);else{let xe=q;const ge=h();if(q?.global_block&&q?.id&&ge){const Ne=new Date,ye=r.injectEmBlockIdIntoBlockHtml(ge,String(q.id),Ne);if(Z=r.formatEmBlockVersion(Ne),ye!==ge){const $e=await G({blockId:q.id,html:ye});!$e.error&&$e.data&&(xe=$e.data)}}Q(xe)}});else if(J.status!=="pending"){const q=h(),se=new Date,xe=e.global_block?r.injectEmBlockIdIntoBlockHtml(q,String(e.id),se):q;e.global_block&&(Z=r.formatEmBlockVersion(se)),G({blockId:e.id,source:re,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:xe,blocktags:ue||e.blocktags,tags:W,...r.hasOwnMeta(e)?{meta:e.meta}:{}}).then(({data:ge,error:Ne})=>{Ne&&I?(b.fromError("BLOCK_EDITING_ERROR",r.getBlockDesc(e),Ne),C(!1)):Q(ge)})}};ee?Promise.all(ee).then(ue=>me(ue)):me(null)};C(!0),Be(void 0)},[oe.status,te,J.status,G,e,i,R,he,p,d,I,h,b,be,L,T,_]);(0,n.useEffect)(()=>{I&&(ae(),K(!1))},[I,ae]);const ke=(0,n.useCallback)(re=>{(re.ctrlKey||re.metaKey)&&re.keyCode===83&&(re.preventDefault(),K(!0))},[]);(0,n.useEffect)(()=>(document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}),[ke]);const Ce=(0,n.useCallback)(re=>{const Be=re.data.operation,ce=re.data.action;Be===r.EVENT_TYPES.APPLICATION_ACTION&&ce==="save_email"&&K(!0)},[]);r.useListenPostMessage(Ce),(0,n.useEffect)(()=>{oe.isError&&(C(!1),b.error(oe))},[k,oe]),(0,n.useEffect)(()=>{const re=setTimeout(()=>{w(!0)},1e4);return()=>{clearTimeout(re)}},[]),(0,n.useEffect)(()=>{e.isNew&&!c&&E&&(ae(),w(!1))},[E,e,ae,c]);const de=J.isLoading||he.isLoading||oe.isLoading||j,Fe=!!s?.isLoading,je=de||Fe;return(0,o.jsx)(t.ui_kit$Tooltip,{title:d(v?"Save by ⌘S":"Save by Ctrl+S"),placement:l?"right":"bottomRight",children:(0,o.jsx)("span",{className:"em-analytics__block-save-tooltip-target",children:(0,o.jsx)(t.ui_kit$Button,{type:"primary",block:l,disabled:a||Fe,className:"em-analytics__block-save",icon:(0,o.jsx)(r.EmIcons,{icon:"SaveOutlined",component:t.icons$SaveOutlined}),onClick:re=>{const Be=re.currentTarget;U({event:"click",action:"save_block"}),K(!0);try{Be?.blur?.()}catch{}},loading:je,children:l||f||x?"":d("Save")})})})};kr.propTypes={block:g.default.shape({id:g.default.string,isNew:g.default.bool,lock:g.default.bool,type:g.default.string,html:g.default.string,description:g.default.string,project:g.default.number,title:g.default.string}),isEditableRights:g.default.bool.isRequired};var Bm=to.__exportAll({AddAllBlocksModal:()=>_r,AddNewBlockModal:()=>gr,BlocksSearch:()=>br,Discuss:()=>Ea,DiscussAi:()=>ea,EmailProperties:()=>Ll,EmailSettings:()=>Ui,EmailStyles:()=>Ji,FileManagerDataLayer:()=>ba,HistoryPanel:()=>fr,LimitUpgradeModal:()=>ai,Optimise:()=>ma,SaveBlockBtn:()=>kr,SelectedElementPanel:()=>dt,SendTestEmailModal:()=>xr});no.AddAllBlocksModal=_r,no.AddNewBlockModal=gr,no.BlocksSearch=br,no.Discuss=Ea,no.DiscussAi=ea,no.EmailProperties=Ll,no.EmailSettings=Ui,no.EmailStyles=Ji,no.FileManagerDataLayer=ba,no.HistoryPanel=fr,no.LimitUpgradeModal=ai,no.LimitUpgradeModal$1=ai,no.Optimise=ma,no.SaveBlockBtn=kr,no.SelectedElementPanel=dt,no.SendTestEmailModal=xr,no.canonicalImageUrlKey=ft,no.getImageDimensionsFromBlob=Sr,no.normalizeImageFormatForDisplay=Ft,Object.defineProperty(no,"panels_exports",{enumerable:!0,get:function(){return Bm}}),no.resolveDataProviderPreview=Rr,no.shouldCountAiUsage=nr,no.useImageBlobFetch=yr,no.useImageBlobResolver=wr});
|