@emailmaker/emailmaker 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 +73 -41
- package/compat-globals.js +1 -1
- package/emailmaker-core.d8f06ef8.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.8a98eb63.js → emailmaker-po.d8f06ef8.js} +1 -1
- package/emailmaker.d.ts +109 -25
- package/emailmaker.js +39 -15
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/discussHandlers.DpogBvtl.js +88 -0
- package/iframe/js/{iframe-eblock.body.js → iframe-eblock.body.d8f06ef8.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/{iframe.body.js → iframe.body.d8f06ef8.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/15af2b29.js +1 -0
- package/static/core/1a079af7.js +27 -0
- package/static/core/{6be08373.js → 1e650cb3.js} +1 -1
- package/static/core/2b02bfec.js +2 -0
- package/static/core/{3b8b6bb0.js → 2c0d88ff.js} +1 -1
- package/static/core/{4aed1398.js → 30fecb60.js} +7 -7
- package/static/core/34aedeaf.js +1 -0
- package/static/core/36ae93da.js +1 -0
- package/static/core/{3364944b.js → 3ab4db57.js} +1 -1
- package/static/core/{1193bb41.js → 3efc4ec8.js} +1 -1
- package/static/core/{1c13f798.js → 40d9b4e4.js} +1 -1
- package/static/core/{cbcede3f.js → 4797d4f7.js} +7 -7
- package/static/core/51b2aae7.js +1 -0
- package/static/core/{99c2b321.js → 61ae67b6.js} +1 -1
- package/static/core/66bcf2f4.js +1 -0
- package/static/core/7606705b.js +7 -0
- package/static/core/76d1f317.js +1 -0
- package/static/core/{21c9f165.js → 7c3a126d.js} +5 -5
- package/static/core/{9de73615.js → 7f73a221.js} +1 -1
- package/static/core/{ec289c6e.js → 90061c56.js} +1 -1
- package/static/core/{bebf981d.js → 918c30e2.js} +6 -6
- package/static/core/9a406203.js +28 -0
- package/static/core/{cd9d9cfd.js → a38cd4c8.js} +1 -1
- package/static/core/{3daf51db.js → ad8c60e8.js} +3 -3
- package/static/core/{4bfe3961.js → ad999fe5.js} +2 -2
- package/static/core/b416d219.js +1 -0
- package/static/core/ba3477cd.js +1 -0
- package/static/core/d0b845c8.js +1 -0
- package/static/core/d5a3b772.js +1 -0
- package/static/core/{18aa476c.js → e648952b.js} +1 -1
- package/static/core/f7baa937.js +1 -0
- package/static/esm/2490dab8.js +1 -0
- package/static/esm/7f198b88.js +1 -0
- package/static/esm/971f1b2c.js +1 -0
- package/static/esm/f76c9d9d.js +1 -0
- package/static/umd/3f12d6ff.js +1 -0
- package/static/umd-runtime/{CKPvGq1V.js → CXeo_4Wo.js} +1 -1
- package/static/umd-runtime/CqMyE0Uc.js +341 -0
- package/static/umd-runtime/{CLdQLcWb.js → CzJl_OWE.js} +1 -1
- package/static/umd-runtime/{Cfglgyi_.js → DHbLOxHw.js} +1 -1
- package/static/umd-runtime/{Dapct6er.js → DJs7nSi6.js} +1 -1
- package/static/umd-runtime/{DK72AzBY.js → DLNNm9qB.js} +1 -1
- package/static/umd-runtime/{-HpwEpwH.js → DRAM_elr.js} +3 -3
- package/static/umd-runtime/{CgYMn5fZ.js → DTloyvLC.js} +1 -1
- package/static/umd-runtime/{BFxYqYWf.js → DYZMXiWv.js} +2 -2
- package/static/umd-runtime/Dxubut77.js +1 -0
- package/static/umd-runtime/{Gn4yF-9a.js → ElFNizMF.js} +1 -1
- package/static/umd-runtime/{ZH-8P1YS.js → eK-pjJXU.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/{BClKfJvv.js → ytvvaFpU.js} +1 -1
- package/vendor/@emailmaker/ui-kit/es/components/DataEntry/Input/index.js +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- 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/emailmaker-core.8a98eb63.js +0 -859
- package/iframe/js/discussHandlers.CTTzIkqW.js +0 -88
- package/static/core/132074fc.js +0 -1
- package/static/core/2a4178e1.js +0 -1
- package/static/core/312b689d.js +0 -7
- package/static/core/36d57a50.js +0 -28
- package/static/core/420fc89a.js +0 -27
- package/static/core/45127a77.js +0 -1
- package/static/core/5e35e5e8.js +0 -1
- package/static/core/9e0696a3.js +0 -1
- package/static/core/b0ddc500.js +0 -2
- package/static/core/c5e3e58d.js +0 -1
- package/static/core/d612bba8.js +0 -1
- package/static/core/dd6e4977.js +0 -1
- package/static/core/fb589d00.js +0 -1
- package/static/esm/50fbfdf6.js +0 -1
- package/static/esm/e1e55006.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/V5NCqAWA.js +0 -1
- package/static/umd-runtime/XrKalJq-.js +0 -335
- 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.8a98eb63.html → iframe-eblock.d8f06ef8.html} +0 -0
- /package/iframe/{iframe.8a98eb63.html → iframe.d8f06ef8.html} +0 -0
|
@@ -1,859 +0,0 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/5dc34752.js",["require","exports","module"],function(M,o,w){var p=Object.create,_=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,O=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}},P=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),g=(e,t)=>{let r={};for(var n in e)_(r,n,{get:e[n],enumerable:!0});return t||_(r,Symbol.toStringTag,{value:"Module"}),r},c=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=f(t),l=0,m=i.length,u;l<m;l++)u=i[l],!a.call(e,u)&&u!==r&&_(e,u,{get:(y=>t[y]).bind(null,u),enumerable:!(n=b(t,u))||n.enumerable});return e},j=(e,t,r)=>(r=e!=null?p(O(e)):{},c(t||!e||!e.__esModule||!a.call(e,"default")?_(r,"default",{value:e,enumerable:!0}):r,e)),s=e=>a.call(e,"module.exports")?e["module.exports"]:c(_({},"__esModule",{value:!0}),e);Object.defineProperty(o,"__commonJSMin",{enumerable:!0,get:function(){return P}}),Object.defineProperty(o,"__esmMin",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"__exportAll",{enumerable:!0,get:function(){return g}}),Object.defineProperty(o,"__toCommonJS",{enumerable:!0,get:function(){return s}}),Object.defineProperty(o,"__toESM",{enumerable:!0,get:function(){return j}})});
|
|
2
|
-
|
|
3
|
-
__emailmaker__.define("static/core/42f90c4f.js",["require","exports","module"],function(lo,u,ho){function Ie(e){return function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...e(t)||{}}}}function $t(e){return t=>{const r={},n=[];for(const i of e)n.push(i(t));for(const i of n)Object.assign(r,i.instance);return{instance:r,setOptions:async i=>{for(const c of n)await c.setOptions(i)},dispose:()=>{for(const i of n)i.dispose()}}}}var v=class kt{_inner;_isDisposed=!1;constructor(t=[]){this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof kt&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const r=this._inner.indexOf(t);r>=0&&this._inner.splice(r,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function B(e){return`service_container_${e}`}var R=new Set,Q;function Mt(){if(!Q)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,ee.prototype.getInstanceAsync),e.stack}function Z(e){R.delete(e)&&Q?.end(e)}var ee=class Te extends v{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(t){this._injectCallbacks.forEach(r=>r(t))}constructor(t=null){super(),this._parent=t,t&&this.addDisposable(t.onInject(r=>this._runCallbacks(r)))}onInject=t=>(this._injectCallbacks.push(t),{dispose:()=>{const r=this._injectCallbacks.indexOf(t);r>=0&&this._injectCallbacks.splice(r,1)}});inject(t,r){this._injections[t]=()=>r,this._runCallbacks(t)}injectFactory(t,r,n){const s=this._injections[t];let o=typeof s=="function"?s():s;const i=this._injections[t]=()=>(o=r(this,o),o);n&&i(),this._runCallbacks(t)}_find(t,r=!0){return this._injections[t]||r&&this._parent?._find(t)}_onInject(t,r,n=new v){return n.addDisposable(this.onInject(s=>{t===s&&(n.dispose(),r(this.getInstance(s)))})),this._parent&&n.addDisposable(this._parent._onInject(t,r,n)),this.addDisposable(n),n}getInstance(t,r=!0){const n=this._find(t,r);if(typeof n=="function")return n()}getOrCreateInstance(t,r){const n=this._find(t);if(typeof n=="function")return n();const s=r(this);return this.inject(t,s),s}getInstanceAsync(t){const r=this._find(t);if(typeof r=="function")return Promise.resolve(r());const n=Mt();return new Promise((s,o)=>{const i={id:String(t),startedAt:Date.now(),origin:n,container:this,reject:o};R.add(i),Q?.start(i),this._onInject(t,()=>{Z(i),s(this.getInstance(t))})})}failPendingWaits(t){for(const r of Array.from(R))r.container===this&&(Z(r),r.reject(t))}pendingWaits(){return[...R].filter(t=>t.container===this)}addService(t,r){const n=B(t);this.injectFactory(n,(o,i=[])=>i.indexOf(r)<0?[...i,r]:i);const s=new v;return s.addDispose(()=>{this.injectFactory(n,(o,i=[])=>i.filter(c=>c!==r))}),s}addServiceFactory(t,r,n){const s=B(t);let o;this.injectFactory(s,(c,a=[])=>(o=r(c,o),o===void 0?a:a.indexOf(o)<0?[...a,o]:a),n);const i=new v;return i.addDispose(()=>{this.injectFactory(s,(c,a=[])=>o===void 0?a:a.filter(l=>l!==o))}),i}getServices(t){const r=B(t);return[...this.getInstance(r,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new Te(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const r=this._parent?.getOrCreateIsolatedContainer(t);return new Te(r)})}remove(t){const r=this._injections;delete r[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(R))t.container===this&&Z(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function te(e){return e.startsWith("__")?e:`__${e}__`}function Ft(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=te(e),r=globalThis;return r[t]??={}}function Bt(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function Gt(e){if(e)return te(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return te(t)}function Ae(e){const t=Gt(e),r=Ft(t);if(Bt(r.container))return r.container;const n=new ee(null);return r.container=n,n}function Ht(e){return Ae(e)}function Wt(){let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Wt()}function f(e=Pe()){return e}function Se(){return"core".trim()||"unknown"}function Vt(e){if(typeof globalThis>"u")return;const t=Se(),r=globalThis[e]??{};globalThis[e]=r;const n=r.__diagnostics??={},s=n.diModuleEval??={evalCount:0,records:[]};s.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),s.evalCount+=1}function Kt(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function Jt(e,t){if(Vt(t),typeof globalThis>"u")return e;const r=Se(),n=globalThis,s=n[t]=n[t]||{},o=s.__diagnostics=s.__diagnostics||{},i=o.dependencyResolver=o.dependencyResolver||{entries:[]},c={container:e,source:"packages/runtime-core/di/index.ts",buildSource:r,timestamp:Date.now(),stack:new Error().stack};return i.entries.push(c),e}var G;function Yt(){if(G)return G;const e=Kt();return G=Jt(Ae(e),e),G}var re=new Proxy({},{get(e,t,r){const n=Yt(),s=Reflect.get(n,t,r);return typeof s=="function"?s.bind(n):s}}),De=class extends v{_options;_listeners=[];constructor(e={}){super(),this._options=e}getListeners(e){return this._listeners.flatMap(([t])=>typeof t=="function"?t:t.getListeners(e))}hasListeners(){for(const[e]of this._listeners){if(typeof e=="function")return!0;const t=e;if(typeof t.hasListeners=="function"){if(t.hasListeners())return!0;continue}return!0}return!1}_addListener(e,t=0,r){if(this.isDisposed())return{dispose:()=>{}};const n=this._listeners,s=this._options;r&&typeof e=="function"&&(e=e.bind(r));const o=n.findIndex(([,c])=>c<t),i=[e,t];return n.splice(o>=0?o:n.length,0,i),n.length===1&&s.onFirstListenerAdd&&s.onFirstListenerAdd(),{dispose:()=>{const c=n.indexOf(i);c>=0&&(n.splice(c,1),!n.length&&s.onLastListenerRemove&&s.onLastListenerRemove())}}}on=this._addListener.bind(this);event=this._addListener.bind(this);once=(e,t=0,r)=>{const n=this._addListener((...s)=>(n?.dispose(),r?e.call(r,...s):e(...s)),t);return n};un=e=>{const t=this._listeners.findIndex(([r])=>r===e);t>=0&&(this._listeners.splice(t,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())};dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},N=class extends De{execute(e,t){for(const r of t)try{r(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},Xt=class extends N{execute([e],t){for(const r of t)try{r(e)}catch{}}},zt=class extends N{_suspendCounter=0;_wasFired=!1;execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const r of t)try{r(e)}catch{}}suspend(){this._suspendCounter++}resume(){--this._suspendCounter===0&&this._wasFired&&(this.fire(),this._wasFired=!1)}},ne=class extends N{async execute([e],t){const r=[];for(const n of t)try{r.push(await n(e))}catch{}return r}async fireSettled(e){const t={results:[],errors:[]};if(this.isDisposed())return t;for(const r of this.getListeners([e]))try{t.results.push(await r(e))}catch(n){t.errors.push(n)}return t}};function Qt(e,t=0){const r=new De,n=e(r,t);return n&&r.addDisposable(n),r.event}function Zt(e,t,r=0){const n=new N,s=e((...o)=>{if(t(...o))return n.fire(...o)},r);return s&&n.addDisposable(s),n.event}function p(e){return f(e)}var se;(function(e){e.BEFORE_SAVE_EMAIL=p("events.BEFORE_SAVE_EMAIL"),e.ON_SAVEBUTTON_CLICK_ID=p("events.ON_SAVEBUTTON_CLICK_ID"),e.ON_NEXTBUTTON_CLICK_ID=p("events.ON_NEXTBUTTON_CLICK_ID"),e.ON_PREVIOUSBUTTON_CLICK_ID=p("events.ON_PREVIOUSBUTTON_CLICK_ID"),e.ON_DOCUMENT_SESSION_CHANGE=p("events.ON_DOCUMENT_SESSION_CHANGE"),e.WILL_EMAIL_INIT_ID=p("events.WILL_EMAIL_INIT_ID"),e.ON_EMAIL_INIT_ID=p("events.ON_EMAIL_INIT_ID"),e.ON_BLOCK_INIT_ID=p("events.ON_BLOCK_INIT_ID"),e.ON_CONTENT_CHANGED_ID=p("events.ON_CONTENT_CHANGED_ID"),e.ON_PREHEADER_CHANGED_ID=p("events.ON_PREHEADER_CHANGED_ID"),e.ON_SUBJECT_CHANGED_ID=p("events.ON_SUBJECT_CHANGED_ID"),e.ON_EMAIL_CHANGED_ID=p("events.ON_EMAIL_CHANGED_ID"),e.ON_HEADER_APPLIED_ID=p("events.ON_HEADER_APPLIED_ID"),e.ON_BLOCK_CHANGED_ID=p("events.ON_BLOCK_CHANGED_ID"),e.ON_CHUNKS_LOADED=p("events.ON_CHUNKS_LOADED"),e.ON_SEND_TESTEMAIL_ID=p("events.ON_SEND_TESTEMAIL_ID"),e.ON_SEND_LIVEPREVIEW_ID=p("events.ON_SEND_LIVEPREVIEW_ID"),e.ON_SHARE_ID=p("events.ON_SHARE_ID"),e.ON_SHOW_PREVIEW_ID=p("events.ON_SHOW_PREVIEW_ID"),e.ON_EMAIL_CLONE_ID=p("events.ON_EMAIL_CLONE_ID"),e.ON_SEND_EMAIL_MODAL_ID=p("events.ON_SEND_EMAIL_MODAL_ID"),e.ON_NOTIFICATION=p("events.ON_NOTIFICATION"),e.READ_LOCALE=p("events.READ_LOCALE"),e.ON_TRANSLATE_ID=p("events.ON_TRANSLATE_ID"),e.ON_CODE_VALIDATE_ID=p("events.ON_CODE_VALIDATE_ID"),e.UPLOAD_EVENT_ID=p("events.UPLOAD_EVENT_ID"),e.PROXY_URL_EVENT_ID=p("events.PROXY_URL_EVENT_ID"),e.FILE_PROXY_EVENT_ID=p("events.FILE_PROXY_EVENT_ID"),e.ON_LIMIT_ID=p("events.ON_LIMIT_ID"),e.ON_BROWSER_EXTENSION_DETECTED_ID=p("events.ON_BROWSER_EXTENSION_DETECTED_ID"),e.ON_LAYOUT_CONVERT_REQUEST_ID=p("events.ON_LAYOUT_CONVERT_REQUEST_ID"),e.ON_BROWSER_TRANSLATE_DETECTED_ID=p("events.ON_BROWSER_TRANSLATE_DETECTED_ID"),e.AI_TEXT_REQUEST_ID=p("events.AI_TEXT_REQUEST_ID"),e.AI_IMAGE_REQUEST_ID=p("events.AI_IMAGE_REQUEST_ID"),e.AI_TEXT_PROGRESS_ID=p("events.AI_TEXT_PROGRESS_ID"),e.AI_IMAGE_PROGRESS_ID=p("events.AI_IMAGE_PROGRESS_ID"),e.AI_TEXT_STREAM_ID=p("events.AI_TEXT_STREAM_ID")})(se||(se={}));function er(e,t){return e.getOrCreateInstance(t,()=>new ne).event}function tr(e,t){return e.getOrCreateInstance(t,()=>new ne)}var rr="Not implemented in plugin",nr=f("plugin.app"),sr=f("plugin.disposable"),or=f("InitPipelineContext"),ir=f("plugin.instance"),po=f("plugin.lateSurfaceListeners"),we=f("plugin.optionsSource"),ar=f("plugin.store"),Ce=f("ConfigSource"),cr=f("plugin.standalone.project"),je=f("plugin.standalone.bootstrapToken"),fo=f("plugin.element"),Re=f("plugin.securityModule"),ur=f("plugin.standalone.activated"),dr=f("plugin.standalone.fileProxyRegistered"),lr=f("plugin.jwt.token"),hr=f("plugin.jwt.error"),_o=f("PluginCollection"),mo=p("APP_LOAD_EVENT"),pr=p("CONFIG_CHANGED_EVENT");function w(e){if(e instanceof DOMException&&e.name==="AbortError")return e;const t=e===void 0?"The operation was aborted.":typeof e=="string"?e:e instanceof Error?e.message:String(e);return new DOMException(t,"AbortError")}function fr(e){return e instanceof DOMException&&e.name==="AbortError"}function oe(e){if(e?.aborted)throw w(e.reason)}function _r(e,t){return t?(t.aborted&&e.catch(()=>{}),oe(t),new Promise((r,n)=>{const s=()=>{o(),n(w(t.reason))},o=()=>{t.removeEventListener("abort",s)};t.addEventListener("abort",s),e.then(i=>{o(),r(i)},i=>{o(),n(i)})})):e}function mr(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/([^a-zA-Z0-9_-])/g,"\\$1")}function ie(e,t=document){try{const n=t.querySelector(e);if(n)return n}catch{return null}const r=t.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n]?.shadowRoot;if(!s)continue;const o=ie(e,s);if(o)return o}return null}function Ne(e,t=[]){const r=e.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n]?.shadowRoot;s&&(t.push(s),Ne(s,t))}return t}function yr(e,t,r){if(e.isConnected)return e;const n=e.id?.trim();return n?Le(`#${mr(n)}`,t,r):Promise.reject(w("Editor mount element was disconnected and has no id — pass a CSS selector or call init() again after the host remounts the container."))}function Le(e,t,r){if(oe(r),typeof e<"u"){if(typeof e=="string"){const n=e,s=ie(n);if(s)return s;const o=t.addDisposable(new v);return new Promise((i,c)=>{const a=E=>{o.dispose(),E()},l=()=>{a(()=>c(w(r?.reason)))};if(r?.aborted){l();return}r?.addEventListener("abort",l),o.addDispose(()=>r?.removeEventListener("abort",l));const h=document.body??document.documentElement;if(!h){a(()=>c(w("Document is not ready to observe mount element")));return}const _=new Set,y=new MutationObserver(()=>{const E=ie(n);if(E){a(()=>i(E));return}b()}),m=E=>{_.has(E)||(_.add(E),y.observe(E,{attributes:!0,childList:!0,subtree:!0}))},b=()=>{const E=document.documentElement;if(E)for(const P of Ne(E))m(P)};m(h),b(),o.addDispose(()=>y.disconnect())})}return e instanceof Element?yr(e,t,r):e}return e}var Er=new Map;function gr(e,t=window){return{peer:e,send(r){e.postMessage(r,"*")},subscribe(r){const n=s=>{r({data:s.data,source:s.source,ports:s.ports})};return t.addEventListener("message",n),{dispose:()=>t.removeEventListener("message",n)}},close(){}}}function br(e){let t=!1;return{peer:e,send(r){e.postMessage(r)},subscribe(r){const n=s=>{r({data:s.data,source:e})};return e.addEventListener("message",n),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",n)}},close(){e.close()}}}function vr(e){return e}function Or(e){return e&&typeof e=="object"}function qe(e,t){return e&&typeof e=="object"&&e.operationId===t}var T="INIT_MESSAGE",Tr="em:port-ready",Ir="em:window-drained",ae="";function Ue(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Ar=class extends v{_listeners=Object.create(null);addListenerAsync=(e,t,r=0,n)=>{const s=this._listeners[e]||(this._listeners[e]=[]);n&&typeof t=="function"&&(t=t.bind(n));const o=s.findIndex(([c,a])=>r<=a),i=[t,r];return this.isDisposed()||s.splice(o>=0?o:s.length,0,i),{dispose(){const c=s.indexOf(i);c>=0&&s.splice(c,1)}}};fireAsync=(e,t)=>{if(!this.isDisposed()){const r=this._listeners[e]||(this._listeners[e]=[]);let n;for(let s=0;s<r.length;s++){const o=r[s][0],i=n;n=c=>o(c,i)}if(n)return n(t)}};addListener=(e,t,r=0)=>this.addListenerAsync(e,(n,s)=>{try{t(n)}catch{}return s&&s(n)},r)},Pr=class extends v{_singleton;_target;_transport;_transportSubscription;_ports=new Map;_drained=new WeakSet;_inited=!1;_emitter=this.addDisposable(new Ar);_handshaken=new WeakSet;_greeted=new WeakSet;_outgoingFilter;constructor(e,t){super(),this._singleton=t,this._transport=gr({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(T,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(T))}),e&&this.setTarget(e)}_onTransportMessage=e=>{const t=e,r=t.data,n=t.source,s=r?.port===!0?t.ports?.[0]:void 0,o=!this._isPortSource(t.source);if(o&&n&&r?.operationId==="em:window-drained"){this._drained.add(n);return}if(!(o&&n&&this._drained.has(n))){if(n&&n!==this._target&&this._greeted.has(n)&&qe(r,T)){this._greeted.delete(n),this._handshaken.add(n),this._postMessage(n,{operationId:T,data:{}}),s&&this.usePort(s,!0,n);return}if(Or(r)&&(t.source===this.target||this._isCurrentPort(t.source))||this._singleton&&qe(r,T)){if(s){const l=this._target;Promise.resolve().then(()=>this.usePort(s,!0,l))}const i=this._emitter.fireAsync(r.operationId||ae,r.operationId===void 0?t:r.data),c=r.result,a=r.error;c&&a&&Promise.resolve(i).then(l=>this._sendMessage(c,l),l=>this._sendMessage(a,l))}}};setTarget(e){if(this._target!==e){if(this._target=e,!e){this._inited=!1;return}if(this._handshaken.has(e)){this._inited=!0,this._emitter.fireAsync(T,void 0);return}this._inited=!1,this._postMessage(e,{operationId:T,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:T,data:{},port:!0},[t])}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}sendNow(e){const t=this._target;return!this._inited||!t?!1:(this._postMessage(t,e),!0)}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:T,data:{}}))}forget(e){this._handshaken.delete(e),this._greeted.delete(e),this._closePort(e),this._drained.delete(e),this._target===e&&(this._inited=!1)}usePort(e,t=!1,r=this._target){if(!r||this._ports.has(r))return;const n=br(e),s=n.subscribe(this._onTransportMessage);this._ports.set(r,{transport:n,subscription:s}),t&&(n.send({operationId:Tr,data:{}}),this.drainWindow(r))}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)}hasPort(e){return this._ports.has(e)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:Ir,data:{}},"*")}isWindowDrained(e){return this._drained.has(e)}_isPortSource(e){for(const t of this._ports.values())if(t.transport.peer===e)return!0;return!1}_isCurrentPort(e){return this._target!==void 0&&this._ports.get(this._target)?.transport.peer===e}getTarget(){return this._target}get target(){return this._target}_postMessage(e,t,r){let n=t;this._outgoingFilter&&!r?.length&&(n="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const s=this._ports.get(e);if(s){s.transport.send(n);return}if(r?.length){e.postMessage(n,"*",r);return}e.postMessage(n,"*")}catch(s){if(s?.name==="DataCloneError"){const o=typeof n?.data=="object"&&n?.data!==null?n.data:void 0}throw s}}_sendMessage(e,t,r=!0){if(!r&&!this.isInited())return;const n=this.addDisposable(this.onInit(s=>{const o=e?{operationId:e,data:t}:t;try{this._postMessage(s,{...o})}finally{n.dispose()}}))}send(e,t,r){return typeof e=="string"?this._sendMessage(e,t,r):this._sendMessage(ae,e,t)}sendAsync(e,t,r=!0){if(!r&&!this.isInited())return Promise.resolve();const n=Ue(),s=Ue();return new Promise((o,i)=>{const c=this.addDisposable(new v);c.addDisposable(this.onInit(a=>{try{this._postMessage(a,{operationId:e,data:t,result:n,error:s})}catch(l){c.dispose(),i(l);return}c.addDisposable(this._onMessage(n,l=>{o(l),c.dispose()})),c.addDisposable(this._onMessage(s,l=>{i(l),c.dispose()}))}))})}_onMessage(e,t,r=0){return this._emitter.addListener(e,t,r)}addListener(e,t,r){return t?this._onMessage(e,t,r):this._onMessage(ae,e)}addListenerAsyncPipe(e,t,r=0){return this._emitter.addListenerAsync(e,t,r)}addListenerAsync(e,t,r=0){return this._emitter.addListenerAsync(e,async(n,s)=>{const o=await t(n);return s?s(n):o},r)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,r=0){const n=this.addDisposable(new v);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?n.addDisposable(this.onInit(e,t,r)):e(this._target)}):n.addDisposable(this._onMessage(T,()=>{e(this._target)},r)),n}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},xe="INJECTION";function ce(e){return e.getState}function ke(e){if(ce(e)){const t=e.getState()[xe];return t&&re.getOrCreateInstance(t,()=>re.createChild())}else return e}function L(e){return f(e)}var Sr=f("extensions.atomsHandlers"),Dr=L("HANDLE_ATOM_INSERT"),yo=f("extensions.sandboxExtensions"),Eo="SANDBOX_EXTENSION_SCRIPT_STATUS",wr=f("MESSAGE_SERVICE"),Cr=L("SETTINGS_PANEL_EVENT"),jr="advanced",Rr=L("MODAL_SHOW_EVENT"),Nr=L("MODAL_CLOSE_EVENT"),Lr=L("MODAL_UPDATE_EVENT"),ue=f("client"),qr=f("v2_client"),Ur=f("ai_client"),xr=f("app.cookieManager"),kr=f("app.storageProvider"),$r=f("image-blob-resolver"),Mr=f("template-directives");function Fr(e,t){for(const r of e)if(r&&t in r)return r[t]}var $e=["generic","stockImages","emFiles","cdn"];function Me(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Fe(e){return!Me(e)||"match"in e||"rewrite"in e||"proxyBase"in e?!1:Object.keys(e).some(t=>$e.includes(t))}function Be(e){return e.length===0?[]:e.length===1?e[0]:e}function Br(e){let t=!1,r=[];for(const n of e)if(n!==void 0){if(t=!0,Array.isArray(n)){r=[...n,...r];continue}r=[n,...r]}if(t)return Be(r)}function Gr(e){return Me(e)&&("value"in e||"replace"in e)}function Ge(e,t){return t===void 0?e:Array.isArray(t)?[...t,...e]:[t,...e]}function Hr(e){let t=!1,r=[],n=!1;for(const o of e)if(o!==void 0){if(Gr(o)){t=!0,o.replace&&(r=[],n=!0),o.value!==void 0&&(r=Ge(r,o.value),n=!0);continue}r=Ge(r,o),n=!0}const s=n?Be(r):void 0;if(!t)return s;if(s!==void 0)return{value:s}}function Wr(e){const t=e.filter(n=>n!==void 0);if(t.length===0)return;if(!t.some(n=>Fe(n)))return Br(t);const r={};for(const n of $e){const s=Hr(e.map(o=>{if(o!==void 0)return Fe(o)?o[n]:n==="generic"?o:void 0}));s!==void 0&&(r[n]=s)}return Object.keys(r).length>0?r:void 0}function He(e){if(typeof e=="object"&&e){const t={};for(const r of Object.keys(e)){const n=e[r];n&&typeof n=="object"?t[r]=He(n):t[r]=n}return t}return e}function H(e,t){if(e!==t){if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const r=Array.isArray(e),n=Array.isArray(t);if(r){if(!n)return!1;const c=e.length;if(t.length!==c)return!1;for(let a=0;a<c;a++)if(!H(e[a],t[a]))return!1}else if(n)return!1;const s=Object.keys(e),o=Object.keys(t),i=s.length;if(i!==o.length)return!1;for(let c=0;c<i;c++){const a=s[c];if(!t.hasOwnProperty(a)||!H(e[a],t[a]))return!1}}return!0}var d=(function(e){return e.Json="application/json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e})({}),Vr=class{baseUrl="https://api.emailmaker.ru/wp-json";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};async request({body:e,secure:t,path:r,type:n,query:s,format:o,baseUrl:i,cancelToken:c,extraQuery:a,proxyHandler:l,...h}){const _=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},y=this.mergeRequestParams(h,_);a&&(s=s?{...s,...a}:a);const m=s&&this.toQueryString(s),b=this.contentFormatters[n||"application/json"],E=o||y.format,P=`${i||this.baseUrl||""}${r}${m?`?${m}`:""}`,j=l?l(P,{body:e,secure:t,path:r,type:n,query:s,format:o,baseUrl:i,cancelToken:c,extraQuery:a,proxyHandler:l,...h}):P,Ut=new Request(j,{...y,headers:{...y.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(c?this.createAbortSignal(c):y.signal)||null,body:typeof e>"u"||e===null?null:b(e)});return this.customFetch(Ut).then(async xt=>{const O=xt;O.data=null,O.error=null,O.meta={request:Ut,response:O};const uo=E?await xt[E]().then(z=>(O.ok?O.data=z:O.error={data:z},O)).catch(z=>(O.error=z,O)):O;return c&&this.abortControllers.delete(c),uo})}},Kr=class{http;constructor(e){this.http=e}ai_create=(e,t={})=>this.http.request({path:"/ai-generator/v1/ai",method:"POST",body:e,type:d.UrlEncoded,...t})},Jr=class{http;constructor(e){this.http=e}ai_status_list=(e,t={})=>this.http.request({path:"/ai-generator/v1/ai-status",method:"GET",query:e,...t})},Yr=class{http;constructor(e){this.http=e}clear_history_list=(e,t={})=>this.http.request({path:"/ai-generator/v1/clear-history",method:"GET",query:e,...t})},Xr=class{http;constructor(e){this.http=e}app_init_create=(e,t={})=>this.http.request({path:"/app/v1/app_init",method:"POST",body:e,type:d.UrlEncoded,...t})},zr=class{http;constructor(e){this.http=e}get_list=(e,t={})=>this.http.request({path:"/cors-proxy/V1/get",method:"GET",query:e,...t})},Qr=class{http;constructor(e){this.http=e}token_create=(e={})=>this.http.request({path:"/jwt-auth/v1/token",method:"POST",...e});token_validate_create=(e={})=>this.http.request({path:"/jwt-auth/v1/token/validate",method:"POST",...e})},Zr=class{http;constructor(e){this.http=e}top_used_list=(e,t={})=>this.http.request({path:"/projects/v1/top-used",method:"GET",query:e,...t})},en=class{http;constructor(e){this.http=e}get_code_info_list=(e,t={})=>this.http.request({path:"/promo/v1/get_code_info",method:"GET",query:e,...t})},tn=class{http;constructor(e){this.http=e}set_code_create=(e,t={})=>this.http.request({path:"/promo/v1/set_code",method:"POST",body:e,type:d.UrlEncoded,...t})},rn=class{http;constructor(e){this.http=e}ai_create=(e,t={})=>this.http.request({path:"/save-file/v1/ai",method:"POST",body:e,type:d.UrlEncoded,...t})},nn=class{http;constructor(e){this.http=e}ai_status_list=(e,t={})=>this.http.request({path:"/save-file/v1/ai-status",method:"GET",query:e,...t})},sn=class{http;constructor(e){this.http=e}get_link_create=(e,t={})=>this.http.request({path:"/save-file/v1/get-link",method:"POST",body:e,type:d.UrlEncoded,...t})},on=class{http;constructor(e){this.http=e}send_email_create=(e,t={})=>this.http.request({path:"/save-file/v1/send-email",method:"POST",body:e,type:d.UrlEncoded,...t})},an=class{http;constructor(e){this.http=e}shortener_create=(e,t={})=>this.http.request({path:"/save-file/v1/shortener",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t})},cn=class{http;constructor(e){this.http=e}upload_create=(e,t={})=>this.http.request({path:"/save-file/v1/upload",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t})},un=class{http;constructor(e){this.http=e}get_translations2=({file:e,...t},r={})=>this.http.request({path:`/translations/v1/${e}`,method:"GET",...r});get_translations3=({id:e,file:t,...r},n={})=>this.http.request({path:`/translations/v1/${t}/${e}`,method:"GET",...n})},dn=class{http;constructor(e){this.http=e}add_user_create=(e,t={})=>this.http.request({path:"/user_to_project/v1/add_user",method:"POST",body:e,type:d.UrlEncoded,...t})},ln=class{http;constructor(e){this.http=e}blocktags_list=(e,t={})=>this.http.request({path:"/wp/v2/blocktags",method:"GET",query:e,format:"json",...t});blocktags_create=(e,t={})=>this.http.request({path:"/wp/v2/blocktags",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});blocktags_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"GET",query:t,format:"json",...r});blocktags_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});blocktags_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});blocktags_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});blocktags_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/blocktags/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},hn=class{http;constructor(e){this.http=e}comments_list=(e,t={})=>this.http.request({path:"/wp/v2/comments",method:"GET",query:e,format:"json",...t});comments_create=(e,t={})=>this.http.request({path:"/wp/v2/comments",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});comments_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"GET",query:t,format:"json",...r});comments_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});comments_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});comments_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});comments_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/comments/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},pn=class{http;constructor(e){this.http=e}confirmation_list=(e,t={})=>this.http.request({path:"/wp/v2/confirmation",method:"GET",query:e,...t})},We=class{http;constructor(e){this.http=e}eblock_list=(e,t={})=>this.http.request({path:"/wp/v2/eblock",method:"GET",query:e,format:"json",...t});eblock_create=(e,t={})=>this.http.request({path:"/wp/v2/eblock",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});eblock_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"GET",query:t,format:"json",...r});eblock_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});eblock_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});eblock_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});eblock_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});eblock_revisions_list=({parent:e,...t},r={})=>this.http.request({path:`/wp/v2/eblock/${e}/revisions`,method:"GET",query:t,format:"json",...r});eblock_revisions_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/eblock/${e}/revisions/${t}`,method:"GET",query:r,format:"json",...n});eblock_revisions_delete=({parent:e,id:t,...r},n,s={})=>this.http.request({path:`/wp/v2/eblock/${e}/revisions/${t}`,method:"DELETE",body:n,type:d.UrlEncoded,format:"json",...s});eblock_autosaves_list=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/eblock/${e}/autosaves`,method:"GET",query:t,format:"json",...r});eblock_autosaves_create=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/eblock/${e}/autosaves`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});eblock_autosaves_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/eblock/${e}/autosaves/${t}`,method:"GET",query:r,format:"json",...n})},Ve=class{http;constructor(e){this.http=e}email_list=(e,t={})=>this.http.request({path:"/wp/v2/email",method:"GET",query:e,format:"json",...t});email_create=(e,t={})=>this.http.request({path:"/wp/v2/email",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});email_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"GET",query:t,format:"json",...r});email_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});email_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});email_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});email_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});email_revisions_list=({parent:e,...t},r={})=>this.http.request({path:`/wp/v2/email/${e}/revisions`,method:"GET",query:t,format:"json",...r});email_revisions_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/email/${e}/revisions/${t}`,method:"GET",query:r,format:"json",...n});email_revisions_delete=({parent:e,id:t,...r},n,s={})=>this.http.request({path:`/wp/v2/email/${e}/revisions/${t}`,method:"DELETE",body:n,type:d.UrlEncoded,format:"json",...s});email_autosaves_list=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/email/${e}/autosaves`,method:"GET",query:t,format:"json",...r});email_autosaves_create=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/email/${e}/autosaves`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});email_autosaves_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/email/${e}/autosaves/${t}`,method:"GET",query:r,format:"json",...n})},fn=class{http;constructor(e){this.http=e}emailtags_list=(e,t={})=>this.http.request({path:"/wp/v2/emailtags",method:"GET",query:e,format:"json",...t});emailtags_create=(e,t={})=>this.http.request({path:"/wp/v2/emailtags",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});emailtags_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"GET",query:t,format:"json",...r});emailtags_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});emailtags_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});emailtags_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});emailtags_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/emailtags/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},_n=class{http;constructor(e){this.http=e}group_list=(e,t={})=>this.http.request({path:"/wp/v2/group",method:"GET",query:e,format:"json",...t});group_create=(e,t={})=>this.http.request({path:"/wp/v2/group",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});group_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"GET",query:t,format:"json",...r});group_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});group_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});group_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});group_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/group/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},mn=class{http;constructor(e){this.http=e}notification_list=(e,t={})=>this.http.request({path:"/wp/v2/notification",method:"GET",query:e,format:"json",...t});notification_create=(e,t={})=>this.http.request({path:"/wp/v2/notification",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});notification_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"GET",query:t,format:"json",...r});notification_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});notification_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});notification_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});notification_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});notification_autosaves_list=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/notification/${e}/autosaves`,method:"GET",query:t,format:"json",...r});notification_autosaves_create=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/notification/${e}/autosaves`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});notification_autosaves_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/notification/${e}/autosaves/${t}`,method:"GET",query:r,format:"json",...n})},yn=class{http;constructor(e){this.http=e}project_list=(e,t={})=>this.http.request({path:"/wp/v2/project",method:"GET",query:e,format:"json",...t});project_create=(e,t={})=>this.http.request({path:"/wp/v2/project",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});project_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"GET",query:t,format:"json",...r});project_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});project_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});project_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});project_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/project/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});project_revisions_list=({parent:e,...t},r={})=>this.http.request({path:`/wp/v2/project/${e}/revisions`,method:"GET",query:t,format:"json",...r});project_revisions_detail=({parent:e,id:t,...r},n={})=>this.http.request({path:`/wp/v2/project/${e}/revisions/${t}`,method:"GET",query:r,format:"json",...n});project_revisions_delete=({parent:e,id:t,...r},n,s={})=>this.http.request({path:`/wp/v2/project/${e}/revisions/${t}`,method:"DELETE",body:n,type:d.UrlEncoded,format:"json",...s})},En=class{http;constructor(e){this.http=e}subscription_list=(e,t={})=>this.http.request({path:"/wp/v2/subscription",method:"GET",query:e,format:"json",...t});subscription_create=(e,t={})=>this.http.request({path:"/wp/v2/subscription",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});subscription_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"GET",query:t,format:"json",...r});subscription_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});subscription_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});subscription_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});subscription_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/subscription/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n})},gn=class{http;constructor(e){this.http=e}users_register_create=(e={})=>this.http.request({path:"/wp/v2/users/register",method:"POST",...e});users_lostpassword_create=(e={})=>this.http.request({path:"/wp/v2/users/lostpassword",method:"POST",...e});users_lost_password_create=(e={})=>this.http.request({path:"/wp/v2/users/lost-password",method:"POST",...e});users_list=(e,t={})=>this.http.request({path:"/wp/v2/users",method:"GET",query:e,format:"json",...t});users_create=(e,t={})=>this.http.request({path:"/wp/v2/users",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});users_detail=({id:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"GET",query:t,format:"json",...r});users_create2=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});users_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"PUT",body:r,type:d.UrlEncoded,format:"json",...n});users_partial_update=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"PATCH",body:r,type:d.UrlEncoded,format:"json",...n});users_delete=({id:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}`,method:"DELETE",body:r,type:d.UrlEncoded,format:"json",...n});users_me_list=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"GET",query:e,format:"json",...t});users_me_create=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"POST",body:e,type:d.UrlEncoded,format:"json",...t});users_me_update=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"PUT",body:e,type:d.UrlEncoded,format:"json",...t});users_me_partial_update=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"PATCH",body:e,type:d.UrlEncoded,format:"json",...t});users_me_delete=(e,t={})=>this.http.request({path:"/wp/v2/users/me",method:"DELETE",body:e,type:d.UrlEncoded,format:"json",...t});users_application_passwords_list=({userId:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords`,method:"GET",query:t,format:"json",...r});users_application_passwords_create=({userId:e,...t},r,n={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords`,method:"POST",body:r,type:d.UrlEncoded,format:"json",...n});users_application_passwords_delete=({userId:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords`,method:"DELETE",format:"json",...r});users_application_passwords_introspect_list=({userId:e,...t},r={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/introspect`,method:"GET",query:t,format:"json",...r});users_application_passwords_detail=({userId:e,uuid:t,...r},n={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"GET",query:r,format:"json",...n});users_application_passwords_create2=({userId:e,uuid:t,...r},n,s={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"POST",body:n,type:d.UrlEncoded,format:"json",...s});users_application_passwords_update=({userId:e,uuid:t,...r},n,s={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"PUT",body:n,type:d.UrlEncoded,format:"json",...s});users_application_passwords_partial_update=({userId:e,uuid:t,...r},n,s={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"PATCH",body:n,type:d.UrlEncoded,format:"json",...s});users_application_passwords_delete2=({userId:e,uuid:t,...r},n={})=>this.http.request({path:`/wp/v2/users/${e}/application-passwords/${t}`,method:"DELETE",format:"json",...n})},bn={aiGenerator:[Kr,Jr,Yr],app:[Xr],corsProxy:[zr],jwtAuth:[Qr],projects:[Zr],promo:[en,tn],saveFile:[rn,nn,sn,on,an,cn],translations:[un],userToProject:[dn],wp:[ln,hn,pn,We,Ve,fn,_n,mn,yn,En,gn]},vn=f("prewarm.networkActivity");function On(){let e=0;const t=new Set,r=()=>{t.forEach(n=>n())};return{begin(){e+=1,r();let n=!1;return()=>{n||(n=!0,e-=1,r())}},inFlight:()=>e,watch(n){return t.add(n),()=>t.delete(n)}}}function Ke(e){return e.getOrCreateInstance(vn,()=>On())}var Tn=Symbol("rest.publicRequest"),Je=f("rest.requestHandler"),In=f("rest.responseHandler"),de=f("rest.customFetch"),le=f("rest_transport"),An=e=>{e.inject(de,{execute:async(t,r={})=>{const n=e.getServices(Je),s={public:r[Tn]===!0},o=Ke(e).begin();try{let i=t instanceof Request?t:new Request(t,r);for(const l of n){const h=await l.execute(i,s);h instanceof Request&&(i=h)}let c=await fetch(i);const a=e.getServices(In);for(const l of a)c=await l.execute(c);return c}finally{o()}}})};function Pn(e,t){const r=e.getInstance(le);if(!r)throw new Error("[restApi] транспорт не зарегистрирован в контейнере");return Object.assign({},...t.map(n=>new n(r)))}var Sn=3e5,S=new Map,q=new Map,Ye=new Set(["generic","stockImages","emFiles","cdn"]),Dn=/^https:\/\/(?:media\d*|i)\.giphy\.com\/media/i,wn=/^https:\/\/api\.giphy\.com\/v1\/gifs/i,Cn=/^https:\/\/images\.unsplash\.com/i,jn=/^https:\/\/api\.unsplash\.com/i,Rn=/^https:\/\/assets\.streamlinehq\.com/i,Nn=/^https:\/\/public-api\.streamlinehq\.com/i;function W(e){return typeof e=="string"&&e.trim().length>0}function Ln(){const e="https://px0.racs.rest/";if(W(e))return e;const t={}.REACT_APP_UNSPLASH_PROXY;return W(t)?t:void 0}function Xe(){return{stockImagesProxyUrl:"https://api.emailmaker.ru/services/stock_images",stockImagesProxyUrlApi:"https://api.emailmaker.ru/services/stock_images_api",genericProxyUrl:Ln()}}function qn(e){const t=[],{stockImagesProxyUrl:r,stockImagesProxyUrlApi:n,genericProxyUrl:s}=Xe();return n&&t.push({id:"mode-default-stock-images-api",match:"https://api.unsplash.com/{path}",proxyBase:n,rewrite:"{path}?proxy_url={origin}{search}{hash}"}),r&&t.push({id:"mode-default-stock-images-cdn",match:"https://images.unsplash.com/{path}",proxyBase:r,rewrite:"{path}?proxy_url={origin}{search}{hash}"}),s&&t.push({id:"mode-default-generic",proxyBase:s,rewrite:"{path}?proxy_url={origin}{search}{hash}"}),t.length>0?t:void 0}function ze(e){return!!e}var Un=()=>{if(!(typeof window>"u"))return window.location.origin};function xn(e){const t=Un();if(!t)return!1;try{return new URL(e).origin===t}catch{return!1}}function kn(e,t){try{const r=new URL(e).hostname.toLowerCase();return t.find(n=>n.toLowerCase()===r)??null}catch{return null}}function $n(e,t){return t?!1:e==="downloadBlob"||e==="display"}function Mn(e){const t=e.trim();return t?t.replace(/:\d+$/,""):""}function Fn(e,t){if(!t.proxySameOrigin&&xn(e))try{return{skipReason:"same-origin",matchedHost:new URL(e).hostname}}catch{return null}const r=kn(e,t.directHosts);return r?{skipReason:"direct-host",matchedHost:r}:null}function Bn(e){const t=[];for(const r of e){if(Array.isArray(r)){for(const n of r)t.push(n);continue}t.push(r)}return t}function Gn(e){const t=new Set,r=[];for(const n of e){const s=I(typeof n=="string"?n:n.proxyBase||"");s&&t.has(s)||(s&&t.add(s),r.push(n))}return r}function he(e){return e?.backendProxy}function I(e){return e.replace(/\/$/,"")}function pe(e){return/^https?:\/\//i.test(e)}function Hn(e){return e==="/"?"":e.replace(/\/$/,"")}function U(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function fe(e){const t=new Set;return e.filter(r=>!r.url||t.has(r.url)?!1:(t.add(r.url),!0))}function _e(){return"https://emcdn.ru"}function Qe(e){return!U(e)||"match"in e||"rewrite"in e||"proxyBase"in e?!1:Object.keys(e).some(t=>Ye.has(t))}function Ze(e){if(e!=null)return U(e)&&("value"in e||"replace"in e)?e.value:e}function et(e,t="generic",r=!1){const n=st(e,r);if(n)return Qe(n)?Ze(n[t]??n.generic):n}function tt(e,t=!1){const r=st(e,t);return r?Qe(r)?Object.keys(r).filter(n=>Ye.has(n)).map(n=>Ze(r[n])).filter(Boolean):[r]:[]}function Wn(e){const t=he(e);return t?[t]:[]}function Vn(e,t=!1){if(ze(t))return{proxyBlobFetch:!0,proxyImgSrc:!0,proxyCdn:!0,proxyEmFiles:!0,proxyStockImages:!0};const{stockImagesProxyUrl:r,stockImagesProxyUrlApi:n}=Xe();return{proxyBlobFetch:!0,proxyImgSrc:!1,proxyCdn:!1,proxyEmFiles:!1,proxyStockImages:W(r)||W(n)}}function rt(e){const t=[],r=new Set;for(const n of e){const s=Mn(n);if(!s)continue;const o=s.toLowerCase();r.has(o)||(r.add(o),t.push(s))}return t}function nt(e){return e?Array.isArray(e)?rt(e):rt(e.value??[]):[]}function Kn(e,t){return[...new Set([...e,...t])]}function Jn(e){const t=e?.canvasImageCache;if(t===!1)return[];const r=t===!0||t===void 0?{}:t;return r.enabled===!1?[]:r.sourceHosts===void 0?[]:nt(r.sourceHosts)}function Yn(e,t){return{inheritDefaults:!e,proxySameOrigin:!1,directHosts:[],...Vn(t,e)}}function x(e,t=!1){const r=Yn(t,e),n=e?.resourceProxyPolicy??{};return{inheritDefaults:n.inheritDefaults??r.inheritDefaults,proxySameOrigin:n.proxySameOrigin??r.proxySameOrigin,directHosts:Kn(Jn(e),n.directHosts!==void 0?nt(n.directHosts):r.directHosts),proxyBlobFetch:n.proxyBlobFetch??r.proxyBlobFetch,proxyImgSrc:n.proxyImgSrc??r.proxyImgSrc,proxyCdn:n.proxyCdn??r.proxyCdn,proxyEmFiles:n.proxyEmFiles??r.proxyEmFiles,proxyStockImages:n.proxyStockImages??r.proxyStockImages,recoveryTtlMs:n.recoveryTtlMs??r.recoveryTtlMs}}function Xn(e,t=!1){return x(e,t).inheritDefaults}function zn(e,t=!1){const r=x(e,t).recoveryTtlMs;return typeof r=="number"&&r>0?r:Sn}function st(e,t=!1){const r=e?.resourceProxy;if(!Xn(e,t))return r;const n=qn(e);if(r===void 0)return n;const s=Wr([n,r]);return Array.isArray(s)?Gn(Bn(s)):s}function Qn(e){return{proxyEmFiles:!0,proxyAi:!1}}function me(e,t,r,n=!1){const s=x(r,n);if(t==="display")return e==="stockImages"?s.proxyStockImages:s.proxyImgSrc;switch(e){case"cdn":return s.proxyCdn;case"emFiles":return s.proxyEmFiles;case"stockImages":return s.proxyStockImages;default:return s.proxyBlobFetch}}function Zn(e,t,r,n=!1){return e==="stockImages"&&me("stockImages",t,r,n)}function es(e,t){const r=Qn(t),n=t?.backendProxyPolicy;switch(e){case"emFiles":return n?.proxyEmFiles??r.proxyEmFiles;case"ai":return n?.proxyAi??r.proxyAi;default:return!0}}var ts={url:".+",url_encoded:".+",origin:"https?:\\/\\/[^\\/?#]+",origin_encoded:".+",proxy_url:"https?:\\/\\/[^\\/?#]+",proxy_url_encoded:".+",path:"[^?#]*",pathname:"[^?#]*",path_with_slash:"\\/[^?#]*",pathname_with_slash:"\\/[^?#]*",query:"[^#]*",search:"\\?[^#]*",hash:"#.*",fragment:".*",pathname_after_wp_json:"[^?#]*",pathname_after_wp_json_with_slash:"\\/[^?#]*",rest_namespace:"[^/?#]*",rest_version:"[^/?#]*",rest_route:"[^?#]*",rest_route_with_slash:"\\/[^?#]*"};function rs(e){const t=[],r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\{([a-z_]+)\\\}/gi,(n,s)=>(t.push(s),`(${ts[s]||".+"})`));return{regex:new RegExp(`^${r}$`,"i"),tokens:t}}function ns(e){return/[?#]/.test(e)||/\{(?:url|url_encoded|query|search|hash|fragment)\}/i.test(e)}function ss(e,t){if(ns(t))return e;try{const r=new URL(e);return`${r.origin}${r.pathname}`}catch{return e.split(/[?#]/)[0]||e}}function os(e,t,r){if(r.endsWith("_encoded"))return!0;const n=e.slice(0,t),s=n.lastIndexOf("#"),o=n.lastIndexOf("?"),i=n.lastIndexOf("&"),c=n.lastIndexOf("=");return c>Math.max(o,i)&&c>s}function is(e){try{const t=new URL(e),r=t.pathname.replace(/^\/+/,""),n=t.search.replace(/^\?/,""),s=t.hash.replace(/^#/,""),o=r.replace(/^wp-json\/?/i,""),i=o?`/${o}`:"/",c=o.match(/^([^/]+)(?:\/([^/]+))?(?:\/(.*))?$/),a=c?.[1]||"",l=c?.[2]||"",h=c?.[3]||"";return{url:e,url_encoded:encodeURIComponent(e),origin:t.origin,origin_encoded:encodeURIComponent(t.origin),proxy_url:t.origin,proxy_url_encoded:encodeURIComponent(t.origin),path:r,pathname:r,path_with_slash:t.pathname||"/",pathname_with_slash:t.pathname||"/",query:n,search:t.search,hash:t.hash,fragment:s,pathname_after_wp_json:o,pathname_after_wp_json_with_slash:i,rest_namespace:a,rest_version:l,rest_route:h,rest_route_with_slash:h?`/${h}`:"/"}}catch{return}}function k(e,t){if(!e)return{};if(Array.isArray(e)){for(const c of e){const a=k(c,t);if(a!==void 0)return a}return}if(e==="*")return{};const r=ss(t,e),{regex:n,tokens:s}=rs(e),o=n.exec(r);if(!o)return;const i={};return s.forEach((c,a)=>{i[`matched_${c}`]=o[a+1]||""}),i}function A(e,t,r={}){const n=is(t);if(!n)return t;const s={...n,...r};let o="",i=0;const c=/\{([a-z_]+)\}/gi;let a;for(;a=c.exec(e);){o+=e.slice(i,a.index);const l=s[a[1]]??"",h=os(e,a.index,a[1])?encodeURIComponent(l):l;o+=h,i=a.index+a[0].length}o+=e.slice(i);try{const l=new URL(o),h=new URL(t);return!o.includes("{search}")&&!o.includes("{query}")&&h.search&&h.searchParams.forEach((_,y)=>{l.searchParams.has(y)||l.searchParams.append(y,_)}),!o.includes("{hash}")&&!o.includes("{fragment}")&&h.hash&&!l.hash&&(l.hash=h.hash),l.toString()}catch{return o}}function V(e,t){try{const r=new URL(t);return`${I(e)}/${r.pathname.replace(/^\//,"")}${r.search}${r.hash}`}catch{return t}}function K(e,t){const r=I(e);return t?pe(t)?t:t.startsWith("?")||t.startsWith("#")?`${r}${t}`:`${r}${t.startsWith("/")?"":"/"}${t}`:r}function ot(e,t,r,n){const s=e.match;return s?Array.isArray(s)?s.some(o=>ot({...e,match:o},t,r,n)):typeof s=="function"?!!s({url:t,resourceType:r,intent:n}):s==="*"?!0:k(s,t)!==void 0:!0}function as(e,t,r,n,s,o){if(e==null)return[];const i=Array.isArray(e)?e:[e],c=[];return i.forEach((a,l)=>{if(!a)return;if(typeof a=="string"){const m=a.includes("{")&&a.includes("}")?A(a,t):V(a,t);c.push({key:`${r}:${l}`,url:m,source:n});return}if(!U(a)||!("rewrite"in a))return;const h=a;if(!ot(h,t,s,o))return;const _=typeof h.match=="string"||Array.isArray(h.match)?k(h.match,t)||{}:{},y=typeof h.proxyBase=="string"&&h.proxyBase.trim()?h.proxyBase.trim():void 0;(Array.isArray(h.rewrite)?h.rewrite:[h.rewrite]).filter(Boolean).forEach((m,b)=>{const E=typeof m=="function"?(()=>{const P=m({url:t,proxyBase:y,resourceType:s,intent:o,..._}),j=y&&!pe(P)?K(y,P):P;return j.includes("{")&&j.includes("}")?A(j,t,_):j})():y?A(K(y,m),t,_):m.includes("{")&&m.includes("}")?A(m,t,_):V(m,t);c.push({key:`${r}:${h.id||"rule"}:${l}:${b}`,url:E,source:n})})}),fe(c)}function it(e,t,r,n){const s=e.match;return s?Array.isArray(s)?s.some(o=>it({...e,match:o},t,r,n)):typeof s=="function"?!!s({url:t,method:n,requestType:r}):s==="*"?!0:k(s,t)!==void 0:!0}function cs(e,t,r,n="generic"){if(e==null)return[];const s=Array.isArray(e)?e:[e],o=[];return s.forEach((i,c)=>{if(!i)return;if(typeof i=="string"){const _=i.includes("{")&&i.includes("}")?A(i,t):V(i,t);o.push({key:`backend:${c}`,url:_,source:"resource"});return}if(!U(i)||!("rewrite"in i))return;const a=i;if(!it(a,t,n,r))return;const l=typeof a.match=="string"||Array.isArray(a.match)?k(a.match,t)||{}:{},h=typeof a.proxyBase=="string"&&a.proxyBase.trim()?a.proxyBase.trim():void 0;(Array.isArray(a.rewrite)?a.rewrite:[a.rewrite]).filter(Boolean).forEach((_,y)=>{const m=typeof _=="function"?(()=>{const b=_({url:t,proxyBase:h,method:r,requestType:n,...l}),E=h&&!pe(b)?K(h,b):b;return E.includes("{")&&E.includes("}")?A(E,t,l):E})():h?A(K(h,_),t,l):_.includes("{")&&_.includes("}")?A(_,t,l):V(_,t);o.push({key:`backend:${a.id||"rule"}:${c}:${y}`,url:m,source:"resource"})})}),fe(o)}function us(e,t,r){return[e,...r.map(n=>n.url)].join("|")}function ds(e,t){if(!e||t.length<2)return t;const r=S.get(e);if(!r?.activeUrl)return t;const n=t.find(s=>s.url===r.activeUrl);return n?[n,...t.filter(s=>s.url!==r.activeUrl)]:t}function at(e){e&&q.get(e)?.forEach(t=>{try{t()}catch{}})}function ls(e,t){if(!e)return()=>{};const r=q.get(e)||new Set;return r.add(t),q.set(e,r),()=>{const n=q.get(e);n&&(n.delete(t),n.size===0&&q.delete(e))}}function ct(e,t){if(!e)return!1;const r=S.get(e);return!!r?.failedUntil&&r.activeUrl===t.url&&r.failedUntil>Date.now()}function hs(e,t){const r=ds(e,t);if(!e||r.length<2)return r;const n=[],s=[];return r.forEach(o=>{ct(e,o)?s.push(o):n.push(o)}),[...n,...s]}function ut(e,t){if(!e)return;const r=S.get(e);S.set(e,{activeUrl:t.url}),(r?.activeUrl!==t.url||r?.failedUntil)&&at(e)}function dt(e,t,r,n=!1){if(!e)return;const s=zn(r,n),o={activeUrl:t.url,failedUntil:Date.now()+s},i=S.get(e);S.set(e,o),(i?.activeUrl!==o.activeUrl||i?.failedUntil!==o.failedUntil)&&at(e)}function ps(e){return Rn.test(e)||Nn.test(e)}function fs(e){return Dn.test(e)||wn.test(e)}function ye(e){return ps(e)||fs(e)}function Ee(e,t){const r=_e();return r&&e.startsWith(I(r))?"cdn":Cn.test(e)||jn.test(e)?"stockImages":"generic"}function _s(e){try{const t=new URL(e);return/(?:^|\/)wp-json\/em-files\/v\d+(?:\/|$)/i.test(t.pathname)?"emFiles":/(?:^|\/)wp-json\/ai-generator\/v\d+(?:\/|$)/i.test(t.pathname)?"ai":"generic"}catch{return"generic"}}function ms(e,t){try{const r=new URL(e),n=new URL(t),s=Hn(n.pathname),o=s===""?!0:r.pathname===s||r.pathname.startsWith(`${s}/`);if(r.origin!==n.origin||!o)return null;const i=r.searchParams.get("url");if(i)return i;const c=r.searchParams.get("proxy_url");if(!c)return null;const a=new URL(c),l=s===""?r.pathname.replace(/^\/+/,""):r.pathname.slice(s.length).replace(/^\/+/,"");return a.pathname=l?`/${l}`:"/",r.searchParams.forEach((h,_)=>{_==="proxy_url"||_==="url"||a.searchParams.has(_)||a.searchParams.append(_,h)}),r.hash&&!a.hash&&(a.hash=r.hash),a.toString()}catch{return null}}function ge(e,t=[]){return e==null||(Array.isArray(e)?e:[e]).forEach(r=>{if(r){if(typeof r=="string"){const n=r.split("{")[0]?.trim();n&&t.push(I(n));return}!U(r)||!("rewrite"in r)||(typeof r.proxyBase=="string"&&r.proxyBase.trim()&&t.push(I(r.proxyBase.trim())),(Array.isArray(r.rewrite)?r.rewrite:[r.rewrite]).forEach(n=>{if(typeof n!="string")return;const s=n.split("{")[0]?.trim();s&&t.push(I(s))}))}}),t}function ys(e,t,r=!1){return tt(t,r).flatMap(n=>ge(n)).filter(Boolean).some(n=>n&&e.startsWith(n))}function Es(e,t){return Wn(t).flatMap(r=>ge(r)).filter(Boolean).some(r=>r&&e.startsWith(r))}function gs(e,t,r=!1){const n=tt(t,r).flatMap(s=>ge(s)).filter(Boolean);for(const s of n){const o=ms(e,s);if(o)return o}return null}function lt(e,t,r=!1){return ys(e,t,r)}function $(e,t,r=!1){return gs(e,t,r)||e}function bs(e,t,r,n=!1){return!!et(r,e,n)&&me(e,t,r,n)}function vs(e,t){return!!he(t)&&es(e,t)}function Os(e,t,r,n=!1){return ze(n)||t==="downloadBlob"?!1:e==="stockImages"?me(e,t,r,n):!1}function Ts(e,t={}){const r=t.config,n=$(e,r,t.standalone),s=t.resourceType||Ee(n,r),o=t.intent||"display";if(ye(n))return{resourceType:"generic",intent:o,candidates:[]};const i=bs(s,o,r,t.standalone)?as(et(r,s,t.standalone),n,s,"resource",s,o):[];return{resourceType:s,intent:o,candidates:i,stabilityKey:i.length?us(s,o,i):void 0}}function Is(e,t={}){const r=t.requestType||_s(e);return vs(r,t.config)?cs(he(t.config),e,t.method,r):[]}function M(e,t={},r){const n=t.intent||r;if(lt(e,t.config,t.standalone)){const a=$(e,t.config,t.standalone),l=t.resourceType||Ee(a,t.config),h={key:"already-proxied",url:e,source:"direct"};return{chain:{resourceType:l,intent:n,candidates:[h]},candidates:[h]}}const s=$(e,t.config,t.standalone),o=t.resourceType||Ee(s,t.config),i=Os(o,n,t.config,t.standalone);if($n(n,i)&&!ye(s)&&!Zn(o,n,t.config,t.standalone)){const a=Fn(s,x(t.config,t.standalone));if(a){const l={key:`direct-${a.skipReason}`,url:s,source:"direct"};return{chain:{resourceType:o,intent:n,candidates:[l],directShortCircuit:a},candidates:[l]}}}const c=Ts(s,{...t,intent:n,resourceType:o});return{chain:c,candidates:fe([...hs(c.stabilityKey,c.candidates),...i?[]:[{key:"direct",url:s,source:"direct"}]])}}function ht(e,t,r={},n){const{chain:s,candidates:o}=M(e,r,n),i=o.find(c=>c.url===t);return!i||i.source!=="resource"?null:{chain:s,candidate:i}}function As(e,t,r={}){const n=ht(e,t,r,"display");n&&ut(n.chain.stabilityKey,n.candidate)}function Ps(e,t,r={}){const n=ht(e,t,r,"display");n&&dt(n.chain.stabilityKey,n.candidate,r.config,r.standalone)}function J(e,t,r,n=!1){return{src:e,changed:r,exhausted:n,reason:t}}var Ss=class extends Error{final=!0;skipReason;hostname;constructor(e,t){super(`Direct resource fetch failed (${e}: ${t}). ${e==="same-origin"?"The same-origin asset is unreachable; check that the resource exists and is served by the editor origin.":"Add CORS headers for the editor origin or remove the host from directHosts."}`),this.name="DirectResourceFetchError",this.skipReason=e,this.hostname=t}};function Ds(e,t){return new Ss(e,t)}function ws(e){if(e instanceof Error&&e.name==="AbortError")return!1;if(e instanceof TypeError)return!0;if(e instanceof Error){if(e.message==="Proxy validation failed")return!1;if(e.message.startsWith("Proxy fetch failed with status"))return!0}return!0}function Cs(e,t=!1){const r=x(e,t);return{inheritDefaults:r.inheritDefaults,proxySameOrigin:r.proxySameOrigin,directHosts:[...r.directHosts]}}function js(e){return e.length>0&&e.every(t=>t.source==="direct")}function Rs(e,t,r){return e.directShortCircuit?e.directShortCircuit.skipReason:t.length===1&&t[0]?.source==="direct"&&ye(r)?"direct-only-vendor":null}function Ns(e,t,r){return e.directShortCircuit||r==="direct-only-vendor"||js(t)?"direct":"proxy"}function Ls(e,t={}){const{chain:r,candidates:n}=M(e,t,t.intent||"display"),s=r.stabilityKey?S.get(r.stabilityKey):void 0,o=n[0]?.url||e,i=Rs(r,n,$(e,t.config,t.standalone)),c=Cs(t.config,t.standalone);return{originalUrl:e,resourceType:r.resourceType,intent:r.intent,stabilityKey:r.stabilityKey,currentSrc:o,runtimeState:s?{...s}:void 0,decision:Ns(r,n,i),skipReason:i,matchedHost:r.directShortCircuit?.matchedHost,policy:c,candidates:n.map(a=>({...a,isCurrent:a.url===o,isFailed:ct(r.stabilityKey,a),failedUntil:s?.activeUrl===a.url?s?.failedUntil:void 0}))}}function qs(e,t={}){let r=M(e,t,"display"),n=r.candidates,s=n[0]?.url||e,o=Math.max(0,n.findIndex(c=>c.url===s));const i=()=>{const c=M(e,t,"display"),a=c.candidates,l=a[0]?.url||e;return!l||l===s?(r=c,n=a,o=Math.max(0,a.findIndex(h=>h.url===s)),J(s,"unchanged",!1)):(r=c,n=a,s=l,o=Math.max(0,a.findIndex(h=>h.url===s)),J(s,"runtime-update",!0))};return{get src(){return s},get stabilityKey(){return r.chain.stabilityKey},handleChangeSrc:()=>i(),handleSuccess:()=>{As(e,s,t)},handleError:()=>{Ps(e,s,t);const c=i();if(c.changed&&c.src)return c;const a=n[o+1];return!a||a.url===s?J(null,"exhausted",!1,!0):(s=a.url,o+=1,J(s,"candidate-fallback",!0))},subscribeToSrcChange:c=>{const a=()=>{const l=i();l.changed&&c(l)};return ls(r.chain.stabilityKey,a)},getDebugSnapshot:()=>Ls(e,t)}}async function Us(e,t={}){if(lt(e,t.config,t.standalone))return fetch(e,t.init);const r=t.config,{chain:n,candidates:s}=M(e,t,t.intent||"downloadBlob");let o;for(const i of s)try{const c=await fetch(i.url,t.init);if(!c.ok)throw new Error(`Proxy fetch failed with status ${c.status}`);if(t.validateBlob){const a=await c.clone().blob();if(!await t.validateBlob(a))throw new Error("Proxy validation failed")}return i.source==="resource"&&ut(n.stabilityKey,i),c}catch(c){o=c,i.source==="resource"&&dt(n.stabilityKey,i,r,t.standalone)}throw n.directShortCircuit&&s.length===1&&s[0]?.source==="direct"&&ws(o)?Ds(n.directShortCircuit.skipReason,n.directShortCircuit.matchedHost):o instanceof Error?o:new Error("Failed to fetch resource through proxy chain")}function pt(e,t={}){return Es(e,t.config)?[e]:Is(e,t).map(r=>r.url)}function xs(e,t){const r=_e(),n=t.filter(Boolean).map(s=>String(s).replace(/^\/+|\/+$/g,""));return r?`${I(r)}/${n.join("/")}`:n.join("/")}function ks(e,t){const r=_e();return!!r&&e.startsWith(I(r))}function D(e){for(;e.endsWith("/");)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}function $s(...e){const t=e.filter(o=>o!=null);if(t.length===0)return;if(t.length===1)return t[0];const r=t.find(o=>o.aborted);if(r)return r;if(typeof AbortSignal<"u"&&typeof AbortSignal.any=="function")return AbortSignal.any(t);const n=new AbortController,s=o=>{n.signal.aborted||n.abort(o.reason)};for(const o of t)o.addEventListener("abort",()=>s(o),{once:!0});return n.signal}var ft=3e5,_t=15e3,g=null,mt=!1;function Ms(){return!0}function Fs(){const e=String({}.REACT_APP_OPENAPI_FAILOVER_TTL_MS||"").trim();if(!e)return ft;const t=Number(e);return Number.isFinite(t)&&t>0?t:ft}function yt(){const e=String({}.REACT_APP_OPENAPI_FAILOVER_ATTEMPT_TIMEOUT_MS||"").trim();if(!e)return _t;const t=Number(e);return Number.isFinite(t)&&t>0?t:_t}function Bs(){const e="https://app.emailmaker.ru/api/".trim();return e?D(e):void 0}function Gs(e){const t=e.trim();if(!t)return[];if(t.startsWith("["))try{const r=JSON.parse(t);if(!Array.isArray(r))throw new Error("expected JSON array");return r.map(n=>String(n).trim()).filter(Boolean)}catch{return mt||(mt=!0),[]}return t.split(",").map(r=>r.trim()).filter(Boolean)}function Hs(e){const t=new Set,r=[];for(const n of e){const s=D(n);t.has(s)||(t.add(s),r.push(s))}return r}function Et(e){const t=String(e||"").trim();return t?D(t):Bs()}function gt(e,t=[]){return e?Hs([e,...t]).slice(0,3):[]}function bt(){return Gs(String({}.REACT_APP_OPENAPI_FAILOVER_BASE_URLS||"").trim())}function Ws(e=Date.now()){return g?e-g.switchedAt>=Fs():!0}function vt(e=Date.now()){g&&Ws(e)&&(g=null)}function Y(e){if(!Ms())return!1;const t=Et(e);if(!t)return!1;const r=bt();return r.length===0?!1:gt(t,r).length>1}function F(e){const t=Et(e);if(!t)return[];const r=bt();return r.length===0?[t]:gt(t,r)}function be(e){const t=F(e);if(t.length===0)return"";if(vt(),g){const r=t.indexOf(g.activeUrl);if(r>=0)return t[r]}return t[0]}function Ot(e){const t=F(e);if(t.length<=1||(vt(),!g||!t.includes(g.activeUrl)))return t;const r=g.activeUrl;return[r,...t.filter(n=>n!==r)]}function Vs(){return yt()}function Ks(e){return be(e)||void 0}function Tt(e){const t=e||void 0;if(typeof AbortController>"u")return{signal:t,timeoutError:()=>{},done:()=>{}};const r=yt(),n=new AbortController;let s;const o=setTimeout(()=>{s=Js(r),n.abort(s)},r);return{signal:$s(t,n.signal),timeoutError:()=>s,done:()=>clearTimeout(o)}}function Js(e){const t=`[apiOriginFailover] origin attempt timed out after ${e}ms`;if(typeof DOMException=="function")return new DOMException(t,"TimeoutError");const r=new Error(t);return r.name="TimeoutError",r}function It(e){return e===502||e===503||e===504}function At(e){return!(e instanceof Error)&&!(e instanceof DOMException)?!1:e.name==="TimeoutError"?!0:e instanceof TypeError}var Ys;function ve(e,t){if(!Y(t))return;const r=F(t);if(r.length<=1)return;const n=r.indexOf(D(e));if(n<0)return;const s=n+1;if(s>=r.length)return;const o=r[s],i=g?.activeUrl;g={activeUrl:o,switchedAt:Date.now()},i!==o&&Ys?.()}function Pt(e,t){if(!Y(t))return;const r=D(e),n=F(t);if(n.includes(r)){if(r===n[0]){g=null;return}g?.activeUrl!==r&&(g={activeUrl:r,switchedAt:Date.now()})}}function St(){g=null}var Xs=e=>{const t=new FormData,r=(n,s,o)=>{if(s!=null){if(s instanceof Blob){n.append(o,s);return}if(Array.isArray(s)){s.forEach((i,c)=>{const a=o?`${o}[${c}]`:`${c}`;r(n,i,a)});return}if(typeof s=="object"){Object.keys(s).forEach(i=>{const c=s[i],a=o?`${o}[${i}]`:i;r(n,c,a)});return}n.append(o,String(s))}};return r(t,e),t},zs={baseUrl:D("https://app.emailmaker.ru/api/"),baseApiParams:{secure:!0,credentials:"same-origin",format:"json"},securityWorker:()=>({credentials:"same-origin"})},C=new Map;function Qs(e){const t=e?.getInstance(Ce);return t?t.get()??t.bootstrap():void 0}var Zs=class extends Vr{container;constructor(e={},t){super(e),this.container=t}buildRequestUrl(e){const{path:t,baseUrl:r,extraQuery:n}=e;let{query:s}=e;n&&(s=s?{...s,...n}:n);const o=s&&this.toQueryString(s);return`${r||this.baseUrl||""}${t}${o?`?${o}`:""}`}buildRequestKey(e,t){return`${t.toUpperCase()} ${e}`}getBackendProxyCandidates(e,t){const r=Qs(this.container),n=this.container?.getInstance(Re)!==void 0,s=pt(e,{config:r,method:t,standalone:n}),o=s.length>0?s:[e],i=this.buildRequestKey(e,t),c=C.get(i);return!c||!o.includes(c)?o:[c,...o.filter(a=>a!==c)]}shouldRetryResponse(e){return e.status===502||e.status===503||e.status===504}resolveFailoverBaseUrl(){return String(this.baseUrl||"").trim()||void 0}async requestOnOrigin(e,t,r=!1){const n={...e,baseUrl:t},s=this.buildRequestUrl(n),o=n.method||"GET",i=this.buildRequestKey(s,o),c=this.getBackendProxyCandidates(s,o);let a,l;for(const h of c){const _=m=>m===s?h:m,y=r?Tt(e.signal):void 0;try{const m=await super.request({...n,proxyHandler:_,...y?{signal:y.signal}:{}});if(!m.ok&&this.shouldRetryResponse(m)&&h!==c[c.length-1]){l=m,C.get(i)===h&&C.delete(i);continue}return C.set(i,h),m}catch(m){C.get(i)===h&&C.delete(i);const b=y?.timeoutError();if(b)throw b;if(a=m,(m instanceof DOMException||m instanceof Error)&&m.name==="AbortError")throw m}finally{y?.done()}}if(l)return l;throw a instanceof Error?a:new Error("Backend proxy chain failed")}async request(e){const t=String(e.baseUrl||"").trim();if(t)return this.requestOnOrigin(e,t);const r=this.resolveFailoverBaseUrl(),n=Y(r),s=e.failoverAttemptTimeout??n,o=n?Ot(r):r?[be(r)]:[this.baseUrl].filter(Boolean);if(o.length===0)return this.requestOnOrigin(e,this.baseUrl);let i,c;for(let a=0;a<o.length;a++){const l=o[a],h=a===o.length-1;try{const _=await this.requestOnOrigin(e,l,s);if(!_.ok&&It(_.status)){if(c=_,!h){ve(l,r);continue}break}return _.ok&&Pt(l,r),_}catch(_){if(!At(_))throw _;i=_,h||ve(l,r)}}if(n&&St(),c)return c;throw i instanceof Error?i:new Error("API origin failover chain failed")}};function Dt(e){for(const[t,r]of Object.entries(bn)){const n=r.map(o=>new o(e)),s=Object.assign({},...n);Object.assign(e,{[t]:s})}}function eo(e=zs){const t=new Map;return{create(r,n){const s=new Zs({...e,...r},n);return s.contentFormatters["multipart/form-data"]=Xs,Dt(s),t.set(s,{options:r,container:n}),s},getOptions(){return e},setOptions(r){e=r;for(const[n,s]of t)Object.assign(n,{...e,...s.options})}}}var wt=f("rest.clientFactory");function to(e){return e.getOrCreateInstance(wt,()=>eo())}function ro(e,t={}){const r=ce(e)?ke(e):e;return to(r).create(t,r)}var no=e=>{const t=e.getInstance(le);if(!t){so(e);return}Dt(t),e.inject(ue,t)},so=e=>{An(e);const t=ro(e,{customFetch:e.getInstance(de)?.execute||fetch});e.inject(ue,t),e.inject(le,t)},Oe;(function(e){const t="https://racs.emcdn.ru/v3";function r(s,o){const i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)};return fetch(`${t}?resource=${s}&dataset=${document.location.hostname}`,i)}e.post=r;async function n(s,o=0){const i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:`{"filter":{},"limit":${o}}`};return await(await fetch(`${t}/get?resource=${s}&dataset=${document.location.hostname}`,i)).json()}e.getAll=n})(Oe||(Oe={}));function oo(e){const t=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=atob(t),n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return new TextDecoder().decode(n)}function Ct(e){const[t,r,n]=e.split("."),s=JSON.parse(oo(r));return{exp:s.exp,createdAt:s.iat,data:s}}var X=f("plugin.auth.token"),jt=new WeakMap,io=3e4;function ao(e){let t;try{t=Ct(e).exp}catch{return!0}return typeof t!="number"||!Number.isFinite(t)?!0:t*1e3<=Date.now()+io}function Rt(e,t,r,n){const s=jt.get(e);s&&(s.stale=!0);const o={stale:!1};jt.set(e,o),e.injectFactory(X,async(i,c)=>{if(o.stale)return"";try{let a=await c||void 0;if(!a){const l=e.getInstance(je);l&&(a=await l)}return t?!a||ao(a)?await t(r,n,a):a:""}catch{return""}},!0)}var Nt=f("auth.oauthProvided"),Lt=new WeakMap;function qt(e,t){const r=Lt.get(e)??{applied:!1};(!r.applied||r.getAuthToken!==t.getAuthToken||!H(r.user,t.user)||r.project!==t.project)&&(Lt.set(e,{applied:!0,getAuthToken:t.getAuthToken,user:t.user,project:t.project}),Rt(e,t.getAuthToken,t.user,t.project))}function co(e){if(e.getInstance(Nt))return;e.inject(Nt,!0);let t;e.getInstance(we)?.watch(r=>{t=r}),e.addService(Je,{execute:async(r,n)=>{if(n?.public||!t?.getAuthToken)return;e.getInstance(X)===void 0&&qt(e,t);const s=await e.getInstanceAsync(X);s&&r.headers.set("authorization",`Bearer ${s}`)}})}var go=Ie(e=>(co(e),{setOptions(t){qt(e,t)}}));Object.defineProperty(u,"ADVANCED_SETTINGS_PANEL",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(u,"AIREST_CLIENT_ID",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(u,"APP_ID",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(u,"ATOMS_HANDLERS_ID",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(u,"AsyncEmitter",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(u,"BaseEmitter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(u,"CONFIG_CHANGED_EVENT_ID",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(u,"CONFIG_SOURCE_ID",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(u,"COOKIE_MANAGER_ID",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(u,"CUSTOM_FETCH_ID",{enumerable:!0,get:function(){return de}}),Object.defineProperty(u,"Container",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(u,"ContentType",{enumerable:!0,get:function(){return d}}),Object.defineProperty(u,"DISPOSABLE_ID",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(u,"DependencyResolver",{enumerable:!0,get:function(){return re}}),Object.defineProperty(u,"Disposable",{enumerable:!0,get:function(){return v}}),Object.defineProperty(u,"ELEMENT_MAP",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(u,"Emitter",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(u,"HANDLE_ATOM_INSERT_ID",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(u,"IMAGE_BLOB_RESOLVER_ID",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(u,"INIT_PIPELINE_ID",{enumerable:!0,get:function(){return or}}),Object.defineProperty(u,"INJECTION",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(u,"INSTANCE_ID",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(u,"JWT_ERROR_ID",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(u,"JWT_TOKEN_ID",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(u,"MESSAGE_SERVICE_ID",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(u,"MODAL_CLOSE_EVENT",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(u,"MODAL_SHOW_EVENT",{enumerable:!0,get:function(){return Rr}}),Object.defineProperty(u,"MODAL_UPDATE_EVENT",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(u,"MessageService",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(u,"NOT_IMPLEMENTED_IN_PLUGIN",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(u,"OPTIONS_SOURCE_ID",{enumerable:!0,get:function(){return we}}),Object.defineProperty(u,"RACS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(u,"REST_CLIENT_FACTORY_ID",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(u,"REST_CLIENT_ID",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(u,"SECURITY_MODULE_ID",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(u,"SETTINGS_PANEL_EVENT",{enumerable:!0,get:function(){return Cr}}),Object.defineProperty(u,"STANDALONE_ACTIVATED_ID",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(u,"STANDALONE_BOOTSTRAP_TOKEN_ID",{enumerable:!0,get:function(){return je}}),Object.defineProperty(u,"STANDALONE_FILE_PROXY_REGISTERED_ID",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(u,"STANDALONE_PROJECT_ID",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(u,"STORAGE_PROVIDER_ID",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(u,"STORE_ID",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(u,"Signal",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(u,"TEMPLATE_DIRECTIVES_ID",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(u,"TOKEN_ID",{enumerable:!0,get:function(){return X}}),Object.defineProperty(u,"V2REST_CLIENT_ID",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(u,"WpEblockApi",{enumerable:!0,get:function(){return We}}),Object.defineProperty(u,"WpEmailApi",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(u,"abandonStickyOrigin",{enumerable:!0,get:function(){return St}}),Object.defineProperty(u,"beginFailoverAttempt",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(u,"buildCdnFileUrl",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(u,"combineMixins",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(u,"createAbortError",{enumerable:!0,get:function(){return w}}),Object.defineProperty(u,"createIdentifier",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(u,"createIdentifier$1",{enumerable:!0,get:function(){return f}}),Object.defineProperty(u,"decodeJwt",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(u,"deepClone",{enumerable:!0,get:function(){return He}}),Object.defineProperty(u,"deepEqual",{enumerable:!0,get:function(){return H}}),Object.defineProperty(u,"defineMixin",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(u,"events",{enumerable:!0,get:function(){return se}}),Object.defineProperty(u,"fetchWithResourceProxy",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(u,"filter",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(u,"generateUUID",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(u,"getActiveBaseUrl",{enumerable:!0,get:function(){return be}}),Object.defineProperty(u,"getApi",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(u,"getContainer",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(u,"getEmitter",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(u,"getEvent",{enumerable:!0,get:function(){return er}}),Object.defineProperty(u,"getFailoverAttemptTimeoutMs",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(u,"getNetworkActivity",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(u,"getOrderedOriginCandidates",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(u,"getOriginChain",{enumerable:!0,get:function(){return F}}),Object.defineProperty(u,"getProxiedUrl",{enumerable:!0,get:function(){return qs}}),Object.defineProperty(u,"getServiceContainerId",{enumerable:!0,get:function(){return B}}),Object.defineProperty(u,"isAbortError",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(u,"isCdnUrl",{enumerable:!0,get:function(){return ks}}),Object.defineProperty(u,"isFailoverEnabled",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(u,"isStateContainer",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(u,"normalizeBaseUrl",{enumerable:!0,get:function(){return D}}),Object.defineProperty(u,"pickKey",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(u,"provideLegacyRestSections",{enumerable:!0,get:function(){return no}}),Object.defineProperty(u,"raceWithAbortSignal",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(u,"recreateTokenProvider",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(u,"reportOriginFailure",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(u,"reportOriginSuccess",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(u,"resolveBackendProxyRequestCandidates",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(u,"resolveContainer",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(u,"resolveExplicitApiBaseUrl",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(u,"shouldFailoverError",{enumerable:!0,get:function(){return At}}),Object.defineProperty(u,"shouldFailoverResponse",{enumerable:!0,get:function(){return It}}),Object.defineProperty(u,"snapshot",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(u,"throwIfAborted",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(u,"unwrapResourceProxyUrl",{enumerable:!0,get:function(){return $}}),Object.defineProperty(u,"waitForElement",{enumerable:!0,get:function(){return Le}})});
|
|
4
|
-
|
|
5
|
-
(function(){try{if(typeof document<"u"){var o='.blocks-app .ant-modal.premium-features-modal .ant-modal-container{border-radius:calc(var(--em-borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--em-borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--em-borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--em-borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .trial-suggest-modal{max-width:calc(100vw - 24px)}.blocks-app .trial-suggest-modal .ant-modal-container{border-radius:16px;padding:0;overflow:hidden}.blocks-app .trial-suggest-modal__layout{align-items:stretch;display:flex}.blocks-app .trial-suggest-modal__gallery{background:var(--em-colorFillQuaternary);flex:0 0 300px;width:300px;max-width:300px;position:relative;overflow:hidden}.blocks-app .trial-suggest-modal__slide-image{border-right:1px solid var(--em-colorFillSecondary);background-repeat:no-repeat;background-size:cover;transition:opacity .4s;position:absolute;inset:0}.blocks-app .trial-suggest-modal__content{flex:auto;min-width:0;max-width:100%;padding:32px}.blocks-app .trial-suggest-modal__badge{background:var(--em-colorPrimaryBg);color:var(--em-colorPrimary);border-radius:12px;margin-bottom:12px;padding:2px 10px;font-size:12px;font-weight:600;line-height:20px;display:inline-block}.blocks-app .trial-suggest-modal__title{color:var(--em-colorText);margin:0 0 8px;font-size:22px;font-weight:600;line-height:1.25}.blocks-app .trial-suggest-modal__intro{color:var(--em-colorTextSecondary);margin:0 0 16px}.blocks-app .trial-suggest-modal__features{margin:0 0 20px;padding:0;list-style:none}.blocks-app .trial-suggest-modal__features li{color:var(--em-colorText);align-items:flex-start;gap:10px;margin-bottom:10px;display:flex}.blocks-app .trial-suggest-modal__feature-icon,.blocks-app .trial-suggest-modal__promise-icon{flex:none;width:20px;height:20px;margin-top:2px;font-size:20px;line-height:20px}.blocks-app .trial-suggest-modal__feature-icon svg,.blocks-app .trial-suggest-modal__promise-icon svg{width:100%;height:100%}.blocks-app .trial-suggest-modal__feature-icon{color:var(--em-colorPrimary)}.blocks-app .trial-suggest-modal__promise{background:var(--em-colorFillQuaternary);color:var(--em-colorText);border-radius:8px;align-items:flex-start;gap:10px;margin:0 0 8px;padding:12px;display:flex}.blocks-app .trial-suggest-modal__promise-icon{color:var(--em-colorSuccess)}.blocks-app .trial-suggest-modal__note{color:var(--em-colorTextTertiary);margin:0 0 24px;font-size:12px;line-height:140%}.blocks-app .trial-suggest-modal__buttons{justify-content:space-between;align-items:center;gap:8px;display:flex}.blocks-app .trial-suggest-modal__decline.ant-btn{box-shadow:none;color:var(--em-colorTextSecondary);border:1px solid #0000}.blocks-app .trial-suggest-modal__decline.ant-btn:hover,.blocks-app .trial-suggest-modal__decline.ant-btn:focus,.blocks-app .trial-suggest-modal__decline.ant-btn:focus-visible,.blocks-app .trial-suggest-modal__decline.ant-btn:active{box-shadow:none;border:1px solid #0000;transform:none}.blocks-app .trial-suggest-modal__decline.ant-btn:hover:not(:disabled){background:var(--em-colorFillTertiary);color:var(--em-colorText)}@media (width<=720px){.blocks-app .trial-suggest-modal__layout{flex-direction:column}.blocks-app .trial-suggest-modal__gallery{flex:none;width:auto;max-width:none;height:180px}.blocks-app .trial-suggest-modal__content{padding:24px}}.blocks-app .user-list{z-index:10;background:#fff0;padding:1px;display:flex;position:absolute;bottom:10px;left:10px}.blocks-app .user{text-align:center;align-items:center;width:0;height:35px;margin-left:20px;transition:all .4s cubic-bezier(.645,.045,.355,1);display:flex;position:relative}.blocks-app .user:first-child{margin-left:0}.blocks-app .user-list.open .user:not(:first-child){margin-left:38px}.blocks-app .user:before{content:"";background:var(--em-user-color,white);border:1.5px solid var(--em-border-color,white);border-radius:50%;width:34px;height:34px;transition:all .2s cubic-bezier(.645,.045,.355,1);display:block;position:absolute}.blocks-app .user div{width:34px;color:var(--em-text-color,white);cursor:default;border-radius:50%;font-weight:600;line-height:40px;text-decoration:none;position:absolute}',e=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),i=o;if(!e.sheets[i]){var a=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(a=new CSSStyleSheet,a.replaceSync(o))}catch{a=null}if(a){if(!e.host||!e.host.isConnected||!e.host.sheet){var t=document.createElement("style");t.setAttribute("data-emailmaker","true"),document.head.appendChild(t),e.host=t}for(var s=e.host.sheet,r=0;r<a.cssRules.length;r++)try{s.insertRule(a.cssRules[r].cssText,s.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(o),(e.listeners||[]).forEach(function(l){try{l(o)}catch{}})}else{var t=document.createElement("style");t.setAttribute("data-emailmaker","true"),t.appendChild(document.createTextNode(o)),document.head.appendChild(t)}e.sheets[i]=!0,e.order.push(i)}}}catch(l){console.error("vite-plugin-css-injected-by-js",l)}})();
|
|
6
|
-
__emailmaker__.define("static/core/aea078c0.js",["require","exports","module","static/core/5dc34752.js","static/core/42f90c4f.js","react","react/jsx-runtime","__delivery__/libs","react-dom","vite/preload-helper"],function(ye,p,FD){const q=ye("./5dc34752.js"),O=ye("./42f90c4f.js");let R=ye("react"),H=q.__toESM(R,1);R=q.__toESM(R);let $=ye("react/jsx-runtime"),be=ye("__delivery__/libs"),mt=ye("react-dom");mt=q.__toESM(mt);let gt=ye("vite/preload-helper");var Gs=class{capacity;items=[];constructor(e){this.capacity=e}push(e){this.items.length>=this.capacity&&this.items.shift(),this.items.push(e)}snapshot(){return this.items.slice()}size(){return this.items.length}clear(){this.items=[]}};function Hs(e,t){return t+e}function jm(){return typeof performance>"u"?Date.now():Hs(performance.now(),performance.timeOrigin)}var Fm="emailmaker:diagnostics",Lm="diagnostics",Ji;function km(){try{const e=new URLSearchParams(window.location.search).get(Lm);return e===null?void 0:e!=="0"}catch{return}}function Um(){const e=window.__DIAGNOSTICS__;return typeof e=="boolean"?e:void 0}function Bm(){try{const e=window.localStorage.getItem(Fm);return e===null?void 0:e==="1"}catch{return}}function zs(){return Ji===void 0&&(Ji=typeof window>"u"?!1:km()??Um()??Bm()??!1),Ji}function Vs(e){return`__${(e||"emailmaker").toLowerCase().replaceAll("-","")}__`}var zt={initStart:"loader:init:start",coreReady:"loader:core:ready",initEnd:"loader:init:end",chunksLoaded:"app:chunks:loaded",showStart:"show:start",showEnd:"show:end",canvasCreated:"canvas:created",canvasLoaded:"canvas:loaded",canvasPainted:"canvas:painted",appVisible:"app:visible",editorVisible:"editor:visible",canvasSettled:"canvas:settled"},$m="app:mount:headless";function Ws(e){return e.some(t=>t.phase==="app:mount:headless")?"headless":"element"}var Qs=Object.values(zt),xm=[zt.canvasPainted,zt.canvasSettled,zt.appVisible,zt.editorVisible];function Ks(e){return e==="headless"?Qs.filter(t=>!xm.includes(t)):Qs}function qm(e){const t=new Set(e.map(r=>r.phase));return Ks(Ws(e)).filter(r=>!t.has(r))}var Gm=5e3,Hm=3e3,Ys="diagnosticsStore",vn,pr;function Xs(){return{marks:new Gs(Gm),resources:new Gs(Hm)}}function Vt(){if(pr)return pr;const e=Zi();return e?(pr=e[Ys]??vn??Xs(),e[Ys]=pr,vn=void 0,pr):(vn??=Xs(),vn)}function qe(e,t){zs()&&Vt().marks.push({phase:e,at:jm(),...t})}function zm(){return Js(),Vt().marks.snapshot()}function Vm(){return Vt().resources.snapshot()}function Wm(){const e=Vt();e.marks.clear(),e.resources.clear()}function Zi(){if(typeof window.__emailmaker__<"u"&&window.__emailmaker__)return window.__emailmaker__;if(typeof window>"u")return;const e=window[Vs()];return e!==null&&typeof e=="object"?e:void 0}function Qm(e){const t=e.length,r=Vt();return e.forEach(n=>r.marks.push(n)),e.length=0,t}function Js(){const e=Zi();return!e||!Array.isArray(e.diagnosticsBuffer)?0:Qm(e.diagnosticsBuffer)}var LD="[show-pipeline]";function Km(e){return e instanceof Error?`${e.name}: ${e.message}`:typeof e=="string"?e:JSON.stringify(e)??"undefined"}function Ym(e,t){}var pe=(function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e})({}),_n=e=>e.type===0?e.start-1:e.start,Xm=e=>e.type===0?e.end+1:e.end,yt=class Tm{start;end;children;parent;content;type=1;tag;closed=!1;startTagEnd;endTagStart;attributes;get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}createdBy;isDirty;get root(){return this.parent?this.parent.root:this}constructor(t,r,n,i){this.start=t,this.end=r,this.children=n,this.parent=i}isSameTag(t){return this.tag===void 0?t===void 0:t!==void 0&&this.tag.length===t.length&&this.tag.toLowerCase()===t}get firstChild(){return this.children[0]}get lastChild(){return this.children.length?this.children[this.children.length-1]:void 0}findNodeBefore(t){const r=eu(this.children,n=>t<=_n(n))-1;if(r>=0){const n=this.children[r];if(t>_n(n)){if(t<n.end)return n.findNodeBefore(t);const i=n.lastChild;return i&&i.end===n.end?n.findNodeBefore(t):n}}return this}findNodeAt(t){const r=eu(this.children,n=>t<=_n(n))-1;if(r>=0){const n=this.children[r];if(t>=_n(n)&&t<=Xm(n))return n.findNodeAt(t)}return this}find(t){if(t(this))return this;for(const r of this.children){const n=r.find(t);if(n)return n}}closest(t){let r=this;do if(t(r))return r;while(r=r.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(t,r=!0){const n=r?[this,...this.parents()]:this.parents();for(let i=n.length-1;i>=0;i--){const o=n[i];if(t(o))return o}}contains(t){return!!t.closest(r=>r===this)}clone(t=this.parent,r=this.start,n=!0){const i=this.start-r,o=new Tm(r,this.end-i,[],t);return o.children=n?this.children.map(a=>a.clone(o,a.start-i)):[],o.attributes={...this.attributes},o.closed=this.closed,o.content=this.content,o.startTagEnd=this.startTagEnd,o.endTagStart=this.endTagStart,o.tag=this.tag,o.type=this.type,o}},Jm=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function Zm(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}var Zs=Object.create(null);function eg(e,t){const r=Zs[e]||(Zs[e]=Object.create(null));let n=r[t];if(typeof n!="boolean"){const i=document.createElement(e)[Zm(t)];n=r[t]=typeof i<"u"&&typeof i!="boolean"}return n}function tg(e){const t=e.tag?.toLowerCase();let r="";if(t){const n=e.attributes;if(n){const i=Object.keys(n);for(const o of i){const a=n[o]===null?"":n[o];typeof a=="string"&&(r+=a===""&&o!=="em"&&!eg(t,o)?` ${o}`:` ${o}="${a.replaceAll('"',"'")}"`)}}}return r}function rg(e,t){if(e.start!==e.startTagEnd||t){const r=e.tag?.toLowerCase()||"div",n=tg(e);return r==="vk-snippet-end"?`<${r}${n}/>`:`<${r}${n}>`}return""}function eu(e,t){let r=0,n=e.length;if(n===0)return 0;for(;r<n;){const i=Math.floor((r+n)/2);t(e[i])?n=i:r=i+1}return r}function ng(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,r)=>r.toUpperCase())}function tu(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var ru=Object.create(null);function ig(e,t){const r=ru[e]||(ru[e]=Object.create(null));let n=r[t];if(typeof n!="boolean"){const i=document.createElement(e)[ng(t)];n=r[t]=typeof i<"u"&&typeof i!="boolean"}return n}function bn(e){return e.nodeType===Node.ELEMENT_NODE}function og(e){return bn(e)&&!e.ownerSVGElement}function ag(e){return e.tagName==="IMG"}function sg(e){return e.tagName==="AMP-IMG"}function ug(e){return e.tagName==="BODY"}function lg(e){return e.tagName==="FORM"}function cg(e){return e.tagName==="HTML"}function dg(e){return e.tagName==="SCRIPT"}function nu(e){return e.tagName==="STYLE"}function iu(e){return e.nodeType===Node.DOCUMENT_NODE}function fg(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function pg(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var eo;(function(e){function t(f){return f.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function r(f){return f.constructor.name==="CSSImportRule"}e.isImportRule=r;function n(f){return f.constructor.name==="CSSMediaRule"}e.isMediaRule=n;function i(f){return f.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=i;function o(f){return f.constructor.name==="CSSPageRule"}e.isPageRule=o;function a(f){return f.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=a;function s(f){return f.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=s;function l(f){return f.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function u(f){return f.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=u;function c(f){return f.constructor.name==="CSSSupportsRule"}e.isSupportsRule=c;function d(f){return f.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(eo||(eo={}));function to(e){return e.nodeType===Node.COMMENT_NODE}function hg(e){return e&&!!e.host&&!!e.mode}function ro(e){const t=e.getRootNode()||window.document;return hg(t)?t:null}var mg=/(<!(--)?\[if\s[()\w\s|&!]+\]>(?:<!--+>)?)((?:.|\r|\n)*?)((?:<!--)?<!\[endif\]\2>)/gi;function gg(e){const t=hr(e).matchAll(mg);if(t)for(const r of t){const[,n,,i,o]=r;return{open:n,close:o,content:i}}}function no(e){return e.nodeType===Node.TEXT_NODE}function yg(e){return e.tagName==="TABLE"}async function vg(e,t=5e3){return typeof e.complete<"u"&&!e.complete?new Promise((r,n)=>{setTimeout(r,t),e.onload=()=>r(getComputedStyle(e)),e.onerror=i=>{}}):getComputedStyle(e)}function hr(e){if(bn(e))return bg(e);if(iu(e))return[...e.childNodes].map(r=>hr(r)).join("");if(pg(e))return tu(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function _g(e){const t=e.tagName.toLowerCase();let r="";for(const n of e.attributes){const i=n.name,o=n.value;r+=o===""&&i!=="em"&&!ig(t,i)?` ${i}`:` ${i}="${o.replaceAll('"',"'")}"`}return r}function ou(e){let t="";for(const r of e.childNodes)t+=hr(r);return t}function bg(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),r=_g(e);return Jm.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${r}/>`:`<${t}${r}>`:nu(e)?`<${t}${r}>${e.innerHTML}</${t}>`:`<${t}${r}>${ou(e)}</${t}>`}function au(e,t){for(const o of[...e.childNodes])o.remove();let r=t.find(o=>cg(o)),n=t.find(o=>ug(o)),i=e;r||(r=document.createElement("html"),e.appendChild(r),i=r,n||(n=document.createElement("body"),r.appendChild(n),i=n));for(const o of t){if(i===e){if(no(o)){i.appendChild(document.createComment(`%%%{{{${o.data}}}}%%%`));continue}if(bn(o)&&o!==r){(r.querySelector("body")??r).appendChild(o);continue}}i.appendChild(o)}}function io(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){const o=e,a=t;return o.length===a.length&&o.every((s,l)=>io(s,a[l]))}const n=Object.keys(e),i=Object.keys(t);return n.length!==i.length?!1:n.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&io(e[o],t[o]))}function su(e,t){const r={watch(n){let i,o=!1;return e.watch(a=>{const s=t(a);o&&io(i,s)||(i=s,o=!0,n(s))})},select(n){return su(r,n)}};return r}function Ve(...e){let t=e[0],r=e.length>0;const n=new Set,i={get(){return r?t:void 0},set(o){t=o,r=!0;for(const a of Array.from(n))a(o)},watch(o){return n.add(o),r&&o(t),{dispose:()=>n.delete(o)}},select(o){return su(i,o)}};return i}var uu=O.createIdentifier$1("HeadlessMode");function oo(e){return e.getOrCreateInstance(uu,()=>Ve(!1))}function Eg(e){return e?.getInstance(uu)?.get()??!1}function Sg(e,t){oo(e).set(t)}var Pg=O.createIdentifier$1("HiddenMount");function wg(e){return e.getOrCreateInstance(Pg,()=>Ve(!1))}function Ig(e,t){wg(e).set(t)}var Cg=q.__commonJSMin(((e,t)=>{var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r})),Og=q.__commonJSMin(((e,t)=>{var r=Cg();function n(){}function i(){}i.resetWarningCache=n,t.exports=function(){function o(l,u,c,d,f,m){if(m!==r){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}o.isRequired=o;function a(){return o}var s={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:a,element:o,elementType:o,instanceOf:a,node:o,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:i,resetWarningCache:n};return s.PropTypes=s,s}})),Tg=q.__commonJSMin(((e,t)=>{t.exports=Og()()})),vt=R.default.createContext(null);function Ag(e){e()}var lu=Ag,Mg=function(t){return lu=t},Ng=function(){return lu},cu={notify:function(){}};function Rg(){var e=Ng(),t=null,r=null;return{clear:function(){t=null,r=null},notify:function(){e(function(){for(var i=t;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=t;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,a=r={callback:i,next:null,prev:r};return a.prev?a.prev.next=a:t=a,function(){!o||t===null||(o=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var du=(function(){function e(r,n){this.store=r,this.parentSub=n,this.unsubscribe=null,this.listeners=cu,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(n){return this.trySubscribe(),this.listeners.subscribe(n)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return!!this.unsubscribe},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=Rg())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=cu)},e})(),ao=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?R.useLayoutEffect:R.useEffect;function Dg(e){var t=e.store,r=e.context,n=e.children,i=(0,R.useMemo)(function(){var s=new du(t);return s.onStateChange=s.notifyNestedSubs,{store:t,subscription:s}},[t]),o=(0,R.useMemo)(function(){return t.getState()},[t]);ao(function(){var s=i.subscription;return s.trySubscribe(),o!==t.getState()&&s.notifyNestedSubs(),function(){s.tryUnsubscribe(),s.onStateChange=null}},[i,o]);var a=r||vt;return R.default.createElement(a.Provider,{value:i},n)}function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},En.apply(null,arguments)}function so(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var jg=q.__commonJSMin((e=>{var t=typeof Symbol=="function"&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,i=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,h=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,P=t?Symbol.for("react.fundamental"):60117,E=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function _(v){if(typeof v=="object"&&v!==null){var I=v.$$typeof;switch(I){case r:switch(v=v.type,v){case u:case c:case i:case a:case o:case f:return v;default:switch(v=v&&v.$$typeof,v){case l:case d:case h:case g:case s:return v;default:return I}}case n:return I}}}function w(v){return _(v)===c}e.AsyncMode=u,e.ConcurrentMode=c,e.ContextConsumer=l,e.ContextProvider=s,e.Element=r,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=g,e.Portal=n,e.Profiler=a,e.StrictMode=o,e.Suspense=f,e.isAsyncMode=function(v){return w(v)||_(v)===u},e.isConcurrentMode=w,e.isContextConsumer=function(v){return _(v)===l},e.isContextProvider=function(v){return _(v)===s},e.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===r},e.isForwardRef=function(v){return _(v)===d},e.isFragment=function(v){return _(v)===i},e.isLazy=function(v){return _(v)===h},e.isMemo=function(v){return _(v)===g},e.isPortal=function(v){return _(v)===n},e.isProfiler=function(v){return _(v)===a},e.isStrictMode=function(v){return _(v)===o},e.isSuspense=function(v){return _(v)===f},e.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===i||v===c||v===a||v===o||v===f||v===m||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===g||v.$$typeof===s||v.$$typeof===l||v.$$typeof===d||v.$$typeof===P||v.$$typeof===E||v.$$typeof===S||v.$$typeof===b)},e.typeOf=_})),Fg=q.__commonJSMin(((e,t)=>{t.exports=jg()})),Lg=q.__commonJSMin(((e,t)=>{var r=Fg(),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[r.ForwardRef]=o,s[r.Memo]=a;function l(b){return r.isMemo(b)?a:s[b.$$typeof]||n}var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,g=Object.prototype;function h(b,P,E){if(typeof P!="string"){if(g){var S=m(P);S&&S!==g&&h(b,S,E)}var _=c(P);d&&(_=_.concat(d(P)));for(var w=l(b),v=l(P),I=0;I<_.length;++I){var y=_[I];if(!i[y]&&!(E&&E[y])&&!(v&&v[y])&&!(w&&w[y])){var T=f(P,y);try{u(b,y,T)}catch{}}}}return b}t.exports=h})),kg=q.__commonJSMin((e=>{var t=typeof Symbol=="function"&&Symbol.for})),Ug=q.__commonJSMin(((e,t)=>{t.exports=kg()})),kD=q.__toESM(Lg()),UD=Ug();function fu(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function mr(e,t){if(fu(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var i=0;i<r.length;i++)if(!Object.prototype.hasOwnProperty.call(t,r[i])||!fu(e[r[i]],t[r[i]]))return!1;return!0}function le(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var pu=typeof Symbol=="function"&&Symbol.observable||"@@observable",uo=()=>Math.random().toString(36).substring(7).split("").join("."),Sn={INIT:`@@redux/INIT${uo()}`,REPLACE:`@@redux/REPLACE${uo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${uo()}`};function _t(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function hu(e,t,r){if(typeof e!="function")throw new Error(le(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(le(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(le(1));return r(hu)(e,t)}let n=e,i=t,o=new Map,a=o,s=0,l=!1;function u(){a===o&&(a=new Map,o.forEach((h,b)=>{a.set(b,h)}))}function c(){if(l)throw new Error(le(3));return i}function d(h){if(typeof h!="function")throw new Error(le(4));if(l)throw new Error(le(5));let b=!0;u();const P=s++;return a.set(P,h),function(){if(b){if(l)throw new Error(le(6));b=!1,u(),a.delete(P),o=null}}}function f(h){if(!_t(h))throw new Error(le(7));if(typeof h.type>"u")throw new Error(le(8));if(typeof h.type!="string")throw new Error(le(17));if(l)throw new Error(le(9));try{l=!0,i=n(i,h)}finally{l=!1}return(o=a).forEach(b=>{b()}),h}function m(h){if(typeof h!="function")throw new Error(le(10));n=h,f({type:Sn.REPLACE})}function g(){const h=d;return{subscribe(b){if(typeof b!="object"||b===null)throw new Error(le(11));function P(){const E=b;E.next&&E.next(c())}return P(),{unsubscribe:h(P)}},[pu](){return this}}}return f({type:Sn.INIT}),{dispatch:f,subscribe:d,getState:c,replaceReducer:m,[pu]:g}}function Bg(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Sn.INIT})>"u")throw new Error(le(12));if(typeof r(void 0,{type:Sn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(le(13))})}function lo(e){const t=Object.keys(e),r={};for(let o=0;o<t.length;o++){const a=t[o];typeof e[a]=="function"&&(r[a]=e[a])}const n=Object.keys(r);let i;try{Bg(r)}catch(o){i=o}return function(a={},s){if(i)throw i;let l=!1;const u={};for(let c=0;c<n.length;c++){const d=n[c],f=r[d],m=a[d],g=f(m,s);if(typeof g>"u")throw s&&s.type,new Error(le(14));u[d]=g,l=l||g!==m}return l=l||n.length!==Object.keys(a).length,l?u:a}}function Pn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function $g(...e){return t=>(r,n)=>{const i=t(r,n);let o=()=>{throw new Error(le(15))};const a={getState:i.getState,dispatch:(s,...l)=>o(s,...l)};return o=Pn(...e.map(s=>s(a)))(i.dispatch),{...i,dispatch:o}}}function mu(e){return _t(e)&&"type"in e&&typeof e.type=="string"}function gu(){return(0,R.useContext)(vt)}function yu(e){e===void 0&&(e=vt);var t=e===vt?gu:function(){return(0,R.useContext)(e)};return function(){return t().store}}var ve=yu();function xg(e){e===void 0&&(e=vt);var t=e===vt?ve:yu(e);return function(){return t().dispatch}}var tt=xg(),qg=function(t,r){return t===r};function Gg(e,t,r,n){var i=(0,R.useReducer)(function(m){return m+1},0)[1],o=(0,R.useMemo)(function(){return new du(r,n)},[r,n]),a=(0,R.useRef)(),s=(0,R.useRef)(),l=(0,R.useRef)(),u=(0,R.useRef)(),c=r.getState(),d;try{if(e!==s.current||c!==l.current||a.current){var f=e(c);u.current===void 0||!t(f,u.current)?d=f:d=u.current}else d=u.current}catch(m){throw a.current&&(m.message+=`
|
|
7
|
-
The error may be correlated with this previous error:
|
|
8
|
-
`+a.current.stack+`
|
|
9
|
-
|
|
10
|
-
`),m}return ao(function(){s.current=e,l.current=c,u.current=d,a.current=void 0}),ao(function(){function m(){try{var g=s.current(r.getState());if(t(g,u.current))return;u.current=g}catch(h){a.current=h}i()}return o.onStateChange=m,o.trySubscribe(),m(),function(){return o.tryUnsubscribe()}},[r,o]),d}function Hg(e){e===void 0&&(e=vt);var t=e===vt?gu:function(){return(0,R.useContext)(e)};return function(n,i){i===void 0&&(i=qg);var o=t(),a=o.store,s=o.subscription,l=Gg(n,i,a,s);return(0,R.useDebugValue)(l),l}}var gr=Hg();Mg(mt.unstable_batchedUpdates);var Ct,co=q.__esmMin((()=>{co(),Ct=typeof Ct<"u"?Ct:typeof self<"u"?self:typeof window<"u"?window:{}}));function vu(){throw new Error("setTimeout has not been defined")}function _u(){throw new Error("clearTimeout has not been defined")}function bu(e){if(rt===setTimeout)return setTimeout(e,0);if((rt===vu||!rt)&&setTimeout)return rt=setTimeout,setTimeout(e,0);try{return rt(e,0)}catch{try{return rt.call(null,e,0)}catch{return rt.call(this,e,0)}}}function zg(e){if(nt===clearTimeout)return clearTimeout(e);if((nt===_u||!nt)&&clearTimeout)return nt=clearTimeout,clearTimeout(e);try{return nt(e)}catch{try{return nt.call(null,e)}catch{return nt.call(this,e)}}}function Vg(){!Tt||!At||(Tt=!1,At.length?We=At.concat(We):yr=-1,We.length&&Eu())}function Eu(){if(!Tt){var e=bu(Vg);Tt=!0;for(var t=We.length;t;){for(At=We,We=[];++yr<t;)At&&At[yr].run();yr=-1,t=We.length}At=null,Tt=!1,zg(e)}}function Wg(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];We.push(new Su(e,t)),We.length===1&&!Tt&&bu(Eu)}function Su(e,t){this.fun=e,this.array=t}function Ot(){}function Qg(e){throw new Error("process.binding is not supported")}function Kg(){return"/"}function Yg(e){throw new Error("process.chdir is not supported")}function Xg(){return 0}function Jg(e){var t=ku.call(Mt)*.001,r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r=r-e[0],n=n-e[1],n<0&&(r--,n+=1e9)),[r,n]}function Zg(){return(new Date-Uu)/1e3}var rt,nt,We,Tt,At,yr,Pu,wu,ey,Iu,Cu,ty,Ou,Tu,Au,Mu,Nu,Ru,Du,ju,Fu,Lu,Mt,ku,Uu,Bu,ry=q.__esmMin((()=>{co(),rt=vu,nt=_u,typeof Ct.setTimeout=="function"&&(rt=setTimeout),typeof Ct.clearTimeout=="function"&&(nt=clearTimeout),We=[],Tt=!1,yr=-1,Su.prototype.run=function(){this.fun.apply(null,this.array)},Pu="browser",wu="browser",ey=!0,Iu={},Cu=[],ty="",Ou={},Tu={},Au={},Mu=Ot,Nu=Ot,Ru=Ot,Du=Ot,ju=Ot,Fu=Ot,Lu=Ot,Mt=Ct.performance||{},ku=Mt.now||Mt.mozNow||Mt.msNow||Mt.oNow||Mt.webkitNow||function(){return new Date().getTime()},Uu=new Date,Bu={nextTick:Wg,title:Pu,browser:!0,env:Iu,argv:Cu,version:"",versions:Ou,on:Mu,addListener:Nu,once:Ru,off:Du,removeListener:ju,removeAllListeners:Fu,emit:Lu,binding:Qg,cwd:Kg,chdir:Yg,umask:Xg,hrtime:Jg,platform:wu,release:Tu,config:Au,uptime:Zg}})),fo=Symbol.for("immer-nothing"),vr=Symbol.for("immer-draftable"),se=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ae=Object,Nt=Ae.getPrototypeOf,_r="constructor",br="prototype",po="configurable",wn="enumerable",In="writable",Er="value",Me=e=>!!e&&!!e[se];function Ee(e){return e?xu(e)||Pr(e)||!!e[vr]||!!e[_r]?.[vr]||wr(e)||Ir(e):!1}var ny=Ae[br][_r].toString(),$u=new WeakMap;function xu(e){if(!e||!Qt(e))return!1;const t=Nt(e);if(t===null||t===Ae[br])return!0;const r=Ae.hasOwnProperty.call(t,_r)&&t[_r];if(r===Object)return!0;if(!Dt(r))return!1;let n=$u.get(r);return n===void 0&&(n=Function.toString.call(r),$u.set(r,n)),n===ny}function iy(e){return Me(e)||ce(15,e),e[se].base_}function Sr(e,t,r=!0){Rt(e)===0?(r?Reflect.ownKeys(e):Ae.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,i)=>t(i,n,e))}function Rt(e){const t=e[se];return t?t.type_:Pr(e)?1:wr(e)?2:Ir(e)?3:0}var Wt=(e,t,r=Rt(e))=>r===2?e.has(t):Ae[br].hasOwnProperty.call(e,t),it=(e,t,r=Rt(e))=>r===2?e.get(t):e[t],Cn=(e,t,r,n=Rt(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function oy(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Pr=Array.isArray,wr=e=>e instanceof Map,Ir=e=>e instanceof Set,Qt=e=>typeof e=="object",Dt=e=>typeof e=="function",ho=e=>typeof e=="boolean";function ay(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var sy=e=>Qt(e)?e?.[se]:null,ot=e=>e.copy_||e.base_,mo=e=>e.modified_?e.copy_:e.base_;function go(e,t){if(wr(e))return new Map(e);if(Ir(e))return new Set(e);if(Pr(e))return Array[br].slice.call(e);const r=xu(e);if(t===!0||t==="class_only"&&!r){const n=Ae.getOwnPropertyDescriptors(e);delete n[se];let i=Reflect.ownKeys(n);for(let o=0;o<i.length;o++){const a=i[o],s=n[a];s[In]===!1&&(s[In]=!0,s[po]=!0),(s.get||s.set)&&(n[a]={[po]:!0,[In]:!0,[wn]:s[wn],[Er]:e[a]})}return Ae.create(Nt(e),n)}else{const n=Nt(e);if(n!==null&&r)return{...e};const i=Ae.create(n);return Ae.assign(i,e)}}function yo(e,t=!1){return Tn(e)||Me(e)||!Ee(e)||(Rt(e)>1&&Ae.defineProperties(e,{set:On,add:On,clear:On,delete:On}),Ae.freeze(e),t&&Sr(e,(r,n)=>{yo(n,!0)},!1)),e}function uy(){ce(2)}var On={[Er]:uy};function Tn(e){return e===null||!Qt(e)?!0:Ae.isFrozen(e)}var An="MapSet",Mn="Patches",qu="ArrayMethods",Nn={};function jt(e){const t=Nn[e];return t||ce(0,e),t}var Gu=e=>!!Nn[e];function ly(e,t){Nn[e]||(Nn[e]=t)}var Cr,Hu=()=>Cr,cy=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Gu(An)?jt(An):void 0,arrayMethodsPlugin_:Gu(qu)?jt(qu):void 0});function zu(e,t){t&&(e.patchPlugin_=jt(Mn),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function vo(e){_o(e),e.drafts_.forEach(dy),e.drafts_=null}function _o(e){e===Cr&&(Cr=e.parent_)}var Vu=e=>Cr=cy(Cr,e);function dy(e){const t=e[se];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Wu(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[se].modified_&&(vo(t),ce(4)),Ee(e)&&(e=Qu(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[se].base_,e,t)}else e=Qu(t,r);return fy(t,e,!0),vo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fo?e:void 0}function Qu(e,t){if(Tn(t))return t;const r=t[se];if(!r)return Dn(t,e.handledSet_,e);if(!Rn(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Xu(r,e)}return r.copy_}function fy(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yo(t,r)}function Ku(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Rn=(e,t)=>e.scope_===t,py=[];function Yu(e,t,r,n){const i=ot(e),o=e.type_;if(n!==void 0&&it(i,n,o)===t){Cn(i,n,r,o);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;Sr(i,(l,u)=>{if(Me(u)){const c=s.get(u)||[];c.push(l),s.set(u,c)}})}const a=e.draftLocations_.get(t)??py;for(const s of a)Cn(i,s,r,o)}function hy(e,t,r){e.callbacks_.push(function(i){const o=t;if(!o||!Rn(o,i))return;i.mapSetPlugin_?.fixSetContents(o);const a=mo(o);Yu(e,o.draft_??o,a,r),Xu(o,i)})}function Xu(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}Ku(e)}}function my(e,t,r){const{scope_:n}=e;if(Me(r)){const i=r[se];Rn(i,n)&&i.callbacks_.push(function(){Fn(e),Yu(e,r,mo(i),t)})}else Ee(r)&&e.callbacks_.push(function(){const o=ot(e);e.type_===3?o.has(r)&&Dn(r,n.handledSet_,n):it(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Dn(it(e.copy_,t,e.type_),n.handledSet_,n)})}function Dn(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Me(e)||t.has(e)||!Ee(e)||Tn(e)||(t.add(e),Sr(e,(n,i)=>{if(Me(i)){const o=i[se];Rn(o,r)&&(Cn(e,n,mo(o),e.type_),Ku(o))}else Ee(i)&&Dn(i,t,r)})),e}function gy(e,t){const r=Pr(e),n={type_:r?1:0,scope_:t?t.scope_:Hu(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,o=jn;r&&(i=[n],o=Or);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return n.draft_=s,n.revoke_=a,[s,n]}var jn={get(e,t){if(t===se)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ot(e);if(!Wt(i,t,e.type_))return vy(e,i,t);const o=i[t];if(e.finalized_||!Ee(o)||n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&ay(t))return o;if(o===bo(e.base_,t)||yy(e,t,o)){Fn(e);const a=e.type_===1?+t:t,s=So(e.scope_,o,e,a);return e.copy_[a]=s}return o},has(e,t){return t in ot(e)},ownKeys(e){return Reflect.ownKeys(ot(e))},set(e,t,r){const n=Ju(ot(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=bo(ot(e),t),o=i?.[se];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(oy(r,i)&&(r!==void 0||Wt(e.base_,t,e.type_)))return!0;Fn(e),Eo(e)}return e.copy_[t]===r&&(r!==void 0||Wt(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),my(e,t,r)),!0},deleteProperty(e,t){return Fn(e),bo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Eo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ot(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[In]:!0,[po]:e.type_!==1||t!=="length",[wn]:n[wn],[Er]:r[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return Nt(e.base_)},setPrototypeOf(){ce(12)}},Or={};for(let e in jn){let t=jn[e];Or[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Or.deleteProperty=function(e,t){return Or.set.call(this,e,t,void 0)},Or.set=function(e,t,r){return jn.set.call(this,e[0],t,r,e[0])};function bo(e,t){const r=e[se];return(r?ot(r):e)[t]}function yy(e,t,r){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Ee(r)||r[se]?!1:e.baseRefs_.has(r)}function vy(e,t,r){const n=Ju(t,r);return n?Er in n?n[Er]:n.get?.call(e.draft_):void 0}function Ju(e,t){if(!(t in e))return;let r=Nt(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Nt(r)}}function Eo(e){e.modified_||(e.modified_=!0,e.parent_&&Eo(e.parent_))}function Fn(e){e.copy_||(e.assigned_=new Map,e.copy_=go(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var _y=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Dt(t)&&!Dt(r)){const o=r;r=t;const a=this;return function(l=o,...u){return a.produce(l,c=>r.call(this,c,...u))}}Dt(r)||ce(6),n!==void 0&&!Dt(n)&&ce(7);let i;if(Ee(t)){const o=Vu(this),a=So(o,t,void 0);let s=!0;try{i=r(a),s=!1}finally{s?vo(o):_o(o)}return zu(o,n),Wu(i,o)}else if(!t||!Qt(t)){if(i=r(t),i===void 0&&(i=t),i===fo&&(i=void 0),this.autoFreeze_&&yo(i,!0),n){const o=[],a=[];jt(Mn).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:a}),n(o,a)}return i}else ce(1,t)},this.produceWithPatches=(t,r)=>{if(Dt(t))return(o,...a)=>this.produceWithPatches(o,s=>t(s,...a));let n,i;return[this.produce(t,r,(o,a)=>{n=o,i=a}),n,i]},ho(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ho(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ho(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ee(e)||ce(8),Me(e)&&(e=Zu(e));const t=Vu(this),r=So(t,e,void 0);return r[se].isManual_=!0,_o(t),r}finishDraft(e,t){const r=e&&e[se];(!r||!r.isManual_)&&ce(9);const{scope_:n}=r;return zu(n,t),Wu(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=jt(Mn).applyPatches_;return Me(e)?n(e,t):this.produce(e,i=>n(i,t))}};function So(e,t,r,n){const[i,o]=wr(t)?jt(An).proxyMap_(t,r):Ir(t)?jt(An).proxySet_(t,r):gy(t,r);return(r?.scope_??Hu()).drafts_.push(i),o.callbacks_=r?.callbacks_??[],o.key_=n,r&&n!==void 0?hy(r,o,n):o.callbacks_.push(function(s){s.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:l}=s;o.modified_&&l&&l.generatePatches_(o,[],s)}),i}function Zu(e){return Me(e)||ce(10,e),el(e)}function el(e){if(!Ee(e)||Tn(e))return e;const t=e[se];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=go(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=go(e,!0);return Sr(r,(i,o)=>{Cn(r,i,el(o))},n),t&&(t.finalized_=!1),r}function by(){function t(g,h=[]){if(g.key_!==void 0){const b=g.parent_.copy_??g.parent_.base_,P=sy(it(b,g.key_)),E=it(b,g.key_);if(E===void 0||E!==g.draft_&&E!==g.base_&&E!==g.copy_||P!=null&&P.base_!==g.base_)return null;const S=g.parent_.type_===3;let _;if(S){const w=g.parent_;_=Array.from(w.drafts_.keys()).indexOf(g.key_)}else _=g.key_;if(!(S&&b.size>_||Wt(b,_)))return null;h.push(_)}if(g.parent_)return t(g.parent_,h);h.reverse();try{r(g.copy_,h)}catch{return null}return h}function r(g,h){let b=g;for(let P=0;P<h.length-1;P++){const E=h[P];if(b=it(b,E),!Qt(b)||b===null)throw new Error(`Cannot resolve path at '${h.join("/")}'`)}return b}const n="replace",i="add",o="remove";function a(g,h,b){if(g.scope_.processedForPatches_.has(g))return;g.scope_.processedForPatches_.add(g);const{patches_:P,inversePatches_:E}=b;switch(g.type_){case 0:case 2:return l(g,h,P,E);case 1:return s(g,h,P,E);case 3:return u(g,h,P,E)}}function s(g,h,b,P){let{base_:E,assigned_:S}=g,_=g.copy_;_.length<E.length&&([E,_]=[_,E],[b,P]=[P,b]);const w=g.allIndicesReassigned_===!0;for(let v=0;v<E.length;v++){const I=_[v],y=E[v];if((w||S?.get(v.toString()))&&I!==y){const T=I?.[se];if(T&&T.modified_)continue;const A=h.concat([v]);b.push({op:n,path:A,value:m(I)}),P.push({op:n,path:A,value:m(y)})}}for(let v=E.length;v<_.length;v++){const I=h.concat([v]);b.push({op:i,path:I,value:m(_[v])})}for(let v=_.length-1;E.length<=v;--v){const I=h.concat([v]);P.push({op:o,path:I})}}function l(g,h,b,P){const{base_:E,copy_:S,type_:_}=g;Sr(g.assigned_,(w,v)=>{const I=it(E,w,_),y=it(S,w,_),T=v?Wt(E,w)?n:i:o;if(I===y&&T===n)return;const A=h.concat(w);b.push(T===o?{op:T,path:A}:{op:T,path:A,value:m(y)}),P.push(T===i?{op:o,path:A}:T===o?{op:i,path:A,value:m(I)}:{op:n,path:A,value:m(I)})})}function u(g,h,b,P){let{base_:E,copy_:S}=g,_=0;E.forEach(w=>{if(!S.has(w)){const v=h.concat([_]);b.push({op:o,path:v,value:w}),P.unshift({op:i,path:v,value:w})}_++}),_=0,S.forEach(w=>{if(!E.has(w)){const v=h.concat([_]);b.push({op:i,path:v,value:w}),P.unshift({op:o,path:v,value:w})}_++})}function c(g,h,b){const{patches_:P,inversePatches_:E}=b;P.push({op:n,path:[],value:h===fo?void 0:h}),E.push({op:n,path:[],value:g})}function d(g,h){return h.forEach(b=>{const{path:P,op:E}=b;let S=g;for(let I=0;I<P.length-1;I++){const y=Rt(S);let T=P[I];typeof T!="string"&&typeof T!="number"&&(T=""+T),(y===0||y===1)&&(T==="__proto__"||T===_r)&&ce(19),Dt(S)&&T===br&&ce(19),S=it(S,T),(S===null||!Qt(S))&&ce(18,P.join("/"))}const _=Rt(S),w=f(b.value),v=P[P.length-1];switch(E){case n:switch(_){case 2:return S.set(v,w);case 3:ce(16);default:return S[v]=w}case i:switch(_){case 1:return v==="-"?S.push(w):S.splice(v,0,w);case 2:return S.set(v,w);case 3:return S.add(w);default:return S[v]=w}case o:switch(_){case 1:return S.splice(v,1);case 2:return S.delete(v);case 3:return S.delete(b.value);default:return delete S[v]}default:ce(17,E)}}),g}function f(g){if(!Ee(g))return g;if(Pr(g))return g.map(f);if(wr(g))return new Map(Array.from(g.entries()).map(([b,P])=>[b,f(P)]));if(Ir(g))return new Set(Array.from(g).map(f));const h=Object.create(Nt(g));for(const b in g)h[b]=f(g[b]);return Wt(g,vr)&&(h[vr]=g[vr]),h}function m(g){return Me(g)?f(g):g}ly(Mn,{applyPatches_:d,generatePatches_:a,generateReplacementPatches_:c,getPath:t})}var Tr=new _y,Ar=Tr.produce,tl=Tr.produceWithPatches.bind(Tr),rl=Tr.applyPatches.bind(Tr);function Ey(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Sy(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var nl=e=>Array.isArray(e)?e:[e];function Py(e){const t=Array.isArray(e[0])?e[0]:e;return Sy(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function wy(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var Iy=class{constructor(e){this.value=e}deref(){return this.value}},Cy=()=>typeof WeakRef>"u"?Iy:WeakRef,il=Cy(),Oy=0,ol=1;function Ln(){return{s:Oy,v:void 0,o:null,p:null}}function Ty(e){return e instanceof il?e.deref():e}function kn(e,t={}){let r=Ln();const{resultEqualityCheck:n}=t;let i,o=0;function a(){let s=r;const{length:l}=arguments;for(let d=0,f=l;d<f;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=s.o;g===null&&(s.o=g=new WeakMap);const h=g.get(m);h===void 0?(s=Ln(),g.set(m,s)):s=h}else{let g=s.p;g===null&&(s.p=g=new Map);const h=g.get(m);h===void 0?(s=Ln(),g.set(m,s)):s=h}}const u=s;let c;if(s.s===ol)c=s.v;else if(c=e.apply(null,arguments),o++,n){const d=Ty(i);d!=null&&n(d,c)&&(c=d,o!==0&&o--),i=typeof c=="object"&&c!==null||typeof c=="function"?new il(c):c}return u.s=ol,u.v=c,c}return a.clearCache=()=>{r=Ln(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function Ay(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,a=0,s,l={},u=i.pop();typeof u=="object"&&(l=u,u=i.pop()),Ey(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const{memoize:c,memoizeOptions:d=[],argsMemoize:f=kn,argsMemoizeOptions:m=[]}={...r,...l},g=nl(d),h=nl(m),b=Py(i),P=c(function(){return o++,u.apply(null,arguments)},...g),E=f(function(){a++;const _=wy(b,arguments);return s=P.apply(null,_),s},...h);return Object.assign(E,{resultFunc:u,memoizedResultFunc:P,dependencies:b,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:c,argsMemoize:f})};return Object.assign(n,{withTypes:()=>n}),n}var al=Ay(kn);function sl(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var My=sl(),Ny=sl,Ry=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pn:Pn.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Dy=e=>e&&typeof e.match=="function";function Se(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(ke(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>mu(n)&&n.type===e,r}var ul=class yn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,yn.prototype)}static get[Symbol.species](){return yn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new yn(...t[0].concat(this)):new yn(...t.concat(this))}};function ll(e){return Ee(e)?Ar(e,()=>{}):e}function Un(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function jy(e){return typeof e=="boolean"}var Fy=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let a=new ul;return r&&(jy(r)?a.push(My):a.push(Ny(r.extraArgument))),a},Bn="RTK_autoBatch",Mr=()=>e=>({payload:e,meta:{[Bn]:!0}}),cl=e=>t=>{setTimeout(t,e)},Ly=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(a),r())},o=e(i),a=setTimeout(i,t)},ky=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,o=!1,a=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Ly(window.requestAnimationFrame,100):cl(10):e.type==="callback"?e.queueNotification:cl(e.timeout),u=()=>{a=!1,o&&(o=!1,s.forEach(c=>c()))};return Object.assign({},n,{subscribe(c){const d=()=>i&&c(),f=n.subscribe(d);return s.add(c),()=>{f(),s.delete(c)}},dispatch(c){try{return i=!c?.meta?.[Bn],o=!i,o&&(a||(a=!0,l(u))),n.dispatch(c)}finally{i=!0}}})},Uy=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new ul(e);return n&&i.push(ky(typeof n=="object"?n:void 0)),i};function By(e){const t=Fy(),{reducer:r=void 0,middleware:n,devTools:i=!0,duplicateMiddlewareCheck:o=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(_t(r))l=lo(r);else throw new Error(ke(1));let u;typeof n=="function"?u=n(t):u=t();let c=Pn;i&&(c=Ry({trace:!1,...typeof i=="object"&&i}));const d=Uy($g(...u));let f=typeof s=="function"?s(d):d();const m=c(...f);return hu(l,a,m)}function dl(e){const t={},r=[];let n;const i={addCase(o,a){const s=typeof o=="string"?o:o.type;if(!s)throw new Error(ke(28));if(s in t)throw new Error(ke(29));return t[s]=a,i},addAsyncThunk(o,a){return a.pending&&(t[o.pending.type]=a.pending),a.rejected&&(t[o.rejected.type]=a.rejected),a.fulfilled&&(t[o.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:o.settled,reducer:a.settled}),i},addMatcher(o,a){return r.push({matcher:o,reducer:a}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function $y(e){return typeof e=="function"}function xy(e,t){let[r,n,i]=dl(t),o;if($y(e))o=()=>ll(e());else{const s=ll(e);o=()=>s}function a(s=o(),l){let u=[r[l.type],...n.filter(({matcher:c})=>c(l)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[i]),u.reduce((c,d)=>{if(d)if(Me(c)){const f=d(c,l);return f===void 0?c:f}else{if(Ee(c))return Ar(c,f=>d(f,l));{const f=d(c,l);if(f===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return c},s)}return a.getInitialState=o,a}var fl=(e,t)=>Dy(e)?e.match(t):e(t);function at(...e){return t=>e.some(r=>fl(r,t))}function Nr(...e){return t=>e.every(r=>fl(r,t))}function $n(e,t){if(!e||!e.meta)return!1;const r=typeof e.meta.requestId=="string",n=t.indexOf(e.meta.requestStatus)>-1;return r&&n}function Rr(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Po(...e){return e.length===0?t=>$n(t,["pending"]):Rr(e)?at(...e.map(t=>t.pending)):Po()(e[0])}function Kt(...e){return e.length===0?t=>$n(t,["rejected"]):Rr(e)?at(...e.map(t=>t.rejected)):Kt()(e[0])}function xn(...e){const t=r=>r&&r.meta&&r.meta.rejectedWithValue;return e.length===0?Nr(Kt(...e),t):Rr(e)?Nr(Kt(...e),t):xn()(e[0])}function bt(...e){return e.length===0?t=>$n(t,["fulfilled"]):Rr(e)?at(...e.map(t=>t.fulfilled)):bt()(e[0])}function wo(...e){return e.length===0?t=>$n(t,["pending","fulfilled","rejected"]):Rr(e)?at(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):wo()(e[0])}var qy="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Io=(e=21)=>{let t="",r=e;for(;r--;)t+=qy[Math.random()*64|0];return t},Gy=["name","message","stack","code"],Co=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},pl=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},Hy=e=>{if(typeof e=="object"&&e!==null){const t={};for(const r of Gy)typeof e[r]=="string"&&(t[r]=e[r]);return t}return{message:String(e)}},hl="External signal was aborted",Oo=(()=>{function e(t,r,n){const i=Se(t+"/fulfilled",(l,u,c,d)=>({payload:l,meta:{...d||{},arg:c,requestId:u,requestStatus:"fulfilled"}})),o=Se(t+"/pending",(l,u,c)=>({payload:void 0,meta:{...c||{},arg:u,requestId:l,requestStatus:"pending"}})),a=Se(t+"/rejected",(l,u,c,d,f)=>({payload:d,error:(n&&n.serializeError||Hy)(l||"Rejected"),meta:{...f||{},arg:c,requestId:u,rejectedWithValue:!!d,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function s(l,{signal:u}={}){return(c,d,f)=>{const m=n?.idGenerator?n.idGenerator(l):Io(),g=new AbortController;let h,b;function P(S){b=S,g.abort()}u&&(u.aborted?P(hl):u.addEventListener("abort",()=>P(hl),{once:!0}));const E=(async function(){let S;try{let _=n?.condition?.(l,{getState:d,extra:f});if(Vy(_)&&(_=await _),_===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const w=new Promise((v,I)=>{h=()=>{I({name:"AbortError",message:b||"Aborted"})},g.signal.addEventListener("abort",h,{once:!0})});c(o(m,l,n?.getPendingMeta?.({requestId:m,arg:l},{getState:d,extra:f}))),S=await Promise.race([w,Promise.resolve(r(l,{dispatch:c,getState:d,extra:f,requestId:m,signal:g.signal,abort:P,rejectWithValue:((v,I)=>new Co(v,I)),fulfillWithValue:((v,I)=>new pl(v,I))})).then(v=>{if(v instanceof Co)throw v;return v instanceof pl?i(v.payload,m,l,v.meta):i(v,m,l)})])}catch(_){S=_ instanceof Co?a(null,m,l,_.payload,_.meta):a(_,m,l)}finally{h&&g.signal.removeEventListener("abort",h)}return n&&!n.dispatchConditionRejection&&a.match(S)&&S.meta.condition||c(S),S})();return Object.assign(E,{abort:P,requestId:m,arg:l,unwrap(){return E.then(zy)}})}}return Object.assign(s,{pending:o,rejected:a,fulfilled:i,settled:at(a,i),typePrefix:t})}return e.withTypes=()=>e,e})();function zy(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Vy(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Wy=Symbol.for("rtk-slice-createasyncthunk");function Qy(e,t){return`${e}/${t}`}function Ky({creators:e}={}){const t=e?.asyncThunk?.[Wy];return function(n){const{name:i,reducerPath:o=i}=n;if(!i)throw new Error(ke(11));const a=(typeof n.reducers=="function"?n.reducers(Xy()):n.reducers)||{},s=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(S,_){const w=typeof S=="string"?S:S.type;if(!w)throw new Error(ke(12));if(w in l.sliceCaseReducersByType)throw new Error(ke(13));return l.sliceCaseReducersByType[w]=_,u},addMatcher(S,_){return l.sliceMatchers.push({matcher:S,reducer:_}),u},exposeAction(S,_){return l.actionCreators[S]=_,u},exposeCaseReducer(S,_){return l.sliceCaseReducersByName[S]=_,u}};s.forEach(S=>{const _=a[S],w={reducerName:S,type:Qy(i,S),createNotation:typeof n.reducers=="function"};Zy(_)?tv(w,_,u,t):Jy(w,_,u)});function c(){const[S={},_=[],w=void 0]=typeof n.extraReducers=="function"?dl(n.extraReducers):[n.extraReducers],v={...S,...l.sliceCaseReducersByType};return xy(n.initialState,I=>{for(let y in v)I.addCase(y,v[y]);for(let y of l.sliceMatchers)I.addMatcher(y.matcher,y.reducer);for(let y of _)I.addMatcher(y.matcher,y.reducer);w&&I.addDefaultCase(w)})}const d=S=>S,f=new Map,m=new WeakMap;let g;function h(S,_){return g||(g=c()),g(S,_)}function b(){return g||(g=c()),g.getInitialState()}function P(S,_=!1){function w(I){let y=I[S];return typeof y>"u"&&_&&(y=Un(m,w,b)),y}function v(I=d){return Un(Un(f,_,()=>new WeakMap),I,()=>{const y={};for(const[T,A]of Object.entries(n.selectors??{}))y[T]=Yy(A,I,()=>Un(m,I,b),_);return y})}return{reducerPath:S,getSelectors:v,get selectors(){return v(w)},selectSlice:w}}const E={name:i,reducer:h,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:b,...P(o),injectInto(S,{reducerPath:_,...w}={}){const v=_??o;return S.inject({reducerPath:v,reducer:h},w),{...E,...P(v,!0)}}};return E}}function Yy(e,t,r,n){function i(o,...a){let s=t(o);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return i.unwrapped=e,i}var Pe=Ky();function Xy(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Jy({type:e,reducerName:t,createNotation:r},n,i){let o,a;if("reducer"in n){if(r&&!ev(n))throw new Error(ke(17));o=n.reducer,a=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,a?Se(e,a):Se(e))}function Zy(e){return e._reducerDefinitionType==="asyncThunk"}function ev(e){return e._reducerDefinitionType==="reducerWithPrepare"}function tv({type:e,reducerName:t},r,n,i){if(!i)throw new Error(ke(18));const{payloadCreator:o,fulfilled:a,pending:s,rejected:l,settled:u,options:c}=r,d=i(e,o,c);n.exposeAction(t,d),a&&n.addCase(d.fulfilled,a),s&&n.addCase(d.pending,s),l&&n.addCase(d.rejected,l),u&&n.addMatcher(d.settled,u),n.exposeCaseReducer(t,{fulfilled:a||qn,pending:s||qn,rejected:l||qn,settled:u||qn})}function qn(){}var ml="listener",gl="completed",yl="cancelled",BD=`task-${yl}`,$D=`task-${gl}`,xD=`${ml}-${yl}`,qD=`${ml}-${gl}`,{assign:vl}=Object,To="listenerMiddleware",rv=vl(Se(`${To}/add`),{withTypes:()=>rv}),GD=Se(`${To}/removeAll`),nv=vl(Se(`${To}/remove`),{withTypes:()=>nv});function ke(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function iv(e){return e}function _l({data:e,...t},r){return t.error?t:{data:r(e,t.meta),...t}}function ov({data:e,...t},r){return t.error?t:{data:e.map(n=>r(n,t.meta)),...t}}function he(e){return t=>_l(t,e)}function av(e){return!e.hasOwnProperty("previous")}function Gn(e){return t=>_l(t,(r,n)=>av(r)?e(r,n):e(r.previous,n))}function Ne(e){return t=>ov(t,e)}var bl={editorThemeColor:"light",isSettingsDisabled:!1,emailAutosaveTimestamps:{},settings:{backgroundColor:"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",textStrong:!1,textItalic:!1,textUnderline:!1},elementSettings:{},searchFilters:{},emailCommonStyles:"",saveTime:null,mobileViewActive:{shutdown:!0,styles:!0},isCodeMode:!1,codeModeDirection:void 0,emailViewType:void 0,changeKey:null,problemsList:[],codeErrors:[],activeProblemRange:null,emailGroups:{},projectGroups:[],isNeedUpdateAppearance:!1,isNeedUpdateContentAppearance:!1},Qe="emailSlice",El=Pe({name:Qe,initialState:bl,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailSettings:(e,{payload:t})=>{Object.assign(e,{...e,settings:{...t},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,{payload:t})=>{e.elementSettings=t},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},updateSearchFilters:(e,t)=>{e.searchFilters={...e.searchFilters,...t.payload}},resetEmailSlice:e=>{const t=e.emailAutosaveTimestamps;return{...bl,emailAutosaveTimestamps:t}},rememberAutosaveTime:(e,{payload:t})=>{e.emailAutosaveTimestamps[t.emailId]=t.modified},applyProjectGroups:(e,{payload:t})=>{const r=t.projectGroups;e.projectGroups=r;const n=t.emailGroup;if(!n)return;const i={};n.length&&r.length&&n.forEach(o=>{r.forEach(a=>{const s=(a.children||[]).find(l=>l.id===o);s&&(i.hasOwnProperty(a.id)||(i[a.id]=[]),i[a.id].push({label:s.name,value:s.id}))})}),e.emailGroups=i},setCodeErrors:(e,t)=>{e.codeErrors=t.payload},setProblemsList:(e,t)=>{e.problemsList=t.payload},setActiveProblemRange:(e,t)=>{e.activeProblemRange=t.payload},markAppearanceNeedsUpdate:e=>{e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setIsNeedUpdateContentAppearance:(e,t)=>{e.isNeedUpdateContentAppearance=t.payload},setIsNeedUpdateAppearance:(e,t)=>{e.isNeedUpdateAppearance=t.payload},setEmailGroups:(e,{payload:t})=>{const r=Object.keys(t)[0],n=e.emailGroups,i=e.projectGroups,o={};i.length&&(t[r]?.forEach(a=>{const s=i.find(u=>u.id===+r),l=(s?.children||[]).find(u=>u.id===+a);l?(o.hasOwnProperty(s.id)||(o[s.id]=[]),o[s.id].push({label:l.name,value:l.id})):(o.hasOwnProperty(r)||(o[r]=[]),o[r].push({label:a,value:null}))}),t[r].length===0&&(o[r]=[])),e.emailGroups={...n,...o}}}}),{setEditorThemeColor:sv,setEmailSettings:uv,setElementSettings:lv,setEmailSettingsDisable:cv,setSearchFilters:HD,updateSearchFilters:zD,resetEmailSlice:dv,rememberAutosaveTime:fv,applyProjectGroups:pv,setProblemsList:hv,setCodeErrors:VD,setActiveProblemRange:mv,setEmailGroups:gv,markAppearanceNeedsUpdate:yv,setIsNeedUpdateAppearance:vv,setIsNeedUpdateContentAppearance:_v}=El.actions;function bv(e,t){return pv({projectGroups:e??[],emailGroup:Array.isArray(t)?t:void 0})}var Ev=e=>e[Qe].isNeedUpdateContentAppearance,Sv=e=>e[Qe].settings,Pv=e=>e[Qe].problemsList,wv=e=>e[Qe].projectGroups,Iv=e=>e[Qe].elementSettings,Cv=e=>e[Qe].editorThemeColor,Ov=e=>e[Qe].isSettingsDisabled,Tv=e=>e[Qe].activeProblemRange,Av=e=>e[Qe].isNeedUpdateAppearance,Mv=/<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s[^<>]*)?\/?>/g;function Nv(e){return e.replace(Mv,t=>/^<br\b/i.test(t)?" ":"")}var Rv={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",contrastColor:"#FFFFFF",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",contrastColor:"#FFFFFF",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:20,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",contrastColor:"#FFFFFF",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",contrastColor:"#1C52DC",bold:!1,italic:!1,backgroundColor:"#1C52DC",contrastBackgroundColor:"#FFFFFF",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:"#FFFFFF",contrastBackgroundColor:"#1C52DC",padding:{all:null,top:null,right:null,bottom:null,left:null}},cards:{contrastBackgroundColor:"#1C52DC",contrastTextColor:"#FFFFFF",baseBackgroundColor:"#F8F8F8",baseTextColor:"#333333",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}}},Dv="ERROR",jv="useblocks",Ao={em_token:"em_access_token",em_refresh_token:"em_refresh_token",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode",em_active_tab:"em_active_tab"},Ft={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open",em_active_tab:"em_active_tab",em_ai_settings:"em_ai_settings",em_last_active_page:"em_last_active_page",em_layout_convert_never_suggest:"em_layout_convert_never_suggest",em_filemanager_v2:"em_filemanager_v2",em_projects_v2:"em_projects_v2",em_translations_v2:"em_translations_v2",em_defer_chrome:"em_defer_chrome",em_stripo_import:"em_stripo_import",em_guest_locale:"em_guest_locale"},Fv="not all",Lv="light",kv="dark",Uv="system",Bv="(prefers-color-scheme: light)",$v="(prefers-color-scheme: dark)",xv={auth:"/auth",projects_index:"/",projects:"/projects",project:"/projects/:projectId/emails",email:"/projects/:projectId/emails/:emailId",create_email:"/projects/:projectId/emails/new",create_page:"/projects/:projectId/emails/create",new_from:"/projects/:projectId/emails/new_from",blocks:"/projects/:projectId/blocks",block:"/projects/:projectId/blocks/:blockId",create_block:"/projects/:projectId/blocks/new",billing:"/billing"},me={ADD_NEW_PROJECT_MODAL:"ADD_NEW_PROJECT_MODAL",BLOCKS_MODAL:"BLOCKS_MODAL",EDIT_PROFILE_MODAL:"EDIT_PROFILE_MODAL",SEND_TEST_EMAIL:"SEND_TEST_EMAIL",ADD_NEW_EBLOCK_MODAL:"ADD_NEW_EBLOCK_MODAL",UPDATE_GLOBAL_BLOCKS_MODAL:"UPDATE_GLOBAL_BLOCKS_MODAL",SAVE_GLOBAL_BLOCK_CHOICE_MODAL:"SAVE_GLOBAL_BLOCK_CHOICE_MODAL",ADD_NEW_EMAIL_MODAL:"ADD_NEW_EMAIL_MODAL",ADD_NEW_AI_EMAIL:"ADD_NEW_AI_EMAIL",STRIPO_IMPORT:"STRIPO_IMPORT",STRIPO_IMPORT_RESULT:"STRIPO_IMPORT_RESULT",SWITCH_TO_PLAN_MODAL:"SWITCH_TO_PLAN_MODAL",IMAGE_EDITOR_MODAL:"IMAGE_EDITOR_MODAL",ADD_NEW_FOLDER_MODAL:"ADD_NEW_FOLDER_MODAL",EDIT_FOLDER_NAME_MODAL:"EDIT_FOLDER_NAME_MODAL",ADD_NEW_GROUP_MODAL:"ADD_NEW_GROUP_MODAL",EDIT_GROUP_NAME_MODAL:"EDIT_GROUP_NAME_MODAL",RENAME_EMAIL_MODAL:"RENAME_EMAIL_MODAL",RENAME_BLOCK_MODAL:"RENAME_BLOCK_MODAL",UPLOAD_IMAGE_MODAL:"UPLOAD_IMAGE_MODAL",UPLOAD_BACKGROUND_MODAL:"UPLOAD_BACKGROUND_MODAL",UPLOAD_IMAGE_MODAL_AI:"UPLOAD_IMAGE_MODAL_AI",UPLOAD_BACKGROUND_MODAL_AI:"UPLOAD_BACKGROUND_MODAL_AI",UPLOAD_IMAGE_MODAL_STOCK:"UPLOAD_IMAGE_MODAL_STOCK",UPLOAD_BACKGROUND_MODAL_STOCK:"UPLOAD_BACKGROUND_MODAL_STOCK",UPLOAD_IMAGE_MODAL_GIF:"UPLOAD_IMAGE_MODAL_GIF",UPLOAD_BACKGROUND_MODAL_GIF:"UPLOAD_BACKGROUND_MODAL_GIF",UPLOAD_IMAGE_MODAL_EDIT:"UPLOAD_IMAGE_MODAL_EDIT",UPLOAD_BACKGROUND_MODAL_EDIT:"UPLOAD_BACKGROUND_MODAL_EDIT",UPLOAD_IMAGE_MODAL_UPLOAD:"UPLOAD_IMAGE_MODAL_UPLOAD",UPLOAD_BACKGROUND_MODAL_UPLOAD:"UPLOAD_BACKGROUND_MODAL_UPLOAD"},qv="application/x-emailmaker-social-reorder",Sl="fonts.googleapis.com",Pl=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},wl=e=>{const t=Pl(String(e??""));return t?t.hostname===Sl&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Gv=e=>{const t=Pl(String(e??""));if(!t||t.hostname!==Sl)return"";const r=t.searchParams.get("family");return r?r.split(":")[0].trim():""},Mo=e=>{const t=Number(e);return Number.isInteger(t)&&t>=100&&t<=900&&t%100===0?String(t):null},Hv=e=>{const[t,r]=e.split("..");if(r===void 0){const i=Mo(t);return i?[i]:[]}const n=[];for(let i=Math.ceil(Number(t)/100)*100;i<=Number(r);i+=100){const o=Mo(String(i));o&&n.push(o)}return n},zv=e=>{const[t,r=""]=e.split("@"),n=t.split(","),i=n.indexOf("ital"),o=n.indexOf("wght");return r.split(";").flatMap(a=>{const s=a.split(","),l=i<0?["0"]:(s[i]??"").split(".."),u=o<0?["400"]:Hv(s[o]??"");return l.flatMap(c=>u.map(d=>({weight:d,style:c==="1"?"italic":"normal"})))})},Vv={regular:"400",bold:"700"},Wv=e=>e.split(",").flatMap(t=>{const r=/^(\d+|regular|bold)?(italic|i)?$/i.exec(t.trim());if(!r||!r[1]&&!r[2])return[];const n=Mo(Vv[r[1]?.toLowerCase()??""]??r[1]??"400");return n?[{weight:n,style:r[2]?"italic":"normal"}]:[]}),Qv=(e,t)=>{if(!wl(e))return[];const r=new URL(String(e).trim()),n=r.pathname.startsWith("/css2"),i=r.searchParams.getAll("family").flatMap(u=>n?[u]:u.split("|")).map(u=>{const c=u.indexOf(":");return c<0?{name:u.trim(),spec:""}:{name:u.slice(0,c).trim(),spec:u.slice(c+1)}}),o=t?.trim().toLowerCase(),a=o?i.find(u=>u.name.toLowerCase()===o):i[0];if(!a?.spec)return[];const s=n?zv(a.spec):Wv(a.spec),l=new Set;return s.filter(u=>{const c=`${u.weight}/${u.style}`;return l.has(c)?!1:(l.add(c),!0)})},Ge={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:O.createIdentifier("sandbox_image_reset"),SANDBOX_NATIVE_IMAGE_DROP_CLEAR:"sandbox_native-image-drop-clear",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",_APPLICATION_ELEMENT_SETTINGS_SET:O.createIdentifier("application_element_settings_set"),APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",SANDBOX_EBLOCK_SET_EM_BLOCK_ID:"sandbox_eblock_set_em_block_id",SANDBOX_GLOBAL_BLOCK_REPLACE:"sandbox_global_block_replace",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_NATIVE_IMAGE_DROP:"application_native-image-drop",APPLICATION_SUBJECT_UPDATE:O.createIdentifier("application_subject_update"),APPLICATION_PREHEADER_UPDATE:O.createIdentifier("application_preheader_update"),APPLICATION_DOMPARSER_ERROR:O.createIdentifier("application_domparser_error"),APPLICATION_UPDATE_ENTITY:O.createIdentifier("application_update_entity"),APPLICATION_IFRAME_DRAG_EVENT:O.createIdentifier("application_iframe_drag_event"),APPLICATION_HAS_AMP:O.createIdentifier("application_has_amp"),APPLICATION_CANVAS_IMAGE_GET:O.createIdentifier("application_canvas_image_get"),APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:O.createIdentifier("application_atom_inserted"),APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:O.createIdentifier("SANDBOX_READY"),SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:O.createIdentifier("sandbox_subject_update"),SANDBOX_PREHEADER_UPDATE:O.createIdentifier("sandbox_preheader_update"),SANDBOX_DRAG_EVENT:O.createIdentifier("sandbox_drag_event"),SANDBOX_WHEEL:O.createIdentifier("sandbox_wheel"),SANDBOX_ADD_MERGETAG:O.createIdentifier("sandbox_add_mergetag"),SANDBOX_TRANSLATIONS:O.createIdentifier("sandbox_send_translations"),SANDBOX_SET_THEME_VARIABLES:O.createIdentifier("sandbox_send_theme_variables"),SANDBOX_SET_PROJECT_FONTS:O.createIdentifier("sandbox_set_project_fonts"),SANDBOX_CANVAS_IMAGE_CACHE_SETUP:O.createIdentifier("sandbox_canvas_image_cache_setup"),SANDBOX_SET_ENTITY:O.createIdentifier("sandbox_set_entity"),SANDBOX_INIT_START:O.createIdentifier("sandbox_init_start"),SANDBOX_INITED:O.createIdentifier("sandbox_inited"),SANDBOX_UPDATE_ENTITY:O.createIdentifier("sandbox_update_entity"),RELOAD:O.createIdentifier("reload"),SANDBOX_ADD_EXTENSIONS:O.createIdentifier("sandbox_add_extensions"),SANDBOX_REMOVE_EXTENSIONS:O.createIdentifier("sandbox_remove_extensions"),SANDBOX_ADD_SCRIPT:O.createIdentifier("sandbox_add_script"),SANDBOX_IS_EMAIL_EMPTY:O.createIdentifier("sandbox_is_email_empty"),SANDBOX_SWITCH_THEME:O.createIdentifier("sandbox_switch_theme")},Kv={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2},Yv=(function(e){return e.IMG="img",e.TEXT="text",e.LINK="a",e.TABLE="table",e.VINDENT="vindent",e.TD="td",e.STRUCTURE="structure",e.GROUP="group",e.BUTTON="button",e.DIV="div",e.FLOAT_BLOCK="floatBlock",e.VAR="var",e.EMPTY_TABLE="emptyTable",e.EMPTY_TD="emptyTd",e.COUNTDOWN="countdown",e.VIDEO="video",e.COLUMN="column",e.CAROUSEL="carousel",e.ACCORDION="accordion",e.CUSTOM_TABLE="customTable",e.SOCIAL="social",e})({}),Xv={ALL:"All",STANDARD:"Standard",PROJECT:"Project"},Jv="Appearance",Zv="Structure",e_="Settings",t_="Properties",r_="History",n_="Disabled_tab",Il="Edit selected element",i_="UTM parameters",o_="Annotations parameters",a_="Table properties",s_="Edit selected table cells",u_="#b9b1b1",l_="Edit",c_="AiChat",No="Build",d_="Styles",f_="Discuss",p_="Blocks",h_="Atoms",m_="Optimise",g_={top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null},all:{width:null,style:null,color:null}},y_="block",Cl="email",v_="cards",__="pending",b_="d41d8",E_="valid",S_="warnings",P_="errors",w_={LINKS:"Links",IMAGES:"Images",SPAM_ASSASSIN:"Spam assassin",PROBLEMS:"Problems"},I_="1865",Ol=127017,Tl="desktop",Al="mobile",C_="emailtags",O_="blocktags",T_=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),CHANGE_IMAGE_EDIT:e("Edit"),CHANGE_IMAGE_STOCK:e("Stock"),CHANGE_IMAGE_CHANGETO:e("Upload"),CHANGE_IMAGE_GIF:e("GIF"),CHANGE_IMAGE_AI:e("Generate"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),UPDATE_GLOBAL_BLOCK_IN_TEMPLATES:e("Push block update to all templates"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),SOCIAL:e("Social media"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SOCIAL:e("Social media"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here"),INSERT_COLUMN_BEFORE_TABLE:e("Insert column before"),INSERT_COLUMN_AFTER_TABLE:e("Insert column after"),INSERT_ROW_BEFORE_TABLE:e("Insert row before"),INSERT_ROW_AFTER_TABLE:e("Insert row after"),MERGE_RIGHT_CELL_TABLE:e("Merge right cell"),MERGE_LEFT_CELL_TABLE:e("Merge left cell"),MERGE_TOP_CELL_TABLE:e("Merge top cell"),MERGE_BOTTOM_CELL_TABLE:e("Merge bottom cell"),SPLIT_CELL_TABLE:e("Split cell"),REMOVE_COLUMN_TABLE:e("Remove column"),REMOVE_ROW_TABLE:e("Remove row"),DROP_BLOCK_HINT:e("Click or drag a block")}),A_={Applications:"Apps",Articles:"Article",Banners:"Banners",Buttons:"Buttons","Call to Action":"Call to Action",Contacts:"Contacts",Content:"Content","E-Commerce":"E-Commerce",Feature:"Features",Footer:"Footers",Header:"Headers",Lists:"Lists",Menu:"Menus",Other:"Others",Polls:"Polls",Promocodes:"Promocodes",Separators:"Separators"},Ml={maker:"https://ai-mail.emcdn.ru",blocks:"https://ai-mail.useblocks.io"},M_=/^(?:ant|vscode|monaco|docs)-/;function N_(e){return M_.test(e)}function R_(){const e="em".trim();if(!/^[a-z][a-z0-9]*$/i.test(e))throw new Error(`[cssVars] REACT_APP_CSS_VAR_PREFIX="${e}" is not a valid CSS identifier fragment.`);return e}var D_=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function j_(){return D_}var F_=new Set;function L_(e,t,r=F_){return e.startsWith(`${t}-`)?!1:!N_(e)&&!r.has(e)}function k_(e,t){return`--${t}-${e}`}function Dr(e){const t=R_();return L_(e,t,j_())?k_(e,t):`--${e}`}function U_(e,t){const r=Dr(e);return t!==void 0?`var(${r}, ${t})`:`var(${r})`}function B_(e,t){return U_(e,t)}function $_(e){return Dr(e)}function Nl(e){return e.getOrCreateInstance(O.MESSAGE_SERVICE_ID,()=>new O.MessageService)}var x_=new WeakMap,Rl=new WeakMap;function q_(e){return x_.get(e)??0}function G_(e,t){let r=Rl.get(e);return r||(r=new Set,Rl.set(e,r)),r.add(t),()=>{r?.delete(t)}}var Dl=O.INJECTION,H_=e=>e??O.createIdentifier$1();function Ke(){const e=ve();return(0,R.useMemo)(()=>O.getContainer(e),[e])}function z_(e,t){const r=ve(),n=(0,R.useMemo)(()=>t||O.getContainer(r),[r,t]),[i,o]=(0,R.useState)(()=>n?.getInstance(e));return(0,R.useEffect)(()=>{const a=n?.onInject(s=>{s===e&&o(n.getInstance(e))});return()=>a?.dispose()},[e,n]),i}function V_(e,t){const r=ve(),n=(0,R.useMemo)(()=>t||O.getContainer(r),[r,t]),[i,o]=(0,R.useState)(()=>n?.getServices(e)||[]);return(0,R.useEffect)(()=>{if(!n)return;const a=n.onInject(s=>{s===O.getServiceContainerId(e)&&o(n.getServices(e))});return()=>{a?.dispose()}},[e,n]),i}function jl(e,t){return e.user.mode||e.serverSide.mode||t||"pro"}function W_(e,t){const r=jl(e,t);return e.serverSide.advancedConfigs?.[r]||{}}function Q_(e,t){const r=jl(e,t),n=e.user?.advancedConfigs?.[r],i=n!==void 0?n:e.user?.advancedConfigs?.pro;return{...e.advancedConfigs?.[r],...i}}function K_(e,t,r){const n=W_(e,r),i=Q_(e,r);return O.pickKey([i,e.user,n,e.serverSide],t)}var Y_=O.createIdentifier$1("planFeatures.source");function X_(e){return e.getOrCreateInstance(Y_,()=>Ve(void 0))}function J_(e,t){if(e&&Object.prototype.hasOwnProperty.call(e,t))return!!e[t]}function Et(e){return e?.getInstance(O.CONFIG_SOURCE_ID)?.get()??{}}function Ro(){const e=Ke().getInstance(O.CONFIG_SOURCE_ID);if(!e)throw new Error("[config] источник конфигурации не зарегистрирован: нет provideConfig");return e}function Hn(){const e=Ro();if(e.get()===void 0)throw e.ready();const t=(0,R.useCallback)(i=>{const o=e.watch(i);return()=>o.dispose()},[e]),r=(0,R.useSyncExternalStore)(t,()=>e.get()),n=Z_();return(0,R.useMemo)(()=>r,[r,n])}function Z_(){const e=Ke(),t=X_(e),r=(0,R.useCallback)(n=>{const i=t.watch(n);return()=>i.dispose()},[t]);return(0,R.useSyncExternalStore)(r,()=>t.get())}function eb(e){const t=Ro();return Hn(),K_(t.layers(),e)}function tb(){const e=Ke(),t=(0,R.useCallback)(n=>{if(!e)return()=>{};const i=oo(e).watch(n);return()=>i.dispose()},[e]),r=(0,R.useCallback)(()=>Eg(e),[e]);return(0,R.useSyncExternalStore)(t,r,r)}function rb(e){return e.hasOwnProperty("children")}function Fl(e,t,r){return e?.length?e.map((n,i)=>rb(n)?{key:O.generateUUID(),value:n.value,label:n.label,children:Fl(n.children,t,r),type:"group"}:{key:O.generateUUID(),label:n.label,value:n.value,onClick:o=>{r(n.value,o.domEvent)}}):void 0}var nb=(e,t)=>{const r=()=>{try{const n={...e,appLabel:"blocks_app"};window.dataLayer&&typeof window.dataLayer.push=="function"&&window.dataLayer.push(n);const i=typeof n.event=="string"&&n.event.trim()?n.event.trim():null,o=(typeof n.action=="string"&&n.action.trim()?n.action.trim():null)||(typeof n.event_action=="string"&&n.event_action.trim()?n.event_action.trim():null);let a;i&&o?a=`${i}_${o}`:i?a=i:o?a=o:a="event";const{event:s,action:l,...u}=n;"event_action"in u&&delete u.event_action;const c={...u,...i?{event:i}:{},...o?{action:o}:{}};typeof window<"u"&&window.amplitude&&typeof window.amplitude.track=="function"&&window.amplitude.track(a,c)}catch{}};t?setTimeout(r,t):r()},jr=()=>{const e=Hn();return(0,R.useCallback)((t,r)=>{e.pushToGTM!==!1&&nb(t,r)},[e.pushToGTM])},ib="change",ob="element_setting",ab={textStrong:"bold",textItalic:"italic",textUnderline:"underline",textStrikethrough:"strikethrough",textSuperscript:"superscript",textSubscript:"subscript",widthDim:"width_unit",heightDim:"height_unit",fontSizeDim:"font_size_unit",lineHeightDim:"line_height_unit",letterSpacingDim:"letter_spacing_unit"},sb=new Set(["width","height","padding","margin","font_size","line_height","letter_spacing","border_radius","border","box_shadow","opacity","color","background_color","border_color","text_color"]),ub=new Set(["activateSection","changeKey","classNamePrefix","parent","path","type","caption","deletable","nextElem","prevElem","floatBlocks","usedColors"]),lb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").toLowerCase(),cb=e=>ab[e]??lb(e),Do=e=>e.length>100?e.slice(0,100):e,db=e=>{if(e==null)return null;const t=typeof e;if(t==="boolean"||t==="number")return e;if(t==="string")return Do(e);if(t==="object"){const r=e;if("value"in r){const n=typeof r.dim=="string"?r.dim:"",i=r.value===null||r.value===void 0?"":String(r.value);return Do(`${i}${n}`)}try{return Do(JSON.stringify(r))}catch{return null}}return null},fb=(e,t)=>{if(!e||!t||typeof t!="object")return[];const r=[];for(const[n,i]of Object.entries(t))ub.has(n)||i===void 0||r.push({event:ib,action:ob,element_type:e,property:cb(n),property_value:db(i)});return r},pb=e=>sb.has(e),hb=(e,t=600)=>{const r=new Map,n=new Map,i=s=>{const l=r.get(s);l&&(clearTimeout(l),r.delete(s));const u=n.get(s);u&&(n.delete(s),e(u))};return{track:(s,l)=>{const u=fb(s,l);for(const c of u){if(!pb(c.property)){e(c);continue}const d=`${c.element_type}:${c.property}`,f=r.get(d);f&&clearTimeout(f),n.set(d,c),r.set(d,setTimeout(()=>i(d),t))}},flush:()=>{Array.from(r.keys()).forEach(s=>i(s))}}},jo=new Set;function mb(){jo.forEach(e=>e())}function gb(e){return jo.add(e),()=>{jo.delete(e)}}function Yt(){const e=ve();return(0,R.useMemo)(()=>Nl(O.getContainer(e)),[e])}function yb(){const e=Yt(),t=jr(),r=(0,R.useRef)(t);r.current=t;const n=(0,R.useRef)(void 0);return n.current||(n.current=hb(i=>r.current(i))),(0,R.useCallback)(function(i){e.send(i),i?.operation===Ge.SANDBOX_ELEMENT_SETTINGS_SET&&mb(),i?.operation===Ge.SANDBOX_ELEMENT_SETTINGS_SET&&i.type&&i.settings&&typeof i.settings=="object"&&n.current?.track(i.type,i.settings)},[e])}function vb(){const e=Yt();return(0,R.useCallback)(function(t,r){e.send(t,r)},[e])}var Ll=(0,R.createContext)({element:void 0}),_b=()=>(0,R.useContext)(Ll)?.element,kl=(0,R.createContext)(void 0),bb=()=>(0,R.useContext)(kl),Ul=(0,R.createContext)(!1),Eb=()=>(0,R.useContext)(Ul);function Fo(e){return O.createIdentifier$1(e)}function Lo(e,t){return e.getOrCreateInstance(t,()=>new O.AsyncEmitter)}function Sb(e,t){return e.getOrCreateInstance(t,()=>new O.AsyncEmitter).event}function Pb(e){return ko(e).event}function ko(e){const t=ve();return(0,R.useMemo)(()=>Lo(O.getContainer(t),e),[t,e])}var Bl=class{_listeners=[];add(e,t=0,r){const n={fn:r?e.bind(r):e,priority:t};return this._listeners.push(n),{dispose:()=>{const i=this._listeners.indexOf(n);i>=0&&this._listeners.splice(i,1)}}}async run(e){const t=[...this._listeners].sort((r,n)=>n.priority-r.priority);for(const{fn:r}of t){const n=await r(e);n!==null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp)&&Object.assign(e,n)}return e}},wb=O.createIdentifier$1("ELEMENT_INSERT_HTML_PIPELINE"),Ib=O.createIdentifier$1("BLOCK_INSERT_HTML_PIPELINE");function Cb(e){return e.getOrCreateInstance(wb,()=>new Bl)}function Ob(e){return e.getOrCreateInstance(Ib,()=>new Bl)}async function Tb(e,t){return e?Cb(e).run({...t}):t}async function Ab(e,t){return e?Ob(e).run({...t}):t}var $l=O.createIdentifier$1("ComponentRegistry"),Uo;function Mb(e){Uo=e}function Nb(e,t=$l){const r=O.DependencyResolver.getInstance(t);if(r)return r;if(!Uo)throw new Error("[extensions] component registry is not loaded yet — UI work starts at init()");return O.DependencyResolver.getOrCreateInstance(t,Uo)}var Rb=class{_factories=new Map;add(e,t){const r=e;return this._factories.set(r,t),{dispose:()=>{this._factories.get(r)===t&&this._factories.delete(r)}}}get(e){return this._factories.get(e)}},xl=O.createIdentifier$1("DomComponentRegistry");function Db(e,t=xl){return O.DependencyResolver.getOrCreateInstance(t,()=>new Rb)}function jb(e){return typeof e=="function"}function Xt(e){return(0,R.isValidElement)(e)}function Fb(e){return typeof e=="function"||Xt(e)}function Lb(e){return typeof e=="object"&&e!==null&&"type"in e&&"props"in e&&!Xt(e)}function Bo(e,t){return(0,R.createElement)(e,t)}function kb(e){return class extends R.Component{_ref=(0,R.createRef)();_instance;componentDidMount(){this._ref.current&&(this._instance=e(this.props),this._ref.current.appendChild(this._instance.node))}componentDidUpdate(r){this._instance?.update&&this._instance.update(this.props)}componentWillUnmount(){this._instance?.dispose&&this._instance.dispose()}render(){return(0,R.createElement)("div",{ref:this._ref})}}}var Ub=class{_domComponentRegistry;_components=new Map;_domAdapters=new Map;constructor(e){this._domComponentRegistry=e}add(e,t){return this.override(e,()=>t)}addDom(e,t){const r=e;this._domAdapters.delete(r);const n=this._domComponentRegistry.add(e,t);return{dispose:()=>{this._domAdapters.delete(r),n.dispose()}}}override(e,t){const r=e;let n=this._components.get(r);n||(n={replacers:[]},this._components.set(r,n));const i=()=>{const o=n.replacers.findIndex(a=>a.replacer===t);o>=0&&(n.replacers.splice(o,1),this._recomputeComponent(r,n))};return n.replacers.push({replacer:t,dispose:i}),this._recomputeComponent(r,n),{dispose:i}}_recomputeComponent(e,t){t.component=t.replacers.reduce((r,{replacer:n})=>n(r),void 0)}get(e){if(Fb(e))return e;const t=e,r=this._components.get(t);if(r?.component)return r.component;const n=this._domComponentRegistry.get(e);if(n){let i=this._domAdapters.get(t);return i||(i=kb(n),this._domAdapters.set(t,i)),i}}_resolveComponentInput(e){if(e==null)return null;if(typeof e=="number"||typeof e=="boolean"||Xt(e))return e;if(typeof e=="string"){const t=this.get(e);return Xt(t)?t:t?Bo(t):e}if(jb(e))return Bo(e);if(Lb(e)){const t=this.get(e.type);return Xt(t)?t:t?Bo(t,e.props):null}return null}getReactNode(e){return this._resolveComponentInput(e)}getReactElement(e){const t=this._resolveComponentInput(e);return Xt(t)?t:typeof t=="string"||t==null||typeof t=="boolean"||typeof t=="number"?(0,R.createElement)(R.Fragment,null,t):(0,R.createElement)(R.Fragment,null)}},ql=()=>new Ub(Db(O.DependencyResolver,xl));Mb(ql),O.DependencyResolver.getOrCreateInstance($l,ql);function $o(e){"@babel/helpers - typeof";return $o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$o(e)}function Gl(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}var Bb=365.2425,$b=Math.pow(10,8)*24*60*60*1e3,Hl=6e4,zl=36e5,WD=-$b,xb=3600,Vl=xb*24,QD=Vl*7,qb=Vl*Bb,Gb=qb/12,KD=Gb*3;function Hb(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function zb(e,t){var r;Gl(1,arguments);var n=Hb((r=t?.additionalDigits)!==null&&r!==void 0?r:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=Kb(e),o;if(i.date){var a=Yb(i.date,n);o=Xb(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),l=0,u;if(i.time&&(l=Jb(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(u=Zb(i.timezone),isNaN(u))return new Date(NaN)}else{var c=new Date(s+l),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return new Date(s+l+u)}var zn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Vb=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Wb=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Qb=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Kb(e){var t={},r=e.split(zn.dateTimeDelimiter),n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],zn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(zn.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){var i=zn.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function Yb(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var i=n[1]?parseInt(n[1]):null,o=n[2]?parseInt(n[2]):null;return{year:o===null?i:o*100,restDateString:e.slice((n[1]||n[2]).length)}}function Xb(e,t){if(t===null)return new Date(NaN);var r=e.match(Vb);if(!r)return new Date(NaN);var n=!!r[4],i=Fr(r[1]),o=Fr(r[2])-1,a=Fr(r[3]),s=Fr(r[4]),l=Fr(r[5])-1;if(n)return iE(t,s,l)?eE(t,s,l):new Date(NaN);var u=new Date(0);return!rE(t,o,a)||!nE(t,i)?new Date(NaN):(u.setUTCFullYear(t,o,Math.max(i,a)),u)}function Fr(e){return e?parseInt(e):1}function Jb(e){var t=e.match(Wb);if(!t)return NaN;var r=xo(t[1]),n=xo(t[2]),i=xo(t[3]);return oE(r,n,i)?r*zl+n*Hl+i*1e3:NaN}function xo(e){return e&&parseFloat(e.replace(",","."))||0}function Zb(e){if(e==="Z")return 0;var t=e.match(Qb);if(!t)return 0;var r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return aE(n,i)?r*(n*zl+i*Hl):NaN}function eE(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,o=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}var tE=[31,null,31,30,31,30,31,31,30,31,30,31];function Wl(e){return e%400===0||e%4===0&&e%100!==0}function rE(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(tE[t]||(Wl(e)?29:28))}function nE(e,t){return t>=1&&t<=(Wl(e)?366:365)}function iE(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function oE(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function aE(e,t){return t>=0&&t<=59}var sE=Object.freeze({});function uE(){return null}function qo(){return sE}function lE(){return""}function Go(){return cE}function cE(){}function dE(){return(0,R.useMemo)(()=>({get:()=>null,set:()=>{}}),[])}var Ql=["title","slug","type","tags","blocktags","modified","author","lock","subject","description","excerpt","status","is_template","link","renderGuid","date","date_gmt","modified_gmt","comment_status","ping_status","template","related_email","project_title","project_author","isAmp","meta"],fE=[...Ql,"html","id","project","password"],Ho=new Set(["html",...Ql,"global_block","project"]),pE=new Set(["title","slug","type","modified","author","subject","description","excerpt","status","link","renderGuid","date","date_gmt","modified_gmt","comment_status","ping_status","template","related_email","project_title","project_author"]),hE=new Set(["tags","blocktags","lock","is_template","isAmp","global_block"]);function Kl(e,t){return Ho.has(e)?e==="html"?typeof t=="string":e==="meta"?t!=null&&typeof t=="object":e==="project"?t!=null:pE.has(e)?t!=null&&t!=="":hE.has(e)?t!=null:t!==void 0:!1}function mE(e){if(!e||typeof e!="object")return{};const t={};e.id!=null&&e.id!==""&&(t.id=String(e.id)),e.title!=null&&e.title!==""&&(t.title=e.title),e.slug!=null&&e.slug!==""&&(t.slug=e.slug),e.type!=null&&e.type!==""&&(t.type=e.type),e.tags!=null&&(t.tags=e.tags),e.blocktags!=null&&(t.blocktags=e.blocktags),e.modified!=null&&e.modified!==""&&(t.modified=e.modified),e.author!=null&&e.author!==""&&(t.author=String(e.author)),e.lock!=null&&(t.lock=e.lock),e.subject!=null&&e.subject!==""&&(t.subject=e.subject),e.description!=null&&e.description!==""&&(t.description=e.description),e.excerpt!=null&&e.excerpt!==""&&(t.excerpt=e.excerpt),e.status!=null&&e.status!==""&&(t.status=e.status),e.is_template!=null&&(t.is_template=e.is_template),e.link!=null&&e.link!==""&&(t.link=e.link),e.renderGuid!=null&&e.renderGuid!==""&&(t.renderGuid=e.renderGuid),e.date!=null&&e.date!==""&&(t.date=e.date),e.date_gmt!=null&&e.date_gmt!==""&&(t.date_gmt=e.date_gmt),e.modified_gmt!=null&&e.modified_gmt!==""&&(t.modified_gmt=e.modified_gmt),e.comment_status!=null&&e.comment_status!==""&&(t.comment_status=e.comment_status),e.ping_status!=null&&e.ping_status!==""&&(t.ping_status=e.ping_status),e.template!=null&&e.template!==""&&(t.template=e.template),e.related_email!=null&&e.related_email!==""&&(t.related_email=e.related_email),e.project_title!=null&&e.project_title!==""&&(t.project_title=e.project_title),e.project_author!=null&&e.project_author!==""&&(t.project_author=e.project_author),e.isAmp!=null&&(t.isAmp=e.isAmp),e.meta!==void 0&&e.meta!==null&&typeof e.meta=="object"&&(t.meta=e.meta);const r=new Set(fE),n={};for(const i of Object.keys(e))r.has(i)||(n[i]=e[i]);return Object.keys(n).length>0&&(t.catalogExtra=n),t}function gE(e,t){return{...mE(e),html:t.html||"",insertFrom:t.insertFrom,fragmentRole:t.fragmentRole,name:t.name,project:t.project}}var yE=class extends O.BaseEmitter{async execute([e],t){for(const r of t){const n=await r(e);n&&(n.id===void 0&&(n.id=e.value.id),e.value=n)}return e.value}},vE=class extends O.AsyncEmitter{};function YD(e){return e}var Yl=class extends O.Disposable{_items=new Map;_onChangeEmitter=new O.Signal;async _getOrCreate(e,t){const r=this._items;let n;if(r.has(e))try{n=await r.get(e)}catch{t&&(n=await t())}else t&&(n=await t(),n&&this._onChangeEmitter.fire());return n}async _addOrUpdate(e,t){let r;const n=this._items;if(n.has(e))try{r=await n.get(e)}catch{}const i=await t(r);return O.deepEqual(r,i)||this._onChangeEmitter.fire(),i}entries(){return Promise.all([...this._items.entries()].map(([e,t])=>t.then(r=>[e,r]))).then(e=>e.filter(([t,r])=>!!r))}values(){return Promise.all([...this._items.values()].map(e=>e).filter(e=>!!e))}getOrCreate(e,t){const r=this._getOrCreate(e,()=>t(e));return this._items.set(e,r),r}addOrUpdate(e,t){const r=this._addOrUpdate(e,t);return this._items.set(e,r),r}async getIfPresent(e){if(this._items.has(e))try{return await this._items.get(e)}catch{return}}add(e,t){const r=Promise.resolve(t);return this._items.set(e,r),r}remove(e){if(this._items.has(e)){const t=this._items.get(e);return this._items.delete(e),this._onChangeEmitter.fire(),t}return Promise.resolve(void 0)}async setAll(e){try{this.suspendChange();const t=[],r=new Set(Array.from(e).map(([i,o])=>i)),n=(await this.entries()).filter(([i,o])=>!r.has(i));for(const[i,o]of e)t.push(this.addOrUpdate(i,()=>o)),r.add(i);for(const[i]of n)t.push(this.remove(i));return await Promise.all(t),n}finally{this.resumeChange()}}clear(){this._items.clear(),this._onChangeEmitter.fire()}suspendChange(){this._onChangeEmitter.suspend()}resumeChange(){this._onChangeEmitter.resume()}onChange=this._onChangeEmitter.event};function _E(e,{filter:t,order:r="asc",orderBy:n,page:i,pageSize:o=20}={}){const a=e.length;let s=e.length;if(t!==void 0){const l=Object.keys(t);e=e.filter(u=>{for(const c of l){const d=u[c],f=t[c];return c==="id"||typeof d!="string"?d===f:typeof f=="string"&&d.startsWith(f)}return!0}),s=e.length}return n&&(e=e.sort((l,u)=>(l[n]>u[n]?1:u[n]>l[n]?-1:0)*(r==="asc"?1:-1))),i!==void 0&&(e=e.slice(o*(i-1),o*i)),{data:e,filteredTotal:s,total:a,totalPages:Math.ceil(s/o)}}var bE=1e3;function Xl(e,t,r=bE,n=0){if(n>r||e===t)return!0;if(typeof e!=typeof t||e===null||t===null)return!1;if(typeof e=="object"&&typeof t=="object"){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(const a of i)if(!Xl(e[a],t[a],r,n+1))return!1;return!0}return!1}function Jl(e,t){if(!e||typeof e!="object")return t;if(!t||typeof t!="object")return{};const r={};for(const n of Object.keys(t)){const i=t[n],o=e[n];Xl(i,o)||(r[n]=i)}return r}function EE(e=[]){if(e=e.filter(r=>r),e.length<=1)return e[0];const t=new Map;for(const r of e)for(const n of r)if(n.id!==void 0){const i=t.get(n.id)||{};t.set(n.id,{...i,...n})}return[...t].map(([r,n])=>n)}function SE(e,t){return Zl(e)&&Zl(t)?String(e)===String(t):e===t}function Zl(e){return typeof e=="string"||typeof e=="number"}var PE=class extends O.Disposable{_cache=new Yl;_readEmitter=new O.AsyncEmitter;_saveEmitter=this.addDisposable(new yE);_removeEmitter=this.addDisposable(new vE);_foreignCache=Object.create(null);async get(e){return this._cache.getOrCreate(e,async t=>Object.assign({id:e},...(await this._readEmitter.fire(e)).filter(r=>!!r)))}get cache(){return this._cache}byForeignKey(e){let t=this._foreignCache[e];if(!t){const r=this.addDisposable(new O.Disposable);r.addDispose(()=>delete this._foreignCache[e]);const n=r.addDisposable(new Yl),i=r.addDisposable(new O.AsyncEmitter);t=this._foreignCache[e]={get:async(o,a={})=>{await n.getOrCreate(o,async()=>{try{const l=EE(await i.fire(o))||[];for(const u of l)u[e]=o,await this._cache.add(u.id,u);return l}catch{return[]}});const s=(await this._cache.values()||[]).filter(l=>{const u=l[e];return u==null||SE(u,o)});return _E(s,a)},first(o,a={}){return t.get(o,{...a,page:1,pageSize:1}).then(({data:s})=>s[0])},handleRead:i.event,clear(){n.clear()},dispose(){r.dispose()}}}return t}async create(e,{source:t="",silent:r}={}){let n=e;return r||(n=await this._saveEmitter.fire({prev:void 0,patch:e,value:n,source:t})),n.id===void 0&&(n.id=O.generateUUID()),await this._cache.addOrUpdate(n.id,()=>n)}notifySave(e){return this._saveEmitter.fire(e)}async update(e,t,{source:r="",silent:n}={}){return this._cache.addOrUpdate(e,async i=>{const o=i?{...i,...t}:t;if(!n)return t=i?Jl(i,t):t,await this._saveEmitter.fire({prev:i,patch:t,value:o,source:r})})}async remove(e,{source:t="",silent:r}={}){const n=await this._cache.remove(e);return r||await this._removeEmitter.fire({value:n,source:t}),n}refresh(){this._cache.clear();for(const e of Object.values(this._foreignCache))e.clear()}suspendChange(){this._cache.suspendChange()}resumeChange(){this._cache.resumeChange()}handlerRead=this._readEmitter.event;onSave=this._saveEmitter.event;onRemove=this._removeEmitter.event;onChange=this._cache.onChange};function Lr(e){const t=O.createIdentifier$1(e);return r=>r.getOrCreateInstance(t,()=>new PE)}function wE(e){const t=e.getInstance(O.STORE_ID);if(!t)throw new Error("Failed");return t}function ec(e){const t=e.getInstance(O.DISPOSABLE_ID);if(!t)throw new Error("Failed");return t}var tc=Lr("plugin.dataSource.blocks"),rc=Lr("plugin.dataSource.blockRevisions"),nc=Lr("plugin.dataSource.comments"),IE=Fo(),CE=Fo(),ic=O.createIdentifier$1("EmailPort");function OE(e){return e.getInstance(ic)}function TE(e,t){e.inject(ic,t)}var zo={INIT_START:5e3,SET_ENTITY:12e3,PREHEADER:5e3,SUBJECT:5e3,INITED:5e3,UPDATE_ENTITY:5e3},oc=["INIT_START","SET_ENTITY","PREHEADER","SUBJECT","INITED"],Vo=2e4,AE=oc.reduce((e,t)=>e+zo[t],0),ac=Vo+AE+3e3;function ME(e){return oc.reduce((t,r)=>t+sc(r,e),0)}function sc(e,t){const r=t?.[e];return typeof r=="number"&&r>0?r:zo[e]}function NE(e){const t=e?.contentReady;return typeof t=="number"&&t>0?t:ac}function RE(e){const t=e?.sandboxReady;return typeof t=="number"&&t>0?t:Vo}function Wo(e=ac){return e+3e3}var uc=O.createIdentifier$1("EmailHistoryPort"),lc=O.createIdentifier$1("BlockHistoryPort");function cc(e){return e.getInstance(lc)}function DE(e,t){e.inject(lc,t)}function dc(e){return e.getInstance(uc)}function jE(e,t){e.inject(uc,t)}var FE=class extends Error{timeoutMs;constructor(e){super(`[emailmaker] handleSaveEmail did not respond within ${e}ms — the email was not saved`),this.timeoutMs=e,this.name="IntegratorSaveTimeoutError"}},LE=({source:e,emailtags:t,group:r,tags:n,...i})=>i;async function kE({emails:e,saveTimeoutMs:t},r){const n=t?.()??Wo();let i;try{return await Promise.race([e.notifySave(r),new Promise((o,a)=>{i=setTimeout(()=>{const s=new FE(n);r.value.id,a(s)},n)})])}finally{i!==void 0&&clearTimeout(i)}}function UE(e){const{emails:t}=e,r=async(n,i)=>{const o=LE(i),a=n===void 0?void 0:await t.cache.getIfPresent(n),s=a?{...a,...o}:o,l=await kE(e,{prev:a,patch:a?Jl(a,o):o,value:s,source:i.source??""}),u=String(l.id??n??O.generateUUID()),c=l.id===void 0?{...l,id:u}:l;return await t.cache.addOrUpdate(u,()=>c)};return{async readEmail(n){return await t.get(n)??null},async createEmail(n){const i=await r(void 0,n);return i?.renderGuid?i:{...i,renderGuid:O.generateUUID()}},async updateEmail(n,i){return await r(n,i)}}}var XD=5e3;function Vn(e){return e?.length?[...e].sort((t,r)=>Date.parse(r.modified)-Date.parse(t.modified))[0]:null}function Qo(e,{freshSince:t}={}){return!(e?.isAutosave!==!0||!e?.html?.trim()||t!==void 0&&Date.parse(e.modified)<t-5e3)}function BE(e,t={}){const r=Vn((e??[]).filter(n=>n?.html?.trim()));return Qo(r,t)?r:null}function fc(e,t){const r=Date.parse(Vn(e)?.modified??""),n=BE(e),i=Date.parse(n?.modified??""),o=t===void 0||Number.isFinite(i)&&i>t,a=[r,t??NaN].filter(s=>Number.isFinite(s));return{autosave:o?n:null,...a.length?{latestAt:Math.max(...a)}:{}}}function pc(e,t){const r=Vn((e??[]).filter(a=>a?.html?.trim())),n=Date.parse(r?.modified??""),i=r&&Number.isFinite(n)&&(t===void 0||n>t),o=[Date.parse(Vn(e??[])?.modified??""),t??NaN].filter(a=>Number.isFinite(a));return{autosave:i&&Qo(r)?r:null,...o.length?{latestAt:Math.max(...o)}:{}}}function $E({hasUnsavedUserEdit:e}){return e?"skip":"apply"}var Ko=20,xE=({source:e,emailtags:t,group:r,tags:n,...i})=>i;function qE({revisions:e,revisionsByEmail:t,readAutosave:r,savedAt:n}){const i=async(o,a)=>(t.clear(),await t.get(o,{page:a}),(await e.cache.values()??[]).filter(s=>String(s?.parent)===String(o)));return{async readRevisions(o,a=1){const s=await i(o,a);return{revisions:s.slice(Ko*(a-1),Ko*a),page:a,hasMore:s.length>Ko*a}},async readAutosave(o){const a=await n?.(o)??NaN,s=Number.isFinite(a)?a:void 0,l=await r?.(o);if(l?.asked){const u=l.revision?[{...l.revision,parent:o,isAutosave:!0}]:[];return pc(u,s)}return fc(await i(o,1),s)},async saveAutosave(o,a){const s=xE(a);return await e.create({...s,parent:o,isAutosave:!0,modified:new Date().toString()})}}}function Yo(e){return Object.prototype.hasOwnProperty.call(e,"meta")}function hc(e,t){const r={...e};return t===void 0?(delete r.meta,r):(r.meta={...e.meta??{},...t},r)}function mc(e,t,r){return e&&!Yo(t)&&Yo(e)?{...r,meta:e.meta}:r}var gc=Lr("plugin.dataSource.emails"),yc=Lr("plugin.dataSource.emailRevisions"),GE=Fo("plugin.readEmailAutosave"),vc=O.createIdentifier$1("emailDocuments.provided");function HE(e){const t=gc(e),r=yc(e),n=r.byForeignKey("parent");return e.getInstance(vc)?{emails:t,emailRevisions:r}:(e.inject(vc,!0),TE(e,UE({emails:t,saveTimeoutMs:()=>Wo(e.getInstance(O.INIT_PIPELINE_ID)?.contentReadyTimeoutMs)})),jE(e,qE({revisions:r,revisionsByEmail:n,readAutosave:async i=>{const o=await Lo(e,GE).fire(i);return o.length===0?{asked:!1}:{asked:!0,revision:o[0]??null}},savedAt:async i=>Date.parse((await t.cache.getIfPresent(i))?.modified??"")})),ec(e).addDisposable(t.onSave(({prev:i,patch:o,value:a})=>mc(i,o,a),Number.MIN_VALUE)),{emails:t,emailRevisions:r})}var zE=`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
11
|
-
<html>
|
|
12
|
-
<head>
|
|
13
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
14
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
15
|
-
<title></title>
|
|
16
|
-
<style type="text/css">
|
|
17
|
-
html {
|
|
18
|
-
-webkit-text-size-adjust: none;
|
|
19
|
-
-ms-text-size-adjust: none;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
<style em="styles">
|
|
23
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
24
|
-
.em-narrow-table {
|
|
25
|
-
width: 100%!important;
|
|
26
|
-
max-width: 660px!important;
|
|
27
|
-
min-width: 320px!important;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
</style>
|
|
31
|
-
</head>
|
|
32
|
-
<body style="margin: 0; padding: 0;">
|
|
33
|
-
<span class="preheader" style="display: none !important; visibility: hidden; opacity: 0; color: #F8F8F8; height: 0; width: 0; font-size: 1px;"> </span>
|
|
34
|
-
<!--[if !mso]><!-->
|
|
35
|
-
<div style="font-size:0px;color:transparent;opacity:0;">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀</div>
|
|
36
|
-
<!--<![endif]-->
|
|
37
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size: 1px; line-height: normal;">
|
|
38
|
-
<tr em="group">
|
|
39
|
-
<td align="center" bgcolor="#F8F8F8">
|
|
40
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
41
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
42
|
-
<![endif]-->
|
|
43
|
-
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="max-width: 660px; min-width: 660px; width: 660px;" class="em-narrow-table"></table>
|
|
44
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
45
|
-
</td></tr></table>
|
|
46
|
-
<![endif]-->
|
|
47
|
-
</td>
|
|
48
|
-
</tr>
|
|
49
|
-
</table>
|
|
50
|
-
</body>
|
|
51
|
-
</html>`;function _c(e){return{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:zE,project:e?.id,project_title:e?.title??"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:"",emailtags:[],isAmp:!1}}function VE(e,t){const r={...t,html:e.html??t.html,subject:e.subject,preheader:e.preheader,description:e.description??t.description,title:e.title??t.title,common_styles:e.common_styles||t.common_styles,utm_parameters:{...t.utm_parameters,...e.utm_parameters},isAmp:e.isAmp??t.isAmp,is_template:!1,parent_email:e.id??e.parent_email??null};return e.meta&&(r.meta=e.meta),r}var Xo=O.createIdentifier$1("documentSession.emailDocuments"),WE=O.createIdentifier$1("RevisionServiceFlag");function bc(e){return e.getOrCreateInstance(WE,()=>{let t=!1;return{isEnabled:()=>t,set:r=>{t=r}}})}function Wn(e){return bc(e).isEnabled()}var Ec=O.createIdentifier$1("EmailRightsResolver");function QE(e,t){e.inject(Ec,t)}function KE(e,t){const r=e.getInstance(Ec);return r?r(t):!0}var Sc=O.createIdentifier$1("EmailHistoryAvailabilityResolver");function YE(e){return e.getInstance(Sc)!==void 0}async function Pc(e){const t=e.getInstance(Sc);if(!t)return!0;try{return await t()}catch{return!1}}var XE=()=>Wo();function JE(e,t){let r;return Promise.race([e,new Promise(n=>{r=setTimeout(()=>{n()},t)})]).finally(()=>{r!==void 0&&clearTimeout(r)})}function ZE(e){return t=>JE(e.getOrCreateInstance(O.events.BEFORE_SAVE_EMAIL,()=>new O.AsyncEmitter).fire(t),XE())}function eS(e){return e!=null&&e!==""}var Jo;function wc(e,t){return Jo?.capture(e,t)}function tS(e,t){return Jo?.captureMessage(e,t)}function rS(e){Jo?.identify(e)}function nS(e=""){let t=e;return{read:()=>t,write:r=>{t=r},dispose:()=>{t=""}}}function Qn(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var Ue=class{oldPosition;oldText;newPosition;newText;get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,r,n){this.oldPosition=e,this.oldText=t,this.newPosition=r,this.newText=n}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Qn(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Qn(this.oldText)}")`:`(replace@${this.oldPosition} "${Qn(this.oldText)}" with "${Qn(this.newText)}")`}};function Ic(e,t){return e===null||e.length===0?t:new iS(e,t).compress()}var iS=class ht{_prevEdits;_currEdits;_result;_resultLen;_prevLen;_prevDeltaOffset;_currLen;_currDeltaOffset;constructor(t,r){this._prevEdits=t,this._currEdits=r,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,r=0,n=this._getPrev(t),i=this._getCurr(r);for(;t<this._prevLen||r<this._currLen;){if(n===null){if(i===null)break;this._acceptCurr(i),i=this._getCurr(++r);continue}if(i===null){this._acceptPrev(n),n=this._getPrev(++t);continue}if(i.oldEnd<=n.newPosition){this._acceptCurr(i),i=this._getCurr(++r);continue}if(n.newEnd<=i.oldPosition){this._acceptPrev(n),n=this._getPrev(++t);continue}if(i.oldPosition<n.newPosition){const[l,u]=ht._splitCurr(i,n.newPosition-i.oldPosition);this._acceptCurr(l),i=u;continue}if(n.newPosition<i.oldPosition){const[l,u]=ht._splitPrev(n,i.oldPosition-n.newPosition);this._acceptPrev(l),n=u;continue}let a,s;if(i.oldEnd===n.newEnd)a=n,s=i,n=this._getPrev(++t),i=this._getCurr(++r);else if(i.oldEnd<n.newEnd){const[l,u]=ht._splitPrev(n,i.oldLength);a=l,s=i,n=u,i=this._getCurr(++r)}else{const[l,u]=ht._splitCurr(i,n.newLength);a=n,s=l,n=this._getPrev(++t),i=u}this._result[this._resultLen++]=new Ue(a.oldPosition,a.oldText,s.newPosition,s.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=s.newLength-s.oldLength}const o=ht._merge(this._result);return ht._removeNoOps(o)}_acceptCurr(t){this._result[this._resultLen++]=ht._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(t){return t<this._currLen?this._currEdits[t]:null}_acceptPrev(t){this._result[this._resultLen++]=ht._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(t){return t<this._prevLen?this._prevEdits[t]:null}static _rebaseCurr(t,r){return new Ue(r.oldPosition-t,r.oldText,r.newPosition,r.newText)}static _rebasePrev(t,r){return new Ue(r.oldPosition,r.oldText,r.newPosition+t,r.newText)}static _splitPrev(t,r){const n=t.newText.substr(0,r),i=t.newText.substr(r);return[new Ue(t.oldPosition,t.oldText,t.newPosition,n),new Ue(t.oldEnd,"",t.newPosition+r,i)]}static _splitCurr(t,r){const n=t.oldText.substr(0,r),i=t.oldText.substr(r);return[new Ue(t.oldPosition,n,t.newPosition,t.newText),new Ue(t.oldPosition+r,i,t.newEnd,"")]}static _merge(t){if(t.length===0)return t;const r=[];let n=0,i=t[0];for(let o=1;o<t.length;o++){const a=t[o];i.oldEnd===a.oldPosition?i=new Ue(i.oldPosition,i.oldText+a.oldText,i.newPosition,i.newText+a.newText):(r[n++]=i,i=a)}return r[n++]=i,r}static _removeNoOps(t){if(t.length===0)return t;const r=[];let n=0;for(let i=0;i<t.length;i++){const o=t[i];o.oldText!==o.newText&&(r[n++]=o)}return r}};function oS(e){return new Ue(e.newPosition,e.newText,e.oldPosition,e.oldText)}function aS(e){return e.map(oS)}function Cc(e,t){return t.every(r=>e.slice(r.oldPosition,r.oldEnd)===r.oldText)}function sS(e,t){let r=e;for(let n=t.length-1;n>=0;n-=1){const i=t[n];r=r.slice(0,i.oldPosition)+i.newText+r.slice(i.oldEnd)}return r}var Zo=class extends Error{reason;constructor(e){super("Открытие документа не удалось"),this.reason=e,this.name="DocumentOpenFailedError"}},Oc=0,uS=Math.random().toString(36).slice(2,8);function lS(){return Oc+=1,`doc-${uS}-${Oc}`}function cS(e){const t=e.createBuffer(),r=e.docId??lS();let n=e.serverId??null,i=0,o=null,a=e.attributes??{};const s=new Set;let l=!1,u=!1,c;const d=new Set;let f=null;const m=()=>(f?.version!==i&&(f={version:i,value:t.read()}),f.value),g=h=>Object.entries(h).some(([b,P])=>a[b]!==P);return{get:()=>({docId:r,serverId:n,version:i,savedVersion:o,attributes:a}),getContent:m,mutate(h,{source:b}){if(l)return i;const P=h.changes?.length?h.changes:void 0,E=P?sS(m(),P):h.content!==void 0?h.content:void 0,S=E!==void 0&&E!==m(),_=h.attributes!==void 0&&g(h.attributes);if(!S&&!_)return i;const w=!(i>(o??-1)),v=_?Object.keys(h.attributes).filter(y=>a[y]!==h.attributes[y]):[];S&&t.write(E),_&&(a={...a,...h.attributes}),i+=1,b!=="user"&&w&&(o=i);const I={source:b,version:i,changes:P,...S?{content:!0}:{},...v.length>0?{attributes:v}:{}};return s.forEach(y=>y(I)),i},markSaved(h,b){const P={serverId:n,savedVersion:o};b!==void 0&&(n=b),(o===null||h>o)&&(o=h),(P.serverId!==n||P.savedVersion!==o)&&s.forEach(E=>E({source:"system",version:i}))},markUnsaved(){l||o===null||o<i||(o=i-1,s.forEach(h=>h({source:"system",version:i})))},markReady(){u||c!==void 0||(u=!0,d.forEach(h=>h.resolve()),d.clear(),s.forEach(h=>h({source:"system",version:i})))},isReady:()=>u,markFailed(h){u||c!==void 0||l||(c=h,d.forEach(b=>b.reject(new Zo(h))),d.clear(),s.forEach(b=>b({source:"system",version:i})))},failure:()=>c,whenReady(){return u?Promise.resolve():c!==void 0?Promise.reject(new Zo(c)):l?Promise.reject(new Error("Документ закрыт до того, как наполнение закончилось")):new Promise((h,b)=>{d.add({resolve:h,reject:b})})},subscribe(h){return s.add(h),()=>s.delete(h)},isNew:()=>n===null,isDirty:()=>i>(o??-1),isDisposed:()=>l,dispose(){l=!0,d.forEach(h=>h.reject(new Error("Документ закрыт до того, как наполнение закончилось"))),d.clear(),s.clear(),t.dispose()}}}var dS=500,fS=100,ea=0;function pS(e,t={}){const r=t.groupIntervalMs??dS,n=t.maxSteps??fS,i=t.now??(()=>0);let o=[],a=0,s=ea+=1,l=null,u=!1,c=!1,d=!1;const f=new Set,m=()=>f.forEach(v=>v()),g=(v,I)=>{if(v.length){c=!0;try{e.mutate({changes:v},{source:I})}finally{c=!1}}},h=v=>g(v,"user"),b=v=>{const I=i();u&&l!==null&&I-l<r?o[a-1]=Ic(o[a-1],v):(o=o.slice(0,a),o.push(v),a=o.length,u=!0,o.length>n&&(o=o.slice(o.length-n),a=o.length,s=ea+=1)),l=I,m()},P=()=>{u=!1,l=null},E=v=>{if(!v.length)return;const I=o.length>a;I&&(o=o.slice(0,a)),a>0&&(o[a-1]=Ic(o[a-1],v)),P(),I&&m()},S=e.subscribe(({source:v,changes:I})=>{if(!(d||c||!I?.length)){if(v==="remote"){_();return}if(v!=="user"){E(I);return}b(I)}}),_=()=>{o=[],a=0,P(),s=ea+=1,m()},w=()=>{if(a===0)return!1;const v=aS(o[a-1]);return Cc(e.getContent(),v)?(h(v),a-=1,P(),!0):(o=o.slice(0,a-1),a=o.length,P(),m(),!1)};return{canUndo:()=>a>0,canRedo:()=>a<o.length,undo(){w()&&m()},redo(){if(!(a>=o.length)){if(!Cc(e.getContent(),o[a])){o=o.slice(0,a),P(),m();return}h(o[a]),a+=1,P(),m()}},clear:_,applyWithoutHistory(v){const I=e.get().version;if(g(v,"system"),e.get().version===I){P();return}E(v)},getPast:v=>o.slice(0,a).reverse().slice(0,v),getFuture:v=>o.slice(a).reverse().slice(0,v),createSnapshot:()=>({stackId:s,index:a}),restoreSnapshot(v){if(v.stackId!==s||v.index>a)return!1;for(;a>v.index;)if(!w())return m(),!1;return m(),!0},subscribe(v){return f.add(v),()=>f.delete(v)},dispose(){d=!0,S(),f.clear(),o=[],a=0}}}var ta=class extends Error{reason;constructor(e){super(`[emailmaker] save refused: ${e}`),this.name="SaveRefusedError",this.reason=e}};function hS(e){return e instanceof ta?e.reason:void 0}var Tc="draft";function kr(e){return e==null||e===""?Tc:String(e)}function mS(e){return e==null||e===""?`${ra}${Tc}`:`${ra}${String(e)}`}var ra="block:";function st(e){return e?.startsWith(ra)===!0}function gS(e,t){}function yS(e,t,r){const n=typeof performance<"u"?performance.now():Date.now();return qe(`show:gate:${e}`,{kind:"wait"}),t.then(i=>(qe(`show:gate:${e}:end`,{kind:"wait"}),i),i=>{const o=Math.round((typeof performance<"u"?performance.now():Date.now())-n);throw O.isAbortError(i)?(`${e}`,{...r}):(`${e}`,{error:Km(i),...r},void 0),i})}var na=e=>e.replace(/\r\n?/g,`
|
|
52
|
-
`),Ac=["recovery","plugin","rest"],vS=["subject","preheader"];function _S(e){let t={},r;for(let i=Ac.length-1;i>=0;i--){const o=e.get(Ac[i]);o&&(o.attributes&&(t={...t,...o.attributes}),o.content!==void 0&&(r=o.content))}const n=e.get("plugin")?.attributes;for(const i of vS){const o=n?.[i];typeof o=="string"&&o!==""&&(t={...t,[i]:o})}return r!==void 0?{content:r,attributes:t}:{attributes:t}}function Kn(e,t){if(!e||!t)return;const r=e.getContent(),n=t.content!==void 0?na(t.content):void 0,i=n!==void 0&&n!==r;e.get().docId,Object.keys(t.attributes??{}),e.mutate({attributes:t.attributes??{},...i?{changes:[new Ue(0,r,0,n)]}:{}},{source:"remote"})}var ia=e=>typeof e=="string"?e.trim():"";function bS(e,t,r){const{version:n,attributes:i}=e.get(),o=i,a=ia(o.title)||ia(o.subject)||ia(t.fallbackTitle);return{version:n,payload:{html:e.getContent(),title:a,subject:o.subject,preheader:o.preheader,description:o.description,common_styles:o.common_styles||"",meta:o.meta,utm_parameters:o.utm_parameters,parent_email:o.parent_email,is_template:o.is_template||!1,is_inited:o.is_inited,tags:o.tags,emailtags:o.emailtags,group:o.group,renderGuid:e.get().docId,project:t.project??o.project,folder:t.folder,...r?.emailtags?{emailtags:r.emailtags}:{},...r?.group?{group:r.group}:{},source:t.source}}}async function ES(e,t,r,n,i){if(r==="materialize"&&n!=null)throw new Error("Письмо уже создано на сервере");if(r==="materialize"||r==="publish"&&n==null)return e.createEmail(i);if(n==null)throw new Error("Письмо ещё не создано на сервере");return r==="publish"?e.updateEmail(n,i):t.saveAutosave(n,i)}function ut(e,t=!1){const r={};for(const n of Object.keys(e)){let i=e[n];i!==void 0&&!(typeof i=="number"&&Number.isNaN(i))&&(t&&typeof i=="object"&&i!==null&&(i=ut(i)),r[n]=i)}return r}function de(e){return typeof e=="object"&&e}function ge(e){const t=Number(e);return isNaN(t)?e:t}function ue(e){return typeof e=="number"?String(e):e}function He(e){return typeof e=="object"?e.rendered:e}function Mc(e){return typeof e=="string"&&e.includes("autosave")}var SS=new Set(["html","id","renderGuid","showToken","showId","isNew"]);function Nc(e){return e?Object.fromEntries(Object.entries(e).filter(([t])=>!SS.has(t))):{}}function Rc(e,t,r={}){e&&e.mutate({attributes:PS(e.get().attributes,t)},{source:r.source??"user"})}function PS(e,t){return t.subject===void 0||t.title!==void 0?t:(e.title??"")===(e.subject??"")?{...t,title:t.subject}:t}function oa(e,t){return e===void 0&&Object.keys(t).length===0?null:{...e!==void 0?{content:e}:{},attributes:t}}function wS(e){return typeof e=="string"&&e.startsWith("{")?e:"{}"}function Dc(e){if(!e)return null;const t=Nc(e);return e.common_styles!==void 0&&(t.common_styles=wS(e.common_styles)),oa(e.html,t)}function jc(e){return e?oa(e.html,ut(Nc(e))):null}var IS=["common_styles","subject","preheader","meta"];function aa(e){if(!e?.html?.trim())return null;const t={};for(const r of IS)CS(r,e[r])&&(t[r]=e[r]);return oa(e.html,t)}function CS(e,t){return e==="common_styles"?typeof t=="string"&&t.startsWith("{"):e==="meta"?typeof t=="object"&&t!==null&&!Array.isArray(t):typeof t=="string"}var OS=["modified","lock"];function TS(e){if(!e)return null;const t={};for(const r of OS)e[r]!==void 0&&(t[r]=e[r]);return Object.keys(t).length===0?null:{attributes:t}}var AS=10,MS=(e,t)=>e.key===t.key&&NS(e.serverId,t.serverId),NS=(e,t)=>e==null||e===t;function RS(e){return typeof e?.then=="function"}var Fc=e=>{e.timer!==void 0&&(clearTimeout(e.timer),e.timer=void 0)},Lc=e=>{e.request.serverId!=null&&!sa(e)&&e.document.markSaved(e.document.get().version)},sa=e=>e.document.get().savedVersion!==null&&e.document.isDirty(),kc=(e,t)=>t?.content!==void 0&&$E({hasUnsavedUserEdit:sa(e)})==="skip",DS=e=>e.document.subscribe(t=>{t.source==="user"&&(t.content&&e.userTouched.add("content"),t.attributes?.forEach(r=>e.userTouched.add(r))),e.document.isDirty()||e.userTouched.clear()}),jS=(e,t)=>{!e.ready||t.content===void 0||e.document.get().serverId==null||(e.contentShown=!0,!(![...e.userTouched].every(r=>r==="content"||r in(t.attributes??{}))||!e.document.isDirty())&&(e.document.markSaved(e.document.get().version),e.userTouched.clear(),e.document.get().docId))},FS=(e,t)=>{if(!e)return t;const r=Object.fromEntries(Object.entries(t.attributes).filter(([i,o])=>e.attributes[i]!==o)),n=t.content!==void 0&&t.content!==e.content?t.content:void 0;return n===void 0&&Object.keys(r).length===0?null:n===void 0?{attributes:r}:{content:n,attributes:r}},LS=e=>{const t=_S(e.reports),r=FS(e.lastMerged,t);e.lastMerged=t,r&&(Kn(e.document,r),Lc(e))},ua=(e,t)=>{if(!e.ready&&!sa(e)){LS(e);return}Kn(e.document,t)},kS=e=>{const{attributes:t,serverId:r,docId:n}=e.document.get();return{...t,html:e.document.getContent(),id:r??void 0,isNew:r==null,renderGuid:n}};function US(e){const{resolveAdapters:t,timeoutMs:r,resolveWritePort:n,resolveHistoryPort:i,resolveTerms:o,canEdit:a,notifyBeforeSave:s,onAdapterError:l,onTimeout:u}=e;let c;const d=new Set,f=new Set,m=()=>d.forEach(y=>y()),g=(y,T)=>{if(!(y.closed||y.ready)){if(y.error!==void 0){y.document.markFailed(y.error),y.document.get().docId;return}Lc(y),y.ready=!0,y.document.markReady(),y.document.get().docId,[...y.reports.keys()]}},h=(y,T,A)=>{l?.(T.id,A),!(!T.required||y.closed)&&(y.error=A,y.document.get().docId,T.id,m())},b=(y,T)=>{const A=new Set(T.map(M=>M.id));T.forEach(M=>{M.watch&&y.watchers.push(M.watch(F=>y.closed?!1:y.ready&&(kc(y,F)||y.contentShown===!0&&F?.content!==void 0)?(y.document.get().docId,M.id,!1):(F&&y.reports.set(M.id,F),ua(y,F),!0)))});const C=(M,F)=>{if(!y.closed){if(!M.required&&kc(y,F)){y.document.get().docId,M.id,M.loaded?.(!1);return}F&&y.reports.set(M.id,F),ua(y,F),M.loaded?.(F!==null)}},N=()=>{A.size>0||y.closed||(Fc(y),g(y,[]))},j=[];if(T.forEach(M=>{let F;try{F=M.load()}catch(D){h(y,M,D),A.delete(M.id);return}if(RS(F)){j.push({id:M.id,required:M.required,load:()=>F,...M.loaded?{loaded:D=>M.loaded?.(D)}:{}});return}C(M,F),A.delete(M.id)}),j.length===0){N();return}y.timer=setTimeout(()=>{y.timer=void 0,u?.([...A]),y.document.get().docId,[...A],g(y,[...A])},r),y.timer.unref?.(),j.forEach(M=>{M.load().then(F=>C(M,F)).catch(F=>{h(y,M,F)}).finally(()=>{A.delete(M.id),N()})})},P=async(y,T,A)=>{if(A==="snapshot"||A==="anchor")return;const C=o?.();if(C)return C.resolve({project:T.project??y.project,tags:(y.tags??[]).map(N=>({name:N}))})},E=y=>{if(y.lock===!0&&a?.(y)===!1)return new ta("locked");const T=y.tags?.length??0,A=y.emailtags?.length??0;if(Math.max(T,A)>AS)return new ta("too-many-tags")},S=async(y,T,A)=>{try{await y.document.whenReady()}catch(F){return y.saveError=F,y.saveFailures+=1,y.saveFailures,!1}if(y.closed)return!1;const C=E(y.document.get().attributes);if(C)return y.saveError=C,y.saveFailures+=1,C.reason,m(),!1;if(s&&(await s(kS(y)).catch(()=>{}),y.closed))return!1;let N;try{N=await P(y.document.get().attributes,A,T)}catch(F){return y.saveError=F,y.saveFailures+=1,y.saveFailures,m(),!1}if(y.closed)return!1;const{payload:j,version:M}=bS(y.document,A,N);y.document.get().docId;try{const F=y.document.get().serverId!=null,D=await ES(n(),i(y.request.key),T,y.document.get().serverId,j);if(y.closed)return!0;let k;if(T==="snapshot"||T==="anchor"){const G=D?.modified!=null?Date.parse(D.modified):NaN;k=Number.isFinite(G)?G:Date.now(),y.snapshotVersion=M,y.lastRevisionAt=k}else y.document.markSaved(M,D?.id!=null?String(D.id):void 0);const L=y.document.get().serverId;!F&&L!=null&&(y.recoveryFacts={emailId:L,historyLoaded:!0,isRecovering:!1},st(y.request.key)||(y.request={...y.request,key:kr(L),serverId:L})),y.saveError=void 0,y.saveFailures=0,y.document.get().serverId,m();const U={intent:T,serverId:y.document.get().serverId,created:!F,...k!==void 0?{revisionAt:k}:{}};return f.forEach(G=>G(U)),!0}catch(F){return y.saveError=F,y.saveFailures+=1,y.saveFailures,m(),!1}},_=()=>{c&&(c.closed=!0,c.watchers.forEach(y=>y()),c.watchers=[],Fc(c),c.history.dispose(),c.document.dispose(),c=void 0)},w=(y,T,A)=>{let C=!1;T.show&&(y.show?.id!==T.show.id||y.show.token!==T.show.token)&&(y.show=T.show,C=!0,{docId:y.document.get().docId,...T.show});const N=A==="show"?jc(T.patch):null;N&&(y.reports.set("plugin",N),ua(y,N),jS(y,N)),C&&m()},v=(y,T={})=>{const A=c;return!A||A.closed||y==="materialize"&&A.document.get().serverId!=null?Promise.resolve(!1):A.saving?y==="snapshot"||y==="materialize"?Promise.resolve(!1):(A.inFlight??Promise.resolve(!1)).then(()=>v(y,T)):(A.saving=!0,m(),A.inFlight=S(A,y,T).finally(()=>{A.saving=!1,A.inFlight=void 0,c===A&&!A.closed&&m()}),A.inFlight)},I=(y,T="open")=>{if(c&&!c.closed&&T!=="new"&&MS(c.request,y))return w(c,y,T),c.document;_();const A=cS({createBuffer:()=>nS(""),serverId:y.serverId??null}),C={request:y,show:y.show,document:A,history:pS(A,{now:Date.now}),watchers:[],userTouched:new Set,saveFailures:0,saving:!1,reports:new Map,ready:!1,closed:!1};return c=C,C.watchers.push(DS(C)),A.get().docId,y.serverId,b(C,t(y,{publishRecoveryFacts(N){C.closed||(C.recoveryFacts=N,m())},readShownContent:()=>C.closed?null:C.document.getContent()})),m(),A};return{openWith:I,open:(y,T={})=>I({key:kr(y),serverId:y,email:T.email,patch:T.patch,show:T.show},"open"),openDraft:(y,T={})=>I({key:kr(void 0),serverId:null,email:y,patch:T.patch,show:T.show},"open"),startNewDraft:(y,T={})=>I({key:kr(void 0),serverId:null,email:y,patch:T.patch,show:T.show},"new"),reload:(y,T={})=>I({key:kr(y),serverId:y,email:T.email,patch:T.patch,show:T.show},"new"),openBlock:(y,T)=>I({key:st(y)?y:mS(y),serverId:T?.id!=null?String(T.id):null,email:T},"open"),show:(y,T)=>{const A=c;if(!(!A||A.closed))return I({...A.request,patch:y,show:T},"show")},current:()=>c?.document,noteServerFacts:({serverId:y,block:T},A)=>{const C=c;!C||C.closed||C.request.serverId!==y||st(C.request.key??"")===T&&Kn(C.document,TS(A))},save:v,saveState:()=>({error:c?.saveError,failures:c?.saveFailures??0,saving:c?.saving===!0}),revisionFacts(){if(!c)return;const y=c.revisionFactsSnapshot;return y&&y.snapshotVersion===c.snapshotVersion&&y.lastRevisionAt===c.lastRevisionAt?y:(c.revisionFactsSnapshot={snapshotVersion:c.snapshotVersion,lastRevisionAt:c.lastRevisionAt},c.revisionFactsSnapshot)},recoveryFacts:()=>c?.recoveryFacts,history:()=>c?.history,forcedHeaders:()=>c?.forcedHeaders,beginForcedHeaders(y){c&&!c.closed&&(c.forcedHeaders=y)},endForcedHeaders(){c&&(c.forcedHeaders=void 0)},onSaved(y){return f.add(y),()=>f.delete(y)},showFacts:()=>c?.show,sessionKey:()=>c?.request.key,openError:()=>c?.error,subscribe(y){return d.add(y),()=>d.delete(y)},close(){c&&(_(),m())}}}var Yn=class extends Error{reason;constructor(e,t){super(`письмо не открылось: ${e}`),this.name="EmailOpenFailedError",this.reason=e,this.cause=t}};function BS(e){return e===404||e===410?"not-found":e===401||e===403?"forbidden":"unavailable"}function Uc(e){if(e instanceof Yn)return e.reason;if(e instanceof Zo)return Uc(e.reason)}function $S(e){return new Yn(BS(e.status),e.error??e)}function xS(e,t){return{id:"rest",required:!0,load:async()=>{const r=await e.readEmail(t);if(!r)throw new Yn("not-found");return Dc(r)}}}var Xn=O.createIdentifier$1("documentSession.restEmailPortFactories");function qS(e,t){e.inject(Xn,t)}function Bc(e){return e.getInstance(Xn)!==void 0}function Lt(e){const t=e.getInstance(Xn);if(!t)throw new Error("[documentSession] порты поверх REST ещё не загружены — работа с сервером начинается с init()");return t}var $c=O.createIdentifier$1("EmailTermsResolver");function GS(e){return e.getInstance($c)}function HS(e,t){e.inject($c,t)}var zS="em_autosave_pending",JD=6e4;function Jn(e){return`${zS}_${e}`}function la(e,t){try{sessionStorage.setItem(Jn(e),JSON.stringify(t))}catch{}}function VS(e){try{const t=sessionStorage.getItem(Jn(e));if(!t)return null;const r=JSON.parse(t);return Date.now()-r.sentAt>6e4?(sessionStorage.removeItem(Jn(e)),null):r}catch{return null}}function Zn(e){try{sessionStorage.removeItem(Jn(e))}catch{}}var WS=2e3,QS=5e3,KS=5,YS=5e3,XS=4;function JS(){return typeof performance<"u"&&typeof performance.timeOrigin=="number"?performance.timeOrigin:Date.now()}function ZS(e,t){return e==null||t==null?!1:e.replaceAll(`\r
|
|
53
|
-
`,`
|
|
54
|
-
`)===t.replaceAll(`\r
|
|
55
|
-
`,`
|
|
56
|
-
`)}function ca(e,t){return Qo(e.autosave,t===void 0?{}:{freshSince:t})?e.autosave:null}function eP({emailId:e,readAutosave:t,revisionServiceEnabled:r,isHistoryAvailable:n,readShownContent:i,onFacts:o,onLate:a,onError:s,pageLoadTs:l=JS()}){let u=null,c=!1,d=!1,f=0,m={emailId:e,historyLoaded:!1,isRecovering:!1},g=null;const h=new Promise(M=>{g=M}),b=M=>{m={...m,...M},o(m)};let P;const E=M=>{f+=1,b({applied:{phase:M,seq:f}})},S=()=>{u?.timer&&clearTimeout(u.timer),u=null},_=M=>{if(!d){if(g){const F=g;g=null,F(M),P=M.revision?M.phase:void 0;return}a(M)&&M.revision&&E(M.phase)}},w=()=>{if(!u||d)return;const M=u.phase==="fast",F=M?WS:YS,D=M?KS:XS;u.timer=setTimeout(()=>{const k=u;if(!(!k||d)){if(k.attempts+=1,T(),M&&k.attempts>=D){const{pending:L}=k;Zn(e),b({isRecovering:!1}),_({revision:{html:L.html,common_styles:L.common_styles,subject:L.subject,preheader:L.preheader},phase:"timeout"}),c=!0,k.phase="bg",k.attempts=0,w();return}if(!M&&k.attempts>=D){Zn(e),S(),b({isRecovering:!1}),c=!0;return}w()}},F),u.timer.unref?.()},v=M=>{u={phase:"fast",attempts:0,pending:M,timer:null},b({isRecovering:!0}),w()},I=M=>{if(d)return;if(b({historyLoaded:!0,latestRevisionAt:M.latestAt!==void 0&&Number.isFinite(M.latestAt)?M.latestAt:void 0}),r&&u){const k=ca(M,u.pending.sentAt);if(!k)return;const L=u.phase==="fast"?"found":"bg";Zn(e),S(),b({isRecovering:!1}),c=!0,_({revision:k,phase:L});return}if(c)return;const F=r?VS(e):null,D=F&&(F.sentAt<l||!ZS(F.html,i()))?F:null;if(D){const k=ca(M,D.sentAt);if(k){Zn(e),c=!0,_({revision:k,phase:"found"});return}v(D);return}c=!0,_({revision:ca(M),phase:"normal"})},y=M=>{d||(s?.(M),m.historyLoaded||(b({historyLoaded:!1,latestRevisionAt:void 0}),N()),!u&&_({revision:null,phase:"normal"}))},T=()=>t(e).then(I).catch(y);let A,C=!1;const N=()=>{C||u||d||(C=!0,A=setTimeout(()=>{A=void 0,!d&&!m.historyLoaded&&T()},QS))},j=()=>{d||(b({historyLoaded:!1,latestRevisionAt:void 0}),_({revision:null,phase:"normal"}))};return n?n().then(M=>M?T():j()):T(),{verdict:()=>h,confirmVerdict(M){const F=P;P=void 0,M&&F!==void 0&&!d&&E(F)},dispose(){d=!0,A!==void 0&&(clearTimeout(A),A=void 0),S()}}}function tP({port:e,revisionServiceEnabled:t,isHistoryAvailable:r,emailId:n,readShownContent:i,onFacts:o}){let a=null;const s=eP({emailId:n,readAutosave:l=>e.readAutosave(l),revisionServiceEnabled:t,...r?{isHistoryAvailable:r}:{},readShownContent:i,onFacts:o,onLate:({revision:l,phase:u})=>{const c=aa(l);return a?.(c)??!1},onError:l=>{l instanceof Error&&l.message}});return{id:"recovery",load:()=>s.verdict().then(({revision:l})=>aa(l)),loaded(l){s.confirmVerdict(l)},watch(l){return a=l,()=>{a=null,s.dispose()}}}}function xc(e,t){return{readRevisions:(r,n)=>t.readRevisions(r,n),readAutosave:r=>t.readAutosave(r),async saveAutosave(r,n){la(r,{sentAt:Date.now(),html:n.html??"",common_styles:n.common_styles??"",subject:n.subject,preheader:n.preheader});const i=await t.saveAutosave(r,n);return await e.saveAutosave(r,n),i}}}function rP(e,t){return{readEmail:r=>e.readEmail(r),createEmail:r=>e.createEmail(r),async updateEmail(r,n){const i=await t.updateEmail(r,n);return await e.updateEmail(r,n),i}}}var da=O.createIdentifier$1("CurrentUser"),qc={};function fa(e){return e.getOrCreateInstance(da,()=>Ve(qc))}function ei(e){return e?.getInstance(da)?.get()??qc}async function nP(e){const t=e?.getInstance(da),r=t?.get().promise;if(!(!t||r===void 0))return t.set({...t.get(),promise:void 0}),r}var iP=1.5;function oP(e){return!e.isEnabled||e.isUserBusy||!e.isReady||!e.isInited?"none":e.isNew?"create":!e.isDirty||e.isSnapshotSent||!e.isHistoryLoaded||e.latestRevisionAgeMs!==void 0&&e.latestRevisionAgeMs<=iP*e.autosaveTimeoutMs?"none":"revision"}var aP=4;function sP(e){const{readDocument:t,readEnvironment:r,onCreate:n,onRevision:i}=e,o=e.readFailures??(()=>0),a=()=>r().autosaveTimeoutMs*2**Math.min(o(),aP),s=()=>{const P=t();if(!P||P.isDisposed())return"none";const{latestRevisionAt:E,snapshotVersion:S,..._}=r();return oP({..._,isDirty:P.isDirty(),isNew:P.isNew(),isReady:P.isReady(),latestRevisionAgeMs:E!=null?Date.now()-E:void 0,isSnapshotSent:S!=null&&S===P.get().version})},l=()=>{const P=t();if(!P||P.isDisposed())return!1;if(!P.isDirty())return P.isNew();const{snapshotVersion:E}=r();return!(E!=null&&E===P.get().version)};let u,c,d,f,m=!1;const g=()=>{c=void 0;const P=t();if(!P||P.isDisposed())return;if(P.get().docId!==u){h();return}const E=s();E==="create"?n():E==="revision"?i():l()&&(u=P.get().docId,c=setTimeout(g,a()))},h=()=>{const P=t();m||!P||c!==void 0||s()==="none"&&!l()||(u=P.get().docId,c=setTimeout(g,a()))},b=()=>{const P=t();P!==d&&(f?.(),d=P,f=P?.subscribe(h),c!==void 0&&(clearTimeout(c),c=void 0))};return b(),h(),{refresh:()=>{m||(b(),h())},stop:()=>{m=!0,f?.(),f=void 0,d=void 0,c!==void 0&&(clearTimeout(c),c=void 0)}}}var Gc=O.createIdentifier$1("documentSession.autosaveUiFacts"),Hc={isUserBusy:!1,saveContext:{}};function zc(e){return e.getOrCreateInstance(Gc,()=>Ve(Hc))}function Vc(e){return e?.getInstance(Gc)?.get()??Hc}var uP=1e4;function lP(e,t){const r=()=>{const l=t.current(),u=l?.get().serverId??void 0,c=st(t.sessionKey()),d=t.recoveryFacts(),f=d?.emailId===u?d:void 0,m=t.revisionFacts(),g=f?.latestRevisionAt,h=m?.lastRevisionAt,b=ei(e).profile;return{isInited:c||l?.get().attributes.is_inited===!0,isEnabled:!!b?.autosaves,isHistoryLoaded:f?.historyLoaded===!0,isUserBusy:Vc(e).isUserBusy,autosaveTimeoutMs:Et(e).autosaveTimeout||uP,latestRevisionAt:g!==void 0||h!==void 0?Math.max(g??0,h??0):void 0,snapshotVersion:m?.snapshotVersion}},n=()=>{const l=Vc(e).saveContext;return{...l,project:l.project??t.current()?.get().attributes.project}},i=sP({readDocument:()=>t.current(),readEnvironment:r,readFailures:()=>t.saveState().failures,onCreate:()=>{st(t.sessionKey())||t.save("materialize",n())},onRevision:()=>{t.save("snapshot",{project:n().project})}}),o=t.subscribe(i.refresh),a=fa(e).watch(()=>i.refresh()),s=zc(e).watch(()=>i.refresh());return()=>{o(),a.dispose(),s.dispose(),i.stop()}}var Wc=12e3;function pa(e){return e.getOrCreateInstance(Xo,()=>{const t=US({resolveAdapters:(n,i)=>dP(n,e,i),resolveWritePort:()=>ha(e),resolveHistoryPort:n=>st(n)?ga(e):ma(e),resolveTerms:()=>GS(e),canEdit:n=>KE(e,n),notifyBeforeSave:ZE(e),timeoutMs:Wc,onAdapterError:(n,i)=>{i instanceof Error&&i.message,wc(i,{origin:"email-source-adapter",tags:{source:n}})},onTimeout:n=>{}}),r=lP(e,t);return e.getInstance(O.DISPOSABLE_ID)?.addDispose(r),t})}function Qc(e){return e?.getInstance(Xo)}function ha(e){const t=OE(e);return t?ya(e)?rP(t,Lt(e).email(e)):t:Lt(e).email(e)}function cP(e){return dc(e)!==void 0||Bc(e)}function ma(e){const t=dc(e);return t?ya(e)?(qe("port:history:server-backed"),xc(t,Lt(e).history(e))):(qe("port:history:integrator"),t):(qe("port:history:rest (порт не зарегистрирован)"),Lt(e).history(e))}function ga(e){const t=cc(e);return t?ya(e)?(qe("port:block-history:server-backed"),xc(t,Lt(e).blockHistory(e))):(qe("port:block-history:integrator"),t):(qe("port:block-history:rest (порт не зарегистрирован)"),Lt(e).blockHistory(e))}function Kc(e){return cc(e)!==void 0||Bc(e)}function ya(e){return Wn(e)}function dP({email:e,patch:t,serverId:r,key:n},i,o){const a=[];e?a.push({id:"rest",load:()=>Dc(e),required:!0}):r&&a.push(xS(ha(i),r)),t&&a.push({id:"plugin",load:()=>jc(t)});const s=st(n);return eS(r)&&(s?Kc(i):cP(i))&&a.push(tP({port:s?ga(i):ma(i),revisionServiceEnabled:Wn(i),...!s&&YE(i)?{isHistoryAvailable:()=>Pc(i)}:{},emailId:r,readShownContent:()=>o.readShownContent(),onFacts:l=>o.publishRecoveryFacts(l)})),a}var Ur=O.createIdentifier$1("CurrentProject"),ti={};function Jt(e){return e.getOrCreateInstance(Ur,()=>Ve(ti))}function fP(e,t){const r=Jt(e),n=r.get()??ti;!!n.refreshing!==t&&r.set({...n,refreshing:t})}function pP(e,t){const r=Jt(e),n=r.get()??ti;n.card!==t&&r.set({...n,...t?{card:t}:{}})}async function hP(e,t){const r=e?.getInstance(Ur),n=r?.get()?.pending;if(!(!r||n?.id!==t))return r.set({...r.get(),pending:void 0}),n.promise}async function mP(e,t){const r=e?.getInstance(Ur),n=r?.get()?.planPending;if(!(!r||n?.id!==t))return r.set({...r.get(),planPending:void 0}),n.promise}function Br(e){return e?.getInstance(Ur)?.get()??ti}function gP(e){const t=Br(e).card?.id,r=Number(t);return t!=null&&t!==""&&Number.isFinite(r)?r:void 0}function Yc(e){return{emails:gc(e),blocks:tc(e),emailRevisions:yc(e),blocksRevision:rc(e),comments:nc(e)}}function va(e){return Qc(e)?.current()}function yP(e){return va(e)?.getContent()}function vP(e,t){const r=t??_c(),n=va(e)?.get();return n?{...r,...n.attributes,id:n.serverId??void 0,isNew:n.serverId===null,html:yP(e)??r.html}:r}async function Xc(e){return(await e.getInstanceAsync(O.APP_ID))?.project}async function _P(e){return gP(e)??await Xc(e)}var Jc=new WeakMap,bP=32;function EP(e){return{...e}}function SP(e){let t=Jc.get(e);return t||(t={byId:new Map,fallback:[]},Jc.set(e,t)),t}function PP(e,t){const{byId:r,fallback:n}=SP(t),i=EP(e);i.id!=null&&i.id!==""&&r.set(String(i.id),i),n.push(i),n.length>bP&&n.shift()}function wP(e){if(!e)return{};const t={};for(const r of Object.keys(e))Ho.has(r)&&Kl(r,e[r])&&(t[r]=e[r]);return t}function Zc(e){const t={},r=e;for(const n of Ho){if(!(n in r))continue;const i=r[n];if(Kl(n,i)){if(n==="project"){const o=Number(i);t.project=Number.isNaN(o)?i:o;continue}if(n==="author"){t.author=String(i);continue}if(n==="status"||n==="comment_status"||n==="ping_status"){t[n]=i;continue}t[n]=i}}return Object.assign(t,wP(e.catalogExtra)),t}function IP(e,t){const{meta:r,...n}=t;let i={...e,...n};return r!==void 0&&(i=hc(i,r)),i}async function CP(e,t,r){if(!e)return;const n=r.id!=null&&r.id!==""?String(r.id):void 0;if(!n)return;const i=Zc(t),o=Zc(r);if(O.deepEqual(i,o))return;const{blocks:a}=Yc(e);await a.cache.addOrUpdate(n,s=>s&&IP(s,o))}var OP=()=>{};function $r(){const e=Ke(),t=(0,R.useCallback)(n=>{if(!e)return OP;const i=Jt(e).watch(n);return()=>i.dispose()},[e]),r=(0,R.useCallback)(()=>Br(e).card,[e]);return(0,R.useSyncExternalStore)(t,r,r)}function ed(e,t,r=!0){const n=e,i=t;for(const o of Object.keys(i)){const a=i[o];a!=null&&(r&&typeof a=="object"?n[o]=ed(n[o]||{},a,!0):n[o]=a)}return e}async function TP(e){const t=(await(0,gt.__vitePreload)(()=>Promise.resolve().then(()=>q.__toESM(ye("./15ea858c.js").default)),void 0,{}.url)).default;return new Promise((r,n)=>{t.load({google:{families:[e]},classes:!1,active:()=>r(),inactive:()=>n(new Error(`Шрифт не загрузился: ${e}`))})})}var AP=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},td=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(td||{}),lt="uninitialized",_a="pending",xr="fulfilled",qr="rejected";function rd(e){return{status:e,isUninitialized:e===lt,isLoading:e===_a,isSuccess:e===xr,isError:e===qr}}var nd=_t;function ba(e,t){if(e===t||!(nd(e)&&nd(t)||Array.isArray(e)&&Array.isArray(t)))return t;const r=Object.keys(t),n=Object.keys(e);let i=r.length===n.length;const o=Array.isArray(t)?[]:{};for(const a of r)o[a]=ba(e[a],t[a]),i&&(i=e[a]===o[a]);return i?e:o}function Ea(e,t,r){return e.reduce((n,i,o)=>(t(i,o)&&n.push(r(i,o)),n),[]).flat()}function MP(e){return new RegExp("(^|:)//").test(e)}function NP(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Sa(e){return e!=null}function id(e){return[...e?.values()??[]].filter(Sa)}function RP(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var DP=e=>e.replace(/\/$/,""),jP=e=>e.replace(/^\//,"");function FP(e,t){if(!e)return t;if(!t)return e;if(MP(t))return t;const r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=DP(e),t=jP(t),`${e}${r}${t}`}function ri(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Pa=()=>new Map,LP=e=>{const t=new AbortController;return setTimeout(()=>{const r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},kP=(...e)=>{for(const r of e)if(r.aborted)return AbortSignal.abort(r.reason);const t=new AbortController;for(const r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},od=(...e)=>fetch(...e),UP=e=>e.status>=200&&e.status<=299,BP=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ad(e){if(!_t(e))return e;const t={...e};for(const[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var $P=e=>typeof e=="object"&&(_t(e)||Array.isArray(e)||typeof e.toJSON=="function");function sd({baseUrl:e,prepareHeaders:t=d=>d,fetchFn:r=od,paramsSerializer:n,isJsonContentType:i=BP,jsonContentType:o="application/json",jsonReplacer:a,timeout:s,responseHandler:l,validateStatus:u,...c}={}){return async(f,m,g)=>{const{getState:h,extra:b,endpoint:P,forced:E,type:S}=m;let _,{url:w,headers:v=new Headers(c.headers),params:I=void 0,responseHandler:y=l??"json",validateStatus:T=u??UP,timeout:A=s,...C}=typeof f=="string"?{url:f}:f,N={...c,signal:A?kP(m.signal,LP(A)):m.signal,...C};v=new Headers(ad(v)),N.headers=await t(v,{getState:h,arg:f,extra:b,endpoint:P,forced:E,type:S,extraOptions:g})||v;const j=$P(N.body);if(N.body!=null&&!j&&typeof N.body!="string"&&N.headers.delete("content-type"),!N.headers.has("content-type")&&j&&N.headers.set("content-type",o),j&&i(N.headers)&&(N.body=JSON.stringify(N.body,a)),N.headers.has("accept")||(y==="json"?N.headers.set("accept","application/json"):y==="text"&&N.headers.set("accept","text/plain, text/html, */*")),I){const U=~w.indexOf("?")?"&":"?",G=n?n(I):new URLSearchParams(ad(I));w+=U+G}w=FP(e,w);const M=new Request(w,N);_={request:new Request(w,N)};let F;try{F=await r(M)}catch(U){return{error:{status:(U instanceof Error||typeof DOMException<"u"&&U instanceof DOMException)&&U.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(U)},meta:_}}const D=F.clone();_.response=D;let k,L="";try{let U;if(await Promise.all([d(F,y).then(G=>k=G,G=>U=G),D.text().then(G=>L=G,()=>{})]),U)throw U}catch(U){return{error:{status:"PARSING_ERROR",originalStatus:F.status,data:L,error:String(U)},meta:_}}return T(F,k)?{data:k,meta:_}:{error:{status:F.status,data:k},meta:_}};async function d(f,m){if(typeof m=="function")return m(f);if(m==="content-type"&&(m=i(f.headers)?"json":"text"),m==="json"){const g=await f.text();return g.length?JSON.parse(g):null}return f.text()}}var ud=class{constructor(e,t=void 0){this.value=e,this.meta=t}value;meta},ni="__rtkq/",ld="online",cd="offline",xP="focus",dd="focused",qP="visibilitychange",Gr=Se(`${ni}${dd}`),ii=Se(`${ni}un${dd}`),Hr=Se(`${ni}${ld}`),oi=Se(`${ni}${cd}`),GP={onFocus:Gr,onFocusLost:ii,onOnline:Hr,onOffline:oi},ai=!1;function HP(e,t){function r(){const[n,i,o,a]=[Gr,ii,Hr,oi].map(u=>()=>e(u())),s=()=>{window.document.visibilityState==="visible"?n():i()};let l=()=>{ai=!1};if(!ai&&typeof window<"u"&&window.addEventListener){let u=function(d){Object.entries(c).forEach(([f,m])=>{d?window.addEventListener(f,m,!1):window.removeEventListener(f,m)})};const c={[xP]:n,[qP]:s,[ld]:o,[cd]:a};u(!0),ai=!0,l=()=>{u(!1),ai=!1}}return l}return t?t(e,GP):r()}var zr="query",fd="mutation",pd="infinitequery";function si(e){return e.type===zr}function zP(e){return e.type===fd}function ui(e){return e.type===pd}function li(e){return si(e)||ui(e)}function wa(e,t,r,n,i,o){const a=VP(e)?e(t,r,n,i):e;return a?Ea(a,Sa,s=>o(hd(s))):[]}function VP(e){return typeof e=="function"}function hd(e){return typeof e=="string"?{type:e}:e}function WP(e,t){return e.catch(t)}var Zt=(e,t)=>e.endpointDefinitions[t],Vr=Symbol("forceQueryFn"),Ia=e=>typeof e[Vr]=="function";function QP({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:i,context:o,getInternalState:a}){const s=_=>a(_)?.runningQueries,l=_=>a(_)?.runningMutations,{unsubscribeQueryResult:u,removeMutationResult:c,updateSubscriptionOptions:d}=i.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:E,buildInitiateMutation:S,getRunningQueryThunk:f,getRunningMutationThunk:m,getRunningQueriesThunk:g,getRunningMutationsThunk:h};function f(_,w){return v=>{const I=e({queryArgs:w,endpointDefinition:Zt(o,_),endpointName:_});return s(v)?.get(I)}}function m(_,w){return v=>l(v)?.get(w)}function g(){return _=>id(s(_))}function h(){return _=>id(l(_))}function b(_,w){const v=(I,{subscribe:y=!0,forceRefetch:T,subscriptionOptions:A,[Vr]:C,...N}={})=>(j,M)=>{const F=e({queryArgs:I,endpointDefinition:w,endpointName:_});let D;const k={...N,type:zr,subscribe:y,forceRefetch:T,subscriptionOptions:A,endpointName:_,originalArgs:I,queryCacheKey:F,[Vr]:C};if(si(w))D=t(k);else{const{direction:z,initialPageParam:ae,refetchCachedPages:Q}=N;D=r({...k,direction:z,initialPageParam:ae,refetchCachedPages:Q})}const L=i.endpoints[_].select(I),U=j(D),G=L(M()),{requestId:W,abort:Z}=U,ee=G.requestId!==W,K=s(j)?.get(F),re=()=>L(M()),X=Object.assign(C?U.then(re):ee&&!K?Promise.resolve(G):Promise.all([K,U]).then(re),{arg:I,requestId:W,subscriptionOptions:A,queryCacheKey:F,abort:Z,async unwrap(){const z=await X;if(z.isError)throw z.error;return z.data},refetch:z=>j(v(I,{subscribe:!1,forceRefetch:!0,...z})),unsubscribe(){y&&j(u({queryCacheKey:F,requestId:W}))},updateSubscriptionOptions(z){X.subscriptionOptions=z,j(d({endpointName:_,requestId:W,queryCacheKey:F,options:z}))}});if(!K&&!ee&&!C){const z=s(j);z.set(F,X),X.then(()=>{z.delete(F)})}return X};return v}function P(_,w){return b(_,w)}function E(_,w){return b(_,w)}function S(_){return(w,{track:v=!0,fixedCacheKey:I}={})=>(y,T)=>{const A=y(n({type:"mutation",endpointName:_,originalArgs:w,track:v,fixedCacheKey:I})),{requestId:C,abort:N,unwrap:j}=A,M=WP(A.unwrap().then(L=>({data:L})),L=>({error:L})),F=()=>{y(c({requestId:C,fixedCacheKey:I}))},D=Object.assign(M,{arg:A.arg,requestId:C,abort:N,unwrap:j,reset:F}),k=l(y);return k.set(C,D),D.then(()=>{k.delete(C)}),I&&(k.set(I,D),D.then(()=>{k.get(I)===D&&k.delete(I)})),D}}}var md=class extends AP{constructor(e,t,r,n){super(e),this.value=t,this.schemaName=r,this._bqMeta=n}value;schemaName;_bqMeta},kt=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Ut(e,t,r,n){const i=await e["~standard"].validate(t);if(i.issues)throw new md(i.issues,t,r,n);return i.value}function gd(e){return e}var Wr=(e={})=>({...e,[Bn]:!0});function KP({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:i,assertTagType:o,selectors:a,onSchemaFailure:s,catchSchemaFailure:l,skipSchemaValidation:u}){const c=(C,N,j,M)=>(F,D)=>{const k=r[C],L=n({queryArgs:N,endpointDefinition:k,endpointName:C});if(F(i.internalActions.queryResultPatched({queryCacheKey:L,patches:j})),!M)return;const U=i.endpoints[C].select(N)(D()),G=wa(k.providesTags,U.data,void 0,N,{},o);F(i.internalActions.updateProvidedBy([{queryCacheKey:L,providedTags:G}]))};function d(C,N,j=0){const M=[N,...C];return j&&M.length>j?M.slice(0,-1):M}function f(C,N,j=0){const M=[...C,N];return j&&M.length>j?M.slice(1):M}const m=(C,N,j,M=!0)=>(F,D)=>{const k=i.endpoints[C].select(N)(D()),L={patches:[],inversePatches:[],undo:()=>F(i.util.patchQueryData(C,N,L.inversePatches,M))};if(k.status===lt)return L;let U;if("data"in k)if(Ee(k.data)){const[G,W,Z]=tl(k.data,j);L.patches.push(...W),L.inversePatches.push(...Z),U=G}else U=j(k.data),L.patches.push({op:"replace",path:[],value:U}),L.inversePatches.push({op:"replace",path:[],value:k.data});return L.patches.length===0||F(i.util.patchQueryData(C,N,L.patches,M)),L},g=(C,N,j)=>M=>M(i.endpoints[C].initiate(N,{subscribe:!1,forceRefetch:!0,[Vr]:()=>({data:j})})),h=(C,N)=>C.query&&C[N]?C[N]:gd,b=async(C,{signal:N,abort:j,rejectWithValue:M,fulfillWithValue:F,dispatch:D,getState:k,extra:L})=>{const U=r[C.endpointName],{metaSchema:G,skipSchemaValidation:W=u}=U,Z=C.type===zr;try{let ee=gd;const K={signal:N,abort:j,dispatch:D,getState:k,extra:L,endpoint:C.endpointName,type:C.type,forced:Z?P(C,k()):void 0,queryCacheKey:Z?C.queryCacheKey:void 0},re=Z?C[Vr]:void 0;let X;const z=async(Q,Y,et,Le)=>{if(Y==null&&Q.pages.length)return Promise.resolve({data:Q});const qt=await ae({queryArg:C.originalArgs,pageParam:Y}),pt=Le?d:f;return{data:{pages:pt(Q.pages,qt.data,et),pageParams:pt(Q.pageParams,Y,et)},meta:qt.meta}};async function ae(Q){let Y;const{extraOptions:et,argSchema:Le,rawResponseSchema:qt,responseSchema:pt}=U;if(Le&&!kt(W,"arg")&&(Q=await Ut(Le,Q,"argSchema",{})),re?Y=re():U.query?(ee=h(U,"transformResponse"),Y=await t(U.query(Q),K,et)):Y=await U.queryFn(Q,K,et,Xi=>t(Xi,K,et)),Y.error)throw new ud(Y.error,Y.meta);let{data:Gt}=Y;qt&&!kt(W,"rawResponse")&&(Gt=await Ut(qt,Y.data,"rawResponseSchema",Y.meta));let It=await ee(Gt,Y.meta,Q);return pt&&!kt(W,"response")&&(It=await Ut(pt,It,"responseSchema",Y.meta)),{...Y,data:It}}if(Z&&"infiniteQueryOptions"in U){const{infiniteQueryOptions:Q}=U,{maxPages:Y=1/0}=Q,et=C.refetchCachedPages??Q.refetchCachedPages??!0;let Le;const qt={pages:[],pageParams:[]},pt=a.selectQueryEntry(k(),C.queryCacheKey)?.data,Gt=P(C,k())&&!C.direction||!pt?qt:pt;if("direction"in C&&C.direction&&Gt.pages.length){const It=C.direction==="backward";Le=await z(Gt,(It?yd:Ca)(Q,Gt,C.originalArgs),Y,It)}else{const{initialPageParam:It=Q.initialPageParam}=C,Xi=pt?.pageParams??[],RD=Xi[0]??It,DD=Xi.length;if(Le=await z(Gt,RD,Y),re&&(Le={data:Le.data.pages[0]}),et)for(let Om=1;Om<DD;Om++){const jD=Ca(Q,Le.data,C.originalArgs);Le=await z(Le.data,jD,Y)}}X=Le}else X=await ae(C.originalArgs);return G&&!kt(W,"meta")&&X.meta&&(X.meta=await Ut(G,X.meta,"metaSchema",X.meta)),F(X.data,Wr({fulfilledTimeStamp:Date.now(),baseQueryMeta:X.meta}))}catch(ee){let K=ee;if(K instanceof ud){let re=h(U,"transformErrorResponse");const{rawErrorResponseSchema:X,errorResponseSchema:z}=U;let{value:ae,meta:Q}=K;try{X&&!kt(W,"rawErrorResponse")&&(ae=await Ut(X,ae,"rawErrorResponseSchema",Q)),G&&!kt(W,"meta")&&(Q=await Ut(G,Q,"metaSchema",Q));let Y=await re(ae,Q,C.originalArgs);return z&&!kt(W,"errorResponse")&&(Y=await Ut(z,Y,"errorResponseSchema",Q)),M(Y,Wr({baseQueryMeta:Q}))}catch(Y){K=Y}}try{if(K instanceof md){const re={endpoint:C.endpointName,arg:C.originalArgs,type:C.type,queryCacheKey:Z?C.queryCacheKey:void 0};U.onSchemaFailure?.(K,re),s?.(K,re);const{catchSchemaFailure:X=l}=U;if(X)return M(X(K,re),Wr({baseQueryMeta:K._bqMeta}))}}catch(re){K=re}throw K}};function P(C,N){const j=a.selectQueryEntry(N,C.queryCacheKey),M=a.selectConfig(N).refetchOnMountOrArgChange,F=j?.fulfilledTimeStamp,D=C.forceRefetch??(C.subscribe&&M);return D?D===!0||(Number(new Date)-Number(F))/1e3>=D:!1}const E=()=>Oo(`${e}/executeQuery`,b,{getPendingMeta({arg:C}){const N=r[C.endpointName];return Wr({startedTimeStamp:Date.now(),...ui(N)?{direction:C.direction}:{}})},condition(C,{getState:N}){const j=N(),M=a.selectQueryEntry(j,C.queryCacheKey),F=M?.fulfilledTimeStamp,D=C.originalArgs,k=M?.originalArgs,L=r[C.endpointName],U=C.direction;return Ia(C)?!0:M?.status==="pending"?!1:P(C,j)||si(L)&&L?.forceRefetch?.({currentArg:D,previousArg:k,endpointState:M,state:j})?!0:!(F&&!U)},dispatchConditionRejection:!0}),S=E(),_=E(),w=Oo(`${e}/executeMutation`,b,{getPendingMeta(){return Wr({startedTimeStamp:Date.now()})}}),v=C=>"force"in C,I=C=>"ifOlderThan"in C,y=(C,N,j={})=>(M,F)=>{const D=v(j)&&j.force,k=I(j)&&j.ifOlderThan,L=(G=!0)=>{const W={forceRefetch:G,subscribe:!1};return i.endpoints[C].initiate(N,W)},U=i.endpoints[C].select(N)(F());if(D)M(L());else if(k){const G=U?.fulfilledTimeStamp;if(!G){M(L());return}(Number(new Date)-Number(new Date(G)))/1e3>=k&&M(L())}else M(L(!1))};function T(C){return N=>N?.meta?.arg?.endpointName===C}function A(C,N){return{matchPending:Nr(Po(C),T(N)),matchFulfilled:Nr(bt(C),T(N)),matchRejected:Nr(Kt(C),T(N))}}return{queryThunk:S,mutationThunk:w,infiniteQueryThunk:_,prefetch:y,updateQueryData:m,upsertQueryData:g,patchQueryData:c,buildMatchThunkActions:A}}function Ca(e,{pages:t,pageParams:r},n){const i=t.length-1;return e.getNextPageParam(t[i],t,r[i],r,n)}function yd(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function vd(e,t,r,n){return wa(r[e.meta.arg.endpointName][t],bt(e)?e.payload:void 0,xn(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function _d(e){return Me(e)?Zu(e):e}function ci(e,t,r){const n=e[t];n&&r(n)}function Qr(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function bd(e,t,r){const n=e[Qr(t)];n&&r(n)}var di={};function YP({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:a,hasRehydrationInfo:s},assertTagType:l,config:u}){const c=Se(`${e}/resetApiState`);function d(I,y,T,A){I[y.queryCacheKey]??={status:lt,endpointName:y.endpointName},ci(I,y.queryCacheKey,C=>{C.status=_a,C.requestId=T&&C.requestId?C.requestId:A.requestId,y.originalArgs!==void 0&&(C.originalArgs=y.originalArgs),C.startedTimeStamp=A.startedTimeStamp;const N=i[A.arg.endpointName];ui(N)&&"direction"in y&&(C.direction=y.direction)})}function f(I,y,T,A){ci(I,y.arg.queryCacheKey,C=>{if(C.requestId!==y.requestId&&!A)return;const{merge:N}=i[y.arg.endpointName];if(C.status=xr,N)if(C.data!==void 0){const{fulfilledTimeStamp:j,arg:M,baseQueryMeta:F,requestId:D}=y;C.data=Ar(C.data,k=>N(k,T,{arg:M.originalArgs,baseQueryMeta:F,fulfilledTimeStamp:j,requestId:D}))}else C.data=T;else C.data=i[y.arg.endpointName].structuralSharing??!0?ba(Me(C.data)?iy(C.data):C.data,T):T;delete C.error,C.fulfilledTimeStamp=y.fulfilledTimeStamp})}const m=Pe({name:`${e}/queries`,initialState:di,reducers:{removeQueryResult:{reducer(I,{payload:{queryCacheKey:y}}){delete I[y]},prepare:Mr()},cacheEntriesUpserted:{reducer(I,y){for(const T of y.payload){const{queryDescription:A,value:C}=T;d(I,A,!0,{arg:A,requestId:y.meta.requestId,startedTimeStamp:y.meta.timestamp}),f(I,{arg:A,requestId:y.meta.requestId,fulfilledTimeStamp:y.meta.timestamp,baseQueryMeta:{}},C,!0)}},prepare:I=>({payload:I.map(y=>{const{endpointName:T,arg:A,value:C}=y,N=i[T];return{queryDescription:{type:zr,endpointName:T,originalArgs:y.arg,queryCacheKey:n({queryArgs:A,endpointDefinition:N,endpointName:T})},value:C}}),meta:{[Bn]:!0,requestId:Io(),timestamp:Date.now()}})},queryResultPatched:{reducer(I,{payload:{queryCacheKey:y,patches:T}}){ci(I,y,A=>{A.data=rl(A.data,T.concat())})},prepare:Mr()}},extraReducers(I){I.addCase(t.pending,(y,{meta:T,meta:{arg:A}})=>{d(y,A,Ia(A),T)}).addCase(t.fulfilled,(y,{meta:T,payload:A})=>{f(y,T,A,Ia(T.arg))}).addCase(t.rejected,(y,{meta:{condition:T,arg:A,requestId:C},error:N,payload:j})=>{ci(y,A.queryCacheKey,M=>{if(!T){if(M.requestId!==C)return;M.status=qr,M.error=j??N}})}).addMatcher(s,(y,T)=>{const{queries:A}=a(T);for(const[C,N]of Object.entries(A))(N?.status===xr||N?.status===qr)&&(y[C]=N)})}}),g=Pe({name:`${e}/mutations`,initialState:di,reducers:{removeMutationResult:{reducer(I,{payload:y}){const T=Qr(y);T in I&&delete I[T]},prepare:Mr()}},extraReducers(I){I.addCase(r.pending,(y,{meta:T,meta:{requestId:A,arg:C,startedTimeStamp:N}})=>{C.track&&(y[Qr(T)]={requestId:A,status:_a,endpointName:C.endpointName,startedTimeStamp:N})}).addCase(r.fulfilled,(y,{payload:T,meta:A})=>{A.arg.track&&bd(y,A,C=>{C.requestId===A.requestId&&(C.status=xr,C.data=T,C.fulfilledTimeStamp=A.fulfilledTimeStamp)})}).addCase(r.rejected,(y,{payload:T,error:A,meta:C})=>{C.arg.track&&bd(y,C,N=>{N.requestId===C.requestId&&(N.status=qr,N.error=T??A)})}).addMatcher(s,(y,T)=>{const{mutations:A}=a(T);for(const[C,N]of Object.entries(A))(N?.status===xr||N?.status===qr)&&C!==N?.requestId&&(y[C]=N)})}}),h=Pe({name:`${e}/invalidation`,initialState:{tags:{},keys:{}},reducers:{updateProvidedBy:{reducer(I,y){for(const{queryCacheKey:T,providedTags:A}of y.payload){b(I,T);for(const{type:C,id:N}of A){const j=(I.tags[C]??={})[N||"__internal_without_id"]??=[];j.includes(T)||j.push(T)}I.keys[T]=A}},prepare:Mr()}},extraReducers(I){I.addCase(m.actions.removeQueryResult,(y,{payload:{queryCacheKey:T}})=>{b(y,T)}).addMatcher(s,(y,T)=>{const{provided:A}=a(T);for(const[C,N]of Object.entries(A.tags??{}))for(const[j,M]of Object.entries(N)){const F=(y.tags[C]??={})[j||"__internal_without_id"]??=[];for(const D of M)F.includes(D)||F.push(D),y.keys[D]=A.keys[D]}}).addMatcher(at(bt(t),xn(t)),(y,T)=>{P(y,[T])}).addMatcher(m.actions.cacheEntriesUpserted.match,(y,T)=>{P(y,T.payload.map(({queryDescription:A,value:C})=>({type:"UNKNOWN",payload:C,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:A}})))})}});function b(I,y){const T=_d(I.keys[y]??[]);for(const A of T){const C=A.type,N=A.id??"__internal_without_id",j=I.tags[C]?.[N];j&&(I.tags[C][N]=_d(j).filter(M=>M!==y))}delete I.keys[y]}function P(I,y){const T=y.map(A=>{const C=vd(A,"providesTags",i,l),{queryCacheKey:N}=A.meta.arg;return{queryCacheKey:N,providedTags:C}});h.caseReducers.updateProvidedBy(I,h.actions.updateProvidedBy(T))}const E=Pe({name:`${e}/subscriptions`,initialState:di,reducers:{updateSubscriptionOptions(I,y){},unsubscribeQueryResult(I,y){},internal_getRTKQSubscriptions(){}}}),S=Pe({name:`${e}/internalSubscriptions`,initialState:di,reducers:{subscriptionsUpdated:{reducer(I,y){return rl(I,y.payload)},prepare:Mr()}}}),_=Pe({name:`${e}/config`,initialState:{online:RP(),focused:NP(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(I,{payload:y}){I.middlewareRegistered=I.middlewareRegistered==="conflict"||o!==y?"conflict":!0}},extraReducers:I=>{I.addCase(Hr,y=>{y.online=!0}).addCase(oi,y=>{y.online=!1}).addCase(Gr,y=>{y.focused=!0}).addCase(ii,y=>{y.focused=!1}).addMatcher(s,y=>({...y}))}}),w=lo({queries:m.reducer,mutations:g.reducer,provided:h.reducer,subscriptions:S.reducer,config:_.reducer});return{reducer:(I,y)=>w(c.match(y)?void 0:I,y),actions:{..._.actions,...m.actions,...E.actions,...S.actions,...g.actions,...h.actions,resetApiState:c}}}var ze=Symbol.for("RTKQ/skipToken"),Ed={status:lt},Sd=Ar(Ed,()=>{}),Pd=Ar(Ed,()=>{});function XP({serializeQueryArgs:e,reducerPath:t,createSelector:r}){const n=S=>Sd,i=S=>Pd;return{buildQuerySelector:f,buildInfiniteQuerySelector:m,buildMutationSelector:g,selectInvalidatedBy:h,selectCachedArgsForQuery:b,selectApiState:a,selectQueries:s,selectMutations:u,selectQueryEntry:l,selectConfig:c};function o(S){return{...S,...rd(S.status)}}function a(S){return S[t]}function s(S){return a(S)?.queries}function l(S,_){return s(S)?.[_]}function u(S){return a(S)?.mutations}function c(S){return a(S)?.config}function d(S,_,w){return v=>{if(v===ze)return r(n,w);const I=e({queryArgs:v,endpointDefinition:_,endpointName:S});return r(T=>l(T,I)??Sd,w)}}function f(S,_){return d(S,_,o)}function m(S,_){const{infiniteQueryOptions:w}=_;function v(I){const y={...I,...rd(I.status)},{isLoading:T,isError:A,direction:C}=y,N=C==="forward",j=C==="backward";return{...y,hasNextPage:P(w,y.data,y.originalArgs),hasPreviousPage:E(w,y.data,y.originalArgs),isFetchingNextPage:T&&N,isFetchingPreviousPage:T&&j,isFetchNextPageError:A&&N,isFetchPreviousPageError:A&&j}}return d(S,_,v)}function g(){return(S=>{let _;return typeof S=="object"?_=Qr(S)??ze:_=S,r(_===ze?i:v=>a(v)?.mutations?.[_]??Pd,o)})}function h(S,_){const w=S[t],v=new Set,I=Ea(_,Sa,hd);for(const y of I){const T=w.provided.tags[y.type];if(!T)continue;let A=(y.id!==void 0?T[y.id]:Object.values(T).flat())??[];for(const C of A)v.add(C)}return Array.from(v.values()).flatMap(y=>{const T=w.queries[y];return T?{queryCacheKey:y,endpointName:T.endpointName,originalArgs:T.originalArgs}:[]})}function b(S,_){return Ea(Object.values(s(S)),w=>w?.endpointName===_&&w.status!==lt,w=>w.originalArgs)}function P(S,_,w){return _?Ca(S,_,w)!=null:!1}function E(S,_,w){return!_||!S.getPreviousPageParam?!1:yd(S,_,w)!=null}}var wd=WeakMap?new WeakMap:void 0,Id=({endpointName:e,queryArgs:t})=>{let r="";const n=wd?.get(t);if(typeof n=="string")r=n;else{const i=JSON.stringify(t,(o,a)=>(a=typeof a=="bigint"?{$bigint:a.toString()}:a,a=_t(a)?Object.keys(a).sort().reduce((s,l)=>(s[l]=a[l],s),{}):a,a));_t(t)&&wd?.set(t,i),r=i}return`${e}(${r})`};function Cd(...e){return function(r){const n=kn(u=>r.extractRehydrationInfo?.(u,{reducerPath:r.reducerPath??"api"})),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(u){let c=Id;if("serializeQueryArgs"in u.endpointDefinition){const d=u.endpointDefinition.serializeQueryArgs;c=f=>{const m=d(f);return typeof m=="string"?m:Id({...f,queryArgs:m})}}else r.serializeQueryArgs&&(c=r.serializeQueryArgs);return c(u)},tagTypes:[...r.tagTypes||[]]},o={endpointDefinitions:{},batch(u){u()},apiUid:Io(),extractRehydrationInfo:n,hasRehydrationInfo:kn(u=>n(u)!=null)},a={injectEndpoints:l,enhanceEndpoints({addTagTypes:u,endpoints:c}){if(u)for(const d of u)i.tagTypes.includes(d)||i.tagTypes.push(d);if(c)for(const[d,f]of Object.entries(c))typeof f=="function"?f(Zt(o,d)):Object.assign(Zt(o,d)||{},f);return a}},s=e.map(u=>u.init(a,i,o));function l(u){const c=u.endpoints({query:d=>({...d,type:zr}),mutation:d=>({...d,type:fd}),infiniteQuery:d=>({...d,type:pd})});for(const[d,f]of Object.entries(c)){if(u.overrideExisting!==!0&&d in o.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(ke(39));continue}o.endpointDefinitions[d]=f;for(const m of s)m.injectEndpoint(d,f)}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function ct(e,...t){return Object.assign(e,...t)}var JP=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{const i=`${e.reducerPath}/subscriptions`;let o=null,a=null;const{updateSubscriptionOptions:s,unsubscribeQueryResult:l}=e.internalActions,u=(h,b)=>{if(s.match(b)){const{queryCacheKey:E,requestId:S,options:_}=b.payload,w=h.get(E);return w?.has(S)&&w.set(S,_),!0}if(l.match(b)){const{queryCacheKey:E,requestId:S}=b.payload,_=h.get(E);return _&&_.delete(S),!0}if(e.internalActions.removeQueryResult.match(b))return h.delete(b.payload.queryCacheKey),!0;if(t.pending.match(b)){const{meta:{arg:E,requestId:S}}=b,_=ri(h,E.queryCacheKey,Pa);return E.subscribe&&_.set(S,E.subscriptionOptions??_.get(S)??{}),!0}let P=!1;if(t.rejected.match(b)){const{meta:{condition:E,arg:S,requestId:_}}=b;if(E&&S.subscribe){const w=ri(h,S.queryCacheKey,Pa);w.set(_,S.subscriptionOptions??w.get(_)??{}),P=!0}}return P},c=()=>r.currentSubscriptions,m={getSubscriptions:c,getSubscriptionCount:h=>c().get(h)?.size??0,isRequestSubscribed:(h,b)=>!!c()?.get(h)?.get(b)};function g(h){return JSON.parse(JSON.stringify(Object.fromEntries([...h].map(([b,P])=>[b,Object.fromEntries(P)]))))}return(h,b)=>{if(o||(o=g(r.currentSubscriptions)),e.util.resetApiState.match(h))return o={},r.currentSubscriptions.clear(),a=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(h))return[!1,m];const P=u(r.currentSubscriptions,h);let E=!0;if(P){a||(a=setTimeout(()=>{const w=g(r.currentSubscriptions),[,v]=tl(o,()=>w);b.next(e.internalActions.subscriptionsUpdated(v)),o=w,a=null},500));const S=typeof h.type=="string"&&!!h.type.startsWith(i),_=t.rejected.match(h)&&h.meta.condition&&!!h.meta.arg.subscribe;E=!S&&!_}return[E,!1]}},ZP=2147483647/1e3-1,ew=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:i,selectors:{selectQueryEntry:o,selectConfig:a},getRunningQueryThunk:s,mwApi:l})=>{const{removeQueryResult:u,unsubscribeQueryResult:c,cacheEntriesUpserted:d}=t.internalActions,f=at(c.match,r.fulfilled,r.rejected,d.match);function m(S){const _=i.currentSubscriptions.get(S);return _?_.size>0:!1}const g={};function h(S){for(const _ of S.values())_?.abort?.()}const b=(S,_)=>{const w=a(_.getState());if(f(S)){let v;if(d.match(S))v=S.payload.map(I=>I.queryDescription.queryCacheKey);else{const{queryCacheKey:I}=c.match(S)?S.payload:S.meta.arg;v=[I]}P(v,_,w)}if(t.util.resetApiState.match(S)){for(const[v,I]of Object.entries(g))I&&clearTimeout(I),delete g[v];h(i.runningQueries),h(i.runningMutations)}if(n.hasRehydrationInfo(S)){const{queries:v}=n.extractRehydrationInfo(S);P(Object.keys(v),_,w)}};function P(S,_,w){const v=_.getState();for(const I of S){const y=o(v,I);y?.endpointName&&E(I,y.endpointName,_,w)}}function E(S,_,w,v){const I=Zt(n,_)?.keepUnusedDataFor??v.keepUnusedDataFor;if(I===1/0)return;const y=Math.max(0,Math.min(I,ZP));if(!m(S)){const T=g[S];T&&clearTimeout(T),g[S]=setTimeout(()=>{if(!m(S)){const A=o(w.getState(),S);A?.endpointName&&w.dispatch(s(A.endpointName,A.originalArgs))?.abort(),w.dispatch(u({queryCacheKey:S}))}delete g[S]},y*1e3)}}return b},Od=new Error("Promise never resolved before cacheEntryRemoved."),tw=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:a,selectApiState:s}})=>{const l=wo(n),u=wo(i),c=bt(n,i),d={},{removeQueryResult:f,removeMutationResult:m,cacheEntriesUpserted:g}=e.internalActions;function h(w,v,I){const y=d[w];y?.valueResolved&&(y.valueResolved({data:v,meta:I}),delete y.valueResolved)}function b(w){const v=d[w];v&&(delete d[w],v.cacheEntryRemoved())}function P(w){const{arg:v,requestId:I}=w.meta,{endpointName:y,originalArgs:T}=v;return[y,T,I]}const E=(w,v,I)=>{const y=S(w);function T(A,C,N,j){const M=a(I,C),F=a(v.getState(),C);!M&&F&&_(A,j,C,v,N)}if(n.pending.match(w)){const[A,C,N]=P(w);T(A,y,N,C)}else if(g.match(w))for(const{queryDescription:A,value:C}of w.payload){const{endpointName:N,originalArgs:j,queryCacheKey:M}=A;T(N,M,w.meta.requestId,j),h(M,C,{})}else if(i.pending.match(w)){if(v.getState()[t].mutations[y]){const[A,C,N]=P(w);_(A,C,y,v,N)}}else if(c(w))h(y,w.payload,w.meta.baseQueryMeta);else if(f.match(w)||m.match(w))b(y);else if(e.util.resetApiState.match(w))for(const A of Object.keys(d))b(A)};function S(w){return l(w)?w.meta.arg.queryCacheKey:u(w)?w.meta.arg.fixedCacheKey??w.meta.requestId:f.match(w)?w.payload.queryCacheKey:m.match(w)?Qr(w.payload):""}function _(w,v,I,y,T){const A=Zt(r,w),C=A?.onCacheEntryAdded;if(!C)return;const N={},j=new Promise(L=>{N.cacheEntryRemoved=L}),M=Promise.race([new Promise(L=>{N.valueResolved=L}),j.then(()=>{throw Od})]);M.catch(()=>{}),d[I]=N;const F=e.endpoints[w].select(li(A)?v:I),D=y.dispatch((L,U,G)=>G),k=C(v,{...y,getCacheEntry:()=>F(y.getState()),requestId:T,extra:D,updateCachedData:li(A)?L=>y.dispatch(e.util.updateQueryData(w,v,L)):void 0,cacheDataLoaded:M,cacheEntryRemoved:j});Promise.resolve(k).catch(L=>{if(L!==Od)throw L})}return E},rw=({api:e,context:{apiUid:t},reducerPath:r})=>(n,i)=>{e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(t))},nw=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:i,api:o,assertTagType:a,refetchQuery:s,internalState:l})=>{const{removeQueryResult:u}=o.internalActions,c=at(bt(n),xn(n)),d=at(bt(i,n),Kt(i,n));let f=[],m=0;const g=(P,E)=>{(i.pending.match(P)||n.pending.match(P))&&m++,d(P)&&(m=Math.max(0,m-1)),c(P)?b(vd(P,"invalidatesTags",r,a),E):d(P)?b([],E):o.util.invalidateTags.match(P)&&b(wa(P.payload,void 0,void 0,void 0,void 0,a),E)};function h(){return m>0}function b(P,E){const S=E.getState(),_=S[e];if(f.push(...P),_.config.invalidationBehavior==="delayed"&&h())return;const w=f;if(f=[],w.length===0)return;const v=o.util.selectInvalidatedBy(S,w);t.batch(()=>{const I=Array.from(v.values());for(const{queryCacheKey:y}of I){const T=_.queries[y],A=ri(l.currentSubscriptions,y,Pa);T&&(A.size===0?E.dispatch(u({queryCacheKey:y})):T.status!==lt&&E.dispatch(s(T)))}})}return g},iw=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:i})=>{const{currentPolls:o,currentSubscriptions:a}=i,s=new Set;let l=null;const u=(b,P)=>{(r.internalActions.updateSubscriptionOptions.match(b)||r.internalActions.unsubscribeQueryResult.match(b))&&c(b.payload.queryCacheKey,P),(t.pending.match(b)||t.rejected.match(b)&&b.meta.condition)&&c(b.meta.arg.queryCacheKey,P),(t.fulfilled.match(b)||t.rejected.match(b)&&!b.meta.condition)&&d(b.meta.arg,P),r.util.resetApiState.match(b)&&(g(),l&&(clearTimeout(l),l=null),s.clear())};function c(b,P){s.add(b),l||(l=setTimeout(()=>{for(const E of s)f({queryCacheKey:E},P);s.clear(),l=null},0))}function d({queryCacheKey:b},P){const E=P.getState()[e],S=E.queries[b],_=a.get(b);if(!S||S.status===lt)return;const{lowestPollingInterval:w,skipPollingIfUnfocused:v}=h(_);if(!Number.isFinite(w))return;const I=o.get(b);I?.timeout&&(clearTimeout(I.timeout),I.timeout=void 0);const y=Date.now()+w;o.set(b,{nextPollTimestamp:y,pollingInterval:w,timeout:setTimeout(()=>{(E.config.focused||!v)&&P.dispatch(n(S)),d({queryCacheKey:b},P)},w)})}function f({queryCacheKey:b},P){const E=P.getState()[e].queries[b],S=a.get(b);if(!E||E.status===lt)return;const{lowestPollingInterval:_}=h(S);if(!Number.isFinite(_)){m(b);return}const w=o.get(b),v=Date.now()+_;(!w||v<w.nextPollTimestamp)&&d({queryCacheKey:b},P)}function m(b){const P=o.get(b);P?.timeout&&clearTimeout(P.timeout),o.delete(b)}function g(){for(const b of o.keys())m(b)}function h(b=new Map){let P=!1,E=Number.POSITIVE_INFINITY;for(const S of b.values())S.pollingInterval&&(E=Math.min(S.pollingInterval,E),P=S.skipPollingIfUnfocused||P);return{lowestPollingInterval:E,skipPollingIfUnfocused:P}}return u},ow=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{const i=Po(r,n),o=Kt(r,n),a=bt(r,n),s={};return(u,c)=>{if(i(u)){const{requestId:d,arg:{endpointName:f,originalArgs:m}}=u.meta,g=Zt(t,f),h=g?.onQueryStarted;if(h){const b={},P=new Promise((_,w)=>{b.resolve=_,b.reject=w});P.catch(()=>{}),s[d]=b;const E=e.endpoints[f].select(li(g)?m:d),S=c.dispatch((_,w,v)=>v);h(m,{...c,getCacheEntry:()=>E(c.getState()),requestId:d,extra:S,updateCachedData:li(g)?_=>c.dispatch(e.util.updateQueryData(f,m,_)):void 0,queryFulfilled:P})}}else if(a(u)){const{requestId:d,baseQueryMeta:f}=u.meta;s[d]?.resolve({data:u.payload,meta:f}),delete s[d]}else if(o(u)){const{requestId:d,rejectedWithValue:f,baseQueryMeta:m}=u.meta;s[d]?.reject({error:u.payload??u.error,isUnhandledError:!f,meta:m}),delete s[d]}}},aw=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:i})=>{const{removeQueryResult:o}=r.internalActions,a=(l,u)=>{Gr.match(l)&&s(u,"refetchOnFocus"),Hr.match(l)&&s(u,"refetchOnReconnect")};function s(l,u){const c=l.getState()[e],d=c.queries,f=i.currentSubscriptions;t.batch(()=>{for(const m of f.keys()){const g=d[m],h=f.get(m);if(!h||!g)continue;const b=[...h.values()];(b.some(P=>P[u]===!0)||b.every(P=>P[u]===void 0)&&c.config[u])&&(h.size===0?l.dispatch(o({queryCacheKey:m})):g.status!==lt&&l.dispatch(n(g)))}})}return a};function sw(e){const{reducerPath:t,queryThunk:r,api:n,context:i,getInternalState:o}=e,{apiUid:a}=i,s={invalidateTags:Se(`${t}/invalidateTags`)},l=f=>f.type.startsWith(`${t}/`),u=[rw,ew,nw,iw,tw,ow];return{middleware:f=>{let m=!1;const g=o(f.dispatch),h={...e,internalState:g,refetchQuery:d,isThisApiSliceAction:l,mwApi:f},b=u.map(S=>S(h)),P=JP(h),E=aw(h);return S=>_=>{if(!mu(_))return S(_);m||(m=!0,f.dispatch(n.internalActions.middlewareRegistered(a)));const w={...f,next:S},v=f.getState(),[I,y]=P(_,w,v);let T;if(I?T=S(_):T=y,f.getState()[t]&&(E(_,w,v),l(_)||i.hasRehydrationInfo(_)))for(const A of b)A(_,w,v);return T}},actions:s};function d(f){return e.api.endpoints[f.endpointName].initiate(f.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Td=Symbol(),Ad=({createSelector:e=al}={})=>({name:Td,init(t,{baseQuery:r,tagTypes:n,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:a,refetchOnMountOrArgChange:s,refetchOnFocus:l,refetchOnReconnect:u,invalidationBehavior:c,onSchemaFailure:d,catchSchemaFailure:f,skipSchemaValidation:m},g){by();const h=z=>z;Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Hr,onOffline:oi,onFocus:Gr,onFocusLost:ii},util:{}});const b=XP({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:E,buildQuerySelector:S,buildInfiniteQuerySelector:_,buildMutationSelector:w}=b;ct(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:E});const{queryThunk:v,infiniteQueryThunk:I,mutationThunk:y,patchQueryData:T,updateQueryData:A,upsertQueryData:C,prefetch:N,buildMatchThunkActions:j}=KP({baseQuery:r,reducerPath:i,context:g,api:t,serializeQueryArgs:o,assertTagType:h,selectors:b,onSchemaFailure:d,catchSchemaFailure:f,skipSchemaValidation:m}),{reducer:M,actions:F}=YP({context:g,queryThunk:v,infiniteQueryThunk:I,mutationThunk:y,serializeQueryArgs:o,reducerPath:i,assertTagType:h,config:{refetchOnFocus:l,refetchOnReconnect:u,refetchOnMountOrArgChange:s,keepUnusedDataFor:a,reducerPath:i,invalidationBehavior:c}});ct(t.util,{patchQueryData:T,updateQueryData:A,upsertQueryData:C,prefetch:N,resetApiState:F.resetApiState,upsertQueryEntries:F.cacheEntriesUpserted}),ct(t.internalActions,F);const D=new WeakMap,k=z=>ri(D,z,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:L,buildInitiateInfiniteQuery:U,buildInitiateMutation:G,getRunningMutationThunk:W,getRunningMutationsThunk:Z,getRunningQueriesThunk:ee,getRunningQueryThunk:K}=QP({queryThunk:v,mutationThunk:y,infiniteQueryThunk:I,api:t,serializeQueryArgs:o,context:g,getInternalState:k});ct(t.util,{getRunningMutationThunk:W,getRunningMutationsThunk:Z,getRunningQueryThunk:K,getRunningQueriesThunk:ee});const{middleware:re,actions:X}=sw({reducerPath:i,context:g,queryThunk:v,mutationThunk:y,infiniteQueryThunk:I,api:t,assertTagType:h,selectors:b,getRunningQueryThunk:K,getInternalState:k});return ct(t.util,X),ct(t,{reducer:M,middleware:re}),{name:Td,injectEndpoint(z,ae){const Q=t,Y=Q.endpoints[z]??={};si(ae)&&ct(Y,{name:z,select:S(z,ae),initiate:L(z,ae)},j(v,z)),zP(ae)&&ct(Y,{name:z,select:w(),initiate:G(z)},j(y,z)),ui(ae)&&ct(Y,{name:z,select:_(z,ae),initiate:U(z,ae)},j(v,z))}}}}),ZD=Cd(Ad()),uw=class{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};async request({body:e,secure:t,path:r,type:n,query:i,format:o,baseUrl:a,cancelToken:s,extraQuery:l,proxyHandler:u,...c}){const d=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},f=this.mergeRequestParams(c,d);l&&(i=i?{...i,...l}:l);const m=i&&this.toQueryString(i),g=this.contentFormatters[n||"application/json"],h=o||f.format,b=`${a||this.baseUrl||""}${r}${m?`?${m}`:""}`,P=u?u(b,{body:e,secure:t,path:r,type:n,query:i,format:o,baseUrl:a,cancelToken:s,extraQuery:l,proxyHandler:u,...c}):b,E=new Request(P,{...f,headers:{...f.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(s?this.createAbortSignal(s):f.signal)||null,body:typeof e>"u"||e===null?null:g(e)});return this.customFetch(E).then(async S=>{const _=S;_.data=null,_.error=null,_.meta={request:E,response:_};const w=h?await S[h]().then(v=>(_.ok?_.data=v:_.error={data:v},_)).catch(v=>(_.error=v,_)):_;return s&&this.abortControllers.delete(s),w})}},lw=class extends uw{unsplashTest={appControllerGetUnsplashTest:(e={})=>this.request({path:"/unsplash_test",method:"GET",...e})};tasks={tasksControllerCreateTask:(e,t={})=>this.request({path:"/tasks",method:"POST",body:e,type:"application/json",...t}),tasksControllerGetTask:({id:e,...t},r={})=>this.request({path:`/tasks/${e}`,method:"GET",...r}),tasksControllerGetEmail:({id:e,...t},r={})=>this.request({path:`/tasks/${e}/email`,method:"GET",...r}),tasksControllerGetEmailHtml:({id:e,...t},r={})=>this.request({path:`/tasks/${e}/html`,method:"GET",...r})};parsing={manParseControllerLogoGen:(e,t={})=>this.request({path:"/parsing/logo-gen",method:"GET",query:e,...t}),manParseControllerSite:(e,t={})=>this.request({path:"/parsing/site",method:"GET",query:e,...t}),manParseControllerColor:(e,t={})=>this.request({path:"/parsing/color",method:"GET",query:e,...t}),manParseControllerStyle:(e,t={})=>this.request({path:"/parsing/style",method:"GET",query:e,...t}),manParseControllerColorScheme:(e,t={})=>this.request({path:"/parsing/color-scheme",method:"GET",query:e,...t}),manParseControllerImage:(e,t={})=>this.request({path:"/parsing/image",method:"GET",query:e,...t})};maintenance={maintenanceControllerReloadBlocks:(e={})=>this.request({path:"/maintenance/reload-blocks",method:"GET",...e}),maintenanceControllerReloadUnsplashTopics:(e={})=>this.request({path:"/maintenance/reload-unsplash-topics",method:"GET",...e})};unsplash={unsplashControllerUnsplashTest:(e={})=>this.request({path:"/unsplash/test",method:"GET",...e}),unsplashControllerSearchPhotos:(e,t={})=>this.request({path:"/unsplash/search",method:"GET",query:e,...t}),unsplashControllerGetTopics:(e={})=>this.request({path:"/unsplash/topics",method:"GET",...e}),unsplashControllerGetPhoto:(e,t={})=>this.request({path:"/unsplash/photo",method:"GET",query:e,...t})}},cw=class{http;constructor(e){this.http=e}planInvalidateCreate=(e={})=>this.http.request({path:"/billing/plan/invalidate",method:"POST",secure:!0,format:"json",...e})},V=(function(e){return e.Json="application/json",e.JsonApi="application/vnd.api+json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e})({}),Md=class{baseUrl="/api/v2";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"application/vnd.api+json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>e instanceof FormData?e:Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};request=async({body:e,secure:t,path:r,type:n,query:i,format:o,baseUrl:a,cancelToken:s,...l})=>{const u=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},c=this.mergeRequestParams(l,u),d=i&&this.toQueryString(i),f=this.contentFormatters[n||"application/json"],m=o||c.format;return this.customFetch(`${a||this.baseUrl||""}${r}${d?`?${d}`:""}`,{...c,headers:{...c.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(s?this.createAbortSignal(s):c.signal)||null,body:typeof e>"u"||e===null?null:f(e)}).then(async g=>{const h=g;h.data=null,h.error=null;const b=m?g.clone():g,P=m?await b[m]().then(E=>(h.ok?h.data=E:h.error=E,h)).catch(E=>(h.error=E,h)):h;return s&&this.abortControllers.delete(s),P})}},dw=class{http;constructor(e){this.http=e}projectsList=(e={},t={})=>this.http.request({path:"/projects",method:"GET",query:e,secure:!0,format:"json",...t});projectsCreate=(e,t={})=>this.http.request({path:"/projects",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t});projectsDelete=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}`,method:"DELETE",query:t,secure:!0,...r});projectsDetail=({id:e},t={})=>this.http.request({path:`/projects/${e}`,method:"GET",secure:!0,format:"json",...t});projectsPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}`,method:"PATCH",body:t,secure:!0,type:V.Json,format:"json",...r});blockFoldersList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/block-folders`,method:"GET",query:t,secure:!0,format:"json",...r});blockFoldersCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/block-folders`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});blockFoldersDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/block-folders/${t}`,method:"DELETE",secure:!0,...r});blockFoldersPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/block-folders/${t}`,method:"PATCH",body:r,secure:!0,type:V.Json,format:"json",...n});blockTagsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/block-tags`,method:"GET",query:t,secure:!0,format:"json",...r});blockTagsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/block-tags`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});blockTagsDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/block-tags/${t}`,method:"DELETE",secure:!0,...r});blockTagsPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/block-tags/${t}`,method:"PATCH",body:r,secure:!0,type:V.Json,format:"json",...n});emailTagsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/email-tags`,method:"GET",query:t,secure:!0,format:"json",...r});emailTagsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/email-tags`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});emailTagsDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/email-tags/${t}`,method:"DELETE",secure:!0,...r});emailTagsPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/email-tags/${t}`,method:"PATCH",body:r,secure:!0,type:V.Json,format:"json",...n});foldersList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/folders`,method:"GET",query:t,secure:!0,format:"json",...r});foldersCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/folders`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});foldersDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/folders/${t}`,method:"DELETE",secure:!0,...r});foldersPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/folders/${t}`,method:"PATCH",body:r,secure:!0,type:V.Json,format:"json",...n});groupsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/groups`,method:"GET",query:t,secure:!0,format:"json",...r});groupsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/groups`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});groupsDelete=({id:e,termId:t},r={})=>this.http.request({path:`/projects/${e}/groups/${t}`,method:"DELETE",secure:!0,...r});groupsPartialUpdate=({id:e,termId:t},r,n={})=>this.http.request({path:`/projects/${e}/groups/${t}`,method:"PATCH",body:r,secure:!0,type:V.Json,format:"json",...n});integrationsList=({id:e},t={})=>this.http.request({path:`/projects/${e}/integrations`,method:"GET",secure:!0,format:"json",...t});integrationsDelete=({id:e,provider:t},r={})=>this.http.request({path:`/projects/${e}/integrations/${t}`,method:"DELETE",secure:!0,...r});integrationsDetail=({id:e,provider:t,...r},n={})=>this.http.request({path:`/projects/${e}/integrations/${t}`,method:"GET",query:r,secure:!0,format:"json",...n});integrationsUpdate=({id:e,provider:t},r,n={})=>this.http.request({path:`/projects/${e}/integrations/${t}`,method:"PUT",body:r,secure:!0,type:V.Json,format:"json",...n});integrationsCheckCreate=({id:e,provider:t},r={})=>this.http.request({path:`/projects/${e}/integrations/${t}/check`,method:"POST",secure:!0,format:"json",...r});invitesDelete=({id:e,email:t},r={})=>this.http.request({path:`/projects/${e}/invites/${t}`,method:"DELETE",secure:!0,...r});membersList=({id:e},t={})=>this.http.request({path:`/projects/${e}/members`,method:"GET",secure:!0,format:"json",...t});membersCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/members`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});membersDelete=({id:e,userId:t},r={})=>this.http.request({path:`/projects/${e}/members/${t}`,method:"DELETE",secure:!0,...r});membersPartialUpdate=({id:e,userId:t},r,n={})=>this.http.request({path:`/projects/${e}/members/${t}`,method:"PATCH",body:r,secure:!0,type:V.Json,format:"json",...n});membersMeDelete=({id:e},t={})=>this.http.request({path:`/projects/${e}/members/me`,method:"DELETE",secure:!0,...t});planList=({id:e},t={})=>this.http.request({path:`/projects/${e}/plan`,method:"GET",secure:!0,format:"json",...t});profileList=({id:e},t={})=>this.http.request({path:`/projects/${e}/profile`,method:"GET",secure:!0,format:"json",...t});profilePartialUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/profile`,method:"PATCH",body:t,secure:!0,type:V.Json,format:"json",...r});restoreCreate=({id:e},t={})=>this.http.request({path:`/projects/${e}/restore`,method:"POST",secure:!0,...t});settingsUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/settings`,method:"PUT",body:t,secure:!0,type:V.Json,format:"json",...r});storageDelete=({id:e},t={})=>this.http.request({path:`/projects/${e}/storage`,method:"DELETE",secure:!0,format:"json",...t});storageList=({id:e},t={})=>this.http.request({path:`/projects/${e}/storage`,method:"GET",secure:!0,format:"json",...t});storageUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/storage`,method:"PUT",body:t,secure:!0,type:V.Json,format:"json",...r});storageTestCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/storage/test`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});stripoFoldersList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/stripo/folders`,method:"GET",query:t,secure:!0,format:"json",...r});stripoImportsCreate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/stripo/imports`,method:"POST",body:t,secure:!0,type:V.Json,format:"json",...r});stripoImportsDetail=({id:e,jobId:t},r={})=>this.http.request({path:`/projects/${e}/stripo/imports/${t}`,method:"GET",secure:!0,format:"json",...r});stripoImportsCurrentList=({id:e},t={})=>this.http.request({path:`/projects/${e}/stripo/imports/current`,method:"GET",secure:!0,format:"json",...t});stripoItemsList=({id:e,...t},r={})=>this.http.request({path:`/projects/${e}/stripo/items`,method:"GET",query:t,secure:!0,format:"json",...r});stripoKeyUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/stripo/key`,method:"PUT",body:t,secure:!0,type:V.Json,...r});stylesList=({id:e},t={})=>this.http.request({path:`/projects/${e}/styles`,method:"GET",secure:!0,format:"json",...t});stylesPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/styles`,method:"PATCH",body:t,secure:!0,type:V.Json,format:"json",...r});stylesFontsCreate=({id:e},t={})=>this.http.request({path:`/projects/${e}/styles/fonts`,method:"POST",secure:!0,format:"json",...t});testRecipientsList=({id:e},t={})=>this.http.request({path:`/projects/${e}/test-recipients`,method:"GET",secure:!0,format:"json",...t});testRecipientsUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/test-recipients`,method:"PUT",body:t,secure:!0,type:V.Json,format:"json",...r});webhookDelete=({id:e},t={})=>this.http.request({path:`/projects/${e}/webhook`,method:"DELETE",secure:!0,...t});webhookList=({id:e},t={})=>this.http.request({path:`/projects/${e}/webhook`,method:"GET",secure:!0,format:"json",...t});webhookUpdate=({id:e},t,r={})=>this.http.request({path:`/projects/${e}/webhook`,method:"PUT",body:t,secure:!0,type:V.Json,format:"json",...r});profileOptionsList=(e={})=>this.http.request({path:"/projects/profile/options",method:"GET",secure:!0,format:"json",...e});topUsedList=(e={},t={})=>this.http.request({path:"/projects/top-used",method:"GET",query:e,secure:!0,format:"json",...t})},ej=O.createIdentifier$1("rest.v2.transport");function Nd(e,t){if(e!=null&&typeof e=="object"){const r=e[t];if(typeof r=="string"&&r!=="")return r}}function Rd(e){const t=e.error,r=t?.error;return r&&typeof r=="object"?{status:e.status,data:{code:Nd(r.details,"wp_code")??r.code,message:Nd(r.details,"wp_message")??r.message,details:r.details}}:t&&typeof t=="object"?{status:e.status,data:t}:{status:e.status,data:{message:e.statusText||"request failed"}}}function fw(e){return!e.ok||!!e.error}function pw(e){return fw(e)?{error:Rd(e)}:{data:e.data}}var hw=class extends Md{billing=new cw(this);projects=new dw(this)},mw=e=>e.getOrCreateInstance(O.V2REST_CLIENT_ID,()=>{const t=e.getInstance(O.CUSTOM_FETCH_ID);return new hw({baseUrl:"https://app.emailmaker.ru/api/v2",customFetch:t?.execute||fetch})}),Be=e=>mw(e),gw=e=>Rd(e),Ye=e=>pw(e),Kr=e=>e.getInstance(O.REST_CLIENT_ID),yw=e=>e.getOrCreateInstance(O.AIREST_CLIENT_ID,()=>new lw({baseUrl:"https://ai-mail.emcdn.ru"}));function Re(e){return(t,r,n)=>{const i=O.getContainer(r)?.getInstance(O.CUSTOM_FETCH_ID);return sd({...e,fetchFn:i?.execute||fetch})(t,r,n)}}var fi=e=>O.getContainer(e),x=e=>Kr(O.getContainer(e)),Xe=e=>Be(O.getContainer(e)),vw=e=>yw(O.getContainer(e));function pi(e){return e.replace(e[0],e[0].toUpperCase())}var _w="query",bw="mutation",Ew="infinitequery";function Sw(e){return e.type===_w}function Pw(e){return e.type===bw}function Dd(e){return e.type===Ew}function Yr(e,...t){return Object.assign(e,...t)}var Oa=Symbol();function Ta(e){const t=(0,H.useRef)(e),r=(0,H.useMemo)(()=>ba(t.current,e),[e]);return(0,H.useEffect)(()=>{t.current!==r&&(t.current=r)},[r]),r}function er(e){const t=(0,H.useRef)(e);return(0,H.useEffect)(()=>{mr(t.current,e)||(t.current=e)},[e]),mr(t.current,e)?t.current:e}var ww=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Iw=ww(),Cw=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Ow=Cw(),Tw=()=>Iw||Ow?H.useLayoutEffect:H.useEffect,Aw=Tw(),jd=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:td.pending}:e;function Aa(e,...t){const r={};return t.forEach(n=>{r[n]=e[n]}),r}var Ma=["data","status","isLoading","isSuccess","isError","error"];function Mw({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:i},unstable__sideEffectsInRender:o,createSelector:a},serializeQueryArgs:s,context:l}){const u=o?v=>v():H.useEffect,c=v=>v.current?.unsubscribe?.(),d=l.endpointDefinitions;return{buildQueryHooks:S,buildInfiniteQueryHooks:_,buildMutationHook:w,usePrefetch:g};function f(v,I,y){if(I?.endpointName&&v.isUninitialized){const{endpointName:M}=I,F=d[M];y!==ze&&s({queryArgs:I.originalArgs,endpointDefinition:F,endpointName:M})===s({queryArgs:y,endpointDefinition:F,endpointName:M})&&(I=void 0)}let T=v.isSuccess?v.data:I?.data;T===void 0&&(T=v.data);const A=T!==void 0,C=v.isLoading,N=(!I||I.isLoading||I.isUninitialized)&&!A&&C,j=v.isSuccess||A&&(C&&!I?.isError||v.isUninitialized);return{...v,data:T,currentData:v.data,isFetching:C,isLoading:N,isSuccess:j}}function m(v,I,y){if(I?.endpointName&&v.isUninitialized){const{endpointName:M}=I,F=d[M];y!==ze&&s({queryArgs:I.originalArgs,endpointDefinition:F,endpointName:M})===s({queryArgs:y,endpointDefinition:F,endpointName:M})&&(I=void 0)}let T=v.isSuccess?v.data:I?.data;T===void 0&&(T=v.data);const A=T!==void 0,C=v.isLoading,N=(!I||I.isLoading||I.isUninitialized)&&!A&&C,j=v.isSuccess||A&&(C&&!I?.isError||v.isUninitialized);return{...v,data:T,currentData:v.data,isFetching:C,isLoading:N,isSuccess:j}}function g(v,I){const y=r(),T=er(I);return(0,H.useCallback)((A,C)=>y(e.util.prefetch(v,A,{...T,...C})),[v,y,T])}function h(v,I,{refetchOnReconnect:y,refetchOnFocus:T,refetchOnMountOrArgChange:A,skip:C=!1,pollingInterval:N=0,skipPollingIfUnfocused:j=!1,...M}={}){const{initiate:F}=e.endpoints[v],D=r(),k=(0,H.useRef)(void 0);k.current||(k.current=D(e.internalActions.internal_getRTKQSubscriptions()));const L=Ta(C?ze:I),U=er({refetchOnReconnect:y,refetchOnFocus:T,pollingInterval:N,skipPollingIfUnfocused:j}),G=M.initialPageParam,W=er(G),Z=M.refetchCachedPages,ee=er(Z),K=(0,H.useRef)(void 0);let{queryCacheKey:re,requestId:X}=K.current||{},z=!1;re&&X&&(z=k.current.isRequestSubscribed(re,X));const ae=!z&&K.current!==void 0;return u(()=>{ae&&(K.current=void 0)},[ae]),u(()=>{const Q=K.current;if(L===ze){Q?.unsubscribe(),K.current=void 0;return}const Y=K.current?.subscriptionOptions;if(!Q||Q.arg!==L){Q?.unsubscribe();const et=D(F(L,{subscriptionOptions:U,forceRefetch:A,...Dd(d[v])?{initialPageParam:W,refetchCachedPages:ee}:{}}));K.current=et}else U!==Y&&Q.updateSubscriptionOptions(U)},[D,F,A,L,U,ae,W,ee,v]),[K,D,F,U]}function b(v,I){return(T,{skip:A=!1,selectFromResult:C}={})=>{const{select:N}=e.endpoints[v],j=Ta(A?ze:T),M=(0,H.useRef)(void 0),F=(0,H.useMemo)(()=>a([N(j),(U,G)=>G,U=>j],I,{memoizeOptions:{resultEqualityCheck:mr}}),[N,j]),D=(0,H.useMemo)(()=>C?a([F],C,{devModeChecks:{identityFunctionCheck:"never"}}):F,[F,C]),k=n(U=>D(U,M.current),mr),L=F(i().getState(),M.current);return Aw(()=>{M.current=L},[L]),k}}function P(v){(0,H.useEffect)(()=>()=>{c(v),v.current=void 0},[v])}function E(v){if(!v.current)throw new Error(ke(38));return v.current.refetch()}function S(v){const I=(A,C={})=>{const[N]=h(v,A,C);return P(N),(0,H.useMemo)(()=>({refetch:()=>E(N)}),[N])},y=({refetchOnReconnect:A,refetchOnFocus:C,pollingInterval:N=0,skipPollingIfUnfocused:j=!1}={})=>{const{initiate:M}=e.endpoints[v],F=r(),[D,k]=(0,H.useState)(Oa),L=(0,H.useRef)(void 0),U=er({refetchOnReconnect:A,refetchOnFocus:C,pollingInterval:N,skipPollingIfUnfocused:j});u(()=>{const ee=L.current?.subscriptionOptions;U!==ee&&L.current?.updateSubscriptionOptions(U)},[U]);const G=(0,H.useRef)(U);u(()=>{G.current=U},[U]);const W=(0,H.useCallback)(function(ee,K=!1){let re;return t(()=>{c(L),L.current=re=F(M(ee,{subscriptionOptions:G.current,forceRefetch:!K})),k(ee)}),re},[F,M]),Z=(0,H.useCallback)(()=>{L.current?.queryCacheKey&&F(e.internalActions.removeQueryResult({queryCacheKey:L.current?.queryCacheKey}))},[F]);return(0,H.useEffect)(()=>()=>{c(L)},[]),(0,H.useEffect)(()=>{D!==Oa&&!L.current&&W(D,!0)},[D,W]),(0,H.useMemo)(()=>[W,D,{reset:Z}],[W,D,Z])},T=b(v,f);return{useQueryState:T,useQuerySubscription:I,useLazyQuerySubscription:y,useLazyQuery(A){const[C,N,{reset:j}]=y(A),M=T(N,{...A,skip:N===Oa}),F=(0,H.useMemo)(()=>({lastArg:N}),[N]);return(0,H.useMemo)(()=>[C,{...M,reset:j},F],[C,M,j,F])},useQuery(A,C){const N=I(A,C),j=T(A,{selectFromResult:A===ze||C?.skip?void 0:jd,...C}),M=Aa(j,...Ma);return(0,H.useDebugValue)(M),(0,H.useMemo)(()=>({...j,...N}),[j,N])}}}function _(v){const I=(T,A={})=>{const[C,N,j,M]=h(v,T,A),F=(0,H.useRef)(M);u(()=>{F.current=M},[M]);const D=A.refetchCachedPages,k=er(D),L=(0,H.useCallback)(function(W,Z){let ee;return t(()=>{c(C),C.current=ee=N(j(W,{subscriptionOptions:F.current,direction:Z}))}),ee},[C,N,j]);P(C);const U=Ta(A.skip?ze:T),G=(0,H.useCallback)(W=>{if(!C.current)throw new Error(ke(38));const Z={refetchCachedPages:W?.refetchCachedPages??k};return C.current.refetch(Z)},[C,k]);return(0,H.useMemo)(()=>({trigger:L,refetch:G,fetchNextPage:()=>L(U,"forward"),fetchPreviousPage:()=>L(U,"backward")}),[G,L,U])},y=b(v,m);return{useInfiniteQueryState:y,useInfiniteQuerySubscription:I,useInfiniteQuery(T,A){const{refetch:C,fetchNextPage:N,fetchPreviousPage:j}=I(T,A),M=y(T,{selectFromResult:T===ze||A?.skip?void 0:jd,...A}),F=Aa(M,...Ma,"hasNextPage","hasPreviousPage");return(0,H.useDebugValue)(F),(0,H.useMemo)(()=>({...M,fetchNextPage:N,fetchPreviousPage:j,refetch:C}),[M,N,j,C])}}}function w(v){return({selectFromResult:I,fixedCacheKey:y}={})=>{const{select:T,initiate:A}=e.endpoints[v],C=r(),[N,j]=(0,H.useState)();(0,H.useEffect)(()=>()=>{N?.arg.fixedCacheKey||N?.reset()},[N]);const M=(0,H.useCallback)(function(Z){const ee=C(A(Z,{fixedCacheKey:y}));return j(ee),ee},[C,A,y]),{requestId:F}=N||{},D=(0,H.useMemo)(()=>T({fixedCacheKey:y,requestId:N?.requestId}),[y,N,T]),k=n((0,H.useMemo)(()=>I?a([D],I):D,[I,D]),mr),L=y==null?N?.arg.originalArgs:void 0,U=(0,H.useCallback)(()=>{t(()=>{N&&j(void 0),y&&C(e.internalActions.removeMutationResult({requestId:F,fixedCacheKey:y}))})},[C,y,N,F]),G=Aa(k,...Ma,"endpointName");(0,H.useDebugValue)(G);const W=(0,H.useMemo)(()=>({...k,originalArgs:L,reset:U}),[k,L,U]);return(0,H.useMemo)(()=>[M,W],[M,W])}}}var Nw=Symbol(),Rw=({batch:e=mt.unstable_batchedUpdates,hooks:t={useDispatch:tt,useSelector:gr,useStore:ve},createSelector:r=al,unstable__sideEffectsInRender:n=!1,...i}={})=>({name:Nw,init(o,{serializeQueryArgs:a},s){const l=o,{buildQueryHooks:u,buildInfiniteQueryHooks:c,buildMutationHook:d,usePrefetch:f}=Mw({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:a,context:s});return Yr(l,{usePrefetch:f}),Yr(s,{batch:e}),{injectEndpoint(m,g){if(Sw(g)){const{useQuery:h,useLazyQuery:b,useLazyQuerySubscription:P,useQueryState:E,useQuerySubscription:S}=u(m);Yr(l.endpoints[m],{useQuery:h,useLazyQuery:b,useLazyQuerySubscription:P,useQueryState:E,useQuerySubscription:S}),o[`use${pi(m)}Query`]=h,o[`useLazy${pi(m)}Query`]=b}if(Pw(g)){const h=d(m);Yr(l.endpoints[m],{useMutation:h}),o[`use${pi(m)}Mutation`]=h}else if(Dd(g)){const{useInfiniteQuery:h,useInfiniteQuerySubscription:b,useInfiniteQueryState:P}=c(m);Yr(l.endpoints[m],{useInfiniteQuery:h,useInfiniteQuerySubscription:b,useInfiniteQueryState:P}),o[`use${pi(m)}InfiniteQuery`]=h}}}}}),we=Cd(Ad(),Rw());function Na({title:e,members:t,projects_test_emails:r,inbox_email:n,ftp_settings:i,webhook:o,integrations:a,emails:s,blocks:l,...u}){const c=h=>Array.isArray(h)?h:h?[h]:[],d=h=>({ID:ge(h.ID||h)}),f=h=>c(h).map(d),m=t,g=m&&{admins:f(m.admins),users:f(m.users),viewers:f(m.viewers),invited_users:c(m.invited_users),owner:m.owner&&d(m.owner)};return{...u,title:e,acf:{members:g,webhook:o,projects_test_emails:r,inbox_email:n,ftp_settings:i,integrations:a,emails:s,blocks:l}}}function Dw(e){if(!e)return;const t=/src=['"]([^'"]+)['"]/.exec(e);return t?t[1]:void 0}function Fd(e,t){return typeof e=="number"||typeof e=="string"?{userId:ue(e),role:t}:!de(e)||e.ID==null?null:{userId:ue(e.ID),role:t,email:e.user_email||void 0,firstName:e.user_firstname||void 0,lastName:e.user_lastname||void 0,displayName:e.display_name||void 0,avatarUrl:Dw(e.user_avatar)}}function jw(e){return Array.isArray(e)?e:[]}function Ld(e){return Array.isArray(e)?e.length:0}function Xr(e){return Array.isArray(e)?e:void 0}function tr(e,t={}){const r=e.acf??{},n=de(r.members)?r.members:{},i=[],o=n.owner;if(o&&(typeof o!="object"||de(o))){const d=Fd(o,"owner");d&&i.push(d)}const a=[[n.admins,"admin"],[n.users,"user"],[n.viewers,"viewer"]];for(const[d,f]of a)for(const m of jw(d)){const g=Fd(m,f);g&&i.push(g)}const s=(Array.isArray(n.invited_users)?n.invited_users:[]).filter(d=>de(d)&&d.invited_user_email).map(d=>({email:d.invited_user_email})),l=t.currentUserId!=null?ue(t.currentUserId):void 0,u=l?i.find(d=>d.userId===l)?.role??"":"",c=e;return{id:ue(e.id),name:He(e.title)||"",myRole:u,members:i,invites:s,emailsCount:Ld(r.emails),blocksCount:Ld(r.blocks),createdAt:c.date_gmt||void 0,updatedAt:c.modified_gmt||void 0,inboxEmail:r.inbox_email||void 0,title:He(e.title)||"",ftp_settings:de(r.ftp_settings)?r.ftp_settings:void 0,projects_test_emails:Array.isArray(r.projects_test_emails)?r.projects_test_emails:void 0,folder:Xr(c.folder),group:Xr(c.group),blockfolder:Xr(c.blockfolder),emailtags:Xr(c.emailtags),blocktags:Xr(c.blocktags),limits:de(c.limits)?c.limits:void 0}}var Fw=["owner","admin","user","viewer"],Lw=["admin","user","viewer"];function kd(e){return Fw.includes(e)?e:""}function kw(e){return Lw.includes(e)?e:void 0}function Uw(e){return{userId:e.user_id||"",role:kd(e.role),email:e.email||void 0,firstName:e.first_name||void 0,lastName:e.last_name||void 0,displayName:e.display_name||void 0,avatarUrl:e.avatar_url||void 0,lastLogin:e.last_login||void 0,joinedAt:e.joined_at||void 0}}function Bw(e){return{email:e.email,role:kw(e.role),invitedAt:e.invited_at||void 0}}function $w(e){if(e)return{slug:e.slug||"",name:e.name||"",isPaid:e.is_paid===!0}}function Jr(e){return{id:e.wp_id!=null?String(e.wp_id):e.id??"",name:e.name||"",myRole:kd(e.my_role),members:(e.members??[]).map(Uw),invites:(e.invites??[]).filter(t=>!!t.email).map(Bw),emailsCount:e.emails_count??0,blocksCount:e.blocks_count??0,createdAt:e.created_at||void 0,updatedAt:e.updated_at||void 0,inboxEmail:e.inbox_email||void 0,ownerPlan:$w(e.owner_plan),title:e.name||""}}function xw(e,t){const r=e.members??[],n=e.invites??[],i=(a,s)=>String(a.userId)===String(s),o=(a,s)=>String(a.email).trim().toLowerCase()===String(s).trim().toLowerCase();switch(t.kind){case"changeRole":return{members:r.map(a=>i(a,t.userId)?{...a,role:t.role}:a),invites:n};case"removeMember":return{members:r.filter(a=>!i(a,t.userId)),invites:n};case"revokeInvite":return{members:r,invites:n.filter(a=>!o(a,t.email))};case"restoreMember":return{members:r.some(a=>i(a,t.userId))?r:[...r,{userId:String(t.userId),role:t.role}],invites:n};case"restoreInvite":return{members:r,invites:n.some(a=>o(a,t.email))?n:[...n,{email:t.email}]};default:return{members:r,invites:n}}}function qw(e,t){const r=i=>e.filter(o=>o.role===i).map(o=>o.userId),n=e.find(i=>i.role==="owner");return{...n?{owner:{ID:n.userId}}:{},admins:r("admin"),users:r("user"),viewers:r("viewer"),invited_users:t.map(i=>({invited_user_email:i.email}))}}function Ra(e){try{const t=localStorage.getItem(e);if(t==="true")return!0;if(t==="false")return!1}catch{}}function De(){return Ra(Ft.em_projects_v2)??!0}var Ie="Projects",Zr="LIST",Da=12;function rr(e){return{error:gw(e)}}function en(e){const t=ei(fi(e)).profile?.id;return t!=null&&t!==""?String(t):void 0}function Gw(e){switch(e){case"modified":return"updated_at";case"title":return"name";case"author":return"owner";case"emails":return"emails";case"blocks":return"blocks";case"members_count":return"members";case"date":case void 0:return"created_at";default:return"created_at"}}function Hw(e){const t=Math.max(1,e.per_page??Da),r={limit:t,offset:(Math.max(1,e.page??1)-1)*t};return e.search&&(r.search=e.search),e.orderby&&(r.order_by=Gw(e.orderby)),(e.order==="asc"||e.order==="desc")&&(r.order=e.order),r}function zw(e){if(Array.isArray(e))return e;if(e!=null&&typeof e=="object"){const t=e.projects;if(Array.isArray(t))return t}return[]}function Vw(e){if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.trunc(e);if(typeof e=="string"&&e.trim()!==""){const t=parseInt(e,10);if(Number.isFinite(t)&&t>=0)return t}}function Ud(e){const t={id:"",name:"",title:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0};if(e==null||typeof e!="object"||Array.isArray(e))return t;const r=e,n=Vw(r.emails_count);return{...t,id:r.id!=null?String(r.id):"",name:typeof r.title=="string"?r.title:"",title:typeof r.title=="string"?r.title:"",emailsCount:n??0}}function Ww(e,t,r){const n=e.headers?.get?.("X-WP-Total"),i=e.headers?.get?.("X-WP-TotalPages"),o=n!=null&&n!==""?parseInt(String(n),10):NaN,a=i!=null&&i!==""?parseInt(String(i),10):NaN,s=Math.max(1,t.per_page??Da),l=Number.isFinite(a)?a:Number.isFinite(o)?Math.max(1,Math.ceil(o/s)):NaN,u=Math.max(1,t.page??1),c=s;let d=o,f=l;return Number.isFinite(d)?Number.isFinite(f)||(f=Math.max(1,Math.ceil(d/c))):u===1?r===0?(d=0,f=1):r<c?(d=r,f=1):(d=r+1,f=2):r===0?(d=Math.max(0,(u-1)*c),f=Math.max(1,u-1)):r<c?(d=(u-1)*c+r,f=u):(d=u*c+1,f=u+1),{total:d,totalPages:f}}var nr=we({reducerPath:"projectsApi",tagTypes:[Ie,"project"],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getProjects:e.query({async queryFn(t={page:1},r){if(De()){const a=await Xe(r).projects.projectsList(Hw(t));if(!a.ok||a.error)return rr(a);const s=(a.data?.data??[]).map(Jr),l=Math.max(1,t.per_page??Da),u=a.data?.page?.total??s.length;return{data:s,meta:{projectsListPagination:{total:u,totalPages:Math.max(1,Math.ceil(u/l))}}}}const n=x(r),i=en(r),o={status:["private"]};return t.page&&(o.page=t.page),t.order&&(o.order=t.order),t.orderby&&(o.orderby=t.orderby),t.search&&(o.search=t.search),t.after&&(o.after=t.after),t.before&&(o.before=t.before),t.per_page!=null&&(o.per_page=t.per_page),n.wp.project_list(o).then(a=>{const s=Ne(l=>tr(l,{currentUserId:i}))(a);return s.error?{error:s.error}:{data:s.data,meta:{projectsListPagination:Ww(a,t,s.data.length)}}})},providesTags:t=>t?[...t.map(({id:r})=>({type:Ie,id:r})),{type:Ie,id:Zr}]:[{type:Ie,id:Zr}]}),getProject:e.query({async queryFn(t,r){if(De()){const o=await hP(fi(r),String(t));if(o)return{data:o};const a=await Xe(r).projects.projectsDetail({id:String(t)});return!a.ok||a.error?rr(a):{data:Jr(a.data)}}const n=x(r),i=en(r);return n.wp.project_detail({id:Number(t)},{extraQuery:{_embed:"wp:term"}}).then(he(o=>tr(o,{currentUserId:i})))},providesTags:(t,r,n)=>[{type:"project",id:n}]}),addProject:e.mutation({async queryFn(t,r){if(De()){const o=await Xe(r).projects.projectsCreate({name:t.title});return!o.ok||o.error?rr(o):{data:Jr(o.data)}}const n=x(r),i=en(r);return n.wp.project_create({status:"private",...Na(t)},{type:O.ContentType.Json}).then(he(o=>tr(o,{currentUserId:i})))},invalidatesTags:[{type:Ie,id:Zr}]}),editProject:e.mutation({async queryFn({projectId:t,...r},n){const i=Object.keys(r).filter(l=>l!=="title");if(De()&&i.length===0&&r.title!=null){const l=await Xe(n).projects.projectsPartialUpdate({id:String(t)},{name:r.title});return!l.ok||l.error?rr(l):{data:Jr(l.data)}}const o=x(n),a=en(n),s=ut(Na(r),!0);return o.wp.project_partial_update({id:Number(t)},s,{type:O.ContentType.Json}).then(he(l=>tr(l,{currentUserId:a})))},invalidatesTags:(t,r,{projectId:n})=>[{type:Ie,id:n},{type:"project",id:n}]}),deleteProject:e.mutation({async queryFn(t,r){if(De()){const n=await Xe(r).projects.projectsDelete({id:String(t)});return!n.ok||n.error?rr(n):{data:{...Ud(null),id:String(t)}}}return x(r).wp.project_delete({id:Number(t)},{}).then(Gn(n=>tr(n)))},invalidatesTags:(t,r,n)=>[{type:Ie,id:n},{type:"project",id:n},{type:Ie,id:Zr}]}),mutateProjectMembers:e.mutation({async queryFn({project:t,action:r},n){const i=t.id;if(De()){const u=Xe(n),c=String(i);switch(r.kind){case"changeRole":{const d=await u.projects.membersPartialUpdate({id:c,userId:String(r.userId)},{role:r.role});return Ye(d)}case"removeMember":{const d=r.isSelf&&t.myRole!=="owner"?await u.projects.membersMeDelete({id:c}):await u.projects.membersDelete({id:c,userId:String(r.userId)});return Ye(d)}case"revokeInvite":{const d=await u.projects.invitesDelete({id:c,email:r.email});return Ye(d)}case"restoreMember":{const d=r.email??t.members.find(m=>String(m.userId)===String(r.userId))?.email;if(!d)return{error:{status:400,data:{message:"member email is unknown"}}};const f=await u.projects.membersCreate({id:c},{email:d,role:r.role==="admin"?"admin":"user"});return Ye(f)}case"restoreInvite":{const d=await u.projects.membersCreate({id:c},{email:r.email,role:"user"});return Ye(d)}default:return{data:void 0}}}const o=xw(t,r),a=x(n),s=ut(Na({members:qw(o.members,o.invites)}),!0),l=await a.wp.project_partial_update({id:Number(t.id)},s,{type:O.ContentType.Json});return{error:l.error,data:l.data}},invalidatesTags:(t,r,{project:n})=>[{type:Ie,id:n.id},{type:"project",id:n.id}]}),addProjectMember:e.mutation({async queryFn({project:t,email:r,role:n},i){if(De()){const a=await Xe(i).projects.membersCreate({id:String(t.id)},{email:r,role:n??"user"});return Ye(a)}const o=await x(i).userToProject.add_user_create({email:r,project_id:String(t.id),...n?{role:n}:{}},{type:O.ContentType.FormData});return{error:o.error,data:o.data}},invalidatesTags:(t,r,{project:n})=>[{type:Ie,id:n.id},{type:Ie,id:Zr},{type:"project",id:n.id}]}),getFrequentProjects:e.query({async queryFn(t,r){const n=typeof t=="number"&&t>0?t:5;if(De()){const a=await Xe(r).projects.topUsedList({limit:n});return!a.ok||a.error?rr(a):{data:(a.data??[]).map(Jr)}}const i=x(r),o=en(r);try{const a=await i.projects.top_used_list({limit:n});if(!a.ok||a.error)throw a.error??new Error("top-used request failed");const s=zw(a.data);return Ne(Ud)({data:s,error:a.error,meta:a.meta})}catch{const a=await i.wp.project_list({per_page:n,order:"desc",orderby:"modified",status:["private"]});return Ne(s=>tr(s,{currentUserId:o}))({data:a.data,error:a.error,meta:a.meta})}},providesTags:t=>t&&t.length>0?[...t.map(({id:r})=>({type:Ie,id:r})),{type:Ie,id:"FREQUENT"}]:[{type:Ie,id:"FREQUENT"}]})})});function Qw(){const e=tt();return(0,R.useCallback)(t=>{t==null||t===""||e(nr.util.invalidateTags([{type:"project",id:t}]))},[e])}var{useGetProjectsQuery:tj,useGetProjectQuery:Kw,useAddProjectMutation:rj,useEditProjectMutation:Yw,useGetFrequentProjectsQuery:nj,useMutateProjectMembersMutation:ij,useAddProjectMemberMutation:oj}=nr,Xw=class extends Error{kind;failed;constructor(e,t){super(`не удалось завести термы (${e}): ${t.map(({name:r})=>r).join(", ")}`),this.name="TermsFailedError",this.kind=e,this.failed=t}};function Jw(e){return e instanceof Xw?e:void 0}function Bd(e){return e?.data?.term_id}function Zw(e){const t=e;return Bd(t?.data)??Bd(t)}var eI="Taxonomies",tI={folder:"folders",group:"groups",blockfolder:"blockFolders",emailtags:"emailTags",blocktags:"blockTags"};function ja(e,t){return t??e.getState?.()?.projectSlice?.project}function hi(e,t){return{error:t??{status:400,data:{message:e}}}}function $d(e,t){return e?.[t]?.[0]}function rI(e){return e?.data?.term_id}async function nI(e,t,r){const n=$d(t,r);if(n)return{rootId:n};const i=await x(e).wp[`${r}_create`]({name:`project_${t.id}`}),o=i?.data?.id??rI(i?.error);return o==null?{error:i?.error}:(await e.dispatch(nr.endpoints.editProject.initiate({projectId:t.id,[r]:[o]})),{rootId:o})}function mi(e){return{id:e.id,name:e.name,parent:e.parent_id??0,count:e.count??0,count_template:e.template_count??0,children:(e.children??[]).map(mi)}}function gi(e,t){return{client:Xe(e),resource:tI[t]}}var yi=we({reducerPath:"taxonomiesApi",tagTypes:[eI,"folder","block_folder","Group"],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getTerms:e.query({async queryFn({project:t,kind:r,parent:n},i){if(De()){const{client:s,resource:l}=gi(i,r),u=await s.projects[`${l}List`]({id:String(t.id),...n?{parent_id:n}:{}});return!u.ok||u.error?{error:u.error}:{data:(u.data??[]).map(mi)}}const o=x(i),a=n??$d(t,r);return a==null?{data:[]}:o.wp[`${r}_list`]({per_page:100,parent:a})},serializeQueryArgs:({endpointName:t,queryArgs:r})=>`${t}(${r?.project?.id}:${r?.kind}:${r?.parent??"root"})`,providesTags:(t,r,{kind:n,parent:i})=>[{type:"folder",id:n},{type:"folder",id:`${n}:${i??"root"}`}]}),addTerm:e.mutation({async queryFn({project:t,kind:r,name:n,parent:i},o){const a=ja(o,t);if(!a?.id)return hi("project is unknown");if(De()){const{client:u,resource:c}=gi(o,r),d=await u.projects[`${c}Create`]({id:String(a.id)},{name:n,...i?{parent_id:i}:{}});return!d.ok||d.error?{error:d.error}:{data:mi(d.data)}}const s=x(o);let l=i;if(l==null){const u=await nI(o,a,r);if(u.rootId==null)return hi("root term was not created",u.error);l=u.rootId}return s.wp[`${r}_create`]({name:n,parent:l})},invalidatesTags:(t,r,{kind:n})=>[{type:"folder",id:n}]}),editTerm:e.mutation({async queryFn({project:t,kind:r,id:n,name:i},o){const a=ja(o,t);if(!a?.id)return hi("project is unknown");if(De()){const{client:s,resource:l}=gi(o,r),u=await s.projects[`${l}PartialUpdate`]({id:String(a.id),termId:Number(n)},{name:i});return!u.ok||u.error?{error:u.error}:{data:mi(u.data)}}return x(o).wp[`${r}_partial_update`]({id:n},{name:i})},invalidatesTags:(t,r,{kind:n})=>[{type:"folder",id:n}]}),getStandardGroups:e.query({queryFn(t,r){return x(r).wp.group_list({per_page:100})}}),deleteTerm:e.mutation({async queryFn({project:t,kind:r,id:n},i){const o=ja(i,t);if(!o?.id)return hi("project is unknown");if(De()){const{client:s,resource:l}=gi(i,r),u=await s.projects[`${l}Delete`]({id:String(o.id),termId:Number(n)}),c=Ye(u);return"error"in c?c:{data:{deleted:!0}}}const a=await x(i).wp[`${r}_delete`]({id:n},{force:!0});return a.error?{error:a.error}:{data:{deleted:!0}}},invalidatesTags:(t,r,{kind:n})=>[{type:"folder",id:n}]})})});function iI(){const e=tt();return(0,R.useCallback)(t=>{e(yi.util.invalidateTags([{type:"folder",id:t}]))},[e])}var{useGetTermsQuery:oI,useGetStandardGroupsQuery:aj,useLazyGetTermsQuery:sj,useAddTermMutation:aI,useEditTermMutation:sI,useDeleteTermMutation:uI}=yi,xd=new URLSearchParams(window.location.search),qd=xd.get("tag"),lI=xd.get("folder"),cI={activeModal:"",switchToPlanRequestTitle:"",secondModal:"",projectsTotal:"",projectsTotalPages:"",folders:[],activeTagId:qd||null,activeFolderId:lI||(qd?null:"all"),activeIntegration:null,addNewProjectInitialTitle:null},Fa="projectsPageSlice",Gd=Pe({name:Fa,initialState:cI,reducers:{openModal(e,t){e.activeModal=t.payload},openAddNewProjectModal(e,t){e.activeModal=me.ADD_NEW_PROJECT_MODAL,e.addNewProjectInitialTitle=t.payload??null},setSwitchToPlanRequestTitle(e,t){e.switchToPlanRequestTitle=typeof t.payload=="string"?t.payload:""},closeModal(e){e.activeModal="",e.activeIntegration=null,e.addNewProjectInitialTitle=null,e.switchToPlanRequestTitle=""},openSecondModal(e,t){e.secondModal=t.payload},closeSecondModal(e){e.secondModal=""},setFolders(e,{payload:t}){e.folders=t},setActiveTagId(e,{payload:t}){e.activeTagId=t},setActiveIntegration(e,t){e.activeIntegration=t.payload}},extraReducers:e=>{e.addMatcher(nr.endpoints.getProjects.matchFulfilled,(t,r)=>{const n=r.meta,i=n.baseQueryMeta,o=n.projectsListPagination??i?.projectsListPagination;if(o!=null&&typeof o.total=="number"&&Number.isFinite(o.total)&&o.total>=0){t.projectsTotal=String(o.total),t.projectsTotalPages=String(typeof o.totalPages=="number"&&Number.isFinite(o.totalPages)?o.totalPages:"");return}const a=i?.response?.headers?.get?.("X-WP-Total"),s=i?.response?.headers?.get?.("X-WP-TotalPages");t.projectsTotal=a??"",t.projectsTotalPages=s??""}),e.addMatcher(yi.endpoints.getTerms.matchFulfilled,(t,{meta:r,payload:n})=>{const i=r.arg.originalArgs?.kind;(i==="folder"||i==="blockfolder")&&(t.folders=n)})}}),{openModal:Hd,openAddNewProjectModal:uj,setSwitchToPlanRequestTitle:lj,closeModal:dI,openSecondModal:fI,closeSecondModal:pI,setFolders:cj,setActiveTagId:dj,setActiveIntegration:fj}=Gd.actions,zd=e=>e[Fa].activeModal,hI=e=>e[Fa].secondModal,Vd=(0,R.createContext)(null),mI=e=>e.includes("UPLOAD_IMAGE_")||e.includes("UPLOAD_BACKGROUND_"),gI=({children:e})=>{const t=tt(),r=gr(zd),[n,i]=(0,R.useState)(null),o=(0,R.useRef)(null),a=(0,R.useCallback)(u=>{o.current?.(u),o.current=null},[]),s=(0,R.useCallback)(u=>(a(null),i(u),t(Hd(u.entryModal)),new Promise(c=>{o.current=c})),[t,a]);(0,R.useEffect)(()=>{mI(r)||(i(null),o.current&&a(null))},[r,a]);const l=(0,R.useMemo)(()=>({request:n,openImagePicker:s,resolveImagePicker:a}),[n,s,a]);return(0,$.jsx)(Vd.Provider,{value:l,children:e})},yI=()=>{const e=(0,R.useContext)(Vd);if(!e)throw new Error("useImagePicker must be used within ImagePickerProvider");return e},Wd=tt,vI=typeof Wd?.withTypes=="function"?Wd.withTypes():tt,Qd=gr,pj=typeof Qd?.withTypes=="function"?Qd.withTypes():gr,Kd=ve,Yd=typeof Kd?.withTypes=="function"?Kd.withTypes():ve;function vi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)n!=="__proto__"&&(e[n]=r[n])}return e}var _I={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function La(e,t){function r(i,o,a){if(!(typeof document>"u")){a=vi({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in a)a[l]&&(s+="; "+l,a[l]!==!0&&(s+="="+a[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var l=o[s].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(c in a||(a[c]=e.read(u,c)),i===c)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",vi({},o,{expires:-1}))},withAttributes:function(i){return La(this.converter,vi({},this.attributes,i))},withConverter:function(i){return La(vi({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Xd=La(_I,{path:"/"}),bI=["is_paying","is_paying_user","paying","paying_user"];function ka(e){if(!e||typeof e!="object")return!1;const t=e;for(const r of bI){const n=t[r];if(n===!0||n===1||n==="1"||typeof n=="string"&&n.trim().toLowerCase()==="true")return!0}return!1}function _i(e){if(e===void 0)return;if(e===null||e==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}function EI(e){if(!e)return!1;const t=e,r=t.trial_enabled??t.trial??t.is_get_trial;return r===!0||r===1||r==="1"||typeof r=="string"&&r.toLowerCase()==="true"}function bi(e){const t=e.acf??{},{autosaves:r,hide_mergetags:n,theme:i,newsletter_consent:o,code_editor:a,counters:s,subscription:l,subscription_end:u,recurring_payments:c,subscription_id:d,promocode:f,subscription_amount:m,enterprise_users_limit:g,enterprise_price:h,enterprise_12_price:b,privacy_policy_agreement:P,last_used_project:E,email_confirmation:S,email_builder_config:_}=t,{id:w,acf:v,...I}=e,y=EI(t),T=s??{},A=ka(t)||ka(I)||ka(e.meta);return{...I,id:ue(w),username:I.username||"",email:I.email||"",password:I.password||"",trial_enabled:y,is_paying:A,autosaves:r,hide_mergetags:n,theme:i,newsletter_consent:o,code_editor:a?{...a,font_size:Number(a.font_size)}:void 0,counters:Object.keys(T).reduce((C,N)=>(C[N]=Number(T[N]),C),{}),subscription:l,subscription_end:u,recurring_payments:c,subscription_id:d,promocode:f,subscription_amount:_i(m),enterprise_users_limit:_i(g),enterprise_price:_i(h),enterprise_12_price:_i(b),privacy_policy_agreement:P,last_used_project:E,email_confirmation:S,email_builder_config:_}}function SI({autosaves:e,theme:t,newsletter_consent:r,code_editor:n,counters:i,subscription:o,subscription_end:a,recurring_payments:s,subscription_id:l,promocode:u,subscription_amount:c,enterprise_users_limit:d,enterprise_price:f,enterprise_12_price:m,privacy_policy_agreement:g,locale:h,last_used_project:b,email_confirmation:P,email_builder_config:E,trial_enabled:S,is_paying:_,id:w,...v}){return{...v,id:ge(w),locale:h,acf:{autosaves:e,theme:t,newsletter_consent:r,code_editor:n?{...n,font_size:String(n.font_size)}:void 0,counters:i,subscription:o,subscription_end:a,recurring_payments:s,subscription_id:l,promocode:u,subscription_amount:c,enterprise_users_limit:d,enterprise_price:f,enterprise_12_price:m,privacy_policy_agreement:g,last_used_project:b,email_confirmation:P,email_builder_config:E,...S!==void 0?{trial_enabled:S}:{},..._!==void 0?{is_paying:_}:{}}}}function PI({title:e,acf:t,...r}){const{limits:n,price:i}=t??{limits:{}},o=t?.features;return{...r,title:He(e)||"",limits:n,price:i,features:o}}function wI(){const e="https://app.emailmaker.ru/api/v2".replace(/\/+$/u,""),t=typeof window<"u"?window.location.origin:"";return{url:`${e.startsWith("http")?e:`${t}${e}`}/auth/user`,method:"GET"}}var Ei=we({reducerPath:"authorizationApi",baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/",prepareHeaders:e=>{const t=Xd.get(Ao.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({getMailConfirmation:e.query({queryFn(t,r){return x(r).wp.confirmation_list({...t})}}),getSchema:e.query({queryFn(t,r){return x(r).wp.users_me_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema"}})}}),getMe:e.query({async queryFn(t,r,n,i){const o=await nP(fi(r));if(o)return{data:o};const a=await i(wI());if(a.error)return{error:a.error};const s=a.data,l=Array.isArray(s)?s[0]:s;return{data:bi(l)}}}),getUser:e.query({queryFn(t,r){return x(r).wp.users_detail({id:t}).then(he(bi))}}),editMe:e.mutation({queryFn(t,r){const n=x(r),i=ut(SI(t),!0);return n.wp.users_me_create(i,{type:O.ContentType.Json}).then(he(bi))}}),getSubscriptions:e.query({queryFn(t,r){return x(r).wp.subscription_list(void 0).then(Ne(PI))}}),activateTrial:e.mutation({query:t=>({url:`${"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}/wp-json/subscription/v2/activate_trial`,method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}})})})}),{useGetMeQuery:hj,useLazyGetMeQuery:Jd,useEditMeMutation:II,useLazyGetSchemaQuery:mj,useGetSubscriptionsQuery:Zd,useLazyGetMailConfirmationQuery:gj,useActivateTrialMutation:CI}=Ei;function OI(e,t){var r=0,n,i;t=t||{};function o(){var a=n,s=arguments.length,l,u;e:for(;a;){if(a.args.length!==arguments.length){a=a.next;continue}for(u=0;u<s;u++)if(a.args[u]!==arguments[u]){a=a.next;continue e}return a!==n&&(a===i&&(i=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n,a.prev=null,n.prev=a,n=a),a.val}for(l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];return a={args:l,val:e.apply(null,l)},n?(n.prev=a,a.next=n):i=a,r===t.maxSize?(i=i.prev,i.next=null):r++,n=a,a.val}return o.clear=function(){n=null,i=null,r=0},o}var TI=q.__commonJSMin((e=>{(function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(s){return i(a(s),arguments)}function n(s,l){return r.apply(null,[s].concat(l||[]))}function i(s,l){for(var u=1,c=s.length,d,f="",m=0,g,h,b,P,E,S,_;m<c;m++)if(typeof s[m]=="string")f+=s[m];else if(typeof s[m]=="object"){if(h=s[m],h.keys)for(d=l[u],g=0;g<h.keys.length;g++){if(d==null)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',h.keys[g],h.keys[g-1]));d=d[h.keys[g]]}else h.param_no?d=l[h.param_no]:d=l[u++];if(t.not_type.test(h.type)&&t.not_primitive.test(h.type)&&d instanceof Function&&(d=d()),t.numeric_arg.test(h.type)&&typeof d!="number"&&isNaN(d))throw new TypeError(r("[sprintf] expecting number but found %T",d));switch(t.number.test(h.type)&&(S=d>=0),h.type){case"b":d=parseInt(d,10).toString(2);break;case"c":d=String.fromCharCode(parseInt(d,10));break;case"d":case"i":d=parseInt(d,10);break;case"j":d=JSON.stringify(d,null,h.width?parseInt(h.width):0);break;case"e":d=h.precision?parseFloat(d).toExponential(h.precision):parseFloat(d).toExponential();break;case"f":d=h.precision?parseFloat(d).toFixed(h.precision):parseFloat(d);break;case"g":d=h.precision?String(Number(d.toPrecision(h.precision))):parseFloat(d);break;case"o":d=(parseInt(d,10)>>>0).toString(8);break;case"s":d=String(d),d=h.precision?d.substring(0,h.precision):d;break;case"t":d=String(!!d),d=h.precision?d.substring(0,h.precision):d;break;case"T":d=Object.prototype.toString.call(d).slice(8,-1).toLowerCase(),d=h.precision?d.substring(0,h.precision):d;break;case"u":d=parseInt(d,10)>>>0;break;case"v":d=d.valueOf(),d=h.precision?d.substring(0,h.precision):d;break;case"x":d=(parseInt(d,10)>>>0).toString(16);break;case"X":d=(parseInt(d,10)>>>0).toString(16).toUpperCase()}t.json.test(h.type)?f+=d:(t.number.test(h.type)&&(!S||h.sign)?(_=S?"+":"-",d=d.toString().replace(t.sign,"")):_="",P=h.pad_char?h.pad_char==="0"?"0":h.pad_char.charAt(1):" ",E=h.width-(_+d).length,b=h.width&&E>0?P.repeat(E):"",f+=h.align?_+d+b:P==="0"?_+b+d:b+_+d)}return f}var o=Object.create(null);function a(s){if(o[s])return o[s];for(var l=s,u,c=[],d=0;l;){if((u=t.text.exec(l))!==null)c.push(u[0]);else if((u=t.modulo.exec(l))!==null)c.push("%");else if((u=t.placeholder.exec(l))!==null){if(u[2]){d|=1;var f=[],m=u[2],g=[];if((g=t.key.exec(m))!==null)for(f.push(g[1]);(m=m.substring(g[0].length))!=="";)if((g=t.key_access.exec(m))!==null)f.push(g[1]);else if((g=t.index_access.exec(m))!==null)f.push(g[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");u[2]=f}else d|=2;if(d===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:u[0],param_no:u[1],keys:u[2],sign:u[3],pad_char:u[4],align:u[5],width:u[6],precision:u[7],type:u[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");l=l.substring(u[0].length)}return o[s]=c}typeof e<"u"&&(e.sprintf=r,e.vsprintf=n),typeof window<"u"&&(window.sprintf=r,window.vsprintf=n,typeof define=="function"&&define.amd&&define(function(){return{sprintf:r,vsprintf:n}}))})()})),AI=q.__toESM(TI()),MI=OI(console.error);function NI(e,...t){try{return AI.sprintf(e,...t)}catch(r){return r instanceof Error&&MI(`sprintf error:
|
|
57
|
-
|
|
58
|
-
`+r.toString()),e}}var ef={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},RI=["(","?"],Si={")":["("],":":["?","?:"]},DI=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function jI(e){for(var t=[],r=[],n,i,o,a;n=e.match(DI);){for(i=n[0],o=e.substr(0,n.index).trim(),o&&t.push(o);a=r.pop();){if(Si[i]){if(Si[i][0]===a){i=Si[i][1]||i;break}}else if(RI.indexOf(a)>=0||ef[a]<ef[i]){r.push(a);break}t.push(a)}Si[i]||r.push(i),e=e.substr(n.index+i.length)}return e=e.trim(),e&&t.push(e),t.concat(r.reverse())}var FI={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,r){if(e)throw t;return r}};function LI(e,t){for(var r=[],n=0,i,o,a,s,l;n<e.length;n++){if(s=e[n],a=FI[s],a){for(i=a.length,o=Array(i);i--;)o[i]=r.pop();try{l=a.apply(null,o)}catch(u){return u}}else t.hasOwnProperty(s)?l=t[s]:l=+s;r.push(l)}return r[0]}function kI(e){var t=jI(e);return function(r){return LI(t,r)}}function UI(e){var t=kI(e);return function(r){return+t({n:r})}}var tf={contextDelimiter:"",onMissingKey:null};function BI(e){for(var t=e.split(";"),r=0,n;r<t.length;r++)if(n=t[r].trim(),n.indexOf("plural=")===0)return n.substr(7)}function Ua(e,t){var r;this.data=e,this.pluralForms={},this.options={};for(r in tf)this.options[r]=t!==void 0&&r in t?t[r]:tf[r]}Ua.prototype.getPluralForm=function(e,t){var r=this.pluralForms[e],n,i,o;return r||(n=this.data[e][""],o=n["Plural-Forms"]||n["plural-forms"]||n.plural_forms,typeof o!="function"&&(i=BI(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),o=UI(i)),r=this.pluralForms[e]=o),r(t)},Ua.prototype.dcnpgettext=function(e,t,r,n,i){var o,a,s;return i===void 0?o=0:o=this.getPluralForm(e,i),a=r,t&&(a=t+this.options.contextDelimiter+r),s=this.data[e][a],s&&s[o]?s[o]:(this.options.onMissingKey&&this.options.onMissingKey(r,e),o===0?r:n)};var rf={"":{plural_forms(e){return e===1?0:1}}},$I=/^i18n\.(n?gettext|has_translation)(_|$)/,Ba=(e,t,r)=>{const n=new Ua({}),i=new Set,o=()=>{i.forEach(_=>_())},a=_=>(i.add(_),()=>i.delete(_)),s=(_="default")=>n.data[_],l=(_,w="default")=>{n.data[w]={...n.data[w],..._},n.data[w][""]={...rf[""],...n.data[w]?.[""]},delete n.pluralForms[w]},u=(_,w)=>{l(_,w),o()},c=(_,w="default")=>{n.data[w]={...n.data[w],..._,"":{...rf[""],...n.data[w]?.[""],..._?.[""]}},delete n.pluralForms[w],o()},d=(_,w)=>{n.data={},n.pluralForms={},u(_,w)},f=(_="default",w,v,I,y)=>(n.data[_]||l(void 0,_),n.dcnpgettext(_,w,v,I,y)),m=(_="default")=>_,g=(_,w)=>{let v=f(w,void 0,_);return r?(v=r.applyFilters("i18n.gettext",v,_,w),r.applyFilters("i18n.gettext_"+m(w),v,_,w)):v},h=(_,w,v)=>{let I=f(v,w,_);return r?(I=r.applyFilters("i18n.gettext_with_context",I,_,w,v),r.applyFilters("i18n.gettext_with_context_"+m(v),I,_,w,v)):I},b=(_,w,v,I)=>{let y=f(I,void 0,_,w,v);return r?(y=r.applyFilters("i18n.ngettext",y,_,w,v,I),r.applyFilters("i18n.ngettext_"+m(I),y,_,w,v,I)):y},P=(_,w,v,I,y)=>{let T=f(y,I,_,w,v);return r?(T=r.applyFilters("i18n.ngettext_with_context",T,_,w,v,I,y),r.applyFilters("i18n.ngettext_with_context_"+m(y),T,_,w,v,I,y)):T},E=()=>h("ltr","text direction")==="rtl",S=(_,w,v)=>{const I=w?w+""+_:_;let y=!!n.data?.[v??"default"]?.[I];return r&&(y=r.applyFilters("i18n.has_translation",y,_,w,v),y=r.applyFilters("i18n.has_translation_"+m(v),y,_,w,v)),y};if(e&&u(e,t),r){const _=w=>{$I.test(w)&&o()};r.addAction("hookAdded","core/i18n",_),r.addAction("hookRemoved","core/i18n",_)}return{getLocaleData:s,setLocaleData:u,addLocaleData:c,resetLocaleData:d,subscribe:a,__:g,_x:h,_n:b,_nx:P,isRTL:E,hasTranslation:S}},xI={ru_RU:{"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"All plan features":["Все преимущества тарифов"],Free:["Free"],Personal:["Персональный"],Advanced:["Продвинутый"],"Advanced+":["Продвинутый+"],Pro:["Профессиональный"],"Pro+":["Профессиональный+"],Enterprise:["Корпоративный"],"Projects and emails":["Проекты и письма"],"Email editor":["Редактор писем"],"Additional features":["Дополнительные функции"],"Team collaboration":["Командная работа"],Support:["Поддержка"],Projects:["Проекты"],"Saved email templates":["Сохранённые шаблоны писем"],"Saved blocks":["Сохранённые блоки"],"Exports per month":["Экспорты в месяц"],"Export to HTML, ZIP and clipboard":["Экспорт в HTML, ZIP и буфер обмена"],"Export to PDF":["Экспорт в PDF"],"Export to PNG":["Экспорт в PNG"],"Export to webhook":["Экспорт в вебхук"],"Template import":["Импорт шаблона"],"Test emails":["Отправка тестовых писем"],"Preview mode":["Предпросмотр письма"],"Undo and redo":["Отмена и повтор действий"],"Export to Outlook":["Экспорт в Outlook"],"Email client tests":["Тесты в почтовиках"],"Block visibility control":["Управление видимостью блоков"],"Border control":["Управление рамками"],"Corner radius control":["Управление скруглением"],"Shadow control":["Управление тенью"],"Convert block to image":["Преобразование блока в изображение"],Typographer:["Типограф"],"Variables support":["Работа с переменными"],"Timer element":["Элемент «Таймер»"],"Video element":["Элемент «Видео»"],"AMP elements":["AMP элементы"],"AI image element":["Элемент «AI картинка»"],"AI image generation":["AI генерация изображений"],"Stock images and GIFs":["Стоковые изображения и GIF"],"Image editor":["Редактор изображений"],"AMP support":["Поддержка AMP"],"HTML code editing":["Правка HTML кода"],"Mobile adaptation":["Адаптация под мобильные устройства"],"Mobile element properties editor":["Редактор свойств элементов для мобильных"],"AI Assistant":["AI Ассистент"],"Link and image checks":["Проверка ссылок и изображений"],"Saved version history":["История сохранённых версий"],Users:["Пользователи"],"Template discussion":["Обсуждение шаблонов"],"User roles and access levels":["Роли пользователей и уровни доступа"],Chat:["Чат"],"Email support":["Электронная почта"],"Phone support":["Телефон"],"Video call":["Видеосозвон"],"Invoice payment and document flow":["Оплата по счёту, документооборот"],"Failed to load plan data":["Не удалось загрузить данные тарифа"],"Editor features depend on your plan. Check your connection and try again.":["Возможности редактора зависят от тарифа. Проверьте соединение и повторите попытку."],"Try again":["Повторить"]}};function qI(e,t){const r=t?xI[t]:void 0;return r&&e.setLocaleData(r),e}var GI={items_per_page:"/ стр.",jump_to:"Перейти",jump_to_confirm:"подтвердить",page:"Страница",prev_page:"Назад",next_page:"Вперед",prev_5:"Предыдущие 5",next_5:"Следующие 5",prev_3:"Предыдущие 3",next_3:"Следующие 3",page_size:"размер страницы"},nf={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0};function tn(e){"@babel/helpers - typeof";return tn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tn(e)}function of(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function af(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?of(Object(r),!0).forEach(function(n){HI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):of(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HI(e,t,r){return t=zI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zI(e){var t=VI(e,"string");return tn(t)=="symbol"?t:String(t)}function VI(e,t){if(tn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WI=af(af({},nf),{},{locale:"ru_RU",today:"Сегодня",now:"Сейчас",backToToday:"Текущая дата",ok:"ОК",clear:"Очистить",week:"Неделя",month:"Месяц",year:"Год",timeSelect:"Выбрать время",dateSelect:"Выбрать дату",monthSelect:"Выбрать месяц",yearSelect:"Выбрать год",decadeSelect:"Выбрать десятилетие",previousMonth:"Предыдущий месяц (PageUp)",nextMonth:"Следующий месяц (PageDown)",previousYear:"Предыдущий год (Control + left)",nextYear:"Следующий год (Control + right)",previousDecade:"Предыдущее десятилетие",nextDecade:"Следущее десятилетие",previousCentury:"Предыдущий век",nextCentury:"Следующий век"}),sf={placeholder:"Выберите время",rangePlaceholder:["Время начала","Время окончания"]},uf={lang:{placeholder:"Выберите дату",yearPlaceholder:"Выберите год",quarterPlaceholder:"Выберите квартал",monthPlaceholder:"Выберите месяц",weekPlaceholder:"Выберите неделю",rangePlaceholder:["Начальная дата","Конечная дата"],rangeYearPlaceholder:["Начальный год","Год окончания"],rangeMonthPlaceholder:["Начальный месяц","Конечный месяц"],rangeWeekPlaceholder:["Начальная неделя","Конечная неделя"],shortWeekDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],shortMonths:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],...WI},timePickerLocale:{...sf}},QI=uf,KI=q.__exportAll({default:()=>lf}),je="${label} не является типом ${type}",lf={locale:"ru",Pagination:GI,DatePicker:uf,TimePicker:sf,Calendar:QI,global:{placeholder:"Пожалуйста выберите",close:"Закрыть"},Table:{filterTitle:"Фильтр",filterConfirm:"OK",filterReset:"Сбросить",filterEmptyText:"Без фильтров",filterCheckAll:"Выбрать все элементы",filterSearchPlaceholder:"Поиск в фильтрах",emptyText:"Нет данных",selectAll:"Выбрать всё",selectInvert:"Инвертировать выбор",selectNone:"Очистить все данные",selectionAll:"Выбрать все данные",sortTitle:"Сортировка",expand:"Развернуть строку",collapse:"Свернуть строку",triggerDesc:"Нажмите для сортировки по убыванию",triggerAsc:"Нажмите для сортировки по возрастанию",cancelSort:"Нажмите, чтобы отменить сортировку"},Tour:{Next:"Далее",Previous:"Назад",Finish:"Завершить"},Modal:{okText:"OK",cancelText:"Отмена",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Отмена"},Transfer:{titles:["",""],searchPlaceholder:"Поиск",itemUnit:"элем.",itemsUnit:"элем.",remove:"Удалить",selectAll:"Выбрать все данные",deselectAll:"Очистить все данные",selectCurrent:"Выбрать текущую страницу",selectInvert:"Инвертировать выбор",removeAll:"Удалить все данные",removeCurrent:"Удалить текущую страницу"},Upload:{uploading:"Загрузка...",removeFile:"Удалить файл",uploadError:"При загрузке произошла ошибка",previewFile:"Предпросмотр файла",downloadFile:"Загрузить файл"},Empty:{description:"Нет данных"},Icon:{icon:"иконка"},Text:{edit:"Редактировать",copy:"Копировать",copied:"Скопировано",expand:"Раскрыть",collapse:"Свернуть"},Form:{optional:"(необязательно)",defaultValidateMessages:{default:"Ошибка проверки поля ${label}",required:"Пожалуйста, введите ${label}",enum:"${label} должен быть одним из [${enum}]",whitespace:"${label} не может быть пустым",date:{format:"${label} не правильный формат даты",parse:"${label} не может быть преобразовано в дату",invalid:"${label} не является корректной датой"},types:{string:je,method:je,array:je,object:je,number:je,date:je,boolean:je,integer:je,float:je,regexp:je,email:je,url:je,hex:je},string:{len:"${label} должна быть ${len} символов",min:"${label} должна быть больше или равна ${min} символов",max:"${label} должна быть меньше или равна ${max} символов",range:"Длина ${label} должна быть между ${min}-${max} символами"},number:{len:"${label} должна быть равна ${len}",min:"${label} должна быть больше или равна ${min}",max:"${label} должна быть меньше или равна ${max}",range:"${label} должна быть между ${min}-${max}"},array:{len:"Количество элементов ${label} должно быть равно ${len}",min:"Количество элементов ${label} должно быть больше или равно ${min}",max:"Количество элементов ${label} должно быть меньше или равно ${max}",range:"Количество элементов ${label} должно быть между ${min} и ${max}"},pattern:{mismatch:"${label} не соответствует шаблону ${pattern}"}}},QRCode:{expired:"QR-код устарел",refresh:"Обновить"},ColorPicker:{presetEmpty:"Пустой",transparent:"Прозрачный",singleColor:"Один цвет",gradientColor:"Градиент"}},cf=lf,df=(e,t)=>{const r=(0,R.useRef)(void 0);r.current=e;const n=(0,R.useRef)(void 0);(0,R.useEffect)(()=>{n.current!==null&&r.current(n.current||[]),n.current=t},t)},$a=Ba();function ff(e){return{__:e.__.bind(e),_x:e._x.bind(e),_n:e._n.bind(e),_nx:e._nx.bind(e),sprintf:NI,isRTL:e.isRTL.bind(e),hasTranslation:e.hasTranslation.bind(e)}}var pf=(0,R.createContext)(ff($a));function YI(e){const{children:t,i18n:r=$a}=e,[,n]=(0,R.useReducer)(()=>[],[]);(0,R.useEffect)(()=>r.subscribe(n),[r]);const i=(0,R.useMemo)(()=>ff(r),[r]);return(0,R.createElement)(pf.Provider,{value:i},t)}var rn=()=>(0,R.useContext)(pf),xa=$a;function XI(e){if(e==="uk"||e.startsWith("uk_"))return"uk";const t=e.search(/[_-]/);return t>0?e.slice(0,t):e}var qa=class extends O.Disposable{_options;_listeners=[];constructor(e){super(),this._options=e}fire=e=>{if(!this.isDisposed()){let t;const r=[...this._listeners];for(const n of r){if(t===!1)return!1;t instanceof Promise?t=t.then(i=>i===!1||this.isDisposed()?!1:n(i)).catch(i=>{}):t=n(e)}return t}};addEventListener=e=>{const t=this._listeners,r=this._options;return t.push(e),t.length===1&&this._options?.onFirstListenerAdd&&this._options.onFirstListenerAdd(),{dispose:()=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),t.length||r?.onFirstListenerAdd&&r.onLastListenerRemove())}}};event=this.addEventListener},hf;(function(e){function t(i){let o;const a=new qa({onFirstListenerAdd(){o=i(a.fire)},onLastListenerRemove(){o.dispose()}});return a.event}e.snapshot=t;function r(i,o){return t(a=>i(s=>o(s)&&a(s)))}e.filter=r;function n(i,o){return t(a=>i(s=>a(o(s))))}e.map=n})(hf||(hf={}));var mf=O.createIdentifier$1("helpers.commandEmitter");function JI(e,t,r){e instanceof O.Container||(e=O.getContainer(e)),e.getOrCreateInstance(mf,()=>new qa).fire({id:t,payload:r})}function ZI(e,t){return O.getContainer(e).getOrCreateInstance(mf,()=>new qa).addEventListener}var gf=(e,t)=>{const r=ZI(Yd(),e);(0,R.useEffect)(()=>{const n=r(({id:i,payload:o})=>{i===e&&t(o)});return()=>n.dispose()},[r,e,t])};function yj(e){return e}var eC="SAVE",vj="SET_THEME",yf="NOTIFY",_j="SET_CONFIG",bj="UPDATE_CONFIG",Pi=e=>xa.__(e);function vf(){return typeof navigator<"u"&&navigator.onLine===!1}function _f(e){if(e==null)return[];const t=[e];if(typeof e!="object")return t;const r=e;if(r.error!=null&&(t.push(r.error),typeof r.error=="object")){const n=r.error;n.data!=null&&t.push(n.data),n.error!=null&&t.push(n.error)}if(r.data!=null&&(t.push(r.data),typeof r.data=="object")){const n=r.data;n.error!=null&&t.push(n.error)}return r.innerException!=null&&t.push(r.innerException),t}function bf(e){if(!e)return!1;if(typeof e=="string"){const r=e.toLowerCase();return r.includes("fetch")||r.includes("network")||r.includes("timeout")||r.includes("failed to fetch")||r.includes("load failed")||r.includes("networkerror")}if(e instanceof Error)return bf(e.message);if(typeof e!="object")return!1;const t=e;return t.status==="FETCH_ERROR"||t.status==="TIMEOUT_ERROR"||t.status==="PARSING_ERROR"?!0:typeof t.status=="number"?t.status===0||t.status===408||t.status>=500:!1}function tC(e){return vf()?!0:_f(e).some(bf)}function rC(e){return vf()?{title:Pi("No internet connection"),description:Pi("Check your network connection and try again.")}:tC(e)?{title:Pi("Server is unavailable"),description:Pi("Could not reach the server. Please try again later.")}:null}function Ef(e,t){return typeof e=="string"&&e.trim()?e:typeof e=="number"||typeof e=="boolean"?String(e):t}var nC=new Set(["uninitialized","pending","fulfilled","rejected"]);function Sf(e){return typeof e=="string"&&!nC.has(e)?e:void 0}function wi(...e){for(const t of e){if(typeof t=="string"&&t.trim())return t;if(typeof t=="number"||typeof t=="boolean")return String(t)}}function Pf(e){const t=rC(e);if(t)return t;const r=_f(e),n=e&&typeof e=="object"?e:{},i=wi(n.title,n.message),o=wi(n.description),a=i??wi(...r.flatMap(l=>{if(!l||typeof l!="object")return[l];const u=l,c=u.data;return[u.message,u.code,c?.code,c?.message,Sf(u.status)]}))??"Unknown error",s=o??wi(...r.flatMap(l=>{if(!l||typeof l!="object")return typeof l=="string"?[l]:[];const u=l,c=u.data;return[u.description,typeof u.error=="string"?u.error:void 0,c?.message,c?.code,Sf(u.status)]}))??"Unknown error";return{title:Ef(a,"Unknown error"),description:Ef(s,"Unknown error")}}var wf="bottomRight";function iC(e){if(e.title!=null||e.message==null)return e;const{message:t,...r}=e;return{...r,title:t}}function oC({node:e}){const t=(0,R.useCallback)(r=>r?.replaceWith(e),[e]);return(0,$.jsx)("div",{ref:t})}var aC=["title","message","description","actions","icon","closeIcon"];function sC(e){let t=e;for(const r of aC){const n=t[r];n instanceof HTMLElement&&(t===e&&(t={...e}),t[r]=(0,$.jsx)(oC,{node:n}))}return t}function uC(e){return{id:e.id,code:e.html,title:e.title,subject:e.subject,preheader:e.preheader}}function lC(e){return{id:e.id,code:e.html,title:e.title}}function Ii(){const e=ko(O.events.ON_NOTIFICATION),{notification:t}=be.ui_kit$App.useApp(),r=(0,R.useCallback)((u,c)=>{u.type||(u={...u,type:"info"});const d=ut({...u});return e.fire(d).then(f=>f.every(m=>m!==!1)?(u={...u,...d},u.placement===void 0&&(u.placement=wf),u=Object.assign(u,...f.filter(m=>typeof m=="object")),c||(t[u.type]?t[u.type](sC(iC(u))):u.title),u):!1)},[t,e]),n=(0,R.useCallback)((u,c)=>{const{title:d,description:f}=Pf(u);return r({...u&&typeof u=="object"?u:{},title:(0,$.jsx)("div",{dangerouslySetInnerHTML:{__html:d}}),description:(0,$.jsx)("div",{dangerouslySetInnerHTML:{__html:f}}),type:"error"},c)},[r]),i=(0,R.useCallback)((u="Success",c)=>r({...typeof u=="string"?{title:u}:u,type:"success"},c),[r]),o=(0,R.useCallback)((u,c)=>r({...u,type:"warning"},c),[r]),a=(0,R.useCallback)((u,c)=>r({...u,type:"info"},c),[r]),s=(0,R.useCallback)(u=>{t.destroy(u)},[t]),l=(0,R.useCallback)((u,c,d,f,m=wf)=>{if(d){const{title:g,description:h}=Pf(d);n({id:u,data:c,title:g,description:h,placement:m,innerException:d?.data instanceof Error?d.data:d,error:d},f)}},[n]);return(0,R.useMemo)(()=>({notify:r,success:i,error:n,warning:o,fromError:l,info:a,destroy:s}),[r,i,n,o,l,a,s])}function cC(){const{notify:e}=Ii();gf(yf,e)}var Ej="en_US",If=O.createIdentifier$1("locale.service"),dC={ready:!1};function Cf(){const e=Ke().getInstance(If),t=(0,R.useCallback)(r=>{if(!e)return()=>{};const n=e.state.watch(r);return()=>n.dispose()},[e]);return(0,R.useSyncExternalStore)(t,()=>e?.snapshot()??dC)}function Of(e){const t=e?.[""];return typeof t?.lang=="string"?t.lang:void 0}function fC(){const e=Cf();return e.id??Of(e.catalog)}var pC=({children:e})=>{const t=Cf(),r=Ii(),n=t.id??Of(t.catalog),i=(0,R.useMemo)(()=>qI(Ba(t.catalog),n),[t.catalog,n]),o=t.antd,a=o&&o.locale!==cf.locale?o:cf;return(0,R.useEffect)(()=>{},[t.id]),df(([s])=>{!s&&t.failure&&r.fromError(t.failure.kind,void 0,t.failure.error??{status:"FETCH_ERROR"})},[t.failure,r]),(0,$.jsx)(YI,{i18n:i,children:(0,$.jsx)(hC,{children:(0,$.jsx)(Ul.Provider,{value:t.ready,children:(0,$.jsx)(be.ui_kit$ThemeProvider,{locale:a,children:e})})})})};function hC({children:e}){const t=rn();return(0,$.jsx)(be.ui_kit$UiKitI18nProvider,{value:t,children:e})}function St({id:e,type:t,title:r,excerpt:n,author:i,acf:{subject:o,description:a,html:s,project:l,related_email:u,tags:c,type:d,is_template:f,global_block:m,lock:g},...h}){return{...h,id:String(e),author:String(i),renderGuid:O.generateUUID(),description:a,html:s,excerpt:He(r),project:de(l)?l.ID:l,project_author:de(l)?l.post_author:void 0,project_title:de(l)?l.post_title:void 0,tags:c,is_template:f,global_block:m,type:d,related_email:ue(de(u)?u.ID:u),title:He(r)||"",lock:g}}function Tf({title:e,subject:t,description:r,renderGuid:n,html:i,project:o,tags:a,type:s,related_email:l,is_template:u,global_block:c,lock:d,author:f,...m}){return{...m,author:ge(f),title:e,acf:{description:r,related_email:ge(l),html:i,project:o,tags:a,type:s,is_template:u,...typeof c=="boolean"?{global_block:c}:{},lock:d}}}function Af({id:e,title:t,acf:{html:r},excerpt:n,parent:i,author:o,...a}){return{...a,isAutosave:Mc(a.slug),id:ue(e),author:ue(o),parent:ue(i),title:He(t)||"",html:r,excerpt:de(n)?n.rendered:n}}function Mf({parent:e,title:t,html:r,project:n,author:i,...o}){return{...o,author:ge(i),parent:ge(e),title:He(t),"acf[html]":r,"acf[project]":de(n)?n.id||n.ID:n}}function Ga(e){return(t,r,n,i)=>e(O.getContainer(r))(t,r,n,i)}var Ha=[{type:"Blocks",id:"LIST"},{type:"ParentsBlocks",id:"LIST"},{type:"TemplatesBlocks",id:"LIST"}],Ci=we({reducerPath:"blocksApi",tagTypes:["Blocks","TemplatesBlocks","ParentsBlocks","Block"],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getBlocks:e.query({queryFn(t,r){const n=x(r),i={order:"desc",orderby:"modified"},o={};if(t.notEmbed||(o._embed=""),t.projectId&&(o._embed="author",o._fields="id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.global_block,acf.html,_embedded",i["filter[meta_key]"]="project",i["filter[meta_value]"]=t.projectId),t.fields&&(o._fields=t.fields),t.page&&(i.page=t.page),t.order&&(i.order=t.order),t.orderby&&(i.orderby=t.orderby),t.folderTag&&t.folderTag!=="all"?(i["filter[tax_query][relation]"]="AND",i["filter[tax_query][0][taxonomy]"]="blockfolder",i["filter[tax_query][0][field]"]="id",i["filter[tax_query][0][terms]"]=t.folderTag,i["filter[tax_query][0][include_children]"]="0"):t.hasOwnProperty("folderTag")&&(t.folderTag!=="all"||typeof t.folderTag=="object"&&t.folderTag===null)&&!t.tags?.length&&t.status&&t.status!=="trash"&&(i["filter[tax_query][0][taxonomy]"]="blockfolder",i["filter[tax_query][0][operator]"]="NOT EXISTS"),t.tags?.length>0&&t.status!=="trash"){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const l=t.tags[a];i[`filter[tax_query][${a+1}][taxonomy]`]="blocktags",i[`filter[tax_query][${a+1}][field]`]="id",i[`filter[tax_query][${a+1}][terms]`]=l}}return t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),t.status==="trash"&&(o.status="trash"),n.wp.eblock_list(i,{extraQuery:o}).then(Ne(St))},providesTags:t=>t?[...t.map(({id:r})=>({type:"Blocks",id:r})),{type:"Blocks",id:"LIST"}]:[{type:"Blocks",id:"LIST"}]}),getBlocksSchema:e.query({queryFn(t,r){return x(r).wp.eblock_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema.properties.acf"}})}}),getParentEmailBlocks:e.query({queryFn(t,r){const n=x(r),i={"filter[meta_query][0][compare]":"LIKE"},o={};if(t.notEmbed||(o._embed=""),t.emailId&&(i["filter[meta_query][0][key]"]="related_email",i["filter[meta_query][0][value]"]=t.emailId),t.fields&&(o._fields=t.fields),t.page&&(i.page=t.page),t.tags?.length>0){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const l=t.tags[a];i[`filter[tax_query][${a}][taxonomy]`]="blocktags",i[`filter[tax_query][${a}][field]`]="id",i[`filter[tax_query][${a}][terms]`]=l}}return t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),n.wp.eblock_list(i,{extraQuery:o}).then(Ne(St))},providesTags:t=>t?[...t.map(({id:r})=>({type:"ParentsBlocks",id:r})),{type:"ParentsBlocks",id:"LIST"}]:[{type:"ParentsBlocks",id:"LIST"}]}),getTemplateBlocks:e.query({queryFn:(t,r)=>{const n=x(r),i={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1",orderby:"modified",order:"desc"},o={};if(t.notEmbed||(o._embed=""),t.fields&&(o._fields=t.fields),t.page&&(i.page=t.page),t.tags?.length>0){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const l=t.tags[a];i[`filter[tax_query][${a}][taxonomy]`]="blocktags",i[`filter[tax_query][${a}][field]`]="id",i[`filter[tax_query][${a}][terms]`]=l}}return t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),n.wp.eblock_list(i,{extraQuery:o}).then(Ne(St))},providesTags:t=>t?[...t.map(({id:r})=>({type:"TemplatesBlocks",id:r})),{type:"TemplatesBlocks",id:"LIST"}]:[{type:"TemplatesBlocks",id:"LIST"}]}),getBlock:e.query({queryFn(t,r){return x(r).wp.eblock_detail({id:ge(t)},{extraQuery:{_embed:""}}).then(he(St))},providesTags:(t,r,n)=>[{type:"Block",id:n}]}),addBlock:e.mutation({queryFn(t,r){return x(r).wp.eblock_create({...Tf(t),status:"publish"},{type:O.ContentType.Json}).then(he(St))},invalidatesTags:[...Ha]}),editBlock:e.mutation({queryFn:Ga(t=>({blockId:r,source:n,...i},o)=>{const a=Kr(t),s=ut(Tf(i));return a.wp.eblock_partial_update({id:r},s,{type:O.ContentType.Json,extraQuery:{_embed:"wp:term"}}).then(he(St))}),invalidatesTags:(t,r,n)=>[...Ha,{type:"Blocks",id:n.blockId}]}),deleteBlock:e.mutation({queryFn(t,r){const n=x(r);let i,o;return typeof t=="object"?(i=t.id,o=t.force):(i=t,o=!1),n.wp.eblock_delete({id:i},{force:o}).then(Gn(St))},invalidatesTags:(t,r,n)=>[...Ha,{type:"Blocks",id:typeof n=="object"?n.id:n}]}),addTag:e.mutation({queryFn(t,r){return x(r).wp.blocktags_create({...t},{type:O.ContentType.Json})}}),getDeletableTag:e.query({queryFn([t,r],n){return x(n).wp.eblock_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":t,blocktags:[r]},{extraQuery:{"_fields[]":"blocktags"}}).then(Ne(St))}}),autoSaveBlock:e.mutation({queryFn({blockId:t,body:r},n){const i=x(n),o=Mf(r);return i.wp.eblock_autosaves_create({id:t},o,{type:O.ContentType.FormData}).then(he(Af))}})})}),{useGetBlocksQuery:mC,useGetBlockQuery:Sj,useLazyGetBlockQuery:Pj,useGetBlocksSchemaQuery:gC,useGetParentEmailBlocksQuery:yC,useAddBlockMutation:vC,useEditBlockMutation:_C,useAddTagMutation:wj,useAutoSaveBlockMutation:bC,useGetTemplateBlocksQuery:EC}=Ci,za={invalidateBlockId:null,isCodeMode:!1,codeModeDirection:"right",editorThemeColor:"light",isSettingsDisabled:!1,settings:{width:""},elementSettings:{},searchFilters:{},monacoDidMount:!1},ir="blockSlice",Nf=Pe({name:ir,initialState:za,reducers:{switchCodeMode:e=>{e.isCodeMode=!e.isCodeMode},setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setBlockSettings:(e,t)=>{Object.assign(e,{...e,settings:t.payload,isSettingsDisabled:!1})},setBlockSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,t)=>{e.elementSettings=t.payload},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},resetBlockSlice:()=>za},extraReducers:e=>{e.addMatcher(t=>t.type==="blocksApi/queries/queryResultPatched",(t,r)=>{const n=r.payload.queryCacheKey.match(/\(([0-9]+)\)/);n?.[1]&&(t.invalidateBlockId=n[1])}),e.addMatcher(t=>t.type==="blocksApi/invalidateTags",(t,r)=>{if(r.payload[0].id===+t.invalidateBlockId)return{...za,isCodeMode:t?.isCodeMode,codeModeDirection:t.codeModeDirection}}),e.addMatcher(Ci.endpoints.editBlock.matchFulfilled,t=>{t.invalidateBlockId=null})}}),{switchCodeMode:Ij,setEditorThemeColor:SC,setBlockSettings:PC,setElementSettings:wC,setBlockSettingsDisable:IC,setSearchFilters:Cj,resetBlockSlice:CC}=Nf.actions,OC=e=>e[ir].isCodeMode,TC=e=>e[ir].settings,AC=e=>e[ir].elementSettings,MC=e=>e[ir].editorThemeColor,NC=e=>e[ir].isSettingsDisabled,Rf=O.createIdentifier$1("CodeMode");function Va(){let e;try{const t=window.localStorage?.getItem(Ft.em_code_mode_settings);e=t?JSON.parse(t):void 0}catch{e=void 0}return{isCodeMode:!!(e?.isCodeMode||e?.isCodeMode===void 0),direction:e?.codeModeDirection||"left"}}function RC(e){try{window.localStorage?.setItem(Ft.em_code_mode_settings,JSON.stringify({isCodeMode:e.isCodeMode,codeModeDirection:e.direction}))}catch{}}function Oi(e){return e.getOrCreateInstance(Rf,()=>{const t=Ve(Va());return t.watch(RC),t})}function Df(e){return e?.getInstance(Rf)?.get()??Va()}function jf(e,t){const r=Oi(e);r.get().isCodeMode!==t&&r.set({...r.get(),isCodeMode:t})}function DC(e){const t=Oi(e);t.set({...t.get(),isCodeMode:!t.get().isCodeMode})}function jC(e,t){const r=Oi(e);r.set({...r.get(),direction:t})}var FC="100%",Ff=Va(),LC={activeModal:"",lastActiveSettingsTab:No,activeSettingsTab:No,isPanelHistoryCollapsed:!0,monacoHeight:0,isCodeMode:Ff.isCodeMode,codeModeDirection:Ff.direction,isHeaderCodeMenuOpen:{current:!1,switched:!1},emailWidth:FC,emailViewType:Tl,mobileViewActive:{shutdown:!0,styles:!0},emailMaxWidthSize:425,propertiesPanelKey:Il,parentBlocks:[],isGlobalLoading:!1},Fe="emailPageSlice",Lf=Pe({name:Fe,initialState:LC,reducers:{openModal:(e,t)=>{e.activeModal=t.payload},closeModal:e=>{e.activeModal=""},setActiveSettingsTab:(e,t)=>{e.lastActiveSettingsTab=e.activeSettingsTab,e.activeSettingsTab=t.payload,t.payload!=="History"&&(e.isPanelHistoryCollapsed=!0)},resetToLastActiveSettingsTab:e=>{e.lastActiveSettingsTab==="Properties"?e.activeSettingsTab="Build":e.activeSettingsTab=e.lastActiveSettingsTab,e.lastActiveSettingsTab!=="History"&&(e.isPanelHistoryCollapsed=!0)},switchIsPanelHistoryCollapsed:(e,t)=>{e.isPanelHistoryCollapsed=t.payload||!e.isPanelHistoryCollapsed},setEmailWidth:(e,{payload:t})=>{e.emailWidth=t,e.emailViewType=typeof t=="number"&&t<=e.emailMaxWidthSize?Al:Tl,window.localStorage.setItem(Ft.em_default_sizes,JSON.stringify(t))},setEmailMaxWidthSize:(e,{payload:t})=>{e.emailMaxWidthSize=t},setEmailViewType:(e,t)=>{e.emailViewType=t.payload},setCodeMode:(e,{payload:t})=>{e.isCodeMode=t},switchCodeModeDirection:(e,{payload:t})=>{e.codeModeDirection=t},setMobileViewActive:(e,t)=>{e.mobileViewActive=t.payload},setPropertiesPanelKey:(e,t)=>{e.propertiesPanelKey=t.payload},resetParentBlocks:e=>{e.parentBlocks=[]},setParentBlocks:(e,t)=>{e.parentBlocks=t.payload},setIsGlobalLoading:(e,t)=>{e.isGlobalLoading=t.payload},setHeaderCodeMenuOpen:(e,t)=>{e.isHeaderCodeMenuOpen.current&&!t.payload?e.isHeaderCodeMenuOpen.switched=!0:e.isHeaderCodeMenuOpen.switched=!1,e.isHeaderCodeMenuOpen.current=t.payload}},extraReducers:e=>{e.addMatcher(Ci.endpoints.getParentEmailBlocks.matchFulfilled,(t,r)=>{t.parentBlocks=r.payload})}}),{openModal:kC,closeModal:UC,setActiveSettingsTab:BC,resetToLastActiveSettingsTab:$C,switchIsPanelHistoryCollapsed:xC,setEmailWidth:qC,switchCodeModeDirection:GC,setMobileViewActive:HC,setEmailViewType:Oj,setCodeMode:zC,setEmailMaxWidthSize:Tj,setPropertiesPanelKey:VC,resetParentBlocks:WC,setIsGlobalLoading:QC,setHeaderCodeMenuOpen:KC}=Lf.actions,YC=e=>e[Fe].isCodeMode,XC=e=>e[Fe].emailWidth,JC=e=>e[Fe].activeModal,ZC=e=>e[Fe].parentBlocks,eO=e=>e[Fe].emailViewType,tO=e=>e[Fe].isGlobalLoading,rO=e=>e[Fe].mobileViewActive,nO=e=>e[Fe].codeModeDirection,iO=e=>e[Fe].activeSettingsTab,oO=e=>e[Fe].propertiesPanelKey,aO=e=>e[Fe].isHeaderCodeMenuOpen,sO=e=>e[Fe].isPanelHistoryCollapsed,kf=()=>z_(O.COOKIE_MANAGER_ID),uO=()=>{},lO={};function cO(){const e=Ke(),t=(0,R.useCallback)(r=>{if(!e)return uO;const n=fa(e).watch(r);return()=>n.dispose()},[e]);return{read:(0,R.useCallback)(()=>ei(e).profile??lO,[e]),subscribe:t}}function Wa(){const{read:e,subscribe:t}=cO();return(0,R.useSyncExternalStore)(t,e,e)}function dO(){return Wa().locale}var Uf=(0,R.createContext)({document:void 0,history:void 0});function Pt(){return(0,R.useContext)(Uf)}function fO({document:e,history:t,children:r}){const n=(0,R.useMemo)(()=>({document:e,history:t}),[e,t]);return(0,$.jsx)(Uf.Provider,{value:n,children:r})}function Bf(){const{document:e}=Pt(),t=(0,R.useCallback)(n=>e?e.subscribe(n):()=>{},[e]),r=(0,R.useCallback)(()=>e?.get().serverId??void 0,[e]);return(0,R.useSyncExternalStore)(t,r)}var Aj="new";function pO(){const{emailId:e}=qo(),t=Ke(),r=Bf();if(e!==void 0)return e==="new"?void 0:e;const n=t?Qc(t)?.sessionKey():void 0;return st(n)?void 0:r}function hO(e,t){return e==null||t==null?!1:String(e)===String(t)}function $f(e,t){if(e?.myRole==="owner"||e?.myRole==="admin")return e.myRole;if(e?.myRole==="user"||e?.myRole==="viewer")return"user";const r=Array.isArray(e?.members)?e.members:[],n=Array.isArray(e?.invites)?e.invites:[];if(t?.id==null||t.id==="")return null;const i=r.find(a=>hO(a?.userId,t.id));if(i){if(i.role==="owner"||i.role==="admin")return i.role;if(i.role==="user"||i.role==="viewer")return"user"}const o=t.email?.trim().toLowerCase();return o&&n.some(a=>a?.email?.trim().toLowerCase()===o)?"invited":null}function Qa(e,t){return t.isPlugin?!1:e?.ownerPlan?.isPaid!==!0}function mO(e,t){const r=$f(e,t);return r===null||r==="owner"}var gO=3,yO=6,Ti=new WeakMap,xf=new Map;function Ka(e){let t=e.parentElement;for(;t;){const r=getComputedStyle(t).overflowY;if(r==="auto"||r==="scroll")return t;t=t.parentElement}return null}function qf(e,t){const r=e?e.clientHeight:typeof window>"u"?0:window.innerHeight;return`${Math.round(r*t)}px 0px`}function vO(e){if(typeof IntersectionObserver>"u")return;const t=xf.get(e);if(t)return t;const r={fill:new IntersectionObserver(n=>{for(const i of n)i.isIntersecting&&Ti.get(i.target)?.fill()},{root:e,rootMargin:qf(e,gO)}),drop:new IntersectionObserver(n=>{for(const i of n)i.isIntersecting||Ti.get(i.target)?.drop()},{root:e,rootMargin:qf(e,yO)})};return xf.set(e,r),r}function _O(e,t){const r=vO(Ka(e));return r?(Ti.set(e,t),r.fill.observe(e),r.drop.observe(e),()=>{r.fill.unobserve(e),r.drop.unobserve(e),Ti.delete(e)}):!1}var Ya=".blocks-search__result-body",Gf=`${Ya}[data-block-preview="filled"]`,Xa=new Map;function bO(e){const t=e.shadowRoot?.firstElementChild,r=t instanceof HTMLStyleElement?t.nextElementSibling:t;return r instanceof HTMLElement?r.offsetHeight:0}function Ja(e){if(!e.length)return;const t=Ka(e[0].body),r=t?t.getBoundingClientRect().top:0,n=e.map(({body:o})=>o.getBoundingClientRect());let i=0;e.forEach(({body:o,height:a,placeholder:s},l)=>{const u=n[l];if(t&&u.top<r&&(i+=a-u.height),o.style.height=`${a}px`,s){o.dataset.previewPlaceholder="true";return}o.dataset.previewMeasured="true",Xa.set(o,a)}),t&&i!==0&&(t.scrollTop+=i)}function EO(){let e=0,t=0;return Xa.forEach((r,n)=>{if(!n.isConnected){Xa.delete(n);return}e+=r,t+=1}),t?e/t:0}function Hf(e){const t=EO();if(!t||!e)return;const r=[...e.querySelectorAll(`${Ya}:not([data-preview-measured])`)],n=new Map,i=a=>{const s=a.parentElement;if(!n.has(s)){const l=Ka(a);n.set(s,l?l.getBoundingClientRect().bottom:null)}return n.get(s)??null},o=[];r.forEach(a=>{if(!a.dataset.previewPlaceholder){o.push({body:a,height:t,placeholder:!0});return}if(Math.abs((parseFloat(a.style.height)||0)-t)<1)return;const s=i(a);s!==null&&a.getBoundingClientRect().top>=s&&o.push({body:a,height:t,placeholder:!0})}),Ja(o)}function SO(e,t){e&&(Ja(zf([...e.querySelectorAll(`${Gf} .blocks-search__result-html`)].map(r=>[r,t]))),Hf(e))}function zf(e){const t=e.map(([n,i])=>bO(n)*i),r=[];return e.forEach(([n],i)=>{const o=n.closest(Ya);o&&t[i]>0&&r.push({body:o,height:t[i]})}),r}var Za=new Map,es=0;function PO(){es=0;const e=[...Za].filter(([t])=>t.closest(Gf)!==null);Za.clear(),Ja(zf(e)),Hf(e[0]?.[0].ownerDocument??null)}function wO(e,t){Za.set(e,t),es||(es=requestAnimationFrame(PO))}function IO(e){return(0,R.useCallback)(t=>wO(t,e),[e])}var CO="https://emcdn.ru/socnets";function OO(e){let t=String(e??"");for(;t.endsWith("/");)t=t.slice(0,-1);return t}function TO(e){let t=String(e??"");for(;t.startsWith("/");)t=t.slice(1);return t}function ts(e){return`${OO(CO)}/${TO(e)}`}var Vf={telegram:"tg",youtube:"yt",vk:"vk",yandex_zen:"yd",x:"xa",pinterest:"pi",tiktok:"tt",ok:"ok",max:"max",rutube:"rutube",linkedin:"linkedin",viber:"viber",drbl:"drbl",fig:"fig",gh:"gh",ggl:"ggl",rdt:"rdt",sptf:"sptf",twitch:"twitch",vkv:"vkv"};function Wf(e,t){return ts(`${e}${t?"-negative":""}.png`)}function AO(e){const t=String(e.buttonBgColor??"").trim();return t||(e.blockBgEnabled&&String(e.blockBgColor??"").trim()?String(e.blockBgColor).trim():"")}function MO(e){const t=AO(e);return t||String(e.hostCellBgForIconLuminance??"").trim()}function Qf(e){const t=String(e??"").trim();if(t.endsWith("%")){const n=parseFloat(t);return Number.isNaN(n)?null:Math.min(1,Math.max(0,n/100))}const r=parseFloat(t);return Number.isNaN(r)?null:Math.min(1,Math.max(0,r))}function rs(e){const t=String(e??"").trim();if(t.endsWith("%")){const n=parseFloat(t);return Number.isNaN(n)?null:Math.min(255,Math.max(0,Math.round(n/100*255)))}const r=parseFloat(t);return Number.isNaN(r)?null:Math.min(255,Math.max(0,Math.round(r)))}function NO(e){const t=String(e??"").trim().toLowerCase();if(!t||t==="transparent")return null;if(t.startsWith("#")){let u=t.slice(1);return/^[0-9a-f]{3}$/i.test(u)&&(u=u.split("").map(c=>c+c).join("")),/^[0-9a-f]{6}$/i.test(u)?{r:parseInt(u.slice(0,2),16),g:parseInt(u.slice(2,4),16),b:parseInt(u.slice(4,6),16),a:1}:/^[0-9a-f]{8}$/i.test(u)?{r:parseInt(u.slice(0,2),16),g:parseInt(u.slice(2,4),16),b:parseInt(u.slice(4,6),16),a:parseInt(u.slice(6,8),16)/255}:null}const r=/^rgba?\(\s*([^)]+)\)$/i.exec(t);if(!r)return null;let n=1,i=r[1];if(i.includes("/")){const u=i.split(/\s*\/\s*/);if(i=u[0].trim(),!u[1])return null;const c=Qf(u[1]);if(c===null)return null;n=c}const o=i.split(/[\s,]+/).map(u=>u.trim()).filter(Boolean);if(o.length<3)return null;const a=rs(o[0]),s=rs(o[1]),l=rs(o[2]);if(a===null||s===null||l===null)return null;if(o.length>=4&&!r[1].includes("/")){const u=Qf(o[3]);if(u===null)return null;n=u}return{r:a,g:s,b:l,a:n}}function ns(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function RO(e){const t=NO(e);if(!t)return null;const r=t.a,n=c=>Math.round(c*r+255*(1-r)),i=n(t.r),o=n(t.g),a=n(t.b),s=ns(i),l=ns(o),u=ns(a);return .2126*s+.7152*l+.0722*u}function DO(e){const t=RO(e);return t==null?!1:t>=.6}function Kf(e){return Object.fromEntries(Object.entries(Vf).map(([t,r])=>[t,Wf(r,e)]))}var nn=Kf(!1),Yf=Kf(!0);function jO({blockBgEnabled:e,blockBgColor:t,buttonBgColor:r}){const n=!!(e&&String(t??"").trim()),i=!!String(r??"").trim();return n||i}function FO(e,t={}){const r=Vf[e],n=jO(t);if(r&&n){const i=MO(t);return ts(`${r}${i&&DO(i)?"-negative-black":"-negative"}.png`)}return r&&!n?ts(`${r}.png`):(n?Yf:nn)[e]??nn[e]}function LO(e,t){const r=nn[e];return t==="dark"?Yf[e]??r:r}var kO=nn;function UO(){return[{platform:"vk",label:"VK",href:""},{platform:"telegram",label:"Telegram",href:""},{platform:"max",label:"Max",href:""},{platform:"vkv",label:"VK Видео",href:""},{platform:"yandex_zen",label:"Яндекс Дзен",href:""}]}var Mj=["tg","yt","vk","yd","xa","ig","fb"].map(e=>Wf(e,!1));function Xf(e){return e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,""),e=e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,""),e=e.replace(/ on\w+="[^"]*"/g,""),e=e.replace(/ on\w+='[^']*'/g,""),e}var Ai=R.default.forwardRef(({icon:e,...t},r)=>{const n=Hn(),i=(0,R.useMemo)(()=>{if(!n?.icons)return;const o={};for(const[a,s]of Object.entries(n.icons))typeof s=="string"&&(o[a]=Xf(s));return Object.keys(o).length>0?o:void 0},[n?.icons]);return(0,$.jsx)(be.ui_kit$EmIcons,{ref:r,icon:e,configIcons:i,strokeWidth:n?.iconStrokeWidth,...t})});Ai.displayName="EmIcons";function BO(e){const{isPlanLocked:t,trialEnabled:r,canStartTrial:n}=e;return!t||r||!n?"upsell":"trial"}var is=Oo("config/changeConfigModeWithCodeCheck",async(e,{dispatch:t,getState:r})=>{const n=O.getContainer({getState:r}),i=n?.getInstance(O.CONFIG_SOURCE_ID);i?.setMode(e),t(Ei.endpoints.editMe.initiate({email_builder_config:e}));const o=i?.get()?.codeEnabled;return n&&o===!1&&Df(n).isCodeMode&&jf(n,!1),e});function $O(e,t,r){const n=e.data?.status,i=typeof e.status=="number"?e.status:void 0;return n===403||i===403?{kind:"failure",userMessage:e.message&&String(e.message).trim()||t}:{kind:"success",title:e.code&&String(e.code).trim()||r,description:e.message&&String(e.message).trim()||void 0}}async function xO(e,t,r,n,i,o,a){const s=await t(e),l=r("Could not activate the trial. Please try again later or contact support.");if("error"in s&&s.error){const u=s.error,c="data"in u?u.data:void 0;return a((c&&typeof c=="object"&&c!==null&&"message"in c?String(c.message):void 0)||l),!1}if("data"in s&&s.data&&typeof s.data=="object"){const u=$O(s.data,l,r("Trial period activated."));return u.kind==="failure"?(a(u.userMessage),!1):(n(is("pro")),await i(void 0),u.description?o({title:u.title,description:u.description}):o(u.title),!0)}return n(is("pro")),await i(void 0),o(r("Trial period activated.")),!0}var qO="https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,""),os="wp-json/limits/v1",GO="wp-json/subscription/v2",Jf=we({reducerPath:"limitsApi",baseQuery:Re({baseUrl:qO}),tagTypes:["LimitsStats","LimitsWarnings","SubscriptionMe"],endpoints:e=>({getLimitsStats:e.query({query:()=>({url:`${os}/stats`,method:"GET"}),providesTags:["LimitsStats"]}),getLimitsStatsByType:e.query({query:t=>({url:`${os}/stats/${t}`,method:"GET"}),providesTags:(t,r,n)=>[{type:"LimitsStats",id:n}]}),getLimitsWarnings:e.query({query:()=>({url:`${os}/warnings`,method:"GET"}),providesTags:["LimitsWarnings"]}),getSubscriptionMeV2:e.query({query:()=>({url:`${GO}/me`,method:"GET"}),providesTags:["SubscriptionMe"]}),invalidatePlanCache:e.mutation({queryFn:async(t,r)=>Ye(await Xe(r).billing.planInvalidateCreate())})})}),{useGetLimitsStatsQuery:Nj,useLazyGetLimitsStatsQuery:Rj,useGetLimitsStatsByTypeQuery:Dj,useLazyGetLimitsStatsByTypeQuery:HO,useGetLimitsWarningsQuery:jj,useLazyGetLimitsWarningsQuery:Fj,useGetSubscriptionMeV2Query:Lj,useLazyGetSubscriptionMeV2Query:kj,useInvalidatePlanCacheMutation:zO}=Jf,on="Integrations",Mi="Webhook",Ni="TestRecipients",as="Storage",Zf="Plan",Je=(e,t)=>{const r=Ye(e);return"error"in r?{error:r.error}:{data:t(r.data)}},ss=we({reducerPath:"projectSettingsV2Api",tagTypes:[on,Mi,Ni,as,Zf],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({getProjectPlan:e.query({async queryFn(t,r,n,i){const o=await mP(O.getContainer(r),String(t));if(o)return{data:o};const a=await i(`/projects/${t}/plan`);return a.error?{error:a.error}:{data:a.data}},providesTags:(t,r,n)=>[{type:Zf,id:String(n)}]}),getProjectIntegrations:e.query({async queryFn(t,r){return Je(await Be(O.getContainer(r)).projects.integrationsList({id:String(t)}),n=>Object.fromEntries((n?.items||[]).map(i=>[i.provider,i])))},providesTags:(t,r,n)=>[{type:on,id:String(n)}]}),getIntegrationCredentials:e.query({async queryFn({projectId:t,provider:r},n){return Je(await Be(O.getContainer(n)).projects.integrationsDetail({id:String(t),provider:r,reveal:!0}),i=>i?.settings||{})},keepUnusedDataFor:0}),putProjectIntegration:e.mutation({async queryFn({projectId:t,provider:r,settings:n},i){return Je(await Be(O.getContainer(i)).projects.integrationsUpdate({id:String(t),provider:r},{settings:n}),o=>o)},invalidatesTags:(t,r,{projectId:n})=>[{type:on,id:String(n)}]}),deleteProjectIntegration:e.mutation({async queryFn({projectId:t,provider:r},n){return Je(await Be(O.getContainer(n)).projects.integrationsDelete({id:String(t),provider:r}),()=>{})},invalidatesTags:(t,r,{projectId:n})=>[{type:on,id:String(n)}]}),getProjectWebhook:e.query({async queryFn(t,r){return Je(await Be(O.getContainer(r)).projects.webhookList({id:String(t)}),n=>n?.url||"")},providesTags:(t,r,n)=>[{type:Mi,id:String(n)}]}),putProjectWebhook:e.mutation({async queryFn({projectId:t,url:r},n){return Je(await Be(O.getContainer(n)).projects.webhookUpdate({id:String(t)},{url:r}),i=>({url:i?.url||""}))},invalidatesTags:(t,r,{projectId:n})=>[{type:Mi,id:String(n)}]}),getProjectStorage:e.query({async queryFn(t,r){return Je(await Be(O.getContainer(r)).projects.storageList({id:String(t)}),n=>n)},providesTags:(t,r,n)=>[{type:as,id:String(n)}]}),putProjectSettings:e.mutation({async queryFn({projectId:t,body:r},n){return Je(await Be(O.getContainer(n)).projects.settingsUpdate({id:String(t)},r),i=>i)},invalidatesTags:(t,r,{projectId:n})=>[{type:on,id:String(n)},{type:Mi,id:String(n)},{type:Ni,id:String(n)},{type:as,id:String(n)}]}),getProjectTestRecipients:e.query({async queryFn(t,r){return Je(await Be(O.getContainer(r)).projects.testRecipientsList({id:String(t)}),n=>n?.emails||[])},providesTags:(t,r,n)=>[{type:Ni,id:String(n)}]}),putProjectTestRecipients:e.mutation({async queryFn({projectId:t,emails:r},n){return Je(await Be(O.getContainer(n)).projects.testRecipientsUpdate({id:String(t)},{emails:r}),i=>({emails:i?.emails||[]}))},invalidatesTags:(t,r,{projectId:n})=>[{type:Ni,id:String(n)}]})})}),{useGetProjectPlanQuery:us,useLazyGetProjectPlanQuery:VO,useGetProjectStorageQuery:Uj,usePutProjectSettingsMutation:Bj,useGetProjectIntegrationsQuery:WO,useLazyGetIntegrationCredentialsQuery:QO,usePutProjectIntegrationMutation:$j,useDeleteProjectIntegrationMutation:xj,useGetProjectWebhookQuery:KO,usePutProjectWebhookMutation:qj,useGetProjectTestRecipientsQuery:YO,usePutProjectTestRecipientsMutation:XO}=ss;function JO(){const{__:e}=rn(),t=tt(),r=kf(),{success:n,notify:i}=Ii(),o=jr(),[a]=Jd(),[s,{isLoading:l}]=CI(),[u]=zO(),c=(0,R.useCallback)(d=>{i({title:d,type:"error"})},[i]);return{activate:(0,R.useCallback)(async()=>{const d=r.get(Ao.em_token);if(!d)return c(e("Sign in to your account to activate the trial period.")),!1;try{const f=await xO(d,s,e,t,a,n,c);return f&&(await u(),t(nr.util.invalidateTags(["project"])),t(ss.util.invalidateTags(["Plan"])),o({event:"change",action:"activate_trial"})),f}catch(f){return c(f?.data?.message||e("Could not activate the trial. Please try again later or contact support.")),!1}},[e,s,r,t,a,u,c,n,o]),isActivating:l}}var ZO=({open:e,sideOnOk:t,onCancel:r,initialSlide:n=0})=>{const{__:i}=rn(),o=Go(),[a,s]=(0,R.useState)(n),l=(0,R.useRef)(null),u=jr(),c=()=>{t&&t(),o("/billing"),r(!1)};(0,R.useEffect)(()=>{e&&l.current&&(l.current.goTo(n,!0),s(n))},[e,n]);const d=(0,R.useMemo)(()=>[{image:i("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--em-blue-2)",title:i("More editing features"),description:i("Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.")},{image:i("https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png"),backgroundColor:"var(--em-purple-2)",title:i("Work with the HTML code"),description:i("Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!")},{image:i("https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png"),backgroundColor:"var(--em-cyan-2)",title:i("AI image generation"),description:i("Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.")},{image:i("https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png"),backgroundColor:"var(--em-green-2)",title:i("Stock photos and GIFs"),description:i("Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.")},{image:i("https://cdn.useblocks.io/1351/241017_18_NDYloAO.png"),backgroundColor:"var(--em-magenta-2)",title:i("Version history"),description:i("Check who and when made changes to the email template and, if necessary, restore one of the previous versions.")},{image:i("https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png"),backgroundColor:"var(--em-red-2)",title:i("Image editor"),description:i("Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.")},{image:i("https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png"),backgroundColor:"var(--em-orange-2)",title:i("Email optimization"),description:i("Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.")},{image:i("https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png"),backgroundColor:"var(--em-volcano-2)",title:i("Team collaboration"),description:i("Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.")},{image:i("https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png"),backgroundColor:"var(--em-geekblue-2)",title:i("Email testing"),description:i("Check how your email appears across various devices and email clients.")},{image:i("https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"),backgroundColor:"var(--em-geekblue-2)",title:i("AI assistant"),description:i("Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!")}],[i]);return(0,R.useEffect)(()=>{if(e&&l.current){l.current.goTo(n,!0),s(n);const f=d[n];u({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:f.title})}},[e,d,n,u]),(0,$.jsxs)(be.ui_kit$Modal,{open:e,footer:null,onCancel:r,closable:!1,className:"premium-features-modal",classNames:{mask:"premium-features-modal-mask"},styles:{mask:{background:"rgba(0, 0, 0, 0.65)"}},width:1100,style:{maxWidth:"80%"},children:[(0,$.jsx)(be.ui_kit$Carousel,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:a,ref:l,children:d.map((f,m)=>(0,$.jsx)("div",{children:(0,$.jsxs)("div",{className:"carousel-slide",style:{background:`${f.backgroundColor}`},children:[(0,$.jsx)("div",{className:"slide-item-image",children:(0,$.jsx)("img",{src:f.image,alt:`slide-${m}`})}),(0,$.jsxs)("div",{className:"slide-item-content",children:[(0,$.jsx)("h3",{className:"slide-title",children:f.title}),(0,$.jsx)("p",{className:"slide-description",children:f.description})]})]})},m))}),(0,$.jsx)("div",{className:"modal-subtitle",children:i("This and other features are available for you on a higher plan.")}),(0,$.jsxs)("div",{className:"modal-buttons",children:[(0,$.jsx)(be.ui_kit$Button,{size:"large",onClick:()=>r(!1),children:i("Cancel")}),(0,$.jsx)(be.ui_kit$Button,{type:"primary",size:"large",onClick:c,style:{padding:"0 30px"},children:i("Select plan")})]})]})},eT=(0,$.jsx)(Ai,{icon:"CheckCircleVerified",component:be.icons$CheckCircleVerified,className:"trial-suggest-modal__feature-icon"}),tT=["Export to HTML, AMP, PDF and PNG","Code editing and version history","AI assistant and AI image generation","Stock photos, GIFs and icons, plus the image editor","Email checks and teamwork"],ep=["https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png","https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png","https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png","https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png","https://cdn.useblocks.io/1351/241017_18_NDYloAO.png","https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png","https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png","https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png","https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png","https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"],rT=5e3,nT=({open:e,onCancel:t,onConfirm:r,loading:n=!1})=>{const{__:i}=rn(),[o,a]=(0,R.useState)(0),s=(0,R.useMemo)(()=>ep.map(l=>({backgroundImage:`url(${i(l)})`})),[i]);return(0,R.useEffect)(()=>{if(!e){a(0);return}const l=setInterval(()=>a(u=>(u+1)%ep.length),rT);return()=>clearInterval(l)},[e]),(0,$.jsx)(be.ui_kit$Modal,{open:e,onCancel:t,footer:null,closable:!1,centered:!0,width:760,className:"trial-suggest-modal",children:(0,$.jsxs)("div",{className:"trial-suggest-modal__layout",children:[(0,$.jsx)("div",{className:"trial-suggest-modal__gallery",children:(0,$.jsx)("div",{className:"trial-suggest-modal__slide-image",style:s[o]})}),(0,$.jsxs)("div",{className:"trial-suggest-modal__content",children:[(0,$.jsxs)("span",{className:"trial-suggest-modal__badge",children:[i("14 days free")," "]}),(0,$.jsxs)("h2",{className:"trial-suggest-modal__title",children:[i("Try every editor feature — free")," "]}),(0,$.jsx)("p",{className:"trial-suggest-modal__intro",children:i("Turn on a 14-day trial and the whole editor opens up:")}),(0,$.jsx)("ul",{className:"trial-suggest-modal__features",children:tT.map(l=>(0,$.jsxs)("li",{children:[eT,(0,$.jsx)("span",{children:i(l)})]},l))}),(0,$.jsxs)("p",{className:"trial-suggest-modal__promise",children:[(0,$.jsx)(Ai,{icon:"ShieldTickIcon",component:be.icons$ShieldTickIcon,className:"trial-suggest-modal__promise-icon"}),(0,$.jsx)("span",{children:i("No card required: we ask for no payment or personal details.")})]}),(0,$.jsx)("p",{className:"trial-suggest-modal__note",children:i("When the trial ends, the service switches to the free plan.")}),(0,$.jsxs)("div",{className:"trial-suggest-modal__buttons",children:[(0,$.jsxs)(be.ui_kit$Button,{type:"text",size:"large",onClick:t,className:"trial-suggest-modal__decline",children:[i("Not now")," "]}),(0,$.jsxs)(be.ui_kit$Button,{type:"primary",size:"large",loading:n,onClick:r,children:[i("Start the trial")," "]})]})]})]})})},iT=({open:e,onCancel:t,initialSlide:r=0,onTrialActivated:n,sideOnOk:i})=>{const o=Wa(),a=$r(),s=jr(),{activate:l,isActivating:u}=JO(),c=BO({isPlanLocked:Qa(a,{isPlugin:!0}),trialEnabled:!!o?.trial_enabled,canStartTrial:mO(a,o)})==="trial";(0,R.useEffect)(()=>{!e||!c||s({event:"open_modal",action:"open_trial-suggest_modal",modal_id:"trial-suggest"})},[e,c,s]);const d=(0,R.useCallback)(()=>{(async()=>{if(await l()){(n??t)();return}t()})()},[l,t,n]);return c?(0,$.jsx)(nT,{open:e,onCancel:t,onConfirm:d,loading:u}):(0,$.jsx)(ZO,{open:e,onCancel:t,initialSlide:r,sideOnOk:i})},oT=["export_platforms","export_html","export_amp","export_webhook","export_pdf","export_png","element_image","element_ai_image","element_text","element_heading","element_button","element_spacer","element_lists","element_divider","element_social","element_table","element_timer","element_video","element_amp_carousel","element_amp_accordion","element_amp_form","block_save","block_visibility","block_border","block_radius","block_shadow","block_to_image","theme_editing","preheader_editing","desktop_mobile_toggle","undo_redo","typograph","variables","google_fonts","code_editor","version_history","preview_service","template_import","code_minify","mobile_props","discussion","utm_editor","stock_photo","stock_gif","stock_icons","image_editor"],aT={export_platforms:1,export_html:1,export_amp:1,export_webhook:1,export_pdf:1,export_png:1,element_image:1,element_ai_image:2,element_text:1,element_heading:1,element_button:1,element_spacer:1,element_lists:1,element_divider:1,element_social:1,element_table:1,element_timer:1,element_video:1,element_amp_carousel:1,element_amp_accordion:1,element_amp_form:1,block_save:1,block_visibility:1,block_border:1,block_radius:1,block_shadow:1,block_to_image:1,theme_editing:1,preheader_editing:1,desktop_mobile_toggle:1,undo_redo:1,typograph:1,variables:1,google_fonts:1,code_editor:1,version_history:4,preview_service:1,template_import:1,code_minify:1,mobile_props:1,discussion:7,utm_editor:1,stock_photo:3,stock_gif:3,stock_icons:3,image_editor:5};function sT(e){return oT.includes(e)}function tp(e){const{featureKey:t,features:r,isPlugin:n}=e,i=r!==void 0;return n?{isLocked:!1,isPlanDataReady:i}:t==null||!sT(t)?{isLocked:!1,isPlanDataReady:i}:{isLocked:J_(r,t)!==!0,isPlanDataReady:i}}function rp(){const e=$r(),t=e?.id,{data:r}=us(t,{skip:!0});return Qa(e,{isPlugin:!0}),r?.features}function uT(){const e=rp();return(0,R.useCallback)(t=>tp({featureKey:t,features:e,isPlugin:!0}).isLocked,[e])}function lT(e){const t=rp();return(0,R.useMemo)(()=>{const r=tp({featureKey:e,features:t,isPlugin:!0});return{isLocked:r.isLocked,state:r.isLocked?{state:"locked_by_plan"}:{state:"allowed"},isPlanDataReady:r.isPlanDataReady}},[e,t])}var np=["vk","telegram","youtube","tiktok","ok","pinterest","max","rutube","yandex_zen","vkv","drbl","fig","gh","ggl","rdt","sptf","twitch"],cT=["telegram","whatsapp","instagram","facebook","youtube","tiktok","x","linkedin","pinterest","viber","apple","dis","drbl","fig","ggl","mdm","rdt","sgnl","sc","sptf","tmblr","twitch","thrds","msngr","bs"],dT=[{id:"vk",labelMsgid:"VK",brands:["em"]},{id:"telegram",labelMsgid:"Telegram",brands:["em","blocks"]},{id:"youtube",labelMsgid:"YouTube",brands:["em","blocks"]},{id:"tiktok",labelMsgid:"TikTok",brands:["em","blocks"]},{id:"ok",labelMsgid:"Одноклассники",brands:["em"]},{id:"pinterest",labelMsgid:"Pinterest",brands:["em","blocks"]},{id:"max",labelMsgid:"Макс",brands:["em"]},{id:"rutube",labelMsgid:"RuTube",brands:["em"]},{id:"yandex_zen",labelMsgid:"Яндекс Дзен",brands:["em"]},{id:"whatsapp",labelMsgid:"WhatsApp",brands:["blocks"]},{id:"instagram",labelMsgid:"Instagram",brands:["blocks"]},{id:"facebook",labelMsgid:"Facebook",brands:["blocks"]},{id:"x",labelMsgid:"X (Twitter)",brands:["blocks"]},{id:"linkedin",labelMsgid:"LinkedIn",brands:["blocks"]},{id:"viber",labelMsgid:"Viber",brands:["blocks"]},{id:"apple",labelMsgid:"Apple",brands:["blocks"]},{id:"dis",labelMsgid:"Discord",brands:["blocks"]},{id:"drbl",labelMsgid:"Dribbble",brands:["blocks","em"]},{id:"fig",labelMsgid:"Figma",brands:["blocks","em"]},{id:"gh",labelMsgid:"GitHub",brands:["blocks","em"]},{id:"ggl",labelMsgid:"Google",brands:["blocks","em"]},{id:"mdm",labelMsgid:"Medium",brands:["blocks"]},{id:"rdt",labelMsgid:"Reddit",brands:["blocks","em"]},{id:"sgnl",labelMsgid:"Signal",brands:["blocks"]},{id:"sc",labelMsgid:"Snapchat",brands:["blocks"]},{id:"sptf",labelMsgid:"Spotify",brands:["blocks","em"]},{id:"tmblr",labelMsgid:"Tumblr",brands:["blocks"]},{id:"twitch",labelMsgid:"Twitch",brands:["blocks","em"]},{id:"thrds",labelMsgid:"Threads",brands:["blocks"]},{id:"msngr",labelMsgid:"Messenger",brands:["blocks"]},{id:"bs",labelMsgid:"Bluesky",brands:["blocks"]},{id:"vkv",labelMsgid:"VK Видео",brands:["em"]}];function fT(e){const t=e==="em"?np:cT,r=new Set(t),n=Object.fromEntries(dT.filter(i=>i.brands.includes(e)&&r.has(i.id)).map(i=>[i.id,i]));return t.map(i=>n[i]).filter(i=>!!i)}var pT=new Set([Ge.APPLICATION_ELEMENT_SETTINGS_SET,Ge.APPLICATION_BLOCK_SETTINGS_SET,Ge.APPLICATION_EMAIL_SETTINGS_SET]);function ip(e,t){const r=Yt(),n=t??e,i=(0,R.useRef)(n);i.current=n,(0,R.useEffect)(()=>{if(t){const c=r.addListener(e,d=>i.current(d));return()=>{c.dispose()}}let o=null;const a=new Map,s=()=>{o=null,a.forEach(c=>i.current(c)),a.clear()},l=c=>{const d=c.data?.operation;if(d&&pT.has(d)){a.set(d,c),o===null&&(o=requestAnimationFrame(s));return}i.current(c)},u=r.addListener(l);return()=>{u.dispose(),o!==null&&(cancelAnimationFrame(o),o=null),a.clear()}},[r,e,t])}function op(e){return{undo:()=>e.undo(),redo:()=>e.redo(),clear:()=>e.clear(),canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo(),createSnapshot:()=>e.createSnapshot(),restoreSnapshot:t=>{e.restoreSnapshot(t)},getPast:t=>e.getPast(t).map(r=>({changes:r})),getFuture:t=>e.getFuture(t).map(r=>({changes:r}))}}var hT={canUndo:!1,canRedo:!1},mT={undo:()=>{},redo:()=>{},clear:()=>{},canUndo:()=>!1,canRedo:()=>!1,createSnapshot:()=>{},restoreSnapshot:()=>{},getPast:()=>[],getFuture:()=>[]};function gT(e){const t=Pt(),{history:r}=e??t;return(0,R.useMemo)(()=>r?op(r):mT,[r])}function yT(){const{history:e}=Pt(),t=(0,R.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),r=(0,R.useRef)(null),n=(0,R.useCallback)(()=>{if(!e)return hT;const i={canUndo:e.canUndo(),canRedo:e.canRedo()},o=r.current;return o&&o.canUndo===i.canUndo&&o.canRedo===i.canRedo?o:(r.current=i,i)},[e]);return(0,R.useSyncExternalStore)(t,n)}function ap(e){return e?.getContent()??""}function vT(e,t){return e?{dispose:e.subscribe(t)}:{dispose:()=>{}}}var _T=[/chunkloaderror/i,/loading chunk [\d\w-]+ failed/i,/failed to fetch dynamically imported module/i,/importing a module script failed/i,/error loading dynamically imported module/i];function bT(e){if(!e)return!1;const t=ET(e);return _T.some(r=>r.test(t))||e instanceof Error&&e.name==="ChunkLoadError"?!0:ST(e)}function ET(e){return typeof e=="string"?e:e instanceof Error?`${e.name} ${e.message}`:typeof e=="object"&&e!==null&&"message"in e?String(e.message??e):String(e)}function ST(e){if(typeof ErrorEvent>"u"||!(e instanceof ErrorEvent))return!1;const t=e.target;if(!t||typeof t!="object")return!1;const r="src"in t?String(t.src??""):"",n="href"in t?String(t.href??""):"",i=r||n;return i?/\/static\/js\/[a-f0-9]+\.js/i.test(i)||/\/main\.[a-f0-9]{8}\.js/i.test(i):!1}var sp="_rb",up="stale-build-reload-at",lp="stale-build-reload-count",PT=5e3,wT=3,cp=!1;function IT(){return!1}function dp(){return typeof sessionStorage>"u"?0:Number(sessionStorage.getItem(lp)??0)}function CT(){typeof sessionStorage>"u"||sessionStorage.setItem(lp,String(dp()+1))}function OT(e){if(!IT()||cp||typeof window>"u"||typeof sessionStorage>"u"||dp()>=wT)return;const t=Number(sessionStorage.getItem(up)??0);if(t&&Date.now()-t<PT)return;cp=!0,CT(),sessionStorage.setItem(up,String(Date.now()));const r=new URL(window.location.href);if(!r.searchParams.has(sp)){r.searchParams.set(sp,String(Date.now())),window.location.replace(r.toString());return}window.location.reload()}function TT(e,t){return(0,R.lazy)(()=>(t&&qe(`route:${t}:start`,{kind:"network"}),e().then(r=>(t&&qe(`route:${t}:end`,{kind:"network"}),r)).catch(r=>{if(bT(r))return OT("lazy_import"),new Promise(()=>{});throw r})))}var AT=null,fp=(0,R.createContext)(AT);function MT(){return(0,R.useContext)(fp)}var pp=(0,R.createContext)(Cl);function NT({kind:e,children:t}){return(0,$.jsx)(pp.Provider,{value:e,children:t})}function RT(){return(0,R.useContext)(pp)}var hp=()=>{};function DT(){const e=Ke(),t=(0,R.useCallback)(n=>{if(!e)return hp;const i=Jt(e).watch(n);return()=>i.dispose()},[e]),r=(0,R.useCallback)(()=>Br(e).requested,[e]);return(0,R.useSyncExternalStore)(t,r,r)}function jT(){const{projectId:e}=qo(),t=Ke(),r=(0,R.useCallback)(o=>{if(!t)return hp;const a=Jt(t).watch(o);return()=>a.dispose()},[t]),n=(0,R.useCallback)(()=>Br(t).card?.id,[t]),i=(0,R.useSyncExternalStore)(r,n,n);return e??(i!=null&&i!==""?String(i):void 0)}var FT=e=>{if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(t)),r.length-1),i=r.at(n)??"B";return parseFloat((e/Math.pow(t,n)).toFixed(1))+" "+i},LT=e=>e?new TextEncoder().encode(e).length:0,kT=(e,t=90)=>e>t*1024,UT=e=>{const t=[];let r=e;r=r.replace(/<!--\[if[^\]]*\]>[\s\S]*?<!\[endif\]-->/gi,i=>{const o=t.length,a=i.replace(/\s+/g," ").replace(/> </g,"><").replace(/\s+>/g,">").replace(/<!--\[if([^\]]*)\]>\s+/g,"<!--[if$1]>").replace(/\s+<!\[endif\]-->/g,"<![endif]-->");return t.push(a),`___CONDITIONAL_COMMENT_${o}___`});let n=r.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/> </g,"><").replace(/\s+>/g,">").trim();return t.forEach((i,o)=>{n=n.replace(`___CONDITIONAL_COMMENT_${o}___`,i)}),n},BT={email_10_30:{id:"email_10_30",titleKey:"You have used up the number of emails you can create on your current plan",subtitleKey:"You can increase the number of emails right now.",usageResource:"email_generate",previous:10,next:30,showSecondaryBuy:!1,debugLabelKey:"Limit modal: emails 10→30"},email_30_300:{id:"email_30_300",titleKey:"You have used up the number of emails you can create on your current plan",subtitleKey:"You can increase the number of emails right now.",usageResource:"email_generate",previous:30,next:300,showSecondaryBuy:!1,debugLabelKey:"Limit modal: emails 30→300"},email_300_inf:{id:"email_300_inf",titleKey:"You have used up the number of emails you can create on your current plan",subtitleKey:"You can increase the number of emails right now.",usageResource:"email_generate",previous:300,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: emails 300→∞"},ai_10_50:{id:"ai_10_50",titleKey:"You have used up your AI generations",subtitleKey:"You can add more generations right now; they are billed separately from the generations included in your plan.",usageResource:"ai",previous:10,next:50,showSecondaryBuy:!1,debugLabelKey:"Limit modal: AI 10→50"},ai_30_150:{id:"ai_30_150",titleKey:"You have used up your AI generations",subtitleKey:"You can add more generations right now; they are billed separately from the generations included in your plan.",usageResource:"ai",previous:30,next:150,showSecondaryBuy:!1,debugLabelKey:"Limit modal: AI 30→150"},ai_150_inf:{id:"ai_150_inf",titleKey:"You have used up your AI generations",subtitleKey:"You can add more generations right now; they are billed separately from the generations included in your plan.",usageResource:"ai",previous:150,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: AI 150→∞"},optimization_exceeded:{id:"optimization_exceeded",titleKey:"You have used up your optimisation limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"optimization",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: optimization exhausted"},image_generate_exceeded:{id:"image_generate_exceeded",titleKey:"You have used up your image generation limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"image_generate",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: image_generate exhausted"},preview_exceeded:{id:"preview_exceeded",titleKey:"You have used up your preview (test send) limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"preview",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: preview exhausted"},test_sends_exceeded:{id:"test_sends_exceeded",titleKey:"You have used up your test send limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"test_sends",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: test sends exhausted"},link_check_exceeded:{id:"link_check_exceeded",titleKey:"You have used up your link check limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"link_check",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: link_check exhausted"},image_check_exceeded:{id:"image_check_exceeded",titleKey:"You have used up your image check limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"image_check",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: image_check exhausted"},spam_check_exceeded:{id:"spam_check_exceeded",titleKey:"You have used up your spam check limit",subtitleKey:"You can increase the limit by changing your plan or buying an extra package.",usageResource:"spam_check",previous:0,next:"infinity",showSecondaryBuy:!1,debugLabelKey:"Limit modal: spam_check exhausted"}};function $T(e){return BT[e]}function xT(e){return e==="infinity"?"∞":e}var qT=/\s+\d+$/;function GT(e){return e.trim().replace(qT,"").toLowerCase().replaceAll("+","-plus").split(/\s+/).filter(Boolean).join("-")}function mp(e,t,r){if(!e||!t||!r)return;const n=e.filter(o=>GT(o.title??"")===t).map(o=>o.limits?.[r]);if(n.length===0)return;const i=n.findIndex(o=>String(o??"").trim()!=="0");return i===-1?"0":n[i]}function gp(e,t){if(!e||!e.is_unlimited||t==null)return e;const r=String(t).trim();return r===""||Number(r)!==0?e:{...e,is_unlimited:!1}}var yp={ai:"ai_limit",email_generate:"email_generate_limit",image_generate:"image_generate_limit",preview:"preview_limit",test_sends:"test_sends_limit",link_check:"link_check_limit",image_check:"image_check_limit",spam_check:"spam_check_limit"};function ls(){return!0}function vp(e){const{data:t}=Zd(void 0,{skip:ls()||e});return t}function _p(e){if(e)return{used:e.used??0,base_limit:e.base_limit??0,extra:e.extra??0,total_limit:e.total_limit??0,remaining:e.remaining??0,percent:e.percent??0,is_unlimited:e.is_unlimited??!1}}function HT(){const e=$r()?.id,{data:t,isSuccess:r}=us(e,{skip:ls()||!e}),n=vp(!t?.slug);return(0,R.useMemo)(()=>{const i=t?.limits??{},o={};return Object.entries(i).forEach(([a,s])=>{const l=a,u=gp(_p(s),mp(n,t?.slug,yp[l]));u&&(o[l]=u)}),{limits:o,isLoaded:!!r}},[n,t,r])}function zT(){const e=$r()?.id,[t]=VO(),r=vp(!1);return(0,R.useCallback)(async n=>{if(ls()||!e)return;const i=await t(e,!1);return gp(_p(i.data?.limits?.[n]),mp(r,i.data?.slug,yp[n]))},[r,t,e])}var VT=new Set([me.UPLOAD_IMAGE_MODAL,me.UPLOAD_BACKGROUND_MODAL,me.UPLOAD_IMAGE_MODAL_AI,me.UPLOAD_BACKGROUND_MODAL_AI,me.UPLOAD_IMAGE_MODAL_STOCK,me.UPLOAD_BACKGROUND_MODAL_STOCK,me.UPLOAD_IMAGE_MODAL_GIF,me.UPLOAD_BACKGROUND_MODAL_GIF,me.UPLOAD_IMAGE_MODAL_EDIT,me.UPLOAD_BACKGROUND_MODAL_EDIT,me.UPLOAD_IMAGE_MODAL_UPLOAD,me.UPLOAD_BACKGROUND_MODAL_UPLOAD]),WT=new Set([me.UPLOAD_IMAGE_MODAL_EDIT,me.UPLOAD_BACKGROUND_MODAL_EDIT]);function QT(e){return!!e&&WT.has(e)}function KT(e){return!!e&&VT.has(e)}function YT(e){if(!(e==null||e===""))return e}async function XT(e,t){if(e){if(e.url)return e.url;if(typeof t.getFileById=="function"&&e.id){const r=await t.getFileById(e.id);if(r?.url)return r.url;if(r?.thumbnailUrl)return r.thumbnailUrl;if(r?.thumbnail)return r.thumbnail}if(typeof t.getFileUrl=="function"&&e.folderId!==void 0&&e.name){const r=await t.getFileUrl(e.folderId||"",e.name);if(r)return r}if(typeof t.getUrl=="function"&&e.name){const r=await t.getUrl(e);if(r)return r}return e.thumbnail||e.thumbnailUrl}}function JT(e){if(!(!e?.success||!Array.isArray(e.detailed)))return e.detailed.find(t=>t?.success&&t.data)?.data}function ZT(e,t,r){if(e)return{id:e.id,name:e.name||t.name,size:e.size??t.size,type:e.type||t.type,folderId:e.folderId??r??"",url:e.url,thumbnail:e.thumbnail,thumbnailUrl:e.thumbnailUrl,date:e.date,dimensions:e.dimensions,aspectRatio:e.aspectRatio,extension:e.extension,selected:e.selected,isFolder:e.isFolder,lastEdited:e.lastEdited,childrenCount:e.childrenCount}}async function eA(e,t,r){if(!t)return;const n=YT(r??t.rootId);let i;typeof t.uploadFiles=="function"?i=JT(await t.uploadFiles({folderId:n,items:[{name:e.name,size:e.size,type:e.type,folderId:n,data:e}]})):typeof t.uploadFile=="function"&&(i=ZT(await t.uploadFile({name:e.name,size:e.size,type:e.type,folderId:n,data:e}),e,n));const o=await XT(i,t);return o?{item:i,url:o}:void 0}function tA(e){for(let t=e.length-1;t>=0;t--){const r=e[t];if(typeof r=="string"&&r)return r}}function rA(e){for(let t=0;t<e.length;t++){const r=e[t];if(r instanceof Blob)return r}}function nA(e,t){for(let r=e.length-1;r>=0;r--){const n=e[r];if(typeof n=="string"&&n&&n!==t)return n}}var iA="Image upload rejected by handleLoadImage";async function oA(e,t){const r=e.hasListeners(),n=await e.fireSettled(t);return{url:tA(n.results),hasHostListener:r,hostFailed:n.errors.length>0,error:n.errors[0]}}function aA(e,t={}){return e.url||e.hostFailed?!1:t.isStandalone?!(e.hasHostListener||t.targetIsOurBackend):!0}function sA(e){return e.error instanceof Error&&e.error.message?e.error:typeof e.error=="string"&&e.error?new Error(e.error):new Error(iA)}function bp(e){if(!e)return!1;try{return e.getInstance(O.SECURITY_MODULE_ID)!==void 0}catch{return!1}}function uA(){const e=ve();return(0,R.useMemo)(()=>bp(O.getContainer(e)),[e])}var lA=class{http;constructor(e){this.http=e}cache_clear_create=(e,t={})=>this.http.request({path:"/em-files/v1/cache/clear",method:"POST",body:e,type:O.ContentType.UrlEncoded,...t})},cA=class{http;constructor(e){this.http=e}empty_trash_create=(e,t={})=>this.http.request({path:"/em-files/v1/empty-trash",method:"POST",body:e,type:O.ContentType.UrlEncoded,...t})},dA=class{http;constructor(e){this.http=e}files_list=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"GET",query:e,format:"json",...t});files_create=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"POST",body:e,type:O.ContentType.UrlEncoded,format:"json",...t});files_delete=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"DELETE",body:e,type:O.ContentType.UrlEncoded,format:"json",...t});files_partial_update=(e,t={})=>this.http.request({path:"/em-files/v1/files",method:"PATCH",body:e,type:O.ContentType.UrlEncoded,format:"json",...t});files_upload_by_url_create=(e,t={})=>this.http.request({path:"/em-files/v1/files/upload-by-url",method:"POST",body:e,type:O.ContentType.UrlEncoded,format:"json",...t});files_rename_partial_update=(e,t={})=>this.http.request({path:"/em-files/v1/files/rename",method:"PATCH",body:e,type:O.ContentType.UrlEncoded,format:"json",...t})},fA=class{http;constructor(e){this.http=e}folders_list=(e,t={})=>this.http.request({path:"/em-files/v1/folders",method:"GET",query:e,format:"json",...t});folders_create=(e,t={})=>this.http.request({path:"/em-files/v1/folders",method:"POST",body:e,type:O.ContentType.UrlEncoded,format:"json",...t});folders_delete=(e,t={})=>this.http.request({path:"/em-files/v1/folders",method:"DELETE",body:e,type:O.ContentType.UrlEncoded,format:"json",...t})},pA=class{http;constructor(e){this.http=e}items_move_partial_update=(e,t={})=>this.http.request({path:"/em-files/v1/items/move",method:"PATCH",body:e,type:O.ContentType.UrlEncoded,format:"json",...t})},hA=[lA,cA,dA,fA,pA];function Ep(e){const t=Ra(Ft.em_filemanager_v2);return t!==void 0?t:e?.fileManagerV2Enabled!==void 0?!!e.fileManagerV2Enabled:!0}var Sp=(e,t)=>t.some(r=>r instanceof RegExp?r.test(e):r===e),mA=new Set(["https:","http:","file:"]),gA=e=>{const t=e.indexOf(":");if(t<=0)return!1;const r=e.substring(0,t+1);return/^[a-zA-Z][a-zA-Z0-9+\-.]*:$/.test(r)?r.endsWith(":")&&!r.includes(".")&&!mA.has(r):!1};function Ri(e,t){if(t={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...t},!e)return"";if(Pp(e)&&(e=cs(e)),typeof t.defaultProtocol=="string"&&!t.defaultProtocol.endsWith(":")&&(t.defaultProtocol=`${t.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e)||gA(e))return e;const r=e.startsWith("//"),n=!r&&/^\.*\//.test(e);let i;try{i=n?new URL(e,typeof document<"u"?document.baseURI:"http://localhost/").toString():e}catch{i=e}let o;try{o=new URL(i)}catch{const s=document.createElement("a");s.href=e,o=new URL(s.href)}if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),t.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),t.stripAuthentication&&(o.username="",o.password=""),t.stripHash?o.hash="":t.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){const s=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let l=0,u="";for(;;){const d=s.exec(o.pathname);if(!d)break;const f=d.index,m=o.pathname.slice(l,f);u+=m.replace(/\/{2,}/g,"/"),u+=d[0],l=f+d[0].length}const c=o.pathname.slice(l);u+=c.replace(/\/{2,}/g,"/"),o.pathname=u;try{o.pathname=decodeURI(o.pathname)}catch{}}if(t.removeDirectoryIndex){let s=o.pathname.split("/");const l=s[s.length-1];Array.isArray(t.removeDirectoryIndex)&&Sp(l,t.removeDirectoryIndex)&&(s=s.slice(0,-1),o.pathname=s.join("/")+"/")}if(t.stripWWW&&/^www\.(?!www\.)[a-z\d\-]+(\.[a-z.\-]{2,63})+$/.test(o.hostname||"")&&(o.hostname=o.hostname.replace(/^www\./,"")),Array.isArray(t.removeQueryParameters))for(const s of[...o.searchParams.keys()])Sp(s,t.removeQueryParameters)&&o.searchParams.delete(s);if(t.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}t.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,"")),t.removeExplicitPort&&o.port&&(o.port="");let a=o.toString();return!t.removeSingleSlash&&o.pathname==="/"&&!e.endsWith("/")&&o.hash===""&&(a=a.replace(/\/$/,"")),(t.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&t.removeSingleSlash&&(a=a.replace(/\/$/,"")),r&&!t.normalizeProtocol&&(a=a.replace(/^https?:\/\//,"//")),a}function Pp(e){if(!e)return!1;const t=e[0];return e.startsWith("/")||e.startsWith("./")||e.startsWith("../")||yA(t)}function yA(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122}function vA(e){return/^(mailto:|tel:|fax:|sms:|geo:|blob:|data:|javascript:)/i.test(e)}function cs(e){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||!Pp(e)||vA(e))return e;if(e.startsWith("/"))return window.location.origin+e;const t=window.location.href,r=t.lastIndexOf("/");return(r!==-1?t.slice(0,r+1):t+"/")+e}var ds=null;function wp(){return ds===null&&(ds=(0,gt.__vitePreload)(()=>Promise.resolve().then(()=>ye("./8a5b1c18.js")).then(e=>e.default),void 0,{}.url)),ds}async function Ip(e){return(await wp()).getType(e)}async function _A(e){return(await wp()).getExtension(e)}var ne=class Am extends Error{code;status;details;get httpStatus(){return this.status}constructor(t,r,n,i){super(t),this.name="FileManagerApiError",this.code=r,this.status=n,this.details=i,Error.captureStackTrace&&Error.captureStackTrace(this,Am)}},bA="Edited",EA=1e4;function Di(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 409:return"FolderAlreadyExists";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}var Cp={file_too_large:"FileTooLarge",file_size_exceeded:"FileTooLarge",file_size_limit:"FileTooLarge",invalid_file_name:"FileInvalidName",file_name_invalid:"FileInvalidName",invalid_name:"FileInvalidName",invalid_folder_name:"FolderInvalidName",folder_name_invalid:"FolderInvalidName",folder_invalid_name:"FolderInvalidName",file_type_not_allowed:"FileTypeNotAllowed",unsupported_type:"FileTypeNotAllowed",invalid_format:"FileTypeNotAllowed",batch_limit_exceeded:"BatchItemLimitExceeded",exceeded_max_files:"BatchItemLimitExceeded",file_count_exceeded:"BatchItemLimitExceeded",upload_limit_exceeded:"BatchItemLimitExceeded",too_many_files:"BatchItemLimitExceeded"};function SA(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&!Array.isArray(e)&&"400x400"in e){const t=e["400x400"];return typeof t=="string"?t:void 0}}function PA(e){const t=e.is_folder;if(t===!0||t===1)return!0;if(t===!1||t===0)return!1;if(typeof t=="string"){const n=t.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no"||n==="")return!1}if(String(e.item_type??"").toLowerCase()==="folder")return!0;const r=String(e.type??"").toLowerCase();return!!(r==="folder"||r==="directory"||r==="dir"||r==="inode/directory"||r==="application/x-directory"||r==="httpd/unix-directory"||r.endsWith("/directory"))}function an(e){if(!e)return["",""];const t=e.replaceAll("\\","/").split("/").filter(Boolean),r=t.pop()||"";return[t.join("/"),r]}function wA(e,t){if(!e)return"";const r=new RegExp(`^/?${t}/?`);return e.replace(r,"")}function IA(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{const i=n.result.toString().split(",")[1];t(i)},n.onerror=r,n.readAsDataURL(e)})}var CA=class{_api;_projectId;i18n;pathPostfix;appConfig;isStandalone;pathMode=!0;rootId="";trashPath="trash";tempPath=bA;constructor(e){this._api=e.restApi,this._projectId=e.projectId,this.i18n=e.i18n||xa,this.pathPostfix=e.pathPostfix,this.appConfig=e.appConfig,this.isStandalone=!!e.isStandalone}removePrefix(e){let t=wA(e,this._projectId);if(this.pathPostfix){const r=new RegExp(`^/?${this.pathPostfix}/?`);t=t.replace(r,"")}return t}handleError(e,t){const{__:r}=this.i18n;if(e instanceof Error)throw e instanceof ne?e:new ne(e.message,t||"BackendError");const n=e.data,i=n?.message||r("Unknown error"),o=n?.data?.status??n?.status,a=n?.code,s=t||(a?Cp[a]:void 0)||(typeof o=="number"?Di(o):void 0)||"BackendError";throw new ne(i,s,o)}convertRestError(e,t){const{__:r}=this.i18n;if(e instanceof ne||e instanceof Error)return e;if(e&&typeof e=="object"&&"data"in e&&!(e instanceof Error)){const n=e.data,i=n?.message||r("Unknown error"),o=n?.data?.status??n?.status,a=n?.code;return{message:i,code:t||(a?Cp[a]:void 0)||(o?Di(o):void 0)||"BackendError",status:o,raw:e}}return e??{message:r("Unknown error")}}async getFolders({parentId:e}){const t=await this._api.folders_list({project_id:this._projectId,path_folder:e,per_page:EA},{type:O.ContentType.Json});if(t.error){if(this.isPathFolderNotFound(t.error))return[];this.handleError(t.error)}return await t.data.folders.map(r=>({id:this.removePrefix(r.full_path),name:r.name,folderId:this.removePrefix(r.parent_folder),childrenCount:r.files_count+r.folders_count,isFolder:!0}))}async getItems(e){if(e.limit===void 0&&(e.limit=Number.MAX_SAFE_INTEGER),e.itemType==="folder")return{items:await this.getFolders({parentId:e.folderId})};let t;try{t=await this._api.files_list({project_id:this._projectId,path_folder:e.folderId,filter_name:e.search,sort_by:e.sortBy,sort_order:e.sortOrder,per_page:e.limit,page:e.page})}catch(a){if(this.isPathFolderNotFound(a)||a?.status===404)return{items:[],pagination:{limit:e.limit,page:1,total:0,totalPages:0}};throw a}const r=t,n=!r.ok&&r.status===404||this.isPathFolderNotFound(t.error);if(t.error||!r.ok){if(n)return{items:[],pagination:{limit:e.limit,page:1,total:0,totalPages:0}};t.error&&this.handleError(t.error)}const i=t.data;let o=(i?.files||[]).map(a=>{const s=a.thumbnail,l=PA(a);return{...a,id:`${this.removePrefix(a.folder)}/${a.name}`,size:Number(a.size),date:a.date||new Date().toISOString(),folderId:this.removePrefix(a.folder),selected:!1,isFolder:l,thumbnail:SA(s)}});return i.total===Number.MAX_SAFE_INTEGER&&(i.total=o.length),e.itemType==="file"&&(o=o.filter(a=>!a.isFolder)),{items:o,pagination:{limit:i.per_page,page:i.page,total:i.total,totalPages:i.total_pages}}}async getFile(e){const t=await O.fetchWithResourceProxy(O.buildCdnFileUrl(this.appConfig,[this._projectId,e]),{config:this.appConfig,standalone:this.isStandalone,resourceType:"cdn",intent:"downloadBlob"});if(t.ok)return t.blob();{const r=await t.text(),n=Di(t.status,"FileReadError"),{__:i}=this.i18n,o=r||i("Failed to get file: %s").replace("%s",t.statusText);throw new ne(o,n,t.status)}}getFileData=async(e,t)=>{const r=e.url||(typeof this.getUrl=="function"?this.getUrl(e):""),n=await O.fetchWithResourceProxy(r,{config:this.appConfig,standalone:this.isStandalone,resourceType:O.isCdnUrl(r,this.appConfig)?"cdn":"generic",intent:"downloadBlob",init:t?.forceReload?{cache:"no-store"}:void 0});if(n.ok)return n.blob();const i=await n.text(),o=Di(n.status,"FileReadError"),{__:a}=this.i18n,s=i||a("Failed to get file: %s").replace("%s",n.statusText);throw new ne(s,o,n.status)};isPathFolderNotFound(e){if(!e||typeof e!="object"||e instanceof Error)return!1;const t=e;return t.code==="path_folder_not_found"||t.data?.code==="path_folder_not_found"||t.data?.data?.status===404}async deleteItem(e,t){if(e.isFolder){const r=await this._api.folders_delete({path_folder:e.id,project_id:this._projectId,force:t.permanent},{type:O.ContentType.Json});if(r.error){if(this.isPathFolderNotFound(r.error)){await this.clearCache(e.folderId??void 0);return}this.handleError(r.error,"FolderNotFound")}await this.clearCache(e.folderId??void 0)}else{const r=await this._api.files_delete({project_id:this._projectId,path_folder:e.folderId??"",file_name:[e.name],force:t.permanent},{type:O.ContentType.Json});r.error&&this.handleError(r.error,"FileNotFound")}}async deleteItems(e,t){try{if(e.length===0)return{success:!0};const r=e.filter(i=>i.isFolder),n=e.filter(i=>!i.isFolder);if(r.length>0){const i=new Set(r.map(s=>s.id)),o=r.filter(s=>{const l=s.folderId??"";return!i.has(l)}).map(s=>s.id),a=await this._api.folders_delete({project_id:this._projectId,path_folder:o.length===1?o[0]:o,force:t.permanent},{type:O.ContentType.Json});if(a.error&&!this.isPathFolderNotFound(a.error))return{success:!1,error:this.convertRestError(a.error)};for(const s of r)try{await this.clearCache(s.folderId??void 0)}catch{}}if(n.length>0){const i=new Map;for(const o of n){const a=o.folderId??"";i.has(a)||i.set(a,[]),i.get(a).push(o)}for(const[o,a]of i){const s=await this._api.files_delete({project_id:this._projectId,path_folder:o,file_name:a.map(l=>l.name),force:t.permanent},{type:O.ContentType.Json});if(s.error)return{success:!1,error:this.convertRestError(s.error)}}}return{success:!0}}catch(r){return{success:!1,error:r}}}async createFolder(e,t,r){const{__:n}=this.i18n;if(!e)throw new ne(n("Folder name is required"),"FolderInvalidName");const i=await this._api.folders_create({name:e,project_id:this._projectId,path_folder:t,is_force_create:r},{type:O.ContentType.Json});return i.error&&this.handleError(i.error),{id:this.removePrefix(i.data.full_path),name:i.data.name,folderId:this.removePrefix(i.data.parent_folder),childrenCount:i.data.files_count|i.data.folders_count,isFolder:!0}}async _uploadFile(e){const{__:t}=this.i18n;if(!e.name||!e.data)throw new ne(t("Invalid file data"),"ValidationError");const r=await this._api.files_create({file:e.data instanceof File?e.data:new File([e.data],e.name,{type:e.type}),path_folder:e.folderId,project_id:this._projectId},{type:O.ContentType.FormData});r.error&&this.handleError(r.error);const n=r.data instanceof Array?r.data[0]:r.data;if(!n)throw new ne(t("File upload failed"),"ValidationError");return{...n,id:this.removePrefix(n.folder)+"/"+n.name,size:Number(n.size),folderId:this.removePrefix(n.folder),date:n.date||new Date().toISOString(),selected:!1,isFolder:!1,thumbnail:n.thumbnail?.["400x400"]}}async uploadFiles(e){try{const t=e.items.map(n=>{if(n.data instanceof File)return n.data;const i=n.name||"file",o=n.data.type||n.type||"application/octet-stream";return new File([n.data],i,{type:o})}),r=await this._api.files_create({project_id:this._projectId,path_folder:e.folderId,file:t},{type:O.ContentType.FormData});return r.error?{success:!1,error:this.convertRestError(r.error)}:{success:!0,detailed:(Array.isArray(r.data)?r.data:[r.data]).map(n=>({success:!0,data:{id:[this.removePrefix(n.folder),n.name].filter(Boolean).join("/"),name:n.name,size:Number(n.size),folderId:this.removePrefix(n.folder),type:n.type,date:n.date||new Date().toISOString(),selected:!1,isFolder:!1,thumbnail:n.thumbnail?.["400x400"]}}))}}catch(t){return{success:!1,error:t}}}async renameItem(e,t){const{__:r}=this.i18n;if(!t){const s=e.isFolder?"FolderInvalidName":"FileInvalidName",l=e.isFolder?r("New folder name is required"):r("New file name is required");throw new ne(l,s)}const[n,i]=an(e.id),o=await this._api.files_rename_partial_update({file_name:i,new_name:t,path_folder:n,project_id:this._projectId,is_folder:e.isFolder},{type:O.ContentType.Json});o.error&&this.handleError(o.error);const a=o.data;return{id:this.removePrefix(a.folder)+"/"+a.name,name:a.name,folderId:this.removePrefix(a.folder)}}async moveItems(e,t){try{const r=e.map(i=>an(i.id)),n=await this._api.items_move_partial_update({file_name:r.map(i=>i[1]),target_folder:t,path_folder:r[0][0],project_id:this._projectId},{type:O.ContentType.Json});return n.error?{success:!1,error:this.convertRestError(n.error)}:{success:!0,detailed:n.data.results.map(i=>({success:i.success,error:this.convertRestError(i.error),data:{id:[this.removePrefix(i.new_path||""),i.item_name].filter(o=>o).join("/")}}))}}catch(r){return this.convertRestError(r),{success:!1,error:r}}}async copyItem(e,t){const[r,n]=an(e.id),i=await this._api.items_move_partial_update({file_name:n,target_folder:t,path_folder:r,project_id:this._projectId,is_copy:!0},{type:O.ContentType.Json});return i.error&&this.handleError(i.error),{id:[t,n].filter(o=>o).join("/")}}async copyItems(e,t){try{const r=e.map(i=>an(i.id)),n=await this._api.items_move_partial_update({file_name:r.map(i=>i[1]),target_folder:t,path_folder:r[0][0],project_id:this._projectId,is_copy:!0},{type:O.ContentType.Json});return n.error?{success:!1,error:this.convertRestError(n.error)}:{success:!0,detailed:n.data.results.map((i,o)=>({success:i.success,error:this.convertRestError(i.error),requestId:e[o].id,data:{id:[this.removePrefix(i.new_path||""),i.item_name].filter(a=>a).join("/")}}))}}catch(r){return{success:!1,error:this.convertRestError(r)}}}async uploadFileByUrl(e,t,r){const n=cs(e);try{if(n.startsWith("http://localhost")||n.startsWith("https://localhost")||this.appConfig?.resourceProxy||this.isStandalone){const a=await(await O.fetchWithResourceProxy(n,{config:this.appConfig,standalone:this.isStandalone,resourceType:r?.eventSource==="imageStock"?"stockImages":"generic",intent:"downloadBlob"})).blob();return this._uploadFile({name:n.split("/").pop()||"file",size:a.size,folderId:t,data:a,type:await Ip(n)||"application/octet-stream"})}const i=await this._api.files_upload_by_url_create({url:n,path_folder:t,project_id:this._projectId},{type:O.ContentType.Json});i.error&&this.handleError(i.error);const o=i.data instanceof Array?i.data[0]:i.data;return{id:`${this.removePrefix(o.folder)}/${o.name}`,name:o.name,size:Number(o.size),type:o.type,folderId:this.removePrefix(o.folder)||null,date:o.date||new Date().toISOString(),url:o.url}}catch(i){throw i}}async updateFile(e,t){const[r,n]=an(e.id),i=await this._api.files_partial_update({file_name:n,project_id:this._projectId,path_folder:r,updates:{data:typeof t.data=="string"?t.data:await IA(t.data),name:t.name}},{type:O.ContentType.Json});if(i.error)this.handleError(i.error);else{const o=i.data;return{...o,id:`${this.removePrefix(o.folder)}/${o.name}`,size:Number(o.size),folderId:this.removePrefix(o.folder),date:o.date||new Date().toISOString(),thumbnail:o.thumbnail?.["400x400"],selected:!1}}}findFileByUrl(e,t){const r=O.unwrapResourceProxyUrl(e,this.appConfig),n=O.buildCdnFileUrl(this.appConfig,[]);if(n&&Ri(r).startsWith(Ri(n))){const i=r.replace(Ri(n)+"/","").split("/").filter(Boolean);if(i[0]===this._projectId){const o=this.removePrefix(i.slice(1,-1).join("/")),a=i[i.length-1];if(!t||o===this.removePrefix(t))return{id:[o,a].filter(Boolean).join("/"),name:a,folderId:o,isFolder:!1,url:r}}}}async clearCache(e){const t={project_id:this._projectId,path_folder:e||void 0},r=await this._api.cache_clear_create(t);r.error&&this.handleError(r.error)}getUrl=e=>O.buildCdnFileUrl(this.appConfig,[this._projectId,this.pathPostfix,e.folderId,e.name]);getThumbnailUrl=e=>{const t=e.name.lastIndexOf("."),r=t>0?e.name.slice(0,t):e.name,n=t>0?e.name.slice(t+1):"";return O.buildCdnFileUrl(this.appConfig,[this._projectId,this.pathPostfix,".thumbs",e.folderId,r,r+"-400x400."+n])};async cleanTrash(){try{const e=await this._api.empty_trash_create({project_id:this._projectId},{type:O.ContentType.UrlEncoded});e.error&&this.handleError(e.error,"BackendError");const t=e.data;return{success:t?.success??!0,deletedCount:t?.deleted_count??0}}catch(e){if(e instanceof ne)throw e;const{__:t}=this.i18n;throw new ne(t("Failed to clean trash"),"BackendError")}}},B=class Mm extends Error{constructor(t,r,n,i){super(t),this.code=r,this.status=n,this.details=i,this.name="FileManagerApiError",Error.captureStackTrace&&Error.captureStackTrace(this,Mm)}},sn="",or=class{constructor(){this.map=new Map}static childrenViewKey(e,t){return`v${sn}${e}${sn}${t}`}static childrenCountKey(e){return`c${sn}${e}`}getFreshError(e,t){let r=this.map.get(e);return r?t!==1/0&&Date.now()-r.updatedAt>t?(this.map.delete(e),null):r.error:null}setError(e,t){this.map.set(e,{error:t,updatedAt:Date.now()})}delete(e){this.map.delete(e)}clearChildrenViewErrorsForParent(e){let t=`v${sn}${e}${sn}`;for(let r of[...this.map.keys()])r.startsWith(t)&&this.map.delete(r)}clearAll(){this.map.clear()}},OA=class{constructor(){this.deletingIds=new Set}beginDeleting(e){for(let t of e)t&&this.deletingIds.add(t)}endDeleting(e){for(let t of e)t&&this.deletingIds.delete(t)}isDeleting(e){return!!e&&this.deletingIds.has(e)}};function Op(e){return{sortBy:e?.sortBy??"name",sortOrder:e?.sortOrder==null?e?.sortBy!=null&&e.sortBy!==""?"desc":"asc":e.sortOrder==="desc"?"desc":"asc"}}function Tp(e,t,r){let{sortBy:n,sortOrder:i}=Op(r),o=0;switch(n){case"name":o=(e.name||"").localeCompare(t.name||"");break;case"date":o=new Date(e.date||0).getTime()-new Date(t.date||0).getTime();break;case"size":o=(Number(e.size)||0)-(Number(t.size)||0);break;case"type":o=(e.extension||e.type||"").toLowerCase().localeCompare((t.extension||t.type||"").toLowerCase());break;default:o=(e.name||"").localeCompare(t.name||"")}return i==="desc"?-o:o}function ji(e){return e!=null&&String(e).trim()!==""}function TA(e,t){let{sortBy:r}=Op(t);switch(r){case"date":return ji(e.date)?!Number.isNaN(new Date(e.date).getTime()):!1;case"size":return e.size!=null&&Number.isFinite(Number(e.size));case"type":return ji(e.extension)||ji(e.type);default:return ji(e.name)}}function AA(e,t){let r=typeof t?.search=="string"?t.search.trim():"";if(!r)return!0;let n=r.toLowerCase();return(e.name?.toLowerCase().includes(n)??!1)||(e.type?.toLowerCase().includes(n)??!1)||(e.extension?.toLowerCase().includes(n)??!1)}var MA=Tp,NA=AA,RA=TA;function Ap(e={}){return{...e,comparator:e.comparator??MA,filterMatch:e.filterMatch??NA,hasSortValue:e.hasSortValue??RA}}var $e="Trash";function Ce(e){return e.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"")}function Mp(e,t,r=$e){let n=Ce(e);if(!n)return[];let i=[e,n];if(n===Ce(t)){i.push(t);let o=Ce(t);o==="Trash"||o.toLowerCase()==="trash"?i.push(r,$e,$e.toLowerCase()):r!=="Trash"&&Ce(r)!==o&&i.push(r)}return Array.from(new Set(i.map(Ce).filter(Boolean)))}function DA(e){let t=new Map;for(let[r,n]of Object.entries(e))n.id&&t.set(Ce(r),n);return r=>{let n=t.get(Ce(r));if(n)return{id:n.id,name:n.name??n.id,folderId:n.folderId??null,isFolder:!0}}}function _e(){if(typeof globalThis?.crypto?.randomUUID=="function")return globalThis.crypto.randomUUID();try{let e=globalThis.crypto||globalThis.msCrypto;if(e&&typeof e.getRandomValues=="function"){let t=new Uint8Array(16);e.getRandomValues(t);let r="";for(let n=0;n<t.length;n++)r+=t[n].toString(16).padStart(2,"0");return`id_${r}`}}catch{}return`id_fallback_${Date.now().toString(36)}_${Math.floor(Math.random()*(2**53-1)).toString(36).slice(0,8)}`}var jA=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function Np(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function FA(e){let t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),(t.protocol==="https:"&&t.port==="443"||t.protocol==="http:"&&t.port==="80")&&(t.port="");let r=(t.search.startsWith("?")?t.search.slice(1):t.search).split("&").filter(Boolean).map(n=>{let i=n.indexOf("="),o=i===-1?n:n.slice(0,i),a=i===-1?"":n.slice(i+1);return{pair:n,key:Np(o),value:Np(a)}}).filter(({key:n})=>!jA.test(n)).sort((n,i)=>{let o=n.key.localeCompare(i.key);return o===0?n.value.localeCompare(i.value):o});return t.search=r.length?`?${r.map(({pair:n})=>n).join("&")}`:"",t.toString()}function Rp(e){try{return FA(e)}catch{return e.trim()}}var Dp="",fs=18e5;function fe(e){return e==null||e===""?Dp:e}function ps(e){if(e==null)return 1/0;let t=Number(e);return Number.isFinite(t)&&t>=0?t:1/0}function LA(e){return!e||typeof e.search!="string"?!1:e.search.trim().length>0}function Oe(e){if(!e)return null;let t=e.folderId;return t==null?null:String(t)}function J(e){return!!e&&!!e.isFolder}function jp(e){if(!e||typeof e!="object")return!1;let t=e;return t.code==="path_folder_not_found"||t.code==="folder_not_found"||t.code==="FolderNotFound"||t.data?.code==="path_folder_not_found"||t.data?.code==="folder_not_found"||t.status===404||t.data?.data?.status===404}function kA(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t.toString(36)}function xe(e){if(!e||typeof e!="object")return String(e??"");let t=e,r=[],n={},i=["page","pageSize","sortBy","sortOrder","search","itemType","limit"];for(let l of Object.keys(t).sort()){let u=t[l];i.includes(l)?r.push(`${l}=${String(u??"")}`):n[l]=u}let o=Object.keys(n).length?JSON.stringify(n):"",a=r.join("|"),s=o?kA(o):"";return`${a}${s?`|${s}`:""}`}var Fp=class Nm{constructor(){this.entities=new Map,this.childrenByParent=new Map,this.maxCacheSize=1e4}now(){return Date.now()}checkCacheSize(){if(this.entities.size>this.maxCacheSize){let t=Array.from(this.entities.entries()).sort((n,i)=>n[1].updatedAt-i[1].updatedAt),r=Math.floor(this.maxCacheSize*.1);for(let n=0;n<r&&n<t.length;n++){let[i,o]=t[n];this.deleteEntityById(i)}}}getEntity(t){return this.entities.get(t)?.value}getRecord(t){return this.entities.get(t)}getFileSystemItem(t){let r=this.getEntity(t);return r&&!J(r)?r:void 0}getFolder(t){let r=this.getEntity(t);return r&&J(r)?r:void 0}getChildrenIds(t,r={}){let n=fe(t),i=this.childrenByParent.get(n);return i?r.onlyFileSystemItems?Array.from(i.files):r.onlyFolders?Array.from(i.folders):[...Array.from(i.folders),...Array.from(i.files)]:[]}searchByUrl(t){let r=Rp(t);for(let n of this.entities.values()){let i=n.value.url;if(i&&(i===t||Rp(i)===r))return n.value}return null}upsertEntity(t){let r=this.entities.get(t.id)??null,n=r?r.value:null,i=n?Oe(n):null,o=Oe(t),a=n?J(n):!1,s=J(t),l;if(n&&J(n)&&s){let f=n.childrenCount,m=t.childrenCount;f!==void 0&&m===void 0&&(l=f)}if(n&&(i!==o||a!==s)){let f=fe(i),m=this.childrenByParent.get(f);m&&(a?m.folders.delete(t.id):m.files.delete(t.id),m.files.size===0&&m.folders.size===0&&this.childrenByParent.delete(f))}let u=t;l!==void 0&&(u={...t,childrenCount:l}),this.entities.set(t.id,{value:{...u},updatedAt:this.now()}),this.checkCacheSize();let c=fe(o),d=this.childrenByParent.get(c);d||(d={files:new Set,folders:new Set},this.childrenByParent.set(c,d)),s?d.folders.add(t.id):d.files.add(t.id)}updateServerChildrenCount(t,r){if(t==null||r==null||Number.isNaN(r))return;let n=this.entities.get(t);if(!n||!J(n.value))return;let i={...n.value,childrenCount:r};this.entities.set(t,{value:i,updatedAt:this.now()})}deleteEntityById(t){let r=this.entities.get(t)??null;if(!r)return{entity:null,parentId:null};let n=r.value,i=Oe(n),o=fe(i),a=this.childrenByParent.get(o);return a&&(J(n)?a.folders.delete(t):a.files.delete(t),a.files.size===0&&a.folders.size===0&&this.childrenByParent.delete(o)),this.entities.delete(t),{entity:{...n},parentId:i}}deleteFolderRecursive(t){let r=this.entities.get(t);if(!r||!J(r.value))return{deletedFolderRecords:[],deletedFileSystemItemRecords:[]};let n=[{id:t,parentId:Oe(r.value)}],i=[],o=[];for(;n.length;){let l=n.shift();i.push(l);let u=this.childrenByParent.get(fe(l.id));if(u){for(let c of Array.from(u.folders)){let d=this.entities.get(c);d&&n.push({id:c,parentId:Oe(d.value)})}for(let c of Array.from(u.files))o.push(c)}}let a=[];for(let l of o){let u=this.entities.get(l);if(!u)continue;let c=u.value,d=fe(Oe(c)),f=this.childrenByParent.get(d);f&&(f.files.delete(l),f.files.size===0&&f.folders.size===0&&this.childrenByParent.delete(d)),this.entities.delete(l),a.push({...c})}let s=[];for(let l=i.length-1;l>=0;l--){let{id:u,parentId:c}=i[l],d=this.entities.get(u);if(!d)continue;let f=d.value,m=fe(f.id);this.childrenByParent.delete(m);let g=fe(c),h=this.childrenByParent.get(g);h&&(h.folders.delete(u),h.files.size===0&&h.folders.size===0&&this.childrenByParent.delete(g)),this.entities.delete(u),s.push({...f})}return{deletedFolderRecords:s,deletedFileSystemItemRecords:a}}moveEntityById(t,r){let n=this.entities.get(t)??null;if(!n)return null;let i=n.value,o=fe(Oe(i)),a=this.childrenByParent.get(o);a&&(J(i)?a.folders.delete(t):a.files.delete(t),a.files.size===0&&a.folders.size===0&&this.childrenByParent.delete(o));let s={...i,folderId:r};if(J(i)&&J(s)){let c=i.childrenCount;c!==void 0&&(s.childrenCount=c)}this.entities.set(t,{value:s,updatedAt:this.now()});let l=fe(r),u=this.childrenByParent.get(l);return u||(u={files:new Set,folders:new Set},this.childrenByParent.set(l,u)),J(s)?u.folders.add(t):u.files.add(t),{...s}}copyFileSystemItem(t,r,n){let i=this.entities.get(t)??null;if(!i||J(i.value))return null;let o={...i.value,id:r,folderId:n};return this.upsertEntity(o),{...o}}copyFolderShallow(t,r,n){let i=this.entities.get(t)??null;if(!i||!J(i.value))return null;let o={...i.value,id:r,folderId:n};return this.upsertEntity(o),{...o}}isEntityStale(t,r){let n=this.entities.get(t)??null;return!n||r!==1/0&&this.now()-n.updatedAt>r}touch(t,r){let n=this.entities.get(t);n&&(n.updatedAt=r??this.now())}getEntitiesByIds(t){return t.map(r=>this.entities.get(r)?.value??null)}searchByName(t,r){if(!t||t.trim()==="")return[];let n=r?.parentId,i=r?.recursive??!1,o=r?.itemType??"all",a=r?.caseSensitive??!1,s=r?.limit??1/0,l=a?t.trim():t.trim().toLowerCase(),u=[],c=null;if(n!==void 0){c=new Set;let d=fe(n);if(c.add(d),i){let f=[d],m=new Set;for(;f.length>0;){let g=f.shift();if(m.has(g))continue;m.add(g);let h=this.childrenByParent.get(g);if(h)for(let b of h.folders)c.add(b),f.push(b)}}}for(let[,d]of this.entities){if(u.length>=s)break;let f=d.value;if(c!==null){let g=fe(Oe(f));if(!c.has(g))continue}if(o==="file"&&J(f)||o==="folder"&&!J(f))continue;let m=f.name??"";(a?m:m.toLowerCase()).includes(l)&&u.push({...f})}return u}toJSON(){return{entities:Array.from(this.entities.entries()),childrenByParent:Array.from(this.childrenByParent.entries()).map(([t,r])=>[t,{files:Array.from(r.files),folders:Array.from(r.folders)}])}}static fromJSON(t){let r=new Nm;for(let[n,i]of t.entities??[])r.entities.set(n,{value:i.value,updatedAt:i.updatedAt});for(let[n,i]of t.childrenByParent??[])r.childrenByParent.set(n,{files:new Set(i.files),folders:new Set(i.folders)});return r}},Lp=class Rm{constructor(t={},r=fs,n,i,o=new or,a=jp){this.views=new Map,this.maxViewsPerParent=50;let s=Ap(t);this.strategy={allowSortedInsert:s.allowSortedInsert??!0,allowSearchInsert:s.allowSearchInsert??!0,invalidateOnPaginationFull:s.invalidateOnPaginationFull??!0,preloadPagesBefore:s.preloadPagesBefore??0,preloadPagesAfter:s.preloadPagesAfter??1,comparator:s.comparator,filterMatch:s.filterMatch,hasSortValue:s.hasSortValue},this.ttl=r,this.errorTtl=n??r,this.entityTtl=i??r,this.failedRequests=o,this.isFolderNotFoundError=a}setServerChildrenCountHandler(t){this.serverChildrenCountHandler=t}setChildrenCountInvalidator(t){this.childrenCountInvalidator=t}now(){return Date.now()}parentKey(t){return fe(t??null)}isExpired(t){return t==null||this.ttl!==1/0&&this.now()-t>this.ttl}areEntitiesStale(t,r){return!t||t.some(n=>!r.getEntity(n)||r.isEntityStale(n,this.entityTtl))}isEntityTypeCompatible(t,r){return!!(!r||r==="all"||r==="file"&&!J(t)||r==="folder"&&J(t))}markViewStaleForReload(t){t.view.meta={...t.view.meta??{},stale:!0},t.view.updatedAt=this.now(),t.view.loadId=_e(),t.view.abortController&&(t.view.abortController.abort(),t.view.abortController=void 0)}cleanupOldViews(t){if(t.size<=this.maxViewsPerParent)return;let r=Array.from(t.entries()).sort((n,i)=>(i[1].view.updatedAt||0)-(n[1].view.updatedAt||0));for(;t.size>this.maxViewsPerParent&&r.length>0;){let[n]=r.pop();t.delete(n)}}async getOrCreateChildren(t,r,n,i){let o=this.parentKey(t),a=xe(r??{}),s=this.views.get(o);s||(s=new Map,this.views.set(o,s));let l=or.childrenViewKey(o,a),u=s.get(a);u||(u={params:r,view:{promise:null,value:void 0,meta:void 0,updatedAt:0,loadId:null}},s.set(a,u),this.cleanupOldViews(s));let c=this.failedRequests.getFreshError(l,this.errorTtl);if(c!=null)throw c;if(u.view.value&&!this.isExpired(u.view.updatedAt)&&!this.areEntitiesStale(u.view.value,i)&&!u.view.meta?.stale){let m=u.view.value.map(h=>i.getEntity(h)).filter(Boolean),g=u.params?.itemType||"all";return{items:m.filter(h=>this.isEntityTypeCompatible(h,g)),...u.view.meta??{}}}if(u.view.promise)return u.view.promise;let d=_e();u.view.loadId=d;let f=(async()=>{try{let m=await n(t,r),g=LA(r),h=g?{...m,total:void 0}:m,b=this.views.get(o)?.get(xe(r));if(!b||b.view.loadId!==d){let I=Error("StaleLoad");throw I.name="StaleLoad",I}for(let I of h.items)i.upsertEntity(I);u.view.value=h.items.map(I=>I.id);let{items:P,...E}=h,S={...E};u.view.meta=S,u.view.meta&&(u.view.meta.stale=!1),this.failedRequests.delete(l),u.view.updatedAt=this.now(),!g&&typeof S.total=="number"&&(this.serverChildrenCountHandler?this.serverChildrenCountHandler(t??null,S.total,i):i.updateServerChildrenCount(t,S.total));let _=this.strategy.preloadPagesAfter??0,w=this.strategy.preloadPagesBefore??0,v=ps(r?.pageSize);if((_>0||w>0)&&Number.isFinite(v)){let I=t,y={...r},T=typeof S.totalPages=="number"?S.totalPages:1,A=r?.page??1,C=v,N=n,j=d;setTimeout(()=>{this.preloadPagesAsync(I,y,A,T,C,_,w,i,S,N,j)},0)}return h}catch(m){if(m?.name==="StaleLoad")throw this.failedRequests.delete(l),u.view.value=void 0,u.view.updatedAt=this.now(),m;if(this.isFolderNotFoundError(m))return this.failedRequests.delete(l),u.view.value=[],u.view.meta={total:0,totalPages:0},u.view.updatedAt=this.now(),{items:[],total:0,totalPages:0};throw this.failedRequests.setError(l,m),u.view.value=void 0,u.view.updatedAt=this.now(),m}finally{u.view.promise=null}})();return u.view.promise=f,f}async preloadPagesAsync(t,r,n,i,o,a,s,l,u,c,d){try{let f=this.parentKey(t),m=this.views.get(f);if(!m)return;let g=m.get(xe(r));if(!g||d!=null&&g.view.loadId!==d)return;let h=m.get(xe(r));if(!h?.view.meta)return;let b=typeof h.view.meta.totalPages=="number"?h.view.meta.totalPages:1;if(b!==i)return;let P=async E=>{let S={...r,page:E};try{let _=await c(t,S),w=this.views.get(f);if(!w)return;let v=w.get(xe(r));if(!v||d!=null&&v.view.loadId!==d||v.view.loadId!==d)return;for(let T of _.items)l.upsertEntity(T);let I=xe(S),y=w.get(I);if(y||(y={params:S,view:{promise:null,value:void 0,meta:void 0,updatedAt:0,loadId:v.view.loadId}},w.set(I,y),this.cleanupOldViews(w)),!y.view.value||this.isExpired(y.view.updatedAt)){y.view.value=_.items.map(C=>C.id);let{items:T,...A}=_;y.view.meta={...A,page:E,totalPages:b},y.view.updatedAt=this.now()}}catch{}};if(a>0&&n<b)for(let E=1;E<=Math.min(a,b-n);E++){let S=n+E,_=xe({...r,page:S}),w=m.get(_);(!w?.view.value||this.isExpired(w.view.updatedAt))&&P(S)}if(s>0&&n>1)for(let E=1;E<=Math.min(s,n-1);E++){let S=n-E,_=xe({...r,page:S}),w=m.get(_);(!w?.view.value||this.isExpired(w.view.updatedAt))&&P(S)}}catch{}}removeEmptyPageIfNeeded(t,r,n,i,o){if(r.view.value&&r.view.value.length===0&&n<i){let a=xe({...o,page:n});t.delete(a)}}updateTotalPagesForAllViews(t,r){for(let[,n]of t)n.view.meta&&(n.view.meta.totalPages=r)}isParamsSame(t,r){let n=Object.keys(t??{}).filter(o=>o!=="page").sort(),i=Object.keys(r??{}).filter(o=>o!=="page").sort();if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o];if(a!==i[o]||t[a]!==r[a])return!1}return!0}syncTotalsInSameViews(t,r){let n=r.view.meta;if(!n||typeof n.total!="number")return;let i=Number(n.total),o=ps(r.params?.pageSize),a=Number.isFinite(o)&&o>0?Math.max(1,Math.ceil(i/o)):void 0;for(let[,s]of t)this.isParamsSame(s.params??{},r.params??{})&&(s.view.meta||(s.view.meta={}),s.view.meta.total=i,a!==void 0&&(s.view.meta.totalPages=a))}cascadeShiftPages(t,r,n,i,o,a,s){let l=r,u=n,c=!1,d=0;for(;l.view.value&&l.view.value.length<i&&u<o&&d<100;){d++;let f=xe({...s,page:u+1}),m=t.get(f);if(!m?.view.value||this.isExpired(m.view.updatedAt)){l.view.meta={...l.view.meta??{},stale:!0};break}let g=i-l.view.value.length,h=m.view.value.slice(0,g).filter(b=>a.getEntity(b));if(h.length===0){l.view.meta={...l.view.meta??{},stale:!0};break}if(l.view.value=[...l.view.value,...h],l.view.updatedAt=Date.now(),m.view.value=m.view.value.slice(h.length),m.view.updatedAt=Date.now(),m.view.value.length===0){let b=u+1,P=m.view.meta;if(b<(P&&typeof P.totalPages=="number"?P.totalPages:1)){let E=xe({...s,page:b});t.delete(E),c=!0}break}l=m,u++}return(!l.view.value||l.view.value.length<i)&&u>=o&&(l.view.meta={...l.view.meta??{},stale:!0}),c}cascadeShiftToNextPage(t,r,n,i,o,a,s){if(!r.view.value||r.view.value.length<=i)return!1;if(n-(s.page||1)>=10)return r.view.meta={...r.view.meta??{},stale:!0},!1;let l={...s,page:n+1},u=xe(l),c=t.get(u),d=!1;if(!c?.view.value||this.isExpired(c.view.updatedAt))if(n>=o){c={params:l,view:{promise:null,value:void 0,meta:void 0,updatedAt:0,loadId:null}},t.set(u,c),this.cleanupOldViews(t);let g=r.view.meta;g&&(c.view.meta={...g,page:n+1}),d=!0}else return r.view.meta={...r.view.meta??{},stale:!0},!1;let f=r.view.value.slice(i).filter(g=>a.getEntity(g));if(f.length===0)return d&&t.delete(u),!1;r.view.value=r.view.value.slice(0,i),r.view.updatedAt=Date.now(),c.view.value=[...f,...c.view.value??[]],c.view.updatedAt=Date.now();let m=c.view.meta&&typeof c.view.meta.totalPages=="number"?c.view.meta.totalPages:o;if(!d&&this.cascadeShiftToNextPage(t,c,n+1,i,m,a,s))return!0;if(!c.view.value||c.view.value.length===0){let g=n+1,h=c.view.meta,b=h&&typeof h.totalPages=="number"?h.totalPages:1;this.removeEmptyPageIfNeeded(t,c,g,b,s)}return d}canCompareInSortedView(t,r){let n=t.params??{};return!n.sortBy&&!n.sortOrder||!this.strategy.hasSortValue||this.strategy.hasSortValue(r,t.params)}tryInsertSorted(t,r,n){let i=this.strategy.comparator;if(!i||!t.view.value)return!1;let o=t.params?.itemType||"all";if(!this.isEntityTypeCompatible(r,o)||!this.canCompareInSortedView(t,r))return!1;let a=t.view.value.map(u=>n.getEntity(u));if(a.some(u=>!u))return!1;if(a.length===0){let u=t.params??{};if(u.sortBy||u.sortOrder){let c=i(r,r,t.params);if(typeof c!="number"||Number.isNaN(c))return!1}return t.view.value.includes(r.id)?(t.view.updatedAt=this.now(),!0):(t.view.value=[r.id],t.view.updatedAt=this.now(),!0)}let s=0,l=a.length;for(;s<l;){let u=Math.floor((s+l)/2),c=i(r,a[u],t.params);if(typeof c!="number"||Number.isNaN(c))return!1;c>=0?s=u+1:l=u}return t.view.value.includes(r.id)?(t.view.updatedAt=this.now(),!0):(t.view.value=[...t.view.value.slice(0,s),r.id,...t.view.value.slice(s)],t.view.updatedAt=this.now(),!0)}updateChildrenCountForOperation(t,r,n,i){let o=Oe(r);switch(t){case"delete":this.adjustChildrenCount(i,o,-1),this.childrenCountInvalidator?.(o);break;case"insert":case"copy":this.adjustChildrenCount(i,o,1),this.childrenCountInvalidator?.(o);break;case"move":this.adjustChildrenCount(i,n??null,-1),this.adjustChildrenCount(i,o,1),this.childrenCountInvalidator?.(n??null),this.childrenCountInvalidator?.(o)}}adjustChildrenCount(t,r,n){if(!r)return;let i=t.getFolder(r);if(i&&typeof i.childrenCount=="number"){let o=Math.max(0,i.childrenCount+n);t.updateServerChildrenCount(r,o)}}smartInvalidateChildrenViews(t,r,n,i,o,a){if(!r)return;this.updateChildrenCountForOperation(n,r,o,i);let s=this.parentKey(t),l=this.views.get(s);if(l)for(let[,u]of l){let c=u.params??{},d=c?.page??1,f=ps(c?.pageSize),m=Number.isFinite(f),g=!!(c?.sortBy||c?.sortOrder),h=!!c?.search,b=c?.itemType||"all";if(this.isEntityTypeCompatible(r,b)){if(h&&this.strategy.filterMatch&&!this.strategy.filterMatch(r,u.params)){u.view.value?.includes(r.id)&&(u.view.value=u.view.value.filter(P=>P!==r.id),u.view.meta&&typeof u.view.meta.total=="number"&&(u.view.meta.total=Math.max(0,u.view.meta.total-1)),this.markViewStaleForReload(u));continue}if(!u.view.value){u.view.meta&&(u.view.meta.stale=!0),u.view.loadId=_e(),u.view.abortController&&(u.view.abortController.abort(),u.view.abortController=void 0);continue}if(u.view.value.includes(r.id),this.shouldInvalidateCompletely(u,n,r,g,m,d)){this.markViewStaleForReload(u);continue}switch(n){case"delete":this.handleDelete(l,u,d,f,m,r,i);break;case"insert":case"copy":this.handleInsert(l,u,d,f,m,g,r,i);break;case"update":this.handleUpdate(l,u,d,f,m,g,h,r,i);break;case"move":this.handleMove(l,u,d,f,m,g,r,o,i)}}}}shouldInvalidateCompletely(t,r,n,i,o,a){return!!(o&&a>1&&(r==="insert"||r==="delete"||r==="move")||this.isExpired(t.view.updatedAt))}tryReinsertEntity(t,r,n,i,o){let a=t.params?.itemType||"all";if(!this.isEntityTypeCompatible(r,a))return!1;let s=t.params??{};return this.strategy.filterMatch(r,s)?this.tryInsertSorted(t,r,n)?!0:s.sortBy||s.sortOrder?!1:!i||t.view.value.length<o?(t.view.value.push(r.id),!0):!1:!1}handleDelete(t,r,n,i,o,a,s){let l=r.view.value.includes(a.id);if(l&&(r.view.value=r.view.value.filter(u=>u!==a.id)),r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total=Math.max(0,r.view.meta.total-1),o&&Number.isFinite(i)&&typeof r.view.meta.total=="number"){let u=i;u>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/u)))}this.syncTotalsInSameViews(t,r)}if(r.view.updatedAt=Date.now(),l&&o&&r.view.value.length<i&&s){let u=r.view.meta,c=u&&typeof u.totalPages=="number"?u.totalPages:1;if(this.cascadeShiftPages(t,r,n,i,c,s,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let d=Math.max(1,r.view.meta.totalPages-1);r.view.meta.totalPages=d,this.updateTotalPagesForAllViews(t,d)}}r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}handleInsert(t,r,n,i,o,a,s,l){if(!r.view.value.includes(s.id)){if(a&&this.strategy.allowSortedInsert&&this.strategy.comparator&&l)if(this.tryInsertSorted(r,s,l)){if(r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let u=i;u>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/u)))}this.syncTotalsInSameViews(t,r)}if(r.view.updatedAt=Date.now(),o&&(r.view.value?.length??0)>i&&l){let u=r.view.meta,c=u&&typeof u.totalPages=="number"?u.totalPages:1;if(this.cascadeShiftToNextPage(t,r,n,i,c,l,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let d=r.view.meta.totalPages+1;r.view.meta.totalPages=d,this.updateTotalPagesForAllViews(t,d)}}}else this.markViewStaleForReload(r);else if(!o||r.view.value.length<i){if(r.view.value.push(s.id),r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let u=i;u>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/u)))}this.syncTotalsInSameViews(t,r)}r.view.updatedAt=Date.now()}else this.markViewStaleForReload(r);r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}}handleUpdate(t,r,n,i,o,a,s,l,u){let c=r.view.value.includes(l.id),d=this.isEntityTypeCompatible(l,r.params?.itemType||"all");if(c&&!d){if(r.view.value=r.view.value.filter(f=>f!==l.id),r.view.meta&&typeof r.view.meta.total=="number"&&(r.view.meta.total=Math.max(0,r.view.meta.total-1),o&&Number.isFinite(i)&&typeof r.view.meta.total=="number")){let f=i;f>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/f)))}if(r.view.updatedAt=Date.now(),o&&r.view.value.length<i&&u){let f=r.view.meta,m=f&&typeof f.totalPages=="number"?f.totalPages:1;if(this.cascadeShiftPages(t,r,n,i,m,u,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let g=Math.max(1,r.view.meta.totalPages-1);r.view.meta.totalPages=g,this.updateTotalPagesForAllViews(t,g)}}r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0);return}if(c&&(a||s)){r.view.value=r.view.value.filter(f=>f!==l.id),this.tryReinsertEntity(r,l,u,o,i)?(r.view.updatedAt=Date.now(),r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)):this.markViewStaleForReload(r);return}if(c){r.view.updatedAt=Date.now(),r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0);return}if(d&&!s){if(a&&this.strategy.allowSortedInsert&&this.strategy.comparator&&u)if(this.tryInsertSorted(r,l,u)){if(r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let f=i;f>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/f)))}this.syncTotalsInSameViews(t,r)}r.view.updatedAt=Date.now()}else this.markViewStaleForReload(r);else if(!o||r.view.value.length<i){if(r.view.value.push(l.id),r.view.meta&&typeof r.view.meta.total=="number"){if(r.view.meta.total+=1,o&&Number.isFinite(i)){let f=i;f>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/f)))}this.syncTotalsInSameViews(t,r)}r.view.updatedAt=Date.now()}else this.markViewStaleForReload(r);r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}}handleMove(t,r,n,i,o,a,s,l,u){if(r.view.value.includes(s.id)){if(r.view.value=r.view.value.filter(c=>c!==s.id),r.view.meta&&typeof r.view.meta.total=="number"&&(r.view.meta.total=Math.max(0,r.view.meta.total-1),o&&Number.isFinite(i)&&typeof r.view.meta.total=="number")){let c=i;c>0&&(r.view.meta.totalPages=Math.max(1,Math.ceil(r.view.meta.total/c)))}if(r.view.updatedAt=Date.now(),o&&r.view.value.length<i&&u){let c=r.view.meta,d=c&&typeof c.totalPages=="number"?c.totalPages:1;if(this.cascadeShiftPages(t,r,n,i,d,u,r.params??{})&&r.view.meta&&typeof r.view.meta.totalPages=="number"){let f=Math.max(1,r.view.meta.totalPages-1);r.view.meta.totalPages=f,this.updateTotalPagesForAllViews(t,f)}}this.syncTotalsInSameViews(t,r)}r.view.loadId=_e(),r.view.abortController&&(r.view.abortController.abort(),r.view.abortController=void 0)}forceInvalidateChildrenViews(t){let r=this.parentKey(t??null);this.failedRequests.clearChildrenViewErrorsForParent(r);let n=this.views.get(r);if(n)for(let[,i]of n)i.view.value=void 0,i.view.meta=void 0,i.view.promise=null,i.view.updatedAt=0,i.view.loadId=_e(),i.view.abortController&&(i.view.abortController.abort(),i.view.abortController=void 0)}getKnownTotal(t){let r=this.parentKey(t??null),n=this.views.get(r);if(!n)return;let i=null;for(let[,o]of n){let a=o.view.meta;a&&typeof a.total=="number"&&(!i||(o.view.updatedAt??0)>i.updatedAt)&&(i={total:Number(a.total),updatedAt:o.view.updatedAt??0})}return i?i.total:void 0}toJSON(){return{views:Array.from(this.views.entries()).map(([t,r])=>[t,Array.from(r.entries())]),ttl:this.ttl,errorTtl:this.errorTtl,entityTtl:this.entityTtl,strategy:{allowSortedInsert:this.strategy.allowSortedInsert,allowSearchInsert:this.strategy.allowSearchInsert,invalidateOnPaginationFull:this.strategy.invalidateOnPaginationFull,preloadPagesBefore:this.strategy.preloadPagesBefore,preloadPagesAfter:this.strategy.preloadPagesAfter}}}static fromJSON(t,r){let n=r?.ttl??t?.ttl??18e5,i=r?.errorTtl??t?.errorTtl??n,o=r?.failedRequests??new or,a=new Rm({},n,i,void 0,o,r?.isFolderNotFoundError);for(let[s,l]of t.views??[]){let u=new Map;for(let[c,d]of l){let f=d;f?.view&&"error"in f.view&&delete f.view.error,u.set(c,f)}a.views.set(s,u)}return a}},UA=class Dm{invalidateChildrenCountCache(t){let r=fe(t??"");this.childrenCountPromises.delete(r),this.failedRequests.delete(or.childrenCountKey(r))}constructor(t={},r=fs,n,i){this.childrenCountPromises=new Map,this.isFolderNotFoundError=i?.isFolderNotFoundError??jp,this.failedRequests=new or,this.ttl=i?.ttl??r,this.errorTtl=i?.errorTtl??n??this.ttl,this.entities=new Fp,this.views=new Lp(t,this.ttl,this.errorTtl,void 0,this.failedRequests,this.isFolderNotFoundError),this.views.setServerChildrenCountHandler((o,a,s)=>{this.handleServerReportedChildrenCount(o,a,s??this.entities)}),this.views.setChildrenCountInvalidator(o=>{this.invalidateChildrenCountCache(o)})}getEntity(t){return this.entities.getEntity(t)??null}getFileSystemItem(t){return this.entities.getFileSystemItem(t)??null}getFolder(t){return this.entities.getFolder(t)??null}async getOrCreateChildren(t,r,n){return this.views.getOrCreateChildren(t,r,n,this.entities)}upsertEntity(t){let r=this.entities.getEntity(t.id),n=r?Oe(r):null,i=Oe(t),o=r?J(r):!1,a=J(t);if(this.entities.upsertEntity(t),r){if(n!==i||o!==a){this.views.smartInvalidateChildrenViews(n,r,"delete",this.entities),this.views.smartInvalidateChildrenViews(i,t,"insert",this.entities);return}this.views.smartInvalidateChildrenViews(i,t,"update",this.entities,void 0,r)}else this.views.smartInvalidateChildrenViews(i,t,"insert",this.entities)}isAncestor(t,r){let n=r,i=new Set;for(;n&&!i.has(n);){if(i.add(n),fe(n)===fe(t))return!0;let o=this.entities.getEntity(n);if(!o)break;n=Oe(o),n===null&&(n=Dp)}return!1}moveEntity(t,r){let n=this.entities.getEntity(t);if(!n||J(n)&&r!==null&&this.isAncestor(t,r))return null;let i=Oe(n),o=this.entities.moveEntityById(t,r);return o?(this.views.smartInvalidateChildrenViews(i,n,"delete",this.entities),this.views.smartInvalidateChildrenViews(r,o,"insert",this.entities),o):null}copyEntity(t,r,n,i){let o=this.entities.getEntity(t);if(!o)return null;let a=null;if(J(o)){let s=[t],l=[];for(;s.length;){let c=s.shift();l.push(c);let d=this.entities.getChildrenIds(c,{onlyFolders:!0});for(let f of d)s.push(f)}let u=new Map;for(let c of l)u.set(c,_e());for(let c of l){let d=this.entities.getFolder(c),f=u.get(c),m=Oe(d),g=m===null?r:u.get(m)??null,h={...d,...c===t?i:void 0,id:f,folderId:(c===t?i?.folderId:void 0)??g};this.entities.upsertEntity(h)}for(let c of l){let d=u.get(c),f=this.entities.getChildrenIds(c,{onlyFileSystemItems:!0});for(let m of f){let g=this.entities.getFileSystemItem(m);if(!g)continue;let h=_e(),b={...g,id:h,folderId:d};this.entities.upsertEntity(b)}}a=this.entities.getEntity(u.get(t))??null}else{let s=n??_e();if(a=this.entities.copyFileSystemItem(t,s,r??null),a&&i){let l={...a,...i,id:s,folderId:i.folderId??r??null};this.entities.upsertEntity(l),a=l}}return a&&this.views.smartInvalidateChildrenViews(r,a,"copy",this.entities),a}searchByUrl(t){return this.entities.searchByUrl(t)??null}deleteEntity(t){let r=this.entities.getEntity(t);if(!r)return null;if(J(r)){let{deletedFolderRecords:n,deletedFileSystemItemRecords:i}=this.entities.deleteFolderRecursive(t);for(let o of i)this.views.smartInvalidateChildrenViews(o.folderId,o,"delete",this.entities);for(let o of n)this.views.smartInvalidateChildrenViews(o.folderId,o,"delete",this.entities);for(let o of n)this.views.forceInvalidateChildrenViews(o.id);return r}{let{entity:n,parentId:i}=this.entities.deleteEntityById(t);return n&&this.views.smartInvalidateChildrenViews(i,n,"delete",this.entities),n}}deleteFolderRecursive(t){let{deletedFolderRecords:r,deletedFileSystemItemRecords:n}=this.entities.deleteFolderRecursive(t);for(let i of n)this.views.smartInvalidateChildrenViews(i.folderId,i,"delete",this.entities);for(let i of r)this.views.smartInvalidateChildrenViews(i.folderId,i,"delete",this.entities);for(let i of r)this.views.forceInvalidateChildrenViews(i.id);return{deletedFileSystemItemIds:n.map(i=>i.id),deletedFolderIds:r.map(i=>i.id)}}forceInvalidate(t){let r=this.entities.getEntity(t);if(!r){this.views.forceInvalidateChildrenViews(t??null),this.invalidateChildrenCountCache(t);return}let n=new Set;if(J(r)){let i=[t];for(;i.length;){let o=i.pop();if(n.has(o))continue;n.add(o),this.views.forceInvalidateChildrenViews(o),this.invalidateChildrenCountCache(o);let a=this.entities.getChildrenIds(o,{onlyFolders:!0});for(let s of a)i.push(s)}}else{let i=r.folderId??null;this.views.forceInvalidateChildrenViews(i),this.invalidateChildrenCountCache(i)}}invalidateListingViews(t){this.views.forceInvalidateChildrenViews(t??null)}getChildrenIds(t){return this.entities.getChildrenIds(t)}searchByName(t,r){return this.entities.searchByName(t,r)}async getChildrenCount(t="",r){let n=fe(t),i=or.childrenCountKey(n),o=this.failedRequests.getFreshError(i,this.errorTtl);if(o!=null)return Promise.reject(o);let a=this.childrenCountPromises.get(n);if(a)return a;let s=(async()=>{try{let l=this.entities.getFolder(t);if(l&&typeof l.childrenCount=="number")return this.failedRequests.delete(i),l.childrenCount;let u=this.views.getKnownTotal(t);if(typeof u=="number")return l&&this.handleServerReportedChildrenCount(t,u,this.entities),this.failedRequests.delete(i),u;if(r){let c=await r(t);return this.entities.getFolder(t)&&this.handleServerReportedChildrenCount(t,c,this.entities),this.failedRequests.delete(i),c}return this.failedRequests.delete(i),this.entities.getChildrenIds(t).length}catch(l){if(this.childrenCountPromises.delete(n),this.isFolderNotFoundError(l))return this.failedRequests.delete(i),0;throw this.failedRequests.setError(i,l),l}finally{this.childrenCountPromises.delete(n)}})();return this.childrenCountPromises.set(n,s),s}toJSON(){return{entities:this.entities.toJSON(),views:this.views.toJSON(),ttl:this.ttl,errorTtl:this.errorTtl}}static fromJSON(t,r,n){let i=n?.ttl??t?.ttl??18e5,o=n?.errorTtl??t?.errorTtl??i,a=new Dm(r??{},i,o,n),s=Fp.fromJSON(t?.entities??{}),l=Lp.fromJSON(t?.views??{},{failedRequests:a.failedRequests,ttl:i,errorTtl:o,isFolderNotFoundError:n?.isFolderNotFoundError});if(r){let u=Ap(r);l.strategy={allowSortedInsert:u.allowSortedInsert??!0,allowSearchInsert:u.allowSearchInsert??!0,invalidateOnPaginationFull:u.invalidateOnPaginationFull??!0,preloadPagesBefore:u.preloadPagesBefore??0,preloadPagesAfter:u.preloadPagesAfter??1,comparator:u.comparator,filterMatch:u.filterMatch}}return a.entities=s,a.views=l,l.setServerChildrenCountHandler((u,c,d)=>{a.handleServerReportedChildrenCount(u,c,d??s)}),l.setChildrenCountInvalidator(u=>{a.invalidateChildrenCountCache(u)}),a}handleServerReportedChildrenCount(t,r,n){this.checkAndResolveChildrenCountConflict(t,r,n),this.invalidateChildrenCountCache(t)}checkAndResolveChildrenCountConflict(t,r,n){if(!n||r===void 0)return;let i=t??null;if(!i){n.updateServerChildrenCount(i,r);return}let o=n.getFolder(i)?.childrenCount;o!==void 0&&o!==r&&this.views.forceInvalidateChildrenViews(i),n.updateServerChildrenCount(i,r)}},BA="",$A="Trash",xA="Edited",kp=1e4,Up=1e4,Bp=25,$p=10;function Fi(e,t){let r=e??{},n=Array.isArray(r.detailed)?r.detailed.map(i=>({requestId:i.requestId??i.id,success:!!i.success,data:t(i.data),error:i.error})):void 0;return{success:!!r.success,error:r.error,detailed:n}}function hs(e){return e==null?"":String(e)}function ie(e){return{...e,name:hs(e.name)}}function qA(e){return(e??[]).map(ie)}function dt(e){return!e||typeof e!="object"||!("name"in e)?e:{...e,name:hs(e.name)}}function GA(e){return e?e.replaceAll("\\","/").split("/").filter(Boolean):[]}var xp=class{_getTrashPath(){return this._pathOptions.trashPath||$A}_getPathLookupCandidates(e){return Mp(e,this._getTrashPath(),$e)}_folderFromResolvedPath(e,t){if(e.isFolder!==!0)throw new B(e.isFolder===!1?"Path '%s' resolves to a file, not a folder".replace("%s",t):"Path '%s' resolved to an item that is not marked as a folder".replace("%s",t),"ValidationError");if(!e.id)throw new B("Path '%s' resolved to a folder without id".replace("%s",t),"ValidationError");let r={id:e.id,name:e.name||e.id,parentId:e.folderId};return this._cache.upsertEntity(ie({id:r.id,name:r.name,folderId:r.parentId??null,isFolder:!0})),r}async _resolveFolderByPath(e){if(typeof this._dataProvider.findItemByPath=="function")for(let t of this._getPathLookupCandidates(e)){let r=await this._dataProvider.findItemByPath(t);if(r)return this._folderFromResolvedPath(r,t)}}async _findOrCreateFolderByPath(e){let t=GA(e);if(t.length>$p)throw new B("Path depth exceeds maximum limit of %s".replace("%s",String($p)),"ValidationError");let r=await this._resolveFolderByPath(e);if(r)return r;let n;for(let i of t){let{files:o}=await this.getFiles({folderId:n?.id||"",itemType:"folder"}),a=o.find(s=>s.name===i);if(a){if(!a.isFolder)throw new B("Path component '%s' in '%s' is not a folder".replace("%s",i).replace("%s",e),"ValidationError");n={id:a.id,name:a.name,parentId:a.folderId}}else{if(typeof this._dataProvider.createFolder!="function")throw new B("Create folder operation is not supported by data provider","UnsupportedOperation");n=await this.createFolder({name:i,parentId:n?.id})}}return n}async getTrashFolder(){let e=await this._findOrCreateFolderByPath(this._getTrashPath());if(!e)throw new B("Trash folder path '%s' could not be resolved".replace("%s",this._getTrashPath()),"FolderNotFound");return e}async getTempFolder(){let e=this._pathOptions.tempPath??xA;if(e)try{return await this._findOrCreateFolderByPath(e)}catch(t){if(t instanceof B&&t.code==="ValidationError")throw t;return}}constructor(e,t={},r,n={}){this._dataProvider=e,this._options=t,this._pathOptions=r,this._blobFetchForceReloadOnceIds=new Set,this._mutationRegistry=new OA,this._mapItem=async({childrenCount:o,...a})=>{let s=ie(a);if(s.isFolder)return{...s,childCount:o,url:"",thumbnailUrl:""};let[l,u]=await Promise.all([this._getUrl(s),this._getThumbnailUrl(s)]);return{...s,childCount:0,url:l,thumbnailUrl:u}},this._config=n,this._useSoftDelete=this._pathOptions.useSoftDelete,this._rootId=this._pathOptions.rootId||BA,this._enableTrash=this._options.enableTrash===void 0||this._options.enableTrash,this._validateDuplicates=this._dataProvider.validateDuplicates,this._cache=new UA(t.cacheStrategy||{},t.cacheStrategy?.ttl,t.cacheStrategy?.errorTtl),this.setController({invalidateItemCache:o=>{this._cache.forceInvalidate(o)},getCachedItem:o=>this._cache.getEntity(o)});let i=Object.getPrototypeOf(this);for(let o of Object.getOwnPropertyNames(i)){let a=Object.getOwnPropertyDescriptor(i,o);o!=="constructor"&&typeof a?.value=="function"&&(this[o]=a.value.bind(this))}}setController(e){typeof this._dataProvider.setController=="function"&&this._dataProvider.setController(e)}async clearCache(e){let t=e??this._rootId;this._cache.forceInvalidate(t),this._cache.invalidateListingViews(t),typeof this._dataProvider.clearCache=="function"&&await this._dataProvider.clearCache(e)}markNextFileBlobFetchBypassHttpCache(e){this._blobFetchForceReloadOnceIds.add(this.normalizeId(e))}normalizeId(e){return!e||e==="root"||e==="folders"?this._rootId:e}_isDeletingId(e){return this._mutationRegistry.isDeleting(this.normalizeId(e))}_collectDeletingIds(e){let t=this.normalizeId(e),r=new Set([t]);if(!this._cache.getEntity(t)?.isFolder)return Array.from(r);let n=[t];for(;n.length>0;){let i=n.pop(),o=this._cache.getChildrenIds(i);for(let a of o)r.has(a)||(r.add(a),this._cache.getEntity(a)?.isFolder&&n.push(a))}return Array.from(r)}_emptyFilesResult(e,t){return{files:[],pagination:{...typeof e=="number"?{page:e}:{},...typeof t=="number"?{limit:t}:{},total:0,totalPages:1,hasNext:!1,hasPrev:!1}}}_validateName(e,t=!1){if(!e||e.trim().length===0)throw new B(t?"Folder name cannot be empty":"File name cannot be empty",t?"FolderInvalidName":"FileInvalidName");if(/[/\\:*?"<>|]/.test(e)){let r=t?"FolderInvalidName":"FileInvalidName";throw new B(t?"Folder name contains invalid characters: %s".replace("%s",e):"File name contains invalid characters: %s".replace("%s",e),r)}}_validateTargetFolderType(e){let t=this.normalizeId(e);if(t===this._rootId)return;let r=this._cache.getEntity(t);if(r&&!r.isFolder)throw new B("Target item with id '%s' is not a folder".replace("%s",e),"ValidationError")}_checkNameExistsInCache(e,t,r,n){let i=this.normalizeId(e),o=this._cache.getChildrenIds(i);for(let a of o){let s=this._cache.getEntity(a);if(s&&s.name===t&&!!s.isFolder===r&&(!n||s.id!==n))return!0}return!1}async _getUrl(e){if(e){if(e.url)return e.url;try{return typeof this._dataProvider?.getUrl=="function"&&this._dataProvider.getUrl(e)||void 0}catch{}}}async _getThumbnailUrl(e){if(e){if(e.thumbnailUrl)return e.thumbnailUrl;try{return typeof this._dataProvider?.getThumbnailUrl=="function"&&this._dataProvider.getThumbnailUrl(e)||void 0}catch{}}}_isAncestor(e,t){if(!t)return!1;let r=this.normalizeId(t),n=this.normalizeId(e);if(r===n)return!0;let i=this._cache.getEntity(r),o=new Set;for(;i&&i.folderId&&!o.has(i.id);){o.add(i.id);let a=this.normalizeId(i.folderId);if(a===n)return!0;if(i=this._cache.getEntity(a),!i||!i.isFolder)break}return!1}async getFile(e,t){return this._isDeletingId(e)?null:this._cache.searchByName(t,{parentId:this.normalizeId(e),caseSensitive:!0,recursive:!1,itemType:"file"})[0]||(await this.getFiles({folderId:e,itemType:"file",search:t})).files[0]}async getFileById(e){let t=this.normalizeId(e);if(this._isDeletingId(t))return null;let r=this._cache.getFileSystemItem(t);if(r&&!r.isFolder)return await this._mapItem(r);if(!this._dataProvider.pathMode)return null;let n=await this._getFileByPathStyleId(t);if(n&&!n.isFolder){let i=ie(n);return this._cache.upsertEntity(i),await this._mapItem(i)}return null}async _getFileByPathStyleId(e){let t=e.replace(/\\/g,"/").replace(/^\/+/,""),r=t.lastIndexOf("/"),n=r<0?"":t.slice(0,r),i=r<0?t:t.slice(r+1);return i?this.getFile(n,i):null}async getFileUrl(e,t){let r=await this.getFile(e??"",t);if(r)return await this._getUrl(r)||await this._getThumbnailUrl(r)||r.thumbnail}async getFiles({folderId:e,search:t,sortBy:r,sortOrder:n,page:i,limit:o,itemType:a="all",noFolder:s=!1}){s&&(e=(await this.getTempFolder())?.id);let l=this.normalizeId(e??this._rootId),u=this._options.enablePagination===!1,c=u?1:i,d=u?kp:o,f=this._options.clientSideFilter,m=this._options.clientSideSorting,g=this._options.clientSidePaging,h=g?Math.max(1,i??1):void 0,b=g?typeof o=="number"&&Number.isFinite(o)&&o>0?o:Bp:void 0,P=this._emptyFilesResult(g?h:c,g?b:d);if(this._isDeletingId(l))return P;let E=this._options.unifiedCatalogFetch!==!1&&u&&(a==="folder"||a==="file"),S=E?"all":a,_={folderId:l,itemType:S};f||(_.search=t),m||(_.sortBy=r??(S==="folder"?void 0:"date"),_.sortOrder=n??(S==="folder"?void 0:"desc")),g||(_.page=c,_.limit=E?Up:d);let w=E?Up:g?void 0:d,v={folderId:l,itemType:S,search:f?void 0:t,sortBy:m?void 0:_.sortBy,sortOrder:m?void 0:_.sortOrder,page:g?void 0:c,pageSize:w},I;try{I=await this._cache.getOrCreateChildren(l,v,async(N,j)=>{let M=j.pageSize,F=M!=null&&Number.isFinite(Number(M))?Number(M):kp,D=await this._dataProvider.getItems({...j,folderId:N,limit:F}),k=qA(D.items);return g?{items:k,total:typeof D.pagination?.total=="number"?D.pagination.total:k.length}:{items:k,...D.pagination}})}catch(N){if(this._isDeletingId(l))return P;throw N}let y=I.items;if(E&&(a==="folder"?y=y.filter(N=>N.isFolder):a==="file"&&(y=y.filter(N=>!N.isFolder))),f){if(typeof this._options.clientSideFilter=="function")y=this._options.clientSideFilter(y,t);else if(t){let N=t.toLowerCase();y=y.filter(j=>j.name?.toLowerCase().includes(N))}}m&&(y=typeof this._options.clientSideSorting=="function"?this._options.clientSideSorting(y,r,n):this._defaultClientSideSort(y,r,n));let T;T=g||f||E?y.length:I.total??y.length;let A=y;if(g)if(typeof this._options.clientSidePaging=="function")A=this._options.clientSidePaging(y,h,b);else{let N=(h-1)*b,j=N+b;A=y.slice(N,j)}if(typeof this._dataProvider.getUrl=="function"||typeof this._dataProvider.getThumbnailUrl=="function"){let N=A.map(async j=>{if(j.isFolder)return j;let[M,F]=await Promise.all([j.url?Promise.resolve(j.url):typeof this._dataProvider.getUrl=="function"?this._dataProvider.getUrl(j):Promise.resolve(void 0),j.thumbnailUrl?Promise.resolve(j.thumbnailUrl):typeof this._dataProvider.getThumbnailUrl=="function"?this._dataProvider.getThumbnailUrl(j):Promise.resolve(void 0)]);return{...j,url:M,thumbnailUrl:F}});A=await Promise.all(N)}let C=g?{page:h,limit:b,total:T,totalPages:Math.max(1,Math.ceil(T/b)),hasNext:h*b<T,hasPrev:h>1}:{page:c,limit:d,total:T,...!g&&I.totalPages&&{totalPages:I.totalPages},...!g&&I.hasNextPage&&{hasNextPage:I.hasNextPage}};return{files:await Promise.all(A.map(this._mapItem)),pagination:C}}_defaultClientSideSort(e,t,r){return e.sort((n,i)=>Tp(n,i,{sortBy:t,sortOrder:r}))}async getFileData(e,t){let r=this.normalizeId(typeof e=="string"?e:e.id),n=t;this._blobFetchForceReloadOnceIds.delete(r)&&(n={...t,forceReload:!0});let i=this._cache.getEntity(r)||(typeof e=="string"?{id:r,name:"",folderId:this._rootId,isFolder:!1}:{...e,childrenCount:e.childCount});if(typeof this._dataProvider.getFileData=="function")return await this._dataProvider.getFileData(i,n);if(!i.url&&typeof this._dataProvider.getUrl!="function")throw new B("Cannot read file","FileReadError");let o=i.url||(typeof this._dataProvider.getUrl=="function"?await this._dataProvider.getUrl(i):"");if(o)return(await(this._config.fetchWithProxy??fetch)(o,n?.forceReload?{cache:"no-store"}:void 0)).blob();throw new B("Unable to get file data","FileReadError")}async findFileByUrl(e){let t=this._cache.searchByUrl(e);if(t)return t;if(typeof this._dataProvider.findFileByUrl=="function")try{let r=await this._dataProvider.findFileByUrl(e);if(r){let n=ie(r);return this._cache.upsertEntity(n),n}}catch{}return null}async getChildrenCount(e){if(!e)return 0;let t=this.normalizeId(e??this._rootId);return this._isDeletingId(t)?0:this._cache.getChildrenCount(t,async()=>{try{if(this._options.clientSidePaging){let n=await this.getFiles({folderId:t,itemType:"all",page:1,limit:Bp});return n.pagination.total??n.files.length}let r=await this._dataProvider.getItems({folderId:t,limit:0,itemType:"all"});return r.pagination===void 0?this._options.enablePagination===!1?r.items.length:0:r.pagination.total||0}catch(r){if(this._isDeletingId(t)||this._isPathFolderNotFoundError(r))return 0;throw r}})}_isPathFolderNotFoundError(e){if(!e||typeof e!="object")return!1;let t=e;return t.code==="path_folder_not_found"||t.data?.code==="path_folder_not_found"||t.status===404||t.data?.data?.status===404}async _uploadFile(e){let t=this.normalizeId(e.folderId??this._rootId);if(typeof this._dataProvider.uploadFile!="function")throw new B("Upload file operation is not supported by data provider","UnsupportedOperation");if(this._validateName(e.name,!1),this._validateDuplicates&&this._checkNameExistsInCache(t,e.name,!1))throw new B("File '%s' already exists in target folder".replace("%s",e.name),"FileAlreadyExists");let r=await this._dataProvider.uploadFile({...e,folderId:t}),n=ie({name:e.name,size:e.size,...r,folderId:r.folderId??t});return this._cache.upsertEntity(n),n}async uploadFiles(e){let t=e.items.some(a=>a.noFolder)?await this.getTempFolder():null;e={...e,items:e.items?.map(a=>({...a,folderId:a.noFolder?t?.id:a.folderId}))};for(let a of e.items)a.folderId&&(e.folderId=a.folderId);let r=e.items||[],n=e.folderId??this._rootId,i=this.normalizeId(n);if(this._validateDuplicates){for(let a of r)if(a.name){this._validateName(a.name,!1);let s=this.normalizeId(a.folderId??i);if(this._checkNameExistsInCache(s,a.name,!1))throw new B("File '%s' already exists in target folder".replace("%s",a.name),"FileAlreadyExists")}}let o={detailed:Array(r.length),success:!0};if(typeof this._dataProvider.uploadFiles=="function"){let a=r.map(u=>({...u,folderId:this.normalizeId(u.folderId??i)})),s=await this._dataProvider.uploadFiles({folderId:i,items:a});o=Fi(s,u=>{if(u)return{id:u.id,name:hs(u.name),folderId:u.folderId,url:u.url,thumbnailUrl:u.thumbnailUrl,thumbnail:u.thumbnail}});let l=s?.detailed;if(o.detailed&&o.detailed.length){for(let u=0;u<o.detailed.length;u++){let c=o.detailed[u];if(c&&c.success){let d=c.data,f=d?.id??c.requestId,m=l?.[u]?.data,g=ie({...m,...d,id:f,folderId:d?.folderId??m?.folderId??i,isFolder:!1});this._cache.upsertEntity(g),c.requestId=f}}o.success===void 0&&(o.success=!o.detailed.some(u=>!u.success))}else o.success=!o.error&&!!o.success}else if(typeof this._dataProvider.uploadFile=="function")o.detailed=await Promise.all(r.map(async a=>{let s=this.normalizeId(a.folderId??i);try{let l=await this._uploadFile({...a,folderId:s});return{requestId:l.id,data:l,success:!0}}catch(l){return{requestId:a?.id,success:!1,error:l}}})),o.success=!o.detailed.some(a=>!a.success);else throw new B("Upload files is not supported by data provider","UnsupportedOperation");if(o.success&&this._enableTrash)try{this._cache.forceInvalidate(i)}catch{}return o}async deleteFile(e){let t=this.normalizeId(e),r=[t];this._mutationRegistry.beginDeleting(r);try{if(this._useSoftDelete&&this._enableTrash){let n=await this.getTrashFolder();return await this.moveItem({itemId:t,targetFolderId:n.id,isFolder:!1})}return await this.hardDeleteItem(t)}finally{this._mutationRegistry.endDeleting(r)}}async deleteItems(e,t){let r=Array.from(new Set(e.flatMap(n=>this._collectDeletingIds(this.normalizeId(n)))));this._mutationRegistry.beginDeleting(r);try{if(this._useSoftDelete&&this._enableTrash&&t.permanent!==!0){let n=await this.getTrashFolder();return await this.moveItems(n.id,e)}return await this.hardDeleteItems(e,t)}finally{this._mutationRegistry.endDeleting(r)}}async hardDeleteItems(e,t){let r={success:!0,detailed:[]},n=t.permanent?null:await this.getTrashFolder();if(typeof this._dataProvider.deleteItems=="function"){if(r=Fi(await this._dataProvider.deleteItems(e.map(i=>this._cache.getEntity(i)),t),i=>i),r.success){let i=r.detailed||e.map(o=>({requestId:o,success:!0,error:void 0}));for(let o of i)o.success&&(n?this._cache.moveEntity(o.requestId,n.id):this._cache.deleteEntity(o.requestId))}}else typeof this._dataProvider.deleteItem=="function"&&(r.detailed=await Promise.all(e.map(async i=>{let o=this._cache.getEntity(i);if(!o)return{requestId:i,success:!1,error:new B("Item with id '%s' not found".replace("%s",i),"FileNotFound")};try{return await this._dataProvider.deleteItem(o,t),n?this._cache.moveEntity(i,n.id):this._cache.deleteEntity(i),{requestId:i,success:!0}}catch(a){return{requestId:i,error:a,success:!1}}})),r.success=!r.detailed.some(i=>!i.success));if(r.success&&n)try{this._cache.forceInvalidate(n.id)}catch{}return r}async hardDeleteItem(e){let t=this._cache.getEntity(e);if(!t)throw new B("Item with id '%s' not found in cache".replace("%s",e),"FileNotFound");if(typeof this._dataProvider.deleteItem!="function")throw new B("Delete item operation is not supported by data provider","DeleteNotAllowed");if(await this._dataProvider.deleteItem(t,{permanent:!0}),this._cache.deleteEntity(e),this._enableTrash)try{let r=await this.getTrashFolder();r&&this._cache.forceInvalidate(r.id)}catch{}return!0}async cleanTrash(){if(!this._enableTrash)throw new B("Trash is not enabled","UnsupportedOperation");if(typeof this._dataProvider.cleanTrash=="function"){let e=await this._dataProvider.cleanTrash();try{let t=await this.getTrashFolder();t&&this._cache.forceInvalidate(t.id)}catch{}return e}throw new B("Clean trash is not supported by data provider","UnsupportedOperation")}async createFolder({name:e,parentId:t,is_force_create:r}){let n=this.normalizeId(t??this._rootId);if(this._validateName(e,!0),this._validateDuplicates&&this._checkNameExistsInCache(n,e,!0))throw new B("Folder '%s' already exists in parent folder".replace("%s",e),"FolderAlreadyExists");let i=await this._dataProvider.createFolder(e,n,r),o=ie({id:i.id,folderId:n,name:i.name,isFolder:!0,childrenCount:i.childrenCount});return this._cache.upsertEntity(o),{...i,name:o.name}}async deleteFolder(e){let t=this.normalizeId(e),r=this._collectDeletingIds(t);this._mutationRegistry.beginDeleting(r);try{if(this._useSoftDelete&&this._enableTrash)try{let n=await this.getTrashFolder();return await this.moveItem({itemId:t,targetFolderId:n.id,isFolder:!0})?(this._cache.deleteFolderRecursive(t),!0):!1}catch{return await this.hardDeleteItem(t)}return await this.hardDeleteItem(t)}finally{this._mutationRegistry.endDeleting(r)}}async renameFolder(e,t){if(typeof this._dataProvider.renameItem!="function")throw new B("Rename folder is not supported","RenameNotAllowed");let r=this.normalizeId(e),n=this._cache.getEntity(r);if(!n)throw new B("Folder with id '%s' not found in cache".replace("%s",e),"FolderNotFound");if(this._validateName(t,!0),this._validateDuplicates){let o=this.normalizeId(n.folderId);if(this._checkNameExistsInCache(o,t,!0,r))throw new B("Folder '%s' already exists in parent folder".replace("%s",t),"FolderAlreadyExists")}let i=dt(await this._dataProvider.renameItem(n,t));return this._cache.upsertEntity(ie({...this._cache.getEntity(i.id),...i})),this._cache.getEntity(i.id)}async renameFile(e,t){if(typeof this._dataProvider.renameItem!="function")throw new B("Rename file is not supported","RenameNotAllowed");let r=this._cache.getEntity(e);if(!r)throw new B("File with id '%s' not found in cache".replace("%s",e),"FileNotFound");let n=this.normalizeId(e);if(this._validateName(t,!1),this._validateDuplicates){let o=this.normalizeId(r.folderId);if(this._checkNameExistsInCache(o,t,!1,n))throw new B("File '%s' already exists in parent folder".replace("%s",t),"FileAlreadyExists")}let i=dt(await this._dataProvider.renameItem(r,t));return i&&this._cache.upsertEntity(ie({...this._cache.getEntity(n),...i})),this._cache.getEntity(n)}async moveItem({itemId:e,targetFolderId:t,isFolder:r}){if(typeof this._dataProvider.moveItem!="function")throw new B("Move item operation is not supported by data provider","MoveNotAllowed");let n=this.normalizeId(t);this._validateTargetFolderType(t);let i=this._cache.getEntity(e);if(!i){let a=dt(await this._dataProvider.moveItem({id:e,folderId:n,isFolder:r},n));if(a.id===e)this._cache.upsertEntity(ie({...a,folderId:n}));else{try{this._cache.deleteEntity(e)}catch{}this._cache.upsertEntity(ie({...a,folderId:n}))}return!0}if(i.isFolder){if(e===n)throw new B("Cannot move folder into itself","MoveIntoSelf");if(this._isAncestor(e,n))throw new B("Cannot move folder into its descendant","MoveIntoDescendant")}if(this._validateDuplicates&&n!==this.normalizeId(i.folderId)&&i.name&&this._checkNameExistsInCache(n,i.name,!!i.isFolder,e)){let a=i.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new B(`${i.isFolder?"Folder":"File"} '${i.name}' already exists in target folder`,a)}let o=dt(await this._dataProvider.moveItem(i,n));if(o.id===e){let a=this._cache.moveEntity(e,n);return this._cache.upsertEntity(ie({...a,...o})),!0}{let a=this._cache.deleteEntity(e);return this._cache.upsertEntity(ie({...a,...o,folderId:n})),!0}}async moveItems(e,t){let r=this.normalizeId(e);this._validateTargetFolderType(e);let n=t.map(o=>this._cache.getEntity(o));for(let o of n)if(o){if(o.isFolder){if(o.id===r)throw new B("Cannot move folder '%s' into itself".replace("%s",o.name),"MoveIntoSelf");if(this._isAncestor(o.id,r))throw new B("Cannot move folder '%s' into its descendant".replace("%s",o.name),"MoveIntoDescendant")}if(this._validateDuplicates&&r!==this.normalizeId(o.folderId)&&o.name&&this._checkNameExistsInCache(r,o.name,!!o.isFolder,o.id)){let a=o.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new B(`${o.isFolder?"Folder":"File"} '${o.name}' already exists in target folder`,a)}}let i={detailed:Array(n.length),success:!0};if(typeof this._dataProvider.moveItems=="function")i=Fi(await this._dataProvider.moveItems(n,r),o=>o);else if(typeof this._dataProvider.moveItem=="function")i.detailed=await Promise.all(t.map(async(o,a)=>{let s=n[a]||{id:o,folderId:null,isFolder:!1,name:o};try{return{requestId:o,data:dt(await this._dataProvider.moveItem(s,r)),success:!0}}catch(l){return{requestId:o,success:!1,error:l}}}));else throw new B("Move items is not supported","MoveNotAllowed");if(i.success){let o=i.detailed||t.map(a=>({requestId:a,success:!0,data:void 0}));for(let a of o)if(a.success)if(!a.data||a.data.id===a.requestId)this._cache.moveEntity(a.requestId,r),a.data&&this._cache.upsertEntity(ie({...this._cache.getEntity(a.requestId),...a.data,folderId:r}));else{let s=this._cache.deleteEntity(a.requestId);this._cache.upsertEntity(ie({...s,...a.data,folderId:r}))}return i}return{success:!1,error:i.error||new B("Move items failed","MoveNotAllowed")}}async copyItem({itemId:e,targetFolderId:t}){if(typeof this._dataProvider.copyItem!="function")throw new B("Copy item is not supported","CopyNotAllowed");let r=this.normalizeId(t);this._validateTargetFolderType(t);let n=this._cache.getEntity(e);if(!n){let o=dt(await this._dataProvider.copyItem({id:e,folderId:r},r));return this._cache.copyEntity(e,r,o.id),this._cache.upsertEntity(ie({...o,folderId:r})),!0}if(this._validateDuplicates&&n.name){let o=r===this.normalizeId(n.folderId)?e:void 0;if(this._checkNameExistsInCache(r,n.name,!!n.isFolder,o)){let a=n.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new B(`${n.isFolder?"Folder":"File"} '${n.name}' already exists in target folder`,a)}}let i=dt(await this._dataProvider.copyItem(n,r));return this._cache.copyEntity(e,r,i.id,{...i,folderId:r})||this._cache.upsertEntity(ie({...i,folderId:r})),!0}async copyItems(e,t){let r=this.normalizeId(e);this._validateTargetFolderType(e);let n=t.map(s=>typeof s=="string"?{id:s}:s),i=n.map(s=>s.id),o=i.map((s,l)=>{let u=this._cache.getEntity(s),c=n[l]?.newName;return u?c?{...u,name:c}:u:void 0});if(this._validateDuplicates)for(let s=0;s<o.length;s++){let l=o[s];if(l&&l.name){let u=r===this.normalizeId(l.folderId)?i[s]:void 0;if(this._checkNameExistsInCache(r,l.name,!!l.isFolder,u)){let c=l.isFolder?"FolderAlreadyExists":"FileAlreadyExists";throw new B(`${l.isFolder?"Folder":"File"} '${l.name}' already exists in target folder`,c)}}}let a={detailed:Array(o.length),success:!0};if(typeof this._dataProvider.copyItems=="function")a=Fi(await this._dataProvider.copyItems(o,r),s=>s);else if(typeof this._dataProvider.copyItem=="function")a.detailed=await Promise.all(i.map(async(s,l)=>{let u=o[l]||{id:s,folderId:null,isFolder:!1};try{return{requestId:s,data:dt(await this._dataProvider.copyItem(u,r)),success:!0}}catch(c){return{requestId:s,success:!1,error:c}}}));else throw new B("Copy items is not supported","CopyNotAllowed");if(a.success&&a.detailed)for(let s=0,l=a.detailed.length;s<l;s++){let u=a.detailed[s];if(u.success&&u.data?.id){let c=u.data.folderId||r;!this._cache.copyEntity(u.requestId,c,u.data.id,{...u.data,folderId:c})&&u.data&&this._cache.upsertEntity(ie({...u.data,folderId:c}))}}else if(!a.detailed)throw new B("batchResult in copy method must have detailed results","ValidationError");return a}async uploadFileByUrl(e){if(e.noFolder){let r=await this.getTempFolder();e={...e,folderId:r?.id}}let t=this.normalizeId(e.folderId??this._rootId);try{let r=ie({...await this._dataProvider.uploadFileByUrl(e.url,t,{eventSource:e.eventSource}),folderId:t});return this._cache.upsertEntity(r),r}catch(r){throw r}}async updateFile(e,t){if(typeof this._dataProvider.updateFile!="function")throw new B("Update file is not supported","UnsupportedOperation");let r=this.normalizeId(e),n=this._cache.getEntity(r);if(!n)throw new B("File with id '%s' not found in cache".replace("%s",e),"FileNotFound");if(t.name&&t.name!==n.name&&this._validateName(t.name,!1),this._validateDuplicates&&t.name&&t.name!==n.name){let o=this.normalizeId(n.folderId);if(this._checkNameExistsInCache(o,t.name,!1,r))throw new B("File '%s' already exists in parent folder".replace("%s",t.name),"FileAlreadyExists")}let i=dt(await this._dataProvider.updateFile(n,{...t}));return this._cache.upsertEntity(ie({...this._cache.getEntity(r),...i,...t})),this._cache.getEntity(r)}},HA="",zA="Trash",qp=class{constructor(e,t=HA,r=$e,n=zA,i=!0){this._inner=e,this.rootPath=t,this.trashId=r,this.trashPath=n,this.ensureFolderTrailingSlash=i,this._pathToId=new Map,this._idToPath=new Map,this.validateDuplicates=this._inner.validateDuplicates??!1,typeof e.getUrl=="function"&&(this.getUrl=a=>e.getUrl({...a,id:this.pathForId(a.id,!1),folderId:a.folderId?this.pathForId(a.folderId,!0):this.rootPath})),typeof e.getThumbnailUrl=="function"&&(this.getThumbnailUrl=a=>e.getThumbnailUrl({...a,id:this.pathForId(a.id,!1),folderId:a.folderId?this.pathForId(a.folderId,!0):this.rootPath}));let o=this;typeof this._inner.deleteItems!="function"&&(o.deleteItems=void 0),typeof this._inner.deleteItem!="function"&&(o.deleteItem=void 0),typeof this._inner.moveItems=="function"?o.moveItem=void 0:o.moveItems=void 0,typeof this._inner.copyItems=="function"?o.copyItem=void 0:o.copyItems=void 0,typeof this._inner.uploadFiles=="function"?o.uploadFile=void 0:o.uploadFiles=void 0,typeof this._inner.clearCache!="function"&&(o.clearCache=void 0),this._getOrGenerateId(this.rootPath)}setController(e){typeof this._inner.setController=="function"&&this._inner.setController({invalidateItemCache:t=>{let r=t.replace(/^\/+|\/+$/g,""),n=this._pathToId.get(r);n&&e.invalidateItemCache(n)},getCachedItem:t=>{let r=t.replace(/^\/+|\/+$/g,""),n=this._pathToId.get(r);if(n){let i=e.getCachedItem(n);if(i)return{...i,id:this.pathForId(i.id,i.isFolder??!1),folderId:this.pathForId(i.folderId??"",i.isFolder??!1)}}}})}clearCache(e){if(typeof this._inner.clearCache=="function")return this._inner.clearCache(e)}findItemByPath(e){if(typeof this._inner.findItemByPath!="function")return;let t=(n,i,o)=>{if(!n)return;if(n.isFolder!==!0)return n;let a=Ce(Ce(o)===Ce(this.trashPath)?this.trashPath:i),s=n.folderId!=null&&n.folderId!==""?Ce(n.folderId):this.rootPath;return{...n,id:this._getOrGenerateId(a),name:n.name,folderId:s===Ce(this.rootPath)?this.rootPath||"":this._getOrGenerateId(s),isFolder:!0}},r=Mp(e,this.trashPath,this.trashId);return(async()=>{for(let n of r){let i=await Promise.resolve(this._inner.findItemByPath(n)),o=t(i,n,e);if(o)return o}})()}_getOrGenerateId(e){if(e===this.rootPath)return"";let t=Ce(e);if(t===Ce(this.trashPath))return this.trashId;if(this._pathToId.has(t))return this._pathToId.get(t);let r=_e();return this._pathToId.set(t,r),this._idToPath.set(r,t),r}pathForId(e,t,r){if(e===""||e===void 0)return this.rootPath;if(e===this.trashId)return this.trashPath;let n=this._idToPath.get(e);if(!n){if(r)return`unknown folder ${e}`;throw new B(`Path for id '${e}' not found in mapping`,"FileNotFound")}let i=0;for(;i<this.rootPath.length&&this.rootPath[i]==="/";)i++;if(i){let o=0;for(;o<n.length&&n[o]==="/";)o++;let a=n.slice(o);n="/".repeat(i)+a}return t&&this.ensureFolderTrailingSlash&&!n.endsWith("/")&&(n+="/"),n}_updateIdMapping(e,t){let r=t.replace(/^\/+|\/+$/g,""),n=this._idToPath.get(e);n&&this._pathToId.delete(n),this._idToPath.set(e,r),this._pathToId.set(r,e)}async getItems(e){let t=e.folderId?this.pathForId(e.folderId,!0):this.rootPath,r=await this._inner.getItems({...e,folderId:t}),n=r.items.map(i=>{let o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):this._getOrGenerateId(this.rootPath);return{...i,id:o,folderId:a}});return{...r,items:n}}async createFolder(e,t,r){let n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.createFolder(e,n,r),o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):this._getOrGenerateId(this.rootPath);return{...i,id:o,folderId:a}}async renameItem(e,t){if(typeof this._inner.renameItem!="function")throw new B("Rename item is not supported by inner storage","RenameNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1),n=r,{...i}=await this._inner.renameItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t);return this._updateIdMapping(e.id,i.id),e.isFolder&&this.remapCachedFolderContents(e.id,n,i.id),i.folderId&&(i={...i,folderId:this._getOrGenerateId(i.folderId)}),{...i,id:this._getOrGenerateId(i.id)}}async deleteItem(e,t){if(typeof this._inner.deleteItem!="function")throw new B("Delete item is not supported by inner storage","DeleteNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1);await this._inner.deleteItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t),this.recursivelyRemoveMappings(e.id,r)}async uploadFile(e){if(typeof this._inner.uploadFile!="function")throw new B("Upload file is not supported by inner storage","UnsupportedOperation");let t=e.folderId?this.pathForId(e.folderId,!0):this.rootPath,r=await this._inner.uploadFile({...e,folderId:t}),n=this._getOrGenerateId(r.id),i=r.folderId?this._getOrGenerateId(r.folderId):this._getOrGenerateId(this.rootPath);return{...r,id:n,folderId:i}}async uploadFiles(e){let t=e.folderId,r=e.items?.map(a=>a.folderId)??[],n=e.folderId?this.pathForId(e.folderId,!0):this.rootPath,i={...e,folderId:n,items:e.items?.map(a=>({...a,folderId:a.folderId?this.pathForId(a.folderId??"",!0):n}))??[]},o=await this._inner.uploadFiles(i);return{...o,detailed:o.detailed?.map((a,s)=>{if(!a?.data)return a;let l=a.data.id?this._getOrGenerateId(a.data.id):"",u=a.data.folderId?this._getOrGenerateId(a.data.folderId):r[s]??t??this._getOrGenerateId(this.rootPath);return{...a,data:{...a.data,id:l,folderId:u}}})}}async findFileByUrl(e,t){let r=t?this.pathForId(t,!0):this.rootPath;if(typeof this._inner.findFileByUrl=="function"){let n=await this._inner.findFileByUrl(e,r);if(!n)return;let i=this._getOrGenerateId(n.id),o=n.folderId?this._getOrGenerateId(n.folderId):this._getOrGenerateId(this.rootPath);return{...n,id:i,folderId:o}}}async uploadFileByUrl(e,t,r){let n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.uploadFileByUrl(e,n,r),o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):this._getOrGenerateId(this.rootPath);return{...i,id:o,folderId:a}}async moveItem(e,t){if(typeof this._inner.moveItem!="function")throw new B("Move item is not supported by inner storage","MoveNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1),n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.moveItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},n);this._updateIdMapping(e.id,i.id),e.isFolder&&this.remapCachedFolderContents(e.id,r,i.id);let o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):t;return{...i,id:o,folderId:a}}async moveItems(e,t){if(typeof this._inner.moveItems!="function")throw new B("Move items is not supported by inner storage","MoveNotAllowed");let r=t?this.pathForId(t,!0):this.rootPath,n=e.map(a=>({...a,id:this.pathForId(a.id,a.isFolder??!1),folderId:a.folderId?this.pathForId(a.folderId??"",!0):this.rootPath})),i=await this._inner.moveItems(n,r),o=[];if(i.detailed&&i.detailed.length>0){let a=new Map;for(let s=0;s<i.detailed.length;s++){let l=i.detailed[s],u=l.requestId||(s<e.length?e[s].id:void 0);u&&a.set(u,l)}for(let s of e){let l=a.get(s.id)||(i.detailed.length===e.length?i.detailed[e.indexOf(s)]:void 0);if(l?.success&&l.data){if(this._updateIdMapping(s.id,l.data.id),s.isFolder){let u=this.pathForId(s.id,s.isFolder??!1);this.remapCachedFolderContents(s.id,u,l.data.id)}o.push({requestId:s.id,success:!0,data:{...l.data,id:this._getOrGenerateId(l.data.id),folderId:l.data.folderId?this._getOrGenerateId(l.data.folderId):t||this._getOrGenerateId(this.rootPath)}})}else o.push({requestId:s.id,success:!1,error:l?.error||{message:"Move operation failed - no detailed result",code:"MoveNotAllowed"}})}}else for(let a of e)o.push({requestId:a.id,success:!1,error:{message:"Move operation failed - no detailed results",code:"MoveNotAllowed"}});return{success:i.success,detailed:o,error:i.error}}async copyItems(e,t){if(typeof this._inner.copyItems!="function")throw new B("Copy items is not supported by inner storage","CopyNotAllowed");let r=t?this.pathForId(t,!0):this.rootPath,n=e.map(s=>({...s,id:this.pathForId(s.id,s.isFolder??!1),folderId:s.folderId?this.pathForId(s.folderId??"",!0):this.rootPath})),i=await this._inner.copyItems(n,r),o=[];if(i.detailed&&i.detailed.length>0){let s=new Map;for(let l=0;l<i.detailed.length;l++){let u=i.detailed[l],c=u.requestId||(l<e.length?e[l].id:void 0);c&&s.set(c,u)}for(let l of e){let u=s.get(l.id)||(i.detailed.length===e.length?i.detailed[e.indexOf(l)]:void 0);if(u?.success&&u.data?.id){let c=this._getOrGenerateId(u.data.id);o.push({requestId:l.id,success:!0,data:{...u.data,id:c,folderId:u.data.folderId?this._getOrGenerateId(u.data.folderId):t||this._getOrGenerateId(this.rootPath)}})}else{let c=u?u.success?u.data?u.data.id?{message:"Unknown copy error",code:"CopyNotAllowed"}:{message:"No ID in copied item data",code:"CopyNotAllowed"}:{message:"No data returned from copy operation",code:"CopyNotAllowed"}:u.error||{message:"Copy operation failed",code:"CopyNotAllowed"}:{message:"No detailed result from copy operation",code:"CopyNotAllowed"};o.push({requestId:l.id,success:!1,error:c})}}}else for(let s of e)o.push({requestId:s.id,success:!1,error:{message:"No detailed results from copy operation",code:"CopyNotAllowed"}});let a=o.every(s=>s.success);return{success:a,detailed:o,error:a?void 0:i.error||{message:"Copy operation completed with errors",code:"CopyNotAllowed"}}}async deleteItems(e,t){if(typeof this._inner.deleteItems!="function")throw new B("Delete items is not supported by inner storage","DeleteNotAllowed");let r=e.map(a=>({...a,id:this.pathForId(a.id,a.isFolder??!1),folderId:a.folderId?this.pathForId(a.folderId??"",!0):this.rootPath})),n=await this._inner.deleteItems(r,t),i=[];if(n.detailed&&n.detailed.length>0){let a=new Map;for(let s=0;s<n.detailed.length;s++){let l=n.detailed[s],u=l.requestId||(s<e.length?e[s].id:void 0);u&&a.set(u,l)}for(let s of e){let l=a.get(s.id)||(n.detailed.length===e.length?n.detailed[e.indexOf(s)]:void 0);if(l?.success){let u=this.pathForId(s.id,s.isFolder??!1);if(t.permanent)this.recursivelyRemoveMappings(s.id,u);else if(this._updateIdMapping(s.id,this.trashPath+"/"+u+(s.isFolder?"/":"")),s.isFolder){let c=this.pathForId(s.id,s.isFolder??!1);this.remapCachedFolderContents(s.id,c,this.trashPath+"/"+u+(s.isFolder?"/":""))}i.push({requestId:s.id,success:!0})}else i.push({requestId:s.id,success:!1,error:l?.error||{message:"Delete operation failed",code:"DeleteNotAllowed"}})}}else for(let a of e)if(n.success){let s=this.pathForId(a.id,a.isFolder??!1);if(t.permanent)this.recursivelyRemoveMappings(a.id,s);else if(this._updateIdMapping(a.id,this.trashPath+"/"+s+(a.isFolder?"/":"")),a.isFolder){let l=this.pathForId(a.id,a.isFolder??!1);this.remapCachedFolderContents(a.id,l,this.trashPath+"/"+s+(a.isFolder?"/":""))}i.push({requestId:a.id,success:!0})}else i.push({requestId:a.id,success:!1,error:n.error||{message:"Delete operation failed",code:"DeleteNotAllowed"}});let o=i.every(a=>a.success);return{success:o,detailed:i,error:o?void 0:n.error||{message:"Some items failed to delete",code:"DeleteNotAllowed"}}}remapCachedFolderContents(e,t,r){let n=t.replace(/\/+$/,""),i=r.replace(/\/+$/,""),o=[];for(let[a,s]of this._idToPath.entries()){let l=s.replace(/\/+$/,"");l!==n&&l.startsWith(n+"/")&&o.push({id:a,oldPath:l})}for(let{id:a,oldPath:s}of o){let l=i+s.substring(n.length);this._updateIdMapping(a,l)}}recursivelyRemoveMappings(e,t){let r=t.replace(/\/+$/,""),n=[],i=[];for(let[o,a]of this._idToPath.entries()){let s=a.replace(/\/+$/,"");(s===r||s.startsWith(r+"/"))&&(n.push(o),i.push(s))}for(let o=0;o<n.length;o++)this._idToPath.delete(n[o]),this._pathToId.delete(i[o])}async copyItem(e,t){if(typeof this._inner.copyItem!="function")throw new B("Copy item is not supported by inner storage","CopyNotAllowed");let r=this.pathForId(e.id,e.isFolder??!1),n=t?this.pathForId(t,!0):this.rootPath,i=await this._inner.copyItem({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},n),o=this._getOrGenerateId(i.id),a=i.folderId?this._getOrGenerateId(i.folderId):t??"";return{...i,id:o,folderId:a}}async updateFile(e,t){if(typeof this._inner.updateFile!="function")throw new B("Update file is not supported by inner storage","UnsupportedOperation");let r=this.pathForId(e.id,!1),{...n}=await this._inner.updateFile({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t);return this._updateIdMapping(e.id,n.id),n.folderId&&(n={...n,folderId:this._getOrGenerateId(n.folderId)}),{...n,id:this._getOrGenerateId(n.id)}}async getFileData(e,t){let r=this.pathForId(e.id,!1);if(typeof this._inner.getFileData=="function")return this._inner.getFileData({...e,id:r,folderId:this.pathForId(e.folderId??"",!0)},t);let n=e.url||(typeof this.getUrl=="function"?await this.getUrl(e):void 0);if(!n)throw new B("Cannot get file data: no url and no inner.getFileData","FileReadError");return fetch(n,t?.forceReload?{cache:"no-store"}:void 0).then(i=>i.blob())}async cleanTrash(){if(typeof this._inner.cleanTrash!="function")throw new B("Clean trash is not supported by inner storage","UnsupportedOperation");return await this._inner.cleanTrash()}};function VA(e){return typeof e!="object"||!e?!1:"name"in e&&e.name==="DirectResourceFetchError"?!("final"in e)||e.final!==!1:"final"in e&&e.final===!0}function Li(e){if(VA(e)||e instanceof B)throw e}async function WA(e,t,r,n,i){let{fetchWithProxy:o,handleFileProxy:a,handleProxyUrl:s}=t,l={mode:"cors",...i?.fetchInit},u;if(a)try{let c=await Promise.resolve(a(e));if(c)return n(c)}catch(c){Li(c),u=c}if(s)try{let c=await Promise.resolve(s(e));if(c&&c!==e)return n(await r(c))}catch(c){Li(c),u=c}if(o)try{let c=await Promise.resolve(o(e,l,{intent:"downloadBlob"}));if(!c.ok)throw Error(`HTTP ${c.status}`);return n(await c.blob())}catch(c){Li(c),u=c}if(!o)try{return n(await r(e))}catch(c){Li(c),u=c}throw u instanceof Error?u:Error("Failed to download file from the URL")}function Gp(e){return e.replace(/\/+$/,"")}function QA(e,t){const r=Gp(O.buildCdnFileUrl(t??{},[])),n=Gp(e);if(!(!r||!n.startsWith(`${r}/`)))return n.slice(r.length+1).split("/").filter(Boolean)[0]}function KA(e,t={}){const r=t.projectId?.trim();if(!r)return!1;const n=O.unwrapResourceProxyUrl(e,t.appConfig,t.isStandalone);return O.isCdnUrl(n,t.appConfig)?QA(n,t.appConfig)===r:!1}function YA(e,t={}){return O.unwrapResourceProxyUrl(e,t.appConfig,t.isStandalone)}var XA=3,JA=/^(.+\.[a-zA-Z0-9]{1,8})\?[^?#]*$/;function ZA(e){let t=e;for(let r=0;r<XA;r++)try{const n=decodeURIComponent(t);if(n===t)break;t=n}catch{break}return t.normalize("NFC")}function e0(e){const t=e.match(JA);return t?t[1]:e}function t0(e){if(/^https?:\/\//i.test(e))return new URL(e).pathname.split("/").filter(Boolean).pop();if(e.startsWith("//"))return new URL(e,"https://placeholder.invalid").pathname.split("/").filter(Boolean).pop()}function Hp(e){const t=e.replaceAll("\\","/").trim();if(!t)return t;let r;try{r=t0(t)}catch{}if(!r){r=e0(t.split("/").pop()??"");const n=r.indexOf("#");n>=0&&(r=r.slice(0,n))}return ZA(r)}function zp(e){const t=e.trim();if(t){if(!(/^https?:\/\//i.test(t)||t.startsWith("//")))try{new URL(t)}catch{return}return Hp(t)||void 0}}var Vp={"platform.validation":"ValidationError","platform.malformed_body":"ValidationError","platform.invalid_uuid":"ValidationError","platform.invalid_field_value":"ValidationError","platform.unauthorized":"AuthenticationFailed","platform.forbidden":"AuthorizationFailed","platform.not_found":"FileNotFound","platform.conflict":"FolderAlreadyExists","platform.payload_too_large":"PayloadTooLarge","platform.unsupported_media_type":"FileTypeNotAllowed","platform.too_many_requests":"RateLimitExceeded","platform.unavailable":"ServiceUnavailable","platform.internal":"BackendError","filemanager.file_not_found":"FileNotFound","filemanager.folder_not_found":"FolderNotFound","filemanager.file_exists":"FileAlreadyExists","filemanager.folder_exists":"FolderAlreadyExists","filemanager.invalid_file_name":"FileInvalidName","filemanager.invalid_folder_name":"FolderInvalidName","filemanager.item_not_found":"FileNotFound","filemanager.no_project_access":"AuthorizationFailed","filemanager.project_required":"ValidationError","filemanager.invalid_project_id":"ValidationError","filemanager.file_too_large":"FileTooLarge","filemanager.upload_too_large":"PayloadTooLarge","filemanager.no_files":"ValidationError","filemanager.batch_limit_exceeded":"BatchItemLimitExceeded","filemanager.too_many_items":"BatchItemLimitExceeded","filemanager.items_required":"ValidationError","filemanager.unsupported_file_type":"FileTypeNotAllowed","filemanager.upload_url_rejected":"UploadUrlInvalid","filemanager.transfer_into_descendant":"MoveIntoDescendant","filemanager.legacy_file_unsupported":"UnsupportedOperation","filemanager.backfill_unsupported":"UnsupportedOperation","filemanager.backfill_already_done":"UnsupportedOperation","filemanager.storage_unavailable":"ServiceUnavailable"};function Wp(e){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 409:return"FolderAlreadyExists";case 413:return"PayloadTooLarge";case 415:return"FileTypeNotAllowed";case 429:return"RateLimitExceeded";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return"BackendError"}}function r0(e,t){return(e?Vp[e]:void 0)??Wp(t)}function n0(e){return(e?Vp[e]:void 0)??"FileWriteError"}var Qp=2e3,Kp=30,i0=Qp*Kp;function o0(e){return typeof e?.watchThumbnail=="function"}var Yp=200,a0=class Ht{pathMode=!1;rootId="";trashPath=$e;useSoftDelete=!1;api;projectId;i18n;appConfig;isStandalone;onIndexingStateChange;pendingThumbnails=new Map;thumbWatchers=new Map;resolveSystemFolderByPath;constructor(t){this.api=t.restApi,this.projectId=t.projectId,this.i18n=t.i18n??xa,this.appConfig=t.appConfig,this.isStandalone=t.isStandalone,this.onIndexingStateChange=t.onIndexingStateChange,this.resolveSystemFolderByPath=DA({Trash:{id:$e,folderId:this.rootId}})}async getItems(t){const r=t.folderId===$e;if(t.itemType==="folder")return{items:await this.listFolders(t.folderId,r)};const n=t.itemType==="all"&&(t.page??1)<=1,[i,o]=await Promise.all([n?this.listFolders(t.folderId,r,t.search):[],this.listFiles(t,r)]);return{items:[...i,...o.items],pagination:o.pagination}}async listFolders(t,r,n){const i=await this.api.folders.foldersList({project_id:this.projectId,parent_id:r?void 0:this.normalizeFolderId(t),trashed:r||void 0});try{this.assertOk(i)}catch(a){if(Ht.isNotFound(a))return[];throw a}let o=(i.data.items??[]).map(a=>this.mapFolder(a,t));if(n){const a=n.toLowerCase();o=o.filter(s=>s.name.toLowerCase().includes(a))}return o}async listFiles(t,r){const n=Math.min(t.limit??Yp,Yp),i=Math.max(t.page??1,1),o=await this.api.files.filesList({project_id:this.projectId,folder_id:r?void 0:this.normalizeFolderId(t.folderId),search:t.search||void 0,sort_by:t.sortBy,sort_order:t.sortOrder,limit:n,offset:(i-1)*n,trashed:r||void 0});try{this.assertOk(o)}catch(s){if(Ht.isNotFound(s))return{items:[],pagination:{page:1,limit:n,total:0,totalPages:0,hasNext:!1,hasPrev:!1}};throw s}this.onIndexingStateChange?.(!!o.data.indexing);const a=r?$e:this.normalizeFolderId(t.folderId)??this.rootId;return{items:(o.data.data??[]).map(s=>this.mapFile(s,a)),pagination:this.mapPagination(o.data.page,n)}}async createFolder(t,r){const n=await this.api.folders.foldersCreate({project_id:this.projectId,name:t,parent_id:this.normalizeFolderId(r)});return this.assertOk(n),this.mapFolder(n.data.folder??{},r)}async uploadFileByUrl(t,r){const n=await this.api.files.uploadByUrlCreate({project_id:this.projectId,url:t,folder_id:this.normalizeFolderId(r)});return this.assertOk(n),this.mapFile(n.data.file??{},this.normalizeFolderId(r)??this.rootId)}async uploadFiles(t){if(t.items.length===0)return{success:!0,detailed:[]};const r=new Map;t.items.forEach((o,a)=>{const s=this.normalizeFolderId(o.folderId??t.folderId??void 0)??this.rootId,l=o.requestId??`item-${a}`,u=r.get(s)??[];u.push({item:o,requestId:l}),r.set(s,u)});const n=[];for(const[o,a]of r){const s=new FormData;s.append("project_id",this.projectId),o!==this.rootId&&s.append("folder_id",o);for(const{item:c,requestId:d}of a)s.append("request_id",d),s.append("file",c.data,c.name);let l;try{l=await this.api.request({path:"/files",method:"POST",body:s,type:V.FormData,format:"json",secure:!0}),this.assertOk(l)}catch(c){for(const{requestId:d}of a)n.push({requestId:d,success:!1,error:Ht.toErrorInfo(c)});continue}const u=new Map((l.data.items??[]).map(c=>[c.request_id,c]));a.forEach(({requestId:c},d)=>{const f=u.get(c)??l.data.items?.[d];f?.file?n.push({requestId:c,success:!0,data:this.mapFile(f.file,o)}):n.push({requestId:c,success:!1,error:this.mapItemFail(f?.error)})})}const i=n.filter(o=>!o.success);return{success:i.length===0,error:i[0]?.error,detailed:n}}async uploadFile(t){const r=(await this.uploadFiles({items:[{name:t.name,size:t.size,type:t.type,folderId:t.folderId,data:t.data}]})).detailed?.[0];if(!r?.success||!r.data){const n=r?.error;throw n instanceof ne?n:new ne(String(n?.message??this.i18n.__("Unknown error")),n?.code||"FileWriteError",typeof n?.status=="number"?n.status:void 0)}return r.data}async updateFile(t,r){let n={id:t.id};if(r.data!==void 0){const i=typeof r.data=="string"?Ht.base64ToBlob(r.data,t.type):r.data,o=new FormData;o.append("project_id",this.projectId),o.append("file",i,t.name);const a=await this.api.request({path:`/files/${t.id}/content`,method:"PUT",body:o,type:V.FormData,format:"json",secure:!0});this.assertOk(a);const s=a.data.file??{};n={...n,size:s.size,type:s.mime,url:s.url,thumbnail:s.thumbnail_url,thumbnailUrl:s.thumbnail_url,lastEdited:s.updated_at}}if(r.name&&r.name!==t.name){const i=await this.renameItem(t,r.name);n={...n,...i}}return n}getFileData=async(t,r)=>{const{__:n}=this.i18n;if(!t.url)throw new ne(n("Failed to get file: %s").replace("%s",t.name),"FileReadError");const i=await O.fetchWithResourceProxy(t.url,{config:this.appConfig,standalone:this.isStandalone,resourceType:O.isCdnUrl(t.url,this.appConfig)?"cdn":"generic",intent:"downloadBlob",init:r?.forceReload?{cache:"no-store"}:void 0});if(i.ok)return i.blob();const o=await i.text();throw new ne(o||n("Failed to get file: %s").replace("%s",i.statusText),Wp(i.status),i.status)};static base64ToBlob(t,r){const n=t.includes(",")?t.slice(t.indexOf(",")+1):t,i=atob(n),o=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)o[a]=i.charCodeAt(a);return new Blob([o],r?{type:r}:void 0)}mapItemFail(t){const{__:r}=this.i18n;return{message:t?.message||r("Unknown error"),code:n0(t?.code)}}async renameItem(t,r){if(t.isFolder){const o=await this.api.folders.foldersPartialUpdate({id:t.id},{project_id:this.projectId,name:r});this.assertOk(o);const a=o.data.folder??{};return{id:t.id,name:a.name??r,folderId:a.parent_id??t.folderId,isFolder:!0,lastEdited:a.updated_at}}const n=await this.api.files.filesPartialUpdate({id:t.id},{project_id:this.projectId,name:r,mode:"replace"});this.assertOk(n);const i=n.data.file??{};return{id:t.id,name:i.name??r,folderId:i.folder_id??t.folderId,isFolder:!1,url:i.url,thumbnail:i.thumbnail_url,thumbnailUrl:i.thumbnail_url,extension:i.ext,type:i.mime,lastEdited:i.updated_at}}async deleteItem(t,r){try{if(t.isFolder){const n=await this.api.folders.foldersDelete({id:t.id,project_id:this.projectId,permanent:r.permanent||void 0});this.assertOk(n)}else{const n=await this.api.files.filesDelete({id:t.id,project_id:this.projectId,permanent:r.permanent||void 0});this.assertOk(n)}}catch(n){if(!Ht.isNotFound(n))throw n}}async deleteItems(t,r){if(t.length===0)return{success:!0};const n=new Set(t.filter(s=>s.isFolder).map(s=>s.id)),i=new Set(t.filter(s=>n.has(s.folderId))),o=[];for(const s of t){if(i.has(s)){o.push({requestId:s.id,success:!0});continue}try{await this.deleteItem(s,r),o.push({requestId:s.id,success:!0})}catch(l){o.push({requestId:s.id,success:!1,error:Ht.toErrorInfo(l)})}}const a=o.filter(s=>!s.success);return{success:a.length===0,error:a[0]?.error,detailed:o}}async moveItems(t,r){if(t.length===0)return{success:!0,detailed:[]};const n=t.filter(s=>s.folderId===$e),i=t.filter(s=>s.folderId!==$e),o=[];if(n.length>0){const s=await this.api.trash.restoreCreate({project_id:this.projectId,ids:n.map(l=>l.id),target_folder_id:this.normalizeFolderId(r),on_conflict:"keep_both"});this.assertOk(s),o.push(...this.mapTransferResults(s.data.items,n))}if(i.length>0){const s=await this.api.items.moveCreate({project_id:this.projectId,ids:i.map(l=>l.id),target_folder_id:this.normalizeFolderId(r)});this.assertOk(s),o.push(...this.mapTransferResults(s.data.items,i))}const a=o.filter(s=>!s.success);return{success:a.length===0,error:a[0]?.error,detailed:o}}async moveItem(t,r){return this.unwrapSingleTransfer(await this.moveItems([t],r),t)}async copyItems(t,r){if(t.length===0)return{success:!0,detailed:[]};const n=await this.api.items.copyCreate({project_id:this.projectId,ids:t.map(a=>a.id),target_folder_id:this.normalizeFolderId(r)});this.assertOk(n);const i=this.mapTransferResults(n.data.items,t),o=i.filter(a=>!a.success);return{success:o.length===0,error:o[0]?.error,detailed:i}}async copyItem(t,r){return this.unwrapSingleTransfer(await this.copyItems([t],r),t)}async cleanTrash(){const t=await this.api.trash.emptyCreate({project_id:this.projectId});return this.assertOk(t),{success:!0,deletedCount:(t.data.deleted_files??0)+(t.data.deleted_folders??0)}}async clearCache(t){}findItemByPath(t){return this.resolveSystemFolderByPath(t)}async findFileByUrl(t,r){const n={appConfig:this.appConfig,isStandalone:this.isStandalone,projectId:this.projectId};if(!KA(t,n))return;const i=YA(t,n),o=zp(i);if(!o)return;const{items:a}=await this.listFiles({folderId:r,search:o},!1);return a.find(s=>s.url===t||s.url===i)}mapTransferResults(t,r){const n=new Map(r.map(i=>[i.id,i]));return(t??[]).map((i,o)=>{const a=i.id??r[o]?.id,s=a?n.get(a):r[o];return i.error?{requestId:a,success:!1,error:this.mapItemFail(i.error)}:{requestId:a,success:!0,data:i.file?this.mapFile(i.file,i.file.folder_id??this.rootId):i.folder?this.mapFolder(i.folder):s?{id:s.id}:{id:a??""}}})}unwrapSingleTransfer(t,r){const n=t.detailed?.[0];if(!n?.success){const i=n?.error??t.error;throw i instanceof ne?i:new ne(String(i?.message??this.i18n.__("Unknown error")),i?.code||"BackendError",typeof i?.status=="number"?i.status:void 0)}return n.data??{id:r.id}}mapFile(t,r){return this.trackThumbnailReadiness(t),{id:t.id??"",name:t.name??"",folderId:t.folder_id??r,isFolder:!1,size:t.size,date:t.created_at,lastEdited:t.updated_at,type:t.mime,extension:t.ext,url:t.url,thumbnail:t.thumbnail_url,thumbnailUrl:t.thumbnail_url,dimensions:t.width&&t.height?`${t.width}x${t.height}`:void 0,aspectRatio:t.width&&t.height?String(t.width/t.height):void 0,selected:!1}}trackThumbnailReadiness(t){if(!t.id||!t.url||!t.mime?.startsWith("image/"))return;if(t.thumbnail_url){this.pendingThumbnails.delete(t.url);return}const r=t.created_at?new Date(t.created_at).getTime():NaN;Number.isFinite(r)&&Date.now()-r<i0?this.pendingThumbnails.set(t.url,t.id):this.pendingThumbnails.delete(t.url)}watchThumbnail(t,r){const n=this.pendingThumbnails.get(t);if(!n)return()=>{};const i=this.thumbWatchers.get(n);if(i)return i.listeners.add(r),()=>i.listeners.delete(r);const o={listeners:new Set([r]),cancelled:!1};return this.thumbWatchers.set(n,o),this.pollThumbnail(n,t,o),()=>{o.listeners.delete(r),o.listeners.size===0&&(o.cancelled=!0,this.thumbWatchers.delete(n))}}async pollThumbnail(t,r,n){for(let i=0;i<Kp;i+=1){if(await new Promise(a=>setTimeout(a,Qp)),n.cancelled)return;let o;try{const a=await this.api.files.filesDetail({id:t,project_id:this.projectId});a.ok&&!a.error&&(o=a.data.file?.thumbnail_url)}catch{}if(n.cancelled)return;if(o){this.pendingThumbnails.delete(r),this.thumbWatchers.delete(t),n.listeners.forEach(a=>a(o));return}}this.thumbWatchers.delete(t),this.pendingThumbnails.delete(r)}mapFolder(t,r){return{id:t.id??"",name:t.name??"",folderId:t.parent_id??this.normalizeFolderId(r)??this.rootId,isFolder:!0,date:t.created_at,lastEdited:t.updated_at,selected:!1}}mapPagination(t,r){const n=t?.limit??r,i=t?.offset??0,o=t?.total??0,a=n>0?Math.floor(i/n)+1:1,s=n>0?Math.ceil(o/n):0;return{page:a,limit:n,total:o,totalPages:s,hasNext:a<s,hasPrev:a>1}}normalizeFolderId(t){if(!(!t||t===this.rootId))return t}assertOk(t){if(t.ok&&!t.error)return;const{__:r}=this.i18n,n=t.error?.error,i=r0(n?.code,t.status);throw new ne(n?.message||r("Unknown error"),i,t.status)}static isNotFound(t){return t instanceof ne&&(t.code==="FileNotFound"||t.code==="FolderNotFound")}static toErrorInfo(t){return t instanceof ne||t instanceof Error?t:{message:String(t),raw:t}}};function s0({storageProvider:e,projectId:t,restApi:r,restApiV2:n,i18n:i,pathPostfix:o,appConfig:a,isStandalone:s,onIndexingStateChange:l}){const u=a?.fileManager,c=u?{...u,enablePagination:u.enablePagination===!1?!!u.clientSidePaging:u.enablePagination}:void 0,d=!!n&&Ep(a),f=e||(d&&n?new a0({projectId:t,restApi:n,i18n:i,appConfig:a,isStandalone:s,onIndexingStateChange:l}):new CA({projectId:t,restApi:r,i18n:i,pathPostfix:o,appConfig:a,isStandalone:s})),m=f.pathMode?new qp(f,f.rootId??"",$e,f.trashPath,!0):null;return{storageProvider:f,pathProxy:m,dataProvider:new xp(m??f,c,{...f,trashPath:f.pathMode?"trash":f.trashPath,rootId:f.pathMode?"":f.rootId??""},{fetchWithProxy:(g,h)=>O.fetchWithResourceProxy(g,{config:a,standalone:s,intent:"downloadBlob",init:h})}),usesBuiltInStorage:!e}}var u0=class{http;constructor(e){this.http=e}filesList=(e,t={})=>this.http.request({path:"/files",method:"GET",query:e,secure:!0,format:"json",...t});filesCreate=(e={})=>this.http.request({path:"/files",method:"POST",secure:!0,format:"json",...e});filesDelete=({id:e,...t},r={})=>this.http.request({path:`/files/${e}`,method:"DELETE",query:t,secure:!0,...r});filesDetail=({id:e,...t},r={})=>this.http.request({path:`/files/${e}`,method:"GET",query:t,secure:!0,format:"json",...r});filesPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/files/${e}`,method:"PATCH",body:t,secure:!0,type:V.Json,format:"json",...r});contentList=({id:e,...t},r={})=>this.http.request({path:`/files/${e}/content`,method:"GET",query:t,secure:!0,...r});contentUpdate=({id:e},t={})=>this.http.request({path:`/files/${e}/content`,method:"PUT",secure:!0,format:"json",...t});backfillList=(e,t={})=>this.http.request({path:"/files/backfill",method:"GET",query:e,secure:!0,format:"json",...t});backfillCreate=(e,t={})=>this.http.request({path:"/files/backfill",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t});backfillCancelCreate=(e,t={})=>this.http.request({path:"/files/backfill/cancel",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t});uploadByUrlCreate=(e,t={})=>this.http.request({path:"/files/upload-by-url",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t})},l0=class{http;constructor(e){this.http=e}foldersList=(e,t={})=>this.http.request({path:"/folders",method:"GET",query:e,secure:!0,format:"json",...t});foldersCreate=(e,t={})=>this.http.request({path:"/folders",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t});foldersDelete=({id:e,...t},r={})=>this.http.request({path:`/folders/${e}`,method:"DELETE",query:t,secure:!0,...r});foldersPartialUpdate=({id:e},t,r={})=>this.http.request({path:`/folders/${e}`,method:"PATCH",body:t,secure:!0,type:V.Json,format:"json",...r})},c0=class{http;constructor(e){this.http=e}copyCreate=(e,t={})=>this.http.request({path:"/items/copy",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t});moveCreate=(e,t={})=>this.http.request({path:"/items/move",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t})},d0=class{http;constructor(e){this.http=e}emptyCreate=(e,t={})=>this.http.request({path:"/trash/empty",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t});restoreCreate=(e,t={})=>this.http.request({path:"/trash/restore",method:"POST",body:e,secure:!0,type:V.Json,format:"json",...t})},f0=class extends Md{files=new u0(this);folders=new l0(this);items=new c0(this);trash=new d0(this)};function p0(e){const t=(O.isStateContainer(e)?O.getContainer(e):e)?.getInstance(O.CUSTOM_FETCH_ID);return new f0({baseUrl:"https://app.emailmaker.ru/api/v2",customFetch:t?.execute||fetch})}var h0=({users:e,isEditor:t,isPlugin:r,token:n})=>{const[i,o]=(0,R.useState)(!1),a=window.localStorage.getItem(Ft.em_color_scheme),s=c=>{const{first_name:d,last_name:f,email:m}=c.user.name;return d?`${d.split("")[0]}${f?`${f.split("")[0]}`:""}`:m?.split("")[0].toUpperCase()||" "},l=c=>{const{first_name:d,last_name:f,email:m}=c.user.name;return d&&f?`${d} ${f}`:d||m},u=c=>{const d=l(c);return(0,$.jsx)("span",{children:d})};return(0,$.jsx)($.Fragment,{children:e.length>0&&t&&(0,$.jsx)("div",{className:`user-list ${i?"open":""}`,style:r?{left:"60px",bottom:"10px"}:{},onMouseOver:()=>o(!0),onMouseOut:()=>o(!1),children:e.map(c=>(0,$.jsx)("div",{className:"user",style:{[Dr("user-color")]:c.user.color,[Dr("border-color")]:n?.colorBgContainer,[Dr("text-color")]:a==="dark"?n?.colorIconHover:n?.colorWhite},children:(0,$.jsx)(be.ui_kit$Tooltip,{title:u(c),placement:"topLeft",trigger:"hover",color:n?.colorBgSpotlight,children:(0,$.jsx)("div",{children:s(c)})})},c.user.color))})})},ki="Ai",Xp=we({reducerPath:"AiApi",tagTypes:[ki],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn({body:t},r){return x(r).aiGenerator.ai_create(t)}}),getDialog:e.query({queryFn({entity_id:t,connection:r="chat"},n){return Et(O.getContainer(n)).aiAssistentEnabled===!1?Promise.resolve({data:{documents:[],totalCount:0}}):x(n).aiGenerator.ai_status_list({connection:r,entity_id:t})},providesTags:t=>t?.documents?[...t.documents.map(({id:r})=>({type:ki,id:r})),{type:ki,id:"LIST"}]:[{type:ki,id:"LIST"}]})})}),{useSendMessageMutation:m0,useGetDialogQuery:g0,useLazyGetDialogQuery:y0}=Xp,v0=async(e,t,r)=>{const n=x(t).baseUrl.replaceAll(/[\\/]$/g,""),i=await Re({baseUrl:n})(e,t,r);if(i.error){let o=i.error;if(typeof o.json=="function")try{o=await o.json()}catch{o=await o}return{error:o}}return i},Jp=we({reducerPath:"AiApiGenerator",baseQuery:v0,endpoints:e=>({generateIdForTask:e.mutation({queryFn(t,r){return vw(r).tasks.tasksControllerCreateTask(t).then(n=>n)}}),clearAiChat:e.query({queryFn(t,r){return x(r).aiGenerator.clear_history_list(t).then(n=>n)}}),getGeneratedContent:e.query({queryFn:t=>({data:[]}),async onCacheEntryAdded({id:t,setError:r},n){const{updateCachedData:i,cacheEntryRemoved:o}=n,a=x(n).baseUrl.indexOf("emailmaker")>=0?Ml.maker:Ml.blocks,s=await O.getContainer(n).getInstance(O.TOKEN_ID),l=s?{Authorization:`Bearer ${s}`}:{},{EventSourcePolyfill:u}=await(0,gt.__vitePreload)(async()=>{const{EventSourcePolyfill:d}=await Promise.resolve().then(()=>q.__toESM(ye("./6933d533.js").default));return{EventSourcePolyfill:d}},void 0,{}.url),c=new u(`${a}/tasks/${t}`,{headers:l});c.onmessage=d=>{const f=JSON.parse(d.data);i(m=>{m.push(f)})},c.onerror=d=>{r("Error connecting to EventSource"),c.close()},await o,c.close()}}),getAiGenerateStatus:e.mutation({query:t=>({url:"/constructor/v1/ai-save-task",method:"POST",body:t})})})}),{useGenerateIdForTaskMutation:Gj,useGetGeneratedContentQuery:Hj,useLazyClearAiChatQuery:_0,useLazyGetGeneratedContentQuery:b0,useGetAiGenerateStatusMutation:E0}=Jp;function un({id:e,post:t,parent:r,author:n,content:i,acf:{status:o,target_id:a},...s}){return{...s,id:ue(e),post:ue(t),parent:ue(r),author:ue(n),content:He(i),target_id:a,comment_status:o}}var wt="Comments",Zp=we({reducerPath:"commentsApi",tagTypes:[wt],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(t,r){return x(r).wp.comments_list({post:[ge(t)],per_page:50,order:"asc"}).then(Ne(un))},providesTags:t=>t?[...t.map(({id:r})=>({type:wt,id:r})),{type:wt,id:"LIST"}]:[{type:wt,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:t,author:r,parent:n,content:i,author_name:o,author_email:a,targetId:s},l){const u=x(l),c={post:ge(t),author:ge(r),author_name:o,author_email:a},d={};return i&&(c.content=i),n&&(c.parent=ge(n)),s&&(d["acf[target_id]"]=s),u.wp.comments_create(c,{type:O.ContentType.UrlEncoded,extraQuery:d}).then(he(un))},invalidatesTags:[{type:wt,id:"LIST"}]}),deleteComment:e.mutation({queryFn(t,r){return x(r).wp.comments_delete({id:t},{}).then(Gn(un))},invalidatesTags:[{type:wt,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:t,content:r,status:n,targetId:i},o){const a=x(o),s={},l={};return r&&(s.content=r),n&&(l["acf[status]"]=n),i&&(l["acf[target_id]"]=i),a.wp.comments_update({id:t},s,{type:O.ContentType.UrlEncoded,extraQuery:l}).then(he(un))},invalidatesTags:[{type:wt,id:"LIST"}]}),deleteTarget:e.mutation({queryFn(t,r){return x(r).wp.comments_update({id:t},{},{type:O.ContentType.UrlEncoded,extraQuery:{"acf[target_id]":""}}).then(he(un))},invalidatesTags:[{type:wt,id:"LIST"}]})})}),{useGetCommentsQuery:S0,useAddCommentMutation:P0,useDeleteCommentMutation:w0,useEditCommentMutation:I0,useDeleteTargetMutation:C0}=Zp,eh={isCollapsed:!0,isMonacoFocusing:!1},th="defaultModePanesSlice",rh=Pe({name:th,initialState:eh,reducers:{setMonacoFocusing:(e,t)=>{e.isMonacoFocusing=t.payload},resetPanes:()=>eh}}),{resetPanes:O0,setMonacoFocusing:T0}=rh.actions,A0=e=>e[th].isMonacoFocusing,ln=null,ms=[],cn=null,nh="custom",M0=e=>{ms=e,ln=null,cn=null},ih=e=>{const t=e.weight?.trim()||"400",r=e.style??"normal";return r==="italic"||r==="oblique"?`${t}i`:t},N0=e=>{if(!ms.length)return e;const t=Array.isArray(e.familyMetadataList)?[...e.familyMetadataList]:[],r=new Map;for(const i of ms){const o=i.family?.trim()||Gv(i.source_url)||i.name.trim();if(!o)continue;const a=Qv(i.source_url,o),s=a.length?a.map(u=>ih({...i,...u})):[ih(i)];let l=r.get(o);l||(l={family:o,category:nh,subsets:["cyrillic","latin"],popularity:0,fonts:{}},r.set(o,l));for(const u of s)l.fonts[u]={}}if(!r.size)return e;const n=t.filter(i=>i?.category!==nh||!(typeof i.family=="string"&&r.has(i.family)));return{...e,familyMetadataList:[...r.values(),...n]}},R0=()=>ln?Promise.resolve(ln):(cn!==null||(cn=(0,gt.__vitePreload)(async()=>{const{default:e}=await Promise.resolve().then(()=>ye("./8bf56b5b.js"));return{default:e}},void 0,{}.url).then(({default:e})=>(ln=N0(e),ln)).catch(e=>{throw e})),cn),gs="em_version";function oh(e){if(!e||!e.includes("em_version"))return e;try{const t=typeof document<"u"?document.baseURI:"http://localhost/",r=new URL(e,t);return r.searchParams.has("em_version")?(r.searchParams.delete(gs),/^https?:\/\//i.test(e)||e.startsWith("//")?r.href:r.pathname+r.search+r.hash):e}catch{return e}}function D0(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",r=new URL(e,t);return r.searchParams.set(gs,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?r.href:r.pathname+r.search+r.hash}catch{return`${e}${e.includes("?")?"&":"?"}${gs}=${Date.now()}`}}var j0=[Ge.APPLICATION_OPEN_IMAGE_AI_POPUP,Ge.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP,Ge.APPLICATION_OPEN_IMAGE_EDIT_POPUP,Ge.APPLICATION_OPEN_IMAGE_GIF_POPUP,Ge.APPLICATION_OPEN_IMAGE_STOCK_POPUP],F0=3e3,ah=new WeakMap;function sh(e){let t=ah.get(e);return t||(t={request:null,listeners:new Set},ah.set(e,t)),t}function uh(e){return oh(typeof e=="string"?e:"")}function L0(){const e=Yt();ip(t=>{const r=t.data;if(!r?.operation||!j0.includes(r.operation))return;const n=sh(e);n.request={operation:r.operation,src:uh(r.src),at:Date.now()},n.listeners.forEach(i=>i())})}function k0(e,t){const r=Yt(),n=(0,R.useRef)(t);n.current=t,(0,R.useEffect)(()=>{const i=sh(r),o=uh(e),a=()=>{const s=i.request;!s||s.src!==o||Date.now()-s.at>F0||(i.request=null,n.current(s.operation))};return i.listeners.add(a),a(),()=>{i.listeners.delete(a)}},[r,e])}function U0(e){Promise.resolve(e).catch(t=>{})}var ys=new Set;function B0(e,t){ys.has(e)||(ys.add(e),Promise.resolve(t()).finally(()=>{ys.delete(e)}))}function $0(e,t,r,n){const i=ro(e),o=Symbol(`once-handler-${t}`),a=i?s=>{s[o]||(s[o]=!0,r(s))}:r;return i?.addEventListener(t,a,n),window.addEventListener(t,a,n),{dispose:()=>{i?.removeEventListener(t,a,n),window.removeEventListener(t,a,n)}}}function x0(e,t,r,n){const i=ro(e),o=Symbol(`once-handler-${t}`),a=i?s=>{s[o]||(s[o]=!0,r(s))}:r;return i?.addEventListener(t,a,n),document.addEventListener(t,a,n),{dispose:()=>{i?.removeEventListener(t,a,n),document.removeEventListener(t,a,n)}}}var q0=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function vs(e){return q0.test(e)||e.indexOf("//")===0}function dn(e){return e&&(e.endsWith("/")?e:`${e}/`)}function lh(){return typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:""}function ch(e,t){const r=e==null||e===""?"./":String(e);if(vs(r))return dn(r);const n=t??lh();if(!n)return dn(r);try{return dn(new URL(r,n).href)}catch{return dn(r)}}function G0(e,t){const r=t??lh();if(!r)return e;try{return new URL(e,r).href}catch{return e}}function H0(e,t){const r=String(e??"");if(!r)return"";if(vs(r))return r;if(r.charAt(0)==="/")return G0(r);const n=r.replace(/^\.\/+/,"").replace(/^\/+/,"");try{return new URL(n,t).href}catch{return dn(t)+n}}function dh(){return typeof window.__emailmaker__<"u"&&window.__emailmaker__?.publicPath?ch(window.__emailmaker__.publicPath):ch("/")}function z0(e){return H0(e,dh())}function fh(e){const t=z0(e);return vs(t)?t:typeof window<"u"&&window.location?.origin?new URL(t.startsWith("/")?t:`/${t}`,window.location.origin).href:t}var _s=e=>{if(!e)return"image/png";const t=e.toLowerCase();return t.includes("jpeg")||t.includes("jpg")||t.includes("pjpeg")?"image/jpeg":t.includes("png")?"image/png":t.includes("gif")?"image/gif":t.includes("webp")?"image/webp":t.includes("svg")?"image/svg+xml":"image/png"},ph=e=>{const t=_s(e).split("/")[1];return t==="svg+xml"?"svg":t||"png"};function fn(e){switch(e.trim().split(".").pop()?.toLowerCase()){case"svg":return"image/svg+xml";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"webp":return"image/webp";default:return}}function bs(e){if(e.type?.startsWith?.("image/"))return!0;const t=(e.name??"").trim();if(fn(t))return!0;const r=(e.type??"").toLowerCase();return r.includes("svg")?!0:r==="text/xml"||r==="application/xml"||r==="text/plain"?t.toLowerCase().endsWith(".svg"):!1}var Ui={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},V0=["gif","svg"];function W0(e){return!V0.includes(e)}function Es(e,t){if(e?.compressMaxSize===0||e?.compressMaxWidthOrHeight===0)return!1;const r=t?.trim()??"";return r.startsWith("image/")&&r!=="image/gif"}function Ss(e){return{maxSizeMB:e?.compressMaxSize??Ui.MAX_SIZE_MB,maxWidthOrHeight:e?.compressMaxWidthOrHeight??Ui.MAX_WIDTH_OR_HEIGHT}}function hh(e){if(!e)return null;const t=e.trim();if(t.endsWith("%"))return null;const r=parseFloat(t.replace(/px$/i,""));return Number.isFinite(r)&&r>0?r:null}function Q0(e){const t=e.match(/<\s*svg\b[\s\S]*?>/i)?.[0]??"",r=t.match(/\bwidth\s*=\s*["']([^"']*)["']/i)?.[1],n=t.match(/\bheight\s*=\s*["']([^"']*)["']/i)?.[1],i=hh(r),o=hh(n);if(i!=null&&o!=null)return{width:i,height:o};const a=e.match(/viewBox\s*=\s*["']([^"']+)["']/i)?.[1];if(a){const s=a.trim().split(/[\s,]+/);if(s.length===4){const l=parseFloat(s[2]),u=parseFloat(s[3]);if(Number.isFinite(l)&&Number.isFinite(u)&&l>0&&u>0)return{width:l,height:u}}}return i!=null?{width:i,height:i}:o!=null?{width:o,height:o}:{width:300,height:300}}function K0(e,t=2,r=4096){const{width:n,height:i}=Q0(e);let o=Math.max(1,Math.round(n*t)),a=Math.max(1,Math.round(i*t));const s=Math.max(64,r),l=Math.max(o,a);if(l>s){const u=s/l;o=Math.max(1,Math.round(o*u)),a=Math.max(1,Math.round(a*u))}return{width:o,height:a}}function Y0(e){return new Promise((t,r)=>{e.toBlob(n=>{n?t(n):r(new Error("canvas.toBlob returned null"))},"image/png")})}async function X0(e,t,r){const n=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(n);try{const o=new Image;await new Promise((c,d)=>{o.onload=()=>c(),o.onerror=()=>d(new Error("Failed to load SVG image")),o.src=i});const a=document.createElement("canvas"),s=Math.max(1,Math.round(t)),l=Math.max(1,Math.round(r));a.width=s,a.height=l;const u=a.getContext("2d");if(!u)throw new Error("Canvas 2D context is not available");return u.clearRect(0,0,s,l),u.drawImage(o,0,0,s,l),Y0(a)}finally{URL.revokeObjectURL(i)}}var J0=24e3;async function Z0(e,t=J0){const r=Math.min(t,Math.max(0,e.size));return e.slice(0,r).text()}function eM(e){const t=e.trimStart().replace(/^\uFEFF/,"");return t.startsWith("<")?/<\s*svg[\s>/]/i.test(t):!1}async function tM(e,t={}){const r=t.pixelScale??2,n=t.maxLongEdge??4096,i=await e.text(),{width:o,height:a}=K0(i,r,n),s=await X0(i,o,a),l=t.outputFileName??e.name,u=/\.svg$/i.test(l)?l.replace(/\.svg$/i,".png"):`${l}.png`;return new File([s],u,{type:"image/png",lastModified:e.lastModified})}function Bi(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function Ps(e,t){return!t||t===e.name?e:Bi(e,t,e.type,e.lastModified)}function rM(e,t,r,n){const i=n??t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?Bi(e,i,r,t.lastModified):e:Bi(e,i,r,t.lastModified)}function nM(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}function iM(e){return e==="image/webp"?"image/jpeg":e}async function ws(e,t={}){const{maxSizeMB:r=Ui.MAX_SIZE_MB,maxWidthOrHeight:n=Ui.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0,convertSvgToPng:l=!1}=t;if(!e||!(e instanceof File))return e;let u=e,c=!1;if(l){const _=(u.type||"").toLowerCase(),w=/\.svg$/i.test(u.name.trim()),v=_.includes("svg");let I=!1;if(!v&&!w)try{const y=await Z0(u);I=eM(y)}catch{I=!1}if(v||w||I)try{u=await tM(u,{maxLongEdge:n,outputFileName:o??u.name}),c=!0}catch{u=e}}const d=(u.type&&u.type.trim()!==""?u.type:fn(u.name))||(c?"image/png":i)||"image/jpeg",f=_s(d),m=c?u.name:o??u.name;if(!f.startsWith("image/"))return Ps(u,m);const g=iM(f),h=ph(f),b=ph(g),P=g!==f?nM(m,b):m,E=s&&W0(h);if(!E&&g===f)return Ps(u,P);const S=u.type===f?u:Bi(u,u.name,f,u.lastModified);try{const _={libURL:a,useWebWorker:!0,fileType:g};E?(_.maxSizeMB=r,_.maxWidthOrHeight=n):(_.maxSizeMB=Math.max(S.size/1048576+1,1),_.initialQuality=1,_.alwaysKeepResolution=!0);const{default:w}=await(0,gt.__vitePreload)(async()=>{const{default:I}=await Promise.resolve().then(()=>ye("./a8cb6e27.js")).then(y=>y.browser_image_compression_exports);return{default:I}},void 0,{}.url),v=await w(S,_);return rM(v,S,_s(v.type||g),P)}catch{try{return Ps(u,P)}catch{return u}}}var oM="js/browser-image-compression.js";function Is(){return fh(oM)}var aM=["image/png","image/jpeg"];async function sM(e){if(typeof createImageBitmap!="function")return null;try{const t=await createImageBitmap(e),r=Math.max(t.width,t.height);return t.close(),r}catch{return null}}async function uM(e,t,r=Is()){if(!bs(e))return e;const{maxWidthOrHeight:n}=Ss(t),i=e.type?.trim()||fn(e.name)||e.type||"",o=Es(t,i);if(aM.includes(i.toLowerCase())){const a=await sM(e);if(!o||a!==null&&a<=n)return e}return ws(e,{maxSizeMB:Number.POSITIVE_INFINITY,maxWidthOrHeight:n,mimeType:i||void 0,fileName:e.name,libURL:r,enableCompression:o,convertSvgToPng:!0})}async function lM(e,t,r=Is()){if(!bs(e))return e;const{maxSizeMB:n,maxWidthOrHeight:i}=Ss(t),o=e.type?.trim()||fn(e.name)||e.type||"";return ws(e,{maxSizeMB:n,maxWidthOrHeight:i,mimeType:o||void 0,fileName:e.name,libURL:r,enableCompression:Es(t,o),convertSvgToPng:!0})}function cM(){const e=Go();return(0,R.useCallback)(()=>{document.body.classList.remove("editor"),e("/billing")},[e])}function dM(e){return XI(e||"en_US")}var fM=q.__commonJSMin(((e,t)=>{(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(i,o){return i<<o|i>>>32-o},rotr:function(i,o){return i<<32-o|i>>>o},endian:function(i){if(i.constructor==Number)return n.rotl(i,8)&16711935|n.rotl(i,24)&4278255360;for(var o=0;o<i.length;o++)i[o]=n.endian(i[o]);return i},randomBytes:function(i){for(var o=[];i>0;i--)o.push(Math.floor(Math.random()*256));return o},bytesToWords:function(i){for(var o=[],a=0,s=0;a<i.length;a++,s+=8)o[s>>>5]|=i[a]<<24-s%32;return o},wordsToBytes:function(i){for(var o=[],a=0;a<i.length*32;a+=8)o.push(i[a>>>5]>>>24-a%32&255);return o},bytesToHex:function(i){for(var o=[],a=0;a<i.length;a++)o.push((i[a]>>>4).toString(16)),o.push((i[a]&15).toString(16));return o.join("")},hexToBytes:function(i){for(var o=[],a=0;a<i.length;a+=2)o.push(parseInt(i.substr(a,2),16));return o},bytesToBase64:function(i){for(var o=[],a=0;a<i.length;a+=3)for(var s=i[a]<<16|i[a+1]<<8|i[a+2],l=0;l<4;l++)a*8+l*6<=i.length*8?o.push(r.charAt(s>>>6*(3-l)&63)):o.push("=");return o.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/gi,"");for(var o=[],a=0,s=0;a<i.length;s=++a%4)s!=0&&o.push((r.indexOf(i.charAt(a-1))&Math.pow(2,-2*s+8)-1)<<s*2|r.indexOf(i.charAt(a))>>>6-s*2);return o}};t.exports=n})()})),mh=q.__commonJSMin(((e,t)=>{var r={utf8:{stringToBytes:function(n){return r.bin.stringToBytes(unescape(encodeURIComponent(n)))},bytesToString:function(n){return decodeURIComponent(escape(r.bin.bytesToString(n)))}},bin:{stringToBytes:function(n){for(var i=[],o=0;o<n.length;o++)i.push(n.charCodeAt(o)&255);return i},bytesToString:function(n){for(var i=[],o=0;o<n.length;o++)i.push(String.fromCharCode(n[o]));return i.join("")}}};t.exports=r})),pM=q.__commonJSMin(((e,t)=>{t.exports=function(i){return i!=null&&(r(i)||n(i)||!!i._isBuffer)};function r(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function n(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&r(i.slice(0,0))}})),hM=q.__commonJSMin(((e,t)=>{(function(){var r=fM(),n=mh().utf8,i=pM(),o=mh().bin,a=function(s,l){s.constructor==String?l&&l.encoding==="binary"?s=o.stringToBytes(s):s=n.stringToBytes(s):i(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var u=r.bytesToWords(s),c=s.length*8,d=1732584193,f=-271733879,m=-1732584194,g=271733878,h=0;h<u.length;h++)u[h]=(u[h]<<8|u[h]>>>24)&16711935|(u[h]<<24|u[h]>>>8)&4278255360;u[c>>>5]|=128<<c%32,u[(c+64>>>9<<4)+14]=c;for(var b=a._ff,P=a._gg,E=a._hh,S=a._ii,h=0;h<u.length;h+=16){var _=d,w=f,v=m,I=g;d=b(d,f,m,g,u[h+0],7,-680876936),g=b(g,d,f,m,u[h+1],12,-389564586),m=b(m,g,d,f,u[h+2],17,606105819),f=b(f,m,g,d,u[h+3],22,-1044525330),d=b(d,f,m,g,u[h+4],7,-176418897),g=b(g,d,f,m,u[h+5],12,1200080426),m=b(m,g,d,f,u[h+6],17,-1473231341),f=b(f,m,g,d,u[h+7],22,-45705983),d=b(d,f,m,g,u[h+8],7,1770035416),g=b(g,d,f,m,u[h+9],12,-1958414417),m=b(m,g,d,f,u[h+10],17,-42063),f=b(f,m,g,d,u[h+11],22,-1990404162),d=b(d,f,m,g,u[h+12],7,1804603682),g=b(g,d,f,m,u[h+13],12,-40341101),m=b(m,g,d,f,u[h+14],17,-1502002290),f=b(f,m,g,d,u[h+15],22,1236535329),d=P(d,f,m,g,u[h+1],5,-165796510),g=P(g,d,f,m,u[h+6],9,-1069501632),m=P(m,g,d,f,u[h+11],14,643717713),f=P(f,m,g,d,u[h+0],20,-373897302),d=P(d,f,m,g,u[h+5],5,-701558691),g=P(g,d,f,m,u[h+10],9,38016083),m=P(m,g,d,f,u[h+15],14,-660478335),f=P(f,m,g,d,u[h+4],20,-405537848),d=P(d,f,m,g,u[h+9],5,568446438),g=P(g,d,f,m,u[h+14],9,-1019803690),m=P(m,g,d,f,u[h+3],14,-187363961),f=P(f,m,g,d,u[h+8],20,1163531501),d=P(d,f,m,g,u[h+13],5,-1444681467),g=P(g,d,f,m,u[h+2],9,-51403784),m=P(m,g,d,f,u[h+7],14,1735328473),f=P(f,m,g,d,u[h+12],20,-1926607734),d=E(d,f,m,g,u[h+5],4,-378558),g=E(g,d,f,m,u[h+8],11,-2022574463),m=E(m,g,d,f,u[h+11],16,1839030562),f=E(f,m,g,d,u[h+14],23,-35309556),d=E(d,f,m,g,u[h+1],4,-1530992060),g=E(g,d,f,m,u[h+4],11,1272893353),m=E(m,g,d,f,u[h+7],16,-155497632),f=E(f,m,g,d,u[h+10],23,-1094730640),d=E(d,f,m,g,u[h+13],4,681279174),g=E(g,d,f,m,u[h+0],11,-358537222),m=E(m,g,d,f,u[h+3],16,-722521979),f=E(f,m,g,d,u[h+6],23,76029189),d=E(d,f,m,g,u[h+9],4,-640364487),g=E(g,d,f,m,u[h+12],11,-421815835),m=E(m,g,d,f,u[h+15],16,530742520),f=E(f,m,g,d,u[h+2],23,-995338651),d=S(d,f,m,g,u[h+0],6,-198630844),g=S(g,d,f,m,u[h+7],10,1126891415),m=S(m,g,d,f,u[h+14],15,-1416354905),f=S(f,m,g,d,u[h+5],21,-57434055),d=S(d,f,m,g,u[h+12],6,1700485571),g=S(g,d,f,m,u[h+3],10,-1894986606),m=S(m,g,d,f,u[h+10],15,-1051523),f=S(f,m,g,d,u[h+1],21,-2054922799),d=S(d,f,m,g,u[h+8],6,1873313359),g=S(g,d,f,m,u[h+15],10,-30611744),m=S(m,g,d,f,u[h+6],15,-1560198380),f=S(f,m,g,d,u[h+13],21,1309151649),d=S(d,f,m,g,u[h+4],6,-145523070),g=S(g,d,f,m,u[h+11],10,-1120210379),m=S(m,g,d,f,u[h+2],15,718787259),f=S(f,m,g,d,u[h+9],21,-343485551),d=d+_>>>0,f=f+w>>>0,m=m+v>>>0,g=g+I>>>0}return r.endian([d,f,m,g])};a._ff=function(s,l,u,c,d,f,m){var g=s+(l&u|~l&c)+(d>>>0)+m;return(g<<f|g>>>32-f)+l},a._gg=function(s,l,u,c,d,f,m){var g=s+(l&c|u&~c)+(d>>>0)+m;return(g<<f|g>>>32-f)+l},a._hh=function(s,l,u,c,d,f,m){var g=s+(l^u^c)+(d>>>0)+m;return(g<<f|g>>>32-f)+l},a._ii=function(s,l,u,c,d,f,m){var g=s+(u^(l|~c))+(d>>>0)+m;return(g<<f|g>>>32-f)+l},a._blocksize=16,a._digestsize=16,t.exports=function(s,l){if(s==null)throw new Error("Illegal argument "+s);var u=r.wordsToBytes(a(s,l));return l&&l.asBytes?u:l&&l.asString?o.bytesToString(u):r.bytesToHex(u)}})()})),gh=q.__toESM(hM());function mM(e){return e.replace(/\/+$/,"")}function yh(e,t){const r=mM(String(t||"").trim());if(!r)throw new Error(`[previewUrls] Missing ${e}`);return r}function vh(){return typeof window<"u"&&!window.location.host.includes("localhost")?window.location.origin:new URL(yh("REACT_APP_OPENAPI_BASE_URL","https://app.emailmaker.ru/api/")).origin}function gM(){return new URL(vh()).hostname}function yM(){return vh()}function vM(){return new URL(yh("REACT_APP_IMAGE_INFO_TOOL","https://scr.emcdn.ru/imageinfo")).origin}function _M(){return typeof window<"u"&&window.location.host.includes("localhost"),vM()}function $i(e,t){return(0,gh.default)(`${e}${t}${b_}`)}function bM(e,t,r,n){const i=n??$i(r,t);return`https://${gM()}/get${e}/${t}?secret_hash=${i}&raw=true`}function EM(e,t,r){return`/get${e}/${t}?secret_hash=${$i(r,t)}&raw=true`}function SM(e,t){return`${yM()}/email/${e}/raw?key=${$i(t,e)}`}function PM(e,t){return`/email/${e}/raw?key=${$i(t,e)}`}function wM(e){return e==null||e===""?"":`&cacheControl=true&cache-hash=${(0,gh.default)(String(e))}`}var zj=800;function _h({type:e,projectId:t,elementId:r,cacheKey:n,clearCache:i=!0,pixelRatio:o=.8,selector:a,force:s,minHeight:l,targetUrl:u,width:c=800}){const d=_M(),f=wM(n),m=l?`minHeight=${l}&`:"",g=s===void 0?"":`&force=${s}`,h=u??bM(e,r,t);return`${d}/screenshot?${m}delay=1000&width=${c}${a?"":"&fullPage=true"}&deviceScaleFactor=${o}&format=jpg&clearCache=${i}${f}${g}&url=${encodeURIComponent(h)}${a?`&selector=${a}`:""}`}function IM(e,t,r=!0,n=.8,i,o,a){const s=`https://racs.emcdn.ru/v3/file/${e}?resource=exportPngApi`;return _h({type:"email",projectId:0,elementId:e,cacheKey:t??o??e,clearCache:r,pixelRatio:n,selector:i,targetUrl:s,width:a})}function CM(e,t,r,n){return _h({type:e,projectId:t,elementId:r,cacheKey:n??null,pixelRatio:.8,clearCache:!0})}function OM(){return"support@emailmaker.ru"}function TM(){return jv==="emailmaker"}var bh={historyData:[],elementHistoryHasMore:!1},Cs="revisionHistorySlice",Os=Pe({name:Cs,initialState:bh,reducers:{resetElementHistorySlice:()=>({...bh}),setElementHistory:(e,t)=>{t.payload.length!==0&&(e.historyData=t.payload)},setElementHistoryPage:(e,{payload:t})=>{e.historyData=t.revisions,e.elementHistoryHasMore=t.hasMore}}}),{resetElementHistorySlice:AM,setElementHistoryPage:xi}=Os.actions,{setElementHistory:Vj}=Os.actions,MM=e=>e[Cs].elementHistoryHasMore,NM=e=>e[Cs].historyData;function RM(){const e=ve(),t=tt();return(0,R.useCallback)(async(r,n=1)=>{const i=O.getContainer(e),o=st(pa(i).sessionKey());try{if(o){if(!Kc(i))return n===1&&t(xi({revisions:[],hasMore:!1})),{isSuccess:!0,data:{data:[],hasMore:!1}};const{revisions:l,hasMore:u}=await ga(i).readRevisions(String(r),n);return n===1&&t(xi({revisions:l,hasMore:u})),{isSuccess:!0,data:{data:l,hasMore:u}}}if(!await Pc(i))return n===1&&t(xi({revisions:[],hasMore:!1})),{isSuccess:!0,data:{data:[],hasMore:!1}};const{revisions:a,hasMore:s}=await ma(i).readRevisions(String(r),n);return n===1&&t(xi({revisions:a,hasMore:s})),{isSuccess:!0,data:{data:a,hasMore:s}}}catch(a){return{isError:!0,error:a}}},[e,t])}var Eh=we({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn(t,r){return x(r).saveFile.upload_create(t,{type:O.ContentType.FormData})}}),sendTestEmail:e.mutation({queryFn(t,r){return x(r).saveFile.send_email_create(t,{type:O.ContentType.FormData})}}),sendLivePreview:e.mutation({queryFn(t,r){return x(r).saveFile.get_link_create(t,{type:O.ContentType.FormData})}}),sendShortLink:e.mutation({queryFn(t,r){return x(r).saveFile.shortener_create(t,{type:O.ContentType.FormData})}})})}),{useUploadImageMutation:DM,useSendTestEmailMutation:jM,useSendLivePreviewMutation:FM,useSendShortLinkMutation:LM}=Eh,kM="Not available for collaborative editing",UM="Problem with internet connection";function BM(){const{document:e}=Pt();return(0,R.useCallback)(()=>ap(e),[e])}function $M(e){const t={order:"desc",orderby:"modified"},r={};if(e.notEmbed||(r._embed=""),e.projectId&&(r._embed="author",r._fields="id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template,_embedded",t["filter[meta_key]"]="project",t["filter[meta_value]"]=e.projectId),e.fields&&(r._fields=e.fields),e.page&&(t.page=e.page),(e.order==="asc"||e.order==="desc")&&(t.order=e.order),e.orderby&&(t.orderby=e.orderby),e.folderTag&&e.folderTag!=="all"?(t["filter[tax_query][relation]"]="AND",t["filter[tax_query][0][taxonomy]"]="folder",t["filter[tax_query][0][field]"]="id",t["filter[tax_query][0][terms]"]=e.folderTag,t["filter[tax_query][0][include_children]"]="0"):(e.folderTag!=="all"||typeof e.folderTag=="object"&&e.folderTag===null)&&!e.tags?.length&&e.status&&e.status!=="trash"&&(t["filter[tax_query][0][taxonomy]"]="folder",t["filter[tax_query][0][operator]"]="NOT EXISTS"),e.tags?.length>0&&e.status!=="trash"){t["filter[tax_query][relation]"]="AND";for(let n=0,i=e.tags.length;n<i;n++){const o=e.tags[n];t[`filter[tax_query][${n+1}][taxonomy]`]="emailtags",t[`filter[tax_query][${n+1}][field]`]="id",t[`filter[tax_query][${n+1}][terms]`]=o}}return e.name&&(t.search=e.name),e.pageSize&&(t.per_page=e.pageSize),e.status==="trash"&&(r.status="trash"),{request:t,extraQuery:r}}var xM=O.createIdentifier$1("EmailsList"),qM={};function GM(e,t){return!!e&&JSON.stringify(e)===JSON.stringify(t)}async function HM(e,t){const r=e?.getInstance(xM),n=r?.get(),i=n?.promise;if(!(!r||i===void 0||!GM(n?.args,t)))return r.set(qM),i}function zM(e){return typeof e=="object"&&e!==null?e:void 0}function Bt({id:e,title:t,meta:r,type:n,guid:i,acf:{lock:o,subject:a,description:s,html:l,project:u,tags:c,utm_parameters:d,parent_email:f,common_styles:m,is_template:g},author:h,...b}){const P=zM(r);return{...b,...P!==void 0?{meta:P}:{},id:ue(e),author:ue(h),title:He(t)||"",lock:o,description:s,html:l,project:de(u)?u.ID:u,project_author:de(u)?u.post_author:void 0,project_title:de(u)?u.post_title:void 0,tags:c,utm_parameters:d,parent_email:ue(f instanceof Array&&f[0]?f[0].ID:f),common_styles:m,is_template:g}}function Ts({title:e,lock:t,subject:r,description:n,html:i,project:o,tags:a,renderGuid:s,utm_parameters:l,parent_email:u,common_styles:c,is_template:d,author:f,meta:m,...g}){return{...g,author:ge(f),title:e,acf:{lock:t,description:n,html:i,project:o,tags:a,utm_parameters:l,parent_email:ge(u),common_styles:c,is_template:d}}}function VM(e){return typeof e=="object"&&e!==null?e:void 0}function Sh({id:e,title:t,meta:r,acf:{html:n,common_styles:i},parent:o,excerpt:a,author:s,...l}){const u=VM(r);return{...l,isAutosave:Mc(l.slug),...u!==void 0?{meta:u}:{},author:ue(s),id:ue(e),parent:ue(o),title:He(t)||"",html:n,common_styles:i,excerpt:de(a)?a.rendered:a}}function Ph({parent:e,title:t,html:r,project:n,subject:i,preheader:o,common_styles:a,author:s,parent_email:l,meta:u,...c}){return{...c,author:ge(s),title:t,parent:ge(e),"acf[html]":r,"acf[project]":de(n)?n.id||n.ID:n,"acf[parent_email]":l,"acf[common_styles]":a}}var wh=we({reducerPath:"emailsApi",tagTypes:["Emails","Email"],baseQuery:Re({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({async queryFn(t,r){const n=await HM(fi(r),t);if(n)return n;const i=x(r),{request:o,extraQuery:a}=$M(t);return i.wp.email_list(o,{extraQuery:a}).then(s=>Ne(Bt)(s))},providesTags:(t,r,n)=>{const i={type:"Emails",id:n?.status==="trash"?"TRASH":"LIST"};return t?[...t.map(({id:o})=>({type:"Emails",id:o})),i]:[i]}}),getTemplateEmails:e.query({queryFn(t,r){const n=x(r),i={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"},o={_embed:"author,wp:term",_fields:"_embedded,id,title,meta,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(t.emailId&&(i["filter[meta_query][0][key]"]="parent_email",i["filter[meta_query][0][value]"]=t.emailId),t.fields&&(o._fields=t.fields),t.group?.length>0||t.projectGroup?.length>0){const a=[...t.group||[],...t.projectGroup||[]].reduce((l,{key:u,parentId:c})=>(l[c]||(l[c]=[]),l[c].push(String(u)),l),{}),s=Object.values(a).map(l=>l.sort());i["filter[tax_query][relation]"]="AND",s.forEach((l,u)=>{i[`filter[tax_query][${u}][relation]`]="OR",l.forEach((c,d)=>{i[`filter[tax_query][${u}][${d}][taxonomy]`]="group",i[`filter[tax_query][${u}][${d}][field]`]="id",i[`filter[tax_query][${u}][${d}][terms]`]=c})})}if(t.tags?.length>0){i["filter[tax_query][relation]"]="AND";for(let a=0,s=t.tags.length;a<s;a++){const l=t.tags[a];i[`filter[tax_query][${a}][taxonomy]`]="emailtags",i[`filter[tax_query][${a}][field]`]="id",i[`filter[tax_query][${a}][terms]`]=l}}if(t.type&&(i["filter[meta_query][2][key]"]="type",i["filter[meta_query][2][value]"]=t.type),t.name&&(i.search=t.name),t.pageSize&&(i.per_page=t.pageSize),t.page){i.page=t.page;const{groupsTemplateProjectTotal:a,groupsTemplateProjectTotalPages:s}=r.getState()?.projectSlice;if(!t.projectGroup?.length&&!t.group?.length&&s<t.page&&t.groupType===Xv.ALL&&a&&s&&!t.projectId){const l=24-a%24+(t.page-(s+1))*24;l&&(i.page=1,i.offset=l)}}return t.projectId&&(i["filter[meta_key]"]="project",i["filter[meta_value]"]=t.projectId),n.wp.email_list(i,{extraQuery:o}).then(Ne(Bt))},keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:Ga(t=>({source:r,...n})=>Kr(t).wp.email_create({status:"publish",...Ts(n)},{type:O.ContentType.Json}).then(he(Bt))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:Ga(t=>({emailId:r,source:n,...i})=>{const o=Kr(t),a=ut(Ts(i));return o.wp.email_partial_update({id:r},a,{type:O.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,meta,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then(he(Bt))}),invalidatesTags:(t,r,n)=>[{type:"Emails",id:"LIST"},{type:"Emails",id:n.emailId}]}),deleteEmail:e.mutation({queryFn(t,r){const n=x(r);let i,o;return typeof t=="object"?(i=t.id,o=t.force):(i=t,o=!1),n.wp.email_delete({id:i},{force:o}).then(Gn(Bt))},invalidatesTags:(t,r,n)=>[{type:"Emails",id:"LIST"},{type:"Emails",id:"TRASH"},{type:"Emails",id:typeof n=="object"?n.id:n}]}),addTag:e.mutation({queryFn(t,r){return x(r).wp.emailtags_create({...t},{type:O.ContentType.Json})}}),getDeletableTag:e.query({queryFn([t,r],n){return x(n).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":t,emailtags:[r]},{extraQuery:{"_fields[]":"emailtags"}}).then(Ne(Bt))}}),autoSaveEmail:e.mutation({queryFn({emailId:t,body:r},n){const i=x(n),o=Ph(r);return i.wp.email_autosaves_create({id:t},o,{type:O.ContentType.FormData}).then(he(Sh))},onQueryStarted({emailId:t,body:r},n){Wn(O.getContainer(n))&&la(t,{sentAt:Date.now(),html:r.html??"",common_styles:r.common_styles??"",subject:r.subject,preheader:r.preheader})}})})}),{useGetEmailsQuery:Wj,useGetTemplateEmailsQuery:Qj,useAddEmailMutation:WM,useEditEmailMutation:QM,useDeleteEmailMutation:Kj,useGetDeletableTagQuery:Yj,useAddTagMutation:Xj,useAutoSaveEmailMutation:Jj}=wh;function KM(){const{document:e}=Pt();return(0,R.useCallback)(t=>Rc(e,t),[e])}function YM(e){const{document:t}=Pt(),r=(0,R.useCallback)(i=>t?t.subscribe(i):()=>{},[t]),n=(0,R.useCallback)(()=>t?.get().attributes?.[e],[t,e]);return(0,R.useSyncExternalStore)(r,n)}var Ih=()=>(0,gt.__vitePreload)(()=>Promise.resolve().then(()=>ye("./1922419a.js")),void 0,{}.url),XM=new TextDecoder("utf-8",{fatal:!0}),JM=new TextDecoder;async function Ch(e){return e instanceof Uint8Array?e:typeof e=="string"?new TextEncoder().encode(e):new Uint8Array(await e.arrayBuffer())}function ZM(e){let t=!1;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i>255)return e;i>=128&&(t=!0)}if(!t)return e;const r=Uint8Array.from(e,n=>n.charCodeAt(0));try{return XM.decode(r)}catch{return new TextDecoder("cp866").decode(r)}}function Oh(e){const t={};for(const r of Object.keys(e))r.endsWith("/")||(t[ZM(r)]=e[r]);return t}async function eN(e){const{zip:t,zipSync:r}=await Ih(),n={};for(const i of Object.keys(e))n[i]=await Ch(e[i]);try{const i=await new Promise((o,a)=>{t(n,{level:6},(s,l)=>s?a(s):o(l))});return new Blob([i],{type:"application/zip"})}catch{return new Blob([r(n,{level:6})],{type:"application/zip"})}}async function Th(e){const{unzip:t,unzipSync:r}=await Ih(),n=await Ch(e);try{return Oh(await new Promise((i,o)=>{t(n,(a,s)=>a?o(a):i(s))}))}catch{return Oh(r(n))}}function tN(e){const t=atob(e);return Th(Uint8Array.from(t,r=>r.charCodeAt(0)))}function rN(e){return JM.decode(e)}function nN(e){return new Blob([e])}function Ah(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function qi(e){const t=e.indexOf("(");if(t<0)return!0;let r=0,n="",i=!1;for(let o=t;o<e.length;o++){const a=e[o];if(i){i=!1;continue}if(a==="\\"){i=!0;continue}if(n){a===n&&(n="");continue}if(a==='"'||a==="'"){n=a;continue}if(a==="("){r++;continue}if(a===")"&&(r--,r<0))return!1}return r===0}function iN(e){return(t,r,n)=>qi(t)?e(t,r,n):!1}function oN(e){return t=>qi(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function aN(e){return(t,r,n)=>qi(t)?Ah(t)?e(t,r,n):t:!1}function sN(e){return t=>{const r=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return qi(r)?Ah(r)?e(t):t:!1}}function uN(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function As(e,t){const r=e.length;for(let n=0;n<r;n++){const i=e.charCodeAt(n);if(i===0||t==='"'&&i===34||t==="'"&&i===39||t===""&&(i===32||i===9||i===10||i===13||i===12||i===34||i===39||i===60||i===62||i===61||i===96))return!1}return!0}function lN(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n=new Uint8Array(e);crypto.getRandomValues(n);let i="";for(let o=0;o<e;o++){const a=n[o]%62;i+=t.charAt(a)}return i}var cN=8,dN=class{_byKey=Object.create(null);_byValue=Object.create(null);getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=lN(cN),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},Gi=new dN;function Mh(e,t){return t!==void 0&&!As(e,t)?`%|{${Gi.getOrCreateByKey(e)}}|%`:e}function fN(e){const t=Gi.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function oe(e,t,r){return t!==void 0?As(e,t)?e:`%|{${Gi.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function pN(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function te(e){return e.startsWith("<!--")&&e.endsWith("-->")?pN(e.slice(4,-3)):e}function hN(e){const t=/^(IF|ELSE|ELSIF|ELSEIF|END|FOREACH|WHILE|NEXT|LAST|BREAK|DO|UNLESS|CONTINUE|SET|UNSET|DEFINE|INCLUDE)\b/i,r=/\w+\s*\(/;let n=e;const i=e.match(/\[%\s*([^%]*?)\s*%\]/);i&&(n=i[1]);const o=n.trim();return t.test(o)||r.test(o)}function mN(e,t,r){return t!==void 0?As(e,t)?e:`%|{${Gi.getOrCreateByKey(e)}}|%`:r||uN(e)||hN(e)?`<!--${e}-->`:e}var $t=iN(oe),xt=oN(te),gN=aN(oe),yN=sN(te),Nh=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",fN),e.escape("@{","}",oe,!0).unescape("<!--@{","}-->",te,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",Mh,!0),e.escape("{{","}}",Mh,!0),e.createSyntax("brace-percent").escape("{%","%}",oe).unescape("<!--{%","%}-->",te),e.createSyntax("brace-hash").escape("{#","#}",oe).unescape("<!--{#","#}-->",te),e.createSyntax("proscript").escape("[%","%]",mN,!0).unescape("<!--[%","%]-->",te,!0),e.createSyntax("getresponse").escape("[[IF","]]",oe).escape("[[if","]]",oe).escape("[[ELSE]]","",oe).escape("[[else]]","",oe).escape("[[ENDIF]]","",oe).escape("[[endif]]","",oe).unescape("<!--[[IF","]]-->",te).unescape("<!--[[if","]]-->",te).unescape("<!--[[ELSE]]","-->",te).unescape("<!--[[else]]","-->",te).unescape("<!--[[ENDIF]]","-->",te).unescape("<!--[[endif]]","-->",te),e.createSyntax("expert-sender").escape("<if",">",oe).escape("</if",">",oe).escape("<else",">",oe).escape("</else",">",oe).escape("<var ",">",oe,!0).unescape("<!--<if ",">-->",te).unescape("<!--</if",">-->",te).unescape("<!--<else ",">-->",te).unescape("<!--</else",">-->",te).unescape("<!--<var",">-->",te,!0),e.createSyntax("velocity").escape("#if",")",$t).escape("#elseif",")",$t).escape("#else","",oe).escape("#foreach",")",$t).escape("#macro",")",$t).escape("#set",")",gN,!0).escape("#parse",")",$t).escape("#include",")",$t).escape("#evaluate",")",$t).escape("#end","",oe).escape("#break","",oe).escape("#stop","",oe).unescape("<!--#macro","-->",xt).unescape("<!--#if","-->",xt).unescape("<!--#elseif","-->",xt).unescape("<!--#else","-->",te).unescape("<!--#foreach","-->",xt).unescape("<!--#parse","-->",xt).unescape("<!--#include","-->",xt).unescape("<!--#evaluate","-->",xt).unescape("<!--#end","-->",te).unescape("<!--#break","-->",te).unescape("<!--#stop","-->",te).unescape("<!--#set","-->",yN,!0),e.createSyntax("mailchimp").escape("*|","|*",oe).unescape("<!--*|","|*-->",te)},Ms="bare",vN=new Map;function _N(e){return e?vN.get(e)??Ms:Ms}var Rh=["brace-percent","brace-hash","proscript","getresponse","expert-sender","mailchimp","velocity"];function Dh(e){return Rh.includes(e)}function pn(e){return e==="bare"||e==="html-comment"}function Ns(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function bN(e,t=r=>{}){const r={output:{},editor:{}};if(e==null)return r;let n;if(typeof e=="string"){if(!pn(e))return t(`templateDirectives: unknown form "${String(e)}", falling back to the default ("bare").`),r;n={output:e}}else if(typeof e=="object"&&!Array.isArray(e))n=e;else return t(`templateDirectives: expected a string or an object, got ${typeof e}. Ignored.`),r;for(const[u,c]of[["output",n.output],["editor",n.editor]])if(c!==void 0&&!pn(c))return t(`templateDirectives.${u}: unknown form "${String(c)}", configuration ignored.`),r;if(n.syntaxes!==void 0&&!Ns(n.syntaxes))return t("templateDirectives.syntaxes: expected an object, configuration ignored."),r;if(n.syntaxes){for(const[u,c]of Object.entries(n.syntaxes))if(!(!Dh(u)||c===void 0||pn(c))){if(!Ns(c))return t(`templateDirectives.syntaxes.${u}: expected a form or an object, configuration ignored.`),r;for(const d of["output","editor"]){const f=c[d];if(f!==void 0&&!pn(f))return t(`templateDirectives.syntaxes.${u}.${d}: unknown form "${String(f)}", configuration ignored.`),r}}}if(n.output===void 0&&n.editor===void 0&&n.syntaxes===void 0)return r;const i=n.output??Ms;let o=n.editor;i==="bare"&&n.editor==="html-comment"&&(t('templateDirectives: editor="html-comment" requires output="html-comment"; editor was reset to match output.'),o=void 0);const a=[];if(n.syntaxes)for(const u of Object.keys(n.syntaxes)){if(!Dh(u)){t(`templateDirectives.syntaxes: unknown syntax id "${u}", entry ignored.`);continue}a.push(u)}else a.push(...Rh);const s={},l={};for(const u of a){const c=n.syntaxes?.[u],d=Ns(c)?c:void 0,f=(pn(c)?c:d?.output)??i;let m=d?.editor??o??f;f==="bare"&&m==="html-comment"&&(t(`templateDirectives.syntaxes.${u}: editor="html-comment" requires output="html-comment" for this id; editor was reset to "bare" for it.`),m="bare"),s[u]=f,l[u]=m}return{output:s,editor:l}}function jh(e,t,r,n){for(let i=t;i<r;i++){const o=e[i];n.insideAttributeValue?n.attributeQuoteChar==='"'||n.attributeQuoteChar==="'"?o===n.attributeQuoteChar&&(n.insideAttributeValue=!1,n.attributeQuoteChar=void 0):n.unquotedAttr&&/[\s>]/.test(o)&&(n.insideAttributeValue=!1,n.attributeQuoteChar=void 0,n.unquotedAttr=!1):o==="<"?n.insideTag=!0:o===">"?n.insideTag=!1:n.insideTag&&(o==='"'||o==="'")?(n.insideAttributeValue=!0,n.attributeQuoteChar=o,n.unquotedAttr=!1):n.insideTag&&/\S/.test(o)&&n.attributeQuoteChar===void 0&&e[i-1]==="="&&!['"',"'","`"].includes(o)&&(n.insideAttributeValue=!0,n.attributeQuoteChar="",n.unquotedAttr=!0)}}function hn(e,t){return e.start<t.end&&t.start<e.end}function Fh(e,t,r,n,i=[]){if(r&&(t=t.filter(c=>c.isVariable)),!t.length)return[];const o=t.flatMap(c=>c.match(e).flatMap(d=>!Number.isInteger(d.start)||!Number.isInteger(d.end)||d.start<0||d.end>e.length||d.start>=d.end?[]:[{range:d,mapFn:c.mapFn,overrideBuiltins:c.overrideBuiltins,syntax:c.syntax,isVariable:c.isVariable}])).sort((c,d)=>c.range.start-d.range.start||c.range.end-d.range.end),a=[],s=i.slice().sort((c,d)=>c.start-d.start),l={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let u=0;for(const{range:c,mapFn:d,overrideBuiltins:f,syntax:m,isVariable:g}of o){if(n?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):jh(e,u,c.start,l),u=c.end,s.some(E=>hn(E,c)))continue;const h=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,b=e.substring(c.start,c.end),P=d(b,h,l.insideTag);P!==!1&&P!==b&&(a.push({range:c,text:P,overrideBuiltins:f,syntax:m,isVariable:g}),s.push(c))}return a.sort((c,d)=>c.range.start-d.range.start||c.range.end-d.range.end)}function EN(e,t){const r=t.reduce((s,{mapFn:l,start:u,end:c,syntax:d,isVariable:f})=>(s[u]||(s[u]=[]),s[u].push({value:c,mapFn:l,syntax:d,isVariable:f}),s),Object.create(null)),n=Object.keys(r).map(s=>s.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&")).join("|"),i=new RegExp(n,"g"),o=[];let a;for(;(a=i.exec(e))!==null;){const s=a[0];o.push({start:a.index,startToken:s,endTokens:r[s]})}return o}function Rs(e,t,r,n,i=!1){const o=[];if(r&&(t=t.filter(u=>u.isVariable)),!t.length)return o;const a=EN(e,t),s={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let l=0;for(let u=0;u<a.length;u++){const{start:c,startToken:d,endTokens:f}=a[u];n?(s.insideAttributeValue=!0,s.attributeQuoteChar='"'):jh(e,l,c,s),l=c;const m=s.insideAttributeValue?s.attributeQuoteChar??"":void 0;let g=!1;for(const{mapFn:h,value:b,syntax:P,isVariable:E}of f){let S=c+d.length,_=e.indexOf(b,S);for(;_!==-1;){let w=_,v=c+d.length,I=0;for(;w!==-1;){const N=e.indexOf(d,v);if(N!==-1&&N<w)I++,v=N+d.length,w=e.indexOf(b,v);else if(I>0)I--,v=w+b.length,w=e.indexOf(b,v);else break}if(w<0)break;const y=w+b.length,T=e.substring(c,y),A=h(T,m,s.insideTag);if(A===!1){S=_+Math.max(b.length,1),_=e.indexOf(b,S);continue}(i||A!==T)&&o.push({range:{start:c,end:y},text:i?T:A,syntax:P,isVariable:E});const C=a.findIndex(({start:N})=>N>=y);C>u?u=C-1:u=a.length,g=!0;break}if(g)break}}return o}function Hi(e,t){if(!t.length)return e;const r=t.slice().sort((i,o)=>o.range.start-i.range.start);let n=e;for(const{text:i,range:o}of r)n=n.slice(0,o.start)+i+n.slice(o.end);return n}var SN=class{_disposables=[];_escapes=[];_unescapes=[];_escapeMatchers=[];_unescapeMatchers=[];constructor(e=Nh){const{_escapes:t,_unescapes:r}=this;e({createSyntax(n){return{...this,syntax:n}},escape(n,i,o,a){return t.push({start:n,end:i,mapFn:o,isVariable:a,syntax:this.syntax||n}),this},unescape(n,i,o,a){return r.push({start:n,end:i,mapFn:o,isVariable:a,syntax:this.syntax||n}),this}})}registerMatcherPair(e){const t=e.syntax||"matcher",r={syntax:t,match:e.escape.match,mapFn:e.escape.mapFn,isVariable:e.escape.isVariable,overrideBuiltins:e.escape.overrideBuiltins},n={syntax:t,match:e.unescape.match,mapFn:e.unescape.mapFn,isVariable:e.unescape.isVariable,overrideBuiltins:e.unescape.overrideBuiltins};this._escapeMatchers.push(r),this._unescapeMatchers.push(n);let i=!1;const o={dispose:()=>{i||(i=!0,this._escapeMatchers=this._escapeMatchers.filter(a=>a!==r),this._unescapeMatchers=this._unescapeMatchers.filter(a=>a!==n))}};return this.addDisposable(o),o}_collectMappings(e,t,r){const n=Rs(e,this._escapes,t,r),i=Fh(e,this._escapeMatchers,t,r),o=i.filter(l=>l.overrideBuiltins).map(l=>l.range),a=n.filter(l=>!o.some(u=>hn(u,l.range))),s=i.filter(l=>l.overrideBuiltins||!a.some(u=>hn(l.range,u.range)));return[...a,...s].sort((l,u)=>l.range.start-u.range.start||l.range.end-u.range.end)}getMappings(e,t,r){return this._collectMappings(e,t,r)}_collectRevertMappings(e,t){const r=Rs(e,this._unescapes,t),n=Fh(e,this._unescapeMatchers,t,!1),i=n.filter(s=>s.overrideBuiltins).map(s=>s.range),o=r.filter(s=>!i.some(l=>hn(l,s.range))),a=n.filter(s=>s.overrideBuiltins||!o.some(l=>hn(s.range,l.range)));return[...o,...a].sort((s,l)=>s.range.start-l.range.start||s.range.end-l.range.end)}getRevertMappings(e,t,r){const n=r?i=>i!==void 0&&r.has(i):i=>_N(i)==="html-comment";return this._collectRevertMappings(e,t).filter(i=>i.isVariable||!n(i.syntax))}getDetectedMappings(e,t,r){return Rs(e,this._escapes,t,r,!0)}getEscapedText(e,t){return Hi(e,this.getMappings(e,t))}getUnescapedText(e,t,r){return Hi(e,this.getRevertMappings(e,t,r))}normalizeToPolicy(e,t){const r=o=>o===void 0?void 0:t[o],n=Object.values(t);let i=e;return n.includes("bare")&&(i=Hi(i,this._collectRevertMappings(i).filter(o=>r(o.syntax)==="bare"))),n.includes("html-comment")&&(i=Hi(i,this._collectMappings(i).filter(o=>!o.isVariable&&r(o.syntax)==="html-comment"&&o.text.startsWith("<!--")&&o.text.endsWith("-->")))),i}hasDetectedMappings(e,t,r){return this.getDetectedMappings(e,t,r).length>0}addDisposable(e){this._disposables.push(e)}dispose(){for(const e of this._disposables)e.dispose()}};function Lh(e){return e.replace("<script","<___script").replace("<\/script>","</___script>")}var PN=new SN(e=>{e.escape("<script","<\/script>",t=>Lh(t)).unescape("<___script","</___script>",t=>t.replace("<___script","<script").replace("</___script>","<\/script>")),e.escape("<script","/>",t=>Lh(t)).unescape("<___script","/>",t=>t.replace("<___script","<script")),Nh(e)}),kh=class{_voidElements;constructor(e){this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},Te=(function(e){return e[e.StartCommentTag=0]="StartCommentTag",e[e.Comment=1]="Comment",e[e.EndCommentTag=2]="EndCommentTag",e[e.StartTagOpen=3]="StartTagOpen",e[e.StartTagClose=4]="StartTagClose",e[e.StartTagSelfClose=5]="StartTagSelfClose",e[e.StartTag=6]="StartTag",e[e.EndTagOpen=7]="EndTagOpen",e[e.EndTagClose=8]="EndTagClose",e[e.EndTag=9]="EndTag",e[e.DelimiterAssign=10]="DelimiterAssign",e[e.AttributeName=11]="AttributeName",e[e.AttributeValue=12]="AttributeValue",e[e.StartDoctypeTag=13]="StartDoctypeTag",e[e.Doctype=14]="Doctype",e[e.EndDoctypeTag=15]="EndDoctypeTag",e[e.Content=16]="Content",e[e.Whitespace=17]="Whitespace",e[e.Unknown=18]="Unknown",e[e.Script=19]="Script",e[e.Styles=20]="Styles",e[e.EOS=21]="EOS",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),wN=class{source;len;position;constructor(e,t){this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===NN||e===RN||e===TN||e===MN||e===AN)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},Uh=33,ar=45,zi=60,Ze=62,Ds=47,IN=61,CN=34,ON=39,TN=10,AN=13,MN=12,NN=32,RN=9,DN={"text/x-handlebars-template":!0,"text/html":!0};function jN(e,t=0,r=0,n=!1){const i=new wN(e,t);let o=r,a=0,s=18,l,u,c,d,f;function m(){return i.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function g(){return i.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function h(E,S,_){return s=S,a=E,l=_,S}function b(){const E=i.pos(),S=o,_=P();return _!==21&&E===i.pos()&&!(n&&(_===4||_===8))?(i.advance(1),h(E,18)):_}function P(){const E=i.pos();if(i.eos())return h(E,21);let S;switch(o){case 6:return i.advanceIfChars([ar,ar,Ze])?(o=0,h(E,2)):(i.advanceUntilChars([ar,ar,Ze]),h(E,1));case 3:return i.advanceIfChar(Ze)?(o=0,h(E,15)):(i.advanceUntilChar(Ze),h(E,14));case 0:if(i.advanceIfChar(zi)){if(!i.eos()&&i.peekChar()===Uh){if(i.advanceIfChars([Uh,ar,ar]))return o=6,h(E,0);if(i.advanceIfRegExp(/^!doctype/i))return o=3,h(E,13)}return i.advanceIfChar(Ds)?(o=2,h(E,7)):(o=1,h(E,3))}return i.advanceUntilChar(zi),h(E,16);case 2:return m().length>0?(o=5,h(E,9)):i.skipWhitespace()?h(E,17,"Tag name must directly follow the open bracket."):(o=5,i.advanceUntilChar(Ze),E<i.pos()?h(E,18,"End tag name expected."):P());case 5:if(i.skipWhitespace())return h(E,17);if(i.advanceIfChar(Ze))return o=0,h(E,8);if(n&&i.peekChar()===zi)return o=0,h(E,8,"Closing bracket missing.");S="Closing bracket expected.";break;case 1:return c=m(),f=void 0,d=void 0,c.length>0?(u=!1,o=4,h(E,6)):i.skipWhitespace()?h(E,17,"Tag name must directly follow the open bracket."):(o=4,i.advanceUntilChar(Ze),E<i.pos()?h(E,18,"Start tag name expected."):P());case 4:return i.skipWhitespace()?(u=!0,h(E,17)):u&&(d=g(),d.length>0)?(o=9,u=!1,h(E,11)):i.advanceIfChars([Ds,Ze])?(o=0,h(E,5)):i.advanceIfChar(Ze)?(c==="script"?f&&DN[f]?o=0:o=7:c==="style"?o=8:o=0,h(E,4)):n&&i.peekChar()===zi?(o=0,h(E,4,"Closing bracket missing.")):(i.advance(1),h(E,18,"Unexpected character in tag."));case 9:return i.skipWhitespace()?(u=!0,h(E,17)):i.advanceIfChar(IN)?(o=10,h(E,10)):(o=4,P());case 10:if(i.skipWhitespace())return h(E,17);let _=i.advanceIfRegExp(/^[^\s"'`=<>]+/);if(_.length>0)return i.peekChar()===Ze&&i.peekChar(-1)===Ds&&(i.goBack(1),_=_.substr(0,_.length-1)),d==="type"&&(f=_),o=4,u=!1,h(E,12);const w=i.peekChar();return w===ON||w===CN?(i.advance(1),i.advanceUntilChar(w)&&i.advance(1),d==="type"&&(f=i.getSource().substring(E+1,i.pos()-1)),o=4,u=!1,h(E,12)):(o=4,u=!1,P());case 7:let v=1;for(;!i.eos();){const I=i.advanceIfRegExp(/<!--|-->|<\/?script\s*\/?>?/i);if(I.length===0)return i.goToEnd(),h(E,19);if(I==="<!--")v===1&&(v=2);else if(I==="-->")v=1;else if(I[1]!=="/")v===2&&(v=3);else if(v===3)v=2;else{i.goBack(I.length);break}}return o=0,E<i.pos()?h(E,19):P();case 8:return i.advanceUntilRegExp(/<\/style/i),o=0,E<i.pos()?h(E,20):P()}return i.advance(1),o=0,h(E,18,S)}return{scan:b,getTokenType:()=>s,getTokenOffset:()=>a,getTokenLength:()=>i.pos()-a,getTokenEnd:()=>i.pos(),getTokenText:()=>i.getSource().substring(a,i.pos()),getScannerState:()=>o,getTokenError:()=>l}}function FN(e){if(typeof e=="string"){const t=e.startsWith("'")||e.startsWith('"')?1:0,r=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,r)}return e}var Bh=class{text;type;node=void 0;replaces=void 0;constructor(e,t){this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,r){if(!this.node){const n=this.node=new yt(e,this.text.length,[],r);n.type=this.type,n.startTagEnd=t,this.replaces=[]}}finish(e,t){const r=this.replaces,n=this.node,i=e+(t||0);if(r){for(const o of r){const a=o.parent;if(!a)throw new Error("parent not defined");const s=a.children.indexOf(o);a.children.splice(s,1)}this.replaces=void 0}if(n){const o=n.parent;if(!o)throw new Error("parent not defined");o.children.push(n),n.closed=t!==void 0,n.endTagStart=e,n.end=i,n.content=this.text.substring(n.startTagEnd,e),this.node=void 0}}},$h=class{dataManager;constructor(e){this.dataManager=e}parse(e,t=[]){const r=jN(e,void 0,void 0,!0),n=new yt(0,e.length,[],void 0);n.type=pe.ROOT;let i=n,o=-1,a,s=null,l=r.scan();const u=()=>{if(!i.tag){const g=i.parent.children,h=g[g.length-2],b=e.substring(i.start,i.end);h?.type===pe.HTML?(h.content=(h.content||"")+b,h.end=i.end,g.splice(g.length-1,1)):(i.type=pe.HTML,i.content=b,i.children=[]),i.type=pe.HTML}i=i.parent},c=new Bh(e,pe.COMMENT),d=new Bh(e,pe.DOCTYPE),f=g=>{i.children.push(g)};for(;l!==Te.EOS;){switch(l){case Te.StartDoctypeTag:d.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case Te.EndDoctypeTag:{const E=i.lastChild,S=d.node;if(!S)throw new Error("");const _=E?E.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(_!==S.start){const w=e.substring(_,S.start);if(w){const v=new yt(_,S.start,[],i);v.type=pe.HTML,v.content=w,f(v)}}d.finish(r.getTokenOffset(),r.getTokenLength());break}case Te.StartCommentTag:c.start(r.getTokenOffset(),r.getTokenEnd(),i);break;case Te.EndCommentTag:{const E=i.lastChild,S=c.node;if(!S)throw new Error("");const _=E?E.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(_!==S.start){const w=e.substring(_,S.start);if(w){const v=new yt(_,S.start,[],i);v.type=pe.HTML,v.content=w,f(v)}}c.finish(r.getTokenOffset(),r.getTokenLength());break}case Te.StartTagOpen:const g=i.lastChild,h=new yt(r.getTokenOffset(),e.length,[],i),b=g?g.end:i.startTagEnd!==void 0?i.startTagEnd:i.start;if(b!==h.start){const E=e.substring(b,h.start);if(E){const S=new yt(b,h.start,[],i);S.type=pe.HTML,S.content=E,f(S)}}f(h),i=h;break;case Te.StartTag:i.tag=r.getTokenText();break;case Te.StartTagClose:i.parent&&(i.end=r.getTokenEnd(),r.getTokenLength()?(i.startTagEnd=r.getTokenEnd(),i.tag&&this.dataManager.isVoidElement(i.tag)&&(i.closed=!0,u())):u());break;case Te.StartTagSelfClose:i.parent&&(i.closed=!0,i.end=r.getTokenEnd(),i.startTagEnd=r.getTokenEnd(),u());break;case Te.EndTagOpen:o=r.getTokenOffset(),a=void 0;break;case Te.EndTag:a=r.getTokenText().toLowerCase();break;case Te.EndTagClose:let P=i;for(;!P.isSameTag(a)&&P.parent;)P=P.parent;if(P.parent){const E=i.lastChild,S=E?E.end:i.startTagEnd===void 0?i.start:i.startTagEnd;if(S!==o){const _=e.substring(S,o);if(_){const w=new yt(S,o,[],i);w.type=pe.HTML,w.content=_,f(w)}}for(;i!==P;)i.end=o,i.closed=!1,u();i.closed=!0,i.endTagStart=o,i.end=r.getTokenEnd(),u()}break;case Te.AttributeName:{s=r.getTokenText();let E=i.attributes;E||(i.attributes=E={}),E[s]=null;break}case Te.AttributeValue:{const E=r.getTokenText(),S=i.attributes;S&&s&&(S[s]=FN(E),s=null);break}}l=r.scan()}for(;i.parent;)i.end=e.length,i.closed=!1,u();c.hasNode,c.finish(e.length);const m=n.lastChild?.end||0;if(m<e.length){const g=e.substring(m);if(g){const h=new yt(m,e.length,[],n);h.type=pe.HTML,h.content=g,f(h)}}return{roots:n.children,findNodeBefore:n.findNodeBefore.bind(n),findNodeAt:n.findNodeAt.bind(n)}}},Zj=new $h(new kh(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),LN=new kh(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),kN=new $h(LN);function UN(e){return kN.parse(e)}function BN(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var xh;function $N(e,t,r){return xh?xh(e,t,r):r}var js;function xN(){return js||(js=document.implementation.createHTMLDocument("")),js}function qN(e,t){let r;switch(t?.toLowerCase()){case"tr":r=e.createElement("table");break;case"td":r=e.createElement("tr");break;case"head":case"body":r=e.createElement("html");break;case"documenttype":case"html":{const n=e.implementation.createHTMLDocument();for(const i of[...n.childNodes])i.remove();return n}default:r=e.createElement("div")}return r}var GN=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),HN=new Set(["script","style","xmp"]);function zN(e,t){return!(t&&HN.has(t.toLowerCase())||GN.has(e.toLowerCase()))}var VN=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1};function qh(e,t,r){let n=e.tagName.toLowerCase();n==="html"&&(n="div");const i=`<${n} ${t}="${r}"/>`,o=qN(xN(),n);if(o instanceof Document)return;o.innerHTML=i;const a=o.querySelector(n);if(!a)throw new Error("targetElement is not defined");const s=a.getAttributeNode(t);s&&e.setAttributeNode(s.cloneNode())}function Gh(e,t,r){try{zN(t,e.tagName)&&!VN(r)?e.setAttribute(t,r):qh(e,t,r)}catch{qh(e,t,r)}}function Fs(e,t=!0){const r=e.content;switch(e.type){case pe.ROOT:{const n=document.implementation.createHTMLDocument();for(const i of[...n.childNodes])n.removeChild(i);if(t)for(const i of e.children)n.appendChild(Fs(i));return n}case pe.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case pe.COMMENT:return document.createComment(r||"");case pe.ELEMENT:if(e.tag){const n=document.createElement(e.tag);if(Object.defineProperty(n,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const i of e.attributeNames){const o=e.attributes[i];try{const a=$N(n,i,typeof o=="string"?o:"");a!==null&&Gh(n,i,a)}catch{}}if(t)for(const i of e.children)n.appendChild(Fs(i));return n}return document.createTextNode("<");case pe.HTML:return BN(r||"");default:throw new Error("unsupported node")}}function Hh(e){return UN(e).roots.map(t=>Fs(t))}var zh=Symbol("Error");function WN(e){return Promise.all(e.map(t=>t instanceof Promise?t.catch(r=>zh):t)).then(t=>t.filter(r=>r!==zh))}var sr=/<script\b(?=[^>]*(?:\bbis_use(?:=|\s)|\bdata-bis-config(?:=|\s)|\bdata-dynamic-id(?:=|\s)|local\.adguard\.org|(?:chrome-extension|moz-extension|safari-extension):\/\/))[^>]*>[\s\S]*?<\/script>/gi,QN=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,ur=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Vh=/display:\s*none\s*!important/gi,KN=/((?:html\s*,\s*body|body\s*,\s*html)\s*\{)([^}]*)(\})/gi,YN=/\s*height\s*:\s*100%\s*!important\s*;?/gi,XN=/height\s*:\s*100%\s*!important/i,JN=[".socialshare,",".advertisment,",".adHolder,",".adsbygoogle-noablate","#ab_adblock","#popmechanic-snippet","filter_ads_by_classname","clever-core-ads","--gn-ov-ad-height","pub_728x90.text-ad.textAd","html-load.com/player","content-loader.com/player",".adblock","#advblock","body { overflow: visible!important; }"];function ZN(e){return Vh.lastIndex=0,(e.match(Vh)||[]).length}function Wh(e){const t=e.trim(),r=ZN(t);if(r===0)return!1;if(t.includes(".advertisment,")&&t.includes(".adHolder,")&&(t.includes(".socialshare,")||r>=3||t.length>2e3))return!0;const n=JN.filter(i=>t.includes(i)).length;return n>=1&&(r>=3||t.length>2e3)||r>=5&&n>=1?!0:r>=20&&/\b(?:\.ad(?:s|vert|vertisment|Holder|banner|box|Container|Wrapper)?[,{]|#ad[-_]|ins\.adsbygoogle)/i.test(t)}function eR(e){ur.lastIndex=0;for(const t of e.matchAll(ur))if(Wh(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function tR(e){let t=!1;return ur.lastIndex=0,{html:e.replace(ur,r=>Wh(r.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):r),found:t}}function rR(e){return sr.lastIndex=0,sr.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||eR(e)}function Qh(e){if(!rR(e))return{html:e,found:!1};let t=!1,r=e;sr.lastIndex=0,sr.test(r)&&(sr.lastIndex=0,r=r.replace(sr,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(r)||/\sdata-bis-config\s*=/.test(r))&&(r=r.replace(QN,""),t=!0);const n=tR(r);return r=n.html,t=t||n.found,{html:r,found:t}}function nR(e){return!e||!XN.test(e)?e:(ur.lastIndex=0,e.replace(ur,t=>t.replace(KN,(r,n,i,o)=>`${n}${i.replace(YN,"")}${o}`)))}function iR(e){const t=Qh(e.replaceAll(`\r
|
|
59
|
-
`,`
|
|
60
|
-
`));return{html:nR(t.html),hasBrowserExtensionArtifacts:t.found}}var mn=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeMap=void 0;var t=(function(){function r(){this._nodes=[],this._values=[]}return r._isIndex=function(n){return+n===n>>>0},r._nodeId=function(n){var i=n[r._ID_PROP];return i||(i=n[r._ID_PROP]=r._NEXT_ID++),i},r.prototype.set=function(n,i){var o=r._nodeId(n);this._nodes[o]=n,this._values[o]=i},r.prototype.get=function(n){var i=r._nodeId(n);return i!==void 0?this._values[i]:void 0},r.prototype.has=function(n){return r._nodeId(n)in this._nodes},r.prototype.delete=function(n){var i=r._nodeId(n);delete this._nodes[i],this._values[i]=void 0},r.prototype.keys=function(){var n=[];for(var i in this._nodes)r._isIndex(i)&&n.push(this._nodes[i]);return n},r._ID_PROP="__mutation_summary_node_map_id__",r._NEXT_ID=1,r})();e.NodeMap=t})),Kh=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChildListChange=void 0;var t=mn(),r=(function(){function n(){this.added=new t.NodeMap,this.removed=new t.NodeMap,this.maybeMoved=new t.NodeMap,this.oldPrevious=new t.NodeMap,this.moved=void 0}return n})();e.ChildListChange=r})),oR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),aR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),sR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),uR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),lR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Vi=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Movement=void 0,(function(t){t[t.STAYED_OUT=0]="STAYED_OUT",t[t.ENTERED=1]="ENTERED",t[t.STAYED_IN=2]="STAYED_IN",t[t.REPARENTED=3]="REPARENTED",t[t.REORDERED=4]="REORDERED",t[t.EXITED=5]="EXITED"})(e.Movement||(e.Movement={}))})),Yh=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeChange=void 0;var t=(function(){function r(n,i,o,a,s,l,u,c){i===void 0&&(i=!1),o===void 0&&(o=!1),a===void 0&&(a=!1),s===void 0&&(s=null),l===void 0&&(l=!1),u===void 0&&(u=null),c===void 0&&(c=null),this.node=n,this.childList=i,this.attributes=o,this.characterData=a,this.oldParentNode=s,this.added=l,this.attributeOldValues=u,this.characterDataOldValue=c,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return r.prototype.getAttributeOldValue=function(n){if(this.attributeOldValues)return this.isCaseInsensitive&&(n=n.toLowerCase()),this.attributeOldValues[n]},r.prototype.getAttributeNamesMutated=function(){var n=[];if(!this.attributeOldValues)return n;for(var i in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(i)&&n.push(i);return n},r.prototype.attributeMutated=function(n,i){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(n in this.attributeOldValues)&&(this.attributeOldValues[n]=i)},r.prototype.characterDataMutated=function(n){this.characterData||(this.characterData=!0,this.characterDataOldValue=n)},r.prototype.removedFromParent=function(n){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=n},r.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},r.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},r})();e.NodeChange=t})),Xh=q.__commonJSMin((e=>{var t=e&&e.__extends||(function(){var a=function(s,l){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(u[d]=c[d])},a(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");a(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.TreeChanges=void 0;var r=mn(),n=Yh(),i=Vi(),o=(function(a){t(s,a);function s(l,u){var c=a.call(this)||this;c.rootNode=l,c.reachableCache=void 0,c.wasReachableCache=void 0,c.anyParentsChanged=!1,c.anyAttributesChanged=!1,c.anyCharacterDataChanged=!1;for(var d=0;d<u.length;d++){var f=u[d];switch(f.type){case"childList":c.anyParentsChanged=!0;for(var m=0;m<f.removedNodes.length;m++){var g=f.removedNodes[m];c.getChange(g).removedFromParent(f.target)}for(var m=0;m<f.addedNodes.length;m++){var g=f.addedNodes[m];c.getChange(g).insertedIntoParent()}break;case"attributes":c.anyAttributesChanged=!0;var h=c.getChange(f.target);h.attributeMutated(f.attributeName,f.oldValue);break;case"characterData":c.anyCharacterDataChanged=!0;var h=c.getChange(f.target);h.characterDataMutated(f.oldValue)}}return c}return s.prototype.getChange=function(l){var u=this.get(l);return u||(u=new n.NodeChange(l),this.set(l,u)),u},s.prototype.getOldParent=function(l){var u=this.get(l);return u?u.getOldParent():l.parentNode},s.prototype.getIsReachable=function(l){if(l===this.rootNode)return!0;if(!l)return!1;this.reachableCache=this.reachableCache||new r.NodeMap;var u=this.reachableCache.get(l);return u===void 0&&(u=this.getIsReachable(l.parentNode),this.reachableCache.set(l,u)),u},s.prototype.getWasReachable=function(l){if(l===this.rootNode)return!0;if(!l)return!1;this.wasReachableCache=this.wasReachableCache||new r.NodeMap;var u=this.wasReachableCache.get(l);return u===void 0&&(u=this.getWasReachable(this.getOldParent(l)),this.wasReachableCache.set(l,u)),u},s.prototype.reachabilityChange=function(l){return this.getIsReachable(l)?this.getWasReachable(l)?i.Movement.STAYED_IN:i.Movement.ENTERED:this.getWasReachable(l)?i.Movement.EXITED:i.Movement.STAYED_OUT},s})(r.NodeMap);e.TreeChanges=o})),Jh=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutationProjection=void 0;var t=Xh(),r=mn(),n=Vi(),i=Kh(),o=(function(){function a(s,l,u,c,d){this.rootNode=s,this.mutations=l,this.selectors=u,this.calcReordered=c,this.calcOldPreviousSibling=d,this.treeChanges=new t.TreeChanges(s,l),this.entered=[],this.exited=[],this.stayedIn=new r.NodeMap,this.visited=new r.NodeMap,this.childListChangeMap=void 0,this.characterDataOnly=void 0,this.matchCache=void 0,this.processMutations()}return a.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var s=this.treeChanges.keys(),l=0;l<s.length;l++)this.visitNode(s[l],void 0)},a.prototype.visitNode=function(s,l){if(!this.visited.has(s)){this.visited.set(s,!0);var u=this.treeChanges.get(s),c=l;if((u&&u.childList||c==null)&&(c=this.treeChanges.reachabilityChange(s)),c!==n.Movement.STAYED_OUT){if(this.matchabilityChange(s),c===n.Movement.ENTERED)this.entered.push(s);else if(c===n.Movement.EXITED)this.exited.push(s),this.ensureHasOldPreviousSiblingIfNeeded(s);else if(c===n.Movement.STAYED_IN){var d=n.Movement.STAYED_IN;u&&u.childList&&(u.oldParentNode!==s.parentNode?(d=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(s)):this.calcReordered&&this.wasReordered(s)&&(d=n.Movement.REORDERED)),this.stayedIn.set(s,d)}if(c!==n.Movement.STAYED_IN)for(var f=s.firstChild;f;f=f.nextSibling)this.visitNode(f,c)}}},a.prototype.ensureHasOldPreviousSiblingIfNeeded=function(s){if(this.calcOldPreviousSibling){this.processChildlistChanges();var l=s.parentNode,u=this.treeChanges.get(s);u&&u.oldParentNode&&(l=u.oldParentNode);var c=this.childListChangeMap.get(l);c||(c=new i.ChildListChange,this.childListChangeMap.set(l,c)),c.oldPrevious.has(s)||c.oldPrevious.set(s,s.previousSibling)}},a.prototype.getChanged=function(s,l,u){this.selectors=l,this.characterDataOnly=u;for(var c=0;c<this.entered.length;c++){var d=this.entered[c],f=this.matchabilityChange(d);(f===n.Movement.ENTERED||f===n.Movement.STAYED_IN)&&s.added.push(d)}for(var m=this.stayedIn.keys(),c=0;c<m.length;c++){var d=m[c],f=this.matchabilityChange(d);if(f===n.Movement.ENTERED)s.added.push(d);else if(f===n.Movement.EXITED)s.removed.push(d);else if(f===n.Movement.STAYED_IN&&(s.reparented||s.reordered)){var g=this.stayedIn.get(d);s.reparented&&g===n.Movement.REPARENTED?s.reparented.push(d):s.reordered&&g===n.Movement.REORDERED&&s.reordered.push(d)}}for(var c=0;c<this.exited.length;c++){var d=this.exited[c],f=this.matchabilityChange(d);(f===n.Movement.EXITED||f===n.Movement.STAYED_IN)&&s.removed.push(d)}},a.prototype.getOldParentNode=function(s){var l=this.treeChanges.get(s);if(l&&l.childList)return l.oldParentNode?l.oldParentNode:null;var u=this.treeChanges.reachabilityChange(s);if(u===n.Movement.STAYED_OUT||u===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return s.parentNode},a.prototype.getOldPreviousSibling=function(s){var l=s.parentNode,u=this.treeChanges.get(s);u&&u.oldParentNode&&(l=u.oldParentNode);var c=this.childListChangeMap.get(l);if(!c)throw Error("getOldPreviousSibling requested on invalid node.");return c.oldPrevious.get(s)},a.prototype.getOldAttribute=function(s,l){var u=this.treeChanges.get(s);if(!u||!u.attributes)throw Error("getOldAttribute requested on invalid node.");var c=u.getAttributeOldValue(l);if(c===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return c},a.prototype.attributeChangedNodes=function(s){if(!this.treeChanges.anyAttributesChanged)return{};var l,u;if(s){l={},u={};for(var c=0;c<s.length;c++){var d=s[c];l[d]=!0,u[d.toLowerCase()]=d}}for(var f={},m=this.treeChanges.keys(),c=0;c<m.length;c++){var g=m[c],h=this.treeChanges.get(g);if(h.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(g)||n.Movement.STAYED_IN!==this.matchabilityChange(g)))for(var b=g,P=h.getAttributeNamesMutated(),E=0;E<P.length;E++){var d=P[E];l&&!l[d]&&!(h.isCaseInsensitive&&u[d])||h.getAttributeOldValue(d)!==b.getAttribute(d)&&(u&&h.isCaseInsensitive&&(d=u[d]),f[d]=f[d]||[],f[d].push(b))}}return f},a.prototype.getOldCharacterData=function(s){var l=this.treeChanges.get(s);if(!l||!l.characterData)throw Error("getOldCharacterData requested on invalid node.");return l.characterDataOldValue},a.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var s=this.treeChanges.keys(),l=[],u=0;u<s.length;u++){var c=s[u];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(c)){var d=this.treeChanges.get(c);!d.characterData||c.textContent==d.characterDataOldValue||l.push(c)}}return l},a.prototype.computeMatchabilityChange=function(s,l){this.matchCache||(this.matchCache=[]),this.matchCache[s.uid]||(this.matchCache[s.uid]=new r.NodeMap);var u=this.matchCache[s.uid],c=u.get(l);return c===void 0&&(c=s.matchabilityChange(l,this.treeChanges.get(l)),u.set(l,c)),c},a.prototype.matchabilityChange=function(s){var l=this;if(this.characterDataOnly)switch(s.nodeType){case Node.COMMENT_NODE:case Node.TEXT_NODE:return n.Movement.STAYED_IN;default:return n.Movement.STAYED_OUT}if(!this.selectors)return n.Movement.STAYED_IN;if(s.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var u=s,c=this.selectors.map(function(m){return l.computeMatchabilityChange(m,u)}),d=n.Movement.STAYED_OUT,f=0;d!==n.Movement.STAYED_IN&&f<c.length;){switch(c[f]){case n.Movement.STAYED_IN:d=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:d===n.Movement.EXITED?d=n.Movement.STAYED_IN:d=n.Movement.ENTERED;break;case n.Movement.EXITED:d===n.Movement.ENTERED?d=n.Movement.STAYED_IN:d=n.Movement.EXITED}f++}return d},a.prototype.getChildlistChange=function(s){var l=this.childListChangeMap.get(s);return l||(l=new i.ChildListChange,this.childListChangeMap.set(s,l)),l},a.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r.NodeMap;for(var s=function(c){var d=l.mutations[c];if(d.type!="childList"||l.treeChanges.reachabilityChange(d.target)!==n.Movement.STAYED_IN&&!l.calcOldPreviousSibling)return"continue";for(var f=l.getChildlistChange(d.target),m=d.previousSibling,g=function(P,E){!P||f.oldPrevious.has(P)||f.added.has(P)||f.maybeMoved.has(P)||E&&(f.added.has(E)||f.maybeMoved.has(E))||f.oldPrevious.set(P,E)},h=0;h<d.removedNodes.length;h++){var b=d.removedNodes[h];g(b,m),f.added.has(b)?f.added.delete(b):(f.removed.set(b,!0),f.maybeMoved.delete(b)),m=b}g(d.nextSibling,m);for(var h=0;h<d.addedNodes.length;h++){var b=d.addedNodes[h];f.removed.has(b)?(f.removed.delete(b),f.maybeMoved.set(b,!0)):f.added.set(b,!0)}},l=this,u=0;u<this.mutations.length;u++)s(u)}},a.prototype.wasReordered=function(s){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var l=s.parentNode,u=this.treeChanges.get(s);u&&u.oldParentNode&&(l=u.oldParentNode);var c=this.childListChangeMap.get(l);if(!c)return!1;if(c.moved)return c.moved.get(s);c.moved=new r.NodeMap;var d=new r.NodeMap;function f(P){if(!P||!c.maybeMoved.has(P))return!1;var E=c.moved.get(P);return E!==void 0||(d.has(P)?E=!0:(d.set(P,!0),E=b(P)!==g(P)),d.has(P)?(d.delete(P),c.moved.set(P,E)):E=c.moved.get(P)),E}var m=new r.NodeMap;function g(P){var E=m.get(P);if(E!==void 0)return E;for(E=c.oldPrevious.get(P);E&&(c.removed.has(E)||f(E));)E=g(E);return E===void 0&&(E=P.previousSibling),m.set(P,E),E}var h=new r.NodeMap;function b(P){if(h.has(P))return h.get(P);for(var E=P.previousSibling;E&&(c.added.has(E)||f(E));)E=E.previousSibling;return h.set(P,E),E}return c.maybeMoved.keys().forEach(f),c.moved.get(s)},a})();e.MutationProjection=o})),Zh=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Summary=void 0;var t=(function(){function r(n,i){var o=this;if(this.projection=n,this.added=[],this.removed=[],this.reparented=i.all||i.element||i.characterData?[]:void 0,this.reordered=i.all?[]:void 0,n.getChanged(this,i.elementFilter,i.characterData),i.all||i.attribute||i.attributeList){var a=i.attribute?[i.attribute]:i.attributeList,s=n.attributeChangedNodes(a);i.attribute?this.valueChanged=s[i.attribute]||[]:(this.attributeChanged=s,i.attributeList&&i.attributeList.forEach(function(u){o.attributeChanged.hasOwnProperty(u)||(o.attributeChanged[u]=[])}))}if(i.all||i.characterData){var l=n.getCharacterDataChanged();i.characterData?this.valueChanged=l:this.characterDataChanged=l}this.reordered&&(this.getOldPreviousSibling=n.getOldPreviousSibling.bind(n))}return r.prototype.getOldParentNode=function(n){return this.projection.getOldParentNode(n)},r.prototype.getOldAttribute=function(n,i){return this.projection.getOldAttribute(n,i)},r.prototype.getOldCharacterData=function(n){return this.projection.getOldCharacterData(n)},r.prototype.getOldPreviousSibling=function(n){return this.projection.getOldPreviousSibling(n)},r})();e.Summary=t})),em=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Qualifier=void 0;var t=(function(){function n(){}return n.prototype.matches=function(i){if(i===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==i;for(var o=i.split(" "),a=0;a<o.length;a++)if(this.attrValue===o[a])return!0;return!1},n.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+r(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+r(this.attrValue)+"]":"["+this.attrName+"]"},n})();e.Qualifier=t;function r(n){return'"'+n.replace(/"/,'\\"')+'"'}})),tm=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Selector=void 0;var t=em(),r=Vi(),n=/[a-zA-Z_]+/,i=/[a-zA-Z0-9_\-]+/,o=(function(){function a(){this.uid=a.nextUid++,this.qualifiers=[]}return Object.defineProperty(a.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),a.prototype.isMatching=function(s){return s[a.matchesSelector](this.selectorString)},a.prototype.wasMatching=function(s,l,u){if(!l||!l.attributes)return u;var c=l.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(c!=="*"&&c!==s.tagName)return!1;for(var d=[],f=!1,m=0;m<this.qualifiers.length;m++){var g=this.qualifiers[m],h=l.getAttributeOldValue(g.attrName);d.push(h),f=f||h!==void 0}if(!f)return u;for(var m=0;m<this.qualifiers.length;m++){var g=this.qualifiers[m],h=d[m];if(h===void 0&&(h=s.getAttribute(g.attrName)),!g.matches(h))return!1}return!0},a.prototype.matchabilityChange=function(s,l){var u=this.isMatching(s);return u?this.wasMatching(s,l,u)?r.Movement.STAYED_IN:r.Movement.ENTERED:this.wasMatching(s,l,u)?r.Movement.EXITED:r.Movement.STAYED_OUT},a.parseSelectors=function(s){var l=[],u,c;function d(){u&&(c&&(u.qualifiers.push(c),c=void 0),l.push(u)),u=new a}function f(){c&&u.qualifiers.push(c),c=new t.Qualifier}for(var m=/\s/,g=void 0,h="Invalid or unsupported selector syntax.",b=1,P=2,E=3,S=4,_=5,w=6,v=7,I=8,y=9,T=10,A=11,C=12,N=13,j=14,M=b,F=0;F<s.length;){var D=s[F++];switch(M){case b:if(D.match(n)){d(),u.tagName=D,M=P;break}if(D=="*"){d(),u.tagName="*",M=E;break}if(D=="."){d(),f(),u.tagName="*",c.attrName="class",c.contains=!0,M=S;break}if(D=="#"){d(),f(),u.tagName="*",c.attrName="id",M=S;break}if(D=="["){d(),f(),u.tagName="*",c.attrName="",M=w;break}if(D.match(m))break;throw Error(h);case P:if(D.match(i)){u.tagName+=D;break}if(D=="."){f(),c.attrName="class",c.contains=!0,M=S;break}if(D=="#"){f(),c.attrName="id",M=S;break}if(D=="["){f(),c.attrName="",M=w;break}if(D.match(m)){M=j;break}if(D==","){M=b;break}throw Error(h);case E:if(D=="."){f(),c.attrName="class",c.contains=!0,M=S;break}if(D=="#"){f(),c.attrName="id",M=S;break}if(D=="["){f(),c.attrName="",M=w;break}if(D.match(m)){M=j;break}if(D==","){M=b;break}throw Error(h);case S:if(D.match(n)){c.attrValue=D,M=_;break}throw Error(h);case _:if(D.match(i)){c.attrValue+=D;break}if(D=="."){f(),c.attrName="class",c.contains=!0,M=S;break}if(D=="#"){f(),c.attrName="id",M=S;break}if(D=="["){f(),M=w;break}if(D.match(m)){M=j;break}if(D==","){M=b;break}throw Error(h);case w:if(D.match(n)){c.attrName=D,M=v;break}if(D.match(m))break;throw Error(h);case v:if(D.match(i)){c.attrName+=D;break}if(D.match(m)){M=I;break}if(D=="~"){c.contains=!0,M=y;break}if(D=="="){c.attrValue="",M=A;break}if(D=="]"){M=E;break}throw Error(h);case I:if(D=="~"){c.contains=!0,M=y;break}if(D=="="){c.attrValue="",M=A;break}if(D=="]"){M=E;break}if(D.match(m))break;throw Error(h);case y:if(D=="="){c.attrValue="",M=A;break}throw Error(h);case T:if(D=="]"){M=E;break}if(D.match(m))break;throw Error(h);case A:if(D.match(m))break;if(D=='"'||D=="'"){g=D,M=N;break}c.attrValue+=D,M=C;break;case C:if(D.match(m)){M=T;break}if(D=="]"){M=E;break}if(D=="'"||D=='"')throw Error(h);c.attrValue+=D;break;case N:if(D==g){M=T;break}c.attrValue+=D;break;case j:if(D.match(m))break;if(D==","){M=b;break}throw Error(h)}}switch(M){case b:case P:case E:case _:case j:d();break;default:throw Error(h)}if(!l.length)throw Error(h);return l},a.nextUid=1,a.matchesSelector="matches",a})();e.Selector=o})),cR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutationSummaryOptionProcessor=void 0;var t=tm(),r=(function(){function n(){}return n.createObserverOptions=function(i){var o={childList:!0,subtree:!0},a;function s(l){if(!(o.attributes&&!a)){if(o.attributes=!0,o.attributeOldValue=!0,!l){a=void 0;return}a=a||{},l.forEach(function(u){a[u]=!0,a[u.toLowerCase()]=!0})}}return i.forEach(function(l){if(l.characterData){o.characterData=!0,o.characterDataOldValue=!0;return}if(l.all){s(),o.characterData=!0,o.characterDataOldValue=!0;return}if(l.attribute){s([l.attribute.trim()]);return}var u=n._elementFilterAttributes(l.elementFilter).concat(l.attributeList||[]);u.length&&s(u)}),a&&(o.attributeFilter=Object.keys(a)),o},n.validateOptions=function(i){for(var o in i)if(!(o in n._optionKeys))throw Error("Invalid option: "+o);if(typeof i.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!i.queries||!i.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var a={callback:i.callback,rootNode:i.rootNode||document,observeOwnChanges:!!i.observeOwnChanges,oldPreviousSibling:!!i.oldPreviousSibling,queries:[]},s=0;s<i.queries.length;s++){var l=i.queries[s];if(l.all){if(Object.keys(l).length>1)throw Error("Invalid request option. all has no options.");a.queries.push({all:!0});continue}if("attribute"in l){var u={attribute:n._validateAttribute(l.attribute)};if(u.elementFilter=t.Selector.parseSelectors("*["+u.attribute+"]"),Object.keys(l).length>1)throw Error("Invalid request option. attribute has no options.");a.queries.push(u);continue}if("element"in l){var c=Object.keys(l).length,u={element:l.element,elementFilter:t.Selector.parseSelectors(l.element)};if(l.hasOwnProperty("elementAttributes")&&(u.attributeList=n._validateElementAttributes(l.elementAttributes),c--),c>1)throw Error("Invalid request option. element only allows elementAttributes option.");a.queries.push(u);continue}if(l.characterData){if(Object.keys(l).length>1)throw Error("Invalid request option. characterData has no options.");a.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return a},n._validateElementAttributes=function(i){if(!i.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var o={},a={},s=i.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(u){u=n._validateAttribute(u);var c=u.toLowerCase();if(o[c])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");a[u]=!0,o[c]=!0}}return Object.keys(a)},n._elementFilterAttributes=function(i){var o={};return i.forEach(function(a){a.qualifiers.forEach(function(s){o[s.attrName]=!0})}),Object.keys(o)},n._validateAttribute=function(i){if(typeof i!="string"||(i=i.trim(),!i))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!i.match(n._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+i);return i},n._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,n._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},n})();e.MutationSummaryOptionProcessor=r})),rm=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutationSummary=void 0;var t=Zh(),r=Jh(),n=cR(),i=(function(){function o(a){var s=this;this._connected=!1,this._options=n.MutationSummaryOptionProcessor.validateOptions(a),this._observerOptions=n.MutationSummaryOptionProcessor.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(l){return l.elementFilter?l.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(l){return l.all}),this._queryValidators=[],o.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(l){return o.createQueryValidator(s._root,l)})),this._observer=new MutationObserver(function(l){s._observerCallback(l)}),this.reconnect()}return o.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},o.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var a=this._createSummaries(this._observer.takeRecords());return this._changesToReport(a)?a:void 0},o.prototype.disconnect=function(){var a=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,a},o.prototype._observerCallback=function(a){this._options.observeOwnChanges||this._observer.disconnect();var s=this._createSummaries(a);this._runQueryValidators(s),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(s)&&this._callback(s),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},o.prototype._createSummaries=function(a){if(!a||!a.length)return[];for(var s=new r.MutationProjection(this._root,a,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),l=[],u=0;u<this._options.queries.length;u++)l.push(new t.Summary(s,this._options.queries[u]));return l},o.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(a){a&&a.recordPreviousState()})},o.prototype._runQueryValidators=function(a){this._queryValidators.forEach(function(s,l){s&&s.validate(a[l])})},o.prototype._changesToReport=function(a){return a.some(function(s){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(l){return s[l]&&s[l].length})||s.attributeChanged&&Object.keys(s.attributeChanged).some(function(l){return!!s.attributeChanged[l].length}))})},o})();e.MutationSummary=i})),dR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),fR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),pR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),hR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),mR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeMirror=void 0;var t=(function(){function r(n,i){this.root=n,this.delegate=i,this.idMap={}}return r.prototype.initialize=function(n,i){this.idMap[n]=this.root;for(var o=0;o<i.length;o++)this.deserializeNode(i[o],this.root)},r.prototype.applyChanged=function(n,i,o,a){var s=this;i.forEach(function(l){var u=s.deserializeNode(l);s.deserializeNode(l.parentNode),s.deserializeNode(l.previousSibling),u.parentNode&&u.parentNode.removeChild(u)}),n.forEach(function(l){var u=s.deserializeNode(l);u.parentNode&&u.parentNode.removeChild(u)}),i.forEach(function(l){var u=s.deserializeNode(l),c=s.deserializeNode(l.parentNode),d=s.deserializeNode(l.previousSibling);c.insertBefore(u,d?d.nextSibling:c.firstChild)}),o.forEach(function(l){var u=s.deserializeNode(l);Object.keys(l.attributes).forEach(function(c){var d=l.attributes[c];d===null?u.removeAttribute(c):(!s.delegate||!s.delegate.setAttribute||!s.delegate.setAttribute(u,c,d))&&u.setAttribute(c,d)})}),a.forEach(function(l){var u=s.deserializeNode(l);u.textContent=l.textContent}),n.forEach(function(l){delete s.idMap[l.id]})},r.prototype.deserializeNode=function(n,i){var o=this;if(n===null)return null;var a=this.idMap[n.id];if(a)return a;var s=this.root.ownerDocument;switch(s===null&&(s=this.root),n.nodeType){case Node.COMMENT_NODE:a=s.createComment(n.textContent);break;case Node.TEXT_NODE:a=s.createTextNode(n.textContent);break;case Node.DOCUMENT_TYPE_NODE:a=s.implementation.createDocumentType(n.name,n.publicId,n.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(a=this.delegate.createElement(n.tagName)),a||(a=s.createElement(n.tagName)),Object.keys(n.attributes).forEach(function(u){(!o.delegate||!o.delegate.setAttribute||!o.delegate.setAttribute(a,u,n.attributes[u]))&&a.setAttribute(u,n.attributes[u])});break;default:throw"Unsupported node type: "+n.nodeType}if(this.idMap[n.id]=a,i&&i.appendChild(a),n.childNodes)for(var l=0;l<n.childNodes.length;l++)this.deserializeNode(n.childNodes[l],a);return a},r})();e.TreeMirror=t})),gR=q.__commonJSMin((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeMirrorClient=void 0;var t=rm(),r=mn(),n=(function(){function i(o,a,s){var l=this;this.target=o,this.mirror=a,this.nextId=1,this.knownNodes=new r.NodeMap;for(var u=this.serializeNode(o).id,c=[],d=o.firstChild;d;d=d.nextSibling)c.push(this.serializeNode(d,!0));this.mirror.initialize(u,c);var f=[{all:!0}];s&&(f=f.concat(s)),this.mutationSummary=new t.MutationSummary({rootNode:o,callback:function(m){l.applyChanged(m)},queries:f})}return i.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},i.prototype.rememberNode=function(o){var a=this.nextId++;return this.knownNodes.set(o,a),a},i.prototype.forgetNode=function(o){this.knownNodes.delete(o)},i.prototype.serializeNode=function(o,a){if(o===null)return null;var s=this.knownNodes.get(o);if(s!==void 0)return{id:s};var l={nodeType:o.nodeType,id:this.rememberNode(o)};switch(l.nodeType){case Node.DOCUMENT_TYPE_NODE:var u=o;l.name=u.name,l.publicId=u.publicId,l.systemId=u.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:l.textContent=o.textContent;break;case Node.ELEMENT_NODE:var c=o;l.tagName=c.tagName,l.attributes={};for(var d=0;d<c.attributes.length;d++){var f=c.attributes[d];l.attributes[f.name]=f.value}if(a&&c.childNodes.length){l.childNodes=[];for(var m=c.firstChild;m;m=m.nextSibling)l.childNodes.push(this.serializeNode(m,!0))}}return l},i.prototype.serializeAddedAndMoved=function(o,a,s){var l=this,u=o.concat(a).concat(s),c=new r.NodeMap;u.forEach(function(f){var m=f.parentNode,g=c.get(m);g||(g=new r.NodeMap,c.set(m,g)),g.set(f,!0)});var d=[];return c.keys().forEach(function(f){for(var m=c.get(f),g=m.keys();g.length;){for(var h=g[0];h.previousSibling&&m.has(h.previousSibling);)h=h.previousSibling;for(;h&&m.has(h);){var b=l.serializeNode(h);b.previousSibling=l.serializeNode(h.previousSibling),b.parentNode=l.serializeNode(h.parentNode),d.push(b),m.delete(h),h=h.nextSibling}g=m.keys()}}),d},i.prototype.serializeAttributeChanges=function(o){var a=this,s=new r.NodeMap;return Object.keys(o).forEach(function(l){o[l].forEach(function(u){var c=s.get(u);c||(c=a.serializeNode(u),c.attributes={},s.set(u,c)),c.attributes[l]=u.getAttribute(l)})}),s.keys().map(function(l){return s.get(l)})},i.prototype.applyChanged=function(o){var a=this,s=o[0],l=s.removed.map(function(f){return a.serializeNode(f)}),u=this.serializeAddedAndMoved(s.added,s.reparented,s.reordered),c=this.serializeAttributeChanges(s.attributeChanged),d=s.characterDataChanged.map(function(f){var m=a.serializeNode(f);return m.textContent=f.textContent,m});this.mirror.applyChanged(l,u,c,d),s.removed.forEach(function(f){a.forgetNode(f)})},i})();e.TreeMirrorClient=n})),yR=q.__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[o]}})}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(dR(),e),r(fR(),e),r(pR(),e),r(hR(),e),r(mR(),e),r(gR(),e)})),vR=q.__commonJSMin((e=>{var t=e&&e.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[o]}})}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=e&&e.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};if(Object.defineProperty(e,"__esModule",{value:!0}),MutationObserver===void 0)throw Error("DOM Mutation Observers are required");r(Kh(),e),r(oR(),e),r(aR(),e),r(sR(),e),r(uR(),e),r(lR(),e),r(Vi(),e),r(Jh(),e),r(rm(),e),r(Yh(),e),r(mn(),e),r(em(),e),r(tm(),e),r(Zh(),e),r(Xh(),e),r(yR(),e)})),_R=vR(),lr=0,cr=new Array(1e3);function bR(){for(let e=0;e<lr;e+=2){const t=cr[e],r=cr[e+1];t(...r),cr[e]=void 0,cr[e+1]=void 0}lr=0}function ER(e,...t){cr[lr]=e,cr[lr+1]=t,lr+=2,lr===2&&PR()}function SR(){let e=0;const t=new MutationObserver(bR),r=document.createTextNode("");return t.observe(r,{characterData:!0}),()=>{r.data=String(e=++e%2)}}var PR=SR();function nm(){ER(()=>{Ls.hasListeners()&&(Ls.fire(),nm())})}var Ls=new O.Emitter({onFirstListenerAdd:nm}),ks=Ls.once,wR=class extends O.Emitter{_mutationSummary;constructor(e={}){super(),this._mutationSummary=new _R.MutationSummary({...e,observeOwnChanges:!0,callback:t=>this.fire(t),queries:[{all:!0}]})}dispose(){this._mutationSummary.disconnect(),super.dispose()}trigger(e){if(this.isDisposed())return;const t=this._mutationSummary.takeSummaries();return(e||t?.length)&&this.fire(t||[]),t}},IR=class extends O.Disposable{_mutationEmitter;_innerEmitter=this.addDisposable(new O.Emitter({onFirstListenerAdd:()=>{this._nextTickHandler()}}));_lostEmitter=this.addDisposable(new O.Emitter);_paused=0;_stopped=0;_summaries=[];_nextTickHandler(){ks(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),this._mutationEmitter=this.addDisposable(new wR(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{this._stopped||(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),ks(()=>{this._summaries.length&&!this._innerEmitter.hasListeners()&&(this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)))}))}get isStoped(){return this._paused>0||this._stopped>0}stop(){this._mutationEmitter.trigger(),this._stopped++}start(){this._mutationEmitter.trigger(),this._stopped--}pause(){this._mutationEmitter.trigger(),this._paused++}resume(){this._mutationEmitter.trigger(),this._paused--}trigger(){this._mutationEmitter.trigger(!0)}onMutate=this._innerEmitter.event;onLost=this._lostEmitter.event;onNativeMutate};function CR(e){for(const t of e){if(t.removed)for(const r of t.removed){const n=t.getOldParentNode(r),i=t.getOldPreviousSibling(r);if(n){const o=i?.nextSibling??null;n.insertBefore(r,o)}}if(t.added)for(const r of t.added)r.parentNode&&r.parentNode.removeChild(r);if(t.reordered)for(const r of t.reordered){const n=t.getOldParentNode(r),i=t.getOldPreviousSibling(r);if(n){const o=i?.nextSibling??null;n.insertBefore(r,o)}}if(t.attributeChanged)for(const r of Object.keys(t.attributeChanged))for(const n of t.attributeChanged[r]){const i=t.getOldAttribute(n,r);i==null?n.removeAttribute(r):n.setAttribute(r,i)}if(t.characterDataChanged)for(const r of t.characterDataChanged)(no(r)||to(r)||to(r))&&(r.data=t.getOldCharacterData(r))}}var OR=class extends O.Disposable{_commitPromise;_mutationCollector;_onLostSummaries=e=>{try{this._mutationCollector.stop(),CR(e)}finally{this._mutationCollector.start()}};constructor(e){super(),this._mutationCollector=this.addDisposable(new IR({rootNode:e,oldPreviousSibling:!0})),this._mutationCollector.onLost(this._onLostSummaries)}commit(){if(this._commitPromise)return this._commitPromise;{const e=()=>new Promise(t=>{const r=this._mutationCollector.onMutate(n=>{this._commitPromise=void 0,t(),r.dispose()});ks(()=>{this._commitPromise=void 0,t(),r.dispose()})});return this._commitPromise=e().catch(t=>{})}}};function TR(e,t){const r=o=>{const a={contentDocument:o,html:hr(o)};return a.html=Qh(a.html).html,a},n=new O.AsyncEmitter,i=new O.AsyncEmitter;try{const o=Hh(e),a=document.implementation.createHTMLDocument();return au(a,o),{document:a,handleRender:i.event,handleReadHtml:n.event,async run(){if(i.hasListeners()){const s=document.createElement("iframe");s.style.position="absolute",s.style.left="-10000px",document.body.appendChild(s);const l=s.contentWindow.document,u=new OR(s.contentDocument);let c;try{if(t){const[d,f]=t;d!==void 0&&s.setAttribute("width",String(d)),f!==void 0&&s.setAttribute("height",String(f))}au(l,[...a.childNodes]),u.commit()}catch(d){throw d}finally{try{try{await i.fire({managedNodeController:u,contentDocument:l})}catch{}const d=r(l);await n.fire(d),c=d.html}finally{s.parentNode===document.body&&document.body.removeChild(s)}}return c}else{const s=r(a);return await n.fire(s),s.html}}}}catch(o){throw o}}function AR(e,t){const r=document.createElement("input");r.type="file",r.accept=e,r.multiple=!1,r.setAttribute("data-testid","uploadFile"),r.style.position="absolute",r.style.opacity="0",r.style.pointerEvents="none",document.body.appendChild(r),r.onchange=()=>{r.files?.length&&t(r.files),document.body.removeChild(r)},r.click()}var im=()=>(0,gt.__vitePreload)(()=>Promise.resolve().then(()=>ye("./99c2b321.js")),void 0,{}.url);async function MR(e,t){if(t==="amp")e.handleRender(async({contentDocument:r,managedNodeController:n})=>{for(const o of r.querySelectorAll(".em-amp-show-disabled"))o.remove();const{html2amp:i}=await im();await i(r,{mappedTags:{script:"___script"},commit:()=>n.commit()})});else if(t==="html"){const r=e.document;for(const i of r.querySelectorAll(".em-amp-show-only"))i.remove();const{amp2html:n}=await im();n(r,{mappedTags:{script:"___script"}})}}function NR(e,t){e?.mutate({content:na(t)},{source:"remote"})}function RR(e,t,r,{undoable:n}){if(!e)return;const i=e.getContent(),o=na(r);i!==o&&(e.mutate({changes:[new Ue(0,i,0,o)]},{source:"user"}),n||t?.clear())}function DR(){const{document:e,history:t}=Pt();return(0,R.useCallback)((r,n)=>RR(e,t,r,n),[e,t])}function Wi(e,t){return Wi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Wi(e,t)}function om(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wi(e,t)}function jR(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function FR(e,t){e.classList?e.classList.add(t):jR(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function am(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function LR(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=am(e.className,t):e.setAttribute("class",am(e.className&&e.className.baseVal||"",t))}var sm={disabled:!1},um=R.default.createContext(null),lm=function(t){return t.scrollTop},Us="unmounted",dr="exited",Qi="entering",Ki="entered",Bs="exiting",ft=(function(e){om(t,e);function t(n,i){var o=e.call(this,n,i)||this,a=i,s=a&&!a.isMounting?n.enter:n.appear,l;return o.appearStatus=null,n.in?s?(l=dr,o.appearStatus=Qi):l=Ki:n.unmountOnExit||n.mountOnEnter?l=Us:l=dr,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){return i.in&&o.status==="unmounted"?{status:dr}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!=="entering"&&a!=="entered"&&(o=Qi):(a==="entering"||a==="entered")&&(o=Bs)}this.updateStatus(!1,o)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var i=this.props.timeout,o=a=s=i,a,s;return i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},r.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o==="entering"){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:mt.default.findDOMNode(this);a&&lm(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status==="exited"&&this.setState({status:Us})},r.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[mt.default.findDOMNode(this),s],u=l[0],c=l[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!i&&!a||sm.disabled){this.safeSetState({status:Ki},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:Qi},function(){o.props.onEntering(u,c),o.onTransitionEnd(f,function(){o.safeSetState({status:Ki},function(){o.props.onEntered(u,c)})})})},r.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:mt.default.findDOMNode(this);if(!o||sm.disabled){this.safeSetState({status:dr},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Bs},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:dr},function(){i.props.onExited(s)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},r.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:mt.default.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},r.render=function(){var i=this.state.status;if(i==="unmounted")return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=so(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return R.default.createElement(um.Provider,{value:null},typeof a=="function"?a(i,s):R.default.cloneElement(R.default.Children.only(a),s))},t})(R.default.Component);ft.contextType=um,ft.propTypes={};function fr(){}ft.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fr,onEntering:fr,onEntered:fr,onExit:fr,onExiting:fr,onExited:fr},ft.UNMOUNTED=Us,ft.EXITED=dr,ft.ENTERING=Qi,ft.ENTERED=Ki,ft.EXITING=Bs;var kR=function(t,r){return t&&r&&r.split(" ").forEach(function(n){return FR(t,n)})},$s=function(t,r){return t&&r&&r.split(" ").forEach(function(n){return LR(t,n)})},xs=(function(e){om(t,e);function t(){for(var n,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=e.call.apply(e,[this].concat(o))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(s,l){var u=n.resolveArguments(s,l),c=u[0],d=u[1];n.removeClasses(c,"exit"),n.addClass(c,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(s,l)},n.onEntering=function(s,l){var u=n.resolveArguments(s,l),c=u[0],d=u[1]?"appear":"enter";n.addClass(c,d,"active"),n.props.onEntering&&n.props.onEntering(s,l)},n.onEntered=function(s,l){var u=n.resolveArguments(s,l),c=u[0],d=u[1]?"appear":"enter";n.removeClasses(c,d),n.addClass(c,d,"done"),n.props.onEntered&&n.props.onEntered(s,l)},n.onExit=function(s){var l=n.resolveArguments(s)[0];n.removeClasses(l,"appear"),n.removeClasses(l,"enter"),n.addClass(l,"exit","base"),n.props.onExit&&n.props.onExit(s)},n.onExiting=function(s){var l=n.resolveArguments(s)[0];n.addClass(l,"exit","active"),n.props.onExiting&&n.props.onExiting(s)},n.onExited=function(s){var l=n.resolveArguments(s)[0];n.removeClasses(l,"exit"),n.addClass(l,"exit","done"),n.props.onExited&&n.props.onExited(s)},n.resolveArguments=function(s,l){return n.props.nodeRef?[n.props.nodeRef.current,s]:[s,l]},n.getClassNames=function(s){var l=n.props.classNames,u=typeof l=="string",c=u&&l?l+"-":"",d=u?""+c+s:l[s];return{baseClassName:d,activeClassName:u?d+"-active":l[s+"Active"],doneClassName:u?d+"-done":l[s+"Done"]}},n}var r=t.prototype;return r.addClass=function(i,o,a){var s=this.getClassNames(o)[a+"ClassName"],l=this.getClassNames("enter").doneClassName;o==="appear"&&a==="done"&&l&&(s+=" "+l),a==="active"&&i&&lm(i),s&&(this.appliedClasses[o][a]=s,kR(i,s))},r.removeClasses=function(i,o){var a=this.appliedClasses[o],s=a.base,l=a.active,u=a.done;this.appliedClasses[o]={},s&&$s(i,s),l&&$s(i,l),u&&$s(i,u)},r.render=function(){var i=this.props;i.classNames;var o=so(i,["classNames"]);return R.default.createElement(ft,En({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t})(R.default.Component);xs.defaultProps={classNames:""},xs.propTypes={};function cm(){const e=ve(),t=pa(O.getContainer(e)),r=(0,R.useCallback)(n=>t.subscribe(n),[t]);return{document:(0,R.useSyncExternalStore)(r,()=>t.current()),show:(0,R.useSyncExternalStore)(r,()=>t.showFacts()),error:(0,R.useSyncExternalStore)(r,()=>t.openError())}}function UR(e){return String(e).replace(/"/g,""")}function dm(e=new Date){const t=r=>String(r).padStart(2,"0");return String(e.getFullYear())+t(e.getMonth()+1)+t(e.getDate())+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())}function BR(e){if(!e||!/^\d{12}(\d{2})?$/.test(e))return null;const t=Number(e.slice(0,4)),r=Number(e.slice(4,6))-1,n=Number(e.slice(6,8)),i=Number(e.slice(8,10)),o=Number(e.slice(10,12)),a=e.length>=14?Number(e.slice(12,14)):0,s=new Date(t,r,n,i,o,a);return Number.isNaN(s.getTime())?null:s}function fm(e){const t=/<(table|tr|div)(\s[^>]*)>/gi;let r;for(;(r=t.exec(e))!==null;){const n=r[2]??"";if(/\bem\s*=\s*["']block["']/i.test(n))return{full:r[0],index:r.index}}return null}function pm(e,t,r){const n=new RegExp(`\\b${t}\\s*=\\s*["'][^"']*["']`,"i"),i=UR(r);return n.test(e)?e.replace(n,`${t}="${i}"`):e.replace(/>$/,` ${t}="${i}">`)}function hm(e,t){const r=new RegExp(`\\b${t}\\s*=\\s*["']([^"']*)["']`,"i").exec(e);return r?r[1]:void 0}function $R(e){if(!e?.trim())return{};const t=fm(e);return t?{emBlockId:hm(t.full,"em-block-id"),emBlockVersion:hm(t.full,"em-block-version")}:{}}function xR(e,t,r){if(!e?.trim()||!t)return e;const n=fm(e);if(!n)return e;const i=String(t),o=dm(r??new Date);let{full:a,index:s}=n;const l=a.length;return/\bem-block-id\s*=/.test(a)||(a=pm(a,"em-block-id",i)),a=pm(a,"em-block-version",o),e.slice(0,s)+a+e.slice(s+l)}function qR(e){return{projectId:e,pageSize:1e3,page:1,tags:null,name:null,type:null,notEmbed:!0,order:"asc",orderby:"title"}}function GR(e){return e===null?null:e===void 0||e===""||e===0||e==="0"?Ol:e}function HR(e){return{emailId:e,pageSize:1e3,page:1,projectId:I_,notEmbed:!0,name:null,type:null}}function zR(){return{pageSize:1e3,page:1,notEmbed:!0,name:null,type:null}}var VR=`
|
|
61
|
-
:host > table { margin: 0 auto; }
|
|
62
|
-
table { border-collapse: initial; }
|
|
63
|
-
`;function mm(e){return e.shadowRoot??e.attachShadow({mode:"open"})}function WR(e,t){e.innerHTML=`<style>${VR}</style>${t}`}function QR(e){e.shadowRoot&&(e.shadowRoot.innerHTML="")}function gm(e,t){const r=e.closest(".blocks-search__result-body");if(t){e.dataset.blockPreview="filled",r?.setAttribute("data-block-preview","filled");return}delete e.dataset.blockPreview,r?.removeAttribute("data-block-preview")}function KR(e,t){const r=Array.from(e.querySelectorAll("img")).filter(n=>!n.complete);return r.forEach(n=>{n.addEventListener("load",t),n.addEventListener("error",t)}),()=>{r.forEach(n=>{n.removeEventListener("load",t),n.removeEventListener("error",t)})}}function YR({html:e,className:t,style:r,onContentLoad:n}){const i=(0,R.useRef)(null);return(0,R.useEffect)(()=>{const o=i.current;if(!o)return;let a,s=!1;const l=()=>{if(s)return;const d=mm(o);WR(d,e),s=!0,gm(o,!0),n?.(o),a=n?KR(d,()=>n(o)):void 0},c=_O(o,{fill:l,drop:()=>{s&&(a?.(),a=void 0,QR(o),s=!1,gm(o,!1))}});return c===!1?(l(),()=>a?.()):()=>{c(),a?.()}},[e,n]),(0,$.jsx)("div",{ref:i,className:t,style:r})}function XR(e){const t=e.cloneNode(!1),r=e.shadowRoot;return r?mm(t).innerHTML=r.innerHTML:t.innerHTML=e.innerHTML,t}var JR={};function ZR(e){const t=(0,R.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),r=(0,R.useRef)(null),n=(0,R.useCallback)(()=>{if(!e)return JR;const{docId:i,attributes:o}=e.get();return(r.current?.docId!==i||r.current.attributes!==o)&&(r.current={docId:i,attributes:o}),r.current.attributes},[e]);return(0,R.useSyncExternalStore)(t,n)}function eD({attributes:e,readContent:t,docId:r,hasSession:n,serverId:i,show:o}){if(!n)return;const a={id:i??void 0,renderGuid:r,showId:o?.id,isNew:i==null,showToken:o?.token},s={...e,...a};return Object.defineProperty(s,"html",{get:()=>t()??"",enumerable:!0,configurable:!0}),s}function tD(){const{document:e,show:t,error:r}=cm(),n=ZR(e),i=(0,R.useCallback)(a=>e?e.subscribe(a):()=>{},[e]),o=(0,R.useSyncExternalStore)(i,()=>e?.get().serverId??void 0);return{document:e,email:(0,R.useMemo)(()=>eD({attributes:n,readContent:()=>e?.getContent(),docId:e?.get().docId,hasSession:!!e,serverId:o,show:t}),[n,e,t,o]),error:r}}function rD(e){const t=ve();return(0,R.useMemo)(()=>e?O.getApi(O.getContainer(t),e):O.getContainer(t)?.getInstance(O.REST_CLIENT_ID),[t,e])}var nD=()=>{const e=ve();return(0,R.useMemo)(()=>O.getContainer(e)?.getInstance(O.STORAGE_PROVIDER_ID),[e])},ym=O.createIdentifier$1("EditorOptions"),qs=Kv;function iD(e){const t=typeof e.font_family=="string"?`${e.font_family}, sans-serif`:void 0,r=e.word_wrap===void 0?void 0:e.word_wrap?"on":"off";return{tabSize:e.tab_size,fontFamily:t,fontSize:e.font_size,wordWrap:r,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}}function vm(e){return e.getOrCreateInstance(ym,()=>{const t=Ve(qs);let r=qs.fontFamily;return t.watch(n=>{!n.fontFamily||n.fontFamily===r||(r=n.fontFamily,Promise.resolve(TP(n.fontFamily.split(",")[0])).catch(()=>{}))}),t})}function oD(e){return e?.getInstance(ym)?.get()??qs}function aD(e,t={}){const r=vm(e);r.set(ed({...r.get()},iD(t)))}function sD({candidates:e,headers:t,createEventSource:r,onMessage:n,onError:i}){const o=e.filter(Boolean);let a=!1,s=null;const l=()=>{s?.close(),s=null},u=c=>{if(a)return;const d=o[c];if(!d){i?.(new Error("Failed to connect to EventSource through proxy chain"));return}l();const f=r(d,{headers:t});s=f,f.onmessage=m=>{a||s!==f||n(m)},f.onerror=m=>{if(!(a||s!==f)){if(l(),c+1<o.length){u(c+1);return}i?.(m)}}};return u(0),{close(){a=!0,l()}}}var uD="https://api.unsplash.com",lD="https://api.giphy.com/v1/gifs";function gn(e){return{error:e instanceof Error?e:new Error(String(e))}}async function Yi(e){if(!e.ok)throw new Error(`Request failed with status ${e.status}`);const t=await e.text();try{return t?JSON.parse(t):null}catch(r){throw r}}function cD(e){return e&&Array.isArray(e.results)?e:e?.data&&Array.isArray(e.data.results)?e.data:e?.response&&Array.isArray(e.response.results)?e.response:{...e||{},results:[]}}var _m=we({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(t,r){try{const n=Et(O.getContainer(r)).imageInfoToolUrl||"https://scr.emcdn.ru/imageinfo";return{data:await Yi(await fetch(`${n}?url=${encodeURIComponent(t)}`))}}catch(n){return gn(n)}}}),getSearchImage:e.query({queryFn:async function({query:t,page:r},n){const i=t.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const o=Et(O.getContainer(n)),a=O.getContainer(n).getInstance(O.SECURITY_MODULE_ID)!==void 0,s=new URL(`${uD}/search/photos`);return s.searchParams.set("client_id","S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"),s.searchParams.set("lang","ru"),s.searchParams.set("per_page","18"),s.searchParams.set("query",i),s.searchParams.set("page",String(r)),t.color!==""&&s.searchParams.set("color",t.color),t.orientation!==""&&s.searchParams.set("orientation",t.orientation),{data:cD(await Yi(await O.fetchWithResourceProxy(s.toString(),{config:o,standalone:a,resourceType:"stockImages",intent:"metadata"})))}}catch(o){return gn(o)}}}),getUnsplashImage:e.query({queryFn:async function(t,r){try{const n=Et(O.getContainer(r)),i=O.getContainer(r).getInstance(O.SECURITY_MODULE_ID)!==void 0,o=new URL(t);return o.searchParams.set("client_id","S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"),{data:await Yi(await O.fetchWithResourceProxy(o.toString(),{config:n,standalone:i,resourceType:"stockImages",intent:"metadata"}))}}catch(n){return gn(n)}}}),sendAiImageRequest:e.query({queryFn:async function({body:t},r){try{return await x(r).aiGenerator.ai_create(t)}catch(n){throw new Error(n)}}}),getAiImage:e.query({queryFn:async function(t,r){try{return await x(r).aiGenerator.ai_status_list(t)}catch(n){return gn(n)}}}),getAiImageSSE:e.query({queryFn:t=>({data:[]}),async onCacheEntryAdded({task_id:t,entity_id:r,setError:n},i){const{updateCachedData:o,cacheEntryRemoved:a}=i,s=x(i).baseUrl||O.normalizeBaseUrl("https://app.emailmaker.ru/api/"),l=Et(O.getContainer(i)),u=O.getContainer(i).getInstance(O.SECURITY_MODULE_ID)!==void 0,c=await O.getContainer(i).getInstance(O.TOKEN_ID),d=c?{Authorization:`Bearer ${c}`}:{},f=`${s}/ai-generator/v1/ai-status?entity_id=${r}&stream=1&task_id=${t}`,{EventSourcePolyfill:m}=await(0,gt.__vitePreload)(async()=>{const{EventSourcePolyfill:b}=await Promise.resolve().then(()=>q.__toESM(ye("./6933d533.js").default));return{EventSourcePolyfill:b}},void 0,{}.url),g=O.resolveBackendProxyRequestCandidates(f,{config:l,method:"GET",requestType:"ai",standalone:u}),h=sD({candidates:g.length>0?g:[f],headers:d,createEventSource:(b,P)=>new m(b,P),onMessage:b=>{const P=JSON.parse(b.data);o(E=>{E.push(P)}),P.progress===100&&h.close()},onError:()=>{h.close()}});await a,h.close()}}),getSearchGif:e.query({queryFn:async function({query:t,page:r},n){const i=t.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const o=Et(O.getContainer(n)),a=O.getContainer(n).getInstance(O.SECURITY_MODULE_ID)!==void 0;return{data:await Yi(await O.fetchWithResourceProxy(`${lD}/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${encodeURIComponent(i)}&limit=25&offset=${r}&lang=en`,{config:o,standalone:a,resourceType:"generic",intent:"metadata"}))}}catch(o){return gn(o)}}})})}),{useLazyGetImageInfoQuery:dD,useGetImageInfoQuery:eF,useGetSearchImageQuery:tF,useLazyGetSearchImageQuery:fD,useSendAiImageRequestQuery:rF,useLazySendAiImageRequestQuery:pD,useGetAiImageQuery:nF,useLazyGetAiImageQuery:iF,useGetUnsplashImageQuery:oF,useLazyGetUnsplashImageQuery:hD,useGetSearchGifQuery:aF,useLazyGetSearchGifQuery:mD,useGetAiImageSSEQuery:sF,useLazyGetAiImageSSEQuery:gD}=_m,bm="Optimise",yD="usage_limit_exceeded",vD=async(e,t,r)=>{const n=x(t).baseUrl.replaceAll(/[\\/]$/g,""),i=await Re({baseUrl:`${n}/optimization/v1/validate`})(e,t,r);if(i.error){let o=i.error;if(typeof o.json=="function")try{o=await o.json()}catch{o=await o}return{error:o}}return i},Em=we({reducerPath:"optimiseApi",tagTypes:[bm],baseQuery:vD,endpoints:e=>({editLinks:e.mutation({query:t=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:t}),invalidatesTags:[bm]}),editImages:e.mutation({query:t=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:t})}),editSpam:e.mutation({query:t=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:t})})})}),{useEditLinksMutation:_D,useEditImagesMutation:bD,useEditSpamMutation:ED}=Em,SD={currentSchema:{},monacoDidMount:!1},PD="userSlice",Sm=Pe({name:PD,initialState:SD,reducers:{setMonacoDidMount:(e,{payload:t})=>{e.monacoDidMount=t}},extraReducers:e=>{e.addMatcher(Ei.endpoints.getSchema.matchFulfilled,(t,r)=>{t.currentSchema=r.payload.schema})}}),{setMonacoDidMount:wD}=Sm.actions,ID={getContainer:O.getContainer,createIdentifier:O.createIdentifier$1,reducer:H_,reducerPath:Dl},Pm=O.createIdentifier$1("DefaultCommonStyles");function wm(e){return e.getOrCreateInstance(Pm,()=>Ve(void 0))}function CD(e){return e?.getInstance(Pm)?.get()}function OD(e,t){wm(e).set(t)}var Im=O.createIdentifier$1("CodeErrors"),Cm=[];function TD(e){return e.getOrCreateInstance(Im,()=>Ve(Cm))}function AD(e){return e?.getInstance(Im)?.get()??Cm}function MD(e,t){TD(e).set(t)}var ND={"doctype-html5":!1,"html-lang-require":!1,"head-script-disabled":!1,"style-disabled":!1,"script-disabled":!1,"attr-lowercase":!1,"attr-value-single-quotes":!1,"attr-value-not-empty":!1,"attr-sorted":!1,"attr-whitespace":!1,"input-requires-label":!1,"tag-self-close":!1,"tagname-lowercase":!1,"href-abs-or-rel":!1,"inline-style-disabled":!1,"space-tab-mixed-disabled":!1,"attr-no-unnecessary-whitespace":!0,"tags-check":{img:{selfclosing:!1,attrsRequired:["src","alt"]},a:{selfclosing:!1,attrsRequired:[]}},"empty-tag-not-self-closed":!1,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0,"alt-require":!0,"inline-script-disabled":!0,"id-class-value":!1,"id-class-ad-disabled":!0,"attr-unsafe-chars":!0};Object.defineProperty(p,"AICHAT",{enumerable:!0,get:function(){return c_}}),Object.defineProperty(p,"ANNOTATIONS_PARAMETERS",{enumerable:!0,get:function(){return o_}}),Object.defineProperty(p,"APPEARANCE",{enumerable:!0,get:function(){return Jv}}),Object.defineProperty(p,"APP_COOKIES",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(p,"APP_ROUTES",{enumerable:!0,get:function(){return xv}}),Object.defineProperty(p,"ATOMS",{enumerable:!0,get:function(){return h_}}),Object.defineProperty(p,"AiApi",{enumerable:!0,get:function(){return Xp}}),Object.defineProperty(p,"AiApiGenerator",{enumerable:!0,get:function(){return Jp}}),Object.defineProperty(p,"BASIC_BORDER_COLOR",{enumerable:!0,get:function(){return u_}}),Object.defineProperty(p,"BLOCK",{enumerable:!0,get:function(){return y_}}),Object.defineProperty(p,"BLOCKS",{enumerable:!0,get:function(){return p_}}),Object.defineProperty(p,"BLOCK_TAGS",{enumerable:!0,get:function(){return O_}}),Object.defineProperty(p,"BUILD",{enumerable:!0,get:function(){return No}}),Object.defineProperty(p,"BlockAutoSaveToWpBlockAutoSave",{enumerable:!0,get:function(){return Mf}}),Object.defineProperty(p,"BlockPreviewShadow",{enumerable:!0,get:function(){return YR}}),Object.defineProperty(p,"CARDS",{enumerable:!0,get:function(){return v_}}),Object.defineProperty(p,"COLLABORATION_EDITOR_WARNING_TEXT",{enumerable:!0,get:function(){return kM}}),Object.defineProperty(p,"COMMON_STYLES",{enumerable:!0,get:function(){return Rv}}),Object.defineProperty(p,"CSSTransition",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(p,"CURRENT_PROJECT_ID",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(p,"CollaboratorList",{enumerable:!0,get:function(){return h0}}),Object.defineProperty(p,"ContentType",{enumerable:!0,get:function(){return V}}),Object.defineProperty(p,"D",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(p,"DARK",{enumerable:!0,get:function(){return kv}}),Object.defineProperty(p,"DEFAULT_SANDBOX_OP_TIMEOUT_MS",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(p,"DEFAULT_SANDBOX_READY_TIMEOUT_MS",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(p,"DISABLED_TAB",{enumerable:!0,get:function(){return n_}}),Object.defineProperty(p,"DISCONNECT_WARNING_TEXT",{enumerable:!0,get:function(){return UM}}),Object.defineProperty(p,"DISCUSS",{enumerable:!0,get:function(){return f_}}),Object.defineProperty(p,"DND_SOCIAL_LIST_REORDER_MIME",{enumerable:!0,get:function(){return qv}}),Object.defineProperty(p,"DocumentSessionProvider",{enumerable:!0,get:function(){return fO}}),Object.defineProperty(p,"EDIT",{enumerable:!0,get:function(){return l_}}),Object.defineProperty(p,"EDIT_SELECTED_ELEMENT",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(p,"EDIT_SELECTED_TABLE_CELLS",{enumerable:!0,get:function(){return s_}}),Object.defineProperty(p,"ELEMENT_TYPES",{enumerable:!0,get:function(){return Yv}}),Object.defineProperty(p,"EMAIL",{enumerable:!0,get:function(){return Cl}}),Object.defineProperty(p,"EMAIL_CODE_RULESET",{enumerable:!0,get:function(){return ND}}),Object.defineProperty(p,"EMAIL_DOCUMENTS_ID",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(p,"EMAIL_TAGS",{enumerable:!0,get:function(){return C_}}),Object.defineProperty(p,"EM_FILES_MODULES",{enumerable:!0,get:function(){return hA}}),Object.defineProperty(p,"EM_SOCIAL_SELECT_ORDER",{enumerable:!0,get:function(){return np}}),Object.defineProperty(p,"ERROR",{enumerable:!0,get:function(){return Dv}}),Object.defineProperty(p,"ERRORS",{enumerable:!0,get:function(){return P_}}),Object.defineProperty(p,"EVENT_TYPES",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(p,"EditorModelContext",{enumerable:!0,get:function(){return fp}}),Object.defineProperty(p,"ElementEntityKindProvider",{enumerable:!0,get:function(){return NT}}),Object.defineProperty(p,"EmIcons",{enumerable:!0,get:function(){return Ai}}),Object.defineProperty(p,"EmailAutoSaveToWpEmailAutoSave",{enumerable:!0,get:function(){return Ph}}),Object.defineProperty(p,"EmailOpenFailedError",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(p,"EmailToWpEmail",{enumerable:!0,get:function(){return Ts}}),Object.defineProperty(p,"FEATURE_UPSELL_SLIDE",{enumerable:!0,get:function(){return aT}}),Object.defineProperty(p,"HISTORY",{enumerable:!0,get:function(){return r_}}),Object.defineProperty(p,"ImagePickerProvider",{enumerable:!0,get:function(){return gI}}),Object.defineProperty(p,"LIGHT",{enumerable:!0,get:function(){return Lv}}),Object.defineProperty(p,"LOCALE_SERVICE_ID",{enumerable:!0,get:function(){return If}}),Object.defineProperty(p,"LOCAL_STORAGE_ITEMS",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(p,"LocaleProvider",{enumerable:!0,get:function(){return pC}}),Object.defineProperty(p,"MOBILE",{enumerable:!0,get:function(){return Al}}),Object.defineProperty(p,"MODALS",{enumerable:!0,get:function(){return me}}),Object.defineProperty(p,"MOUNT_HEADLESS_MARK",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(p,"ModalRootContext",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(p,"NOTIFY_COMMAND_ID",{enumerable:!0,get:function(){return yf}}),Object.defineProperty(p,"NOT_ALL",{enumerable:!0,get:function(){return Fv}}),Object.defineProperty(p,"OPTIMISE",{enumerable:!0,get:function(){return m_}}),Object.defineProperty(p,"OPTIMISE_TABS",{enumerable:!0,get:function(){return w_}}),Object.defineProperty(p,"PENDING",{enumerable:!0,get:function(){return __}}),Object.defineProperty(p,"PHASES",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(p,"PREFERS_COLOR_SCHEME_DARK",{enumerable:!0,get:function(){return $v}}),Object.defineProperty(p,"PREFERS_COLOR_SCHEME_LIGHT",{enumerable:!0,get:function(){return Bv}}),Object.defineProperty(p,"PROPERTIES",{enumerable:!0,get:function(){return t_}}),Object.defineProperty(p,"PlanUpgradePrompt",{enumerable:!0,get:function(){return iT}}),Object.defineProperty(p,"PromiseAllCatched",{enumerable:!0,get:function(){return WN}}),Object.defineProperty(p,"Provider",{enumerable:!0,get:function(){return Dg}}),Object.defineProperty(p,"READ_COMMON_BLOCKS_EVENT_ID",{enumerable:!0,get:function(){return CE}}),Object.defineProperty(p,"READ_TEMPLATE_BLOCKS_EVENT_ID",{enumerable:!0,get:function(){return IE}}),Object.defineProperty(p,"RESET_BORDER_PARAMS",{enumerable:!0,get:function(){return g_}}),Object.defineProperty(p,"REST_EMAIL_PORTS_ID",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(p,"RootContext",{enumerable:!0,get:function(){return Ll}}),Object.defineProperty(p,"RouteOutlet",{enumerable:!0,get:function(){return uE}}),Object.defineProperty(p,"SANDBOX_TRANSLATIONS_MAP",{enumerable:!0,get:function(){return T_}}),Object.defineProperty(p,"SAVE_COMMAND_ID",{enumerable:!0,get:function(){return eC}}),Object.defineProperty(p,"SETTINGS",{enumerable:!0,get:function(){return e_}}),Object.defineProperty(p,"SOCIAL_ICON_BY_PLATFORM",{enumerable:!0,get:function(){return kO}}),Object.defineProperty(p,"SOCIAL_ICON_ORIGINAL_BY_PLATFORM",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(p,"STRUCTURE",{enumerable:!0,get:function(){return Zv}}),Object.defineProperty(p,"STYLES",{enumerable:!0,get:function(){return d_}}),Object.defineProperty(p,"SYSTEM",{enumerable:!0,get:function(){return Uv}}),Object.defineProperty(p,"TABLE_PROPERTIES",{enumerable:!0,get:function(){return a_}}),Object.defineProperty(p,"TEMPLATE_EMAIL_ID",{enumerable:!0,get:function(){return Ol}}),Object.defineProperty(p,"TYPES_TRANSLATE",{enumerable:!0,get:function(){return A_}}),Object.defineProperty(p,"TextChange",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(p,"USAGE_LIMIT_EXCEEDED_CODE",{enumerable:!0,get:function(){return yD}}),Object.defineProperty(p,"UTM_PARAMETERS",{enumerable:!0,get:function(){return i_}}),Object.defineProperty(p,"VALID",{enumerable:!0,get:function(){return E_}}),Object.defineProperty(p,"WARNINGS",{enumerable:!0,get:function(){return S_}}),Object.defineProperty(p,"WpBlockRevisionToBlockRevision",{enumerable:!0,get:function(){return Af}}),Object.defineProperty(p,"WpEmailRevisionToEmailRevision",{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(p,"WpEmailToEmail",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(p,"WpUserToUser",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(p,"Z",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(p,"_extends",{enumerable:!0,get:function(){return En}}),Object.defineProperty(p,"_objectWithoutPropertiesLoose",{enumerable:!0,get:function(){return so}}),Object.defineProperty(p,"_polyfill_node_global_default",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(p,"_setPrototypeOf",{enumerable:!0,get:function(){return Wi}}),Object.defineProperty(p,"_typeof",{enumerable:!0,get:function(){return $o}}),Object.defineProperty(p,"addDocumentListenerFromShadow",{enumerable:!0,get:function(){return x0}}),Object.defineProperty(p,"addWindowListenerFromShadow",{enumerable:!0,get:function(){return $0}}),Object.defineProperty(p,"api",{enumerable:!0,get:function(){return Xd}}),Object.defineProperty(p,"appendEmVersionForPreviewReload",{enumerable:!0,get:function(){return D0}}),Object.defineProperty(p,"applyEditorOptions",{enumerable:!0,get:function(){return aD}}),Object.defineProperty(p,"applyMetaPatch",{enumerable:!0,get:function(){return hc}}),Object.defineProperty(p,"authorizationApi",{enumerable:!0,get:function(){return Ei}}),Object.defineProperty(p,"autosaveStateFromRevisions",{enumerable:!0,get:function(){return fc}}),Object.defineProperty(p,"autosaveStateFromSlots",{enumerable:!0,get:function(){return pc}}),Object.defineProperty(p,"blockPreviewHref",{enumerable:!0,get:function(){return CM}}),Object.defineProperty(p,"blockRevisionsDataSourceProvider",{enumerable:!0,get:function(){return rc}}),Object.defineProperty(p,"blockSlice",{enumerable:!0,get:function(){return Nf}}),Object.defineProperty(p,"blocksApi",{enumerable:!0,get:function(){return Ci}}),Object.defineProperty(p,"blocksDataSourceProvider",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(p,"browser$1",{enumerable:!0,get:function(){return Bu}}),Object.defineProperty(p,"buildBlockInsertContext",{enumerable:!0,get:function(){return gE}}),Object.defineProperty(p,"buildEmailRawSharePath",{enumerable:!0,get:function(){return PM}}),Object.defineProperty(p,"buildEmailRawShareUrl",{enumerable:!0,get:function(){return SM}}),Object.defineProperty(p,"buildGetElementPreviewPath",{enumerable:!0,get:function(){return EM}}),Object.defineProperty(p,"buildResolvedFileManagerProviders",{enumerable:!0,get:function(){return s0}}),Object.defineProperty(p,"changeConfig",{enumerable:!0,get:function(){return is}}),Object.defineProperty(p,"clearDiagnostics",{enumerable:!0,get:function(){return Wm}}),Object.defineProperty(p,"clientFromApi",{enumerable:!0,get:function(){return x}}),Object.defineProperty(p,"cloneBlockPreviewForDrag",{enumerable:!0,get:function(){return XR}}),Object.defineProperty(p,"closeModal",{enumerable:!0,get:function(){return UC}}),Object.defineProperty(p,"closeModal$1",{enumerable:!0,get:function(){return dI}}),Object.defineProperty(p,"closeSecondModal",{enumerable:!0,get:function(){return pI}}),Object.defineProperty(p,"combineReducers",{enumerable:!0,get:function(){return lo}}),Object.defineProperty(p,"commentsApi",{enumerable:!0,get:function(){return Zp}}),Object.defineProperty(p,"commentsDataSourceProvider",{enumerable:!0,get:function(){return nc}}),Object.defineProperty(p,"commonLocale",{enumerable:!0,get:function(){return nf}}),Object.defineProperty(p,"configureStore",{enumerable:!0,get:function(){return By}}),Object.defineProperty(p,"createApi",{enumerable:!0,get:function(){return we}}),Object.defineProperty(p,"createDraftFromTemplate",{enumerable:!0,get:function(){return VE}}),Object.defineProperty(p,"createI18n",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(p,"createIFrame",{enumerable:!0,get:function(){return TR}}),Object.defineProperty(p,"createNewEmailDraft",{enumerable:!0,get:function(){return _c}}),Object.defineProperty(p,"createRestClientV2",{enumerable:!0,get:function(){return p0}}),Object.defineProperty(p,"createSlice",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(p,"createState",{enumerable:!0,get:function(){return iv}}),Object.defineProperty(p,"createZip",{enumerable:!0,get:function(){return eN}}),Object.defineProperty(p,"css",{enumerable:!0,get:function(){return eo}}),Object.defineProperty(p,"decodeFileNameFromPath",{enumerable:!0,get:function(){return Hp}}),Object.defineProperty(p,"decodeFileNameFromUrl",{enumerable:!0,get:function(){return zp}}),Object.defineProperty(p,"defaultModePanesSlice",{enumerable:!0,get:function(){return rh}}),Object.defineProperty(p,"detectMount",{enumerable:!0,get:function(){return Ws}}),Object.defineProperty(p,"di",{enumerable:!0,get:function(){return ID}}),Object.defineProperty(p,"drainLoaderMarks",{enumerable:!0,get:function(){return Js}}),Object.defineProperty(p,"e",{enumerable:!0,get:function(){return B}}),Object.defineProperty(p,"emCssVar",{enumerable:!0,get:function(){return B_}}),Object.defineProperty(p,"emailOpenFailureReason",{enumerable:!0,get:function(){return Uc}}),Object.defineProperty(p,"emailPageSlice",{enumerable:!0,get:function(){return Lf}}),Object.defineProperty(p,"emailSlice",{enumerable:!0,get:function(){return El}}),Object.defineProperty(p,"emailsApi",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(p,"executeCommand",{enumerable:!0,get:function(){return JI}}),Object.defineProperty(p,"existingTermIdFromError",{enumerable:!0,get:function(){return Zw}}),Object.defineProperty(p,"failedTerms",{enumerable:!0,get:function(){return Jw}}),Object.defineProperty(p,"fetchBaseQuery",{enumerable:!0,get:function(){return sd}}),Object.defineProperty(p,"fetchBaseQueryApp",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(p,"filterUndefined",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(p,"findShadowRoot",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(p,"fireUploadImageEvent",{enumerable:!0,get:function(){return oA}}),Object.defineProperty(p,"formatCodeSize",{enumerable:!0,get:function(){return FT}}),Object.defineProperty(p,"formatEmBlockVersion",{enumerable:!0,get:function(){return dm}}),Object.defineProperty(p,"fromHistory",{enumerable:!0,get:function(){return op}}),Object.defineProperty(p,"fromRevision",{enumerable:!0,get:function(){return aa}}),Object.defineProperty(p,"getAppConfig",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(p,"getAppNamespaceRoot",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(p,"getAppProject",{enumerable:!0,get:function(){return Xc}}),Object.defineProperty(p,"getBlockDesc",{enumerable:!0,get:function(){return lC}}),Object.defineProperty(p,"getBlocksProject",{enumerable:!0,get:function(){return _P}}),Object.defineProperty(p,"getBrandNamespace",{enumerable:!0,get:function(){return Zi}}),Object.defineProperty(p,"getBrowserImageCompressionLibUrl",{enumerable:!0,get:function(){return Is}}),Object.defineProperty(p,"getBundledHostAssetUrl",{enumerable:!0,get:function(){return fh}}),Object.defineProperty(p,"getClient",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(p,"getClientV2",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(p,"getCodeErrors",{enumerable:!0,get:function(){return AD}}),Object.defineProperty(p,"getCodeMode",{enumerable:!0,get:function(){return Df}}),Object.defineProperty(p,"getCodeSize",{enumerable:!0,get:function(){return LT}}),Object.defineProperty(p,"getComponentRegistry",{enumerable:!0,get:function(){return Nb}}),Object.defineProperty(p,"getComputedStyleAsync",{enumerable:!0,get:function(){return vg}}),Object.defineProperty(p,"getConditionalComment",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(p,"getCurrentProject",{enumerable:!0,get:function(){return Br}}),Object.defineProperty(p,"getCurrentUser",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(p,"getDataSources",{enumerable:!0,get:function(){return Yc}}),Object.defineProperty(p,"getDefaultCommonStyles",{enumerable:!0,get:function(){return CD}}),Object.defineProperty(p,"getDefaultSocialItems",{enumerable:!0,get:function(){return UO}}),Object.defineProperty(p,"getDiagnosticsSnapshot",{enumerable:!0,get:function(){return zm}}),Object.defineProperty(p,"getDiagnosticsStore",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(p,"getDisposable",{enumerable:!0,get:function(){return ec}}),Object.defineProperty(p,"getDocType",{enumerable:!0,get:function(){return tu}}),Object.defineProperty(p,"getEditorOptions",{enumerable:!0,get:function(){return oD}}),Object.defineProperty(p,"getElementInnerHTML",{enumerable:!0,get:function(){return ou}}),Object.defineProperty(p,"getElementStartHtml_VDOM",{enumerable:!0,get:function(){return rg}}),Object.defineProperty(p,"getEmailDesc",{enumerable:!0,get:function(){return uC}}),Object.defineProperty(p,"getEmailDocuments",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(p,"getEmitter",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(p,"getEvent",{enumerable:!0,get:function(){return Sb}}),Object.defineProperty(p,"getLimitUpgradePresetDefinition",{enumerable:!0,get:function(){return $T}}),Object.defineProperty(p,"getMessageService",{enumerable:!0,get:function(){return Nl}}),Object.defineProperty(p,"getMimeExtension",{enumerable:!0,get:function(){return _A}}),Object.defineProperty(p,"getMimeType",{enumerable:!0,get:function(){return Ip}}),Object.defineProperty(p,"getMyProjectRole",{enumerable:!0,get:function(){return $f}}),Object.defineProperty(p,"getOpenDocument",{enumerable:!0,get:function(){return va}}),Object.defineProperty(p,"getOpenEmail",{enumerable:!0,get:function(){return vP}}),Object.defineProperty(p,"getOuterHtml",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(p,"getPublicPath",{enumerable:!0,get:function(){return dh}}),Object.defineProperty(p,"getRendererString",{enumerable:!0,get:function(){return He}}),Object.defineProperty(p,"getResourcesSnapshot",{enumerable:!0,get:function(){return Vm}}),Object.defineProperty(p,"getRestEmailPortFactories",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(p,"getRevisionServiceFlag",{enumerable:!0,get:function(){return bc}}),Object.defineProperty(p,"getSandboxGeneration",{enumerable:!0,get:function(){return q_}}),Object.defineProperty(p,"getSocialIcon",{enumerable:!0,get:function(){return LO}}),Object.defineProperty(p,"getSocialIconForBlockCell",{enumerable:!0,get:function(){return FO}}),Object.defineProperty(p,"getSocialPresetsForBrand",{enumerable:!0,get:function(){return fT}}),Object.defineProperty(p,"getStore",{enumerable:!0,get:function(){return wE}}),Object.defineProperty(p,"getSupportEmail",{enumerable:!0,get:function(){return OM}}),Object.defineProperty(p,"hasOwnMeta",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(p,"hasThumbnailWatcher",{enumerable:!0,get:function(){return o0}}),Object.defineProperty(p,"identifyUser",{enumerable:!0,get:function(){return rS}}),Object.defineProperty(p,"ie",{enumerable:!0,get:function(){return WA}}),Object.defineProperty(p,"imageApi",{enumerable:!0,get:function(){return _m}}),Object.defineProperty(p,"inferImageMimeFromFileName",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(p,"init__polyfill_node_global",{enumerable:!0,get:function(){return co}}),Object.defineProperty(p,"init__polyfill_node_process",{enumerable:!0,get:function(){return ry}}),Object.defineProperty(p,"injectBlockHistoryPort",{enumerable:!0,get:function(){return DE}}),Object.defineProperty(p,"injectEmBlockIdIntoBlockHtml",{enumerable:!0,get:function(){return xR}}),Object.defineProperty(p,"injectEmailRightsResolver",{enumerable:!0,get:function(){return QE}}),Object.defineProperty(p,"injectEmailTermsResolver",{enumerable:!0,get:function(){return HS}}),Object.defineProperty(p,"injectRestEmailPortFactories",{enumerable:!0,get:function(){return qS}}),Object.defineProperty(p,"isAMPImageElement",{enumerable:!0,get:function(){return sg}}),Object.defineProperty(p,"isAllowedImageUploadFile",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(p,"isCodeSizeExceeded",{enumerable:!0,get:function(){return kT}}),Object.defineProperty(p,"isComment",{enumerable:!0,get:function(){return to}}),Object.defineProperty(p,"isDiagnosticsEnabled",{enumerable:!0,get:function(){return zs}}),Object.defineProperty(p,"isDocument",{enumerable:!0,get:function(){return iu}}),Object.defineProperty(p,"isDocumentFragment",{enumerable:!0,get:function(){return fg}}),Object.defineProperty(p,"isEditorLockedByPlan",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(p,"isElement",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(p,"isFileManagerV2Enabled",{enumerable:!0,get:function(){return Ep}}),Object.defineProperty(p,"isForm",{enumerable:!0,get:function(){return lg}}),Object.defineProperty(p,"isGoogleFontsCssUrl",{enumerable:!0,get:function(){return wl}}),Object.defineProperty(p,"isHtmlElement",{enumerable:!0,get:function(){return og}}),Object.defineProperty(p,"isImageCenterModal",{enumerable:!0,get:function(){return KT}}),Object.defineProperty(p,"isImageEditModal",{enumerable:!0,get:function(){return QT}}),Object.defineProperty(p,"isImageElement",{enumerable:!0,get:function(){return ag}}),Object.defineProperty(p,"isProjectsV2Enabled",{enumerable:!0,get:function(){return De}}),Object.defineProperty(p,"isRevisionServiceEnabled",{enumerable:!0,get:function(){return Wn}}),Object.defineProperty(p,"isScriptElement",{enumerable:!0,get:function(){return dg}}),Object.defineProperty(p,"isStandaloneRuntime",{enumerable:!0,get:function(){return bp}}),Object.defineProperty(p,"isStyleElement",{enumerable:!0,get:function(){return nu}}),Object.defineProperty(p,"isTableElement",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(p,"isTextNode",{enumerable:!0,get:function(){return no}}),Object.defineProperty(p,"isUseBlocksBuild",{enumerable:!0,get:function(){return TM}}),Object.defineProperty(p,"lazyRoute",{enumerable:!0,get:function(){return TT}}),Object.defineProperty(p,"limitsApi",{enumerable:!0,get:function(){return Jf}}),Object.defineProperty(p,"loadDocumentContent",{enumerable:!0,get:function(){return NR}}),Object.defineProperty(p,"loadGFonts",{enumerable:!0,get:function(){return R0}}),Object.defineProperty(p,"logShowPipeline",{enumerable:!0,get:function(){return gS}}),Object.defineProperty(p,"logShowPipelineError",{enumerable:!0,get:function(){return Ym}}),Object.defineProperty(p,"logShowPipelineWait",{enumerable:!0,get:function(){return yS}}),Object.defineProperty(p,"mapMargeTags",{enumerable:!0,get:function(){return Fl}}),Object.defineProperty(p,"mapper",{enumerable:!0,get:function(){return PN}}),Object.defineProperty(p,"mark",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(p,"markAppearanceNeedsUpdate",{enumerable:!0,get:function(){return yv}}),Object.defineProperty(p,"measureBlockPreviews",{enumerable:!0,get:function(){return SO}}),Object.defineProperty(p,"mergeEntityPreservingMeta",{enumerable:!0,get:function(){return mc}}),Object.defineProperty(p,"minifyHtml",{enumerable:!0,get:function(){return UT}}),Object.defineProperty(p,"missingRequiredPhases",{enumerable:!0,get:function(){return qm}}),Object.defineProperty(p,"ne",{enumerable:!0,get:function(){return qp}}),Object.defineProperty(p,"normalizeUrl",{enumerable:!0,get:function(){return Ri}}),Object.defineProperty(p,"onPanelSettingsSent",{enumerable:!0,get:function(){return gb}}),Object.defineProperty(p,"onSandboxGenerationChange",{enumerable:!0,get:function(){return G_}}),Object.defineProperty(p,"openFailureFromResponse",{enumerable:!0,get:function(){return $S}}),Object.defineProperty(p,"openModal",{enumerable:!0,get:function(){return kC}}),Object.defineProperty(p,"openModal$1",{enumerable:!0,get:function(){return Hd}}),Object.defineProperty(p,"openSecondModal",{enumerable:!0,get:function(){return fI}}),Object.defineProperty(p,"optimiseApi",{enumerable:!0,get:function(){return Em}}),Object.defineProperty(p,"parentEmailBlocksArgs",{enumerable:!0,get:function(){return HR}}),Object.defineProperty(p,"parentEmailSource",{enumerable:!0,get:function(){return GR}}),Object.defineProperty(p,"parseEmBlockVersion",{enumerable:!0,get:function(){return BR}}),Object.defineProperty(p,"parseFromString",{enumerable:!0,get:function(){return Hh}}),Object.defineProperty(p,"parseISO",{enumerable:!0,get:function(){return zb}}),Object.defineProperty(p,"pickFileProxyBlobFromFireResults",{enumerable:!0,get:function(){return rA}}),Object.defineProperty(p,"pickProxyUrlOverrideFromFireResults",{enumerable:!0,get:function(){return nA}}),Object.defineProperty(p,"prepareEmailHtmlForEditor",{enumerable:!0,get:function(){return iR}}),Object.defineProperty(p,"prepareImageForEditorResult",{enumerable:!0,get:function(){return uM}}),Object.defineProperty(p,"prepareImageForEditorUpload",{enumerable:!0,get:function(){return lM}}),Object.defineProperty(p,"prepareImageForUpload",{enumerable:!0,get:function(){return ws}}),Object.defineProperty(p,"presetLimitDisplay",{enumerable:!0,get:function(){return xT}}),Object.defineProperty(p,"previewHrefForRacs",{enumerable:!0,get:function(){return IM}}),Object.defineProperty(p,"processAmp",{enumerable:!0,get:function(){return MR}}),Object.defineProperty(p,"projectBlocksArgs",{enumerable:!0,get:function(){return qR}}),Object.defineProperty(p,"projectGroupsLoaded",{enumerable:!0,get:function(){return bv}}),Object.defineProperty(p,"projectSettingsV2Api",{enumerable:!0,get:function(){return ss}}),Object.defineProperty(p,"projectsApi",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(p,"projectsPageSlice",{enumerable:!0,get:function(){return Gd}}),Object.defineProperty(p,"provideAutosaveUiFacts",{enumerable:!0,get:function(){return zc}}),Object.defineProperty(p,"provideCodeMode",{enumerable:!0,get:function(){return Oi}}),Object.defineProperty(p,"provideCurrentProject",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(p,"provideCurrentUser",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(p,"provideDefaultCommonStyles",{enumerable:!0,get:function(){return wm}}),Object.defineProperty(p,"provideEditorOptions",{enumerable:!0,get:function(){return vm}}),Object.defineProperty(p,"provideEmailDocuments",{enumerable:!0,get:function(){return HE}}),Object.defineProperty(p,"provideHeadlessMode",{enumerable:!0,get:function(){return oo}}),Object.defineProperty(p,"readDocumentContent",{enumerable:!0,get:function(){return ap}}),Object.defineProperty(p,"readLocalToggle",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(p,"readRootEmBlockAttrs",{enumerable:!0,get:function(){return $R}}),Object.defineProperty(p,"readZip",{enumerable:!0,get:function(){return Th}}),Object.defineProperty(p,"readZipFromBase64",{enumerable:!0,get:function(){return tN}}),Object.defineProperty(p,"reducerPath",{enumerable:!0,get:function(){return Dl}}),Object.defineProperty(p,"registerBlockInsertPending",{enumerable:!0,get:function(){return PP}}),Object.defineProperty(p,"rememberAutosaveTime",{enumerable:!0,get:function(){return fv}}),Object.defineProperty(p,"reportError",{enumerable:!0,get:function(){return wc}}),Object.defineProperty(p,"reportMessage",{enumerable:!0,get:function(){return tS}}),Object.defineProperty(p,"require_prop_types",{enumerable:!0,get:function(){return Tg}}),Object.defineProperty(p,"requiredArgs",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(p,"requiredPhases",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(p,"resetBlockSlice",{enumerable:!0,get:function(){return CC}}),Object.defineProperty(p,"resetElementHistorySlice",{enumerable:!0,get:function(){return AM}}),Object.defineProperty(p,"resetEmailSlice",{enumerable:!0,get:function(){return dv}}),Object.defineProperty(p,"resetPanes",{enumerable:!0,get:function(){return O0}}),Object.defineProperty(p,"resetParentBlocks",{enumerable:!0,get:function(){return WC}}),Object.defineProperty(p,"resetToLastActiveSettingsTab",{enumerable:!0,get:function(){return $C}}),Object.defineProperty(p,"resolveContentReadyTimeoutMs",{enumerable:!0,get:function(){return NE}}),Object.defineProperty(p,"resolveEmailPort",{enumerable:!0,get:function(){return ha}}),Object.defineProperty(p,"resolveImageCompressionLimits",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(p,"resolveSandboxOpTimeoutMs",{enumerable:!0,get:function(){return sc}}),Object.defineProperty(p,"resolveSandboxReadyTimeoutMs",{enumerable:!0,get:function(){return RE}}),Object.defineProperty(p,"resolveSequentialSandboxOpBudgetMs",{enumerable:!0,get:function(){return ME}}),Object.defineProperty(p,"resolveTemplateDirectivesConfig",{enumerable:!0,get:function(){return bN}}),Object.defineProperty(p,"revisionHistorySlice",{enumerable:!0,get:function(){return Os}}),Object.defineProperty(p,"ru_RU_exports",{enumerable:!0,get:function(){return KI}}),Object.defineProperty(p,"runBlockInsertHtmlPipeline",{enumerable:!0,get:function(){return Ab}}),Object.defineProperty(p,"runElementInsertHtmlPipeline",{enumerable:!0,get:function(){return Tb}}),Object.defineProperty(p,"runOnceInFlight",{enumerable:!0,get:function(){return B0}}),Object.defineProperty(p,"sanitizeHtml",{enumerable:!0,get:function(){return Xf}}),Object.defineProperty(p,"saveFileApi",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(p,"saveRefusalReason",{enumerable:!0,get:function(){return hS}}),Object.defineProperty(p,"selectActiveModal",{enumerable:!0,get:function(){return JC}}),Object.defineProperty(p,"selectActiveModal$1",{enumerable:!0,get:function(){return zd}}),Object.defineProperty(p,"selectActiveProblemRange",{enumerable:!0,get:function(){return Tv}}),Object.defineProperty(p,"selectActiveSettingsTab",{enumerable:!0,get:function(){return iO}}),Object.defineProperty(p,"selectBlockSettings",{enumerable:!0,get:function(){return TC}}),Object.defineProperty(p,"selectCodeModeDirection",{enumerable:!0,get:function(){return nO}}),Object.defineProperty(p,"selectEditorThemeColor",{enumerable:!0,get:function(){return MC}}),Object.defineProperty(p,"selectEditorThemeColor$1",{enumerable:!0,get:function(){return Cv}}),Object.defineProperty(p,"selectElementHistoryHasMore",{enumerable:!0,get:function(){return MM}}),Object.defineProperty(p,"selectElementSettings",{enumerable:!0,get:function(){return AC}}),Object.defineProperty(p,"selectElementSettings$1",{enumerable:!0,get:function(){return Iv}}),Object.defineProperty(p,"selectEmailSettings",{enumerable:!0,get:function(){return Sv}}),Object.defineProperty(p,"selectEmailViewType",{enumerable:!0,get:function(){return eO}}),Object.defineProperty(p,"selectEmailWidth",{enumerable:!0,get:function(){return XC}}),Object.defineProperty(p,"selectHistoryData",{enumerable:!0,get:function(){return NM}}),Object.defineProperty(p,"selectIsCodeMode",{enumerable:!0,get:function(){return YC}}),Object.defineProperty(p,"selectIsCodeMode$1",{enumerable:!0,get:function(){return OC}}),Object.defineProperty(p,"selectIsGlobalLoading",{enumerable:!0,get:function(){return tO}}),Object.defineProperty(p,"selectIsHeaderCodeMenuOpen",{enumerable:!0,get:function(){return aO}}),Object.defineProperty(p,"selectIsNeedUpdateAppearance",{enumerable:!0,get:function(){return Av}}),Object.defineProperty(p,"selectIsNeedUpdateContentAppearance",{enumerable:!0,get:function(){return Ev}}),Object.defineProperty(p,"selectIsPanelHistoryCollapsed",{enumerable:!0,get:function(){return sO}}),Object.defineProperty(p,"selectIsSettingsDisabled",{enumerable:!0,get:function(){return NC}}),Object.defineProperty(p,"selectIsSettingsDisabled$1",{enumerable:!0,get:function(){return Ov}}),Object.defineProperty(p,"selectMobileViewActive",{enumerable:!0,get:function(){return rO}}),Object.defineProperty(p,"selectMonacoFocusing",{enumerable:!0,get:function(){return A0}}),Object.defineProperty(p,"selectParentBlocks",{enumerable:!0,get:function(){return ZC}}),Object.defineProperty(p,"selectProblemsList",{enumerable:!0,get:function(){return Pv}}),Object.defineProperty(p,"selectProjectGroups",{enumerable:!0,get:function(){return wv}}),Object.defineProperty(p,"selectPropertiesPanelKey",{enumerable:!0,get:function(){return oO}}),Object.defineProperty(p,"selectSecondModal",{enumerable:!0,get:function(){return hI}}),Object.defineProperty(p,"setActiveProblemRange",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(p,"setActiveSettingsTab",{enumerable:!0,get:function(){return BC}}),Object.defineProperty(p,"setAttributeSafe",{enumerable:!0,get:function(){return Gh}}),Object.defineProperty(p,"setBlockSettings",{enumerable:!0,get:function(){return PC}}),Object.defineProperty(p,"setBlockSettingsDisable",{enumerable:!0,get:function(){return IC}}),Object.defineProperty(p,"setCachedProjectFonts",{enumerable:!0,get:function(){return M0}}),Object.defineProperty(p,"setCodeErrors",{enumerable:!0,get:function(){return MD}}),Object.defineProperty(p,"setCodeMode",{enumerable:!0,get:function(){return zC}}),Object.defineProperty(p,"setCodeMode$1",{enumerable:!0,get:function(){return jf}}),Object.defineProperty(p,"setCodeModeDirection",{enumerable:!0,get:function(){return jC}}),Object.defineProperty(p,"setCurrentProjectCard",{enumerable:!0,get:function(){return pP}}),Object.defineProperty(p,"setCurrentProjectRefreshing",{enumerable:!0,get:function(){return fP}}),Object.defineProperty(p,"setDefaultCommonStyles",{enumerable:!0,get:function(){return OD}}),Object.defineProperty(p,"setEditorThemeColor",{enumerable:!0,get:function(){return SC}}),Object.defineProperty(p,"setEditorThemeColor$1",{enumerable:!0,get:function(){return sv}}),Object.defineProperty(p,"setElementSettings",{enumerable:!0,get:function(){return wC}}),Object.defineProperty(p,"setElementSettings$1",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(p,"setEmailGroups",{enumerable:!0,get:function(){return gv}}),Object.defineProperty(p,"setEmailSettings",{enumerable:!0,get:function(){return uv}}),Object.defineProperty(p,"setEmailSettingsDisable",{enumerable:!0,get:function(){return cv}}),Object.defineProperty(p,"setEmailWidth",{enumerable:!0,get:function(){return qC}}),Object.defineProperty(p,"setHeaderCodeMenuOpen",{enumerable:!0,get:function(){return KC}}),Object.defineProperty(p,"setHeadlessMode",{enumerable:!0,get:function(){return Sg}}),Object.defineProperty(p,"setHiddenMount",{enumerable:!0,get:function(){return Ig}}),Object.defineProperty(p,"setIsGlobalLoading",{enumerable:!0,get:function(){return QC}}),Object.defineProperty(p,"setIsNeedUpdateAppearance",{enumerable:!0,get:function(){return vv}}),Object.defineProperty(p,"setIsNeedUpdateContentAppearance",{enumerable:!0,get:function(){return _v}}),Object.defineProperty(p,"setMobileViewActive",{enumerable:!0,get:function(){return HC}}),Object.defineProperty(p,"setMonacoDidMount",{enumerable:!0,get:function(){return wD}}),Object.defineProperty(p,"setMonacoFocusing",{enumerable:!0,get:function(){return T0}}),Object.defineProperty(p,"setProblemsList",{enumerable:!0,get:function(){return hv}}),Object.defineProperty(p,"setPropertiesPanelKey",{enumerable:!0,get:function(){return VC}}),Object.defineProperty(p,"setupListeners",{enumerable:!0,get:function(){return HP}}),Object.defineProperty(p,"shouldEnableImageCompression",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(p,"shouldFallbackToBuiltInUpload",{enumerable:!0,get:function(){return aA}}),Object.defineProperty(p,"stripEmVersionFromUrlString",{enumerable:!0,get:function(){return oh}}),Object.defineProperty(p,"stripSubjectTags",{enumerable:!0,get:function(){return Nv}}),Object.defineProperty(p,"subscribeToContent",{enumerable:!0,get:function(){return vT}}),Object.defineProperty(p,"swallowPromiseRejection",{enumerable:!0,get:function(){return U0}}),Object.defineProperty(p,"switchCodeModeDirection",{enumerable:!0,get:function(){return GC}}),Object.defineProperty(p,"switchIsPanelHistoryCollapsed",{enumerable:!0,get:function(){return xC}}),Object.defineProperty(p,"syncBlockCacheAfterInsertPipeline",{enumerable:!0,get:function(){return CP}}),Object.defineProperty(p,"taxonomiesApi",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(p,"templateBlocksArgs",{enumerable:!0,get:function(){return zR}}),Object.defineProperty(p,"themeTokenCssVarName",{enumerable:!0,get:function(){return $_}}),Object.defineProperty(p,"toAbsolute",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(p,"toAbsoluteUrl",{enumerable:!0,get:function(){return cs}}),Object.defineProperty(p,"toLanguageCode",{enumerable:!0,get:function(){return dM}}),Object.defineProperty(p,"toNumberSafe",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(p,"toUploadImageError",{enumerable:!0,get:function(){return sA}}),Object.defineProperty(p,"toggleCodeMode",{enumerable:!0,get:function(){return DC}}),Object.defineProperty(p,"transformListResponseFn",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(p,"transformResponseFn",{enumerable:!0,get:function(){return he}}),Object.defineProperty(p,"uploadFile",{enumerable:!0,get:function(){return AR}}),Object.defineProperty(p,"uploadFileViaDataProvider",{enumerable:!0,get:function(){return eA}}),Object.defineProperty(p,"useAddBlockMutation",{enumerable:!0,get:function(){return vC}}),Object.defineProperty(p,"useAddCommentMutation",{enumerable:!0,get:function(){return P0}}),Object.defineProperty(p,"useAddEmailMutation",{enumerable:!0,get:function(){return WM}}),Object.defineProperty(p,"useAddTermMutation",{enumerable:!0,get:function(){return aI}}),Object.defineProperty(p,"useAppConfig",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(p,"useAppDispatch",{enumerable:!0,get:function(){return vI}}),Object.defineProperty(p,"useAppNavigate",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(p,"useAppSearchParams",{enumerable:!0,get:function(){return dE}}),Object.defineProperty(p,"useAppStore",{enumerable:!0,get:function(){return Yd}}),Object.defineProperty(p,"useAutoSaveBlockMutation",{enumerable:!0,get:function(){return bC}}),Object.defineProperty(p,"useCommand",{enumerable:!0,get:function(){return gf}}),Object.defineProperty(p,"useConfigSource",{enumerable:!0,get:function(){return Ro}}),Object.defineProperty(p,"useContainer",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(p,"useContentReader",{enumerable:!0,get:function(){return BM}}),Object.defineProperty(p,"useContentReplacer",{enumerable:!0,get:function(){return DR}}),Object.defineProperty(p,"useCookieManager",{enumerable:!0,get:function(){return kf}}),Object.defineProperty(p,"useCurrentProjectRequested",{enumerable:!0,get:function(){return DT}}),Object.defineProperty(p,"useCurrentSession",{enumerable:!0,get:function(){return cm}}),Object.defineProperty(p,"useCurrentUser",{enumerable:!0,get:function(){return Wa}}),Object.defineProperty(p,"useCurrentUserLocale",{enumerable:!0,get:function(){return dO}}),Object.defineProperty(p,"useDeleteCommentMutation",{enumerable:!0,get:function(){return w0}}),Object.defineProperty(p,"useDeleteTargetMutation",{enumerable:!0,get:function(){return C0}}),Object.defineProperty(p,"useDeleteTermMutation",{enumerable:!0,get:function(){return uI}}),Object.defineProperty(p,"useDispatch",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(p,"useDocumentHistoryReader",{enumerable:!0,get:function(){return RM}}),Object.defineProperty(p,"useDocumentSessionContext",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(p,"useDocumentUndo",{enumerable:!0,get:function(){return gT}}),Object.defineProperty(p,"useDocumentUndoState",{enumerable:!0,get:function(){return yT}}),Object.defineProperty(p,"useEditBlockMutation",{enumerable:!0,get:function(){return _C}}),Object.defineProperty(p,"useEditCommentMutation",{enumerable:!0,get:function(){return I0}}),Object.defineProperty(p,"useEditEmailMutation",{enumerable:!0,get:function(){return QM}}),Object.defineProperty(p,"useEditImagesMutation",{enumerable:!0,get:function(){return bD}}),Object.defineProperty(p,"useEditLinksMutation",{enumerable:!0,get:function(){return _D}}),Object.defineProperty(p,"useEditMeMutation",{enumerable:!0,get:function(){return II}}),Object.defineProperty(p,"useEditProjectMutation",{enumerable:!0,get:function(){return Yw}}),Object.defineProperty(p,"useEditSpamMutation",{enumerable:!0,get:function(){return ED}}),Object.defineProperty(p,"useEditTermMutation",{enumerable:!0,get:function(){return sI}}),Object.defineProperty(p,"useEditorProjectId",{enumerable:!0,get:function(){return jT}}),Object.defineProperty(p,"useElementEntityKind",{enumerable:!0,get:function(){return RT}}),Object.defineProperty(p,"useEmailAttribute",{enumerable:!0,get:function(){return YM}}),Object.defineProperty(p,"useEmailAttributesWriter",{enumerable:!0,get:function(){return KM}}),Object.defineProperty(p,"useEvent",{enumerable:!0,get:function(){return Pb}}),Object.defineProperty(p,"useEventEmitter",{enumerable:!0,get:function(){return ko}}),Object.defineProperty(p,"useFitBlockPreviewHeight",{enumerable:!0,get:function(){return IO}}),Object.defineProperty(p,"useGetAiGenerateStatusMutation",{enumerable:!0,get:function(){return E0}}),Object.defineProperty(p,"useGetBlocksQuery",{enumerable:!0,get:function(){return mC}}),Object.defineProperty(p,"useGetBlocksSchemaQuery",{enumerable:!0,get:function(){return gC}}),Object.defineProperty(p,"useGetCommentsQuery",{enumerable:!0,get:function(){return S0}}),Object.defineProperty(p,"useGetDialogQuery",{enumerable:!0,get:function(){return g0}}),Object.defineProperty(p,"useGetParentEmailBlocksQuery",{enumerable:!0,get:function(){return yC}}),Object.defineProperty(p,"useGetProjectIntegrationsQuery",{enumerable:!0,get:function(){return WO}}),Object.defineProperty(p,"useGetProjectPlanQuery",{enumerable:!0,get:function(){return us}}),Object.defineProperty(p,"useGetProjectQuery",{enumerable:!0,get:function(){return Kw}}),Object.defineProperty(p,"useGetProjectTestRecipientsQuery",{enumerable:!0,get:function(){return YO}}),Object.defineProperty(p,"useGetProjectWebhookQuery",{enumerable:!0,get:function(){return KO}}),Object.defineProperty(p,"useGetSubscriptionsQuery",{enumerable:!0,get:function(){return Zd}}),Object.defineProperty(p,"useGetTemplateBlocksQuery",{enumerable:!0,get:function(){return EC}}),Object.defineProperty(p,"useGetTermsQuery",{enumerable:!0,get:function(){return oI}}),Object.defineProperty(p,"useHeadless",{enumerable:!0,get:function(){return tb}}),Object.defineProperty(p,"useI18n",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(p,"useImageControlRequest",{enumerable:!0,get:function(){return k0}}),Object.defineProperty(p,"useImageControlRequestCollector",{enumerable:!0,get:function(){return L0}}),Object.defineProperty(p,"useImagePicker",{enumerable:!0,get:function(){return yI}}),Object.defineProperty(p,"useIntegratorConfigValue",{enumerable:!0,get:function(){return eb}}),Object.defineProperty(p,"useInterfaceLocale",{enumerable:!0,get:function(){return fC}}),Object.defineProperty(p,"useInvalidateProject",{enumerable:!0,get:function(){return Qw}}),Object.defineProperty(p,"useInvalidateTerms",{enumerable:!0,get:function(){return iI}}),Object.defineProperty(p,"useIsLocaleInited",{enumerable:!0,get:function(){return Eb}}),Object.defineProperty(p,"useIsStandalone",{enumerable:!0,get:function(){return uA}}),Object.defineProperty(p,"useLazyClearAiChatQuery",{enumerable:!0,get:function(){return _0}}),Object.defineProperty(p,"useLazyGetAiImageSSEQuery",{enumerable:!0,get:function(){return gD}}),Object.defineProperty(p,"useLazyGetDialogQuery",{enumerable:!0,get:function(){return y0}}),Object.defineProperty(p,"useLazyGetGeneratedContentQuery",{enumerable:!0,get:function(){return b0}}),Object.defineProperty(p,"useLazyGetImageInfoQuery",{enumerable:!0,get:function(){return dD}}),Object.defineProperty(p,"useLazyGetIntegrationCredentialsQuery",{enumerable:!0,get:function(){return QO}}),Object.defineProperty(p,"useLazyGetLimitsStatsByTypeQuery",{enumerable:!0,get:function(){return HO}}),Object.defineProperty(p,"useLazyGetMeQuery",{enumerable:!0,get:function(){return Jd}}),Object.defineProperty(p,"useLazyGetSearchGifQuery",{enumerable:!0,get:function(){return mD}}),Object.defineProperty(p,"useLazyGetSearchImageQuery",{enumerable:!0,get:function(){return fD}}),Object.defineProperty(p,"useLazyGetUnsplashImageQuery",{enumerable:!0,get:function(){return hD}}),Object.defineProperty(p,"useLazySendAiImageRequestQuery",{enumerable:!0,get:function(){return pD}}),Object.defineProperty(p,"useListenPostMessage",{enumerable:!0,get:function(){return ip}}),Object.defineProperty(p,"useMessageService",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(p,"useModalRootElement",{enumerable:!0,get:function(){return bb}}),Object.defineProperty(p,"useModel",{enumerable:!0,get:function(){return MT}}),Object.defineProperty(p,"useNotification",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(p,"useNotifyCommand",{enumerable:!0,get:function(){return cC}}),Object.defineProperty(p,"useOpenEmail",{enumerable:!0,get:function(){return tD}}),Object.defineProperty(p,"useOpenEmailId",{enumerable:!0,get:function(){return Bf}}),Object.defineProperty(p,"useOpenPlanCatalog",{enumerable:!0,get:function(){return cM}}),Object.defineProperty(p,"usePlanFeatureGate",{enumerable:!0,get:function(){return lT}}),Object.defineProperty(p,"usePlanFeatureLocks",{enumerable:!0,get:function(){return uT}}),Object.defineProperty(p,"usePrevious",{enumerable:!0,get:function(){return df}}),Object.defineProperty(p,"useProjectData",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(p,"useProjectPlanLimitPreflight",{enumerable:!0,get:function(){return zT}}),Object.defineProperty(p,"useProjectPlanLimits",{enumerable:!0,get:function(){return HT}}),Object.defineProperty(p,"usePushToDataLayer",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(p,"usePutProjectTestRecipientsMutation",{enumerable:!0,get:function(){return XO}}),Object.defineProperty(p,"useRestClient",{enumerable:!0,get:function(){return rD}}),Object.defineProperty(p,"useRootElement",{enumerable:!0,get:function(){return _b}}),Object.defineProperty(p,"useRouteEmailId",{enumerable:!0,get:function(){return pO}}),Object.defineProperty(p,"useRouteParams",{enumerable:!0,get:function(){return qo}}),Object.defineProperty(p,"useRoutePathname",{enumerable:!0,get:function(){return lE}}),Object.defineProperty(p,"useSelector",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(p,"useSendLivePreviewMutation",{enumerable:!0,get:function(){return FM}}),Object.defineProperty(p,"useSendMessageMutation",{enumerable:!0,get:function(){return m0}}),Object.defineProperty(p,"useSendPostMessage",{enumerable:!0,get:function(){return yb}}),Object.defineProperty(p,"useSendPostMessageEx",{enumerable:!0,get:function(){return vb}}),Object.defineProperty(p,"useSendShortLinkMutation",{enumerable:!0,get:function(){return LM}}),Object.defineProperty(p,"useSendTestEmailMutation",{enumerable:!0,get:function(){return jM}}),Object.defineProperty(p,"useServices",{enumerable:!0,get:function(){return V_}}),Object.defineProperty(p,"useStorageProvider",{enumerable:!0,get:function(){return nD}}),Object.defineProperty(p,"useStore",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(p,"useUploadImageMutation",{enumerable:!0,get:function(){return DM}}),Object.defineProperty(p,"userSlice",{enumerable:!0,get:function(){return Sm}}),Object.defineProperty(p,"v2ResultOf",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(p,"writeEmailAttributes",{enumerable:!0,get:function(){return Rc}}),Object.defineProperty(p,"writePendingData",{enumerable:!0,get:function(){return la}}),Object.defineProperty(p,"writeSourceReport",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(p,"zipEntryToBlob",{enumerable:!0,get:function(){return nN}}),Object.defineProperty(p,"zipEntryToText",{enumerable:!0,get:function(){return rN}})});
|
|
64
|
-
|
|
65
|
-
__emailmaker__.define("static/core/bd22024c.js",["require","exports","module","static/core/42f90c4f.js","static/core/aea078c0.js","react"],function(j,m,U){const b=j("./42f90c4f.js"),o=j("./aea078c0.js");let _=j("react");function M(e){const t=o.parseISO(e);return isNaN(t)?new Date(e):t}var E=new Map;function v(e){let t=E.get(e);return t||(t={shortDate:new Intl.DateTimeFormat(e,{dateStyle:"short"}),shortTime:new Intl.DateTimeFormat(e,{timeStyle:"short"})},E.set(e,t)),t}var C=(e,t,n=!1)=>{e instanceof Date;const r=new Date,a=e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear();if(n&&a){const s=Math.floor((r-e)/1e3),c=Math.floor(s/60),l=Math.floor(c/60);if(s<60)return t("Just now");if(l>0){const i=c%60;return`${l} ${t("hour","hours",l)} ${i} ${t("minute","minutes",i)}`}else return`${c} ${t("minute","minutes",c)}`}else{const{shortDate:s,shortTime:c}=v(navigator.language);return s.format(e)+" "+c.format(e)}},H=e=>{const t=e.match(/(\(copy\))( \d+)?$/),n=t?.[1],r=t?.[2];return n?r?`${e.slice(0,-r.length)} ${+r.slice(1)+1}`:`${e} 2`:`${e} (copy)`};function w(e,t,n){const r=new Map,a=new RegExp(`(${t})(.*?)(${n})`,"gis");return e=e.replaceAll(a,(s,c,l,i)=>{const u=b.generateUUID();return r.set(u,l),c+u+i}),{escapes:r,html:e}}function D(e,t){let n=[];for(const[r,a]of t){const{escapes:s,html:c}=w(e,r,a);e=c,n.push([r,a,s])}return{escapes:n,html:e}}function N(e,t,n,r){const a=new RegExp(`(${t})(.*?)(${n})`,"gis");return e.replaceAll(a,(s,c,l,i)=>{const u=r.get(l);return typeof u=="string"?c+u+i:s})}function R(e,t){for(const[n,r,a]of t)e=N(e,n,r,a);return e}var O=/<title>([\s\S]*?)<\/title>/gim;function k(e){return e==null?"":String(e).replace(/\s+/g," ").trim()}var $=(e,t)=>{const{escapes:n,html:r}=D(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","-->"]]);let a=r;return a=a.replaceAll(O,(s,c)=>{if(t==null)return s;const l=k(c);return l===k(t)?`<title>${H(l)}</title>`:s}),R(a,n.reverse())};function A(e){let{html:t}=D(e,[["<style.*?>","<\\/style>"],["<script.*?>","<\\/script>"],["<\\!--","-->"]]);return[...t.matchAll(O)].map(n=>k(n[1])).find(n=>!!n)}var L=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,F=()=>{const e=o.useSendPostMessage(),t=o.useRootElement(),n=o.useStore(),{projectId:r}=o.useRouteParams(),a=o.useProjectData();return(0,_.useCallback)(async(s,c,l,i,u)=>{t.querySelectorAll(".block-search__preview").forEach(K=>K.remove());const f=t.querySelector("#iframe-scroll-top"),y=t.querySelector("#iframe-scroll-bottom"),p=t.querySelector("#email_iframe_slot"),S=document.body.getBoundingClientRect().height,h=p.getClientRects()[0];h.top<0&&(f.style.display="block"),h.top+h.height>S&&(y.style.display="block");const I=l==="project"||l==="template"||l==="common"?"block":"structure",T=b.getContainer(n),P=a?.id??r,d=o.buildBlockInsertContext(u,{html:c||"",insertFrom:l,fragmentRole:I,name:i,project:P}),g=await o.runBlockInsertHtmlPipeline(T,{...d});await o.syncBlockCacheAfterInsertPipeline(T,d,g),o.registerBlockInsertPending(g,T);const J=g.project!==void 0&&g.project!==null?String(g.project):String(P??""),B={operation:o.EVENT_TYPES.SANDBOX_BLOCK_INSERT,settings:{blockHTML:g.html||null,targetBlock:null,project:J,type:l,name:g.name??i,blockId:g.id!=null?String(g.id):void 0}};s.dataTransfer.setData("Text",JSON.stringify(B)),e(B)},[e,t,n,r,a])},z=()=>{const e=o.useSendPostMessage(),t=o.useRootElement(),n=o.useStore();return(0,_.useCallback)(async(r,a,s)=>{if(!s(a))return;const c=t.querySelector("#iframe-scroll-top"),l=t.querySelector("#iframe-scroll-bottom"),i=t.querySelector("#email_iframe_slot"),u=document.body.getBoundingClientRect().height,f=i.getClientRects()[0];f.top<0&&(c.style.display="block"),f.top+f.height>u&&(l.style.display="block");const y=b.getContainer(n),p=await o.runElementInsertHtmlPipeline(y,{name:a?.name??"",className:a?.className??"",html:a?.html??""}),S={operation:o.EVENT_TYPES.SANDBOX_ATOM_INSERT,settings:{atomHTML:p.html||null,targetBlock:null,name:p.name??a.name}};r.dataTransfer.setData("Text",JSON.stringify(S)),e(S)},[e,t,n])},q=()=>{const e=o.useSendPostMessage(),t=o.usePushToDataLayer(),{emailId:n,blockId:r,projectId:a}=o.useRouteParams(),s=o.useProjectData(),c=o.useStore();return(0,_.useCallback)(async(l,i,u,f,y)=>{const p=u==="project"||u==="template"||u==="common"?"block":"structure",S=p==="block"?f||u||"block":f||u||"structure",h=p==="block"?"block":"structure",I=b.getContainer(c),T=s?.id??a,P=o.buildBlockInsertContext(y,{html:i||"",insertFrom:u,fragmentRole:h,name:S,project:T}),d=await o.runBlockInsertHtmlPipeline(I,{...P});await o.syncBlockCacheAfterInsertPipeline(I,P,d),o.registerBlockInsertPending(d,I);const g=d.project!==void 0&&d.project!==null?String(d.project):String(T??"");e({operation:o.EVENT_TYPES.SANDBOX_BLOCK_INSERT,action:"insert",settings:{blockHTML:d.html,type:u,name:d.name??S,project:g,blockId:d.id!=null?String(d.id):void 0}}),t({event:"add",action:"add_element_to_email",element_type:p,element_name:S,entity_id:n||r,project_id:s?.id||a})},[e,t,n,r,a,s,c])},V=()=>{const e=o.useSendPostMessage(),t=o.usePushToDataLayer(),{emailId:n,blockId:r,projectId:a}=o.useRouteParams(),s=o.useProjectData(),c=o.useStore();return(0,_.useCallback)(async(l,i)=>{const u=b.getContainer(c),f=await o.runElementInsertHtmlPipeline(u,{name:i?.name??"",className:i?.className??"",html:i?.html??""});e({operation:o.EVENT_TYPES.SANDBOX_ATOM_INSERT,action:"insert",settings:{atomHTML:f.html||null,targetBlock:null,name:f.name??i?.name}}),t({event:"add",action:"add_element_to_email",element_type:"atom",element_name:i.name||"atom",entity_id:n||r,project_id:s?.id||a})},[e,t,n,r,a,s,c])},Y=(e,t)=>{t.success({mask:{closable:!0},centered:!0,title:e("Coming soon"),content:e("The feature is under development."),okText:e("Ok. I'll be waiting"),onOk:()=>{}})},X=()=>{const e=o.useSendPostMessage();return(t,n)=>{e({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,settings:t,type:n})}},G=(e,t="")=>{const n=[];return e&&e._embedded?.["wp:term"]?.filter(r=>!!r.length&&(t?r[0]?.taxonomy===t:!0)).forEach(r=>{const a=r[0].taxonomy;n[a]||(n[a]=[]),n[a]=r.map(s=>({id:s.id,name:s.name,children:s.children})),n[n.length]=n[a]}),t!==""&&n.length?n[t]:n};Object.defineProperty(m,"comingSoonHandler",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(m,"emailValidation",{enumerable:!0,get:function(){return L}}),Object.defineProperty(m,"formatDate",{enumerable:!0,get:function(){return C}}),Object.defineProperty(m,"generateCopyHtml",{enumerable:!0,get:function(){return $}}),Object.defineProperty(m,"generateCopyTitle",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"getTaxonomy",{enumerable:!0,get:function(){return G}}),Object.defineProperty(m,"getTitleFromHtml",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"tryParseISO",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"useDragStartAtomToIframeHandler",{enumerable:!0,get:function(){return z}}),Object.defineProperty(m,"useDragStartBlockToIframeHandler",{enumerable:!0,get:function(){return F}}),Object.defineProperty(m,"useSendStyleToggleToIframe",{enumerable:!0,get:function(){return X}}),Object.defineProperty(m,"useSetHtmlAtomInIframeHandler",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"useSetHtmlElementInIframeHandler",{enumerable:!0,get:function(){return q}})});
|
|
66
|
-
|
|
67
|
-
__emailmaker__.define("static/core/d0e76c33.js",["require","exports","module","static/core/42f90c4f.js","static/core/aea078c0.js"],function(P,b,rt){const $=P("./42f90c4f.js"),l=P("./aea078c0.js");var H=/url(?:\((['|"]?))(.*?\.(png|jpg|gif|jpeg|tiff){1})(?:['|"]?\))/gi;function v(t){return t.arrayBuffer().then(e=>{const i=new Uint8Array(e);let n="";for(let r=0;r<i.length;r++)n+=String.fromCharCode(i[r]);return btoa(n)})}function I(t,e=76){if(t=t.replace(/[\r\n\s]/g,""),!t)return t;const i=[];for(let n=0;n<t.length;n+=e)i.push(t.slice(n,n+e));return i.join(`
|
|
68
|
-
`)}function T(t){return t.replaceAll(/[\\\/:*?"<>|]/g,"_")}async function C(t,e,i,n,r,s,c){const a=[];s&&(s.attachments=a);let u="";typeof r=="function"?u=await U(e,i,n,r,s,c):u=(await l.PromiseAllCatched(Object.keys(r).map(async m=>`\r
|
|
69
|
-
--boundary-string\r
|
|
70
|
-
Content-Type: ${m}\r
|
|
71
|
-
\r
|
|
72
|
-
${await U(e,i,n,r[m],s,c)}\r
|
|
73
|
-
\r
|
|
74
|
-
`))).join("")+"----boundary_string--";const g=[`Subject: ${t}`,"X-Unsent: 1","MIME-Version: 1.0"];if(a.length>0){let m=`\r
|
|
75
|
-
--boundary-related\r
|
|
76
|
-
Content-Type: ${typeof r=="function"?"text/html; charset=utf-8":'multipart/alternative; boundary="boundary-string"'}\r
|
|
77
|
-
\r
|
|
78
|
-
${u}\r
|
|
79
|
-
`;for(const o of a)m+=`\r
|
|
80
|
-
--boundary-related\r
|
|
81
|
-
Content-Type: ${o.mimeType}\r
|
|
82
|
-
Content-Transfer-Encoding: base64\r
|
|
83
|
-
Content-ID: <${o.cid}>\r
|
|
84
|
-
\r
|
|
85
|
-
${o.base64}\r
|
|
86
|
-
`;m+=`\r
|
|
87
|
-
--boundary-related--\r
|
|
88
|
-
`,u=m,g.push('Content-Type: multipart/related; boundary="boundary-related"')}else g.push(`Content-Type: ${typeof r=="function"?"text/html; charset=utf-8":'multipart/alternative; boundary="boundary-string"'}`);return`${g.join(`\r
|
|
89
|
-
`)}\r
|
|
90
|
-
\r
|
|
91
|
-
${u}`}function R(t,e=!0){const i=l.decodeFileNameFromPath(t);return e?T(i):i}function W(t){return!(t.length>8||t.length<1||/[^\x00-\x7F]/.test(t)||/[\\\/:*?"<>|&=%]/.test(t)||!/[a-zA-Z]/.test(t)||/^\d+$/.test(t))}function j(t){const e=l.decodeFileNameFromPath(t),i=e.lastIndexOf("."),n=e.slice(i+1);return i===-1||!W(n)?[T(e),""]:[T(e.slice(0,i)),n]}function q(t){return O(t).then(e=>_(e))}async function D(t,e,i,n){t=l.mapper.getEscapedText(t);const r=l.createIFrame(t,i);try{const s=r.document,c=s.querySelectorAll("tbody");for(const a of c)a.replaceWith(...a.childNodes);s.querySelectorAll("em-replace").forEach(a=>{if(a.hasAttribute("text")&&(a.insertAdjacentHTML("beforebegin",a.getAttribute("text")),a.parentNode.removeChild(a)),a.hasAttribute("src")){const u=a.querySelector("img, amp-img");u?(u.setAttribute("src",a.getAttribute("src")),a.replaceWith(u)):a.replaceWith(...a.childNodes)}});try{await e(r,t)}catch{}t=await r.run()}catch(s){throw s}return l.mapper.getUnescapedText(t,!1,n)}function M(t,e,i){try{if(typeof i=="function"){const n=[];return String.prototype.replace.call(t,e,function(){return n.push(i.apply(void 0,arguments)),""}),l.PromiseAllCatched(n).then(function(r){return String.prototype.replace.call(t,e,function(){return r.shift()})})}else return Promise.resolve(String.prototype.replace.call(t,e,i))}catch(n){return Promise.reject(n)}}async function G(t,e,i=new Map,n){const r=o=>{let p=i.get(o);return p||(p=e(o),i.set(o,p)),p instanceof Promise?p:Promise.resolve(p)};function s(o){return M(o,H,async(p,f="",d)=>`url(${f}${await r(d)}${f})`)}async function c(o){const p=o.getAttribute("style");if(p){const f=await s(p);p!==f&&(o.setAttribute("style",f),n&&n())}}const a=t instanceof Document?t:t.ownerDocument;if(!a)return l.PromiseAllCatched([]);const u=t instanceof Document?t.body??t.documentElement??t:t;if(!u)return l.PromiseAllCatched([]);const g=a.createNodeIterator(u,NodeFilter.SHOW_ALL),m=[];for(;;){const o=g.nextNode();if(o===null)break;if(l.isElement(o)){m.push(c(o));const p=o.getAttribute("background");if(p&&m.push(r(p).then(f=>{o.setAttribute("background",f||p),n&&n()})),l.isImageElement(o)||l.isAMPImageElement(o)){const f=o.getAttribute("src"),d=f&&l.mapper.hasDetectedMappings(f,!0,!0)?f:("src"in o?o.src:"")||f;d&&m.push(r(d).then(y=>{y||(y=d),o.setAttribute("src",y),n&&n()}))}if(l.isStyleElement(o)){const f=o.innerHTML;f&&m.push(s(f).then(d=>{d!==f&&(o.innerHTML=d,n&&n())}))}}else if(l.isComment(o)){const p=l.getConditionalComment(o),f=p?.content;f&&m.push(M(f,/<v:fill.*>/gi,async d=>M(await M(d,/src="([^"]*)"/gi,async(y,h)=>`src="${await r(h)||h}"`),/src='([^']*)'/gi,async(y,h)=>`src='${await r(h)||h}'`)).then(d=>{f!==d&&(o.replaceWith(l.parseFromString(`${p.open}${d}${p.close}`)[0]),n&&n())}))}}return l.PromiseAllCatched(m)}async function N(t,e,i=new Map,n){await G(t,e,i,n)}var it=800;function Z(t){const e=new Map;let i=0;for(;i>=0;)if(i=t.indexOf("<!--",i),i>=0){const n=t.indexOf("-->",i);e.set(t.substring(i,n+3),$.generateUUID()),i=n}return e}function X(t){return!!t&&l.mapper.hasDetectedMappings(t,!0,!0)}function F(t,e){const i=t.indexOf("#"),n=i>=0?t.substring(i+1):"";let r=i>=0?t.substring(0,i):t;const s=r.indexOf("?"),c=s>=0?r.substring(s+1):"";r=s>=0?r.substring(0,s):r;const a=new Map(c.split("&").filter(g=>g.indexOf("=")>=0).map(g=>g.split("=")));let u=c;if(e)for(const g of Object.keys(e))e[g]&&!a.has(g)&&(u=u+(u?"&":"")+`${g}=${e[g]}`);return u===c?t:r+(u?`?${u}`:"")+(n?`#${n}`:"")}function z(t){const e=l.mapper.getDetectedMappings(t,!0,!0).slice().sort((s,c)=>c.range.start-s.range.start),i=[],n=[];let r=t;for(const{range:s}of e){const c=t.substring(s.start,s.end),a=`EMMVAR${$.generateUUID().replace(/-/g,"")}EMMVAR`;i.push(a),n.push({token:a,original:c}),r=r.slice(0,s.start)+a+r.slice(s.end)}return{masked:r,tokens:i,restore:s=>n.reduce((c,{token:a,original:u})=>c.split(a).join(u),s)}}function V(t,e,i,n){if(!/^https?:\/\//i.test(e.trimStart()))return;const{masked:r,tokens:s,restore:c}=z(e),a=r.replace(/^https?:\/\//i,""),u=a.search(/[/?#]/),g=u===-1?a:a.slice(0,u);if(!s.some(p=>g.includes(p))&&t.host===document.location.host)return;const m=F(r,i);if(m===r)return;const o=c(m);o!==e&&(t.setAttribute("href",o),n&&n())}function S(t,e,i){const n=t.getAttribute("href");if(X(n)){V(t,n,e,i);return}let r=t.href;if(r=l.toAbsoluteUrl(r),r&&t.protocol.startsWith("http")){const s=Z(r);if(s.forEach((c,a)=>{r=r.replaceAll(a,c)}),t.host!==document.location.host){const c=F(r,e);c!==r&&(r=c,s.forEach((a,u)=>{r=r.replaceAll(a,u)}),t.setAttribute("href",r),i&&i())}}}async function Q(t,e,i,n,r){let[s,c]=e||[800];return typeof s=="number"&&(s=s+"px"),typeof c=="number"&&(c=c+"px"),t=await D(t,async a=>{const u=a.document;await N(u,m=>l.mapper.getEscapedText(m)!==m?m:l.toAbsoluteUrl(m));const g=u.querySelectorAll("a");for(const m of g)S(m,i);if(n)return n(a)},[s,c],r),t}async function U(t,e,i,n,r,s){let[c,a]=e||[800];return typeof c=="number"&&(c=c+"px"),typeof a=="number"&&(a=a+"px"),t=await D(t,async u=>{const g=u.document;if(await N(g,m=>l.mapper.getEscapedText(m)!==m?m:l.toAbsoluteUrl(m)),u.handleRender(async({contentDocument:m,managedNodeController:o})=>{const p=m.querySelectorAll("*");for(const f of p)if(l.isImageElement(f)){const d=await l.getComputedStyleAsync(f);if(d){const y=parseInt(d.height),h=parseInt(d.width);isNaN(y)||f.setAttribute("height",String(y)),!isNaN(h)&&!f.getAttribute("width")&&f.setAttribute("width",String(h))}o.commit()}else if(l.isTableElement(f)){const d=parseInt(getComputedStyle(f).width);!isNaN(d)&&f.parentElement.tagName!=="BODY"&&f.setAttribute("width",String(d)),o.commit()}else f.tagName==="TD"||f.tagName==="A"&&S(f,i,()=>o.commit())}),r?.embedImagesAsBase64&&r.getImageBlob){const m=r.getImageBlob,o=r.attachments||[];u.handleReadHtml(async p=>{const f=new DOMParser().parseFromString(p.html,"text/html"),d=f.body??f.documentElement;if(!d)return;await N(d,async h=>{if(l.mapper.getEscapedText(h)!==h)return h;const w=h.trim();if(!w||/^cid:/i.test(w))return h;if(w.startsWith("data:")){const A=/^data:([^;]+);base64,(.+)$/i.exec(w);if(A){const E=`img-${$.generateUUID()}@emailmaker`;return o.push({cid:E,mimeType:A[1]||"application/octet-stream",base64:I(A[2])}),`cid:${E}`}return h}const x=l.toAbsoluteUrl(h);if(x.startsWith("data:")){const A=/^data:([^;]+);base64,(.+)$/i.exec(x);if(A){const E=`img-${$.generateUUID()}@emailmaker`;return o.push({cid:E,mimeType:A[1]||"application/octet-stream",base64:I(A[2])}),`cid:${E}`}return x}try{const A=await m(x),E=`img-${$.generateUUID()}@emailmaker`,L=await v(A);return o.push({cid:E,mimeType:A.type||"application/octet-stream",base64:I(L)}),`cid:${E}`}catch{return x}});const y=f.documentElement;p.html=y?l.getOuterHtml(y):p.html})}if(n)return n(u)},[c,a],s),t=t.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),t}var Y="images",J=40;function K(){const t=new Date;return`${t.toISOString().slice(2,10).replace(/-/g,"").concat("_",t.toTimeString().slice(0,5).replace(/:/g,""))}_${Array.from({length:8},()=>"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*62))).join("")}`}async function k(t,e,i,n=q,r,s){const c=Object.create(null);let[a,u]=e||[800];typeof a=="number"&&(a=a+"px"),typeof u=="number"&&(u=u+"px");const g=new Set,m=await D(t,async o=>{const p=o.document;await N(p,async d=>{l.mapper.getEscapedText(d)===d&&(d=l.toAbsoluteUrl(d));const y=await n(d);let[h,w]=j(d);if(h.length>J&&(h=K()),!w||!await l.getMimeType(w))try{w=await l.getMimeExtension(y.type)??w}catch{}let x=`${h}.${w}`,A=1;for(;g.has(x);)x=`${h}(${++A}).${w}`;g.add(x);const E=`${Y}/${x}`;return c[E]=y,E});const f=p.querySelectorAll("a");for(const d of f)S(d,i);if(r)return r(o)},[a,u],s);return c["index.html"]=new Blob([m],{type:"text/html;charset=utf-8"}),c}function tt(t){return l.createZip(t)}function O(t){const e=new Image;return e.crossOrigin="anonymous",new Promise((i,n)=>{e.onload=()=>i(e),e.onerror=n,e.src=t})}function _(t,e="image/png",i){const n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),new Promise((r,s)=>n.toBlob(c=>c?r(c):s("blob is null"),e,Number(i)||0))}function et(t,e){do{if(t===e)return!0;t=t.parentNode}while(t);return!1}function B(t){const e=t.ownerDocument?.body;if(e&&et(t,e)){if(l.isElement(t)&&(t.tagName==="IMG"||t.tagName==="SPAN"&&t.classList.contains("preheader")))return"";if(t.nodeName==="#text")return t.textContent}return t.childNodes?[...t.childNodes].map(B).join(""):""}function nt(t){const{document:e}=l.createIFrame(t);try{return B(e).replace(/\u2800/g,"").replace(/(\r\n|\r|\n){2,}/g,`
|
|
92
|
-
`).trim()}catch{return""}}Object.defineProperty(b,"changeHtml",{enumerable:!0,get:function(){return D}}),Object.defineProperty(b,"extractDocumentTextContent",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(b,"getEML",{enumerable:!0,get:function(){return C}}),Object.defineProperty(b,"getFileNameAndExt",{enumerable:!0,get:function(){return j}}),Object.defineProperty(b,"getFileNameWithExt",{enumerable:!0,get:function(){return R}}),Object.defineProperty(b,"getImageByUrl",{enumerable:!0,get:function(){return O}}),Object.defineProperty(b,"htmlFilesToZip",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(b,"htmlToFilesData",{enumerable:!0,get:function(){return k}}),Object.defineProperty(b,"imageToBlob",{enumerable:!0,get:function(){return _}}),Object.defineProperty(b,"prepareHTML",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(b,"replaceImagesInDocument",{enumerable:!0,get:function(){return N}}),Object.defineProperty(b,"sanitizeFileName",{enumerable:!0,get:function(){return T}})});
|
|
93
|
-
|
|
94
|
-
(function(){try{if(typeof document<"u"){var t='html,body{width:100%;height:100%}.blocks-app input::-ms-clear{display:none}.blocks-app input::-ms-reveal{display:none}.blocks-app *,.blocks-app :before,.blocks-app :after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:#0000;font-family:sans-serif;line-height:1.15}.blocks-app [tabindex="-1"]:focus{outline:none}.blocks-app hr{box-sizing:content-box;height:0;overflow:visible}.blocks-app h1,.blocks-app h2,.blocks-app h3,.blocks-app h4,.blocks-app h5,.blocks-app h6{margin-top:0;margin-bottom:.5em;font-weight:500}.blocks-app p{margin-top:0;margin-bottom:1em}.blocks-app abbr[title],.blocks-app abbr[data-original-title]{cursor:help;border-bottom:0;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.blocks-app address{font-style:normal;line-height:inherit;margin-bottom:1em}.blocks-app input[type=text],.blocks-app input[type=password],.blocks-app input[type=number],.blocks-app textarea{-webkit-appearance:none}.blocks-app ol,.blocks-app ul,.blocks-app dl{margin-top:0;margin-bottom:1em}.blocks-app ol ol,.blocks-app ul ul,.blocks-app ol ul,.blocks-app ul ol{margin-bottom:0}.blocks-app dt{font-weight:500}.blocks-app dd{margin-bottom:.5em;margin-left:0}.blocks-app blockquote{margin:0 0 1em}.blocks-app dfn{font-style:italic}.blocks-app b,.blocks-app strong{font-weight:bolder}.blocks-app small{font-size:80%}.blocks-app sub,.blocks-app sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.blocks-app sub{bottom:-.25em}.blocks-app sup{top:-.5em}.blocks-app pre,.blocks-app code,.blocks-app kbd,.blocks-app samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}.blocks-app pre{margin-top:0;margin-bottom:1em;overflow:auto}.blocks-app figure{margin:0 0 1em}.blocks-app img{vertical-align:middle;border-style:none}.blocks-app a,.blocks-app area,.blocks-app button,.blocks-app [role=button],.blocks-app input:not([type=range]),.blocks-app label,.blocks-app select,.blocks-app summary,.blocks-app textarea{touch-action:manipulation}.blocks-app table{border-collapse:collapse}.blocks-app caption{text-align:left;caption-side:bottom;padding-top:.75em;padding-bottom:.3em}.blocks-app input,.blocks-app button,.blocks-app select,.blocks-app optgroup,.blocks-app textarea{color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;margin:0}.blocks-app button,.blocks-app input{overflow:visible}.blocks-app button,.blocks-app select{text-transform:none}.blocks-app button,html [type=button],.blocks-app [type=reset],.blocks-app [type=submit]{-webkit-appearance:button}.blocks-app button::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=button]::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=reset]::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=submit]::-moz-focus-inner{border-style:none;padding:0}.blocks-app input[type=radio],.blocks-app input[type=checkbox]{box-sizing:border-box;padding:0}.blocks-app input[type=date],.blocks-app input[type=time],.blocks-app input[type=datetime-local],.blocks-app input[type=month]{-webkit-appearance:listbox}.blocks-app textarea{resize:vertical;overflow:auto}.blocks-app fieldset{border:0;min-width:0;margin:0;padding:0}.blocks-app legend{width:100%;max-width:100%;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal;margin-bottom:.5em;padding:0;display:block}.blocks-app progress{vertical-align:baseline}.blocks-app [type=number]::-webkit-inner-spin-button{height:auto}.blocks-app [type=number]::-webkit-outer-spin-button{height:auto}.blocks-app [type=search]{outline-offset:-2px;-webkit-appearance:none}.blocks-app [type=search]::-webkit-search-cancel-button{-webkit-appearance:none}.blocks-app [type=search]::-webkit-search-decoration{-webkit-appearance:none}.blocks-app ::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.blocks-app output{display:inline-block}.blocks-app summary{display:list-item}.blocks-app template{display:none}.blocks-app [hidden]{display:none!important}.blocks-app .blocks-plugin{zoom:var(--em-appZoom)}.blocks-app .blocks-plugin .ant-layout-sider-children{display:none}.blocks-app *,.blocks-app ul.ai-roles-list *,.blocks-app .ai-response-variant[class*=ai-response] *,.blocks-app ul.buttons-variants [class*=ai-response]{-webkit-user-select:none;user-select:none}.codicon[class*=codicon-]{font:16px/1 codicon!important}.blocks-app .element-card__title,.blocks-app [class*=ai-response],.blocks-app [class*=ai-response] *,.blocks-app .ant-comment-content-detail{-webkit-user-select:text;user-select:text}.blocks-app .code-mode__pane *{-webkit-user-select:auto;user-select:auto}.blocks-app,.blocks-app .ant-app,.blocks-app .ant-app .main,.blocks-app .ant-app .main__pane-content{height:100%}@media (width<=1300px){.blocks-app .ant-app .main{min-width:1270px}}.blocks-app .ant-app [role=button],.blocks-app .ant-app a,.blocks-app .ant-app area,.blocks-app .ant-app button,.blocks-app .ant-app input:not([type=range]),.blocks-app .ant-app label,.blocks-app .ant-app select,.blocks-app .ant-app summary,.blocks-app .ant-app textarea{touch-action:manipulation}.blocks-app .ant-app ::-webkit-scrollbar{width:10px;height:10px}.blocks-app .ant-app ::-webkit-scrollbar-corner{background:0 0}.blocks-app .ant-app ::-webkit-scrollbar-track{background:0 0}.blocks-app .ant-app ::-webkit-scrollbar-thumb{min-height:20px;box-shadow:inset 0 0 0 10px var(--em-colorFillSecondaryDarken);background-clip:content-box;border:3px solid #0000;border-radius:8px;transition:all .2s}.blocks-app .ant-app ::-webkit-scrollbar-thumb:hover{box-shadow:inset 0 0 0 10px var(--em-colorTextDisabled)}.blocks-app .ant-app textarea::-webkit-scrollbar-track{margin:10px}.blocks-app .ant-app .ant-btn.ant-btn-icon-only .free-mode-firewall-icon,.blocks-app .ant-app .email-pane .ant-tabs-tab .free-mode-firewall-icon,.blocks-app .ant-app .free-mode-firewall-icon{background-color:var(--em-colorBgLayout);border-radius:100%;justify-content:center;display:flex;position:absolute;bottom:0;right:0}.blocks-app .ant-app .email-pane .ant-tabs-tab .free-mode-firewall-icon_emailpane{background-color:var(--em-colorBgContainer);bottom:13px;right:13px}.blocks-app .ant-app .ant-table-wrapper .ant-table{border-radius:calc(var(--em-borderRadiusXL) * 1px);overflow:hidden;background:0 0!important}.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr,.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr>th,.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr>td{background:0 0!important}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,.blocks-app .ant-app .email-pane__content-col .selected-td-form__button:not(.ant-btn-text),.blocks-app .ant-app .email-pane__content-col .ant-btn-default{background:var(--em-colorFillSecondary);border:1px solid #0000!important}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){color:var(--em-colorPrimary);background:var(--em-colorFillSecondary);border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button{min-height:calc(var(--em-formControlHeight) * 1px);min-width:calc(var(--em-formControlHeight) * 1px);padding:0 8px;line-height:1;position:relative}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ant-btn-icon-only .ant-btn-icon{justify-content:center;align-items:center;width:100%;height:100%;display:inline-flex}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ant-btn-icon-only .anticon{vertical-align:0;justify-content:center;align-items:center;line-height:1;display:inline-flex}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ghost-button:before{content:"";z-index:1;cursor:pointer;background-color:#0000;width:385px;height:50px;position:absolute;top:-9px;left:-338px}.blocks-app .ant-app .email-pane__content-col .ant-btn-default:not(:disabled,.ant-btn-disabled,.email-pane__content-col .selected-td-form__button--active):hover{background:var(--em-colorFillSecondaryDarken);color:inherit;border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button--active,.blocks-app .ant-app .email-pane__content-col .ant-btn-default.selected-td-form__button--active{background:var(--em-colorPrimaryBg);color:var(--em-colorPrimary);border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button--active:hover{background:var(--em-colorPrimaryBgHover);color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,.blocks-app .ant-app .email-page .ant-btn{min-width:calc(var(--em-formControlHeight) * 1px);height:calc(var(--em-formControlHeight) * 1px);line-height:calc((var(--em-formControlHeight) - 2) * 1px);text-align:center;padding:0 9px}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper{justify-content:center;align-items:center;padding:0 7px;display:flex}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper>span{display:inline-flex}.blocks-app .ant-app .ant-btn.ant-btn-icon-only.project-page__add-folder{margin-top:26px}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover{color:inherit;background:var(--em-colorFillSecondaryDarken)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper.ant-radio-button-wrapper-checked{background:var(--em-colorPrimaryBg)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper.ant-radio-button-wrapper-checked:hover{background:var(--em-colorPrimaryBgHover);color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-app .email-pane__content-col .ant-form-item{margin-bottom:calc(var(--em-formItemMarginBottomMD) * 1px)}.blocks-app .ant-app .email-pane__content-col .ant-form-item.form-item-margin-xs{margin-bottom:calc(var(--em-formItemMarginBottomXS) * 1px)}.blocks-app .ant-app .selected-td-form__br-input{margin-bottom:8px!important}.blocks-app .ant-app .addon-text-content{font-size:11px;font-weight:600}.blocks-app .ant-app .addon-text-content--icon{align-items:center;font-size:0;line-height:0;display:inline-flex}.blocks-app .ant-app .ant-btn.ant-btn-lg.project-page__folder_menu{text-align:center;width:32px;height:32px;padding:0;line-height:32px}.blocks-app .ant-app .editor .main__pane{overflow:hidden}.blocks-app .ant-app .element-card_block.ant-card-bordered .ant-card-cover .element-card__img-wrapper{background-color:#0000;background-image:linear-gradient(45deg,#0000001a 25%,#0000 0 75%,#0000001a 0),linear-gradient(45deg,#0000001a 25%,#0000 0 75%,#0000001a 0);background-position:0 0,4px 4px;background-repeat:repeat,repeat;background-size:8px 8px;background-attachment:scroll,scroll;background-origin:padding-box,padding-box;background-clip:border-box,border-box}.blocks-app .ant-app .ant-tabs-tabpane{width:100%}.blocks-app .ant-app .ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:18px 0}.blocks-app .ant-app .ant-tabs-content-holder{position:relative}.blocks-app .ant-app #filerobot-editor ::-webkit-scrollbar-thumb{border:none}.blocks-app .ant-app .email-pane__bottom .code-mode__pane{border-top:1px solid var(--em-colorBorder)}.blocks-app .ant-app .container{width:100%;margin:0 auto;padding:0 65px}@media (width<=1550px){.blocks-app .ant-app .container{gap:10px;padding:0 10px}}.blocks-app .ant-app .projects-page__container .container{padding-top:30px}.blocks-app .ant-app .container.email-pane__col-wrapper_pinch{padding-right:0}.blocks-app .ant-app body,.blocks-app .ant-app .ant-layout{transition:background-color .2s ease-in-out}.blocks-app .ant-app p{margin-top:0}.blocks-app .ant-app .ant-layout-content.container{padding-bottom:40px}.blocks-app .ant-app .ant-table-wrapper{width:100%}.blocks-app .ant-app .ant-table{border-radius:16px;overflow:hidden}.blocks-app .ant-app .verticalColorpicker.ant-color-picker .ant-color-picker-inner-content{width:340px}.blocks-app .ant-app .ant-color-picker .ant-color-picker-inner-content .ant-color-picker-panel .ant-color-picker-select .ant-color-picker-palette{min-height:160px}.blocks-app .ant-app .easylogic-colorpicker{border-radius:8px}.blocks-app .ant-app .easylogic-colorpicker .colorpicker-body .color{border-radius:8px 8px 0 0}.blocks-app .ant-app .ant-page-header-heading-title{max-width:700px;white-space:unset;box-shadow:none;align-items:baseline;padding:0;font-size:18px;line-height:24px}.blocks-app .ant-app .ant-page-header-heading-title.ant-typography-edit-content{overflow:unset;margin-top:0}.blocks-app .ant-app .ant-page-header-heading-title textarea{background:0 0;font-size:16px;font-weight:500;line-height:20px}.blocks-app .ant-app .ant-page-header-heading-preheader:disabled,.blocks-app .ant-app .ant-page-header-heading-title:disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;pointer-events:none}.blocks-app .ant-app .ant-menu{background:inherit}.blocks-app .ant-app .ant-page-header{background:inherit;margin-bottom:20px;padding:20px 0}@media (width<=1450px){.blocks-app .ant-app .ant-page-header{padding:10px 0}}.blocks-app .ant-app .ant-page-header-heading-left{margin:0;overflow:visible}.blocks-app .ant-app .ant-page-header-heading-extra{margin:0}.blocks-app .ant-app .ant-page-header-heading-sub-title{display:block;overflow:visible}.blocks-app .ant-app .ant-progress-inner{background-color:#fff}.blocks-app .ant-app .dark .ant-progress-inner{background-color:#ffffff14}.blocks-app .ant-app .ant-collapse>.ant-collapse-item>.ant-collapse-header{flex-direction:row-reverse}.blocks-app .ant-app .ant-tabs-tab{justify-content:center}.blocks-app .ant-app .nobr{white-space:nowrap}.blocks-app .ant-app .checkbox-horizontal .ant-row{flex-direction:row-reverse;justify-content:flex-end;align-items:center}.blocks-app .ant-app .checkbox-horizontal .ant-form-item-control{margin-right:10px;flex-grow:0!important;width:auto!important}.blocks-app .ant-app .checkbox-horizontal .ant-form-item-label{padding:0!important}.blocks-app .ant-app .ant-comment .ant-comment-nested{margin-left:24px}.blocks-app .ant-app .ant-comment .ant-comment-avatar{margin-top:-2px;margin-right:8px;position:relative}.blocks-app .ant-app .ant-comment .ant-comment-avatar img{width:24px;height:24px}.blocks-app .ant-app .ant-comment .ant-comment-inner{background:var(--em-colorBgLayout);border-radius:8px;margin-bottom:12px;padding:12px;display:flex}.blocks-app .ant-app img:not([srcset*=\\.],[src*=\\.],[src*=data\\:image]){display:none}.blocks-app .ant-app .dark .targetted-comment-item>.ant-comment-inner{background:#7030d43b}.blocks-app .ant-app .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before,.blocks-app .blocks-modal .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before{background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--em-colorBorderSecondary);z-index:1;background-position:0 -2px;background-repeat:no-repeat;border-bottom:none;height:20px;bottom:-20px}.blocks-app .ant-app .ant-tabs-top[style*=vh]>.ant-tabs-nav:before,.blocks-app .blocks-modal .ant-tabs-top[style*=vh]>.ant-tabs-nav:before{background:0 0}.dark .blocks-app .ant-app .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before,.dark .blocks-app .blocks-modal .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.blocks-app .ant-app .ant-tabs-top>.ant-tabs-nav,.blocks-app .blocks-modal .ant-tabs-top>.ant-tabs-nav{margin-bottom:20px}.blocks-app .ant-app .ant-tabs.email-pane__col_settings-inner>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .ant-app .ant-tabs.email-pane__col_settings-inner>div>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .blocks-modal .ant-tabs.email-pane__col_settings-inner>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .blocks-modal .ant-tabs.email-pane__col_settings-inner>div>.ant-tabs-nav .ant-tabs-nav-operations{visibility:hidden;pointer-events:none;position:absolute}.blocks-app .transition-enter{opacity:0}.blocks-app .transition-enter-active{opacity:1;transition:opacity .3s ease-in}.blocks-app .transition-exit{opacity:1}.blocks-app .transition-exit-active{opacity:0;transition:opacity .3s ease-in}.blocks-app #carrotquest-messenger-collapsed-container{z-index:10!important}.blocks-app .carrot-messenger-frame-container{z-index:11!important}.blocks-app .default-mode__pane_editor,.blocks-app .code-mode{z-index:20}@media (height<=700px){.blocks-app .ant-color-picker-presets .ant-collapse-item:last-child{display:none}}@media only screen and (device-width<=480px),only screen and (width<=480px){.blocks-app .email-pane_only_code_mode_mobile .email-pane__row .ant-col:first-child{display:none}.blocks-app .email-pane_only_code_mode_mobile .email-pane__row .ant-col:last-child{width:100%!important}}.blocks-app .em-filemanager .uploadProgress{right:105px!important}body{margin:0}.blocks-app .ant-menu-submenu-placement-rightTop:before,.blocks-app .ant-menu-submenu-placement-rightTop:after{display:none!important}.blocks-app .main{overflow:hidden}.blocks-app .main__pane-layout{height:100%;min-height:100%}.blocks-app .main__pane{height:100%;transition:height .2s cubic-bezier(0,0,.2,1);position:relative}.blocks-app .main__pane_editor{z-index:2;box-shadow:0 10px 60px #2223}.blocks-app .main__pane .ant-layout-sider-trigger{flex-direction:column;justify-content:center;display:flex;overflow:hidden}.blocks-app .main__pane-trigger{box-sizing:border-box;justify-content:space-between;align-items:center;gap:8px;width:100%;min-width:0;max-width:100%;display:flex}.blocks-app .main__pane-trigger .anticon{flex-shrink:0}.blocks-app .main__pane-trigger .theme-switcher{flex:auto;min-width:0}.blocks-app .main__pane-trigger_compact{justify-content:center;gap:0}.blocks-app .main__pane-trigger .anticon-menu-unfold,.blocks-app .main__pane-trigger:hover .anticon-menu{display:none}.blocks-app .main__pane-trigger:hover .anticon-menu-unfold,.blocks-app .main__pane-trigger .anticon-menu{display:inline-flex}.blocks-app .main__panes-resizer{position:relative}.blocks-app .main__panes-resizer:before{content:"";background-color:#0000;border-bottom:2px solid #0000;width:100%;height:10px;transition:border-color .2s;position:absolute;bottom:0;left:0;right:0}.blocks-app .main__panes-resizer:hover{cursor:row-resize}.blocks-app .main__panes-resizer:hover:before{border-color:var(--em-colorPrimary)}.blocks-app .main__pane-close-btn{z-index:21;bottom:0;left:50%;transform:translate(-50%)}.blocks-app .main__pane-close-btn.ant-btn{border:0;border-radius:25px 25px 0 0;width:50px;height:25px;padding:0;position:absolute}.blocks-app .main__pane-close-btn .anticon{border-radius:50px 50px 0 0;outline:0 solid #188fff40;align-items:flex-end;height:100%;transition:all .1s cubic-bezier(0,0,.2,1)}.blocks-app .main__pane-close-btn .anticon.show-halo{outline-width:12px}.blocks-app .main__pane-close-btn .anticon.opened{align-items:flex-start;transform:rotate(180deg)}.blocks-app .main__pane-trigger .anticon.anticon-menu-fold{display:inline-flex}.blocks-app .main__pane-trigger.ant-btn{z-index:1;width:100%;height:70px;box-shadow:none;background:0 0;border:0;display:block;position:absolute;top:0;left:0;right:0}.blocks-app .main__pane-trigger.ant-btn:hover,.blocks-app .main__pane-trigger.ant-btn:focus{background:0 0}.blocks-app .main__pane-trigger.ant-btn:empty{visibility:visible;width:100%;display:block}.blocks-app .main__menu{z-index:11;height:100%;position:sticky;top:0}.blocks-app .main__menu .ant-layout-sider-children{box-sizing:border-box;max-height:100vh;overflow:hidden auto}.blocks-app .main__menu>div{border-right:1px solid;border-color:inherit}.blocks-app .main__menu:not(.ant-layout-sider-collapsed){margin-right:-180px;top:0;left:0;box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d}.blocks-app body.dark .main__menu:not(.ant-layout-sider-collapsed){box-shadow:0 3px 6px -4px #0000007a,0 6px 16px #00000052,0 9px 28px 8px #0003}.blocks-app .main__menu.main__menu_lock{box-shadow:none;margin-right:0}.blocks-app body.dark .main__menu.main__menu_lock{box-shadow:none}.blocks-app .main__menu *{text-overflow:unset!important}@media (width<=1400px){.blocks-app .main__menu .ant-layout-sider-zero-width-trigger{z-index:100000;top:50%;text-align:center;visibility:visible;width:20px;height:60px;font-size:16px;inset-inline-start:0;transform:translateY(-30px);box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #0000000f}.blocks-app .main__menu .ant-layout-sider-zero-width-trigger-right{visibility:hidden}}.blocks-app .main__content-wrapper{position:relative}@media (width<=1550px){.blocks-app .main__header{padding:0 20px 0 40px!important}}.blocks-app .ant-layout .ant-layout-sider-trigger{text-align:left;border-bottom:none;padding:0 30px}.blocks-app .ant-app .main__menu:not(.ant-layout-sider-collapsed) .ant-layout-sider-trigger{padding:0 30px}.blocks-app .ant-app .main__menu.ant-layout-sider-collapsed .ant-layout-sider-trigger{padding:0 10px}.blocks-app .ant-layout-sider-light .ant-layout-sider-trigger{background:0 0}.blocks-app .ant-btn.project-menu__block-button{padding:0!important}.blocks-app .selected-element-panel__columns-settings__controls__field{background:var(--em-colorBgElevated);border:calc(var(--em-borderWidth) * 1px) solid var(--em-colorFillSecondaryDarken);transition:all .2s linear .2s}.blocks-app .selected-element-panel__columns-settings__controls__field:hover{border-color:var(--em-borderColorHover)}.blocks-app .selected-element-panel__columns-settings__controls__field:focus,.blocks-app .selected-element-panel__columns-settings__controls__field:focus-within{border-color:var(--em-colorPrimaryBorder);box-shadow:0 0 0 2px #0591ff1a}.blocks-app .selected-element-panel__columns-settings__controls__column.current .selected-element-panel__columns-settings__controls__field{background:var(--em-colorPrimaryBg);border-color:var(--em-colorPrimaryBorder)}.blocks-app .structures{margin-left:-3px;margin-right:-3px;overflow:visible}.blocks-app .structures__list{margin-bottom:-10px}.blocks-app .structures__item{box-sizing:border-box;cursor:grab;flex-direction:row;justify-content:center;align-items:center;width:100%;min-width:100%;height:50px;margin-bottom:20px;padding:0;display:flex}.blocks-app .structures__item:hover .structures__item-row{background:var(--em-colorFillTertiary);border:#0000;box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.dark .blocks-app .structures__item:hover .structures__item-row{background:var(--em-colorBgSpotlight)}.blocks-app .structures__item-row{background:var(--em-colorFillSecondary);border-radius:calc(var(--em-borderRadius) * 1.2px);width:97%;height:100%;padding:6px 3px;transition:box-shadow .3s,border-color .3s,background-color .3s}.blocks-app .structures__item-col{border-radius:calc(var(--em-borderRadius) * 1px);border:1px solid var(--em-controlItemBgActiveHover);background:var(--em-controlItemBgActive);width:100%;height:100%}.dark .blocks-app .structures__item-col{border-color:var(--em-colorBgElevated);background:var(--em-colorFillTertiary)}.blocks-app .em-dragging-element .structures__item .structures__item-row{background-color:var(--em-controlTmpOutline);box-shadow:none}.dark .blocks-app .em-dragging-element .structures__item .structures__item-row{background:var(--em-controlTmpOutline)}.blocks-app .em-dragging-element .structures__item .structures__item-row .structures__item-col{opacity:0;border-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .em-ghost-element{background-color:var(--em-colorBgContainer);border-radius:calc(var(--em-borderRadiusXL) * 1px)}.blocks-app .em-ghost-element .structures__item-col{opacity:1!important}.dark .blocks-app .em-ghost-element{background:var(--em-colorBgSpotlight)}@media (width<=1550px){.blocks-app .structures__item{margin-bottom:16px}.blocks-app .structures__item:last-child{margin-bottom:20px}}.blocks-app .atoms{overflow:visible}.blocks-app .atoms__list{margin-bottom:20px;transition:opacity .2s}.blocks-app .atoms__item{font:inherit;text-align:center;appearance:none;box-sizing:border-box;border-radius:calc(var(--em-borderRadius) * 1px);width:109px;height:70px;color:var(--em-colorTextSecondary);background:var(--em-colorFillSecondary);border:0;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:5px;display:flex;position:relative}.blocks-app .atoms__item.ant-card-hoverable{cursor:grab!important}.blocks-app .atoms__item:hover{border-color:var(--em-colorBgElevated)}.dark .blocks-app .atoms__item:hover{border-color:var(--em-colorTextDisabled);background:var(--em-colorBorder)}.blocks-app .atoms__item_inactive{opacity:.5;cursor:default}.blocks-app .atoms__item_inactive:hover{border-color:var(--em-colorBorder)}.blocks-app .atoms__item_locked .atom-image{opacity:.55;margin-bottom:6px;display:inline-flex;position:relative}.blocks-app .atoms__item_locked .atom-image__lock{opacity:1;background-color:var(--em-colorBgContainer);border-radius:100%;position:absolute;bottom:-2px;right:-6px}.blocks-app .atoms__item_locked .atom-title{opacity:.55}.blocks-app .atoms__item.ai:before{content:"AI";color:#fff;background-color:var(--em-colorInfo);text-align:center;border-radius:0 calc(var(--em-borderRadius) * 1px) 0 calc(var(--em-borderRadiusSM) * 1px);width:36px;padding:1px 5px;font-size:12px;line-height:1.2;display:inline-block;position:absolute;top:0;right:0}.blocks-app .atoms__item.amp:before{content:"AMP";color:#fff;background-color:var(--em-colorPrimary);text-align:center;border-radius:0 8px 0 5px;width:36px;padding:1px 5px;font-size:12px;line-height:1.2;display:inline-block;position:absolute;top:0;right:0}.blocks-app .atoms .anticon{color:var(--em-colorTextSecondary);font-size:28px}.blocks-app .atoms .em-dragging-element .atoms__item{background-color:var(--em-controlTmpOutline)}.blocks-app .atoms .em-ghost-element{background-color:var(--em-colorBgContainer)!important;border:1px solid var(--em-colorBorder)!important}.blocks-app .atoms .atom-title{color:var(--em-colorTextTertiary);text-align:center;font-size:13px;line-height:1}.blocks-app #email_iframe{vertical-align:top;background-color:#f8f8f8;border:0;width:1px;min-width:100%}.blocks-app .iframe-provider+#email_iframe_slot{pointer-events:none}.blocks-app .iframe-provider{width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .browser-extension-warning-modal__footer,.blocks-app .browser-translate-warning-modal__footer{justify-content:center;margin-top:24px;display:flex}.blocks-app .email-pane{position:relative}.blocks-app .email-pane__loader{z-index:10;background-color:#fff6;width:100%;height:100%;position:fixed;top:0;left:0}.dark .blocks-app .email-pane__loader{background-color:#0006}.blocks-app .email-pane__paths{border-top:1px solid var(--em-colorBorder);z-index:10;background-color:var(--em-colorBgContainer);justify-content:space-between;align-items:center;width:100%;transition:all .5s;display:flex;position:sticky;bottom:0;left:0}.blocks-app .email-pane__paths>div{color:var(--em-colorTextTertiary);padding:3px 15px}.blocks-app .email-pane__paths .ant-breadcrumb{white-space:nowrap;overflow:auto hidden}.blocks-app .email-pane__paths .ant-breadcrumb ol{flex-wrap:nowrap;padding-right:10px}.blocks-app .email-pane__paths .ant-breadcrumb li{position:relative}.blocks-app .email-pane__paths .ant-breadcrumb li:hover>span{color:var(--em-colorPrimary)}.blocks-app .email-pane__paths .ant-breadcrumb li>span{color:var(--em-colorTextSecondary);cursor:pointer;padding:3px 15px;display:block}.blocks-app .email-pane__paths .ant-breadcrumb li>span span{align-items:center;gap:4px;display:flex}.blocks-app .email-pane__paths .ant-breadcrumb li:after{content:"";border-style:solid;border-width:15px 0 15px 10px;border-color:transparent transparent transparent var(--em-colorBgContainer);width:0;height:0;transition:all .5s;position:absolute;top:50%;right:-5px;transform:translateY(-50%)}.blocks-app .email-pane__paths .ant-breadcrumb li:before{content:"";border-style:solid;border-width:15px 0 15px 10px;border-color:transparent transparent transparent var(--em-colorBorder);width:0;height:0;transition:all .5s;position:absolute;top:50%;right:-6px;transform:translateY(-50%)}.blocks-app .email-pane__code-size{white-space:nowrap;margin-left:auto;padding:3px 15px;font-size:14px}.blocks-app .email-pane__code-size_exceeded{color:var(--em-colorError)}.blocks-app .email-pane .ant-btn-primary.mobile_view{background-color:var(--em-colorInfo)}.blocks-app .email-pane .ant-btn-primary.mobile_view:hover{background-color:var(--em-colorInfoHover)}.blocks-app .email-pane .ant-tabs .ant-tabs-tab-btn{transition:none}.blocks-app .email-pane .ant-tabs-extra-content{justify-content:center;align-items:center;display:flex}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode{margin-top:22px;transform:rotate(90deg)}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-label{min-height:40px;padding:0;line-height:40px}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-icon{width:28px;height:40px;display:inline-block;transform:rotate(-90deg)}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-icon .anticon{position:relative}.blocks-app .email-pane .email-pane_code-mode .email-pane__col-wrapper{transition:all .5s;padding-top:0!important}.blocks-app .blocks-plugin .email-pane .email-pane_code-mode .email-pane__resizable{padding-top:60px;transition:all .5s}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__col-wrapper{padding-top:0!important}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__left .email-pane__content-col_main{border-width:0;border-radius:0;margin-left:0;margin-right:0;border-top-width:0!important;border-bottom-width:0!important;border-right-width:0!important}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__right .email-pane__content-col_main{border-width:0;border-radius:0;margin-left:0;margin-right:0;border-top-width:0!important;border-bottom-width:0!important;border-left-width:0!important}.blocks-app .blocks-plugin .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__resizable{max-width:calc(100% - 2px);margin-bottom:0;padding-top:0}.blocks-app .email-pane .selected-td-form__padding-input .ant-input-number-focused input{text-align:left}.blocks-app .email-pane .selected-td-form__padding-input input{text-align:center}.blocks-app .email-pane .email-pane__comment-counter{background-color:var(--em-colorInfo);color:var(--em-colorWhite);border:none}.blocks-app .email-pane .element-controls{width:100%;height:100%}.blocks-app .email-pane #selected_element_form_desktop_props{height:100%}.blocks-app .email-pane .ant-tabs .ant-divider-horizontal.selected-td-form__divider{border-top:1px solid var(--em-colorBorderSecondary);background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);width:calc(100% + 50px);margin:26px -23px}.dark .blocks-app .email-pane .ant-tabs .ant-divider-horizontal.selected-td-form__divider{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.blocks-app .email-pane .ant-tabs .element-controls .selected-td-form__divider{margin-top:0;margin-bottom:0}.blocks-app .email-pane .ant-tabs .blocks-search__divider{pointer-events:none;width:auto;height:20px;margin:24px 0 0;position:absolute;bottom:-20px;left:-24px;right:-13px}.blocks-app .email-pane .ant-tabs ::-webkit-scrollbar-thumb{box-shadow:inset 0 0 0 10px var(--em-colorFillSecondary)}.blocks-app .email-pane .ant-tabs ::-webkit-scrollbar-thumb:hover{box-shadow:inset 0 0 0 10px var(--em-colorFill)}.blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow{height:100%;position:relative}.blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow:after{content:"";background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);z-index:1;width:calc(100% + 48px);height:20px;margin-left:-24px;position:absolute;top:0;left:0}.blocks-app .email-pane .ant-tabs .blocks-search__empty-wrapper{height:calc(100% + 10px);margin:0 -24px;padding:24px 14px 0 24px;position:relative;overflow:scroll}.blocks-app .email-pane__container{scroll-behavior:smooth;min-height:100%;padding-top:0}.blocks-app .email-pane_code-mode .email-pane__container{overflow:unset;height:unset;padding-bottom:0;position:relative}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel{z-index:101;pointer-events:none;height:0;position:absolute;inset:0 0 auto}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel>div{pointer-events:auto}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel .selected-element-panel-content.selected-element-panel__content_abs{width:fit-content;max-width:calc(100% - 24px);min-height:auto;display:block}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel .selected-element-panel-content.selected-element-panel__content_abs form.element-controls{height:auto;min-height:auto}.blocks-app .email-pane__col-wrapper{flex-wrap:nowrap;gap:30px;display:flex;position:relative}.blocks-app .email-pane__col-wrapper .email-pane__col_settings{margin-top:30px}.blocks-app .email-pane__col-wrapper .email-pane__col_settings-inner{border-radius:8px;position:sticky;top:30px;left:0}.blocks-app .ant-app .email-pane__col-wrapper_reverse{flex-direction:row-reverse}.blocks-app .email-pane .email-pane__sizeSwitcher:not(.email-pane__pinch,.email-pane__right) .email-pane__col-wrapper{top:-114px}.blocks-app .email-pane_code-mode .email-pane__code-divider{z-index:10;opacity:0;cursor:ew-resize;background-color:var(--em-colorPrimary);width:5px;height:100%;transition:opacity .4s;position:absolute}.blocks-app .email-pane_code-mode .email-pane__code-divider:hover,.blocks-app .email-pane_code-mode .email-pane__code-divider:active{opacity:1;background-color:var(--em-colorPrimary)}.blocks-app .email-pane_code-mode.email-pane .email-pane__row:not(.email-pane__bottom,.email-pane__sizeSwitcher) .email-pane__content-col_main{border-radius:0;border:0 solid var(--em-colorBorder)!important;margin:0!important}.blocks-app .email-pane_code-mode.email-pane .email-pane__row:not(.email-pane__bottom,.email-pane__sizeSwitcher) [class^=device-width__] button{display:none}.blocks-app .email-pane_code-mode .email-pane__left{flex-direction:row}.blocks-app .email-pane_code-mode .email-pane__left>div:first-child{border-right:1px solid var(--em-colorBorder);overflow-y:auto!important}.blocks-app .email-pane_code-mode .email-pane__left .email-pane__handle.left{display:none}.blocks-app .email-pane_code-mode .email-pane__left .email-pane__code-divider{left:-2px}.blocks-app .email-pane_code-mode .email-pane__right{flex-direction:row-reverse}.blocks-app .email-pane_code-mode .email-pane__right>div:first-child{border-left:1px solid var(--em-colorBorder);overflow-y:auto!important}.blocks-app .email-pane_code-mode .email-pane__right .email-pane__handle.right{display:none}.blocks-app .email-pane_code-mode .email-pane__right .email-pane__code-divider{right:-2px}.blocks-app .email-pane_code-mode .email-pane__bottom{max-width:unset;flex-direction:column;margin:0}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__col-wrapper{width:100%;margin:0 auto}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider{opacity:0;cursor:ns-resize;z-index:10;width:100%;height:2px;top:-2px}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider:hover,.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider:active{opacity:1;background-color:var(--em-colorPrimary)}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper{gap:0;height:100%;padding-left:3px}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{overflow-y:scroll;height:100%!important}@media (width<=1590px){.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{overflow-x:hidden}}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .ant-tabs-content-holder{border-radius:0}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper.email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:10px;padding-right:0}.blocks-app .email-pane__left .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper.email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:65px;padding-right:0}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .ant-tabs-right>.ant-tabs-nav .ant-tabs-tab{height:53px;padding-top:6px;padding-left:6px;padding-right:6px}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-right:0}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-left:0;padding-right:35px;overflow:visible}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview .email-pane__content-col.email-pane__content-col_main{border-width:1px}.blocks-app .email-pane .email-pane__left.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-left:65px!important;padding-right:0!important}.blocks-app .email-pane .email-pane__right .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview,.blocks-app .email-pane .email-pane__left.email-pane__sizeSwitcher .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:0!important;padding-right:0!important}.blocks-app .email-pane .email-pane__right:not(.email-pane__pinch) .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0;padding-right:65px}.blocks-app .email-pane .email-pane__right.email-pane__pinch.email-pane__sizeSwitcher .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__right.email-pane__pinch.email-pane__sizeSwitcher .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col_preview{padding-left:0;padding-right:65px}.blocks-app .email-pane .email-pane__reverse .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-top:30px}.blocks-app .email-pane .email-pane__sizeSwitcher .email-pane__col-wrapper_pinch .email-pane__col.email-pane__col_preview{padding:60px 2px 0}.blocks-app .email-pane .email-pane__reverse.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-right:65px}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__right .email-pane__col.email-pane__col_preview,.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__left .email-pane__col.email-pane__col_preview{padding-top:0}.blocks-app .email-pane .email-pane__right .email-pane__col_preview,.blocks-app .email-pane .email-pane__left .email-pane__col_preview{padding-left:0;padding-right:0}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{height:100%!important}.blocks-app .email-pane .email-pane__sizes-panel-wrapper{z-index:5;position:sticky;top:30px;left:15px}.blocks-app .email-pane .email-pane__right .email-pane__sizes-panel-wrapper{left:auto;right:15px}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__sizes-panel-wrapper{display:none}.blocks-app .email-pane .email-pane__pinch .email-pane__sizes-panel-wrapper{position:absolute;top:12px;left:calc(50% - 266px)}.blocks-app .email-pane .email-pane__reverse .email-pane__sizes-panel-wrapper{left:auto;right:calc(50% - 266px)}.blocks-app .email-pane .email-pane__reverse.email-pane__left.email-pane__pinch .email-pane__sizes-panel-wrapper{display:none;left:15px;right:auto}.blocks-app .email-pane .email-pane__sizes-panel{background-color:var(--em-colorBgElevated);border:1px solid var(--em-colorBorder);border-radius:34px}.blocks-app .email-pane__header{padding-right:10px}.blocks-app .email-pane__header .header__left{margin-left:0}.blocks-app .email-pane__header .header__logo{float:left;height:auto;margin-top:5px;margin-right:26px;padding-right:0;font-size:22px!important}.blocks-app .email-pane__header__title{align-items:center;width:100%;display:flex}.blocks-app .email-pane__header__title__project a{white-space:nowrap;text-overflow:ellipsis;flex:1;max-width:190px;display:flex;overflow:hidden}.blocks-app .email-pane__header__title__project{float:left;margin-top:10px}.blocks-app .email-pane__header__title__project a:hover{color:var(--em-colorPrimary)}.blocks-app .email-pane__header__title .ant-typography{white-space:nowrap;text-overflow:ellipsis;flex:1;margin:10px 0 10px 20px;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__row{flex-wrap:nowrap;justify-content:space-between;gap:30px;height:100%;position:relative}.blocks-app .email-pane_path-enabled .email-pane__row{height:calc(100% - 29px)}.blocks-app .email-pane_code-mode .email-pane__row{gap:0;height:calc(100% - 29px);padding:0}.blocks-app .email-pane__col_settings{border-color:var(--em-colorBorder);height:100%;margin-right:50px;position:sticky;top:0;bottom:60px;overflow:visible}.blocks-app .email-pane__col_disabled.email-pane__content-col_tabs.email-pane__content-col{width:68px;min-width:68px;margin-right:0}.blocks-app .email-pane__col_settings-inner{height:100%;max-height:100%;margin-right:0}.blocks-app .email-pane__col_settings-inner_reverse{flex-direction:row-reverse}.blocks-app .email-pane__col_settings-inner_reverse .email-pane__tab-bar.ant-tabs-nav{margin-left:0;margin-right:8px}.blocks-app .email-pane__col_settings-inner_reverse .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-btn>span{line-height:1}.blocks-app .email-pane__col .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-btn>span{height:24px;margin-right:0;font-size:20px}.blocks-app .email-pane__col-wrapper_pinch .email-pane__col .email-pane__tab-bar.ant-tabs-nav{border-left:1px solid var(--em-colorBorderSecondary);background:var(--em-colorBgContainer)}.blocks-app .email-pane__reverse .email-pane__col-wrapper_pinch .email-pane__col .email-pane__tab-bar.ant-tabs-nav{border-left:none}.blocks-app .email-pane__col .email-pane__col_settings-inner_reverse{border-right:1px solid var(--em-colorBorder)}.blocks-app .email-pane_view .email-pane__col{height:calc(100vh - 48px);top:0;bottom:0;overflow:auto}.blocks-app .email-pane__col_settings{height:calc(100vh - 76px);position:sticky;top:10px;bottom:60px;overflow:auto}.blocks-app .email-pane_view .email-pane__col_settings{height:calc(100vh - 48px)}.blocks-app .email-pane__col_settings-collapsed{flex:0 0;max-width:0}.blocks-app .email-pane__col_preview{scroll-behavior:smooth}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__col_preview{overflow:auto;width:100%!important}.blocks-app .email-pane__col_preview-collapsed{flex:0 0 100%;width:100%;max-width:100%}.blocks-app .email-pane__col_settings{z-index:11;height:100%;position:sticky;top:20px;bottom:60px;overflow:visible}.blocks-app .email-pane__col_settings-inner{height:100%;max-height:100%}.blocks-app .email-pane__col_menu{margin-left:20px}.blocks-app .email-pane__col .ant-modal-close{top:14px;width:34px;height:34px;font-size:16px;position:absolute;inset-inline-end:12px;padding:0!important}.blocks-app .email-pane__col_code-mode .ant-menu-vertical.element-preview-menu__list_discuss li.ant-menu-item{text-align:center}.blocks-app .email-pane__col__alert{z-index:100;width:40%;max-width:400px;bottom:40px;left:10px;position:absolute!important}.blocks-app .email-pane__collapse-wrapper{background-color:var(--em-colorBgContainer);border:1px solid var(--em-colorBgContainer);border-radius:calc(var(--em-borderRadiusXL) * 1px);flex-direction:column;align-self:flex-start;height:auto;min-height:0;max-height:100%;display:flex;overflow:hidden}.dark .blocks-app .email-pane__collapse-wrapper{border:1px solid var(--em-colorBorderSecondary)}.blocks-app .email-pane__collapse-wrapper_disabled{display:none}.blocks-app .email-pane__collapse-wrapper>*{min-height:0;max-height:100%}.blocks-app .email-pane__collapse-wrapper .ant-tabs-content-holder{border-radius:0 0 calc(var(--em-borderRadiusXL) * 1px) calc(var(--em-borderRadiusXL) * 1px);border:none;margin:0 -1px -1px;transition:all .3s;overflow:hidden}.blocks-app .email-pane__collapse-wrapper .selected_form-mobile-props-title,.blocks-app .email-pane__collapse-wrapper .selected_form-desktop-props-title{opacity:0;will-change:transform, height;padding-top:0;transition:height .45s cubic-bezier(.16,1,.3,1),margin-top .45s cubic-bezier(.16,1,.3,1),transform .45s cubic-bezier(.16,1,.3,1),opacity .3s ease-out;transform:translateY(-100%)}@keyframes em-mobile-props-title-slide-in{0%{opacity:0;height:0;transform:translateY(-100%)}to{opacity:1;height:32px;transform:translateY(0)}}.blocks-app .email-pane__collapse-wrapper #selected_element_form_desktop_props{transition:all .1s}.blocks-app .email-pane__collapse-wrapper .selected_form-props-wrapper_optimize{padding-top:0}.blocks-app .ant-app .email-pane__collapse-wrapper .selected_form-mobile-props-title,.blocks-app .ant-app .email-pane__collapse-wrapper .selected_form-desktop-props-title{background-color:var(--em-colorInfoBg);border:none;border-radius:0;height:0;padding:0 24px;top:0;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body{border:1px solid var(--em-colorInfo);border-radius:0 0 calc(var(--em-borderRadius) * 2px) calc(var(--em-borderRadius) * 2px);scrollbar-gutter:auto;flex-direction:column;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body-content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body-content>div{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .ant-tabs .ant-tabs-ink-bar{background:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .email-properties__collapse:after{display:none}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel-content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel{flex-direction:column;flex:1;min-height:0;padding-left:0;padding-right:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel>div{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties form.element-controls{flex-direction:column;height:100%;min-height:0;display:flex}.blocks-app .email-pane__collapse-wrapper.mobile-properties #selected_element_form_desktop_props{min-height:0;padding:24px var(--em-panel-form-padding-x,24px) 0;flex:1;overflow:hidden auto}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-wrapper{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-header{flex-shrink:0}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props{scrollbar-gutter:stable;flex:1;min-height:0;overflow:hidden auto}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel__float-blocks-settings{display:none}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-desktop-props-title{opacity:1;height:32px;animation:.45s cubic-bezier(.16,1,.3,1) both em-mobile-props-title-slide-in;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-title{z-index:1;border:none;border-bottom:1px solid var(--em-colorBorderSecondary);background-color:var(--em-colorInfoBg);padding:5px 24px;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-view .ant-tabs-tab:first-child:hover{color:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-view .selected_form-mobile-props-title{opacity:1;height:32px;animation:.45s cubic-bezier(.16,1,.3,1) both em-mobile-props-title-slide-in;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-view .selected_form-mobile-props-title .ant-alert-title{color:var(--em-colorInfoText)}.blocks-app .email-pane__collapse-wrapper_build{flex:1;align-self:stretch;height:100%}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse{flex:1;min-height:0}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder{flex:1;min-height:0;display:flex}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder>.ant-tabs-content{height:100%;min-height:0}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane-active{flex-direction:column;flex:1;min-height:0;display:flex}.blocks-app .email-pane__col-wrapper_pinch .email-pane__collapse-wrapper{border:none;border-left:1px solid var(--em-colorBorder);border-radius:0;height:100%}.blocks-app .email-pane__collapse{flex-direction:column;flex:1;width:100%;height:100%;min-height:0;max-height:100%;display:flex;overflow:hidden}.blocks-app .email-pane__collapse.ant-collapse{border:0}.blocks-app .email-pane__collapse-panel.ant-collapse-item{min-height:50px;overflow:hidden}.blocks-app .email-pane__comment-counter{border-radius:10px;width:27px;height:16px;margin:5px;padding:0 6px;font-size:12px}.blocks-app .email-pane__add-new-element-btn{width:100%;margin-bottom:60px}.blocks-app .email-pane__tab-bar.ant-tabs-nav{z-index:1;width:60px;margin-bottom:0;margin-left:8px;margin-right:0;top:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-active{border-radius:8px;border-right:none!important}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tabpane,.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-left:0}.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list{background:var(--em-colorBgContainer);border-radius:8px;flex:none;padding:0 0 4px;box-shadow:0 2px 10px #0500380a}.blocks-app .email-pane__col-wrapper_pinch .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list{box-shadow:none;border-radius:0;height:100%}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-wrap{overflow:unset;flex:none}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder{border-left:none;margin-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane{padding-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:first-child,.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:nth-child(2),.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:nth-child(3){display:none}.blocks-app .email-pane__col-wrapper_pinch .email-pane__tab-bar.ant-tabs-nav{margin-left:0;margin-right:0}.blocks-app .email-pane .ant-tabs-right>.ant-tabs-content-holder,.blocks-app .email-pane .ant-tabs-right>div>.ant-tabs-content-holder{border-right:none;margin-right:0}.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab{border:1px solid #0000;height:60px;padding:14px 24px}@media (width<=1550px){.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab{height:50px}}.blocks-app .email-pane .ant-collapse-panel{box-sizing:content-box;height:calc(100% - 50px);margin-top:-1px;overflow:auto}.blocks-app .email-pane .ant-tabs-content{height:100%;max-height:100%}.blocks-app .email-pane .ant-collapse-body,.blocks-app .email-pane .secondary-tabs .ant-tabs-content{height:100%;padding-bottom:0;position:relative;overflow:hidden scroll}.blocks-app .email-pane__comment-counter{position:absolute;top:-4px;right:0}@media (width<=1550px){.blocks-app .email-pane__comment-counter{right:-5px}}.blocks-app .email-pane__content-col_disable{pointer-events:none}.blocks-app .email-pane .header__project{vertical-align:middle;align-items:center;height:28px;padding-top:0;display:inline-flex}.blocks-app .email-pane .header__project .ant-avatar.ant-avatar-circle{min-width:28px}.blocks-app .email-pane_view .header__project{pointer-events:none}.blocks-app .email-pane__pane{height:100%;transition:height .2s cubic-bezier(0,0,.2,1);position:relative}.blocks-app .email-pane__panes{height:calc(100vh - 48px);display:flex;overflow:auto}.blocks-app .email-pane__panes-resizer{z-index:2;position:relative}.blocks-app .email-pane__panes-resizer:before{content:"";background-color:#0000;border-left:2px solid #0000;width:10px;height:100%;transition:border-color .2s;position:absolute;inset:0}.blocks-app .email-pane__panes-resizer:hover{cursor:col-resize}.blocks-app .email-pane__panes-resizer:hover:before{border-color:var(--em-colorPrimary)}.blocks-app .email-pane__footer{z-index:2;border-top:1px solid #d9d9d9;height:28px;display:none;position:relative}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content{height:100%;position:absolute;inset:0;overflow:hidden}.blocks-app .email-pane__pane_main .email-pane:not(.email-pane_view) .email-pane__pane-content{overflow:auto}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content .email-pane__pane_editor{height:100%;overflow:visible}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content .email-pane__pane_editor .email-pane__pane-content{height:100%}.blocks-app .email-pane__buttons{text-align:right}.blocks-app .email-pane__buttons .ant-space.ant-space-horizontal.ant-space-align-center{display:flex}.blocks-app .email-pane__buttons button{width:46px;height:24px;margin-left:8px;padding:0}.blocks-app .email-pane__iframe-scroll-bottom,.blocks-app .email-pane__iframe-scroll-top{z-index:10;width:100%;height:50px;display:none;position:sticky;left:0;right:0}.blocks-app .email-pane__iframe-scroll-top{margin-bottom:-50px;top:0}.blocks-app .email-pane__iframe-scroll-bottom{margin-top:-50px;bottom:0}.blocks-app .email-pane__list{border:none;line-height:20px}.blocks-app .email-pane__list.ant-menu-horizontal>.ant-menu-item{padding:0 14px}.blocks-app .email-pane__list.ant-menu-horizontal>.ant-menu-item:after{content:none}.blocks-app .email-pane__list-item_active{color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-menu-item .email-pane__list-item-icon.anticon{font-size:20px}.blocks-app .email-pane__list-item:hover .email-pane__list-item-icon.anticon,.blocks-app .email-pane__list-item_active.ant-menu-item .email-pane__list-item-icon.anticon{color:var(--em-colorPrimaryTextHover)}.blocks-app .email-pane__list-item.ant-menu-item.ant-menu-item-selected,.blocks-app .email-pane__list-item.ant-menu-item-disabled:hover .email-pane__list-item-icon.anticon{color:inherit}.blocks-app .email-pane__content-col.email-pane__content-col_menu{min-width:462px;margin-left:0}.blocks-app .email-pane__content-col_menu-left{margin-right:10px}.blocks-app .email-pane__code-mode{margin-top:10px;display:flex}.blocks-app .email-pane__code-mode .email-pane__panes{width:100%}.blocks-app .email-pane__code-mode .email-pane__panes+.email-pane__content-col.email-pane__content-col_menu,.blocks-app .email-pane__code-mode .email-pane__content-col.email-pane__content-col_menu:not(.email-pane__content-col_menu-right){width:60px;min-width:60px;margin-top:5px;margin-left:10px;margin-right:10px}.blocks-app .email-pane__code-mode .email-pane__content-col.email-pane__content-col_menu.email-pane__content-col_menu-right{width:50px;min-width:50px;margin-top:5px;margin-left:10px;margin-right:10px}.blocks-app .email-pane__col_code-mode{top:0}.blocks-app .email-pane__comments-icon-wrapper{text-align:center;cursor:pointer;width:50px;height:60px;margin-right:5px;padding:13px 21px;position:relative}.blocks-app .email-pane__comments-icon-wrapper:hover{color:#999da0}.blocks-app .email-pane__comment-counter{color:#000000d9;width:auto;min-width:28px;height:18px;text-shadow:none;border:1px solid #fff;border-radius:10px;margin:5px;padding:0 6px;font-size:12px;position:absolute;top:-8px;right:-10px}.blocks-app body.dark .email-pane__comment-counter{color:#f0f0f0;border-color:#1f1f1f}.blocks-app .email-pane__col-wrapper_pinch .email-pane__comment-counter{right:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tabpane,.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-left:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-right:0}.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{z-index:1;margin-top:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab .ant-tabs-tab-btn{background:0 0;border-radius:6px;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{background:var(--em-controlItemBgActive)}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list .ant-tabs-ink-bar{box-sizing:border-box;background:#fff;border:none;border-radius:6px;width:60px;margin:0 2px;display:none;box-shadow:0 2px 8px -2px #0000000d,0 1px 4px -1px #00000012,0 0 1px #00000014}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder{border-left:none;width:397px;margin-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane{padding-left:0;padding-right:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:first-child{display:none}.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.blocks-app .email-pane .ant-tabs-right>.ant-tabs-nav .ant-tabs-tab{border:none;height:56px;padding:4px 4px 0}.blocks-app .email-pane .ant-tabs-tab .anticon{margin-right:0;font-size:20px}.blocks-app .email-pane__code-mode:not(.email-pane__col_preview-collapsed){padding-left:60px}.blocks-app .email-pane__content-col_tabs.email-pane__content-col{margin-left:0;margin-right:0;transition:all .3s cubic-bezier(.075,.82,.165,1);top:30px}@media (width<=1350px){.blocks-app .email-pane__content-col_tabs.email-pane__content-col{transform-origin:0 0;transform:scale(.83)}}.blocks-app .email-pane__col-wrapper_pinch .email-pane__content-col_tabs.email-pane__content-col{margin-top:0;top:0;height:100%!important}.blocks-app .email-pane .email-pane__col-wrapper_pinch .blocks-search__empty-wrapper{height:calc(100% - 30px)}.blocks-app .email-pane__col_preview-collapsed{margin-left:70px}.blocks-app .email-pane .email-pane__content-col_main{border:1px solid var(--em-colorBorder);border-radius:calc(var(--em-borderRadiusXL) * 1px);margin-left:-2px;margin-right:-2px;transition:border-color .4s;overflow:hidden auto}.blocks-app .email-pane .secondary-tabs.secondary-tabs_unset_scroll .ant-tabs-nav:after{display:none}.blocks-app .email-pane .secondary-tabs.secondary-tabs_unset_scroll .ant-tabs-content{overflow-y:hidden;padding-top:0!important;padding-right:24px!important}.blocks-app .email-pane__col.email-pane__col_preview{flex-direction:column;justify-content:flex-start;align-items:center;max-width:1600px;margin:0;padding:0 2px;display:flex}.blocks-app .email-pane__sizes{border:1px solid var(--em-colorBorder);z-index:10;opacity:.9;border-top:none;border-radius:0 0 8px 8px;justify-content:center;width:100%;height:15px;min-height:15px;margin-bottom:15px;transition:all .5s;display:flex;position:sticky;top:0;left:0}.blocks-app .email-pane__sizes:hover{opacity:1}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__sizes{border-width:0;height:0;min-height:0;margin-bottom:0}.blocks-app .email-pane__sizes .email-pane__width-selectors-wrapper{justify-content:center;width:100%;display:flex}.blocks-app .email-pane__sizes .device-width__theme{border-right:1px solid var(--em-colorBorder);background-color:var(--em-colorBgElevated);flex-shrink:0;width:36px;transition:all .3s;position:relative}.blocks-app .email-pane__sizes .device-width__theme .email-pane__theme-toggle{margin:0}.blocks-app .email-pane__sizes .device-width__theme-placeholder{flex-shrink:0;width:36px;cursor:default!important}.blocks-app .email-pane__sizes [class^=device-width__]{border-right:1px solid var(--em-colorBorder);background-color:var(--em-colorBgElevated);cursor:pointer;transition:all .3s;position:relative}.blocks-app .email-pane__sizes [class^=device-width__]:first-child{border-bottom-left-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .email-pane__sizes [class^=device-width__]:last-child{border-bottom-right-radius:calc(var(--em-borderRadius) * 1px);border:none}.blocks-app .ant-app .email-pane__sizes [class^=device-width__] button{color:var(--em-colorTextDescription);width:24px;min-width:24px;height:24px;line-height:1}.blocks-app .ant-app .email-pane__sizes [class^=device-width__] button:hover{background:var(--em-colorPrimaryBg)}.blocks-app .email-pane__sizes .device-width__320{text-align:center;color:var(--em-colorText);font-size:12px;line-height:15px}.blocks-app .email-pane__sizes.device-width__full-hovered [class^=device-width__],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__768],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__425],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__425],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__375-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__375-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__320-hovered [class*=__320]{background:var(--em-colorPrimaryBg)}.blocks-app .email-pane__resizable{width:100%;margin-bottom:29px;transition:max-width .5s;position:relative}.blocks-app .blocks-plugin .email-pane__resizable{padding:0 2px}.blocks-app .email-pane__resizable_drag{transition:none}.blocks-app .email-pane__resizable .email-pane__handle{box-sizing:border-box;opacity:0;cursor:ew-resize;width:5px;height:100%;transition:opacity .4s;position:absolute}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__resizable .email-pane__handle{pointer-events:none}.blocks-app .email-pane__resizable .email-pane__handle:hover,.blocks-app .email-pane__resizable .email-pane__handle:active{opacity:1}.blocks-app .email-pane__resizable .email-pane__handle.left{left:0}.blocks-app .email-pane__resizable .email-pane__handle.right{right:0}.blocks-app .email-pane__left .email-pane__resizable,.blocks-app .email-pane__right .email-pane__resizable{margin-bottom:0}.blocks-app .email-pane__tooltip{margin-right:20px}.blocks-app .email-pane .ant-layout-content.container.email-pane__container{padding-bottom:0}.blocks-app .email-pane .ant-tabs-tabpane.ant-tabs-tabpane-active.em-analytics__email-tab-build{border-top-left-radius:0}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-nav-list{padding-left:24px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-nav{margin-bottom:0}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-tab .ant-tabs-tab-btn{font-size:14px;font-weight:400}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-tab+.ant-tabs-tab{margin:0 0 0 20px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-content{padding:24px 13px 4px 24px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs.secondary-tabs_optimise .ant-tabs-content{padding:0 25px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs.email-properties__collapse .ant-tabs-content{padding-bottom:0}.blocks-app .email-pane.email-pane_no-element-navigation .ant-tabs-large.secondary-tabs.email-properties__collapse .ant-tabs-content{padding-top:0}.blocks-app .email-pane .email-properties__collapse{position:relative}.blocks-app .email-pane .email-properties__collapse:after{content:"";background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--em-colorBorderSecondary);z-index:1;width:100%;height:20px;position:absolute;top:58px;left:0}.dark .blocks-app .email-pane .email-properties__collapse:after{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.blocks-app .email-pane .ant-tooltip{pointer-events:none}.blocks-app .email-pane__blocks-search{overflow-clip-margin:40px;flex-direction:column;height:calc(100% - 44px);min-height:0;display:flex;overflow:clip}.blocks-app .email-pane__blocks-search label.ant-segmented-item{margin-top:0}.blocks-app .email-pane__blocks-panel,.blocks-app .email-pane__blocks-panel-body{height:100%}.blocks-app .email-pane__blocks-panel-header{flex-shrink:0}.blocks-app .email-pane__blocks-panel-results{display:none}.blocks-app .email-pane__blocks-panel-results_visible{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__blocks-panel_scrollable,.blocks-app .email-pane__blocks-panel_scrollable{overflow-clip-margin:40px;flex-direction:column;flex:1;min-height:0;display:flex;overflow:clip}.blocks-app .email-pane__blocks-panel_scrollable .email-pane__blocks-panel-body{flex-direction:column;flex:1;min-height:0;margin-left:-24px;margin-right:-24px;display:flex;overflow:hidden}.blocks-app .email-pane__blocks-panel_scrollable .blocks-search__empty-shadow{padding-left:24px;padding-right:24px}.blocks-app .email-pane .email-pane__blocks-search .ant-segmented{position:relative;top:-7px}@media screen and (width<=700px){.blocks-app .email-pane_view .email-pane__buttons{display:none}.blocks-app .email-pane__content{margin:0;padding-right:0}.blocks-app .email-pane__content .email-pane__content-col_main{min-width:100%}.blocks-app .email-pane__content .email-pane__content-col_menu{display:none}.blocks-app .email-pane__content .email-pane__content-col_menu+.email-pane__resizer{border-left:none;border-right:2px solid #0000}.blocks-app .email-pane__content .email-pane__content-col_menu+.email-pane__resizer:hover{border-color:var(--em-colorPrimary)}}.blocks-app .ant-menu-vertical.element-preview-menu__list_discuss li.ant-menu-item{text-align:right;padding:0 10px}.blocks-app .ant-tooltip{pointer-events:none}@media (width<=1550px){.blocks-app .email-pane .ant-tabs .secondary-tabs.email-pane__collapse:not(.secondary-tabs_unset_scroll):after{margin-top:44px}}.dark .blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow:after{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.dark .blocks-app .ant-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode{background-color:#121212}.blocks-app .collaborator-list{position:absolute;bottom:30px}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode{width:48px}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode.ant-switch-checked{background:var(--em-controlItemBgActive)}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode.ant-switch-checked .ant-switch-inner-checked{color:var(--em-colorPrimary)}.blocks-app .email-preview-menu__versions .ant-btn,.blocks-app .email-preview-menu__code .ant-btn,.blocks-app .email-preview-menu__preview .ant-btn,.blocks-app .email-preview-menu__test{justify-content:center;align-items:center;display:inline-flex}.blocks-app .email-preview-menu__list-item-icon{align-items:center;display:inline-flex}.blocks-app .email-preview-menu_right{margin-left:auto}.blocks-app .email-preview-menu_new{align-items:center;padding-right:22px;display:flex}.blocks-app .email-preview-menu .email-preview-menu__history *{pointer-events:none}.blocks-app .ant-menu.email-preview-menu__list{border:0}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item{margin-top:0;padding:0 10px}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item_disabled{cursor:not-allowed}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item:hover .ant-menu-item.email-preview-menu__list-item_disabled .anticon.email-preview-menu__list-item-icon{color:inherit}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item a{width:40px;height:40px;margin-left:-10px;display:block}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item a .email-preview-menu__list-item-icon{margin-left:10px}.blocks-app .ant-menu-item .anticon.email-preview-menu__list-item-icon{font-size:20px}.blocks-app .ant-menu-item .anticon.email-preview-menu__list-item-icon_revert{transform:scaleX(-1)}.blocks-app .email-preview-menu__list-item:hover .anticon.email-preview-menu__list-item-icon,.blocks-app .ant-menu-item.email-preview-menu__list-item_active .anticon.email-preview-menu__list-item-icon{color:var(--em-colorPrimaryHover)}.blocks-app .ant-menu-item.ant-menu-item-selected.email-preview-menu__list-item,.blocks-app .ant-menu-item-disabled.email-preview-menu__list-item:hover .anticon.email-preview-menu__list-item-icon{color:inherit}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons{cursor:default;text-align:center;height:auto;margin:0;padding:0}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons .ant-space{display:block}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button{width:40px;height:40px;box-shadow:none;text-shadow:none;background:0 0;border:none;margin-bottom:8px;padding:0;display:block}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button .anticon{font-size:20px;transition:color .3s}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button .anticon :hover{color:var(--em-colorPrimaryHover)}.blocks-app .ant-menu-vertical .email-preview-menu__list__divider{border-top:2px solid var(--em-colorBorder);width:20px;min-width:auto;margin:20px 0}.blocks-app .ant-menu-vertical .email-preview-menu__list__divider.second-devider{margin-left:10px}.blocks-app .code-size-warning-modal .ant-modal-container{padding:32px}.blocks-app .code-size-warning-modal__content{flex-direction:column;display:flex}.blocks-app .code-size-warning-modal__icon{color:var(--em-colorWarning);margin-bottom:16px;font-size:64px}.blocks-app .code-size-warning-modal__icon .anticon{display:block}.blocks-app .code-size-warning-modal__title{color:var(--em-colorText);margin:0 0 12px;font-size:18px;font-weight:600}.blocks-app .code-size-warning-modal__message{color:var(--em-colorTextSecondary);margin-bottom:24px;font-size:14px;line-height:1.6}.blocks-app .code-size-warning-modal__message p{margin:0 0 12px}.blocks-app .code-size-warning-modal__message p:last-child{margin-bottom:0}.blocks-app .code-size-warning-modal__message strong{color:var(--em-colorError);font-weight:600}.blocks-app .code-size-warning-modal__image{width:100%;margin-bottom:24px}.blocks-app .code-size-warning-modal__image-placeholder{border-radius:8px;width:100%;height:200px;display:flex}.blocks-app .code-size-warning-modal__image-placeholder img{object-fit:contain;max-width:100%;max-height:100%}.blocks-app .code-size-warning-modal__actions{width:100%;display:flex}.blocks-app .code-size-warning-modal__actions .ant-btn{min-width:140px}.blocks-app .integration-tile{border:1px solid var(--em-colorBorderSecondary);background:var(--em-colorBgContainer);border-radius:8px;flex-direction:column;min-height:254px;padding:16px;transition:border-color .2s;display:flex}.blocks-app .integration-tile--error{border-color:var(--em-colorError)}.blocks-app .integration-tile__body{flex:1;min-height:0}.blocks-app .integration-tile__icon{object-fit:contain;width:48px;height:48px;margin-bottom:12px}.blocks-app .integration-tile__icon-svg{margin-bottom:12px;font-size:48px;line-height:1}.blocks-app .integration-tile__title{color:var(--em-colorText);margin:0 0 4px;font-size:14px;font-weight:500;line-height:1.3;display:block}.blocks-app .integration-tile__description{color:var(--em-colorTextSecondary);margin:0;font-size:12px;font-weight:300;line-height:1.4;display:block}.blocks-app .integration-tile__footer{justify-content:space-between;align-items:flex-end;gap:8px;min-height:40px;margin-top:16px;display:flex}.blocks-app .integration-tile__badge{white-space:nowrap;border-radius:11px;align-items:center;height:22px;padding:0 8px;font-size:12px;font-weight:400;line-height:1;display:inline-flex}.blocks-app .integration-tile__badge--connected{color:var(--em-colorSuccess);background:var(--em-colorSuccessBg)}.blocks-app .integration-tile__badge--not_connected{color:var(--em-colorTextSecondary);background:var(--em-colorFillTertiary)}.blocks-app .integration-tile__badge--error{color:var(--em-colorError);background:var(--em-colorErrorBg)}.blocks-app .integration-tile__badge--coming_soon{color:var(--em-colorPrimary);background:var(--em-colorPrimaryBg)}.blocks-app .integration-tile__configure.ant-btn{box-sizing:border-box;width:40px;min-width:40px;height:40px;box-shadow:none;background:var(--em-colorFillQuaternary);color:var(--em-colorTextSecondary);border:none;border-radius:6px;flex-direction:row;flex:none;justify-content:center;align-items:center;gap:0;padding:0;display:inline-flex}.blocks-app .integration-tile__configure.ant-btn.ant-btn-icon-only{width:40px;min-width:40px;height:40px;padding:0}.blocks-app .integration-tile__configure.ant-btn .ant-btn-icon{justify-content:center;align-items:center;width:16px;height:16px;margin:0;line-height:0;display:inline-flex}.blocks-app .integration-tile__configure.ant-btn:not(:disabled):hover,.blocks-app .integration-tile__configure.ant-btn:not(:disabled):focus-visible{box-shadow:none;background:var(--em-colorFillTertiary);color:var(--em-colorTextSecondary);border:none}.blocks-app .integration-tile__configure.ant-btn:disabled,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled{cursor:not-allowed;box-shadow:none;opacity:1;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary);border:none}.blocks-app .integration-tile__configure.ant-btn:disabled .ant-btn-icon,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled .ant-btn-icon{color:var(--em-colorTextQuaternary)}.blocks-app .integration-tile__configure.ant-btn:disabled:hover,.blocks-app .integration-tile__configure.ant-btn:disabled:focus-visible,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled:hover,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled:focus-visible{box-shadow:none;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary);border:none}.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only{width:40px;min-width:40px;height:40px;padding:0}.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only:disabled,.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only.ant-btn-disabled{opacity:1;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary)}.blocks-app .em-export-platforms-submenu .ant-dropdown-menu{max-height:420px;overflow-y:auto}.blocks-app .app-logo{color:#000;line-height:1.35;display:inline-block}.blocks-app .app-logo:hover{color:#000}.blocks-app .em-analytics__email-save .ant-btn-loading-icon .anticon,.blocks-app .em-analytics__block-save .ant-btn-loading-icon .anticon{font-size:16px}.blocks-app .main__ribbon{background:var(--em-colorInfo);min-height:43px;color:var(--em-colorTextLightSolid);flex-direction:row;justify-content:center;align-items:center;font-size:16px;display:flex}.blocks-app .main__ribbon button{background:var(--em-colorInfoTextHover)}.blocks-app .main__ribbon button:hover{background:var(--em-colorInfoHover)!important}.blocks-app .main__ribbon .main__ribbon-resend.ant-btn.ant-btn-sm{padding-block:5px;padding-inline:14px}.blocks-app .header{box-sizing:content-box;border-bottom:1px solid;height:70px;min-height:70px}.blocks-app .header_blocks{padding-right:10px}.blocks-app .header_main{z-index:1}.blocks-app .header__container{justify-content:space-between;align-items:center;gap:30px;min-height:70px;transition:opacity .3s;display:flex}.blocks-app .header__logo,.blocks-app .header__project{white-space:nowrap;text-overflow:ellipsis;max-width:220px;display:block;overflow:hidden}.blocks-app .header__logo{padding-top:10px}.blocks-app .header h2,.blocks-app .header h3{margin:0}.blocks-app .header__right{max-height:40px}.blocks-app .header__right .header__action-btn.ant-btn{align-items:center;height:34px;min-height:34px;padding-block:0;display:inline-flex}.blocks-app .header__right .ant-space.ant-space-horizontal.ant-space-align-center{align-items:center;display:flex}.blocks-app .header__right,.blocks-app .header__left{display:flex}.blocks-app .header__left .ant-space,.blocks-app .header__left .ant-space .ant-space-item:last-child{flex-grow:1}.blocks-app .header .project-menu__list-item{cursor:pointer;transition:color .3s}.blocks-app .header .project-menu__list-item:hover{color:#40a9ff}.blocks-app .header .project-menu__list-item svg{width:1.2em;height:1.2em;vertical-align:inherit}.blocks-app .header .project-menu__list-item .anticon-bell svg{width:1.4em;height:1.4em}.blocks-app .header .ant-typography{margin-bottom:0}.blocks-app .foo-title{color:#fff;letter-spacing:1px;background:#9254de;border-radius:3px;margin-top:-10px;margin-left:-4px;padding:0 7px;font-size:13px;font-weight:500;position:absolute}.blocks-app .email-page-header__dropdown-menu{top:10px}.blocks-app .email-page-header__email-id{color:var(--em-colorTextTertiary)}.blocks-app .email-page-header .button{cursor:pointer}.blocks-app .anticon.anticon-edit.email-page-header__icon-edit{color:#8c8c8c;margin-left:6px;font-size:16px}.blocks-app .ant-typography-edit:hover .anticon.anticon-edit.email-page-header__icon-edit{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header-heading{max-width:700px;transition:all .2s;position:relative}.blocks-app .ant-page-header-heading svg{cursor:pointer;opacity:0;justify-content:center;width:0;height:0;transition:all .2s .2s;position:absolute;top:0;right:3px}.blocks-app .ant-page-header-heading svg:hover{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header-heading.focus{background-color:var(--em-colorFillSecondary);border-radius:calc(var(--em-borderRadiusSM) * 1px);padding:0 8px}.blocks-app .ant-page-header-heading.focus svg{opacity:1;width:20px;height:20px;top:3px}.blocks-app .ant-page-header-heading.ant-page-header-heading_preheader.focus svg{top:3px}.blocks-app .ant-page-header-heading_preheader .anticon{top:-2px}.blocks-app .email-page-header .ant-page-header-heading-left{flex-grow:1;overflow:visible}.blocks-app .email-page-header .ant-page-header-back{align-self:flex-start;margin-right:0;padding-top:8px}.blocks-app div.ant-typography-edit-content.ant-page-header-heading-preheader,.blocks-app div.ant-typography-edit-content.ant-page-header-heading-title{margin-top:0;margin-bottom:0;inset-inline-start:0}.blocks-app .header__left .ant-form-item-control-input,.blocks-app .header__left .ant-form-item-control-input-content{line-height:normal;min-height:auto!important}.blocks-app .header__left .ant-page-header-heading-title{white-space:pre-wrap;text-overflow:ellipsis;border-radius:0;flex-grow:1;min-height:auto;font-weight:500;line-height:1;overflow:visible;height:auto!important;padding:3px 20px 3px 0!important}.blocks-app .header__left .ant-page-header-heading-preheader{max-width:700px;min-height:auto;box-shadow:none;text-overflow:ellipsis;white-space:nowrap;border-radius:0;display:block;overflow:hidden;height:auto!important;padding:3px 20px 3px 0!important;line-height:20px!important}.blocks-app .header__left .ant-skeleton.ant-skeleton-element{width:100%;display:block}.blocks-app .ant-page-header-heading-title,.blocks-app .ant-page-header-heading-preheader{background:0 0;padding:0;box-shadow:none!important;border:none!important;transition:none!important}.blocks-app .ant-page-header-heading-preheader{color:var(--em-colorTextSecondary);min-height:auto}.blocks-app .subject_preheader_form__title{width:80px;color:var(--em-colorTextTertiary);white-space:nowrap}.blocks-app .ant-page-header-heading-title{line-height:22px!important}.blocks-app .email-page-header .ant-typography{align-items:center;margin-bottom:0;padding:0 12px;display:flex}.blocks-app .email-page-header .ant-typography-edit-content{margin-top:-10px;padding:0;top:5px;left:auto}.blocks-app .email-page-header .ant-input{font-size:inherit;font-weight:inherit}.blocks-app .email-page-header .ant-page-header-heading-extra>*{margin-left:8px}.blocks-app header .ant-btn.email-page-header__btn_extra{width:32px;padding:0}.blocks-app .update-global-blocks-modal__hint{color:#000000a6;margin-bottom:16px}.blocks-app .update-global-blocks-modal__list{flex-direction:column;gap:12px;max-height:320px;display:flex;overflow-y:auto}.blocks-app .update-global-blocks-modal__row{align-items:center;gap:12px;display:flex}.blocks-app .update-global-blocks-modal__title{flex-direction:column;flex:auto;display:flex;overflow:hidden}.blocks-app .update-global-blocks-modal__version{color:#00000073;font-size:12px}.blocks-app .update-global-blocks-modal__count{color:#00000073;flex:none;font-size:12px}.blocks-app .update-global-blocks-modal__footer{justify-content:flex-end;gap:8px;display:flex}.blocks-app .convert-layout-modal .ant-modal-header{text-align:center;margin-top:16px;margin-bottom:8px}.blocks-app .convert-layout-modal .ant-modal-footer{margin-top:16px;padding:0 8px}.blocks-app .convert-layout-modal__title{color:var(--em-colorText);font-size:20px;font-weight:600}.blocks-app .convert-layout-modal__content{flex-direction:column;align-items:center;gap:24px;display:flex;overflow:hidden}.blocks-app .convert-layout-modal__text{font-size:14px;line-height:1.5}.blocks-app .convert-layout-modal__intro-text{text-align:center;color:var(--em-colorTextSecondary);padding:0 16px}.blocks-app .convert-layout-modal__image{border-radius:8px;width:100%;max-width:100%;height:auto;display:block}.blocks-app .convert-layout-modal__footer{justify-content:flex-end;gap:8px;margin-top:8px;display:flex}.blocks-app .convert-layout-modal__footer--between{justify-content:space-between}.blocks-app .convert-layout-modal__error-details{background-color:var(--em-colorErrorBg,#ff00000f);color:var(--em-colorTextSecondary);word-break:break-word;border-radius:8px;margin-top:12px;padding:8px 12px;font-size:12px}.blocks-app .conversion-overlay{z-index:2000;background-color:var(--em-colorBgMask,#00000073);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.blocks-app .conversion-overlay__content{background-color:var(--em-colorBgElevated);width:360px;max-width:80vw;box-shadow:var(--em-boxShadowSecondary);text-align:center;border-radius:12px;flex-direction:column;align-items:center;gap:16px;padding:32px;display:flex}.blocks-app .conversion-overlay__title{color:var(--em-colorText);font-size:16px;font-weight:600}.blocks-app .conversion-overlay__hint{color:var(--em-colorTextSecondary);font-size:13px}.blocks-app .conversion-overlay__progress{width:100%}@media (width<=1550px){.blocks-app .email-pane__col_settings{margin-left:48px;margin-right:32px}}.blocks-app .em-dragging-element{border-radius:8px}.blocks-app .em-dragging-element>div{box-shadow:none!important}.blocks-app .em-dragging-element .blocks-search__result-html,.blocks-app .em-dragging-element span,.blocks-app .em-dragging-element .atoms__item:before{visibility:hidden}.blocks-app .em-ghost-element.blocks-search__result-html,.blocks-app .em-ghost-element span,.blocks-app .em-ghost-element.atoms__item:before{visibility:visible!important}.blocks-app .em-ghost-element table{border-collapse:initial}',e=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),n=t;if(!e.sheets[n]){var o=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(o=new CSSStyleSheet,o.replaceSync(t))}catch{o=null}if(o){if(!e.host||!e.host.isConnected||!e.host.sheet){var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),document.head.appendChild(a),e.host=a}for(var l=e.host.sheet,i=0;i<o.cssRules.length;i++)try{l.insertRule(o.cssRules[i].cssText,l.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(t),(e.listeners||[]).forEach(function(p){try{p(t)}catch{}})}else{var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),a.appendChild(document.createTextNode(t)),document.head.appendChild(a)}e.sheets[n]=!0,e.order.push(n)}}}catch(p){console.error("vite-plugin-css-injected-by-js",p)}})();
|
|
95
|
-
__emailmaker__.define("core",["require","exports","module","static/core/5dc34752.js","static/core/42f90c4f.js","static/core/aea078c0.js","static/core/bd22024c.js","static/core/d0e76c33.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper","react-dom/client","classnames","dayjs"],function(Ee,an,hv){Object.defineProperties(an,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Gt=Ee("./static/core/5dc34752.js"),h=Ee("./static/core/42f90c4f.js"),r=Ee("./static/core/aea078c0.js"),Pt=Ee("./static/core/bd22024c.js"),gt=Ee("./static/core/d0e76c33.js");let l=Ee("react");l=Gt.__toESM(l);let s=Ee("react/jsx-runtime"),y=Ee("__delivery__/libs"),Ye=Ee("vite/preload-helper"),cl=Ee("react-dom/client"),nt=Ee("classnames");nt=Gt.__toESM(nt);let wn=Ee("dayjs");wn=Gt.__toESM(wn);var dl="Editor mount element was removed from the document. Call instance.destroy() on host unmount.";function ul(){return h.createAbortError(dl)}function ml(e,t,n){if(typeof document>"u")return;let o=!1,i;const a=()=>{o=!0,i?.disconnect(),i=void 0},c=()=>{o||(a(),t())};if(n.addDispose(a),!e.isConnected){queueMicrotask(c);return}i=new MutationObserver(()=>{e.isConnected||c()});let d=e.parentNode;for(;d;)i.observe(d,{childList:!0}),d=d.parentNode}var pl="-host-mount";function fl(){return`data-emailmaker${pl}`}function hl(e,t){Array.from(e.children).forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute(t)&&n.remove()})}function gl(e){const t=fl();hl(e,t);const n=document.createElement("div");n.setAttribute(t,"true"),n.setAttribute("translate","no"),n.classList.add("notranslate"),n.style.display="block",n.style.width="100%",n.style.height="100%",n.style.minHeight="100%";const o=e.querySelector(":scope > [data-canvas-host]");return o?e.insertBefore(n,o):e.appendChild(n),n}function yl(e,t,n){n.addDispose(()=>{t.parentNode===e&&t.remove()})}function zn(e){return t=>{let n=null,o=!1;return{async setOptions(i){if(!n&&!o){n=await e(t);const a=await t.getInstanceAsync(h.INSTANCE_ID);Object.assign(a,n.instance||{})}n.setOptions&&await n.setOptions(i)},instance:{},dispose(){n?.dispose&&n?.dispose(),o=!0}}}}function _l(e){return`__${e.replace(/[^a-zA-Z0-9_]/gu,"_")}_styles__`}var bl=class{shadowRoot;markerAttr;observer;addedKeys=new Set;stopSharedStyles;constructor({shadowRoot:e,markerAttr:t="data-emailmaker"}){this.shadowRoot=e,this.markerAttr=t,this.observer=new MutationObserver(this.handleMutations),this.observer.observe(document.head,{childList:!0,subtree:!1}),this.syncExistingStyles(),this.syncSharedStyles()}syncSharedStyles(){const e=window,t=_l("emailmaker"),n=e[t]??={},o=document.createElement("style");o.setAttribute(this.markerAttr,"shared"),o.textContent=(n.texts??[]).join(`
|
|
96
|
-
`),this.shadowRoot.insertBefore(o,this.shadowRoot.firstChild);const i=c=>{o.appendChild(document.createTextNode(`
|
|
97
|
-
${c}`))},a=n.listeners??=[];a.push(i),this.stopSharedStyles=()=>{const c=a.indexOf(i);c>=0&&a.splice(c,1)}}syncExistingStyles(){const e=document.querySelectorAll(`style[${this.markerAttr}], link[${this.markerAttr}]`);for(let t=e.length-1;t>=0;t--)this.cloneAndInjectNode(e[t])}getNodeKey(e){return e.tagName==="STYLE"?(e.textContent||"").trim():e.tagName==="LINK"?e.href:null}cloneAndInjectNode(e){const t=this.getNodeKey(e);if(!t||this.addedKeys.has(t))return;const n=e.cloneNode(!0);this.shadowRoot.insertBefore(n,this.shadowRoot.firstChild),this.addedKeys.add(t)}handleMutations=e=>{for(const t of e)for(const n of t.addedNodes)n.nodeType===1&&(n instanceof HTMLStyleElement||n instanceof HTMLLinkElement)&&n.hasAttribute(this.markerAttr)&&this.cloneAndInjectNode(n)};dispose(){this.observer.disconnect(),this.stopSharedStyles?.(),this.addedKeys.clear()}};function vl(){let e,t,n=!1;const o=()=>{const i=e;!n||!i||i===t||(t=i,i.handleChunkLoaded?.())};return{use:i=>{e=i,o()},loaded:()=>{n=!0,o()}}}function El({children:e}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)("div",{className:"config-gate-fallback"}),children:e})}var Sl=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),wl=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),kl=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&!/\s/.test(t)},Cl=e=>{let t,n;e==="system"?(t=r.PREFERS_COLOR_SCHEME_LIGHT,n=r.PREFERS_COLOR_SCHEME_DARK):(t=e==="light"?"all":r.NOT_ALL,n=e==="dark"?"all":r.NOT_ALL),[...wl].forEach(o=>{o.media=t}),[...Sl].forEach(o=>{o.media=n})},Tl=(e={})=>{const t=document.querySelector("head"),n=document.createElement("style");if(n.type="text/css",n.dataset.themeVaribalse=!0,n.setAttribute("data-emailmaker","true"),Object.entries(e).length){let o="";Object.entries(e).forEach(([a,c])=>{typeof c!="object"&&(o+=` ${r.themeTokenCssVarName(a)}: ${c};
|
|
98
|
-
`)}),o=`.blocks-body, .blocks-app, .ant-modal-root, .ant-tooltip, .ant-notification {
|
|
99
|
-
${o}}`,n.appendChild(document.createTextNode(o));const i=t.querySelector('[data-theme-varibalse="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}},Il=e=>{if(!kl(e))return;const t=e.trim(),n=document.body;n.classList.contains(t)||setTimeout(()=>{n.classList.remove(t==="dark"?r.LIGHT:r.DARK),n.classList.add(t)},200)},Al=()=>{const e=r.useSendPostMessage();return(0,l.useCallback)(()=>{const t=window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_color_scheme),n=matchMedia("(prefers-color-scheme: dark)").matches?r.DARK:r.LIGHT,o=t||n;e({operation:r.EVENT_TYPES.UPDATE_PREVIEW,theme:o})},[e])},zt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},gv={defaultMerge:zt.defaultMerge};function xl(e,t){return t}function Jo(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:jl(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Pl(e){const t=new Set;for(const n of e)for(const o of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(o);return t}function Rl(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function Zo(e){return{*[Symbol.iterator](){for(const t of e)for(const n of t)yield n}}}var ei=new Set(["[object Object]","[object Module]"]);function jl(e){if(!ei.has(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const n=t.prototype;return!(n===null||typeof n!="object"||!ei.has(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}function Ll(e,t,n){const o={};for(const i of Pl(e)){const a=[];for(const d of e)Rl(d,i)&&a.push(d[i]);if(a.length===0)continue;const c=ni(a,t,t.metaDataUpdater(n,{key:i,parents:e}));c!==zt.skip&&(i==="__proto__"?Object.defineProperty(o,i,{value:c,configurable:!0,enumerable:!0,writable:!0}):o[i]=c)}return o}function Ol(e){return e.flat()}function Ml(e){return new Set(Zo(e))}function Nl(e){return new Map(Zo(e))}function ti(e){return e.at(-1)}var zr=Object.freeze({__proto__:null,mergeArrays:Ol,mergeMaps:Nl,mergeOthers:ti,mergeRecords:Ll,mergeSets:Ml});function Wr(...e){return Dl({})(...e)}function Dl(e,t){const n=Fl(e,o);function o(...i){return ni(i,n,t)}return o}function Fl(e,t){return{defaultMergeFunctions:zr,mergeFunctions:{...zr,...Object.fromEntries(Object.entries(e).filter(([n,o])=>Object.hasOwn(zr,n)).map(([n,o])=>o===!1?[n,ti]:[n,o]))},metaDataUpdater:e.metaDataUpdater??xl,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,actions:zt}}function ni(e,t,n){if(e.length===0)return;if(e.length===1)return Hr(e,t,n);const o=Jo(e[0]);if(o!==0&&o!==5){for(let i=1;i<e.length;i++)if(Jo(e[i])!==o)return Hr(e,t,n)}switch(o){case 1:return Bl(e,t,n);case 2:return Ul(e,t,n);case 3:return $l(e,t,n);case 4:return Gl(e,t,n);default:return Hr(e,t,n)}}function Bl(e,t,n){const o=t.mergeFunctions.mergeRecords(e,t,n);return o===zt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):o}function Ul(e,t,n){const o=t.mergeFunctions.mergeArrays(e,t,n);return o===zt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):o}function $l(e,t,n){const o=t.mergeFunctions.mergeSets(e,t,n);return o===zt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):o}function Gl(e,t,n){const o=t.mergeFunctions.mergeMaps(e,t,n);return o===zt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):o}function Hr(e,t,n){const o=t.mergeFunctions.mergeOthers(e,t,n);return o===zt.defaultMerge||t.useImplicitDefaultMerging&&o===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):o}function zl(e){r.requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||r._typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):new Date(NaN)}function Wl(e){const t=new Map,n=new Set;let o=null,i=null;const a=(d,u)=>{const m={participantId:d.participant.id,acknowledgedVersion:d.acknowledged,documentVersion:e.get().version,error:u};n.forEach(f=>f(m))},c=d=>{if(d.detached)return;const u=e.get().version;if(d.acknowledged===u||d.skipVersion===u)return;if(d.pushing){d.stale=!0;return}d.pushing=!0;const{attributes:m}=e.get(),f=d.participant.applyChanges&&i?.version===u&&d.acknowledged===u-1?i:null;(f?d.participant.applyChanges(f.changes,u,m):d.participant.apply(e.getContent(),u,m)).then(()=>{d.acknowledged=u}).catch(g=>{a(d,g)}).finally(()=>{d.pushing=!1,d.stale&&(d.stale=!1,c(d))})};return e.subscribe(({version:d,changes:u})=>{i=u?.length?{version:d,changes:u}:null,t.forEach(c)}),{attach(d){const u={participant:d,acknowledged:null,pushing:!1,stale:!1,detached:!1,skipVersion:null};return t.set(d.id,u),c(u),{acknowledgedVersion:()=>u.acknowledged,reset(){u.acknowledged=null,u.skipVersion=null,c(u)},detach(){u.detached=!0,t.delete(d.id)}}},setPrimacy(d){o=d},getPrimacy:()=>o,mutateFrom(d,u,m){const f=t.get(d);if(m.echo!==!0&&o!==null&&o!==d)return f?.participant.dropUnsent?.(),null;const g=e.get().version;f&&(f.skipVersion=g+1);const _=e.mutate(u,{source:m.source});return f&&_===g?f.skipVersion=null:f&&(f.acknowledged=_),_},onOutOfSync(d){return n.add(d),()=>n.delete(d)}}}var Hl=({children:e})=>{const[t,n]=(0,l.useState)([]),o=r.useEvent(h.MODAL_SHOW_EVENT),i=r.useEvent(h.MODAL_CLOSE_EVENT),a=r.useEvent(h.MODAL_UPDATE_EVENT),c=r.useModalRootElement(),d=(0,l.useCallback)(g=>{n(_=>g===void 0?[]:_.filter(p=>p.id!==g))},[n]),u=(0,l.useCallback)(g=>{n(_=>{const p=_.find(v=>v.id===g.id);return p?_.map(v=>v===p?{...v,...p}:v):[..._,{...g,visible:!0}]})},[n]),m=(0,l.useCallback)(g=>{n(_=>{const p=_.find(v=>v.id===g.id);return p?_.map(v=>v===p?{...v,...p}:v):_})},[n]),f=(0,l.useCallback)(()=>c,[c]);return(0,l.useEffect)(()=>{const g=new h.Disposable;return g.addDisposable(o(u)),g.addDisposable(a(m)),g.addDisposable(i(d)),()=>g.dispose()},[o,i,a,u,d,m]),(0,s.jsxs)(s.Fragment,{children:[t.map(({id:g,content:_,props:p,visible:v,onOk:C,onClose:k,modalProps:S,...I})=>{const A=()=>d(g),Y=async()=>{C&&await C(),d(g)};return(0,s.jsx)(y.ui_kit$Modal,{open:v,onCancel:A,onOk:Y,afterClose:k,getContainer:f,...S,...I,children:typeof _!="function"?_:l.default.createElement(_,p)},g)}),e]})},ql=new Set;function ri(e){const t=typeof e=="string"&&e?e:void 0;t?window.localStorage.setItem(r.LOCAL_STORAGE_ITEMS.em_color_scheme,t):window.localStorage.removeItem(r.LOCAL_STORAGE_ITEMS.em_color_scheme);for(const n of ql)n(t)}var Vl=[(0,y.ui_kit$createTransformer)()],Yl={colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},Kl={colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderWidth:1,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},Ql=Wr(y.ui_kit$lightThemePreset,{token:Yl}),Xl=Wr(y.ui_kit$darkThemePreset,{token:Kl});function Jl(e){const t=matchMedia(r.PREFERS_COLOR_SCHEME_DARK);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}var Zl=()=>matchMedia("(prefers-color-scheme: dark)").matches?r.DARK:r.LIGHT;function oi(e,t){return e&&e!=="system"?e:t}function ec({children:e}){const t=r.useSelector(r.selectEditorThemeColor$1),n=(0,l.useSyncExternalStore)(Jl,Zl),o=r.useAppConfig(),[i,a]=(0,l.useState)(oi(o.theme,n)),c=r.useDispatch(),d=Al();(0,l.useEffect)(()=>{const C=oi(o.theme,n);a(C),Il(C),c(r.setEditorThemeColor$1(C==="dark"?`vs-${C}`:r.LIGHT)),d()},[t,n,o.theme,o.pathEnabled,c,d]);const u=(0,l.useCallback)(C=>{C&&C!=="system"?(Cl(C),ri(C)):ri(void 0)},[]);(0,l.useEffect)(()=>{const C=o.theme,k=localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_color_scheme);C&&C!==k&&u(C)},[o.theme,u]);const m=(0,l.useCallback)(()=>{const C=localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_color_scheme);u(C)},[u]);(0,l.useEffect)(()=>{m()},[m]);const f=o.themes,[g]=(0,l.useState)(1),_=(0,l.useMemo)(()=>{const C=i==="light"?Ql:Xl,k=f[i],S=k?Wr(C,k):C;return{...S,token:{...S.token,appZoom:g}}},[i,f,g]),p=r.useModalRootElement(),v=(0,l.useCallback)(()=>p,[p]);return(0,s.jsx)(y.ui_kit$ThemeProvider,{theme:_,getPopupContainer:v,children:(0,s.jsx)(y.ui_kit$StyleProvider,{transformers:Vl,children:(0,s.jsx)(Hl,{children:(0,s.jsx)(y.ui_kit$App,{children:(0,s.jsx)(r.ImagePickerProvider,{children:e})})})})})}var tc=({onLoad:e,children:t})=>{(0,l.useEffect)(()=>{e&&e()},[e]);const n=r.useAppDispatch();return(0,l.useEffect)(()=>{n(r.authorizationApi.endpoints.getMe.initiate(""))},[n]),t};function ii({title:e,content:t,acf:{seen:n,type:o,event:i,data:a},...c}){return{...c,seen:n,type:o,event:i,data:a,title:r.getRendererString(e),content:t}}var kn="Notifications",Wn=r.createApi({reducerPath:"notificationsApi",tagTypes:[kn],baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn(t,n){return r.clientFromApi(n).wp.notification_list({author:[Number(t)]}).then(r.transformListResponseFn(ii))},providesTags:t=>t?[...t.map(({id:n})=>({type:kn,id:n})),{type:kn,id:"LIST"}]:[{type:kn,id:"LIST"}]}),notificationShown:e.mutation({queryFn({id:t,datetime:n},o){return r.clientFromApi(o).wp.notification_create2({id:t},{},{type:h.ContentType.Json,extraQuery:{"acf[seen]":n}}).then(r.transformResponseFn(ii))},invalidatesTags:[{type:kn,id:"LIST"}]})})}),{useGetNotificationsQuery:nc,useNotificationShownMutation:rc}=Wn,oc=()=>{const e=r.useCookieManager(),t=r.useContainer(),n=r.useRoutePathname();(0,l.useEffect)(()=>{n.endsWith("/new")||e.remove(r.APP_COOKIES.em_new_email)},[n,e,t])},ic=()=>{const e=r.useCookieManager(),t=r.useRoutePathname();(0,l.useEffect)(()=>{t.endsWith("/new")||e.remove(r.APP_COOKIES.em_new_block)},[t,e])},ai="em_notification_mark_seen_skipped_ids";function si(){try{const e=sessionStorage.getItem(ai),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(String):[]}catch{return[]}}function ac(e){try{const t=String(e),n=new Set(si());n.has(t)||(n.add(t),sessionStorage.setItem(ai,JSON.stringify([...n])))}catch{}}var sc=({children:e=void 0,sider:t=null,modals:n=null,hasEmail:o=!1,hasBlock:i=!1})=>{const{token:a}=(0,y.ui_kit$useToken)(),c=r.useDispatch(),d=r.useSelector(r.selectActiveModal$1),u=r.useCurrentUser();r.useSelector(r.selectIsCodeMode);const m=r.usePushToDataLayer(),[f]=rc(),g=r.useNotification();(0,l.useEffect)(()=>{Tl(a)},[a]);const{data:_=[],isSuccess:p}=nc(u?.id??"",{pollingInterval:3e5,skip:!!d||!u?.id});return(0,l.useEffect)(()=>{const v=_.filter(C=>C.seen===""||C.seen===null);setTimeout(()=>{if(v.length&&p){const C=new Set(si());v.forEach(k=>{if(C.has(String(k.id)))return;k.event==="subscription_payment"&&m({event:"payment",data:k.data}),g[k.type]({title:k.title?.rendered||k.title||"",description:k.content?.rendered||""});const S=new Date().toLocaleString();f({id:k.id,datetime:S}).unwrap().catch(I=>{const A=I&&typeof I=="object"?I:{};(A.data&&typeof A.data=="object"&&A.data!==null&&"code"in A.data?String(A.data.code):void 0)==="em_rest_notification_403"&&ac(k.id)})})}},5e3)},[p,f,_,g]),oc(),ic(),(0,l.useEffect)(()=>{i||c(r.resetBlockSlice()),o||c(r.resetEmailSlice())},[i,o,c]),(0,s.jsx)("div",{className:"main",children:(0,s.jsx)("div",{className:"main__pane main__pane_main",children:(0,s.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe","data-scroll-area":"page",children:(0,s.jsxs)(y.ui_kit$Layout,{className:"main__pane-layout",hasSider:!!t,children:[t,n,e??(0,s.jsx)(r.RouteOutlet,{})]})})})})},lc={toggle:()=>{},set:()=>{},setDirection:()=>{}};function qr(){const e=r.useContainer();return(0,l.useMemo)(()=>e?{toggle:()=>r.toggleCodeMode(e),set:t=>r.setCodeMode$1(e,t),setDirection:t=>r.setCodeModeDirection(e,t)}:lc,[e])}var cc=`
|
|
100
|
-
<style>
|
|
101
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
102
|
-
.em-mob-width-100perc {
|
|
103
|
-
width: 100% !important;
|
|
104
|
-
max-width: 100% !important;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.em-mob-width-91perc {
|
|
108
|
-
width: 91% !important;
|
|
109
|
-
max-width: 91% !important;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
</style>
|
|
113
|
-
<tr em="block" class="em-structure">
|
|
114
|
-
<td align="center">
|
|
115
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
116
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
117
|
-
<![endif]-->
|
|
118
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
119
|
-
<tr>
|
|
120
|
-
<td align="center" valign="top">
|
|
121
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
122
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
123
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
124
|
-
<tr><td width="660" valign="top" align="center"><![endif]-->
|
|
125
|
-
<div style="display: inline-block; width: 100%; max-width: 660px; vertical-align: top;" class="em-mob-width-100perc">
|
|
126
|
-
<table width="602" border="0" cellspacing="0" cellpadding="0" style="width: 91%; max-width: 602px;" class="em-mob-width-91perc">
|
|
127
|
-
<tr>
|
|
128
|
-
<td align="left"></td>
|
|
129
|
-
</tr>
|
|
130
|
-
</table>
|
|
131
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
132
|
-
</div>
|
|
133
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
134
|
-
</td></tr>
|
|
135
|
-
</table><![endif]-->
|
|
136
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
137
|
-
</td>
|
|
138
|
-
</tr>
|
|
139
|
-
</table>
|
|
140
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
141
|
-
</td></tr></table>
|
|
142
|
-
<![endif]-->
|
|
143
|
-
</td>
|
|
144
|
-
</tr>
|
|
145
|
-
|
|
146
|
-
`,dc=`
|
|
147
|
-
<style>
|
|
148
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
149
|
-
.em-mob-width-100perc {
|
|
150
|
-
width: 100% !important;
|
|
151
|
-
max-width: 100% !important;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.em-mob-width-91perc {
|
|
155
|
-
width: 91% !important;
|
|
156
|
-
max-width: 91% !important;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
</style>
|
|
160
|
-
<tr em="block" class="em-structure">
|
|
161
|
-
<td align="center">
|
|
162
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
163
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
164
|
-
<![endif]-->
|
|
165
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
166
|
-
<tr>
|
|
167
|
-
<td align="center" valign="top">
|
|
168
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
169
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
170
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
171
|
-
<tr><td width="207" valign="top" align="center"><![endif]-->
|
|
172
|
-
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
173
|
-
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
174
|
-
<tr>
|
|
175
|
-
<td align="left"></td>
|
|
176
|
-
</tr>
|
|
177
|
-
</table>
|
|
178
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
179
|
-
</div>
|
|
180
|
-
<!--[if (gte mso 9)|(IE)]></td><td width="413" valign="top" align="center"><![endif]-->
|
|
181
|
-
<div style="display: inline-block; width: 413px; vertical-align: top;" class="em-mob-width-100perc">
|
|
182
|
-
<table width="393" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
183
|
-
<tr>
|
|
184
|
-
<td align="left"></td>
|
|
185
|
-
</tr>
|
|
186
|
-
</table>
|
|
187
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
188
|
-
</div>
|
|
189
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
190
|
-
</td></tr>
|
|
191
|
-
</table><![endif]-->
|
|
192
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
193
|
-
</td>
|
|
194
|
-
</tr>
|
|
195
|
-
</table>
|
|
196
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
197
|
-
</td></tr></table>
|
|
198
|
-
<![endif]-->
|
|
199
|
-
</td>
|
|
200
|
-
</tr>
|
|
201
|
-
|
|
202
|
-
`,uc=`
|
|
203
|
-
<style>
|
|
204
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
205
|
-
.em-mob-width-100perc {
|
|
206
|
-
width: 100% !important;
|
|
207
|
-
max-width: 100% !important;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.em-mob-width-91perc {
|
|
211
|
-
width: 91% !important;
|
|
212
|
-
max-width: 91% !important;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
</style>
|
|
216
|
-
<tr em="block" class="em-structure">
|
|
217
|
-
<td align="center">
|
|
218
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
219
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
220
|
-
<![endif]-->
|
|
221
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
222
|
-
<tr>
|
|
223
|
-
<td align="center" valign="top">
|
|
224
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
225
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
226
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
227
|
-
<tr><td width="413" valign="top" align="center"><![endif]-->
|
|
228
|
-
<div style="display: inline-block; width: 413px; vertical-align: top;" class="em-mob-width-100perc">
|
|
229
|
-
<table width="393" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
230
|
-
<tr>
|
|
231
|
-
<td align="left"></td>
|
|
232
|
-
</tr>
|
|
233
|
-
</table>
|
|
234
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
235
|
-
</div>
|
|
236
|
-
<!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]-->
|
|
237
|
-
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
238
|
-
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
239
|
-
<tr>
|
|
240
|
-
<td align="left"></td>
|
|
241
|
-
</tr>
|
|
242
|
-
</table>
|
|
243
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
244
|
-
</div>
|
|
245
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
246
|
-
</td></tr>
|
|
247
|
-
</table><![endif]-->
|
|
248
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
249
|
-
</td>
|
|
250
|
-
</tr>
|
|
251
|
-
</table>
|
|
252
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
253
|
-
</td></tr></table>
|
|
254
|
-
<![endif]-->
|
|
255
|
-
</td>
|
|
256
|
-
</tr>
|
|
257
|
-
|
|
258
|
-
`,mc=`
|
|
259
|
-
<style>
|
|
260
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
261
|
-
.em-mob-width-100perc {
|
|
262
|
-
width: 100% !important;
|
|
263
|
-
max-width: 100% !important;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.em-mob-width-91perc {
|
|
267
|
-
width: 91% !important;
|
|
268
|
-
max-width: 91% !important;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
</style>
|
|
272
|
-
<tr em="block" class="em-structure">
|
|
273
|
-
<td align="center">
|
|
274
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
275
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
276
|
-
<![endif]-->
|
|
277
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
278
|
-
<tr>
|
|
279
|
-
<td align="center" valign="top">
|
|
280
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
281
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
282
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
283
|
-
<tr><td width="311" valign="top" align="center"><![endif]-->
|
|
284
|
-
<div style="display: inline-block; width: 311px; vertical-align: top;" class="em-mob-width-100perc">
|
|
285
|
-
<table width="291" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
286
|
-
<tr>
|
|
287
|
-
<td align="left"></td>
|
|
288
|
-
</tr>
|
|
289
|
-
</table>
|
|
290
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
291
|
-
</div>
|
|
292
|
-
<!--[if (gte mso 9)|(IE)]></td><td width="311" valign="top" align="center"><![endif]-->
|
|
293
|
-
<div style="display: inline-block; width: 311px; vertical-align: top;" class="em-mob-width-100perc">
|
|
294
|
-
<table width="291" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
295
|
-
<tr>
|
|
296
|
-
<td align="left"></td>
|
|
297
|
-
</tr>
|
|
298
|
-
</table>
|
|
299
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
300
|
-
</div>
|
|
301
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
302
|
-
</td></tr>
|
|
303
|
-
</table><![endif]-->
|
|
304
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
305
|
-
</td>
|
|
306
|
-
</tr>
|
|
307
|
-
</table>
|
|
308
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
309
|
-
</td></tr></table>
|
|
310
|
-
<![endif]-->
|
|
311
|
-
</td>
|
|
312
|
-
</tr>
|
|
313
|
-
|
|
314
|
-
`,pc=`
|
|
315
|
-
<style>
|
|
316
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
317
|
-
.em-mob-width-100perc {
|
|
318
|
-
width: 100% !important;
|
|
319
|
-
max-width: 100% !important;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.em-mob-width-91perc {
|
|
323
|
-
width: 91% !important;
|
|
324
|
-
max-width: 91% !important;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
</style>
|
|
328
|
-
<tr em="block" class="em-structure">
|
|
329
|
-
<td align="center">
|
|
330
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
331
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
332
|
-
<![endif]-->
|
|
333
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
334
|
-
<tr>
|
|
335
|
-
<td align="center" valign="top">
|
|
336
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
337
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
338
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
339
|
-
<tr><td width="207" valign="top" align="center"><![endif]-->
|
|
340
|
-
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
341
|
-
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
342
|
-
<tr>
|
|
343
|
-
<td align="left"></td>
|
|
344
|
-
</tr>
|
|
345
|
-
</table>
|
|
346
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
347
|
-
</div>
|
|
348
|
-
<!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]-->
|
|
349
|
-
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
350
|
-
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
351
|
-
<tr>
|
|
352
|
-
<td align="left"></td>
|
|
353
|
-
</tr>
|
|
354
|
-
</table>
|
|
355
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
356
|
-
</div>
|
|
357
|
-
<!--[if (gte mso 9)|(IE)]></td><td width="207" valign="top" align="center"><![endif]-->
|
|
358
|
-
<div style="display: inline-block; width: 207px; vertical-align: top;" class="em-mob-width-100perc">
|
|
359
|
-
<table width="187" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
360
|
-
<tr>
|
|
361
|
-
<td align="left"></td>
|
|
362
|
-
</tr>
|
|
363
|
-
</table>
|
|
364
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
365
|
-
</div>
|
|
366
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
367
|
-
</td></tr>
|
|
368
|
-
</table><![endif]-->
|
|
369
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
370
|
-
</td>
|
|
371
|
-
</tr>
|
|
372
|
-
</table>
|
|
373
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
374
|
-
</td></tr></table>
|
|
375
|
-
<![endif]-->
|
|
376
|
-
</td>
|
|
377
|
-
</tr>
|
|
378
|
-
|
|
379
|
-
`,fc=`
|
|
380
|
-
<style>
|
|
381
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
382
|
-
.em-mob-width-100perc {
|
|
383
|
-
width: 100% !important;
|
|
384
|
-
max-width: 100% !important;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
.em-mob-width-91perc {
|
|
388
|
-
width: 91% !important;
|
|
389
|
-
max-width: 91% !important;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
</style>
|
|
393
|
-
<tr em="block" class="em-structure">
|
|
394
|
-
<td align="center">
|
|
395
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
396
|
-
<table cellpadding="0" cellspacing="0" border="0" width="660"><tr><td>
|
|
397
|
-
<![endif]-->
|
|
398
|
-
<table align="center" width="100%" border="0" cellspacing="0" cellpadding="0" style="max-width: 660px;">
|
|
399
|
-
<tr>
|
|
400
|
-
<td align="center" valign="top">
|
|
401
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="30"></td></tr></table>
|
|
402
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
403
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
404
|
-
<tr><td width="310" valign="top" align="center"><![endif]-->
|
|
405
|
-
<div style="display: inline-block; width: 310px; vertical-align: top;" class="em-mob-width-100perc">
|
|
406
|
-
<table width="290" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
407
|
-
<tr>
|
|
408
|
-
<td align="left"></td>
|
|
409
|
-
<td width="20"> </td>
|
|
410
|
-
<td align="left"></td>
|
|
411
|
-
</tr>
|
|
412
|
-
</table>
|
|
413
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
414
|
-
</div>
|
|
415
|
-
<!--[if (gte mso 9)|(IE)]></td><td width="310" valign="top" align="center"><![endif]-->
|
|
416
|
-
<div style="display: inline-block; width: 310px; vertical-align: top;" class="em-mob-width-100perc">
|
|
417
|
-
<table width="290" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
418
|
-
<tr>
|
|
419
|
-
<td align="left"></td>
|
|
420
|
-
<td width="20"> </td>
|
|
421
|
-
<td align="left"></td>
|
|
422
|
-
</tr>
|
|
423
|
-
</table>
|
|
424
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
425
|
-
</div>
|
|
426
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
427
|
-
</td></tr>
|
|
428
|
-
</table><![endif]-->
|
|
429
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="10"></td></tr></table>
|
|
430
|
-
</td>
|
|
431
|
-
</tr>
|
|
432
|
-
</table>
|
|
433
|
-
<!--[if (gte mso 9)|(IE)]>
|
|
434
|
-
</td></tr></table>
|
|
435
|
-
<![endif]-->
|
|
436
|
-
</td>
|
|
437
|
-
</tr>
|
|
438
|
-
|
|
439
|
-
`,li=[{sizeArray:[24],name:"column-one",html:cc},{sizeArray:[12,12],name:"column-two-50",html:mc},{sizeArray:[8,8,8],name:"column-three",html:pc},{sizeArray:[6,6,6,6],name:"column-four",html:fc},{sizeArray:[8,16],name:"column-two-33",html:dc},{sizeArray:[16,8],name:"column-two-66",html:uc}],ci=()=>{const e=Pt.useSetHtmlElementInIframeHandler(),t=Pt.useDragStartBlockToIframeHandler();return(0,s.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,s.jsx)("div",{className:"structures__list",children:(0,s.jsx)("div",{children:li&&li.map(n=>(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"structures__item",draggable:!0,onClick:o=>e(o,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),onDragStart:o=>t(o,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),children:(0,s.jsx)(y.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:n.sizeArray.map((o,i)=>(0,s.jsx)(y.ui_kit$Col,{span:o,children:(0,s.jsx)("div",{className:"structures__item-col"})},n.name+i))})})},n.name))})})})};ci.propTypes={};var hc=`<style em="styles">
|
|
440
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
441
|
-
.em-mob-width-100perc {
|
|
442
|
-
width: 100%!important;
|
|
443
|
-
max-width: 100%!important;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
.em-mob-wrap {
|
|
447
|
-
display: block!important;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.em-mob-padding_right-20 {
|
|
451
|
-
padding-right: 20px!important;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.em-mob-padding_left-20 {
|
|
455
|
-
padding-left: 20px!important;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
</style>
|
|
459
|
-
<tr em="block" class="em-structure">
|
|
460
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
461
|
-
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
462
|
-
<tr>
|
|
463
|
-
<td width="580" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
464
|
-
</tr>
|
|
465
|
-
</table>
|
|
466
|
-
</td>
|
|
467
|
-
</tr>`,gc=`<style em="styles">
|
|
468
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
469
|
-
.em-mob-width-100perc {
|
|
470
|
-
width: 100%!important;
|
|
471
|
-
max-width: 100%!important;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.em-mob-wrap {
|
|
475
|
-
display: block!important;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
.em-mob-padding_right-20 {
|
|
479
|
-
padding-right: 20px!important;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
.em-mob-padding_left-20 {
|
|
483
|
-
padding-left: 20px!important;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.em-mob-height-20px {
|
|
487
|
-
height: 20px!important;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
</style>
|
|
491
|
-
<tr em="block" class="em-structure">
|
|
492
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
493
|
-
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
494
|
-
<tr>
|
|
495
|
-
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
496
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
497
|
-
<td width="380" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
498
|
-
</tr>
|
|
499
|
-
</table>
|
|
500
|
-
</td>
|
|
501
|
-
</tr>`,yc=`<style em="styles">
|
|
502
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
503
|
-
.em-mob-width-100perc {
|
|
504
|
-
width: 100%!important;
|
|
505
|
-
max-width: 100%!important;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.em-mob-wrap {
|
|
509
|
-
display: block!important;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
.em-mob-padding_right-20 {
|
|
513
|
-
padding-right: 20px!important;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
.em-mob-padding_left-20 {
|
|
517
|
-
padding-left: 20px!important;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
.em-mob-height-20px {
|
|
521
|
-
height: 20px!important;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
</style>
|
|
525
|
-
<tr em="block" class="em-structure">
|
|
526
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
527
|
-
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
528
|
-
<tr>
|
|
529
|
-
<td width="380" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
530
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
531
|
-
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
532
|
-
</tr>
|
|
533
|
-
</table>
|
|
534
|
-
</td>
|
|
535
|
-
</tr>`,_c=`<style em="styles">
|
|
536
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
537
|
-
.em-mob-width-100perc {
|
|
538
|
-
width: 100%!important;
|
|
539
|
-
max-width: 100%!important;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.em-mob-wrap {
|
|
543
|
-
display: block!important;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
.em-mob-padding_right-20 {
|
|
547
|
-
padding-right: 20px!important;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
.em-mob-padding_left-20 {
|
|
551
|
-
padding-left: 20px!important;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.em-mob-height-20px {
|
|
555
|
-
height: 20px!important;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
</style>
|
|
559
|
-
<tr em="block" class="em-structure">
|
|
560
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
561
|
-
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
562
|
-
<tr>
|
|
563
|
-
<td width="280" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
564
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
565
|
-
<td width="280" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
566
|
-
</tr>
|
|
567
|
-
</table>
|
|
568
|
-
</td>
|
|
569
|
-
</tr>`,bc=`<style em="styles">
|
|
570
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
571
|
-
.em-mob-width-100perc {
|
|
572
|
-
width: 100%!important;
|
|
573
|
-
max-width: 100%!important;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.em-mob-wrap {
|
|
577
|
-
display: block!important;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.em-mob-padding_right-20 {
|
|
581
|
-
padding-right: 20px!important;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
.em-mob-padding_left-20 {
|
|
585
|
-
padding-left: 20px!important;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
.em-mob-height-20px {
|
|
589
|
-
height: 20px!important;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
</style>
|
|
593
|
-
<tr em="block" class="em-structure">
|
|
594
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
595
|
-
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
596
|
-
<tr>
|
|
597
|
-
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
598
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
599
|
-
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
600
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
601
|
-
<td width="180" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
602
|
-
</tr>
|
|
603
|
-
</table>
|
|
604
|
-
</td>
|
|
605
|
-
</tr>`,vc=`<style em="styles">
|
|
606
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
607
|
-
.em-mob-width-100perc {
|
|
608
|
-
width: 100%!important;
|
|
609
|
-
max-width: 100%!important;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
.em-mob-wrap {
|
|
613
|
-
display: block!important;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
.em-mob-padding_right-20 {
|
|
617
|
-
padding-right: 20px!important;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
.em-mob-padding_left-20 {
|
|
621
|
-
padding-left: 20px!important;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.em-mob-height-20px {
|
|
625
|
-
height: 20px!important;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
</style>
|
|
629
|
-
<tr em="block" class="em-structure">
|
|
630
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
631
|
-
<table border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
632
|
-
<tr>
|
|
633
|
-
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
634
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
635
|
-
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
636
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
637
|
-
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
638
|
-
<td width="20" class="em-mob-wrap em-mob-height-20px"></td>
|
|
639
|
-
<td width="130" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>
|
|
640
|
-
</tr>
|
|
641
|
-
</table>
|
|
642
|
-
</td>
|
|
643
|
-
</tr>`,di=[{sizeArray:[24],name:"column-one",html:hc},{sizeArray:[12,12],name:"column-two-50",html:_c},{sizeArray:[8,8,8],name:"column-three",html:bc},{sizeArray:[6,6,6,6],name:"column-four",html:vc},{sizeArray:[8,16],name:"column-two-33",html:gc},{sizeArray:[16,8],name:"column-two-66",html:yc}],ui=()=>{const e=Pt.useSetHtmlElementInIframeHandler(),t=Pt.useDragStartBlockToIframeHandler();return(0,s.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,s.jsx)("div",{className:"structures__list",children:(0,s.jsx)("div",{children:di&&di.map(n=>(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"structures__item",draggable:!0,onClick:o=>e(o,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),onDragStart:o=>t(o,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),children:(0,s.jsx)(y.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:n.sizeArray.map((o,i)=>(0,s.jsx)(y.ui_kit$Col,{span:o,children:(0,s.jsx)("div",{className:"structures__item-col"})},n.name+i))})})},n.name))})})})};ui.propTypes={};var Ec=`<style em="styles">
|
|
644
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
645
|
-
.em-mob-width-100perc {
|
|
646
|
-
width: 100%!important;
|
|
647
|
-
max-width: 100%!important;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
</style>
|
|
651
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
652
|
-
<img src=${__emailmaker__.assetUrl("empty-image.png")} width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />
|
|
653
|
-
</td></tr></table>`,Sc=`<style em="styles">
|
|
654
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
655
|
-
.em-mob-width-100perc {
|
|
656
|
-
width: 100%!important;
|
|
657
|
-
max-width: 100%!important;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
</style>
|
|
661
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
662
|
-
<img class="em-ai-img em-just-inserted" src="${__emailmaker__.assetUrl("ai-image.png")}" width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />
|
|
663
|
-
</td></tr></table>`,wc=({__:e})=>`<style em="styles">
|
|
664
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
665
|
-
.em-mob-width-100perc {
|
|
666
|
-
width: 100%!important;
|
|
667
|
-
max-width: 100%!important;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
</style>
|
|
671
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">
|
|
672
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
673
|
-
</td></tr></table>`,kc=({__:e})=>`<style em="styles">
|
|
674
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
675
|
-
.em-mob-width-100perc {
|
|
676
|
-
width: 100%!important;
|
|
677
|
-
max-width: 100%!important;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
</style>
|
|
681
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 20px 0 10px;">
|
|
682
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 24px; line-height: 32px; color: #333333;"><strong>${e("Header text")}</strong></div>
|
|
683
|
-
</td></tr></table>`,Cc=({__:e})=>`<style em="styles">
|
|
684
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
685
|
-
.em-mob-width-100perc {
|
|
686
|
-
width: 100%!important;
|
|
687
|
-
max-width: 100%!important;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
</style>
|
|
691
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 10px 0;">
|
|
692
|
-
<table cellpadding="0" cellspacing="0" border="0" width="200" class="em-mob-width-100perc">
|
|
693
|
-
<tr>
|
|
694
|
-
<td align="center" valign="middle" height="41" bgcolor="#1C52DC" style="height: 41px; background-color: #1C52DC; border-radius: 5px;">
|
|
695
|
-
<a href="" target="_blank" style="display: block; font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 16px; line-height: 41px; text-decoration: none; white-space: nowrap;">
|
|
696
|
-
${e("Button")}
|
|
697
|
-
</a>
|
|
698
|
-
</td>
|
|
699
|
-
</tr>
|
|
700
|
-
</table>
|
|
701
|
-
</td></tr></table>`,Tc=({__:e})=>`<style em="styles">
|
|
702
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
703
|
-
.em-mob-width-100perc {
|
|
704
|
-
width: 100%!important;
|
|
705
|
-
max-width: 100%!important;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
</style>
|
|
709
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
710
|
-
<table class="em-element-list-ul" cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
711
|
-
<tr>
|
|
712
|
-
<td align="left" valign="top" width="20">
|
|
713
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">•</div>
|
|
714
|
-
</td>
|
|
715
|
-
<td align="left" valign="top" style="padding-bottom: 5px; padding-left: 1px;">
|
|
716
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
717
|
-
</td>
|
|
718
|
-
</tr>
|
|
719
|
-
</table>
|
|
720
|
-
</td></tr></table>`,Ic=({__:e})=>`<style em="styles">
|
|
721
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
722
|
-
.em-mob-width-100perc {
|
|
723
|
-
width: 100%!important;
|
|
724
|
-
max-width: 100%!important;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
</style>
|
|
728
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
729
|
-
<table class="em-element-list-ol" cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
730
|
-
<tr>
|
|
731
|
-
<td align="left" valign="top" width="20">
|
|
732
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">1. </div>
|
|
733
|
-
</td>
|
|
734
|
-
<td align="left" valign="top" style="padding-bottom: 5px; padding-left: 1px;">
|
|
735
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
736
|
-
</td>
|
|
737
|
-
</tr>
|
|
738
|
-
</table>
|
|
739
|
-
</td></tr></table>`,Ac=`<style em="styles">
|
|
740
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
741
|
-
.em-mob-width-100perc {
|
|
742
|
-
width: 100%!important;
|
|
743
|
-
max-width: 100%!important;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
</style>
|
|
747
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="0" style="padding: 20px 0 0; border-top: 1px solid #BFBFBF;"> </td></tr></table>`,xc=`<style em="styles">
|
|
748
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
749
|
-
.em-mob-width-100perc {
|
|
750
|
-
width: 100%!important;
|
|
751
|
-
max-width: 100%!important;
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
</style>
|
|
755
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>`,Pc="https://cdn.useblocks.io/socnets";function Rc(e){let t=String(e??"");for(;t.endsWith("/");)t=t.slice(0,-1);return t}function jc(e){let t=String(e??"");for(;t.startsWith("/");)t=t.slice(1);return t}function Lc(e){return`${Rc(Pc)}/${jc(e)}`}var Oc={telegram:"tg",youtube:"yt",vk:"vk",yandex_zen:"yd",x:"xa",twitter:"tw",instagram:"ig",facebook:"fb",pinterest:"pi",tiktok:"tt",ok:"ok",max:"max",rutube:"rutube",whatsapp:"whatsapp",linkedin:"linkedin",viber:"viber",apple:"apple",dis:"dis",drbl:"drbl",fig:"fig",gh:"gh",ggl:"ggl",mdm:"mdm",rdt:"rdt",sgnl:"sgnl",sc:"sc",sptf:"sptf",tmblr:"tmblr",twitch:"twitch",thrds:"thrds",msngr:"msngr",bs:"bs"};function mi(e,t){return Lc(`${e}${t?"-negative":""}.png`)}function pi(e){return Object.fromEntries(Object.entries(Oc).map(([t,n])=>[t,mi(n,e)]))}var yv=pi(!1),_v=pi(!0),bv=["tg","yt","vk","yd","xa","ig","fb"].map(e=>mi(e,!1)),Mc=r.SOCIAL_ICON_BY_PLATFORM;function fi(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function hi(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=typeof window<"u"&&window.location?.origin?window.location.origin:"";if(!n)return t;try{return new URL(t,n).href}catch{return t}}function Nc(e){return e>0?`<td width="${e}"> </td>`:""}var Dc={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function gi(e){const{iconSize:t,gap:n,align:o}=Dc,i=Math.max(0,Math.round(Number(n)||0)),a=e.length>1;return`<style em="styles">
|
|
756
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
757
|
-
.em-mob-width-100perc {
|
|
758
|
-
width: 100%!important;
|
|
759
|
-
max-width: 100%!important;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
</style>
|
|
763
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"><tr><td align="${o}">
|
|
764
|
-
<table border="0" cellspacing="0" cellpadding="0">
|
|
765
|
-
<tr>${e.map(c=>{const d=hi(c.iconSrc),u=d||hi(Mc[c.platform]);if(!u)return"";const m=fi(c.label),f=fi(c.href||""),g=a?' draggable="true"':"",_=d?" em-custom-icon":"";return`<td em-platform="${c.platform}"${_}${g}><a href="${f}" target="_blank" draggable="false"><img src="${u}" width="${t}" height="${t}" border="0" alt="${m}" draggable="false" style="display:block;" /></a></td>`}).filter(Boolean).reduce((c,d,u)=>(u>0&&c.push(Nc(i)),c.push(d),c),[]).join("")}
|
|
766
|
-
</tr>
|
|
767
|
-
</table>
|
|
768
|
-
</td></tr></table>`}var Fc=gi(r.getDefaultSocialItems()),Bc=({__:e})=>`<style em="styles">
|
|
769
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
770
|
-
.em-mob-width-100perc {
|
|
771
|
-
width: 100%!important;
|
|
772
|
-
max-width: 100%!important;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
</style>
|
|
776
|
-
<table cellpadding="0" cellspacing="0" width="100%" class="em-mob-width-100perc em-element-custom-table" em="atom" style="border: 1px solid #b9b1b1;" align="center">
|
|
777
|
-
<tr>
|
|
778
|
-
<td align="center" valign="top" style="border: 1px solid #b9b1b1;">
|
|
779
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 1</div>
|
|
780
|
-
</td>
|
|
781
|
-
<td align="center" valign="top" style="border: 1px solid #b9b1b1;">
|
|
782
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 2</div>
|
|
783
|
-
</td>
|
|
784
|
-
<td align="center" valign="top" style="border: 1px solid #b9b1b1;">
|
|
785
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 3</div>
|
|
786
|
-
</td>
|
|
787
|
-
</tr>
|
|
788
|
-
</table>`,Uc="https://cdt3.emcdn.ru/rndt",yi=new Date(+new Date+432e6).toISOString(),_i=-new Date().getTimezoneOffset()/60,$c=e=>`${Uc}?locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${yi}&timezone=${_i}&frames=20`,Gc=e=>`<style em="styles">
|
|
789
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
790
|
-
.em-mob-width-100perc {
|
|
791
|
-
width: 100%!important;
|
|
792
|
-
max-width: 100%!important;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
</style>
|
|
796
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td align="center"><img class="em-countdown" em-cd-settings="locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${yi}&timezone=${_i}&frames=20" src="${$c(e)}" border="0" alt="" style="display: block;" /></td></tr></table>`,zc=`<style em="styles">
|
|
797
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
798
|
-
.em-mob-width-100perc {
|
|
799
|
-
width: 100%!important;
|
|
800
|
-
max-width: 100%!important;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
</style>
|
|
804
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
805
|
-
<img class="em-video" src="${__emailmaker__.assetUrl("video.png")}" width="150" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;" />
|
|
806
|
-
</td></tr></table>`,Wc=({__:e})=>`<style em="styles">
|
|
807
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
808
|
-
.em-mob-width-100perc {
|
|
809
|
-
width: 100%!important;
|
|
810
|
-
max-width: 100%!important;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
</style>
|
|
814
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
815
|
-
<amp-carousel width="800" height="600" layout="responsive" type="slides" controls>
|
|
816
|
-
<amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
|
|
817
|
-
<amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
|
|
818
|
-
<amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
|
|
819
|
-
</amp-carousel>
|
|
820
|
-
</td></tr></table>`,Hc=({__:e})=>`<style em="styles">
|
|
821
|
-
amp-accordion > section > * {
|
|
822
|
-
background: none !important;
|
|
823
|
-
padding: 0 !important;
|
|
824
|
-
border: none !important;
|
|
825
|
-
overflow: visible !important;
|
|
826
|
-
}
|
|
827
|
-
@media only screen and (max-device-width:660px),only screen and (max-width:660px) {
|
|
828
|
-
.em-mob-width-100perc {
|
|
829
|
-
width: 100%!important;
|
|
830
|
-
max-width: 100%!important;
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
</style>
|
|
834
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
|
|
835
|
-
<amp-accordion animate expand-single-section>
|
|
836
|
-
<section>
|
|
837
|
-
<header>
|
|
838
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
839
|
-
<tr>
|
|
840
|
-
<td style="padding: 10px 0; border-bottom: 1px solid #CCCCCC;">
|
|
841
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;"><strong>${e("Section title")}</strong></div>
|
|
842
|
-
</td>
|
|
843
|
-
</tr>
|
|
844
|
-
</table>
|
|
845
|
-
</header>
|
|
846
|
-
<div>
|
|
847
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
|
|
848
|
-
<tr>
|
|
849
|
-
<td style="padding: 10px 0;">
|
|
850
|
-
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
|
|
851
|
-
</td>
|
|
852
|
-
</tr>
|
|
853
|
-
</table>
|
|
854
|
-
</div>
|
|
855
|
-
</section>
|
|
856
|
-
</amp-accordion>
|
|
857
|
-
</td></tr></table>`,qc={image:"element_image","ai-image":"element_ai_image",text:"element_text",header:"element_heading",button:"element_button",spacer:"element_spacer","list-ul":"element_lists","list-ol":"element_lists",divider:"element_divider",social:"element_social",table:"element_table",countdown:"element_timer",video:"element_video","amp-carousel":"element_amp_carousel","amp-accordion":"element_amp_accordion","amp-form":"element_amp_form"};function bi(e){return qc[e]??null}var vi=e=>Number(e)||void 0,Vc={colors:[],fonts:[],socials:[]},Vr=(e="entity")=>{const t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t?.randomUUID)return t.randomUUID();const n=typeof performance<"u"?performance.now().toString(36).replace(".",""):String(Date.now());return`${e}-${Date.now().toString(36)}-${n}`},Yc=()=>Vr("soc"),Kc=/^[a-z][a-z0-9+.-]*:/i,Ei=e=>{const t=String(e??"").trim();return t?Kc.test(t)?t:`https://${t}`:""},Qc=e=>{const t=Ei(e);if(!t)return!1;try{const n=new URL(t);return n.protocol==="https:"&&!!n.hostname}catch{return!1}},Xc=e=>[...e].filter(t=>t.url.trim()!=="").sort((t,n)=>t.order-n.order),Jc=e=>Xc(e).map(t=>({platform:t.icon_key,href:t.url,label:t.name,...t.icon_url?{iconSrc:t.icon_url}:{}})),Zc=/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,ed=/^#?([0-9a-f]{6})$/i,Yr=e=>{if(!e)return null;const t=String(e).trim().toLowerCase(),n=ed.exec(t);if(n)return`#${n[1]}`;const o=Zc.exec(t);if(o){const[,i,a,c]=o;return`#${i}${i}${a}${a}${c}${c}`}return null},Si=()=>Vr("bc"),td=/\.(woff2|woff|ttf|otf)$/i,nd=e=>{const t=td.exec(e.trim().toLowerCase());return t?`.${t[1]}`:null},rd={".woff":"application/x-font-woff",".woff2":"application/font-woff2",".ttf":"font/sfnt",".otf":"font/sfnt"},od={".woff":["application/x-font-woff","font/woff","application/font-woff"],".woff2":["application/font-woff2","font/woff2"],".ttf":["font/sfnt","application/font-sfnt","application/x-font-ttf","font/ttf","application/x-font-truetype"],".otf":["font/sfnt","application/font-sfnt","application/vnd.ms-opentype","application/x-font-opentype","font/otf","font/opentype"]},id=new Set(["","application/octet-stream","binary/octet-stream"]),ad=e=>{const t=nd(e.name);if(!t)return e;const n=e.type.trim().toLowerCase();return od[t].includes(n)||!id.has(n)?e:new File([e],e.name,{type:rd[t],lastModified:e.lastModified})},sd=()=>Vr("fnt"),ld=e=>e.family?.trim()||e.name.trim(),cd=e=>{const t=new Set;return e.filter(n=>n.source_url?.trim()).map(n=>({family:n.family?.trim()||n.name.trim(),source_url:n.source_url?.trim()??"",weight:n.weight?.trim()||"400",style:n.style??"normal",stylesheet:Kr(n),category:n.category})).filter(n=>{const o=`${n.family.toLowerCase()}/${n.weight}/${n.style}`;return t.has(o)?!1:(t.add(o),!0)})},dd=(e,t={})=>{const n=t.srcOverride?.trim()||e.source_url?.trim();if(!n||!t.srcOverride&&Kr(e)||t.srcOverride&&r.isGoogleFontsCssUrl(n))return null;const o=t.familyOverride?.trim()||ld(e),i=e.weight?.trim()||"400",a=e.style??"normal";return`@font-face{font-family:${JSON.stringify(o)};src:url(${JSON.stringify(n)});font-weight:${i};font-style:${a};font-display:swap;}`},ud=e=>e.source_kind?e.source_kind:r.isGoogleFontsCssUrl(e.source_url)?"google_stylesheet":e.file_name?.trim()?"uploaded":"remote_file",Kr=e=>e.source_kind?e.source_kind==="google_stylesheet"||e.source_kind==="remote_stylesheet":r.isGoogleFontsCssUrl(e.source_url),wi="data-em-project-fonts-face",ki="data-em-project-font-link",md=e=>{const t=e.filter(n=>Kr(n)).map(n=>n.source_url?.trim()??"").filter(Boolean);return[...new Set(t)]},pd=e=>e.map(t=>dd(t)).filter(t=>!!t).join(""),fd=(e,t=document)=>{const n=pd(e),{head:o}=t;let i=o.querySelector(`style[${wi}]`);if(!n){i?.remove();return}i||(i=t.createElement("style"),i.setAttribute(wi,""),o.appendChild(i)),i.textContent=n},hd=(e,t=document)=>{const n=new Set(md(e)),{head:o}=t;o.querySelectorAll(`link[${ki}]`).forEach(i=>{const a=i.getAttribute("href")??"";n.has(a)?n.delete(a):i.remove()}),n.forEach(i=>{const a=t.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",i),a.setAttribute(ki,""),o.appendChild(a)})},gd=(e,t=document)=>{fd(e,t),hd(e,t)},yd=new Set(["normal","italic","oblique"]),_d=new Set(["sans-serif","serif"]),vv="[emailmaker] projectStyles:",Rt=e=>{},yt=e=>typeof e=="string"?e.trim():"",Ci=e=>!e||e.startsWith("//")?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:e.toLowerCase().startsWith("https://"),bd=e=>{const t=typeof window<"u"?window.location?.href:void 0;if(!t||/^https:/i.test(e))return e;try{return new URL(e,t).href}catch{return e}},vd=e=>r.isGoogleFontsCssUrl(e)?"google_stylesheet":(e.split(/[?#]/)[0]??"").toLowerCase().endsWith(".css")?"remote_stylesheet":"remote_file",Ti=(e,t,n)=>e.length<=t?e:(Rt(`${n} list is capped at ${t} entries, ${e.length-t} dropped`),e.slice(0,t)),Ed=(e,t)=>{const n=Yr(e?.hex);if(!n){Rt(`colors[${t}] skipped: "${String(e?.hex)}" is not a hex color`);return}return{id:yt(e.id)||Si(),name:yt(e.name),hex:n,order:0}},Sd=(e,t)=>{const n=yt(e).toLowerCase();if(!n||_d.has(n))return n||void 0;Rt(`fonts[${t}]: category must be sans-serif or serif, got "${n}" — sans-serif used`)},wd=(e,t)=>{const n=yt(e?.family),o=yt(e?.source_url);if(!n){Rt(`fonts[${t}] skipped: family is required`);return}if(!o){Rt(`fonts[${t}] skipped: source_url is required`);return}if(!Ci(o)){Rt(`fonts[${t}] skipped: source_url must be https or relative, got "${o}"`);return}const i=yt(e.style),a=bd(o);return{id:yt(e.id)||sd(),name:yt(e.name)||n,family:n,source_url:a,source_kind:vd(a),weight:yt(e.weight)||"400",style:yd.has(i)?i:"normal",category:Sd(e.category,t),order:0}},kd=(e,t)=>{const n=Ei(e?.url);if(!n||!Qc(n)){Rt(`socials[${t}] skipped: url must be https, got "${String(e?.url)}"`);return}const o=yt(e.icon_key),i=yt(e.icon_url);let a;if(i&&Ci(i)?a=i:i&&Rt(`socials[${t}]: icon_url must be https or relative, got "${i}" — icon dropped`),!o&&!a){Rt(`socials[${t}] skipped: icon_key or icon_url is required`);return}return{id:yt(e.id)||Yc(),name:yt(e.name),url:n,icon_key:o,...a?{icon_url:a}:{},enabled:!0,order:0}},Cd=e=>{const t=new Set;return e.filter((n,o)=>{if(!n)return!1;const i=`${n.family?.toLowerCase()}/${n.weight}/${n.style}`;return t.has(i)?(Rt(`fonts[${o}] skipped: duplicate face ${n.family} ${n.weight} ${n.style}`),!1):(t.add(i),!0)})},Qr=e=>e.map((t,n)=>({...t,order:n})),Ii=e=>({colors:Qr(Ti(e?.colors??[],32,"colors").map(Ed).filter(t=>t!==void 0)),fonts:Qr(Cd((e?.fonts??[]).map(wd))),socials:Qr(Ti(e?.socials??[],20,"socials").map(kd).filter(t=>t!==void 0))}),Td={tg:"telegram",yt:"youtube",yd:"yandex_zen",tt:"tiktok",pi:"pinterest",ig:"instagram",fb:"facebook",xa:"x",tw:"twitter"},Ai="vk",Id=new Set(r.EM_SOCIAL_SELECT_ORDER),Ad=e=>Id.has(e),xi=e=>{const t=String(e??"").trim().toLowerCase();return t?Ad(t)?t:Td[t]??Ai:Ai},xd=e=>xi(e),Pd=new Set(["normal","italic","oblique"]),Rd=new Set(["sans-serif","serif"]),jd=new Set(["uploaded","remote_file","google_stylesheet"]),jt=e=>(e??"").trim(),Cn=e=>jt(e)||void 0,Pi=e=>typeof e=="number"&&e>0?e:void 0,Ld=e=>Pd.has(e)?e:void 0,Od=e=>Rd.has(e)?e:void 0,Md=e=>jd.has(e)?e:void 0,Nd=(e,t)=>{const n=Yr(jt(e.hex));return n?{id:jt(e.id)||Si(),name:jt(e.name),hex:n,order:e.order??t}:null},Ri=(e,t=0)=>({id:jt(e.id),name:jt(e.name),source_url:Cn(e.source_url),source_kind:Md(e.source_kind),file_name:Cn(e.file_name),family:Cn(e.family),weight:Cn(e.weight),style:Ld(e.style),category:Od(e.category),preview_url:Cn(e.preview_url),storage_fallback:e.storage_fallback||void 0,font_size_px:Pi(e.font_size_px),line_height_px:Pi(e.line_height_px),order:e.order??t}),Dd=(e,t)=>{const n=jt(e.url);return n?{id:jt(e.id),name:jt(e.name),url:n,icon_key:xi(jt(e.icon_key)),enabled:e.enabled??!0,order:e.order??t}:null},sn=e=>[...e].sort((t,n)=>t.order-n.order),ji=e=>e?{colors:sn((e.colors??[]).map(Nd).filter(t=>t!==null)),fonts:sn((e.fonts??[]).map(Ri)),socials:sn((e.socials??[]).map(Dd).filter(t=>t!==null))}:Vc,Fd=e=>e==="remote_stylesheet"?"remote_file":e,Bd=e=>{const t={};return e.colors&&(t.colors=sn(e.colors).map(n=>({id:n.id,name:n.name.trim(),hex:Yr(n.hex)||n.hex}))),e.fonts&&(t.fonts=sn(e.fonts).map(n=>({id:n.id,name:n.name.trim(),source_url:n.source_url??"",source_kind:Fd(ud(n)),file_name:n.file_name??"",family:n.family??"",weight:n.weight??"",style:n.style??"",category:n.category??"",preview_url:n.preview_url??"",storage_fallback:n.storage_fallback??!1,font_size_px:n.font_size_px??0,line_height_px:n.line_height_px??0}))),e.socials&&(t.socials=sn(e.socials).map(n=>({id:n.id,name:n.name.trim(),url:n.url,icon_key:xd(n.icon_key),enabled:n.enabled}))),t},Li="ProjectBrandStyles",Xt=r.createApi({reducerPath:"projectSettingsStylesApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Li],endpoints:e=>({getProjectStyles:e.query({async queryFn({projectId:t},n){const o=r.v2ResultOf(await r.getClientV2(h.getContainer(n)).projects.stylesList({id:String(t)}));return"error"in o?{error:o.error}:{data:ji(o.data)}},providesTags:(t,n,{projectId:o})=>[{type:Li,id:String(o)}]}),updateProjectStyles:e.mutation({async queryFn({projectId:t,patch:n},o){const i=r.v2ResultOf(await r.getClientV2(h.getContainer(o)).projects.stylesPartialUpdate({id:String(t)},Bd(n)));return"error"in i?{error:i.error}:{data:ji(i.data)}},async onQueryStarted({projectId:t,patch:n},{dispatch:o,queryFulfilled:i}){const a=o(Xt.util.updateQueryData("getProjectStyles",{projectId:t},c=>Object.assign(c,n)));try{const{data:c}=await i;o(Xt.util.upsertQueryData("getProjectStyles",{projectId:t},c))}catch{a.undo()}}}),uploadProjectFont:e.mutation({async queryFn({projectId:t,file:n},o){const i=new FormData;i.append("file",ad(n));const a=r.v2ResultOf(await r.getClientV2(h.getContainer(o)).request({path:`/projects/${String(t)}/styles/fonts`,method:"POST",body:i,secure:!0,type:r.ContentType.FormData,format:"json"}));return"error"in a?{error:a.error}:{data:Ri(a.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:o}){try{const{data:i}=await o;n(Xt.util.updateQueryData("getProjectStyles",{projectId:t},a=>{a.fonts=a.fonts.some(c=>c.id===i.id)?a.fonts.map(c=>c.id===i.id?i:c):[...a.fonts,i],a.fonts.sort((c,d)=>c.order-d.order)}))}catch{}}})})}),{useGetProjectStylesQuery:Ud,useUpdateProjectStylesMutation:Ev,useUploadProjectFontMutation:Sv}=Xt,Oi=new WeakMap,$d=e=>{if(!e)return Ii(e);let t=Oi.get(e);return t||(t=Ii(e),Oi.set(e,t)),t},Mi=e=>{const t=r.useIntegratorConfigValue("projectStyles"),{data:n}=Ud({projectId:e},{skip:!0});return(0,l.useMemo)(()=>$d(t),[t])},Gd=2.5,zd=({atom:e,onSelect:t,onDragStart:n,isDroppedAtom:o})=>{const i=(0,l.useCallback)(d=>t(d,e),[t,e]),a=(0,l.useCallback)(d=>n(d,e,o),[n,e,o]),c=(0,l.useCallback)(d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t(d,e))},[t,e]);return(0,s.jsxs)("button",{type:"button",className:"ant-card-hoverable atoms__item "+e.className+(e.isLockedByPlan?" atoms__item_locked":""),draggable:!0,onClick:i,onKeyDown:c,onDragStart:a,"data-test-name":e.name,children:[(0,s.jsxs)("span",{className:"atom-image",children:[e.icon,e.isLockedByPlan&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:Gd,className:"atom-image__lock"})]}),(0,s.jsx)("span",{className:"atom-title",children:e.title})]})},Ni=()=>{const e=r.useI18n(),{__:t}=e,n=r.useAppConfig(),o=r.useProjectData(),i=r.useCurrentUserLocale()||"ru_RU",a=Pt.useSetHtmlAtomInIframeHandler(),c=Pt.useDragStartAtomToIframeHandler(),[d,u]=(0,l.useState)(!1),[m,f]=(0,l.useState)(0),g=r.useMessageService(),_=r.useServices(h.ATOMS_HANDLERS_ID),p=r.useEventEmitter(h.HANDLE_ATOM_INSERT_ID),v=r.usePlanFeatureLocks(),C=vi(o?.id),k=Mi(C),S=k?Jc(k.socials):[],I=S.length>0?gi(S):Fc;let A=[];if(n.elementImageEnabled&&A.push({title:t("Image"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:24,strokeWidth:n.iconStrokeWidth}),html:Ec,className:"",name:"image"}),n.elementAIimageEnabled&&A.push({title:t("AI image"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementImageAI",component:y.icons$ElementImageAI,size:24,strokeWidth:n.iconStrokeWidth}),html:Sc,className:"ai",name:"ai-image"}),n.elementTextEnabled&&A.push({title:t("Text"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:24,strokeWidth:n.iconStrokeWidth}),html:wc(e),className:"",name:"text"}),n.elementHeaderEnabled&&A.push({title:t("Header"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementTitle",component:y.icons$ElementTitle,size:24,strokeWidth:n.iconStrokeWidth}),html:kc(e),className:"",name:"header"}),n.elementButtonEnabled&&A.push({title:t("Button"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:24,strokeWidth:n.iconStrokeWidth}),html:Cc(e),className:"",name:"button"}),n.elementSpacerEnabled&&A.push({title:t("Spacer"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementSpacer",component:y.icons$ElementSpacer,size:24,strokeWidth:n.iconStrokeWidth}),html:xc,className:"",name:"spacer"}),n.elementListULEnabled&&A.push({title:t("List UL"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementListUL",component:y.icons$ElementListUL,size:24,strokeWidth:n.iconStrokeWidth}),html:Tc(e),className:"",name:"list-ul"}),n.elementListOLEnabled&&A.push({title:t("List OL"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementListOL",component:y.icons$ElementListOL,size:24,strokeWidth:n.iconStrokeWidth}),html:Ic(e),className:"",name:"list-ol"}),n.elementDividerEnabled&&A.push({title:t("Divider"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementDivider",component:y.icons$ElementDivider,size:24,strokeWidth:n.iconStrokeWidth}),html:Ac,className:"",name:"divider"}),n.elementSocialEnabled&&A.push({title:t("Social media"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementSocial",component:y.icons$ElementSocial,size:24,strokeWidth:n.iconStrokeWidth}),html:I,className:"",name:"social"}),n.elementTableEnabled&&A.push({title:t("Table"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:24,strokeWidth:n.iconStrokeWidth}),html:Bc(e),className:"",name:"table"}),n.elementCountdownEnabled&&A.push({title:t("Countdown"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementCountdown",component:y.icons$ElementCountdown,size:24,strokeWidth:n.iconStrokeWidth}),html:Gc(i),className:"",name:"countdown"}),n.elementVideoEnabled&&A.push({title:t("Video"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementVideo",component:y.icons$ElementVideo,size:24,strokeWidth:n.iconStrokeWidth}),html:zc,className:"",name:"video"}),n.elementCarouselEnabled&&A.push({title:t("Carousel"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementCarousel",component:y.icons$ElementCarousel,size:24,strokeWidth:n.iconStrokeWidth}),html:Wc(e),className:"amp",name:"amp-carousel"}),n.elementAccordionEnabled&&A.push({title:t("Accordion"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementAccordion",component:y.icons$ElementAccordion,size:24,strokeWidth:n.iconStrokeWidth}),html:Hc(e),className:"amp",name:"amp-accordion"}),n.elementFormEnabled&&A.push({title:t("Form"),icon:(0,s.jsx)(r.EmIcons,{icon:"ElementForm",component:y.icons$ElementForm,size:24,strokeWidth:n.iconStrokeWidth}),html:null,className:"amp",name:"amp-form"}),A=A.map(N=>({...N,fallbackTooltip:t("Coming soon"),planFeature:bi(N.name),isLockedByPlan:v(bi(N.name))})),_){const N={value:A};for(const B of _)B.execute(N);A=N.value}(0,l.useEffect)(()=>{const{dispose:N}=g.addListener(r.EVENT_TYPES.APPLICATION_ATOM_INSERTED,B=>{const D=A.find(O=>O.name===B);D&&p.fire(D)});return()=>N()},[g,A,p]);const Y=(0,l.useCallback)(N=>{u(!0),f(N.planFeature?r.FEATURE_UPSELL_SLIDE[N.planFeature]:1)},[]),ee=(0,l.useCallback)(N=>N.isLockedByPlan?(setTimeout(()=>Y(N),1e3),!1):!0,[Y]),j=(0,l.useCallback)((N,B)=>{if(B.isLockedByPlan){Y(B);return}a(N,B)},[Y,a]),R=(0,l.useCallback)((N,B,D)=>{c(N,B,D)},[c]);return(0,s.jsxs)("div",{className:"atoms",children:[(0,s.jsx)("div",{className:"atoms__list",children:(0,s.jsx)(y.ui_kit$Space,{wrap:!0,style:{justifyContent:"space-between",rowGap:10},children:A&&A.map((N,B)=>N.html?(0,s.jsx)(zd,{atom:N,onSelect:j,onDragStart:R,isDroppedAtom:ee},N.title+B.toString()):(0,s.jsx)(y.ui_kit$Tooltip,{title:N.fallbackTooltip||t("Coming soon"),placement:"top",children:(0,s.jsxs)("div",{className:"atoms__item atoms__item_inactive "+N.className,"data-test-name":N.name,children:[(0,s.jsx)("span",{className:"atom-image",children:N.icon}),(0,s.jsx)("span",{className:"atom-title",children:N.title})]},N.title+B.toString())},N.title+B.toString()))})}),(0,s.jsx)(r.PlanUpgradePrompt,{open:d,onCancel:()=>u(!1),initialSlide:m})]})};Ni.propTypes={};var Wd={full:{flexGrow:1},768:{width:171},425:{width:25},375:{width:28},320:{width:320}},Di={right:-12,top:4,zIndex:999,padding:0,position:"absolute"},Hd=[{kind:"full",width:1200},{kind:"768",width:768},{kind:"425",width:425},{kind:"375",width:375},{kind:"320",width:320,showLabel:!0},{kind:"375",width:375},{kind:"425",width:425,control:"mobile"},{kind:"768",width:768,control:"desktop"},{kind:"full",width:1200}];function qd({kind:e,width:t,label:n,onSelect:o,onHover:i,children:a}){const c=(0,l.useCallback)(()=>i(e,n),[i,e,n]),d=(0,l.useCallback)(()=>i(null,""),[i]),u=(0,l.useCallback)(()=>o(t),[o,t]),m=(0,l.useCallback)(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),o(t))},[o,t]);return(0,s.jsx)("div",{className:`device-width__${e}`,style:Wd[e],role:"button",tabIndex:0,"aria-label":n,onMouseEnter:c,onMouseLeave:d,onClick:u,onKeyDown:m,children:a})}function Vd({onSelectWidth:e,themeToggle:t}){const{__:n}=r.useI18n(),[o,i]=(0,l.useState)(""),[a,c]=(0,l.useState)(""),d={full:n("Desktop"),768:n("Small desktop – 768px"),425:n("Mobile L – 425px"),375:n("Mobile M – 375px"),320:n("Mobile S – 320px")},u=(0,l.useCallback)((m,f)=>{i(m?`device-width__${m}-hovered`:""),c(f)},[]);return(0,s.jsx)("div",{className:`email-pane__sizes ${o}`,children:(0,s.jsxs)("div",{className:"email-pane__width-selectors-wrapper",children:[(0,s.jsx)("div",{className:"device-width__theme",children:t}),Hd.map((m,f)=>(0,s.jsxs)(qd,{kind:m.kind,width:m.width,label:d[m.kind],onSelect:e,onHover:u,children:[m.showLabel?a:null,m.control==="mobile"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Mobile view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(r.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Di})}),m.control==="desktop"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Desktop view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(r.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Di})})]},`${m.kind}-${f}`)),(0,s.jsx)("div",{className:"device-width__theme-placeholder"})]})})}var Ge=Gt.__toESM(r.require_prop_types()),Fi=h.createIdentifier$1("canvas.resizerBinder"),Yd=h.createIdentifier$1("canvas.service"),wv={created:r.PHASES.canvasCreated,loaded:r.PHASES.canvasLoaded};function Kd(e){return e.getInstance(Yd)}var Bi=2e3,Qd=10,Xd="iframe_errors",Jd=5;function Zd(e){const{__:t}=r.useI18n(),n=r.useMessageService(),o=r.useDocumentUndo(),{error:i}=r.useNotification(),{document:a}=r.useDocumentSessionContext(),c=(0,l.useCallback)(()=>a?.getContent()??"",[a]),d=(0,l.useRef)(0),u=(0,l.useRef)(void 0),m=(0,l.useRef)(!1),f=r.useCurrentUser(),g=(0,l.useCallback)(p=>new Promise((v,C)=>{const k=n.addListener(r.EVENT_TYPES.SANDBOX_READY,()=>{k.dispose(),v()});p&&setTimeout(()=>{k.dispose(),C("timeout")})}),[n]),_=(0,l.useCallback)(p=>{g(Bi).catch(v=>{}).finally(()=>{Promise.resolve().then(()=>{if(!m.current){if(++d.current){if(u.current){if(d.current<Jd){o.restoreSnapshot(u.current);for(let v=0;v<d.current;v++)o.undo()}}else u.current=o.createSnapshot();n.send(r.EVENT_TYPES.RELOAD)}setTimeout(()=>{if(--d.current===0){u.current=null;const v=new Error(p.message);p.stack&&(v.stack=p.stack);const C=r.reportError(v,{origin:"iframe"}),k={past:o.getPast(Qd),future:o.getFuture(),errorResolved:!m.current,text:c(),message:p.message,stack:p.stack,userId:f?.id,entityId:e?.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block",sentryEventId:C};i({id:"IFRAME_ERROR",data:k,title:t("Something went wrong")}),h.RACS.post(Xd,k).catch(S=>{}),m.current=!1}},Bi)}})})},[o,c,i,f?.id,e?.id,t,g,n]);r.useListenPostMessage(r.EVENT_TYPES.APPLICATION_DOMPARSER_ERROR,_)}function eu(e,t){const n=JSON.stringify(t??{});tu(e?.get().attributes.common_styles,n)||r.writeEmailAttributes(e,{common_styles:n})}function tu(e,t){if(e===t)return!0;try{return h.deepEqual(JSON.parse(e||"{}"),JSON.parse(t||"{}"))}catch{return!1}}var Hn=Symbol("isIframeEvent");function nu({children:e}){const[t,n]=(0,l.useState)(),[o,i]=(0,l.useState)(),[a,c]=(0,l.useState)(!1),d=r.useMessageService();return(0,l.useEffect)(()=>{if(t){const u=d.addListener(r.EVENT_TYPES.APPLICATION_IFRAME_DRAG_EVENT,m=>{if(m.type!=="drageleave"&&m.type!=="dragenter"){const f=t.getBoundingClientRect(),g=m.clientX+f.x+window.scrollX,_=m.clientY+f.y+window.scrollY,p=document.elementFromPoint(g,_);if(p){const v=new DataTransfer,C=new DragEvent(m.type,{clientX:g,clientY:_,cancelable:!0,bubbles:!0,dataTransfer:v});C[Hn]=!0,p.dispatchEvent(C)}}});return()=>u.dispose()}},[d,t]),(0,l.useEffect)(()=>{const u=f=>{f[Hn]||c(!0)},m=f=>{f[Hn]||c(!1)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",m),()=>{window.removeEventListener("dragstart",u),window.removeEventListener("dragend",m)}},[o]),(0,l.useEffect)(()=>{const u=m=>{if(!m[Hn]){const f=o.getBoundingClientRect();d.send(r.EVENT_TYPES.SANDBOX_DRAG_EVENT,{value:m.dataTransfer?.getData("Text")||"",type:m.type,clientX:m.pageX-f.x-window.scrollX,clientY:m.pageY-f.y-window.scrollY})}};if(o)return o.addEventListener("dragenter",u),o.addEventListener("dragover",u),o.addEventListener("dragleave",u),o.addEventListener("drop",u),o.addEventListener("dragend",u),()=>{o.removeEventListener("dragenter",u),o.removeEventListener("dragover",u),o.removeEventListener("dragleave",u),o.removeEventListener("drop",u),o.removeEventListener("dragend",u)}},[o,d]),(0,s.jsxs)("div",{ref:n,children:[a&&(0,s.jsx)("div",{ref:i,className:"iframe-provider"}),e]})}var ru=["colorBgBase","colorBgElevated","colorError","colorInfo","colorInfoBg","colorInfoBgHover","colorInfoBorder","colorInfoBorderHover","colorLink","colorPrimary","colorPrimaryBg","colorPrimaryBgHover","colorPrimaryBorder","colorPrimaryBorderHover"];function ou(e){const t={};for(const n of ru){const o=e[n];typeof o=="string"&&(t[n]=o)}return t}function Xr(e,t){const n=r.useMessageService(),o=t?.async??!1;(0,l.useEffect)(()=>{const i=o?n.addListenerAsync(r.EVENT_TYPES.RELOAD,e):n.addListener(r.EVENT_TYPES.RELOAD,e);return()=>i.dispose()},[n,e,o]),(0,l.useEffect)(()=>{},[e])}function iu(){const e=r.useMessageService(),{token:t}=(0,y.ui_kit$useToken)(),[n,o]=(0,l.useState)();(0,l.useEffect)(()=>{if(!h.deepEqual(n,t)){const a=e.onInit(()=>{e.send(r.EVENT_TYPES.SANDBOX_SET_THEME_VARIABLES,ou(t)),o(t)});return()=>a.dispose()}},[t,n,o,e]);const i=(0,l.useCallback)(()=>{o(void 0)},[]);Xr(i)}var au={minHeight:600},su="#pane-content-wrapper, .email-pane__col_preview, .preview-mode__pane-content";function Ui(e){e?.current?.resize?.()}var $i=(0,l.forwardRef)(({className:e=null,email:t=null,handlerSendPosition:n=()=>{},surface:o,clip:i=null},a)=>{const c=r.useAppConfig(),d=r.useContainer(),u=o??(t?.hasOwnProperty("type")?"block":"email"),m=(0,l.useMemo)(()=>Kd(d),[d]),f=(0,l.useMemo)(()=>m?.current(u),[m,u]),g=(0,l.useRef)(null),_=(0,l.useCallback)(()=>{r.mark(r.PHASES.canvasLoaded),Ui(a),n()},[n,a]);(0,l.useImperativeHandle)(a,()=>({getIframeElement:()=>m?.current(u)?.element,resize:()=>m?.current(u)?.resize()}),[m,u]),(0,l.useEffect)(()=>{if(!m)return;const k=g.current,S=i??k?.closest(su)??null;return m.alignSurface(u,k,S),()=>m.alignSurface(u,null)},[m,u,i,c.sidePanelFloating]);const p=(0,l.useRef)(_);p.current=_,(0,l.useEffect)(()=>{if(!f)return;let k=!1;const S=()=>{k||p.current({target:f.element})};return f.ready().then(S).catch(()=>{window.requestAnimationFrame(()=>{k||f.ready().then(S).catch(()=>{})})}),()=>{k=!0}},[f]),iu(),Zd(t);const{document:v}=r.useDocumentSessionContext();(0,l.useEffect)(()=>{const k=r.subscribeToContent(v,()=>{Ui(a)});return()=>k.dispose()},[v,a]);const C=(0,l.useCallback)(k=>{const{operation:S,settings:I}=k.data;S===r.EVENT_TYPES.APPLICATION_COMMON_STYLES_UPDATE&&eu(v,I?.commonStyles)},[v]);return r.useListenPostMessage(C),(0,s.jsx)(nu,{children:(0,s.jsx)("div",{ref:g,className:(0,nt.default)("email-preview",e),id:"email_iframe_slot",style:au})})});$i.propTypes={className:Ge.default.string,surface:Ge.default.oneOf(["email","block","preview"]),email:Ge.default.shape({html:Ge.default.string}),handlerSendPosition:Ge.default.func,clip:Ge.default.object};var Jr=new Map,lu=new Map;function cu(e,t){e.set(t,(e.get(t)??0)+1)}function du(e,t){const n=e.get(t)??0;n<=1?e.delete(t):e.set(t,n-1)}function Gi(e,t){return(e.get(t)??0)>0}function uu(e){return Gi(Jr,e)||Gi(lu,e)}function mu(e){cu(Jr,e);let t=!1;return{dispose(){t||(t=!0,pu(e))}}}function pu(e){du(Jr,e)}function fu(e,t){return gu([...e.changes].sort((n,o)=>n.rangeOffset-o.rangeOffset).map(n=>({start:n.rangeOffset,end:n.rangeOffset+n.rangeLength,text:n.text})),t)}function hu(e,t){return e.map(n=>{const o=t.getPositionAt(n.oldPosition),i=t.getPositionAt(n.oldEnd);return{text:n.newText,range:{startLineNumber:o.lineNumber,startColumn:o.column,endLineNumber:i.lineNumber,endColumn:i.column}}})}function gu(e,t){let n=0;return e.map(({start:o,end:i,text:a})=>{const c=new r.TextChange(o,t.slice(o,i),o+n,a);return n+=a.length-(i-o),c})}var zi=new WeakMap;function yu(e){const t=zi.get(e);if(t)return t;const n=Wl(e);return zi.set(e,n),n}var Wi="monaco";function _u(e,t){(0,l.useEffect)(()=>{if(!e||!t)return;const n=yu(e);let o=!1;const i=d=>{o=!0;const u=mu(t);try{d()}finally{u.dispose(),o=!1}},a=n.attach({id:Wi,apply(d){return t.getValue()!==d&&i(()=>t.setValue(d)),Promise.resolve()},applyChanges(d){return i(()=>t.applyEdits(hu(d,t))),Promise.resolve()}}),c=t.onDidChangeContent(d=>{if(o)return;const u=uu(t)?"remote":"user";n.mutateFrom(Wi,{changes:fu(d,e.getContent())},{source:u})});return()=>{a.detach(),c.dispose()}},[e,t])}function bu(e,t){const[n,o]=(0,l.useState)(void 0),i=(0,l.useRef)(!1),{error:a}=r.useNotification(),{__:c}=r.useI18n(),d=(0,l.useRef)(t);d.current=t;const u=(0,l.useRef)({error:a,__:c});u.current={error:a,__:c},(0,l.useEffect)(()=>{if(!e||n||i.current)return;i.current=!0;let f=!1;return d.current().then(g=>{if(f){g.dispose();return}o(g)}).catch(()=>{const{error:g,__:_}=u.current;g({id:"CODE_EDITOR_LOAD_FAILED",title:_("Failed to load the code editor")})}).finally(()=>{i.current=!1}),()=>{f=!0}},[e,n]);const m=(0,l.useRef)(void 0);return m.current=n,(0,l.useEffect)(()=>()=>{m.current?.dispose()},[]),n}var qn;function Zr(){return qn===void 0&&(qn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/420fc89a.js")),void 0,{}.url).catch(e=>{throw qn=void 0,e})),qn}function vu(){return Zr().then(e=>e.ensureMonaco())}var Eu=r.lazyRoute(()=>Zr().then(e=>({default:e.MonacoEditor}))),Su=()=>Zr().then(e=>e.loadEditorModel()),wu={height:"100%"};function ku(e){const t=bu(!0,Su),{document:n}=r.useDocumentSessionContext();return(0,l.useEffect)(()=>{},[]),(0,l.useEffect)(()=>{},[t]),_u(n,t),(0,s.jsx)(r.EditorModelContext.Provider,{value:t,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$Flex,{justify:"center",align:"center",style:wu,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})}),children:(0,s.jsx)(Eu,{...e})})})}var Cu=({elementPath:e})=>{const{_x:t}=r.useI18n(),n=r.useDispatch(),o=r.useMessageService(),i=r.useAppConfig(),{blockId:a}=r.useRouteParams(),c=r.useEditorProjectId(),d=r.useRouteEmailId(),u=r.useProjectData(),m=r.usePushToDataLayer(),f=(0,l.useCallback)(I=>{o.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_SET,index:I})},[o]),g=(0,l.useCallback)(I=>{let A="element";I?.target?.closest("svg")||I?.target?.closest(".anticon")||I?.target?.closest('[class*="icon"]')?A="icon":I?.target?.textContent&&!I?.target?.closest("svg")&&!I?.target?.closest(".anticon")&&(A="text"),n(r.setActiveSettingsTab(r.STYLES)),o.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),o.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),m({event:"click",action:"click_breadcrumb_email",email_id:d||a,project_id:u?.id||c,click_target:A})},[o,n,m,d,a,c,u]),_={title:(0,s.jsxs)("span",{onClick:g,children:[(0,s.jsx)(r.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},[p,v]=(0,l.useState)([_]),C=(0,l.useCallback)(I=>{o.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_HOVER_SET,index:I})},[o]),k=I=>{if(I.includes("em-element-path-item-text"))return(0,s.jsx)(r.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-image"))return(0,s.jsx)(r.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-link"))return(0,s.jsx)(r.EmIcons,{icon:"LinkOutlined",component:y.icons$LinkOutlined,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-atom"))return(0,s.jsx)(r.EmIcons,{icon:"Atom",component:y.icons$Atom,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-column"))return(0,s.jsx)(r.EmIcons,{icon:"Column",component:y.icons$Column,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-block"))return(0,s.jsx)(r.EmIcons,{icon:"Block",component:y.icons$Block,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-group"))return(0,s.jsx)(r.EmIcons,{icon:"Group",component:y.icons$Group,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-button"))return(0,s.jsx)(r.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-table"))return(0,s.jsx)(r.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-amp"))return(0,s.jsx)(r.EmIcons,{icon:"AMP",component:y.icons$AMP,size:16,strokeWidth:i.iconStrokeWidth})},S=(0,l.useCallback)((I,A)=>{const Y=ee=>{let j="element";ee.target.closest("svg")||ee.target.closest(".anticon")||ee.target.closest('[class*="icon"]')?j="icon":ee.target.textContent&&!ee.target.closest("svg")&&!ee.target.closest(".anticon")&&(j="text");const R=e?.[A],N=R?.className?.replace("em-element-path-item-","")||"unknown";m({event:"click",action:"click_breadcrumb_element",email_id:d||a,project_id:u?.id||c,element_type:N,element_index:A,element_title:R?.title||"",click_target:j}),f(A)};return(0,s.jsxs)("span",{className:I.className,onClick:Y,onMouseOver:()=>{C(A)},children:[k(I.className)," ",I.title]})},[f,C,e,m,d,a,c,u]);return(0,l.useEffect)(()=>{if(e){const I=e.map((A,Y)=>({title:S(A,Y)}));v([{title:(0,s.jsxs)("span",{onClick:g,children:[(0,s.jsx)(r.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},...I])}},[e,S,g,t]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(y.ui_kit$Breadcrumb,{items:p,type:"separator",separator:""})})};function Tu(){const{document:e}=r.useDocumentSessionContext(),t=(0,l.useCallback)(o=>e?e.subscribe(o):()=>{},[e]),n=(0,l.useCallback)(()=>e?.getContent()??"",[e]);return(0,l.useSyncExternalStore)(t,n)}var Iu=({fallbackHtml:e})=>{const{__:t}=r.useI18n(),n=Tu(),o=(0,l.useMemo)(()=>r.getCodeSize(n||e||""),[e,n]),i=r.formatCodeSize(o),a=r.isCodeSizeExceeded(o);return(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:t(a?"The code size exceeds the recommended value 90kB":"Code size"),children:(0,s.jsx)("span",{className:(0,nt.default)("email-pane__code-size",{"email-pane__code-size_exceeded":a}),children:i})})};function Hi(e){const{limits:t,isLoaded:n}=r.useProjectPlanLimits();return r.useProjectData(),(0,l.useMemo)(()=>({isLocked:!1,state:{state:"allowed"},isPlanDataReady:n,exceeded:null}),[!1,e,t,n])}var Au=({open:e,onClose:t})=>{const{__:n}=r.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:{closable:!1},footer:null,width:520,className:"browser-extension-warning-modal",title:n("Browser extension detected"),onCancel:t,children:[(0,s.jsx)("p",{children:n("A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.")}),(0,s.jsx)("p",{children:n("We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.")}),(0,s.jsx)("div",{className:"browser-extension-warning-modal__footer",children:(0,s.jsxs)(y.ui_kit$Button,{type:"primary",onClick:t,children:[n("Got it")," "]})})]})},xu={closable:!1},Pu=({open:e,onClose:t})=>{const{__:n}=r.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:xu,footer:null,width:520,className:"browser-translate-warning-modal",title:n("Browser translation detected"),children:[(0,s.jsx)("p",{children:n("Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.")}),(0,s.jsx)("p",{children:n("To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.")}),(0,s.jsx)("div",{className:"browser-translate-warning-modal__footer",children:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:t,children:n("Got it")})})]})},Ru=h.createIdentifier$1("prewarm.editorVisible");function ju(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Lu(e={}){const t=e.paint??ju;let n=!1,o=!1,i=!1,a=!1,c=!1;const d=[],u=()=>{c||a||!n||!o||!i||(a=!0,t(()=>{c=!0,r.mark(r.PHASES.editorVisible);for(const m of d.splice(0))m()}))};return{noteShellVisible(){n=!0,u()},notePagePainted(){o=!0,u()},noteContentShown(){i=!0,u()},whenVisible(m){if(c){m();return}d.push(m)},contentShown:()=>i}}function Wt(e){return e.getOrCreateInstance(Ru,()=>Lu())}function Tn(e){const t=(0,l.useRef)(!1);return e&&(t.current=!0),t.current}var qi=4e3;function Jt(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:qi});return}window.setTimeout(e,qi)}var Vn,eo;function to(){return Vn===void 0&&(Vn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/36d57a50.js")).then(e=>e.panels_exports).then(e=>(eo=e,e),e=>{throw Vn=void 0,e}),void 0,{}.url)),Vn}function Ou(e){(0,l.useEffect)(()=>{Wt(e).whenVisible(()=>{Jt(()=>{to().catch(()=>{})})})},[e])}function ct(e){const t=r.lazyRoute(()=>to().then(o=>({default:o[e]})),"panels");function n(o){const[i]=(0,l.useState)(()=>eo?eo[e]:t);return(0,l.createElement)(i,o)}return n.displayName=`PanelDoor(${String(e)})`,n}var Vi=ct("EmailProperties"),Mu=ct("SelectedElementPanel"),Nu=ct("EmailSettings"),Du=ct("EmailStyles"),Fu=ct("DiscussAi"),Bu=ct("Optimise"),Uu=ct("FileManagerDataLayer"),$u=ct("BlocksSearch"),Gu=ct("Discuss"),zu=ct("HistoryPanel"),Wu=ct("AddNewBlockModal"),Hu=ct("AddAllBlocksModal"),qu=ct("SendTestEmailModal"),Vu=ct("SaveBlockBtn"),no=ct("LimitUpgradeModal"),Yu={height:"100%"},Ku=()=>{const e=r.useContainer(),t=r.isImageCenterModal(r.useSelector(r.selectActiveModal$1)),[n,o]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{e&&Wt(e).whenVisible(()=>o(!0))},[e]),Tn(n||t)?(0,s.jsx)(l.Suspense,{fallback:t?(0,s.jsx)(y.ui_kit$PageLoader,{style:Yu}):null,children:(0,s.jsx)(Uu,{})}):null},Yn;function Qu(){return Yn===void 0&&(Yn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/9cbeb725.js")),void 0,{}.url).catch(e=>{throw Yn=void 0,e})),Yn}function In(e){return r.lazyRoute(()=>Qu().then(t=>({default:t[e]})),"form-panels")}var kv=In("FormEditorCalendarPanel"),Cv=In("FormEditorCheckboxPanel"),Tv=In("FormEditorDropdownListPanel"),Iv=In("FormEditorInputPanel"),Av=In("FormEditorRadioPanel");function Xu(){try{const e=new URLSearchParams(window.location.search).get("deferChrome");return e===null?void 0:e!=="0"&&e!=="false"}catch{return}}function Ju(e,t){const n=Xu()??r.readLocalToggle(r.LOCAL_STORAGE_ITEMS.em_defer_chrome);if(n!==void 0)return n;const o=t?.deferEditorChrome;return typeof o=="boolean"?o:o&&typeof o=="object"?o[e]??!0:{}.REACT_APP_DEFER_EDITOR_CHROME_DEFAULT!=="false"}function Yi(e){const t=r.useAppConfig(),[n,o]=(0,l.useState)(()=>!Ju(e,t));return(0,l.useEffect)(()=>{if(n)return;let i=0;const a=window.requestAnimationFrame(()=>{i=window.requestAnimationFrame(()=>(0,l.startTransition)(()=>o(!0)))});return()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(i)}},[n]),n}function Zu(){const e=r.useAppConfig(),t=r.useIsStandalone(),n=r.useProjectData(),o=r.useStore(),i=r.useI18n(),a=r.useCurrentUser(),c=r.useEventEmitter(h.events.UPLOAD_EVENT_ID),d=n?.id?String(n.id):"",u=a?.id!=="0"?String(a?.id??""):"";return(0,l.useCallback)(async m=>{const f=await r.fireUploadImageEvent(c,{file:m,project:d});if(f.url)return f.url;const g=h.getContainer(o),{dataProvider:_,usesBuiltInStorage:p}=r.buildResolvedFileManagerProviders({storageProvider:g.getInstance(h.STORAGE_PROVIDER_ID),projectId:d,restApi:h.getApi(g,r.EM_FILES_MODULES),restApiV2:r.createRestClientV2(o),i18n:i,pathPostfix:u,appConfig:e,isStandalone:t,onIndexingStateChange:()=>{}});if(!r.shouldFallbackToBuiltInUpload(f,{isStandalone:t,targetIsOurBackend:!!p}))throw r.toUploadImageError(f);const v=await r.uploadFileViaDataProvider(m,_);if(!v?.url)throw new Error(i.__("The image could not be uploaded."));return v.url},[e,i,t,d,o,c,u])}var Ki=r.createState({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:r.CARDS,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),Kn="blocksPageSlice",ro=r.createSlice({name:Kn,initialState:Ki,reducers:{resetPagesAndTotal:()=>Ki,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeBlockFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(o=>o.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(r.blocksApi.endpoints.getBlocks.matchFulfilled,(t,{meta:n,payload:o})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||o?.length,a=n.arg.originalArgs?.status==="trash",c=!!n.arg.originalArgs?.name?.length,d=n.arg.originalArgs?.page,u=n.arg.originalArgs?.folderTag||n.arg.originalArgs?.tags?.[0];a?(c||(t.blocksTrashTotal=i),t.elementsTrashList=o):u?t.customFolders={...t.customFolders,[u]:{list:o,page:d,total:i}}:(t.blocksTotal=i,t.elementsList=o)}),e.addMatcher(r.blocksApi.endpoints.getParentEmailBlocks.matchFulfilled,(t,{meta:n,payload:o})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||o?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.parentEmailBlocksTotal=i,t.parentEmailBlocksTotalPages=a}),e.addMatcher(r.blocksApi.endpoints.getTemplateBlocks.matchFulfilled,(t,{meta:n,payload:o})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||o?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.templateBlocks=o,t.templateBlocksTotal=i,t.templateBlocksTotalPages=a}),e.addMatcher(r.blocksApi.endpoints.editBlock.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(o=>o.id?.toString()===n.id?.toString()?Object.assign(o,{lock:n.lock,title:n.title,blocktags:n.blocktags}):o)})}}),{resetPagesAndTotal:xv,resetElementsList:Pv,toggleElementsView:Rv,removeBlockFromList:jv}=ro.actions,em=e=>e[Kn].blocksTotal,tm=e=>e[Kn].templateBlocksTotal,nm=e=>e[Kn].parentEmailBlocksTotal,rm=class extends Error{label;timeoutMs;constructor(e){super(`[sandbox:ready] iframe handshake timed out after ${e}ms`),this.name="SandboxReadyTimeoutError",this.label="sandbox:ready",this.timeoutMs=e}};function Qi(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.isInited=="function"&&typeof t.getTarget=="function"&&typeof t.onInit=="function"}function Xi(e,t,n){return e.isInited()&&e.getTarget()?Promise.resolve():(h.throwIfAborted(n),new Promise((o,i)=>{let a=!1,c,d;const u=f=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),d?.dispose(),n?.removeEventListener("abort",m),f())},m=()=>{u(()=>i(h.createAbortError(n?.reason)))};if(d=e.onInit(()=>{e.isInited()&&e.getTarget()&&u(()=>o())}),e.isInited()&&e.getTarget()){u(()=>o());return}t>0&&(c=setTimeout(()=>{u(()=>i(new rm(t)))},t)),n?.addEventListener("abort",m)}))}var om=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},An=(e,t)=>{om()},im=e=>[...e].sort((t,n)=>t.order-n.order).map(t=>t.hex.toUpperCase()),am=(e,t)=>{const n=Array.isArray(e?.usedColors)?e.usedColors:[],o=new Set,i=[];for(const a of[...n,...im(t)]){const c=String(a??"").trim().toUpperCase();!c||o.has(c)||(o.add(c),i.push(a))}return{...e,usedColors:i}},Ji,sm=e=>{Ji=e},Qn=e=>am(e,Ji?.colors??[]),lm=e=>{const t=r.useMessageService(),n=Mi(e),[o,i]=(0,l.useState)("");(0,l.useEffect)(()=>{sm(n);const c=n?.fonts??[];r.setCachedProjectFonts(c),gd(c),An("parent: cache + host @font-face synced",{projectId:e,fontsCount:c.length,families:c.map(d=>d.family?.trim()||d.name)})},[n,e]),(0,l.useEffect)(()=>{const c=n?.fonts??[],d=cd(c),u=JSON.stringify(d);if(u===o){An("parent: iframe send skipped (unchanged)",{entriesCount:d.length});return}An("parent: scheduling SANDBOX_SET_PROJECT_FONTS",{entriesCount:d.length,entries:d});const m=()=>{t.send(r.EVENT_TYPES.SANDBOX_SET_PROJECT_FONTS,d),i(u),An("parent: SANDBOX_SET_PROJECT_FONTS sent",{entriesCount:d.length})};if(t.inited){m();return}const f=t.onInit(()=>{m()});return()=>f.dispose()},[t,n,o]);const a=(0,l.useCallback)(()=>{An("parent: iframe reload — will resend project fonts map"),i("")},[]);Xr(a)};function cm(e,t){const n=e,o=n?.data?.operation!==void 0?n.data:n;if(o?.operation===t)return o.file instanceof File?o.file:void 0}async function dm(e,t){try{const n=await t.prepare(e),o=await t.upload(n);return o?{status:"uploaded",url:o}:{status:"failed",error:void 0}}catch(n){return{status:"failed",error:n}}}function um(){const[e,t]=(0,l.useState)(!1),n=r.useHeadless(),o=r.useEventEmitter(h.events.ON_BROWSER_EXTENSION_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=o.event(()=>{n||t(!0)});return()=>a.dispose()},[o,n]),{open:e,close:i}}function mm(){const[e,t]=(0,l.useState)(!1),n=r.useHeadless(),o=r.useEventEmitter(h.events.ON_BROWSER_TRANSLATE_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=o.event(()=>{n||t(!0)});return()=>a.dispose()},[o,n]),{open:e,close:i}}var pm=["translated-ltr","translated-rtl"],fm=".goog-te-banner-frame",oo=!1;function hm(e){if(e)return e;if(!(typeof document>"u"))return document}function gm(e){const t=hm(e);if(!t?.documentElement)return!1;const n=t.documentElement.classList;return pm.some(o=>n.contains(o))?!0:t.querySelector(fm)!=null}function ym(){oo=!1}function _m(e){const t=gm();return t&&!oo&&e(),oo=t,t}var bm=500;function vm(){const e=r.useEventEmitter(h.events.ON_BROWSER_TRANSLATE_DETECTED_ID),t=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(typeof window>"u")return;const n=()=>{_m(()=>{e.fire()})},o=()=>{t.current!=null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,n()},bm)};n();const i=()=>{o()},a=()=>{document.visibilityState==="visible"&&o()},c=new MutationObserver(()=>{o()});return c.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("focus",i),document.addEventListener("visibilitychange",a),()=>{t.current!=null&&clearTimeout(t.current),ym(),c.disconnect(),window.removeEventListener("focus",i),document.removeEventListener("visibilitychange",a)}},[e])}var io={},Zi=(0,l.createContext)(io),ea=(0,l.createContext)({current:io}),ta=(0,l.createContext)(()=>{});function Em({children:e}){const t=r.useDispatch(),n=r.useSelector(r.selectActiveSettingsTab),o=r.useEvent(h.SETTINGS_PANEL_EVENT),[i,a]=(0,l.useState)(io),c=(0,l.useRef)(i);return c.current=i,(0,l.useEffect)(()=>{const d=o(u=>{const m=u?.type===h.ADVANCED_SETTINGS_PANEL;if((!u||!u.type&&!u.content&&!u.advancedTabs?.length)&&n==="Properties")a({}),t(r.resetToLastActiveSettingsTab());else if(n!=="Properties"&&t(r.setActiveSettingsTab(r.PROPERTIES)),u.advancedTabs?.length&&!m&&!u.content){const f=u.advancedTabs.map(g=>({content:g.content,label:g.label,key:g.key,className:g.className}));a(g=>({settings:{},extraTabs:f}))}else if(m&&u.content){const f=u.advancedTabs?.map(g=>({content:g.content,label:g.label,key:g.key,className:g.className}));a(g=>({settings:{},type:u.type,content:u.content,instanceKey:u.instanceKey,parent:u.parent,caption:u.caption,extraTabs:f,deletable:u.deletable}))}});return()=>d.dispose()},[o,a,t,n]),(0,s.jsx)(ta.Provider,{value:a,children:(0,s.jsx)(ea.Provider,{value:c,children:(0,s.jsx)(Zi.Provider,{value:i,children:e})})})}function ao(){return(0,l.useContext)(Zi)}function Sm(){return(0,l.useContext)(ea)}function wm(){return(0,l.useContext)(ta)}var na={widthCodeSplit:50,isResizing:!1,currentSide:null},ra=(0,l.createContext)({current:na}),oa=(0,l.createContext)(na.widthCodeSplit),ia=(0,l.createContext)({isResizing:!1,currentSide:null}),aa=(0,l.createContext)({setWidthCodeSplit:()=>{},setIsResizing:()=>{},setCurrentSide:()=>{},setBlockMaxHeight:()=>{}}),sa=(0,l.createContext)("unset");function km({children:e}){const[t,n]=(0,l.useState)(()=>+window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes)||50),[o,i]=(0,l.useState)(!1),[a,c]=(0,l.useState)(null),[d,u]=(0,l.useState)("unset"),m=(0,l.useMemo)(()=>({widthCodeSplit:t,isResizing:o,currentSide:a}),[t,o,a]),f=(0,l.useMemo)(()=>({isResizing:o,currentSide:a}),[o,a]),g=(0,l.useRef)(m);g.current=m;const _=(0,l.useMemo)(()=>({setWidthCodeSplit:n,setIsResizing:i,setCurrentSide:c,setBlockMaxHeight:u}),[]);return(0,s.jsx)(aa.Provider,{value:_,children:(0,s.jsx)(ra.Provider,{value:g,children:(0,s.jsx)(ia.Provider,{value:f,children:(0,s.jsx)(oa.Provider,{value:t,children:(0,s.jsx)(sa.Provider,{value:d,children:e})})})})})}function la(){return(0,l.useContext)(ia)}function ca(){return(0,l.useContext)(oa)}function Cm(){return(0,l.useContext)(ra)}function Tm(){return(0,l.useContext)(sa)}function Im(){return(0,l.useContext)(aa)}var da=(0,l.createContext)({previewAlertShow:!1,templateNotEmAlertShow:!1}),ua=(0,l.createContext)({setPreviewAlertShow:()=>{},setTemplateNotEmAlertShow:()=>{}});function Am({children:e}){const[t,n]=(0,l.useState)(!1),[o,i]=(0,l.useState)(!1),a=(0,l.useMemo)(()=>({previewAlertShow:t,templateNotEmAlertShow:o}),[t,o]),c=(0,l.useMemo)(()=>({setPreviewAlertShow:n,setTemplateNotEmAlertShow:i}),[]);return(0,s.jsx)(ua.Provider,{value:c,children:(0,s.jsx)(da.Provider,{value:a,children:e})})}function xm(){return(0,l.useContext)(da)}function Pm(){return(0,l.useContext)(ua)}function Rm({className:e,sidePanelFloating:t,isCodeMode:n,codeModeDirection:o,children:i}){const a=Tm(),c=(0,l.useMemo)(()=>{const d=Number.isFinite(a)?`${a}px`:"unset";return{"--em-pane-block-height":t?n&&o==="bottom"?d:"calc(100% - 30px)":"100%"}},[t,n,o,a]);return(0,s.jsx)(y.ui_kit$Layout,{className:e,style:c,children:i})}function jm(){const[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let n=0;const o=window.requestAnimationFrame(()=>{n=window.requestAnimationFrame(()=>t(!0))});return()=>{window.cancelAnimationFrame(o),window.cancelAnimationFrame(n)}},[]),e}function Lm({maxPaneWidth:e,isCodeMode:t,codeModeDirection:n,isShowMobileSettings:o,desktopMobileSwitchPanel:i,children:a}){const c=r.useSelector(r.selectEmailWidth),{isResizing:d,currentSide:u}=la(),m=t&&n!=="bottom"&&!o&&i?"100%":c,f=jm(),g=(0,l.useMemo)(()=>({maxWidth:typeof m=="number"?Math.min(m,e):e,...f?{}:{transition:"none"}}),[m,e,f]);return(0,s.jsx)("div",{className:(0,nt.default)("email-pane__resizable",{"email-pane__resizable_drag":u||d}),style:g,children:a})}function Om({isCodeMode:e,codeModeDirection:t,sidePanelFloating:n,contentWrapperRef:o,children:i}){const a=ca(),c=(0,l.useMemo)(()=>({flexGrow:1,overflowY:n?"scroll":"hidden",overflowX:"hidden",height:e&&t==="bottom"?`calc(${a}%)`:"100%",width:`${t==="left"?100-a:t==="bottom"?100:a}%`}),[e,t,n,a]);return(0,s.jsx)(y.ui_kit$Col,{style:c,id:"pane-content-wrapper",ref:o,children:i})}function Mm({isCodeMode:e,codeModeDirection:t,children:n}){const o=ca(),i=(0,l.useMemo)(()=>({width:`${t==="right"?100-o:t==="bottom"?100:o}%`,position:"relative",height:t==="bottom"?`calc(${100-o}%)`:"unset",display:e?"initial":"none"}),[e,t,o]);return(0,s.jsx)(y.ui_kit$Col,{style:i,children:n})}function Nm({wrapperRef:e,children:t}){const{isResizing:n,currentSide:o}=la();return(0,s.jsx)("div",{className:(0,nt.default)("email-pane__content-col email-pane__content-col_main",{"email-pane__content-col_disable":o||n}),ref:e,children:t})}function Dm({isShowMobileSettings:e,headless:t,templateNotEmAlertEnabled:n}){const{__:o}=r.useI18n(),{previewAlertShow:i,templateNotEmAlertShow:a}=xm();return(0,s.jsxs)(s.Fragment,{children:[i&&e&&(0,s.jsx)(y.ui_kit$Alert,{title:o("Template is not mobile-friendly"),description:o("While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices."),type:"warning",className:"email-pane__col__alert",closable:!0}),a&&!t&&n&&(0,s.jsx)(y.ui_kit$Alert,{title:o("Template from another editor"),description:o("This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control."),type:"warning",className:"email-pane__col__alert",closable:!0})]})}function ma(){const e=r.useElementEntityKind(),t=r.useSelector(r.selectElementSettings$1),n=r.useSelector(r.selectElementSettings);return e==="email"?t:n}function Fm({isShowMobileSettings:e,propertiesPanelKey:t,onMouseLeave:n,email:o,onClosePanel:i}){const a=ma(),c=ao();return a?.type||c?.type||c?.content||c?.extraTabs?.length?(0,s.jsx)("div",{className:(0,nt.default)("email-pane__collapse-wrapper",{"mobile-view":e,"mobile-properties":e&&t!=="Structure"}),onMouseLeave:n,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Vi,{email:o,formSettings:c,onClosePanel:i})})}):null}function Bm({className:e,emailElementType:t}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Mu,{className:e,emailElementType:t,formSettings:ao()})})}function Um({isCodeMode:e,codeModeDirection:t}){const n=r.useElementEntityKind(),o=ma()?.type;return!(o===r.ELEMENT_TYPES.TEXT||o===r.ELEMENT_TYPES.LINK||o===r.ELEMENT_TYPES.IMG||o===r.ELEMENT_TYPES.BUTTON)||!e||t==="bottom"?null:(0,s.jsx)(Bm,{className:(0,nt.default)("selected-element-panel__content selected-element-panel__content_abs",{"selected-element-panel__hidden":o===r.ELEMENT_TYPES.IMG}),emailElementType:n})}function $m({isCodeMode:e,codeModeDirection:t,email:n,onClosePanel:o}){const i=ao();return i?.type!=="img"||!e||t==="bottom"?null:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper email-pane__collapse-wrapper_disabled",children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Vi,{email:n,formSettings:i,onClosePanel:o})})})}var Gm="code",zm=(e,t)=>(0,s.jsx)(t,{className:"email-pane__tab-bar",...e}),{Content:Wm}=y.ui_kit$Layout,Hm=()=>{to().catch(()=>{})},Zt=e=>(0,l.memo)(t=>(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(e,{...t})})),qm=Zt(Fu),Vm=Zt(Du),Ym=Zt(Bu),Km=Zt($u),Qm=(0,l.memo)(e=>(0,s.jsx)(ku,{...e})),Xm=(0,l.memo)((0,l.forwardRef)((e,t)=>(0,s.jsx)($i,{...e,ref:t}))),Jm=(0,l.memo)(e=>(0,s.jsx)(Ni,{...e})),Zm=Zt(Nu),ep=Zt(zu),tp=Zt(Gu),pa=({emailElement:e,isSuccess:t,setIsCollaborationEditor:n,isShowAddAllBlocksModal:o,triggerOpenSavedBlocksTab:i,setIsShowAddAllBlocksModal:a})=>{const{__:d,_x:u}=r.useI18n(),m=r.useMessageService(),{blockId:f}=r.useRouteParams(),g=r.useEditorProjectId(),_=r.useRouteEmailId(),p=r.useDispatch(),v=qr(),C=r.useOpenPlanCatalog(),{modal:k}=y.ui_kit$App.useApp(),S=r.useAppConfig(),I=r.useConfigSource(),A=r.useHeadless(),Y=r.useContainer(),ee=Yi("panel");Ou(Y),(0,l.useEffect)(()=>{Wt(Y).notePagePainted()},[Y]);const{token:j}=(0,y.ui_kit$useToken)(),R=r.useNotification(),N=r.usePushToDataLayer(),B=r.useProjectData(),D=vi(B?.id||g);lm(D);const O=r.useCookieManager(),$=r.useSelector(r.selectActiveSettingsTab),de=r.useCurrentUser(),ue=r.toLanguageCode(r.useInterfaceLocale()),z=r.useStore(),ie=Cm(),{setWidthCodeSplit:je,setIsResizing:pe,setCurrentSide:Qe,setBlockMaxHeight:be}=Im(),ge=r.useSelector(r.selectActiveModal$1),X=r.useSelector(r.selectIsCodeMode),he=r.useSelector(r.selectCodeModeDirection),[se,le]=(0,l.useState)(X);(0,l.useEffect)(()=>{X&&le(!0)},[X]);const Se=r.useSelector(em),Te=r.useSelector(tm),Ue=r.useSelector(nm),te=r.useSelector(r.selectPropertiesPanelKey),[ye]=r.useLazyClearAiChatQuery(),we=Zu(),ke=r.useSelector(r.selectEmailViewType)===r.MOBILE,[Ie,rt]=(0,l.useState)(r.LIGHT),[T,w]=(0,l.useState)(),[x,L]=(0,l.useState)(S.defaultBuildPanel||"empty"),[F,b]=(0,l.useState)("empty"),[H,Le]=(0,l.useState)(!1),[Pe,qe]=(0,l.useState)([]),[We,Xe]=(0,l.useState)([]),{setPreviewAlertShow:mt,setTemplateNotEmAlertShow:_t}=Pm(),{open:bt,close:pt}=um(),{open:W,close:J}=mm();vm();const Z=r.useRootElement(),fe=r.isEditorLockedByPlan(B,{isPlugin:!0}),et=r.usePlanFeatureGate("discussion"),ot=r.usePlanFeatureGate("code_editor"),me=Hi("ai"),Me=me.exceeded?r.getLimitUpgradePresetDefinition(me.exceeded.presetId):null,Ut=S?.configSwither||!1;(0,l.useEffect)(()=>{p(r.resetParentBlocks())},[p]),(0,l.useEffect)(()=>{const E=window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_active_tab);E&&p(r.setActiveSettingsTab(E))},[O,p]);const Ne=_||f,Ve=e.hasOwnProperty("type")?r.BLOCK:r.EMAIL,ae=wm(),ne=Sm(),G=(0,l.useRef)(null);(0,l.useEffect)(()=>r.onPanelSettingsSent(()=>{G.current=null}),[]);const ce=(0,l.useRef)(null),Re=(0,l.useRef)(),ve=(0,l.useRef)(),De=(0,l.useRef)(null),Je=(0,l.useRef)(),Oe=(0,l.useRef)(),tt=(0,l.useRef)(null),nn=(0,l.useRef)(!1),Tt=(0,l.useRef)(!1),vt=(0,l.useCallback)(()=>{Tt.current=!1},[]),Mt=(0,l.useCallback)(()=>{Tt.current=!0},[]),It=(0,l.useCallback)(E=>{E?.type===r.ELEMENT_TYPES.SOCIAL&&Mt()},[Mt]),[$t,rn]=(0,l.useState)(!1),[On,Mn]=(0,l.useState)(!1),[Nn]=r.useEditMeMutation(),[dt,At]=(0,l.useState)(!1),[Dn,Yt]=(0,l.useState)(0),[yn,re]=(0,l.useState)(!1),Ae=(0,l.useCallback)(()=>re(!1),[]),Fe=(0,l.useCallback)(()=>{re(!1),C()},[C]),[it,xe]=(0,l.useState)(!1),Kt=S.configSwither?localStorage.getItem("configSwither")==="pro"?!0:localStorage.getItem("configSwither")==="editor"?!1:S.mode==="pro":!1,xt=(0,l.useCallback)(()=>{clearTimeout(tt.current);const E=".blocks-search__result-holder";Z.querySelector(E)&&(Se||Te||Ue)&&(Z.querySelector(E).style.removeProperty("transition"),Z.querySelector(E).style.opacity=0,tt.current=setTimeout(()=>{r.measureBlockPreviews(Z,207/660),Z.querySelector(E)&&(Z.querySelector(E).style.transition="opacity 0.2s",Z.querySelectorAll(E).forEach(P=>P.style.opacity=1))},200))},[Te,Se,Ue]),st=(0,l.useRef)(void 0),Et=(0,l.useCallback)(E=>{const P=E.target;P&&(window.clearTimeout(st.current),st.current=window.setTimeout(()=>{rn(!!P.closest(".desktop_view")),Mn(!!P.closest(".mobile_view"))},100))},[]);(0,l.useEffect)(()=>()=>{window.clearTimeout(st.current)},[]),(0,l.useEffect)(()=>{const E=r.addDocumentListenerFromShadow(Z,"mouseover",Et);return()=>{E.dispose()}},[Z,Et]),(0,l.useEffect)(()=>{typeof n=="function"&&(We.length>0?n(!0):n(!1))},[We]);const[Qt]=r.useSendMessageMutation(),{data:ft={},refetch:M,status:q}=r.useGetDialogQuery({entity_id:Ne},{skip:!Ne||S.aiAssistentEnabled===!1||fe}),K=r.useEventEmitter(h.events.AI_TEXT_REQUEST_ID).hasListeners(),Q=r.useIsStandalone(),oe=!K&&!Q,V=(0,l.useMemo)(()=>oe?[{data:{role:"assistant",message:d("Typing..."),isLoading:!0}}]:[],[oe,d]),[Ce,_e]=(0,l.useState)([]),[ze,_n]=(0,l.useState)(S.defaultBuildPanel!==""?r.BLOCKS:r.ATOMS),Fn=(0,l.useRef)(null),ut=(0,l.useCallback)(()=>{const E=ve.current?.getBoundingClientRect(),P=T?.getBoundingClientRect();m.send({operation:r.EVENT_TYPES.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:X&&he!=="bottom"?0:30,scrollTop:-E?.top+P?.top+30,innerHeight:window.innerHeight,previewHeight:P?.height,mode:X&&he!=="bottom"?Gm:"default"}})},[he,X,T,m]),Fr=t&&e,bn=(0,l.useCallback)(E=>{const P=window.navigator.platform.match("Mac");S.codeEnabled&&S.codeSideEnabled&&E.altKey&&E.keyCode===88&&(v.toggle(),ot.isLocked&&(At(!0),Yt(r.FEATURE_UPSELL_SLIDE.code_editor))),((P?E.metaKey:E.ctrlKey)&&E.shiftKey&&E.keyCode===76||(P?E.metaKey:E.ctrlKey)&&E.shiftKey&&E.keyCode===69||(P?E.metaKey:E.ctrlKey)&&E.shiftKey&&E.keyCode===82)&&E.preventDefault()},[S.codeEnabled,ot.isLocked,S.codeSideEnabled,v]),wt=ge.includes("UPLOAD_IMAGE_")||ge.includes("UPLOAD_BACKGROUND_"),vn=(0,l.useRef)(!1),ht=(0,l.useCallback)(E=>{const P=E.target,U=P.closest(".email-pane__content-col")||P.closest(".email-pane__collapse-wrapper")||P.closest(".selected-element-panel-content")||P.closest(".selected-element-panel")||P.closest(".em-analytics__email-tab-properties")||P.closest(".em-analytics__email-tab-styles")||P.closest(".em-analytics__email-tab-history")||P.closest(".blocks-modal-container")||P.closest(".email-pane__sizes")||P.closest(".email-preview-menu")||P.closest(".monaco-editor")||P.closest(".ant-modal-wrap");vn.current=!!U},[]),Qs=(0,l.useCallback)(E=>{const P=vn.current,U=window.getSelection().toString().length>0||document.activeElement&&document.activeElement.tagName==="INPUT"&&document.activeElement.selectionStart!==document.activeElement.selectionEnd;vn.current=!1,!(P||U)&&(!document.querySelector(".easylogic-colorpicker")&&!Z.querySelector(".easylogic-colorpicker")&&!E.target.closest(".email-pane__content-col")&&!E.target.closest(".blocks-modal-container")&&!E.target.closest(".email-pane__collapse-wrapper")&&!E.target.closest(".selected-element-panel__columns-settings__controls__column__remove")&&!E.target.closest(".email-preview__content-col_main")&&!E.target.closest(".email-preview-menu")&&!E.target.closest(".monaco-editor")&&!E.target.closest(".main__pane-close-btn")&&!E.target.closest(".main__pane-trigger")&&!E.target.closest(".ant-modal-wrap")&&!E.target.closest(".email-pane__sizes")&&!E.target.closest(".ant-input-clear-icon")&&!E.target.closest(".ant-color-picker")&&!E.target.closest(".control-font-family-dropdown")&&!Fn.current&&!E.target.closest(".email-preview-menu__history")&&!E.target.closest(".selected-element-panel-content")&&!E.target.closest(".ant-select-dropdown")&&!E.target.closest(".ant-picker-dropdown")&&!E.target.closest(".toggle_view")&&!E.target.closest(".upload-bg-image__menu")&&!E.target.closest(".email-pane__paths")&&!E.target.closest(".ant-tabs-extra-content")&&!E.target.closest(".anticon-delete")&&!wt&&ge!==r.MODALS.IMAGE_EDITOR_MODAL&&($==="Properties"&&(Mt(),p(r.resetToLastActiveSettingsTab()),m.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),qe([])),$==="History"&&p(r.setActiveSettingsTab(r.BUILD)),p(r.switchIsPanelHistoryCollapsed(!0)),m.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),setTimeout(()=>{e.type?p(r.setElementSettings({type:null})):p(r.setElementSettings$1({type:null}))},300)),Fn.current=null)},[p,e.type,ge,$,m,wt]),[Vb,Xs]=(0,l.useState)(!0),{data:Wo=[],refetch:Br}=r.useGetCommentsQuery(Ne,{skip:!Ne||fe});(0,l.useEffect)(()=>{Ne&&!fe&&Br()},[$,Ne,fe,Br]),(0,l.useEffect)(()=>{Ne&&!Object.keys(ft).length&&q==="fulfilled"&&M()},[$,Ne,M,ft,q]),(0,l.useEffect)(()=>{const E=new h.Disposable,P=window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_active_tab);if(ft?.totalCount===0&&q!=="pending"){const $e={project_id:g,connection:"chat",entity_id:Ne,context:"default",locale:ue};!P&&oe&&r.runOnceInFlight(`email-default-context:${Ne}`,()=>{r.swallowPromiseRejection(Qt({body:$e}).then(()=>{E.isDisposed()||q==="fulfilled"&&M()}))})}const U={data:{role:"assistant",message:d("Typing..."),isLoading:!0}};return ft?.documents?.length>0?(window.localStorage.removeItem(r.LOCAL_STORAGE_ITEMS.em_active_tab),_e(ft?.documents),oe&&ft?.documents[ft?.documents?.length-1].data?.userInfo&&_e([...ft?.documents,U])):P||_e(oe?[U]:[]),()=>E.dispose()},[Ne,ue,ft?.totalCount,ft?.documents,oe,g,M,Qt,q]),(0,l.useEffect)(()=>{ae({}),p(Ve==="email"?r.setElementSettings$1({}):r.setElementSettings({}))},[p,Ve]);const Js=(0,l.useCallback)(E=>{p(r.setEmailSettings(Qn(E)))},[p]),Zs=(0,l.useCallback)(E=>{p(r.setBlockSettings(Qn(E)))},[p]),Bn=(0,l.useCallback)(E=>{p(Ve==="email"?r.setElementSettings$1(Qn(E)):r.setElementSettings(Qn(E)))},[p,Ve]);(0,l.useEffect)(()=>{const E=Je.current,P=De.current;w(X?P??E:E)},[X,he]);const[Yb,Kb]=(0,l.useState)(null),Qb=(0,l.useCallback)(E=>{S.sidePanelFloating&&(De.current=E),Kb(E)},[S.sidePanelFloating]),Un=(0,l.useCallback)(E=>{L(E),E==="search"?Le(!0):(Le(!1),b(E)),setTimeout(xt,50)},[xt]),Xb=(0,l.useCallback)(E=>{const P=E.data.operation,U=E.data,$e=E.data.action;if(P==="application_block_inserted"||E.data.operationId==="application_block_inserted"){const Be=E.data.operationId?E.data.data:U||{},Dt=Be.type==="project"||Be.type==="template"||Be.type==="common"?"block":"structure",Sn=Be.name||Be.type||(Dt==="block"?"block":"structure");N({event:"add",action:"add_element_to_email",element_type:Dt,element_name:Sn,entity_id:e?.id||_||f,project_id:B?.id||g})}if(P===r.EVENT_TYPES.APPLICATION_SCROLL_TO&&setTimeout(()=>{De.current?.scrollTo({top:E.data.settings.value,behavior:"smooth"})},100),P===r.EVENT_TYPES.APPLICATION_PREVIEW_ALERT_SHOW&&mt(U.settings.show),P===r.EVENT_TYPES.APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW&&_t(!0),P===r.EVENT_TYPES.APPLICATION_ACTION&&$e==="toggle_editor"&&v.toggle(),P===r.EVENT_TYPES.APPLICATION_IFRAME_SET_HEIGHT&&(Z.querySelector(".email-pane__iframe").style.height=U.settings.height+"px"),P===r.EVENT_TYPES.APPLICATION_EMAIL_SETTINGS_SET){let Be=Object.assign({},U.settings);delete Be.preheader,Object.values(Be).every(Dt=>!Dt)?(p(r.setEmailSettingsDisable(!0)),p(r.resetToLastActiveSettingsTab())):Js(U.settings),U.settings.noBlocks,p(r.setMobileViewActive(U.settings.responsive)),Xs(Be.structuresMedia)}if(P===r.EVENT_TYPES.APPLICATION_BLOCK_SETTINGS_SET&&(Object.values(U.settings).every(Be=>!Be)?(p(r.setBlockSettingsDisable(!0)),p(r.resetToLastActiveSettingsTab())):(Zs(U.settings),Xs(U.settings.structuresMedia))),P===r.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_SET){const Be=Object.values(r.ELEMENT_TYPES).includes(U.type),Dt=ne.current,Sn=Dt?.type==="advanced"&&!!Dt.content,St=U.tab?!0:!Be&&!Sn,{type:uv,caption:mv,settings:pv}=U,ll=JSON.stringify([uv,mv,pv]),fv=ll!==G.current;if(G.current=ll,St&&$==="Properties"&&p(r.resetToLastActiveSettingsTab()),U.type===r.ELEMENT_TYPES.EMPTY_TABLE||U.type===r.ELEMENT_TYPES.EMPTY_TD?(p(r.setActiveSettingsTab(r.BUILD)),U.type===r.ELEMENT_TYPES.EMPTY_TABLE?(_n(r.BLOCKS),U.tab?Un(U.tab):Un("common")):U.type===r.ELEMENT_TYPES.EMPTY_TD&&_n(r.ATOMS)):U.type&&$!=="Properties"?U.type===r.ELEMENT_TYPES.SOCIAL&&Tt.current?vt():(vt(),p(r.setActiveSettingsTab(r.PROPERTIES))):U.type!==r.ELEMENT_TYPES.SOCIAL&&vt(),!fv)return;U.type===r.ELEMENT_TYPES.CAROUSEL||U.type===r.ELEMENT_TYPES.ACCORDION||U.type===r.ELEMENT_TYPES.SOCIAL?(ae(on=>({settings:{...U.settings,type:St?null:U.type,caption:U.caption,parent:St?null:U.settings.parent},type:St?null:U.type,parent:St?null:U.settings.parent,caption:U.caption,extraTabs:on.extraTabs})),Bn({})):(Bn({...U.settings,type:St?null:U.type,parent:St?null:U.settings.parent,caption:U.caption}),ae(on=>!Be&&on.type==="advanced"&&on.content?{...on,settings:{...U.settings,type:U.type,parent:U.settings?.parent,caption:U.caption}}:on.extraTabs?.length?{extraTabs:on.extraTabs}:{})),U.settings?.path?.length>0&&qe(U.settings?.path)}P===r.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_CLOSE&&(G.current=null,ne.current?.type===r.ELEMENT_TYPES.SOCIAL&&Mt(),p(r.resetToLastActiveSettingsTab()))},[p,Js,Zs,Bn,$,Un,Z,N,e,_,f,B,vt,Mt,v,g,ne,ae,mt,_t]);(0,l.useEffect)(()=>{r.identifyUser({id:de?.id,email:de?.email,username:de?.name})},[de]),(0,l.useEffect)(()=>{},[fe,de.email_builder_config,de.id,p,z,I]),(0,l.useEffect)(()=>{X&&ot.isLocked&&v.toggle()},[]);const el=E=>{setTimeout(()=>{if(fe)p(r.changeConfig("pro")),xe(!0),At(!0),N({event:"change",action:"change_config_mode",config_mode:"pro",entity_id:e?.id||_||f,project_id:B?.id||g});else{let P=E?"pro":"editor";localStorage.setItem("configSwither",P),p(r.changeConfig(P)),N({event:"change",action:"change_config_mode",config_mode:P,entity_id:e?.id||_||f,project_id:B?.id||g})}},200)},Jb=()=>{X&&v.toggle(),p(r.resetToLastActiveSettingsTab()),p(r.changeConfig("simple")),xe(!1),At(!1),N({event:"change",action:"change_config_mode",config_mode:"simple",entity_id:e?.id||_||f,project_id:B?.id||g})},Zb=(0,l.useCallback)(()=>{At(!1)},[]);r.useListenPostMessage(Xb),r.useImageControlRequestCollector(),(0,l.useEffect)(()=>{const E=m.addListener(P=>{const U=cm(P,r.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP);if(!U)return;const $e=()=>m.send({operation:r.EVENT_TYPES.SANDBOX_NATIVE_IMAGE_DROP_CLEAR});(async()=>{const Be=await dm(U,{prepare:St=>r.prepareImageForEditorUpload(St,S),upload:we});if(Be.status!=="uploaded"){const{error:St}=Be;R.error({id:"IMAGE_UPLOAD_ERROR",data:U,title:d("Upload failed"),description:St instanceof Error&&St.message?St.message:d("The image could not be uploaded.")}),$e();return}m.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:r.ELEMENT_TYPES.IMG,settings:{src:Be.url}});const Dt=z.getState(),Sn=Ve==="email"?r.selectElementSettings$1(Dt):r.selectElementSettings(Dt);Sn?.type===r.ELEMENT_TYPES.IMG&&Bn({...Sn,src:Be.url,changeKey:"src"})})()});return()=>E.dispose()},[d,m,we,S,R,Bn,z,Ve]),(0,l.useEffect)(()=>{const E=m.addListener("application_atom_inserted",U=>{N({event:"add",action:"add_element_to_email",element_type:"atom",element_name:U||"atom",entity_id:e?.id||_||f,project_id:B?.id||g})}),P=m.addListener("application_block_inserted",U=>{const $e=U?.type==="project"||U?.type==="template"||U?.type==="common"?"block":"structure",Be=U?.name||U?.type||($e==="block"?"block":"structure");N({event:"add",action:"add_element_to_email",element_type:$e,element_name:Be,entity_id:e?.id||_||f,project_id:B?.id||g})});return()=>{E?.dispose(),P?.dispose()}},[m,N,e?.id,_,f,g,B?.id]);const ev=E=>{let P=Z.querySelector(".atoms__list");S.toggleSidePanel&&E===$?p(r.setActiveSettingsTab(r.DISABLED_TAB)):E==="Optimize"?Pt.comingSoonHandler(d,k):E!=="Properties"&&E!=="History"?(p(r.setActiveSettingsTab(E)),N({event:"navigate",action:"navigate_email_pane_tab",tab_name:E==="Disabled_tab"?"DISABLED_TAB":E,entity_id:e?.id||_||f,project_id:B?.id||g}),m.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),qe([])):(E==="Properties"||E==="History")&&N({event:"navigate",action:"navigate_email_pane_tab",tab_name:E,entity_id:e?.id||_||f,project_id:B?.id||g}),et.isLocked&&E==="Discuss"&&(At(!0),Yt(r.FEATURE_UPSELL_SLIDE.discussion)),fe&&E==="Optimise"&&(At(!0),Yt(6)),me.isLocked&&E==="AiChat"&&(me.state.state==="locked_by_limit"&&me.exceeded?re(!0):(At(!0),Yt(9)))},Ho=(0,l.useRef)(null),Ur=(0,l.useRef)(void 0),Nt=(0,l.useCallback)(()=>{const E=De.current?.getBoundingClientRect();if(Ho?.current?.getBoundingClientRect().top>=0&&E){const P=Math.round(E.height-30);Ho.current.style.height=`${P}px`,be(P-30)}Ur.current&&window.clearTimeout(Ur.current),Ur.current=window.setTimeout(function(){m.isInited()&&ut()},100)},[ut,m,be]);(0,l.useEffect)(()=>()=>{window.clearTimeout(Ur.current)},[]),(0,l.useEffect)(()=>($==="AiChat"&&!fe?ce.current=setInterval(()=>{M({entity_id:Ne})},5e3):clearInterval(ce.current),clearInterval(ce.current)),[Ne,fe,M,$]);const tv=E=>_n(E||""),nv=()=>{Le(!1),L(F)},qo=()=>{let E=Z.querySelector(".block-search__preview");E&&(E.style.opacity="0",E.style.transform="translateX(-99%)",setTimeout(function(){E.remove()},300))};let En=[];const $n={display:"flex",alignItems:"center",justifyContent:"center"};S.blocksEmptyEnabled&&En.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Empty blocks"),children:(0,s.jsx)("div",{style:$n,children:(0,s.jsx)(r.EmIcons,{icon:"BorderOuterOutlined",component:y.icons$BorderOuterOutlined,style:{fontSize:18}})})}),value:"empty"}),S.blocksSavedEnabled&&En.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Saved blocks"),children:(0,s.jsx)("div",{style:$n,children:(0,s.jsx)(r.EmIcons,{icon:"AppstoreAddOutlined",component:y.icons$AppstoreAddOutlined,style:{fontSize:18}})})}),value:"project"}),S.blocksCommonEnabled&&En.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Common blocks"),children:(0,s.jsx)("div",{style:$n,children:(0,s.jsx)(r.EmIcons,{icon:"AppstoreOutlined",component:y.icons$AppstoreOutlined,style:{fontSize:18}})})}),value:"common"}),S.blocksTemplateEnabled&&En.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Template blocks"),children:(0,s.jsx)("div",{style:$n,children:(0,s.jsx)(r.EmIcons,{icon:"BuildOutlined",component:y.icons$BuildOutlined,style:{fontSize:18}})})}),value:"template"}),S.blocksSearchEnabled&&En.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Blocks search"),children:(0,s.jsx)("div",{style:$n,children:(0,s.jsx)(r.EmIcons,{icon:"SearchOutlined",component:y.icons$SearchOutlined,style:{fontSize:18}})})}),value:"search"});const $r=x!=="empty"||H,rv=!S.blocksSectionsShow||$r?"100%":"calc(100% - 44px)";let ov=[{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Elements")}),key:r.ATOMS,className:"email-pane__collapse-panel email-pane__atoms",children:(0,s.jsx)(Jm,{})},{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Blocks")}),key:r.BLOCKS,className:"email-pane__collapse-panel email-pane__blocks-search",style:{height:rv},children:(0,s.jsxs)("div",{className:(0,nt.default)("email-pane__blocks-panel",{"email-pane__blocks-panel_scrollable":$r}),children:[S.blocksSectionsShow&&(0,s.jsxs)("div",{className:"email-pane__blocks-panel-header",children:[(0,s.jsxs)(y.ui_kit$Space.Compact,{block:!0,children:[!H&&(0,s.jsx)(y.ui_kit$Segmented,{block:!0,style:{width:"100%",marginTop:24},onChange:Un,value:x,options:En}),H&&(0,s.jsx)("div",{style:{width:"100%",height:36}}),H&&(0,s.jsx)("div",{style:{width:36,textAlign:"right",marginTop:22},children:(0,s.jsx)(r.EmIcons,{icon:"CloseOutlined",component:y.icons$CloseOutlined,style:{padding:"0 2px 0",cursor:"pointer"},onClick:nv})})]}),(0,s.jsx)("div",{className:"blocks-search__divider-wrapper",style:{marginTop:H?28:12},children:(0,s.jsx)(y.ui_kit$Divider,{className:"blocks-search__divider"})})]}),(0,s.jsxs)("div",{className:"email-pane__blocks-panel-body",children:[(0,s.jsx)("div",{className:"blocks-search__empty-shadow",style:{display:x==="empty"&&!H?"block":"none"},children:Vb?(0,s.jsx)(ui,{}):(0,s.jsx)(ci,{})}),(0,s.jsx)("div",{className:(0,nt.default)("email-pane__blocks-panel-results",{"email-pane__blocks-panel-results_visible":$r}),children:(0,s.jsx)(Km,{parentEmailId:e?.parent_email,blocksTab:x,search:H,reloadBlockScreens:xt,setIsShowAddAllBlocksModal:a})})]})]})}];const Gn=[{disabled:dt,key:r.PROPERTIES,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-properties",children:(0,s.jsx)(Fm,{isShowMobileSettings:ke,propertiesPanelKey:te,onMouseLeave:qo,email:e,onClosePanel:It})},{disabled:dt,key:r.HISTORY,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-history",children:Fr&&(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",onMouseLeave:qo,children:(0,s.jsx)(ep,{setCollapsedHistory:()=>p(r.switchIsPanelHistoryCollapsed(!0)),emailElement:Fr})})},{key:r.DISABLED_TAB,className:"em-analytics__email-tab-properties"},{disabled:dt,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Build","tab"),children:(0,s.jsx)(r.EmIcons,{"data-testid":"contentIcon",icon:"PlusCircleOutlined",component:y.icons$PlusCircleOutlined,size:24,strokeWidth:S.iconStrokeWidth})}),key:r.BUILD,className:"em-analytics__email-tab-build",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:(0,nt.default)("email-pane__collapse-wrapper",{"email-pane__collapse-wrapper_no-topleft-radius":$==="Build"||!$,"email-pane__collapse-wrapper_build":ze==="Blocks"&&$r}),onMouseLeave:qo,children:(0,s.jsx)(y.ui_kit$Tabs,{className:(0,nt.default)("secondary-tabs email-pane__collapse",{"secondary-tabs_unset_scroll":ze===r.BLOCKS}),size:"large",activeKey:ze,onChange:tv,items:ov})})},{disabled:dt,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Styles","tab"),children:(0,s.jsx)(r.EmIcons,{"data-testid":"stylesIcon",icon:"Styles",component:y.icons$Styles,size:24,strokeWidth:S.iconStrokeWidth})}),key:r.STYLES,className:"em-analytics__email-tab-styles",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Vm,{email:e})})}];S.commentsEnabled&&Gn.push({disabled:dt,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Discuss","tab"),children:[(0,s.jsx)(r.EmIcons,{"data-testid":"commentsIcon",icon:"CommentOutlined",component:y.icons$CommentOutlined,size:24,strokeWidth:S.iconStrokeWidth}),et.isLocked&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:S.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),!!Wo.length&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:Wo.filter(E=>E.comment_status!=="deleted").length})]}),key:"Discuss",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-wrapper",size:"large",activeKey:"Discuss",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Discuss")}),key:"Discuss",forceRender:!0,className:"email-settings__collapse-panel",children:Ne?(0,s.jsx)(tp,{email:e,comments:Wo,subjectId:Ne,isLoggedIn:!0,emailElementType:Ve}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})});const iv=()=>{ye({entity_id:Ne}).then(E=>{E.error?R.error({title:E.error.data.code,description:E.error.data.message}):E.data.success&&R.success({title:d("Success"),description:E.data.success}),fe||M()})};S.aiAssistentEnabled&&Gn.push({disabled:dt,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("AI assistant","tab"),children:[(0,s.jsx)(r.EmIcons,{"data-testid":"aiAssistentIcon",icon:"AI",component:y.icons$AI,size:24,strokeWidth:S.iconStrokeWidth}),me.isLocked&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:S.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),ft?.totalCount>0&&Ne&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:ft?.totalCount})]}),key:"AiChat",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-ai-wrapper",size:"large",activeKey:"AiChat",tabBarExtraContent:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Clear chat"),children:(0,s.jsx)(y.ui_kit$Popconfirm,{description:d("Clear chat history?"),onConfirm:iv,okText:d("Yes"),cancelText:d("No"),icon:"",placement:"leftTop",title:!1,children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(r.EmIcons,{icon:"ClearChat",component:y.icons$ClearChat,style:{fontSize:16}}),style:{marginRight:16}})})}),items:[{label:(0,s.jsx)(s.Fragment,{children:d("AI assistant")}),key:"AiChat",forceRender:!0,className:"email-settings__collapse-panel",children:Ne||window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_active_tab)?(0,s.jsx)(qm,{messages:Ce.length>0?Ce:V,newEmailAiGeneratorRef:nn}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})})}),S.optimizeEnabled&&Gn.push({disabled:dt,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Optimize","tab"),children:[(0,s.jsx)(r.EmIcons,{"data-testid":"optimizeIcon",icon:"Speed",component:y.icons$Speed,size:24,strokeWidth:S.iconStrokeWidth}),fe&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:S.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"})]}),key:"Optimise",className:"em-analytics__email-tab-optimise",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs secondary-tabs_optimise email-settings__collapse optimise-wrapper",size:"large",activeKey:"Optimise",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Optimize")}),key:"Optimise",forceRender:!0,className:"email-settings__collapse-panel",children:(0,s.jsx)(Ym,{})}]})})}),S.settingsEnabled&&Gn.push({disabled:dt,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Settings","tab"),children:(0,s.jsx)(r.EmIcons,{"data-testid":"settingsIcon",icon:"SettingOutlined",component:y.icons$SettingOutlined,size:24,strokeWidth:S.iconStrokeWidth})}),key:"Edit",className:"em-analytics__email-tab-edit",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Zm,{email:e})})});const tl=$===r.DISCUSS,nl=(0,l.useRef)(0),rl=(0,l.useRef)(0),ol=(0,l.useRef)(0),av=(0,l.useCallback)(()=>(Z.querySelector(".email-pane__col_preview")?.getBoundingClientRect().width??0)-(S.sidePanelFloating?0:38),[Z,S.sidePanelFloating]);(0,l.useEffect)(()=>{Ne&&!fe&&Br()},[Ne,fe,Br]),(0,l.useEffect)(()=>{const E=m.onInit(()=>{m.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_DISCUSS,value:tl})});return()=>E.dispose()},[tl,m]),(0,l.useEffect)(()=>{if(!T||!Qi(m))return;const E=new AbortController;return Xi(m,r.DEFAULT_SANDBOX_READY_TIMEOUT_MS,E.signal).then(()=>ut()).catch(()=>{}),()=>E.abort()},[T,ut,m]);const Vo=(0,l.useCallback)(E=>{const P=E??r.selectEmailWidth(z.getState());m.send({operation:r.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:typeof P=="number"?P+2:P}}),Re.current?.resize()},[z,m]);(0,l.useEffect)(()=>{if(!ke&&$!=="Disabled_tab"){const E=Z.querySelector(".email-pane__row")?.getBoundingClientRect().width;ve?.current?.getBoundingClientRect().width+540>E&&p(r.setEmailWidth("100%"))}},[p,$,Z,ke]);const Yo=(0,l.useCallback)(()=>{const E=ve.current;E&&(E.style.borderWidth="1px",S.sidePanelFloating||(E.style.marginLeft="-1px",E.style.marginRight="-1px"),E.style.borderLeftColor=null,E.style.borderRightColor=null)},[S.sidePanelFloating]),il=(0,l.useCallback)(E=>{const P=ie.current.widthCodeSplit;pe(!1),ie.current.currentSide&&(setTimeout(()=>Vo(),50),Qe(null)),E.target.classList.contains("email-pane__handle")||Yo(),window.localStorage.setItem(r.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes,JSON.stringify(P))},[Vo,ie,pe,Qe,Yo]),al=E=>P=>{P.target.classList.contains("email-pane__handle")&&(P.preventDefault(),nl.current=P.target.parentNode.offsetWidth,rl.current=P.pageX,ol.current=av(),Qe(E),Fn.current=E)},Gr=E=>{const P=ve.current,{currentSide:U}=ie.current;typeof E=="string"&&(!U||U===E)?(Z.querySelector(".email-pane__iframe").style.width="calc(100% + 1px)",E==="right"?(P.style.borderRightColor=j.colorPrimary,P.style.borderRightWidth="2px"):(P.style.borderLeftColor=j.colorPrimary,P.style.borderLeftWidth="2px",Z.querySelector(".email-pane__iframe").style.marginLeft="-1px")):U||(Yo(),Z.querySelector(".email-pane__iframe").style.width="1px",Z.querySelector(".email-pane__iframe").style.removeProperty("margin-left"))},sv=(0,l.useCallback)(()=>{pe(!0)},[pe]),Ko=(0,l.useCallback)(E=>{const{currentSide:P}=ie.current;if(!P)return;const U=(E.pageX-rl.current)*2,$e=nl.current+(P==="left"?-U:U),Be=Math.min(ol.current,1200);$e>318&&$e<Be&&(p(r.setEmailWidth(Math.min($e,1200))),Re.current?.resize())},[p,ie]),Qo=(0,l.useCallback)(E=>{if(ie.current.isResizing)if(he==="bottom"){const P=Oe.current.getBoundingClientRect().height,U=Oe.current.getBoundingClientRect().top,$e=(E.clientY-U)/P*100;if($e<20||$e>80)return;je($e),Nt()}else{const P=Oe.current.getBoundingClientRect().width,U=Oe.current.getBoundingClientRect().left,$e=(E.clientX-U)/P*100,Be=ve.current.getBoundingClientRect().width;if(S.desktopMobileSwitchPanel&&typeof Be=="number"&&Be<=425&&p(r.setEmailWidth(425)),$e<20||$e>80)return;je($e)}},[ie,je,he,Nt,p,S.desktopMobileSwitchPanel]);(0,l.useEffect)(()=>{Nt()},[X,Nt]);const lv=E=>{E?.stopPropagation?.();const P=Ie==="light"?r.DARK:r.LIGHT;m.send({operation:r.EVENT_TYPES.SANDBOX_SWITCH_THEME,data:{theme:P}}),rt(P)},sl=(E="panel")=>{const P=E==="panel",U=Ie===r.DARK,$e={size:P?18:16,strokeWidth:P?S.iconStrokeWidth:2};return(0,s.jsx)(y.ui_kit$Tooltip,{title:d(U?"Light theme":"Dark theme"),placement:P?"top":"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:P?U?"primary":"text":"default",icon:U?(0,s.jsx)(r.EmIcons,{icon:"LightMode",component:y.icons$LightMode,...$e}):(0,s.jsx)(r.EmIcons,{icon:"DarkMode",component:y.icons$DarkMode,...$e}),shape:"circle",size:P?void 0:"small",onClick:lv,className:"toggle_view theme_view email-pane__theme-toggle",style:P?void 0:{left:4,top:4,zIndex:999,padding:0,position:"absolute"}})})},Xo=E=>{const P=typeof E=="number"?Math.min(E,1200):E;p(r.setEmailWidth(P)),setTimeout(()=>Vo(P),700);const U=typeof P=="number"?P:P==="100%"?"full":P,$e=typeof P=="number"&&P<=425?"mobile":"desktop";N({event:"change",action:"change_email_size",email_id:e?.id||_||f,project_id:B?.id||g,width:U,view_type:$e})};(0,l.useEffect)(()=>{const E=new h.Disposable;return E.addDisposable(r.addWindowListenerFromShadow(Z,"mousedown",ht,!0)),E.addDisposable(r.addWindowListenerFromShadow(Z,"click",Qs)),E.addDisposable(r.addWindowListenerFromShadow(Z,"mouseup",P=>il(P),!0)),()=>{E.dispose()}},[Z,Qs,ht,il]),(0,l.useEffect)(()=>{const E=De.current;if(!E||typeof ResizeObserver!="function")return;const P=new ResizeObserver(Nt);return P.observe(E),()=>P.disconnect()},[Nt,S.sidePanelFloating]),(0,l.useEffect)(()=>(window.addEventListener("scroll",Nt,!0),window.addEventListener("mousemove",Ko,!0),window.addEventListener("mousemove",Qo),window.addEventListener("keydown",bn),()=>{window.removeEventListener("mousemove",Ko,!0),window.removeEventListener("mousemove",Qo),window.removeEventListener("scroll",Nt,!0),window.removeEventListener("keydown",bn)}),[Nt,Ko,Qo,bn]);const cv=E=>{const P=X?"visual":"code",U=!X;if(X?v.toggle():typeof E=="string"?(v.setDirection(E),!X&&v.toggle()):v.toggle(),U){const $e=Ve==="block"?"block":"email",Be=typeof E=="string"?E:he||"toggle";N({event:"activate",action:"activate_code_mode",entity_type:$e,entity_id:e?.id||_||f,project_id:B?.id||g,code_mode_direction:Be})}N({event:"change",action:"change_editor_mode",editor_mode:P,entity_id:e?.id||_||f,project_id:B?.id||g}),p(r.resetToLastActiveSettingsTab()),setTimeout(()=>{p(Ve==="block"?r.setElementSettings({type:null}):r.setElementSettings$1({type:null}))},300),m.send({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),p(r.resetPanes())};(0,l.useEffect)(()=>{S.emailPaneDesktopSize&&p(r.setEmailWidth(S.emailPaneDesktopSize))},[p,S.emailPaneDesktopSize]);const dv=()=>{_n(r.BLOCKS),Un("project")};return(0,l.useEffect)(()=>{i&&dv()},[i]),(0,s.jsx)(r.ElementEntityKindProvider,{kind:Ve,children:(0,s.jsxs)(Rm,{className:(0,nt.default)("email-pane",{"email-pane_code-mode":X,"email-pane_only_code_mode_mobile":S.onlyCodeModeInMobile,"email-pane_code-mode-bottom":X&&he==="bottom","email-pane_no-element-navigation":!S.switchDesktopMobilePropsEnabled&&!S.stepToOtherElementEnabled&&!S.deleteButtonEnabled,"email-pane_is-mobile":ke,"email-pane_path-enabled":S.pathEnabled}),sidePanelFloating:!!S.sidePanelFloating,isCodeMode:!!X,codeModeDirection:String(he),children:[(0,s.jsxs)(Wm,{className:"email-pane__container",ref:Je,children:[(0,s.jsx)(Um,{isCodeMode:X,codeModeDirection:he}),(0,s.jsx)(Dm,{isShowMobileSettings:ke,headless:!!A,templateNotEmAlertEnabled:!!S.templateNotEmAlertShow}),(0,s.jsxs)(y.ui_kit$Row,{ref:Oe,className:(0,nt.default)("email-pane__row",{"email-pane__left":X&&he==="right","email-pane__right":X&&he==="left","email-pane__bottom":X&&he==="bottom","email-pane__sizeSwitcher":S.desktopMobileSwitchPanel,"email-pane__reverse":S.menuDirection==="left","email-pane__pinch":!S.sidePanelFloating}),children:[(0,s.jsxs)(Om,{isCodeMode:X,codeModeDirection:he,sidePanelFloating:S.sidePanelFloating,contentWrapperRef:Qb,children:[(0,s.jsx)("div",{className:"email-pane__iframe-scroll-top",id:"iframe-scroll-top"}),S.desktopMobileSwitchPanel&&(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel-wrapper",orientation:"vertical",size:10,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel",size:0,children:[sl("panel"),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Desktop view"),placement:"top",open:$t,children:(0,s.jsx)(y.ui_kit$Button,{type:ke?"text":"primary",icon:(0,s.jsx)(r.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:18,strokeWidth:S.iconStrokeWidth}),shape:"circle",onClick:()=>Xo(S.emailPaneDesktopSize||1e3),className:"toggle_view desktop_view"})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Mobile view"),placement:"top",open:On,children:(0,s.jsx)(y.ui_kit$Button,{type:ke?"primary":"text",icon:(0,s.jsx)(r.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:18,strokeWidth:S.iconStrokeWidth}),shape:"circle",onClick:()=>Xo(425),className:"toggle_view mobile_view"})})]}),S.codeSideEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Code mode"),placement:"right",children:(0,s.jsx)(y.ui_kit$Button,{type:X?"primary":"default",icon:(0,s.jsx)(r.EmIcons,{icon:"Code",component:y.icons$Code}),shape:"circle",onClick:()=>cv("right")})})]}),(0,s.jsxs)(y.ui_kit$Row,{className:(0,nt.default)("email-pane__col-wrapper",{container:X&&he==="bottom"||!X,"email-pane__col-wrapper_reverse":S.menuDirection==="left","email-pane__col-wrapper_pinch":!S.sidePanelFloating}),style:{flexGrow:1,maxWidth:"unset",paddingTop:S.desktopMobileSwitchPanel&&X&&he!=="bottom"?"60px":""},children:[(0,s.jsxs)(y.ui_kit$Col,{className:"email-pane__col email-pane__col_preview",style:{flexGrow:1,maxWidth:"unset"},ref:S.sidePanelFloating?null:De,children:[S.desktopMobileSwitchRule&&(0,s.jsx)(Vd,{onSelectWidth:Xo,themeToggle:sl("rule")}),(0,s.jsxs)(Lm,{maxPaneWidth:1200,isCodeMode:X,codeModeDirection:he,isShowMobileSettings:ke,desktopMobileSwitchPanel:S.desktopMobileSwitchPanel,children:[(0,s.jsx)("div",{className:"email-pane__handle left",onMouseDown:al("left"),onMouseEnter:()=>Gr("left"),onMouseLeave:Gr}),(0,s.jsx)("div",{className:"email-pane__handle right",onMouseDown:al("right"),onMouseEnter:()=>Gr("right"),onMouseLeave:Gr}),(0,s.jsx)(Nm,{wrapperRef:ve,children:(0,s.jsx)(Xm,{ref:Re,className:"email-pane__iframe",email:e,handlerSendPosition:Nt,clip:Yb})})]})]}),(0,s.jsx)(y.ui_kit$Col,{style:{display:X&&he!=="bottom"||S.disableSideMenu?"none":"initial"},ref:Ho,onPointerEnter:Hm,className:(0,nt.default)("email-pane__content-col email-pane__content-col_menu email-pane__content-col_tabs email-pane__col email-pane__col_settings",{"email-pane__col_disabled":$===r.DISABLED_TAB}),children:(!X||he==="bottom")&&ee&&(0,s.jsx)(y.ui_kit$Tabs,{className:(0,nt.default)("email-pane__col_settings-inner",{"email-pane__col_settings-inner_reverse":S.menuDirection==="left"}),size:"medium",activeKey:$,onTabClick:ev,renderTabBar:zm,tabPlacement:"right",items:Gn,tabBarExtraContent:Ut&&(0,s.jsx)("div",{style:{paddingTop:15,textAlign:"center"},children:fe?(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:el,checked:it}):(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:el,defaultChecked:Kt})})})})]}),(0,s.jsx)("div",{className:"email-pane__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,s.jsxs)(Mm,{isCodeMode:X,codeModeDirection:he,children:[(0,s.jsx)("div",{className:"email-pane__code-divider",onMouseDown:sv}),(0,s.jsx)("div",{className:"code-mode__pane code-mode__pane_editor email-pane__pane email-pane__pane_editor",children:(0,s.jsx)("div",{className:"code-mode__pane-content email-pane__pane-content",children:se&&ee&&(0,s.jsx)(Qm,{email:e,setOtherUsers:Xe,readOnly:S.lockEditor,newEmailAiGeneratorRef:nn})})})]})]}),S.pathEnabled&&(0,s.jsxs)("div",{className:"email-pane__paths",children:[(0,s.jsx)(Cu,{elementPath:Pe}),(0,s.jsx)(Iu,{fallbackHtml:e?.html})]}),(0,s.jsx)("div",{className:"collaborator-list",children:(0,s.jsx)(r.CollaboratorList,{users:We,isEditor:!1,isPlugin:!0,token:j})})]}),(0,s.jsx)($m,{isCodeMode:X,codeModeDirection:he,email:e,onClosePanel:It}),(0,s.jsx)(Ku,{}),(0,s.jsx)(r.PlanUpgradePrompt,{open:dt,onCancel:Jb,onTrialActivated:Zb,initialSlide:Dn}),Me&&me.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(no,{open:yn,onClose:Ae,title:d(Me.titleKey),subtitle:d(Me.subtitleKey),usageResource:Me.usageResource,previousDisplay:r.presetLimitDisplay(me.exceeded.previousLimit),nextDisplay:r.presetLimitDisplay(me.exceeded.nextLimit),onChangePlan:Fe})}):null,(0,s.jsx)(Au,{open:bt,onClose:pt}),(0,s.jsx)(Pu,{open:W,onClose:J})]})})};pa.propTypes={};var np=e=>(0,s.jsx)(Em,{children:(0,s.jsx)(km,{children:(0,s.jsx)(Am,{children:(0,s.jsx)(pa,{...e})})})}),rp=(0,l.memo)(np),op=({open:e,onClose:t})=>{const{__:n}=r.useI18n(),o=r.getSupportEmail(),[i,a=""]=n("To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.").split("{supportEmail}");return(0,s.jsx)(y.ui_kit$Modal,{width:440,open:e,onCancel:t,title:(0,s.jsxs)("div",{style:{paddingBottom:8},children:[(0,s.jsx)(r.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:20,strokeWidth:2})," ",n("Email confirmation required")]}),footer:[(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:n("Got it")},"ok")],children:(0,s.jsxs)("p",{children:[i,(0,s.jsx)("a",{href:`mailto:${o}`,children:o}),a]})})},Xn=e=>{const t=r.useCurrentUser(),[n,o]=(0,l.useState)({owner:!1,admin:!1,user:!1}),i=r.useProjectData(),{data:a}=r.useGetProjectQuery(e,{skip:!e||!t.id||!!i}),c=i||a;return(0,l.useEffect)(()=>{if(c){const d=r.getMyProjectRole(c,t);o({owner:d==="owner",admin:d==="admin",user:d==="user"})}},[c,t]),n},fa=r.getLimitUpgradePresetDefinition("preview_exceeded"),ha=({emailElement:e,isCollaborationEditor:t})=>{const{__:n}=r.useI18n(),o=r.useDispatch(),i=qr(),a=r.useOpenPlanCatalog(),c=r.useSendPostMessage(),{blockId:d}=r.useRouteParams(),u=r.useRouteEmailId(),m=r.useSelector(r.selectActiveModal$1)===r.MODALS.SEND_TEST_EMAIL,f=Tn(m),[g,_]=(0,l.useState)(!1),[p,v]=r.useSendLivePreviewMutation(),C=r.useCurrentUser(),k=r.useDocumentHistoryReader(),S=r.useProjectPlanLimitPreflight(),{owner:I}=Xn(),A=r.useDocumentUndo(),Y=r.useDocumentUndoState(),ee=r.useContentReader(),j=r.useSelector(r.selectIsPanelHistoryCollapsed),R=r.useSelector(r.selectIsCodeMode),N=r.useSelector(r.selectCodeModeDirection),{token:B}=(0,y.ui_kit$useToken)(),D=r.useNotification(),O=r.useAppConfig(),$=e.hasOwnProperty("type")?r.BLOCK:r.EMAIL,de=r.useEventEmitter(h.events.ON_SHARE_ID),ue=r.useEventEmitter(h.events.ON_SHOW_PREVIEW_ID),[z,ie]=(0,l.useState)(!1),[je,pe]=(0,l.useState)(0),[Qe,be]=(0,l.useState)(!1),ge=Tn(Qe),[X,he]=(0,l.useState)(fa),[se,le]=(0,l.useState)(n("—")),Se=(0,l.useCallback)(()=>{be(!1),a()},[a]),[Te,Ue]=(0,l.useState)(!1),te=r.useProjectData(),ye=r.usePlanFeatureGate("version_history"),we=r.usePlanFeatureGate("code_editor"),ke=r.usePlanFeatureGate("preview_service"),Ie=r.usePlanFeatureGate("undo_redo"),rt=r.isEditorLockedByPlan(te,{isPlugin:!0}),T=r.usePushToDataLayer(),w=e?.project,x=me=>{const Me=$==="block"?"block":"email";typeof me=="string"?(i.setDirection(me),!R&&i.toggle()):i.toggle(),T({event:"activate",action:"activate_code_mode",entity_type:Me,entity_id:e?.id||u||d,project_id:e?.project||w}),setTimeout(()=>{o($==="block"?r.setElementSettings({type:null}):r.setElementSettings$1({type:null}))},300),c({operation:r.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),we.isLocked&&(ie(!0),pe(r.FEATURE_UPSELL_SLIDE.code_editor))},L=(0,l.useCallback)(async me=>!0,[S]),F=(0,l.useCallback)(()=>be(!1),[]),b=async()=>{if(rt){ie(!0),pe(8);return}await L("test_sends")&&(o(r.openModal$1(r.MODALS.SEND_TEST_EMAIL)),T({event:"open",action:"open_test_email_modal",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||w}))},H=()=>{ie(!0),pe(r.FEATURE_UPSELL_SLIDE.undo_redo)},Le=()=>{A.undo()},Pe=()=>{A.redo()},qe=async()=>{const me=(await de.fire({project:w,id:u})).find(Me=>Me===!1||typeof Me=="string");me!==!1&&navigator.clipboard.writeText(me||r.buildEmailRawShareUrl(u,w)).then(()=>{D.success(n("A shareable link to this page has been copied to the clipboard.")),T({event:"click",action:"share_email",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||w})})},We=async()=>{if(!g){if(!await L("preview"))return;const me={email:u,subject:encodeURIComponent("#"+e.project+" "+e.title).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A"),content:encodeURIComponent(ee()).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A")};p(me),_(!0),T({event:"click",action:"open_email_inbox_tests",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||w})}},Xe=(0,l.useCallback)(async()=>{await L("preview")&&(he(fa),le(n("—")),be(!0))},[n,L]);(0,l.useEffect)(()=>{v.isError&&(D.error(v),_(!1))},[v]),(0,l.useEffect)(()=>{if(v.isSuccess&&g){if(v.data?.status===401)D.error({title:v.data.code,description:v.data.message});else if(v.data){let me=document.createElement("A");me.setAttribute("target","_blank"),me.setAttribute("href",v.data.message),me.click()}_(!1)}},[v,g,D]);const[mt,_t]=(0,l.useState)(!1),bt=()=>{c({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:j}),o(r.switchIsPanelHistoryCollapsed(!j))},pt=()=>k(e?.id),W=()=>{j?(_t(!0),pt().then(me=>{me.isSuccess?me.data.data.length:me.isError&&D.error(me),bt(),o(r.setActiveSettingsTab(r.HISTORY)),_t(!1),T({event:"open",action:"open_version_control",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||w}),ye.isLocked&&(ie(!0),pe(r.FEATURE_UPSELL_SLIDE.version_history))})):(o(r.resetToLastActiveSettingsTab()),bt())},J=()=>{j||(bt(),o(r.resetToLastActiveSettingsTab())),R&&i.toggle(),ie(!1)};let Z=[];const fe=(0,l.useCallback)(async()=>{const me=await ue.fire({project:w,id:u});me.find(Me=>Me===!1||typeof Me=="string")!==!1&&(window.open(me.find(Me=>Me)||r.buildEmailRawSharePath(u,w)),T({event:"click",action:"open_email_preview",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||w}))},[ue,w,u,T,$,e,d]),et=(0,l.useCallback)(async()=>{window.open(r.buildGetElementPreviewPath(r.EMAIL,u,w)),T({event:"click",action:"open_web_version",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||w})},[w,u,T,$,e,d]);O.previewModeEnabled&&Z.push({key:"Preview_mode",icon:(0,s.jsx)(r.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:18,strokeWidth:O.iconStrokeWidth}),label:n("Preview mode"),onClick:fe}),O.livePreviewEnabled&&Z.push({key:"Live_preview",icon:g?(0,s.jsx)(r.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,style:{fontSize:16}}):(0,s.jsx)(r.EmIcons,{icon:"CheckCircleVerified",component:y.icons$CheckCircleVerified,size:18,strokeWidth:O.iconStrokeWidth}),label:n("Live preview"),onClick:C.id?.toString()===e.project_author?.toString()&&C?.subscription?.post_name==="community"&&I?Xe:We}),O.webversionEnabled&&Z.push({key:"Web version",icon:(0,s.jsx)(r.EmIcons,{icon:"Web",component:y.icons$Web,size:18,strokeWidth:O.iconStrokeWidth}),label:n("Web version"),onClick:et}),O.sharePreviewEnabled&&Z.push({key:"Share",icon:(0,s.jsx)(r.EmIcons,{icon:"ShareAltOutlined",component:y.icons$ShareAltOutlined,size:18,strokeWidth:O.iconStrokeWidth}),label:n("Share"),onClick:qe,className:"em-analytics__email-share"});const ot=[{key:"Left_mode",icon:(0,s.jsx)(r.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:O.iconStrokeWidth,style:{color:N==="left"&&R?B.colorPrimary:"inherit"}}),label:n("Left Code panel"),onClick:()=>x("left")},{key:"Right_mode",icon:(0,s.jsx)(r.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:O.iconStrokeWidth,style:{transform:"rotate(180deg)",color:N==="right"&&R?B.colorPrimary:"inherit"}}),label:n("Right Code panel"),onClick:()=>x("right")},{key:"Bottom_mode",icon:(0,s.jsx)(r.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:O.iconStrokeWidth,style:{transform:"rotate(-90deg)",color:N==="bottom"&&R?B.colorPrimary:"inherit"}}),label:n("Bottom Code panel"),onClick:()=>x("bottom")}];return(0,s.jsxs)("div",{className:"email-preview-menu email-preview-menu_new",children:[(0,s.jsxs)(y.ui_kit$Space,{size:32,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-preview-menu__versions",size:8,style:{borderRadius:`calc(${r.emCssVar("borderRadius")} * 1px)`},children:[(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?r.COLLABORATION_EDITOR_WARNING_TEXT:"Undo (Ctrl+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.EmIcons,{icon:"UndoOutlined",component:y.icons$UndoOutlined,size:22,strokeWidth:O.iconStrokeWidth}),Ie.isLocked&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:O.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:Ie.isLocked?H:Le,disabled:!Ie.isLocked&&!Y.canUndo})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?r.COLLABORATION_EDITOR_WARNING_TEXT:"Redo (Ctrl+Shift+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.EmIcons,{icon:"RedoOutlined",component:y.icons$RedoOutlined,size:22,strokeWidth:O.iconStrokeWidth}),Ie.isLocked&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:O.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:Ie.isLocked?H:Pe,disabled:!Ie.isLocked&&!Y.canRedo})}),O.historyEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Version history"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:j?"text":"primary",ghost:!j,onClick:W,disabled:e.isNew||mt,className:"email-preview-menu__history",icon:mt?(0,s.jsx)(y.ui_kit$Spin,{size:"small"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.EmIcons,{icon:"HistoryOutlined",component:y.icons$HistoryOutlined,size:22,strokeWidth:O.iconStrokeWidth,className:"email-preview-menu__list-item-icon email-preview-menu__list-item-icon_revert"}),ye.isLocked&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:O.iconStrokeWidth,className:"free-mode-firewall-icon"})]})})})]}),(0,s.jsxs)(y.ui_kit$Space,{size:8,style:{borderRadius:`calc(${r.emCssVar("borderRadius")} * 1px)`},children:[O.codeEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:ot},trigger:"hover",mouseEnterDelay:0,className:"email-preview-menu__code",children:(0,s.jsx)(y.ui_kit$Button,{type:R?"primary":"text",ghost:R,icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.EmIcons,{icon:"Code",component:y.icons$Code,size:22,strokeWidth:O.iconStrokeWidth}),we.isLocked&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:O.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:x})},"Code mode"),O.previewIconEnabled&&(ke.isLocked?(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Preview mode"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:O.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:O.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:()=>{ie(!0),pe(r.FEATURE_UPSELL_SLIDE.preview_service)}})}):(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:Z},className:"email-preview-menu__preview",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",target:"_blank",rel:"noreferrer",icon:(0,s.jsx)(r.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:O.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),onClick:O.previewModeEnabled?fe:void 0})},"Preview")),O.sendTestEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Send a test email"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-open-test email-preview-menu__test",type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:22,strokeWidth:O.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),rt&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:O.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:b})})]})]}),f&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(qu,{isModalVisible:m,email:e})}),(0,s.jsx)(op,{open:Te,onClose:()=>Ue(!1)}),(0,s.jsx)(r.PlanUpgradePrompt,{open:z,onCancel:J,initialSlide:je}),ge&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(no,{open:Qe,onClose:F,title:n(X.titleKey),subtitle:n(X.subtitleKey),usageResource:X.usageResource,previousDisplay:se,nextDisplay:r.presetLimitDisplay("infinity"),onChangePlan:Se})})]})};ha.propTypes={};var ip=[["brace-percent",/<!--\{%/],["brace-hash",/<!--\{#/],["proscript",/<!--\[%/],["getresponse",/<!--\[\[(?:if|else\]\]|endif\]\])/i],["mailchimp",/<!--\*\|/],["expert-sender",/<!--<\/?(?:if|else|var)/i]],ap=200;function ga(e=new Set){const t=new Set;return(n,o)=>{if(!ip.some(([a,c])=>!e.has(a)&&c.test(n)))return;const i=o??`new:${n.length}:${n.slice(0,200)}`;t.has(i)||(t.size>=ap&&t.clear(),t.add(i))}}function ya(){return{isConfigured:()=>!1,toEditorForm:e=>e,toOutputForm:e=>e,keepWrappedOnOutput:new Set,editorPolicy:{},warnAboutUnconfiguredInput:ga()}}var sp=ya();function ln(e){return e?.getInstance(h.TEMPLATE_DIRECTIVES_ID)??sp}function lp({html:e,renderGuid:t,showToken:n,showId:o,...i},a){const{requested:c}=r.getCurrentProject(a),d=r.getAppConfig(a);return r.filterUndefined({...i,code:ln(a).toOutputForm(e),project:c===void 0?i.project:c,utm_parameters:d.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}var cp=Gt.__commonJSMin(((e,t)=>{r.init__polyfill_node_global(),(function(n,o){typeof define=="function"&&define.amd?define([],o):typeof e<"u"?o():(o(),n.FileSaver={})})(e,function(){"use strict";function n(m,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(m.type)?new Blob(["\uFEFF",m],{type:m.type}):m}function o(m,f,g){var _=new XMLHttpRequest;_.open("GET",m),_.responseType="blob",_.onload=function(){u(_.response,f,g)},_.onerror=function(){},_.send()}function i(m){var f=new XMLHttpRequest;f.open("HEAD",m,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function a(m){try{m.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),m.dispatchEvent(f)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof r._polyfill_node_global_default=="object"&&r._polyfill_node_global_default.global===r._polyfill_node_global_default?r._polyfill_node_global_default:void 0,d=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(m,f,g){var _=c.URL||c.webkitURL,p=document.createElement("a");f=f||m.name||"download",p.download=f,p.rel="noopener",typeof m=="string"?(p.href=m,p.origin===location.origin?a(p):i(p.href)?o(m,f,g):a(p,p.target="_blank")):(p.href=_.createObjectURL(m),setTimeout(function(){_.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(m,f,g){if(f=f||m.name||"download",typeof m!="string")navigator.msSaveOrOpenBlob(n(m,g),f);else if(i(m))o(m,f,g);else{var _=document.createElement("a");_.href=m,_.target="_blank",setTimeout(function(){a(_)})}}:function(m,f,g,_){if(_=_||open("","_blank"),_&&(_.document.title=_.document.body.innerText="downloading..."),typeof m=="string")return o(m,f,g);var p=m.type==="application/octet-stream",v=/constructor/i.test(c.HTMLElement)||c.safari,C=/CriOS\/[\d]+/.test(navigator.userAgent);if((C||p&&v||d)&&typeof FileReader<"u"){var k=new FileReader;k.onloadend=function(){var A=k.result;A=C?A:A.replace(/^data:[^;]*;/,"data:attachment/file;"),_?_.location.href=A:location=A,_=null},k.readAsDataURL(m)}else{var S=c.URL||c.webkitURL,I=S.createObjectURL(m);_?_.location=I:location.href=I,_=null,setTimeout(function(){S.revokeObjectURL(I)},4e4)}});c.saveAs=u.saveAs=u,typeof t<"u"&&(t.exports=u)})})),cn=cp(),xn="NEXT_BUTTON",so="SAVE_BUTTON",lo="KEYBOARD",dp="EXTERNAL",up=new Set([so,xn,lo]);function mp(e){return e!=null&&e!==""&&up.has(e)}function _a(e){if(!e||e==="all")return;const t=Number(e);return Number.isFinite(t)?[t]:void 0}var ba=(0,l.createContext)(null);function pp(){const e=(0,l.useContext)(ba);if(!e)throw new Error("useEmailSaveController must be used within EmailSaveContext.Provider");return e}var fp=2;function hp({email:e,documentSession:t,save:n,saveState:o}){const i=r.useDispatch(),{__:a}=r.useI18n(),c=r.useEditorProjectId(),d=+c,u=Number.isFinite(d)&&d>0?d:e?.project,m=r.useCookieManager(),f=r.useContainer(),g=r.useNotification(),_=r.useAppConfig(),p=r.useConfigSource(),[v,C]=(0,l.useState)(0),k=(0,l.useRef)(""),[S,I]=(0,l.useState)(!1),A=r.useEventEmitter(h.events.ON_NEXTBUTTON_CLICK_ID),Y=r.useEventEmitter(h.events.ON_SAVEBUTTON_CLICK_ID);r.useEvent(h.events.ON_EMAIL_INIT_ID);const ee=_.activeNextButton===!1,j=_.disableDoubleClickNextButton!==!1,R=(0,l.useRef)(!1),N=(0,l.useRef)(void 0),B=(0,l.useRef)(null),D=(0,l.useRef)(null),O=(0,l.useRef)(e);O.current=e;const $=(0,l.useCallback)(()=>{N.current=void 0},[]),de=(0,l.useCallback)(te=>{p.merge({activeNextButton:!te},"user")},[p]),ue=(0,l.useCallback)((te,ye)=>{const we=r.saveRefusalReason(ye);if(we==="locked"){g.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:r.getEmailDesc(te),message:a("No access to edit the letter.")});return}if(we==="too-many-tags"){g.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:r.getEmailDesc(te),message:a("Maximum 10 tags available.")});return}const ke=r.failedTerms(ye);if(ke){ke.failed.forEach(Ie=>{if(ke.kind==="group"){g.fromError("GROUP_CREATING_ERROR",{id:Ie.id??0,name:Ie.name,parent:Ie.parent??0},ye);return}g.fromError("TAG_CREATING_ERROR",Ie.name,ye)});return}g.fromError(te.isNew?"EMAIL_CREATING_ERROR":"EMAIL_EDITING_ERROR",r.getEmailDesc(te),ye)},[g,a]),z=(0,l.useCallback)(te=>{const ye=mp(te),we=()=>{I(!1),te===xn&&(R.current=!1,de(!1))};if(!e){we();return}const ke=async()=>{(rt=>{n("publish",{project:rt.isNew?u:rt.project,folder:_a(m.get(r.APP_COOKIES.em_folder)),source:te,fallbackTitle:a("Untitled email.")}).then(T=>{if(I(!1),R.current=!1,!T){te===xn&&de(!1),ye&&(ue(rt,o().error),$());return}ye&&(g.success({id:"EMAIL_SAVING_SUCCESS",message:a("The email was successfully saved."),data:r.getEmailDesc(rt)}),$())})})(e)};I(!0),ke()},[e,i,c,a,t,m,u,g,ue,n,o,de,$]);r.useCommand(r.SAVE_COMMAND_ID,(0,l.useCallback)(te=>z(te||dp),[z]));const ie=(0,l.useRef)(void 0),je=(0,l.useRef)(z);je.current=z;const pe=(0,l.useCallback)(te=>{k.current=te,C(ye=>ye+1)},[]);(0,l.useEffect)(()=>()=>{ie.current!==void 0&&clearTimeout(ie.current)},[]),(0,l.useEffect)(()=>{if(v===0)return;const te=k.current;O.current?.isNew&&(N.current=te),ie.current!==void 0&&clearTimeout(ie.current),ie.current=setTimeout(()=>{ie.current=void 0,je.current(te)})},[v]);const Qe=(0,l.useCallback)(te=>{(te.ctrlKey||te.metaKey)&&te.keyCode===83&&(te.preventDefault(),pe(lo))},[pe]);(0,l.useEffect)(()=>(document.addEventListener("keydown",Qe),()=>{document.removeEventListener("keydown",Qe)}),[Qe]);const be=(0,l.useCallback)(te=>{const ye=te.data.operation,we=te.data.action;ye===r.EVENT_TYPES.APPLICATION_ACTION&&we==="save_email"&&pe(lo)},[pe]);r.useListenPostMessage(be),(0,l.useEffect)(()=>{e?.isNew&&(D.current=null,B.current=null)},[e?.isNew,e?.renderGuid]),(0,l.useEffect)(()=>{R.current=!1},[e?.id]);const ge=m.get(r.APP_COOKIES.em_folder),X=f?r.provideAutosaveUiFacts(f):void 0;(0,l.useEffect)(()=>{X?.set({...X?.get()??{isUserBusy:!1,saveContext:{}},saveContext:{project:u,folder:_a(ge),fallbackTitle:a("Untitled email.")}})},[X,u,ge,a]);const he=(0,l.useRef)(!1),se=o().failures;(0,l.useEffect)(()=>{se>=fp&&!he.current&&(he.current=!0,g.warning({message:a("Changes are not being saved. Check your connection.")})),se===0&&(he.current=!1)},[se,g,a]);const le=S,Se=o().saving,Te=(0,l.useCallback)(te=>{pe(te||so)},[pe]),Ue=(0,l.useCallback)(async(te,ye)=>{if(te===xn){if(R.current)return;R.current=!0;try{j&&de(!0),(await A.fire(ye)).every(we=>we!==!1)?pe(xn):(de(!1),R.current=!1)}catch(we){g.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",r.getEmailDesc(ye),we,!0),de(!1),R.current=!1}return}try{(await Y.fire(ye)).every(we=>we!==!1)&&pe(te||so)}catch(we){g.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",r.getEmailDesc(ye),we,!0)}},[j,A,Y,g,de,pe]);return(0,l.useMemo)(()=>({requestSave:Te,requestSaveWithEvents:Ue,isLoading:le,isAutosaveLoading:Se,nextButtonDisabled:ee}),[Te,Ue,le,Se,ee])}var gp="NEXT_BUTTON",yp="SAVE_BUTTON",va=({email:e=null,disabled:t})=>{const{__:n}=r.useI18n(),o=r.useAppConfig(),i=r.useContentReader(),a=r.useNotification(),{requestSaveWithEvents:c,isLoading:d,isAutosaveLoading:u,nextButtonDisabled:m}=pp(),f=d||u,[g,_]=(0,l.useState)(null);(0,l.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&_(!0)},[]);const p=o.saveButtonEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n(g?"Save by ⌘S":"Save by Ctrl+S"),placement:"bottom",children:(0,s.jsx)("span",{className:"em-analytics__email-save-tooltip-target",children:(0,s.jsx)(y.ui_kit$Button,{disabled:t||u,type:o.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:f,icon:(0,s.jsx)(r.EmIcons,{icon:"SaveOutlined",component:y.icons$SaveOutlined,size:16,strokeWidth:o.iconStrokeWidth}),onClick:async C=>{const k=C.currentTarget,S={...e,html:i()};try{await c(yp,S)}catch(I){a.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",r.getEmailDesc(S),I,!0)}finally{try{k?.blur?.()}catch{}}},children:o.saveButtonText||n("Save")})})},"save-button"),v=o.nextButtonEnabled&&(0,s.jsx)(y.ui_kit$Button,{disabled:t||m,type:"primary",block:"false",className:"em-analytics__email-save",icon:o.primaryCommandButtonIcon,loading:d,onClick:async()=>{const C={...e,html:i()};await c(gp,C)},children:o.nextButtonText||n("Continue")},"next-button");return(0,s.jsx)(s.Fragment,{children:o.saveButtonEnabled&&o.nextButtonEnabled?(0,s.jsx)(y.ui_kit$Space,{children:[p,v]}):[p,v]})};va.propTypes={email:Ge.default.shape({id:Ge.default.string,isNew:Ge.default.bool,title:Ge.default.string,lock:Ge.default.bool,subject:Ge.default.string,html:Ge.default.string,description:Ge.default.string,utm_parameters:Ge.default.shape({utm_source:Ge.default.string,utm_medium:Ge.default.string,utm_campaign:Ge.default.string,utm_term:Ge.default.string,utm_content:Ge.default.string}),project:Ge.default.number,is_template:Ge.default.bool}),disabled:Ge.default.bool};var Ea=({element:e,context:t="list"})=>{const{__:n,_x:o}=r.useI18n(),[i]=r.useEditEmailMutation(),[a]=r.useEditBlockMutation(),c=r.useNotification(),d=r.usePushToDataLayer(),u=r.useStore();e.hasOwnProperty("type");const m=(_,p)=>{_.error||e.id==null||r.getEmailDocuments(h.getContainer(u)).noteServerFacts({serverId:String(e.id),block:p},_.data)},f=(_,p)=>{if(_.error)return c.error(_),!1;c.success(n("The ")+(p.hasOwnProperty("type")?n("block"):o("email","letter"))+" "+n("“")+_.data.title+n("”")+n("was successfully")+" "+(p.lock?p.hasOwnProperty("type")?o("unlocked.","block"):o("unlocked.","email"):p.hasOwnProperty("type")?o("locked.","block"):o("locked.","email")))},g=()=>{const _=!e.lock,p=_?"lock_email":"unlock_email";e.hasOwnProperty("type")?a({blockId:e.id,lock:_}).then(v=>{f(v,e),m(v,!0),v.error||d({event:_?"lock":"unlock",action:_?"lock_block":"unlock_block",entity_type:"block",entity_id:e.id,project_id:e.project,context:t})}):i({emailId:e.id,lock:_}).then(v=>{f(v,e),m(v,!1),v.error||d({event:_?"lock":"unlock",action:p,entity_type:"email",entity_id:e.id,project_id:e.project,context:t})})};return(0,s.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:g,children:e.lock?n("Unlock"):n("Lock")})};Ea.propTypes={element:Ge.default.shape({lock:Ge.default.bool,id:Ge.default.string})};var _p=({open:e,codeSize:t,onMinimize:n,onDownloadAsIs:o,onCancel:i})=>{const{__:a}=r.useI18n(),c=r.formatCodeSize(t);return(0,s.jsx)(y.ui_kit$Modal,{open:e,onCancel:i,footer:null,className:"code-size-warning-modal",width:480,children:(0,s.jsxs)("div",{className:"code-size-warning-modal__content",children:[(0,s.jsx)("h3",{className:"code-size-warning-modal__title",children:a("Code Size Warning")}),(0,s.jsxs)("div",{className:"code-size-warning-modal__message",children:[(0,s.jsxs)("p",{children:[a("The current code size is")," ",(0,s.jsx)("strong",{children:c}),","," ",a("which exceeds the recommended 90 KB limit.")]}),(0,s.jsx)("p",{children:a("Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.")})]}),(0,s.jsxs)(y.ui_kit$Space,{className:"code-size-warning-modal__actions",size:"medium",children:[(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:n,size:"large",children:a("Minimize code")}),(0,s.jsx)(y.ui_kit$Button,{onClick:o,size:"large",children:a("Download as is")})]})]})})};function bp(e){return e.includes("em-narrow-table")}function vp(e){if(!e||bp(e))return!1;const t=e.includes("nl-container"),n=/row-content\s+stack/.test(e)||/stack\s+row-content/.test(e),o=/\brow-\d/.test(e),i=/_block\s+block-\d/.test(e),a=e.includes('role="presentation"');return t&&n&&(o||i)&&a}function Ep(e){return e?e.includes("em-narrow-table"):!1}function Sp(e){return e.includes("em-narrow-table")}function wp(e){return e.includes("i-amphtml")||e.includes("amp-runtime")||e.includes("amp-version")}function kp(e){if(!e||Sp(e)||wp(e))return!1;const t=e.includes("es-wrapper"),n=/es-(?:header|content|footer)-body/.test(e);return t||n}function Sa(){r.useAppConfig();const e=r.useIntegratorConfigValue("beeFreeConverterEnabled"),t=r.useIntegratorConfigValue("stripoConverterEnabled"),n=r.useIntegratorConfigValue("aiLayoutConverterEnabled"),o=e===!0,i=t===!0,a=n===!0;return{beeFreeConverterEnabled:o,stripoConverterEnabled:i,aiLayoutConverterEnabled:a,anyConverterEnabled:o||i||a}}function wa(e,t){return!e||Ep(e)?null:vp(e)?t.beeFreeConverterEnabled?"beefree":null:kp(e)?t.stripoConverterEnabled?"stripo":null:t.aiLayoutConverterEnabled?"ai":null}var Cp=()=>"emailmaker",Tp={unisender:{id:"unisender",name:"Unisender",icon:"/images/integrations/unisender.svg",description:"Export emails to Unisender",cardDescription:"Mass mailing automation, audience segmentation, and campaign performance analytics.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Unisender API key",helpUrl:"https://app.unisender.com/ru/v5/cp/user/info/api"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Unisender"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"number",label:"Contact List ID",required:!0,placeholder:"e.g., 123456"}]},mailganer:{id:"mailganer",name:"Mailganer",icon:"/images/integrations/mailganer.svg",description:"Export emails to Mailganer",cardDescription:"Contact sync, content personalization, and real-time campaign results tracking.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Mailganer API key",helpUrl:"https://mailganer.com/app/profile/"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Mailganer"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Mailing Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"theme",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},sendsay:{id:"sendsay",name:"Sendsay",icon:"/images/integrations/sendsay.svg",description:"Export emails to Sendsay",cardDescription:"Mailing automation, audience segmentation, and email personalization.",apps:["emailmaker"],settingsFields:[{name:"login",type:"text",label:"Account Login",required:!0,placeholder:"e.g., myaccount or myaccount/sublogin",extra:"Your Sendsay account login (not email). For sublogin use format: account/sublogin",fullWidth:!0},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Sendsay API key",helpUrl:"https://docs.sendsay.ru/sendsay-api/how-to-get-apikey"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Sendsay"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Draft Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]},klaviyo:{id:"klaviyo",name:"Klaviyo",icon:"/images/integrations/klaviyo.svg",description:"Export emails to Klaviyo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., pk_xxxxxxxx",helpUrl:"https://help.klaviyo.com/hc/en-us/articles/7423954176283-How-to-create-a-private-API-key",extra:"Use a custom key with templates:write and campaigns:write (or Full access). Campaigns-only is not enough — export creates a template first."},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Klaviyo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., ABC123",helpText:"Find your List ID in Klaviyo: Lists & Segments → List → Settings"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},campaign_monitor:{id:"campaign_monitor",name:"Campaign Monitor",icon:"/images/integrations/campaign_monitor.svg",description:"Export emails to Campaign Monitor",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.campaignmonitor.com/s/article/api-keys"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"e.g., 4a397ccaaa55eb4e6aa1221e1e2d7122",helpText:"Find in Account Settings → API Keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Campaign Monitor"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",helpText:"Find in Lists → List ID"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},constant_contact:{id:"constant_contact",name:"Constant Contact",icon:"/images/integrations/constant_contact.svg",description:"Export emails to Constant Contact",apps:["useblocks"],settingsFields:[{name:"access_token",type:"password",label:"Access Token",required:!0,placeholder:"OAuth2 Bearer token",fullWidth:!0,helpText:"Get from Constant Contact Developer Portal. Token expires in 24 hours.",helpUrl:"https://developer.constantcontact.com/api_guide/getting_started.html"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be confirmed in Constant Contact"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"Contact List ID",required:!0,placeholder:"e.g., fa32f620-6d82-11e8-8b59-fa163e56c9b0",helpText:"Find via GET /contact_lists API"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},bento:{id:"bento",name:"Bento",icon:"/images/integrations/bento.svg",description:"Export emails to Bento",apps:["useblocks"],settingsFields:[{name:"publishable_key",type:"password",label:"Publishable Key",required:!0,placeholder:"Enter Publishable Key",fullWidth:!0,helpUrl:"https://app.bentonow.com/account/teams"},{name:"secret_key",type:"password",label:"Secret Key",required:!0,placeholder:"Enter Secret Key",fullWidth:!0},{name:"site_uuid",type:"text",label:"Site UUID",required:!0,placeholder:"Your site UUID",helpText:"Find in Bento dashboard"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be an author in your Bento account"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Broadcast Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"},{name:"inclusive_tags",type:"text",label:"Tags (inclusive)",required:!1,placeholder:"e.g., subscribers,newsletter",helpText:"Comma-separated tags to send to. Default: subscribers"}]},dotdigital:{id:"dotdigital",name:"Dotdigital",icon:"/images/integrations/dotdigital.svg",description:"Export emails to Dotdigital",apps:["useblocks"],settingsFields:[{name:"username",type:"text",label:"API Username",required:!0,placeholder:"API user email",helpText:"API user email from Settings → Access → API users",helpUrl:"https://developer.dotdigital.com/docs/setting-up-an-api-user"},{name:"password",type:"password",label:"API Password",required:!0,placeholder:"API user password",fullWidth:!0},{name:"region",type:"text",label:"Region",required:!0,placeholder:"r1, r2, or r3",helpText:"r1=Europe, r2=North America, r3=Asia Pacific"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",fullWidth:!0,extra:"Use an email registered as a Custom from address in Dotdigital (see support.dotdigital.com — “Create a custom from address”). If it does not match, export uses your account default sender."},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},getresponse:{id:"getresponse",name:"GetResponse",icon:"/images/integrations/getresponse.svg",description:"Export emails to GetResponse",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://app.getresponse.com/api"},{name:"from_field_id",type:"text",label:"From Field ID",required:!0,placeholder:"e.g., V",helpText:"Find via GET /from-fields API"}],exportFields:[{name:"name",type:"text",label:"Newsletter Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"campaign_id",type:"text",label:"Campaign ID",required:!0,placeholder:"e.g., C",helpText:"List/campaign ID from GET /campaigns"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},brevo:{id:"brevo",name:"Brevo",icon:"/images/integrations/brevo.svg",description:"Export emails to Brevo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Brevo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"number",label:"List ID",required:!0,placeholder:"e.g., 2",helpText:"Find in Contacts → Lists"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},activecampaign:{id:"activecampaign",name:"ActiveCampaign",icon:"/images/integrations/activecampaign.svg",description:"Export emails as draft campaigns to ActiveCampaign",apps:["useblocks"],settingsFields:[{name:"api_url",type:"text",label:"API URL",required:!0,placeholder:"e.g., https://youraccount.api-us1.com",helpText:"Find in Settings → Developer → API Access",helpUrl:"https://help.activecampaign.com/hc/en-us/articles/207317590-Getting-started-with-the-API"},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., 1",extra:"Find in Lists → Click your list → The ID is in the URL (e.g., /app/contacts?listid=1)"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in ActiveCampaign"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},salesforce_mc:{id:"salesforce_mc",name:"Salesforce",icon:"/images/integrations/salesforce.svg",description:"Export emails to Salesforce",apps:["useblocks"],settingsFields:[{name:"subdomain",type:"text",label:"Tenant Subdomain",required:!0,placeholder:"e.g., mc563885gzs27c5t9-63k636ttgm",helpText:"Find in Installed Packages → API Integration → REST Base URI",helpUrl:"https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/your-subdomain-tenant-specific-endpoints.html"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"From Installed Package"},{name:"client_secret",type:"password",label:"Client Secret",required:!0,placeholder:"From Installed Package"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Marketing Cloud"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},hubspot:{id:"hubspot",name:"HubSpot Email",icon:"/images/integrations/hubspot.svg",description:"Export emails to HubSpot",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"Private App Access Token",required:!0,placeholder:"e.g., pat-na1-xxxx",helpUrl:"https://developers.hubspot.com/docs/api/private-apps"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in HubSpot"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},mailchimp:{id:"mailchimp",name:"Mailchimp",icon:"/images/integrations/mailchimp.svg",description:"Export emails to Mailchimp",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., xxxxxxxx-us1",helpUrl:"https://mailchimp.com/help/about-api-keys/"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Mailchimp"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"Audience ID",required:!0,placeholder:"e.g., a1b2c3d4e5",helpText:"Find your Audience ID in Audience settings → Audience name and defaults"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},enkod:{id:"enkod",name:"enKod",icon:"/images/integrations/enkod.svg",description:"Export emails to enKod",cardDescription:"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter enKod API key",helpUrl:"https://help.enkod.io/doku.php/api:start"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]}},Ip=(e,t)=>!e.apps||e.apps.length===0?!0:e.apps.includes(t),co=e=>{const t=Tp[e];if(t&&Ip(t,Cp()))return t},Ap=(e,t)=>{const n={placeholder:e.placeholder?t(e.placeholder):void 0,style:{width:"100%"}};switch(e.type){case"number":return(0,s.jsx)(y.ui_kit$InputNumber,{...n,min:1});case"email":return(0,s.jsx)(y.ui_kit$Input,{...n,type:"email"});default:return(0,s.jsx)(y.ui_kit$Input,{...n})}},xp=({integration:e,visible:t,loading:n=!1,onConfirm:o,onCancel:i,__:a})=>{const[c]=y.ui_kit$Form.useForm(),d=e.exportFields||[];(0,l.useEffect)(()=>{t||c.resetFields()},[t,c]);const u=()=>{n||c.validateFields().then(g=>{o(g)})},m=()=>{c.resetFields(),i()};if(d.length===0)return null;const f=d.find(g=>g.helpText);return(0,s.jsxs)(y.ui_kit$Modal,{title:a(`Export to ${e.name}`),open:t,onOk:u,onCancel:m,okText:a("Export"),cancelText:a("Cancel"),confirmLoading:n,cancelButtonProps:{disabled:n},children:[f&&(0,s.jsx)(y.ui_kit$Alert,{title:a(f.label),description:a(f.helpText),type:"info",showIcon:!0,style:{marginBottom:16}}),(0,s.jsx)(y.ui_kit$Form,{form:c,layout:"vertical",children:d.map(g=>(0,s.jsx)(y.ui_kit$Form.Item,{label:a(g.label),name:g.name,rules:[...g.required?[{required:!0,message:a(`Please enter ${g.label.toLowerCase()}`)}]:[],...g.type==="number"?[{type:"number",message:a(`${g.label} must be a number`)}]:[]],children:Ap(g,a)},g.name))})]})},Jn=r.createApi({reducerPath:"unisenderApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmailMessage:e.mutation({query:t=>{const n="https://api.unisender.com/ru/api/createEmailMessage",o=new URLSearchParams;return o.append("format","json"),Object.entries(t).forEach(([i,a])=>{o.append(i,String(a))}),{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o.toString()}}})})}),{useCreateEmailMessageMutation:Pp}=Jn,Zn=r.createApi({reducerPath:"mailganerApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://mailganer.com"}),endpoints:e=>({createMailing:e.mutation({query:t=>{const n=new URLSearchParams;return n.append("api_key",t.api_key),n.append("name",t.name),n.append("html-content",t.html_content),t.theme&&n.append("theme",t.theme),t.from_name&&n.append("from_name",t.from_name),t.from_email&&n.append("from_email",t.from_email),t.segment_id&&n.append("segment_id",String(t.segment_id)),t.utm_campaign&&n.append("utm_campaign",t.utm_campaign),t.utm_source&&n.append("utm_source",t.utm_source),t.utm_medium&&n.append("utm_medium",t.utm_medium),{url:"/api/v1/mailing/create/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}}})})}),{useCreateMailingMutation:Rp}=Zn,er=r.createApi({reducerPath:"sendsayApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://api.sendsay.ru"}),endpoints:e=>({createDraft:e.mutation({query:t=>{const n={action:"issue.draft.set",apikey:t.api_key,return_fresh_obj:1,obj:{name:t.name,letter:{subject:t.subject,"from.name":t.from_name||void 0,"from.email":t.from_email||void 0,message:{html:t.html_content}}}};return{url:`/general/api/v100/json/${t.login.split("/").map(o=>encodeURIComponent(o)).join("/")}`,method:"POST",headers:{"Content-Type":"application/json"},body:n}}})})}),{useCreateDraftMutation:jp}=er,tr=r.createApi({reducerPath:"altcraftApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({addTemplate:e.mutation({query:t=>{const n=`${t.api_url}/api/v1.1/templates/add`,o={token:t.api_key,name:t.name,channels:[{sid:"email",fields:{html:t.html_content,text:"",subject:t.subject||t.name,from_email:t.from_email||"",from_name:t.from_name||"",replyto_email:"",replyto_name:"",is_not_inline:!0}}],is_draft:t.is_draft??!1};return{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}}})})}),{useAddTemplateMutation:Lp}=tr,Op=e=>e.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\s+/g," ").trim(),nr=r.createApi({reducerPath:"enkodApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://api.enkod.ru"}),endpoints:e=>({createMessage:e.mutation({query:t=>{const n=Op(t.html_content)||t.subject,o={message:{subject:t.subject,fromEmail:t.sender_email||"",fromName:t.sender_name||"",html:t.html_content,plainText:n},isDraft:!0};return{url:"/v1/message/onetime/",method:"POST",headers:{"Content-Type":"application/json",Apikey:t.api_key},body:o}}})})}),{useCreateMessageMutation:Mp}=nr,Np=e=>{const t=e.split("-");return t.length>1?t[1]:"us1"},Dp=e=>`https://${Np(e)}.api.mailchimp.com/3.0`,rr=r.createApi({reducerPath:"mailchimpApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a=Dp(t.api_key),c=btoa(`anystring:${t.api_key}`),d={type:"regular",recipients:{list_id:t.list_id},settings:{subject_line:t.subject,from_name:t.from_name,reply_to:t.from_email}},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(d)});if(u.error){const _=u.error,p=_?.data?.detail||_?.error||String(u.error),v=_?.data?.errors;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(C=>C.detail||C.title).join("; "):p}}}const m=u.data;if(!m?.id)return{error:{status:"CUSTOM_ERROR",error:u.data?.errors?.map(_=>_.detail||_.title).join("; ")||"Failed to create campaign"}};const f={html:t.html},g=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns/${m.id}/content`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(f)});if(g.error){const _=g.error;return{error:{status:"CUSTOM_ERROR",error:_?.data?.detail||_?.error||String(g.error)}}}return{data:{id:m.id,status:m.status,web_id:m.web_id}}}})})}),{useCreateCampaignMutation:Fp}=rr,uo="https://a.klaviyo.com/api",Bp="2025-04-15",Up=e=>({"Content-Type":"application/json",Accept:"application/json",Authorization:`Klaviyo-API-Key ${e}`,revision:Bp}),or=r.createApi({reducerPath:"klaviyoApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a=Up(t.api_key),c={data:{type:"template",attributes:{name:`Email ${Date.now()}`,editor_type:"CODE",html:t.html}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${uo}/templates`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const k=d.error,S=k?.data?.errors,I=k?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(A=>A.detail||A.status).join("; "):I||k?.error||String(d.error)}}}const u=d.data?.data?.id;if(!u)return{error:{status:"CUSTOM_ERROR",error:"Failed to create template"}};const m={data:{type:"campaign",attributes:{name:`Campaign ${Date.now()}`,audiences:{included:[t.list_id],excluded:[]},send_strategy:{method:"immediate"},"campaign-messages":{data:[{type:"campaign-message",attributes:{definition:{channel:"email",label:t.subject,content:{subject:t.subject,from_email:t.from_email,from_label:t.from_name,reply_to_email:t.from_email}}}}]}}}},f=await i({url:`?proxy_url=${encodeURIComponent(`${uo}/campaigns`)}`,method:"POST",headers:a,body:JSON.stringify(m)});if(f.error){const k=f.error,S=k?.data?.errors,I=k?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(A=>A.detail||A.status).join("; "):I||k?.error||String(f.error)}}}const g=f.data,_=g?.data?.relationships?.["campaign-messages"]?.data?.[0]?.id,p=g?.data?.id;if(!_)return{error:{status:"CUSTOM_ERROR",error:"Failed to get campaign message from campaign"}};const v={data:{type:"campaign-message",id:_,relationships:{template:{data:{type:"template",id:u}}}}},C=await i({url:`?proxy_url=${encodeURIComponent(`${uo}/campaign-message-assign-template`)}`,method:"POST",headers:a,body:JSON.stringify(v)});if(C.error){const k=C.error,S=k?.data?.errors,I=k?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(A=>A.detail||A.status).join("; "):I||k?.error||String(C.error)}}}return{data:{id:p,campaign_message_id:_}}}})})}),{useCreateCampaignMutation:$p}=or,Gp="https://api.hubapi.com",zp=e=>({"Content-Type":"application/json",Authorization:`Bearer ${e}`}),ir=r.createApi({reducerPath:"hubspotApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,o,i)=>{const a=zp(t.api_key),c={name:t.name,subject:t.subject,from:{fromName:t.from_name,replyTo:t.from_email},content:{templatePath:"@hubspot/email/dnd/plain_text.html",widgets:{"module-0-1-1":{body:{html:t.html,path:"@hubspot/rich_text",schema_version:2},child_css:{},css:{},id:"module-0-1-1",name:"module-0-1-1",order:2,styles:{},type:"module"},"module-1-1-1":{body:{align:"center",path:"@hubspot/email_footer",schema_version:2,unsubscribe_link_type:"both"},child_css:{},css:{},id:"module-1-1-1",name:"module-1-1-1",order:3,styles:{},type:"module"}}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${Gp}/marketing/v3/emails/`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const m=d.error,f=m?.data?.errors,g=m?.data?.message;return{error:{status:"CUSTOM_ERROR",error:f?.length?f.map(_=>_.message||_.errorType).join("; "):g||m?.error||String(d.error)}}}const u=d.data;return u?.id?{data:{id:u.id}}:{error:{status:"CUSTOM_ERROR",error:d.data?.errors?.map(m=>m.message||m.errorType).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:Wp}=ir,ar=r.createApi({reducerPath:"salesforceMcApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,o,i)=>{const a=`https://${t.subdomain}.auth.marketingcloudapis.com/v2/token`,c=await i({url:`?proxy_url=${encodeURIComponent(a)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.client_id,client_secret:t.client_secret})});if(c.error){const p=c.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_description||p?.data?.error||p?.error||String(c.error)}}}const d=c.data,u=d?.access_token,m=d?.rest_instance_url;if(!u||!m)return{error:{status:"CUSTOM_ERROR",error:d?.error_description||d?.error||"Failed to get access token"}};const f={name:t.name,assetType:{id:208,name:"htmlemail"},views:{html:{content:t.html},text:{},subjectline:{content:t.subject},preheader:{}},data:{email:{options:{characterEncoding:"utf-8"}}}},g=await i({url:`?proxy_url=${encodeURIComponent(`${m.replace(/\/$/,"")}/asset/v1/content/assets`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify(f)});if(g.error){const p=g.error,v=p?.data?.errors,C=p?.data?.message;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(k=>k.message||k.documentation).join("; "):C||p?.error||String(g.error)}}}const _=g.data;return _?.id?{data:{id:_.id}}:{error:{status:"CUSTOM_ERROR",error:g.data?.errors?.map(p=>p.message).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:Hp}=ar,qp=e=>e.replace(/\/$/,""),Vp=e=>e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()||" ",sr=r.createApi({reducerPath:"activecampaignApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a=qp(t.api_url),c=t.api_key,d={"Content-Type":"application/json","Api-Token":c},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/addresses`)}`,method:"GET",headers:{"Api-Token":c}});if(u.error)return{error:{status:"CUSTOM_ERROR",error:"Failed to load mailing addresses. Check your API URL and Key."}};const m=u.data?.addresses??[],f=m.find(A=>A.isDefault==="1")??m[0];if(!f?.id)return{error:{status:"CUSTOM_ERROR",error:"NO_MAILING_ADDRESS"}};const g={message:{name:t.name,fromname:t.from_name,fromemail:t.from_email,email:t.from_email,reply2:t.from_email,subject:t.subject,html:t.html,text:Vp(t.html),preheader_text:"",format:"mime"}},_=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/messages`)}`,method:"POST",headers:d,body:JSON.stringify(g)});if(_.error){const A=_.error;return{error:{status:"CUSTOM_ERROR",error:A?.data?.message||A?.error||"Failed to create message."}}}const p=_.data?.message?.id;if(!p)return{error:{status:"CUSTOM_ERROR",error:"Message created but no ID returned."}};const v=`${a}/admin/api.php?api_action=campaign_create&api_output=json`,C=new URLSearchParams;C.append("type","single"),C.append("name",t.name),C.append("sdate","2099-12-31 12:00:00"),C.append("status","0"),C.append("public","1"),C.append("trackreads","1"),C.append("tracklinks","all"),C.append("htmlunsub","1"),C.append("textunsub","1"),C.append("addressid",String(f.id)),C.append(`p[${t.list_id}]`,t.list_id),C.append(`m[${p}]`,"100");const k=await i({url:`?proxy_url=${encodeURIComponent(v)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","Api-Token":c},body:C.toString()});if(k.error){const A=k.error;return{error:{status:"CUSTOM_ERROR",error:A?.data?.result_message||A?.error||"Message created, but campaign creation failed."}}}const S=k.data;if(Number(S?.result_code)===0)return{error:{status:"CUSTOM_ERROR",error:S?.result_message||"Campaign creation failed (v1 API)."}};const I=S?.id;return I?{data:{campaignId:String(I)}}:{error:{status:"CUSTOM_ERROR",error:S?.result_message||"Campaign created but no ID returned."}}}})})}),{useCreateCampaignMutation:Yp}=sr,Kp="https://api.brevo.com/v3",lr=r.createApi({reducerPath:"brevoApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a={name:t.name,subject:t.subject,sender:{name:t.from_name,email:t.from_email},htmlContent:t.html,recipients:{listIds:[t.list_id]}},c=await i({url:`?proxy_url=${encodeURIComponent(`${Kp}/emailCampaigns`)}`,method:"POST",headers:{"Content-Type":"application/json","api-key":t.api_key},body:JSON.stringify(a)});if(c.error){const u=c.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.data?.code||u?.error||String(c.error)}}}const d=c.data;return d?.id?{data:{id:d.id}}:{error:{status:"CUSTOM_ERROR",error:c.data?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:Qp}=lr,Xp="https://api.createsend.com/api/v3.3",Jp=e=>`Basic ${btoa(`${e}:x`)}`,cr=r.createApi({reducerPath:"campaignMonitorApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a={Name:t.name,Subject:t.subject,FromName:t.from_name,FromEmail:t.from_email,ReplyTo:t.from_email,HtmlUrl:t.html_url,ListIDs:[t.list_id],InlineCss:!0},c=await i({url:`?proxy_url=${encodeURIComponent(`${Xp}/campaigns/${t.client_id}.json`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Jp(t.api_key)},body:JSON.stringify(a)});if(c.error){const m=c.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.Message||m?.error||String(c.error)}}}const d=c.data,u=typeof d=="string"?d:d?.id;return!u||typeof u!="string"?{error:{status:"CUSTOM_ERROR",error:d?.Message||"Failed to create campaign"}}:{data:{id:u}}}})})}),{useCreateCampaignMutation:Zp}=cr,ka="https://api.cc.email/v3",ef=e=>e.includes("[[trackingImage]]")?e:e.replace(/<body([^>]*)>/i,"<body$1>[[trackingImage]]"),dr=r.createApi({reducerPath:"constantContactApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a=ef(t.html),c={name:t.name,email_campaign_activities:[{format_type:5,from_email:t.from_email,reply_to_email:t.from_email,from_name:t.from_name,subject:t.subject,html_content:a}]},d=await i({url:`?proxy_url=${encodeURIComponent(`${ka}/emails`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(c)});if(d.error){const p=d.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(d.error)}}}const u=d.data,m=u?.campaign_activities?.find(p=>p.role==="primary_email")?.campaign_activity_id,f=u?.campaign_id;if(!m||!f)return{error:{status:"CUSTOM_ERROR",error:"Failed to create campaign"}};const g={campaign_activity_id:m,campaign_id:f,role:"primary_email",contact_list_ids:[t.list_id],segment_ids:[],current_status:"DRAFT",format_type:5,from_email:t.from_email,from_name:t.from_name,reply_to_email:t.from_email,subject:t.subject,html_content:a},_=await i({url:`?proxy_url=${encodeURIComponent(`${ka}/emails/activities/${m}`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(g)});if(_.error){const p=_.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(_.error)}}}return{data:{campaign_id:f}}}})})}),{useCreateCampaignMutation:tf}=dr,nf="https://api.getresponse.com/v3",rf=e=>`api-key ${e}`,ur=r.createApi({reducerPath:"getresponseApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createNewsletter:e.mutation({queryFn:async(t,n,o,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c={name:t.name,type:"draft",subject:t.subject,fromField:{fromFieldId:t.from_field_id},replyTo:{fromFieldId:t.from_field_id},campaign:{campaignId:t.campaign_id},content:{html:t.html,plain:a||"Newsletter"},flags:["openrate","clicktrack"],sendSettings:{selectedCampaigns:[t.campaign_id]}},d=await i({url:`?proxy_url=${encodeURIComponent(`${nf}/newsletters`)}`,method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":rf(t.api_key)},body:JSON.stringify(c)});if(d.error){const m=d.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.message||m?.data?.code||m?.error||String(d.error)}}}const u=d.data;return u?.newsletterId?{data:{newsletterId:u.newsletterId}}:{error:{status:"CUSTOM_ERROR",error:d.data?.message||"Failed to create newsletter"}}}})})}),{useCreateNewsletterMutation:of}=ur,af=e=>`https://${e||"r1"}-api.dotdigital.com/v2`,Ca=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,Ta=e=>e&&typeof e=="object"&&"data"in e&&e.data!==void 0?e.data:e,Ia=e=>e.trim().toLowerCase(),mr=r.createApi({reducerPath:"dotdigitalApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,o,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c=af(t.region),d={"Content-Type":"application/json",Authorization:Ca(t.username,t.password)},u=await i({url:`?proxy_url=${encodeURIComponent(`${c}/custom-from-addresses`)}`,method:"GET",headers:{Authorization:Ca(t.username,t.password)}});let m=[];if(!u.error){const k=Ta(u.data);Array.isArray(k)?m=k:k&&typeof k=="object"&&Array.isArray(k.items)&&(m=k.items)}const f=Ia(t.from_email),g=m.find(k=>k.email&&Ia(k.email)===f),_={name:t.name,subject:t.subject,fromName:t.from_name,htmlContent:t.html,plainTextContent:a||"Newsletter"},p=!g?.id;g?.id!=null&&(_.fromAddress={id:g.id});const v=await i({url:`?proxy_url=${encodeURIComponent(`${c}/campaigns`)}`,method:"POST",headers:d,body:JSON.stringify(_)});if(v.error){const k=v.error;return{error:{status:"CUSTOM_ERROR",error:k?.data?.message||k?.error||String(v.error)}}}const C=Ta(v.data);return C?.id?{data:{id:C.id,usedAccountDefaultFromAddress:p}}:{error:{status:"CUSTOM_ERROR",error:v.data?.message||C?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:sf}=mr,lf="https://app.bentonow.com/api/v1",cf=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,pr=r.createApi({reducerPath:"bentoApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createBroadcast:e.mutation({queryFn:async(t,n,o,i)=>{const a={broadcasts:[{name:t.name,subject:t.subject,content:t.html,type:"raw",from:{email:t.from_email,name:t.from_name},inclusive_tags:t.inclusive_tags||"subscribers",exclusive_tags:"",segment_id:t.segment_id||"",batch_size_per_hour:500,approved:!1}]},c=`${lf}/batch/broadcasts?site_uuid=${encodeURIComponent(t.site_uuid)}`,d=await i({url:`?proxy_url=${encodeURIComponent(c)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:cf(t.publishable_key,t.secret_key),"User-Agent":"EmailMaker/1.0"},body:JSON.stringify(a)});if(d.error){const u=d.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.error||String(d.error)}}}return{data:{count:d.data?.count??1}}}})})}),{useCreateBroadcastMutation:df}=pr,uf=()=>{const{__:e}=r.useI18n(),[t,{isLoading:n}]=Pp(),[o,{isLoading:i}]=Rp(),[a,{isLoading:c}]=jp(),[d,{isLoading:u}]=Lp(),[m,{isLoading:f}]=Mp(),[g,{isLoading:_}]=Fp(),[p,{isLoading:v}]=$p(),[C,{isLoading:k}]=Wp(),[S,{isLoading:I}]=Hp(),[A,{isLoading:Y}]=Yp(),[ee,{isLoading:j}]=Qp(),[R,{isLoading:N}]=Zp(),[B,{isLoading:D}]=tf(),[O,{isLoading:$}]=of(),[de,{isLoading:ue}]=sf(),[z,{isLoading:ie}]=df(),je=n||i||c||u||f||_||v||k||I||Y||j||N||D||$||ue||ie,rt={unisender:async(w,x,L,F)=>{try{const b=await t({api_key:w.api_key,sender_name:w.sender_name,sender_email:w.sender_email,subject:F,body:L,list_id:x.list_id,generate_text:1,lang:"ru"}).unwrap();return b.result?.message_id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.unisender.com/ru/v5/spa/email-campaign/editor/${b.result.message_id}?step=send`,text:e("Open in Unisender")}}:b.error?{success:!1,error:b.error+(b.code?` (${b.code})`:"")}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},mailganer:async(w,x,L,F)=>{try{const b=await o({api_key:w.api_key,name:x.name,html_content:L,theme:x.theme||F,from_name:w.from_name,from_email:w.from_email}).unwrap();return b.status===1&&b.public_id?{success:!0,message:e("Mailing successfully created!"),link:b.step1_url?{url:b.step1_url,text:e("Open in Mailganer")}:void 0}:b.error?{success:!1,error:b.error}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create mailing")}}},sendsay:async(w,x,L,F)=>{try{const b=await a({login:w.login,api_key:w.api_key,name:x.name,subject:x.subject,html_content:L,from_name:w.from_name,from_email:w.from_email}).unwrap();return b.obj?.id?{success:!0,message:e("Draft successfully created!"),link:{url:`https://app.sendsay.ru/content/drafts/email/${b.obj.id}/settings`,text:e("Open in Sendsay")}}:b.errors&&b.errors.length>0?{success:!1,error:b.errors.map(H=>H.explain).join(", ")}:b.error?{success:!1,error:b.explain||b.error}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create draft")}}},altcraft:async(w,x,L,F)=>{try{const b=await d({api_url:w.api_url,api_key:w.api_key,name:x.name,html_content:L,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email}).unwrap();return b.error===0?{success:!0,message:e("Template successfully created!")}:{success:!1,error:b.error_text||e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create template")}}},enkod:async(w,x,L,F)=>{try{const b=await m({api_key:w.api_key,subject:x.subject,html_content:L,sender_name:w.sender_name,sender_email:w.sender_email}).unwrap();if(b.success||b.messageId||b.id){const H=b.messageId||b.id;return{success:!0,message:e("Draft successfully created!"),link:H?{url:`https://app.enkod.ru/ensend/messages/detail/${H}/preview`,text:e("Open in enKod")}:void 0}}else if(b.error||b.message)return{success:!1,error:b.error||b.message||e("Unknown error")};return{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create draft")}}},mailchimp:async(w,x,L,F)=>{try{const b=await g({api_key:w.api_key,list_id:x.list_id,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();if(b.id){const H=w.api_key?.split("-")[1]||"us1";return{success:!0,message:e("Campaign successfully created!"),link:{url:`https://${H}.admin.mailchimp.com/campaigns/#r:campaignId=${b.id}`,text:e("Open in Mailchimp")}}}return{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},klaviyo:async(w,x,L,F)=>{try{const b=await p({api_key:w.api_key,list_id:x.list_id,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();return b.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://www.klaviyo.com/campaign/${b.id}/wizard/1`,text:e("Open in Klaviyo")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},hubspot:async(w,x,L,F)=>{try{const b=await C({api_key:w.api_key,name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();return b.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.hubspot.com/email/0/edit/${b.id}`,text:e("Open in HubSpot")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},salesforce_mc:async(w,x,L,F)=>{try{const b=await S({subdomain:w.subdomain,client_id:w.client_id,client_secret:w.client_secret,name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();return b.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.s7.exacttarget.com/ContentBuilder?app=contentbuilder&id=${b.id}`,text:e("Open in Marketing Cloud")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},activecampaign:async(w,x,L,F)=>{try{const b=await A({api_url:w.api_url,api_key:w.api_key,list_id:w.list_id,name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();if(b.campaignId){const H=(w.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Le=H?H[1]:"",Pe=Le?`https://${Le}.activehosted.com/app/campaigns/${b.campaignId}`:"https://www.activecampaign.com/app/campaigns";return{success:!0,message:e("Draft campaign created! Open it to review and schedule."),link:{url:Pe,text:e("Open draft campaign")}}}return{success:!1,error:e("Unknown error")}}catch(b){const H=b.message||b.error||"";if(H==="NO_MAILING_ADDRESS"){const Le=(w.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Pe=Le?Le[1]:"",qe=Pe?`https://${Pe}.activehosted.com/app/settings/addresses`:"https://www.activecampaign.com/app/settings/addresses";return{success:!1,error:e("No mailing address found. Add one in ActiveCampaign: ")+qe}}return{success:!1,error:H||e("Failed to create campaign")}}},brevo:async(w,x,L,F)=>{try{const b=await ee({api_key:w.api_key,list_id:Number(x.list_id),name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();return b.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.brevo.com/marketing-campaign/edit/${b.id}`,text:e("Open in Brevo")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},campaign_monitor:async(w,x,L,F)=>{try{const b=x.html_url?.trim();if(!b)return{success:!1,error:e("HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.")};const H=await R({api_key:w.api_key,client_id:w.client_id,list_id:x.list_id,name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html_url:b.trim()}).unwrap();return H.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.createsend.com/campaigns/#/${H.id}`,text:e("Open in Campaign Monitor")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},constant_contact:async(w,x,L,F)=>{try{return(await B({access_token:w.access_token,list_id:x.list_id,name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap()).campaign_id?{success:!0,message:e("Campaign successfully created!"),link:{url:"https://app.constantcontact.com/pages/email/campaigns",text:e("Open in Constant Contact")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},getresponse:async(w,x,L,F)=>{try{const b=await O({api_key:w.api_key,from_field_id:w.from_field_id,campaign_id:x.campaign_id,name:x.name,subject:x.subject||F,html:L}).unwrap();return b.newsletterId?{success:!0,message:e("Newsletter successfully created!"),link:{url:`https://app.getresponse.com/letter/${b.newsletterId}`,text:e("Open in GetResponse")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create newsletter")}}},dotdigital:async(w,x,L,F)=>{try{const b=await de({username:w.username,password:w.password,region:w.region||"r1",name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L}).unwrap();return b.id?{success:!0,message:b.usedAccountDefaultFromAddress?e("Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it."):e("Campaign successfully created!"),link:{url:"https://login.dotdigital.com/",text:e("Open in Dotdigital")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},bento:async(w,x,L,F)=>{try{return await z({publishable_key:w.publishable_key,secret_key:w.secret_key,site_uuid:w.site_uuid,name:x.name,subject:x.subject||F,from_name:w.from_name,from_email:w.from_email,html:L,inclusive_tags:x.inclusive_tags}).unwrap(),{success:!0,message:e("Broadcast successfully created!"),link:{url:"https://app.bentonow.com/",text:e("Open in Bento")}}}catch(b){return{success:!1,error:b.message||e("Failed to create broadcast")}}}};return{exportToIntegration:async(w,x,L,F,b)=>{const H=rt[w];return H?H(x,L,F,b):{success:!1,error:e("Unknown integration")}},isLoading:je}},Lt={INFO:"info",STORAGE:"storage",STYLES:"styles",MEMBERS:"members",INTEGRATIONS:"integrations",PLUGIN:"plugin"},Lv=Lt.INFO,Ov=[Lt.INFO,Lt.STORAGE,Lt.STYLES,Lt.MEMBERS,Lt.INTEGRATIONS,Lt.PLUGIN],Mv={mainsettings:Lt.INFO,ftpsettings:Lt.STORAGE,webhooksettings:Lt.INTEGRATIONS},mf=async(e,t,n)=>{try{const{notification:o,...i}=e,a=await r.fetchBaseQuery({baseUrl:"https://racs.emcdn.ru/v3"})(i,t,n);if(a.error)throw new Error;return a}catch(o){return(e?.notification).error(o),{error:o}}},fr=r.createApi({reducerPath:"exportPngApi",baseQuery:mf,endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:t,title:n,notification:o})=>{const i=new Blob([t],{type:"text/html"}),a=new FormData;return a.append("file",i,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:o}}}),deleteTemporaryMail:e.mutation({query:({id:t,notification:n})=>({url:`/${t}?resource=exportPngApi`,method:"DELETE",notification:n})})})}),{useMakeTemporaryMailForPngMutation:pf,useDeleteTemporaryMailMutation:ff}=fr,hr=r.createApi({reducerPath:"webHookApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:t,body:n})=>({url:`?proxy_url=${encodeURIComponent(t)}`,method:"POST",body:n})})})}),{usePostDataByWebHookMutation:hf}=hr,gf=async(e,t,n)=>{try{const{notification:o,...i}=e,a=await r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"})(i,t,n);if(a.error)throw new Error;return a}catch(o){return(e?.notification).error(o),{error:o}}},gr=r.createApi({reducerPath:"htmlToPdfPlusApi",baseQuery:gf,endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:t,notification:n})=>({url:"emails/pdf",method:"POST",body:t,notification:n,responseHandler:o=>o.blob()})})})}),{useGenerateHtmlToPdfMutation:yf}=gr,yr=r.createApi({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:t,tryFetch:n=!0,type:o},i){const a=r.clientFromApi(i),c=n?fetch(t):Promise.reject(),d=m=>{switch(o){case"json":return m.json();case"text":return m.text();default:return m.blob()}},u=m=>d(m).then(f=>({data:f}));return c.then(m=>u(m)).catch(()=>a.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(t)}}))}})})}),{useGetFileQuery:Nv,useLazyGetFileQuery:_f}=yr,Dv="email",Fv=100;function bf(e){return gt.sanitizeFileName(String(e??"").trim()).slice(0,100).trimEnd()||"email"}function Aa(e){const t=bf(e);return{archive:`${t}.zip`,desktop:`${t}-desktop.png`,mobile:`${t}-mobile.png`}}function vf(e,t){const n=Aa(e);return{[n.desktop]:t.desktop,[n.mobile]:t.mobile}}var mo=()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/ec3b2810.js")).then(e=>e.import_exports),void 0,{}.url),Ef=1,Sf=2,wf=375,Ft={fontSize:"16px"},kf={position:"absolute",bottom:-4,right:-4,borderRadius:"100%",backgroundColor:r.emCssVar("colorBgContainer")},Cf={position:"relative",display:"inline-flex"},Ht=({icon:e,locked:t,strokeWidth:n,className:o})=>(0,s.jsxs)("span",{className:o,style:Cf,children:[e,t&&(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:n,style:kf})]}),Tf=({email:e,autoSaveBlockResult:t})=>{const{__:n,_x:o}=r.useI18n(),i=r.useDispatch(),a=r.useEmailAttributesWriter(),[c]=_f(),[d]=r.useUploadImageMutation(),u=r.useAppNavigate(),{owner:m,admin:f}=Xn(),g=r.useCurrentUser(),_=r.useProjectData(),{modal:p}=y.ui_kit$App.useApp(),v=r.useNotification(),{confirm:C}=p,k=r.useAppStore(),S=()=>ln(h.getContainer(k)).keepWrappedOnOutput,I=(M,q,K,Q)=>gt.prepareHTML(M,q,K,Q,S()),A=(M,q,K,Q,oe,V)=>gt.getEML(M,q,K,Q,oe,V,S()),Y=(M,q,K,Q,oe)=>gt.htmlToFilesData(M,q,K,Q,oe,S()),ee=r.useCookieManager(),j=r.useAppConfig(),R=Sa(),{beeFreeConverterEnabled:N,aiLayoutConverterEnabled:B}=R,D=r.useEditorProjectId(),O=r.useEventEmitter(h.events.ON_EMAIL_CLONE_ID),$=r.useEventEmitter(h.events.ON_BROWSER_EXTENSION_DETECTED_ID),[de]=hf(),ue=!0,{data:z}=r.useGetProjectIntegrationsQuery(_?.id??0,{skip:ue}),{data:ie}=r.useGetProjectWebhookQuery(_?.id??0,{skip:ue}),[je]=r.useLazyGetIntegrationCredentialsQuery(),{exportToIntegration:pe,isLoading:Qe}=uf(),be=r.usePushToDataLayer(),[ge,X]=(0,l.useState)(()=>!Wt(h.getContainer(k)).contentShown()),[he,se]=(0,l.useState)(!1),[le,Se]=(0,l.useState)(null),[Te,Ue]=(0,l.useState)(""),[te,ye]=(0,l.useState)(!1),[we,ke]=(0,l.useState)(0),[Ie,rt]=(0,l.useState)(null),[T,w]=(0,l.useState)(""),[x,L]=(0,l.useState)(!1),F=r.usePlanFeatureGate("export_html"),b=r.usePlanFeatureGate("export_pdf"),H=r.usePlanFeatureGate("export_png");r.usePlanFeatureGate("export_webhook");const Le=r.usePlanFeatureGate("export_platforms"),Pe=r.usePlanFeatureGate("export_amp"),qe=r.usePlanFeatureGate("template_import"),We=r.usePlanFeatureGate("code_minify"),Xe=M=>{ye(!0),ke(r.FEATURE_UPSELL_SLIDE[M])},[mt]=r.emailsApi.useDeleteEmailMutation(),_t=async(M,q)=>{try{const K=await mt(M.id).unwrap();M.project,v.success(n('The email "')+K.title+o('" was successfully removed.',"email")),be({event:"delete",action:"delete_email",entity_type:"email",entity_id:M.id,project_id:M.project,context:"editor"})}catch(K){v.error(K)}},[bt,pt]=r.useAddEmailMutation(),[W]=pf(),[J]=ff(),[Z]=yf(),fe=r.useProjectData(),et=r.useInvalidateTerms(),ot=r.useSelector(r.selectIsHeaderCodeMenuOpen);(0,l.useEffect)(()=>{ot.switched&&X(!1)},[ot]);const me=()=>{const{title:M}=e;return M===null?n("New email title"):M},Me=(M,q,K=!1)=>{const Q=r.getCodeSize(M);K&&r.isCodeSizeExceeded(Q)?(Ue(M),Se(()=>q),se(!0)):q(M)},Ut=()=>{if(se(!1),We.isLocked){Xe("code_minify");return}if(le&&Te){r.getCodeSize(Te);const M=r.minifyHtml(Te);r.getCodeSize(M),le(M),Se(null),Ue("")}},Ne=()=>{se(!1),le&&Te&&(le(Te),Se(null),Ue(""))},Ve=()=>{se(!1),Se(null),Ue("")},ae=r.useContentReader(),ne=r.useContentReplacer(),G=r.useEvent(h.events.ON_EMAIL_INIT_ID),ce=r.useEventEmitter(h.events.ON_LAYOUT_CONVERT_REQUEST_ID);(0,l.useEffect)(()=>{const M=G(()=>{X(!1)});return()=>M.dispose()},[G]);const Re=async(M,q=ae())=>{const K=document.querySelector(".email-preview"),Q=getComputedStyle(K);return q=await I(q,[Q.width],e.utm_parameters,async oe=>{tt(oe)}),W({file:q,title:me(),notification:v}).unwrap().then(oe=>{const V={id:oe._id,...oe};return M(V,()=>J({id:V.id,notification:v}))}).catch(oe=>{v.error({title:oe.data?.code,description:oe.data?.message})})},ve=(M,q=1)=>Re((K,Q)=>({hrefs:M.map(oe=>r.previewHrefForRacs(K.id,void 0,!1,q,void 0,void 0,oe)),dispose:Q})),De=(M,q,K=2)=>Re((Q,oe)=>({data:M.map(V=>({selector:V,href:r.previewHrefForRacs(Q.id,void 0,!1,K,V)})),dispose:oe}),q),Je=async(M,q)=>{const K=typeof M=="string"?(await c({url:M}))?.data:M;if(!K)return typeof M=="string"?M:"";let Q=r.decodeFileNameFromPath(q);if(typeof M=="string"&&/^https?:\/\//i.test(M)){const ze=r.decodeFileNameFromUrl(M);ze&&(Q=ze)}const oe=K,{ensureFileExtension:V,extractUploadResult:Ce}=await mo();Q=await V(Q,oe.type||"");const _e=new File([oe],Q.toLowerCase(),{type:oe.type||""});try{const ze=Ce(await d({user_id:g.id,folder:String(fe.id),file:_e}).unwrap());if(ze.error)return typeof M=="string"?M:"";if(ze.file_url)return ze.file_url}catch{}return typeof M=="string"?M:""},Oe=async M=>{const q=M.document.querySelectorAll("[em-operation=exportAsPicture]"),K=new Map;for(let Q=0,oe=q.length;Q<oe;Q++){const V=q[Q];V.setAttribute("em-export-id",String(Q)),K.set(`[em-export-id='${Q}']`,V)}K.size&&M.handleRender(async({contentDocument:Q,managedNodeController:oe})=>{try{const{data:V,dispose:Ce}=await De([...K.keys()],r.getOuterHtml(Q),Sf);try{const _e=V.map(async({href:ze,selector:_n},Fn)=>{const ut=K.get(_n);if(ut.tagName==="TD"){ut.removeAttribute("style");for(const ht of[...ut.classList])ht.startsWith("em-mob-")&&ut.classList.remove(ht)}oe.commit();const Fr=await Je(ze,`${Fn}-${ut.tagName.toLowerCase()}.png`),bn=parseInt(getComputedStyle(ut).width);let wt=new Image(bn);wt.setAttribute("border","0"),wt.setAttribute("style",`display: block; width: 100%; max-width: ${bn}px;`),wt.alt="",wt.src=Fr;const vn=ut.querySelector("a");if(vn){const ht=document.createElement("a");ht.setAttribute("target","_blank"),ht.setAttribute("href",vn.getAttribute("href")),ht.appendChild(wt),wt=ht}if(ut.tagName==="TD"){const ht=ut.cloneNode();ht.removeAttribute("em-operation"),ht.appendChild(wt),wt=ht}ut.replaceWith(wt),oe.commit()});await Promise.all(_e)}catch{}finally{Ce()}}catch{}})},tt=M=>{const q=M.document;if(fe?.limits?.preview_limit==="0"&&D&&g?.counters?.emails_counter>2&&!q.querySelector(".em-powered-logo")){const K=`<a href="${`https://https://racs.emcdn.ru/v3/v3/link?app=emailmaker&project=${D}&email=${e.id}&link=https%3A%2F%2Femailmaker.ru`}" target="_blank"><img src="https://https://racs.emcdn.ru/v3/v3/pixel/123.png?image=https://emcdn.ru/emailmaker/powered.png&project=${D}&email=${e.id}" width="150" height="50" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;"></a>`;q.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child")&&q.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child").insertAdjacentHTML("afterend",`<tr em="block" class="em-powered-logo">
|
|
858
|
-
<td align="center" bgcolor="#FFFFFF">${K}</td>
|
|
859
|
-
</tr>`)}},nn=async()=>{const M=ae();Me(M,async q=>{try{const K=document.querySelector(".email-preview"),Q=getComputedStyle(K),oe=await I(q,[Q.width],e.utm_parameters,async ze=>{tt(ze)}),V=await Z({htmlContent:oe,notification:v}).unwrap(),Ce=window.URL.createObjectURL(new Blob([V],{type:"application/pdf"})),_e=document.createElement("a");_e.href=Ce,_e.setAttribute("download",`${me()}.pdf`),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),window.URL.revokeObjectURL(Ce)}catch{}})},Tt=M=>{const q=ae();Me(q,K=>{be({event:"click",action:"export_email",export_type:"HTML"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q);I(K,[oe.width],e.utm_parameters,async V=>{await Oe(V),tt(V),await r.processAmp(V,M)}).then(V=>{const Ce=new Blob([V],{type:"text/html;charset=utf-8"});(0,cn.saveAs)(Ce,`${me()}.html`)}).catch(V=>{})},!0)},vt=M=>{const q=ae();Me(q,K=>{be({event:"click",action:"export_email",export_type:"TEXT"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q);I(K,[oe.width],e.utm_parameters,async V=>{await Oe(V),tt(V),await r.processAmp(V,M);const[{htmlToText:Ce},{EmailTextPlainConvertOptions:_e}]=await Promise.all([(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/1193bb41.js")),void 0,{}.url),(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/18aa476c.js")),void 0,{}.url)]);V.handleReadHtml(ze=>{ze.html=Ce(ze.contentDocument,_e)})}).then(V=>{const Ce=new Blob([V],{type:"text/plain;charset=utf-8"});(0,cn.saveAs)(Ce,`${me()}.txt`)}).catch(V=>{})})},Mt=()=>{const M=ae();Me(M,q=>{be({event:"click",action:"export_email",export_type:"MARKDOWN"});const K=document.querySelector(".email-preview"),Q=getComputedStyle(K),{utm_parameters:oe}=e;I(q,[Q.width],oe,async V=>{tt(V),await r.processAmp(V,"html");const{htmlToMarkdown:Ce}=await(0,Ye.__vitePreload)(async()=>{const{htmlToMarkdown:_e}=await Promise.resolve().then(()=>Ee("./static/core/ec289c6e.js"));return{htmlToMarkdown:_e}},void 0,{}.url);V.handleReadHtml(_e=>{_e.html=Ce(_e.contentDocument)})}).then(V=>{const Ce=new Blob([V],{type:"text/markdown;charset=utf-8"});(0,cn.saveAs)(Ce,`${me()}.md`)}).catch(V=>r.reportError(V,{origin:"markdown-export"}))})},It=M=>{const q=ae();Me(q,K=>{be({event:"click",action:"export_email",export_type:"Clipboard"});const Q=document.querySelector(".email-preview"),oe=getComputedStyle(Q);I(K,[oe.width],e.utm_parameters,async V=>{await Oe(V),tt(V),await r.processAmp(V,M)}).then(V=>navigator.clipboard.writeText(V).then(function(){v.success(n("The email has been copied to the clipboard."))})).catch(V=>{})},!0)},$t=async M=>{Ie&&co(Ie)},rn=()=>{rt(null),w("")},On=async()=>{if(!x){L(!0);try{const M=await ve([800,wf],Ef);if(!M)return;const{hrefs:q,dispose:K}=M;try{const[Q,oe]=await Promise.all(q.map(_e=>gt.getImageByUrl(_e).then(ze=>gt.imageToBlob(ze)))),V=me(),Ce=await gt.htmlFilesToZip(vf(V,{desktop:Q,mobile:oe}));(0,cn.saveAs)(Ce,Aa(V).archive),be({event:"click",action:"export_email",export_type:"Image"})}finally{K()}}catch{v.error({title:n("Error"),description:n("Failed to export the email as images. Please try again.")})}finally{L(!1)}}},Mn=M=>{const q=ee.get(r.APP_COOKIES.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(M)}`,{headers:{authorization:`Bearer ${q}`}}).then(K=>K.blob())},Nn=M=>new Promise((q,K)=>{const Q=()=>Mn(M).then(q,K);fetch(M).then(oe=>q(oe.blob()),Q).catch(()=>{})}),dt=(M,q)=>{const K=ae();Me(K,Q=>{be({event:"click",action:"export_email",export_type:"Outlook"});const oe=document.querySelector(".email-preview"),V=getComputedStyle(oe),Ce=async(_e,ze)=>{_e.document,await r.processAmp(_e,ze),await Oe(_e),tt(_e)};A(e.title,Q,[V.width,V.height],e.utm_parameters,M?_e=>Ce(_e,"html"):_e=>Ce(_e),q?{embedImagesAsBase64:!0,getImageBlob:Nn}:void 0).then(_e=>{const ze=new Blob([_e],{type:"text/html;charset=utf-8"});(0,cn.saveAs)(ze,`${me()}.eml`)}).catch(_e=>{})})},At=M=>{C({centered:!0,mask:{closable:!0},title:n("Embed images in the file?"),content:n('If "Yes", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If "No", images will be loaded from external links.'),okText:n("Yes"),cancelText:n("No"),onOk:()=>dt(M,!0),onCancel:()=>dt(M,!1)})},Dn=async()=>{const M=ae();Me(M,async q=>{be({event:"click",action:"export_email",export_type:"ZIP"});const K=document.querySelector(".email-preview"),Q=getComputedStyle(K),oe=await Y(q,[Q.width,void 0],e.utm_parameters,Nn,async Ce=>{await Oe(Ce),tt(Ce),st&&await r.processAmp(Ce,"html")});st&&(oe["amp.html"]=await I(q,[Q.width],e.utm_parameters,async Ce=>{await Oe(Ce),tt(Ce),await r.processAmp(Ce,"amp")}));const V=await gt.htmlFilesToZip(oe);(0,cn.saveAs)(V,`${me()}.zip`)},!0)},Yt=async()=>{if(be({event:"click",action:"duplicate_email",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew)v.warning({title:n("To create a copy, you need to save the email.")});else{if((await O.fire(e)).some(Q=>Q===!1))return;const{title:M,subject:q}=e,K=M||q||n("Untitled email.").replace(/\.$/,"");bt({title:Pt.generateCopyTitle(K),...e.meta!==void 0?{meta:e.meta}:{},project:Number(fe?.id),description:e.description,html:Pt.generateCopyHtml(ae()||"",String(e.title)),parent_email:e.parent_email||127017,common_styles:e.common_styles||"",utm_parameters:{utm_source:e.utm_parameters?.utm_source,utm_medium:e.utm_parameters?.utm_medium,utm_campaign:e.utm_parameters?.utm_campaign,utm_term:e.utm_parameters?.utm_term,utm_content:e.utm_parameters?.utm_content},emailtags:e.emailtags,folder:e.folder}).unwrap().then(Q=>{u(`/projects/${fe.id}/emails/${Q.id}`),v.success({title:n('The copy of email "')+K+n('" was successfully created.')}),be({event:"duplicate",action:"duplicate_email_success",entity_type:"email",entity_id:e.id,cloned_entity_id:Q.id,project_id:e.project,context:"editor"}),et("folder")}).catch(Q=>{v.error({title:Q.data.code,description:Q.data.message})})}},yn=()=>{be({event:"click",action:"click_delete_email_menu_item",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew?v.success(n("The draft of the email has been deleted.")):re(e,u)},re=(M,q)=>{be({event:"open",action:"open_delete_email_modal",entity_type:"email",entity_id:M.id,project_id:M.project,context:"editor"}),C({mask:{closable:!0},centered:!0,title:o('Are you sure to delete "',"email")+M.title+n('" email?'),icon:(0,s.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:22,style:{color:y.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:n("Yes"),cancelText:n("No"),onOk:()=>_t(M,q)})},Ae=()=>{mo().catch(()=>{}),r.uploadFile("application/zip, message/rfc822, text/html",Fe)},Fe=async M=>{const q=M[0];try{i(r.setIsGlobalLoading(!0));const{createDocumentProcessor:K,createFileProcessor:Q,importEmail:oe}=await mo(),{html:V,hasBrowserExtensionArtifacts:Ce}=await oe(q,Q(c,d,g,fe,j),K(q))??{html:"",hasBrowserExtensionArtifacts:!1};Ce&&$.fire();const[_e]=gt.getFileNameAndExt(q.name.replaceAll(" "," ")),ze=_e||Pt.getTitleFromHtml(V)||"";ne(V,{undoable:!0}),a({title:ze}),i(r.setIsGlobalLoading(!1)),ce.fire({html:V})}catch(K){i(r.setIsGlobalLoading(!1));const Q=K instanceof Error?K.message:K;v.error({title:Q})}be({event:"upload_file",action:"import_email"})},it=()=>{const M=ae();M&&(be({event:"click",action:"convert_layout"}),ce.fire({html:M}))},xe=[];j.emailDropdownMenuClone&&xe.push({label:n("Clone"),icon:(0,s.jsx)(r.EmIcons,{icon:"CopyOutlined",component:y.icons$CopyOutlined,size:16,strokeWidth:j.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:pt.isLoading,onClick:Yt}),j.emailDropdownMenuImport&&xe.push({label:o("Import","verb"),icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,style:Ft}),locked:qe.isLocked,strokeWidth:j.iconStrokeWidth}),key:"Import",className:"em-analytics__editor-page__import",onClick:()=>{if(qe.isLocked){Xe("template_import");return}be({event:"click",action:"import_email"}),Ae()}});const Kt=ae(),xt=!e.hasOwnProperty("type")&&wa(Kt,R)!==null;j.emailDropdownMenuConvert&&xt&&xe.push({label:n("Convert"),icon:(0,s.jsx)(r.EmIcons,{icon:"SwapOutlined",component:y.icons$SwapOutlined,size:16,strokeWidth:j.iconStrokeWidth}),key:"ConvertLayout",className:"em-analytics__email-convert",onClick:it}),(m||f||g.id?.toString()===e.author?.toString())&&(j.emailDropdownMenuLock&&xe.push({label:(0,s.jsx)(Ea,{element:e,context:"editor"},"Lock"),icon:e.lock?(0,s.jsx)(r.EmIcons,{icon:"UnLock",component:y.icons$UnLock,size:16,strokeWidth:j.iconStrokeWidth}):(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:16,strokeWidth:j.iconStrokeWidth}),disabled:e.isNew}),j.emailDropdownMenuRemove&&xe.push({label:n("Remove"),icon:(0,s.jsx)(r.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:16,strokeWidth:j.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:yn}));const st=e.isAmp,Et=[],Qt=()=>[...st?[{key:"html_txt",label:`${n("Plain text")} (HTML)`,onClick:()=>vt("html")},{key:"сode_txt",label:`${n("Plain text")} (AMP)`,onClick:()=>vt("amp")}]:[{key:"plain_txt",label:n("Plain text"),onClick:()=>vt()}],{key:"markdown",label:n("Markdown"),onClick:()=>Mt()}];j.exportHtmlEnabled&&Et.push({key:"html",label:n("Code"),icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"FileTextOutlined",component:y.icons$FileTextOutlined,style:Ft}),locked:F.isLocked,strokeWidth:j.iconStrokeWidth}),...F.isLocked?{onClick:()=>Xe("export_html")}:st?{children:[{key:"сode_html",label:n("AMP"),onClick:()=>Pe.isLocked?Xe("export_amp"):Tt("amp")},{key:"html_amp",label:n("HTML"),onClick:()=>Tt("html")}]}:{onClick:()=>Tt()}}),j.exportZipEnabled&&Et.push({key:"zip",label:n("ZIP"),icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"FileZipOutlined",component:y.icons$FileZipOutlined,style:Ft}),locked:F.isLocked,strokeWidth:j.iconStrokeWidth}),...F.isLocked?{onClick:()=>Xe("export_html")}:{onClick:()=>Dn().catch(M=>{})}}),j.exportClipboardEnabled&&Et.push({key:"clipboard",label:n("Clipboard"),icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"SnippetsOutlined",component:y.icons$SnippetsOutlined,style:Ft}),locked:F.isLocked,strokeWidth:j.iconStrokeWidth}),...F.isLocked?{onClick:()=>Xe("export_html")}:st?{children:[{key:"clipboard_html",label:n("AMP"),onClick:()=>Pe.isLocked?Xe("export_amp"):It("amp")},{key:"clipboard_amp",label:n("HTML"),onClick:()=>It("html")}]}:{onClick:()=>It()}}),j.exportTextEnabled&&Et.push({key:"text",label:n("Text"),icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"FileOutlined",component:y.icons$FileOutlined,style:Ft}),locked:F.isLocked,strokeWidth:j.iconStrokeWidth}),...F.isLocked?{onClick:()=>Xe("export_html")}:j.exportMarkdownEnabled?{children:Qt()}:st?{children:[{key:"сode_txt",label:n("AMP"),onClick:()=>Pe.isLocked?Xe("export_amp"):vt("amp")},{key:"html_txt",label:n("HTML"),onClick:()=>vt("html")}]}:{onClick:()=>vt()}}),j.exportOutlookEnabled&&Et.push({key:"outlook",icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"FileWordOutlined",component:y.icons$FileWordOutlined,style:Ft}),locked:Le.isLocked,strokeWidth:j.iconStrokeWidth}),label:n("Outlook"),onClick:()=>Le.isLocked?Xe("export_platforms"):At(!!st)}),j.exportPdfEnabled&&Et.push({key:"pdf",icon:(0,s.jsx)(Ht,{icon:(0,s.jsx)(r.EmIcons,{icon:"FilePdfOutlined",component:y.icons$FilePdfOutlined,style:Ft}),locked:b.isLocked,strokeWidth:j.iconStrokeWidth}),label:n("PDF"),onClick:()=>b.isLocked?Xe("export_pdf"):nn()}),j.exportPngEnabled&&Et.push({key:"img",icon:(0,s.jsx)(Ht,{icon:x?(0,s.jsx)(r.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,spin:!0,style:Ft}):(0,s.jsx)(r.EmIcons,{icon:"FileImageOutlined",component:y.icons$FileImageOutlined,style:Ft}),locked:H.isLocked,strokeWidth:j.iconStrokeWidth}),label:n("PNG"),disabled:!H.isLocked&&x,onClick:()=>H.isLocked?Xe("export_png"):On()});const ft=e.author;return(0,s.jsxs)(y.ui_kit$Space,{children:[j.emailDropdownMenuEnabled?(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:xe},children:(0,s.jsx)(y.ui_kit$Button,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{},children:(0,s.jsx)(r.EmIcons,{icon:"DotsHoriz",component:y.icons$DotsHoriz,size:18,strokeWidth:j.iconStrokeWidth})})},"Actions"):j.emailDropdownMenuImport&&(0,s.jsx)(y.ui_kit$Tooltip,{title:o("Import","verb"),placement:"bottom",children:j.emailDropdownMenuImportButton?(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",icon:(0,s.jsx)(r.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:16,strokeWidth:j.iconStrokeWidth}),onClick:()=>{be({event:"click",action:"import_email"}),Ae()},children:n("Import")}):(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",type:"text",icon:(0,s.jsx)(r.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:22,strokeWidth:j.iconStrokeWidth}),onClick:()=>{be({event:"click",action:"import_email"}),Ae()}})}),j.emailExportEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:Et},children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-page__export",type:"default",icon:(0,s.jsx)(r.EmIcons,{icon:"CloudDownloadOutlined",component:y.icons$CloudDownloadOutlined,size:16,strokeWidth:j.iconStrokeWidth}),children:n("Export")},"Export")},"Export"),!e.hasOwnProperty("type")&&(0,s.jsx)(va,{disabled:ge,email:e},"Save"),!!e.hasOwnProperty("type")&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Vu,{disabled:ge,rightCol:void 0,block:e,isEditableRights:m||f||g.id?.toString()===ft?.toString(),autoSaveBlockResult:t})},"Save"),(0,s.jsx)(_p,{open:he,codeSize:r.getCodeSize(Te),onMinimize:Ut,onDownloadAsIs:Ne,onCancel:Ve}),Ie&&co(Ie)&&(0,s.jsx)(xp,{integration:co(Ie),visible:!!Ie,loading:Qe,onConfirm:$t,onCancel:rn,__:n}),(0,s.jsx)(r.PlanUpgradePrompt,{open:te,sideOnOk:void 0,onCancel:()=>ye(!1),initialSlide:we})]})},_r=r.createApi({reducerPath:"confirmationMailApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:t,email:n})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${t}&user_email=${n}`)}`})})})}),{useLazyGetConfirmationMailQuery:If}=_r,Af=()=>{const{__:e}=r.useI18n(),t=r.useNotification(),n=r.useCurrentUser(),[o]=If(),[i,a]=(0,l.useState)(!1),c=r.usePushToDataLayer();(0,l.useEffect)(()=>{n.hasOwnProperty("email_confirmation")&&a(n.email_confirmation)},[n,i]);const d=()=>{c({event:"click",action:"click_resend_confirmation_email",user_email:n.email,user_id:n.id}),o({userId:n.id,email:n.email}).then(({data:u,error:m})=>{u?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",n.email)):m&&t.error(m)})};return n?.email_confirmation||!n?.privacy_policy_agreement?null:(0,s.jsx)("div",{className:"main__ribbon",children:(0,s.jsxs)("span",{children:[(0,s.jsx)(r.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:16,style:{marginRight:10,verticalAlign:"-0.15em"}}),e("Confirmation email was sent to")," ",(0,s.jsx)("em",{children:n.email}),". ",e("Didn't receive an email?")," ",(0,s.jsxs)(y.ui_kit$Button,{type:"primary",size:"small",className:"main__ribbon-resend",style:{fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",gap:8},onClick:d,children:[e("Resend"),(0,s.jsx)(r.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:16,style:{flexShrink:0}})]})]})})},xf=({className:e,leftBlock:t,rightBlock:n,isHeaderCodeMenuOpen:o=!1})=>{const{token:i}=(0,y.ui_kit$useToken)(),a=(0,l.useRef)(),c=r.useAppConfig();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Af,{}),c.headerShow&&(0,s.jsx)("header",{className:(0,nt.default)("header",{[e]:e}),style:{borderColor:i.colorBorder},children:!o&&(0,s.jsx)(r.CSSTransition,{nodeRef:a,in:!o,timeout:300,classNames:"transition",children:(0,s.jsxs)("div",{className:"header__container container",children:[(0,s.jsx)("div",{className:"header__left",style:{flexGrow:1},children:t}),(0,s.jsx)("div",{className:"header__right",children:(0,s.jsx)(y.ui_kit$Space,{size:10,children:n})})]})})})]})},Pf=e=>{},xa=h.createIdentifier$1("canvas.headerFlow");function Rf(e){const t=(0,l.useCallback)(n=>e?e.subscribe(n):()=>{},[e]);return(0,l.useSyncExternalStore)(t,()=>e?.isReady()===!0)}var Pa=({email:e,isCollaborationEditor:t})=>{const[n]=y.ui_kit$Form.useForm(),{__:o}=r.useI18n();let i=r.useDispatch();const a=r.useEmailAttributesWriter(),c=r.useAppNavigate(),d=r.useOpenPlanCatalog(),u=Yi("header"),m=r.useCurrentUser(),f=r.useContainer().getInstance(xa),g=r.useProjectData(),{owner:_,admin:p}=Xn(),{token:v}=(0,y.ui_kit$useToken)(),C=r.useAppConfig(),k=r.usePushToDataLayer(),S=(0,l.useRef)(),I=(0,l.useRef)(),A=(0,l.useRef)(),Y=r.useEventEmitter(h.events.ON_PREVIOUSBUTTON_CLICK_ID),ee=r.useEventEmitter(h.events.ON_PREHEADER_CHANGED_ID),j=r.useEventEmitter(h.events.ON_SUBJECT_CHANGED_ID),R=r.useSelector(r.selectCodeModeDirection),N=e.hasOwnProperty("type")?r.BLOCK:r.EMAIL,B=r.useSelector(r.selectElementSettings$1),D=r.useSelector(r.selectElementSettings),O=N==="email"?B:D,$=r.useSelector(r.selectIsCodeMode),[de,ue]=(0,l.useState)(!1),[z,ie]=(0,l.useState)(!1),[je,pe]=(0,l.useState)(!1),Qe=(0,l.useCallback)(()=>pe(!1),[]),be=(0,l.useCallback)(()=>{pe(!1),d()},[d]),ge=Hi("email_generate"),X=ge.exceeded?r.getLimitUpgradePresetDefinition(ge.exceeded.presetId):null;(0,l.useEffect)(()=>{const b=!!O?.type&&(O?.type===r.ELEMENT_TYPES.TEXT||O?.type===r.ELEMENT_TYPES.LINK||O.type===r.ELEMENT_TYPES.BUTTON)&&$&&R!=="bottom";ue(b),i(r.setHeaderCodeMenuOpen(b))},[O,R,$]);const he=(0,l.useCallback)(()=>{k({event:"click",action:"click_back_button",entity_type:N==="block"?"block":"email",entity_id:e?.id,project_id:e?.project||g?.id,context:"editor"}),Y.fire(e)},[c,Y,e,g?.id,k,N]),{document:se}=r.useCurrentSession(),le=Rf(se);r.usePrevious(([b])=>{le&&b!==e.subject&&j.fire(e.subject)},[e.subject,le]);const Se=(0,l.useCallback)(b=>{const H=b.target.value;j.fire(H)},[j]),Te=(0,l.useCallback)(b=>{const H=b.target.value;ee.fire(H)},[ee]);r.usePrevious(([b])=>{le&&b!==e.preheader&&ee.fire(e.preheader)},[e.preheader,le]);const Ue=(0,l.useCallback)((b,H="?")=>{b.subject?.length,b.preheader?.length,n.setFieldValue("subject",b.subject??""),n.setFieldValue("preheader",b.preheader??"")},[n]),te=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{const b=e?.renderGuid??(e?.id!=null?String(e.id):void 0);!le||!b||te.current===b||(te.current=b,Ue(e,"identity"))},[le,e,Ue]);const ye=(0,l.useCallback)(b=>{const H=r.stripSubjectTags(b.value).trim();return H!==b.value&&n.setFieldValue("subject",H),H},[n]),we=(0,l.useCallback)(b=>{const H=ye(b.target);a({subject:H})},[a,ye]),ke=r.useEvent(h.events.BEFORE_SAVE_EMAIL),Ie=(0,l.useCallback)(async b=>{const H=I.current?.input;if(document.activeElement===H){const Pe=ye(H);Pe!==b.subject&&(b.subject=Pe,a({subject:Pe}))}const Le=A.current?.input;if(document.activeElement===Le){const Pe=Le.value.trim();Pe!==b.preheader&&(b.preheader=Pe,a({preheader:Pe}))}await f?.whenDelivered()},[f,a,ye]);(0,l.useEffect)(()=>{const b=ke(Ie);return()=>b.dispose()},[ke,Ie]);const rt=(0,l.useCallback)(b=>{const H=b.target.value.trim();a({preheader:H})},[a]),T=r.useEvent(h.events.ON_HEADER_APPLIED_ID);(0,l.useEffect)(()=>{const b=T(({field:H,value:Le})=>{n.setFieldValue(H,Le)});return()=>b.dispose()},[T,n]),Pf(e.title===null?o("New email title"):e.title);const w=(0,l.useCallback)(()=>{i(r.setActiveSettingsTab(r.AICHAT)),setTimeout(()=>{const b=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');b&&b.click()},100)},[i]),x=(0,l.useCallback)(()=>{ge.isLocked?ge.state.state==="locked_by_limit"&&ge.exceeded?pe(!0):ie(!0):w()},[ge,w]),L=(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(y.ui_kit$Space,{ref:S,size:10,children:[C.headerArrowBackVisible&&(0,s.jsx)(y.ui_kit$Tooltip,{title:o("Back"),placement:"left",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(r.EmIcons,{icon:"ArrowLeftOutlined",component:y.icons$ArrowLeftOutlined,size:22,strokeWidth:C.iconStrokeWidth}),onClick:he,shape:"circle"})}),(0,s.jsx)("div",{children:(C.headerTitleVisible||C.headerPreheaderVisible)&&(0,s.jsxs)(y.ui_kit$Form,{form:n,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""},children:[C.headerTitleVisible&&(0,s.jsx)("div",{style:{marginTop:le?-3:0},children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:o("Subject")}),le?(0,s.jsxs)("div",{className:"ant-page-header-heading",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"subject",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-title",ref:I,placeholder:o("Enter subject line here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Se,onPressEnter:we,onBlur:b=>{we(b),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:C.lockPreheaderAndTitle})}),C.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:o("Generate with AI"),children:(0,s.jsx)(r.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:C.iconStrokeWidth,onClick:x})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}})]})}),C.headerPreheaderVisible&&(0,s.jsx)("div",{children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:o("Preheader")}),le?(0,s.jsxs)("div",{className:"ant-page-header-heading ant-page-header-heading_preheader",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"preheader",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-preheader",ref:A,placeholder:o("Enter preheader here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Te,onPressEnter:rt,onBlur:b=>{rt(b),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:C.lockPreheaderAndTitle})}),C.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:o("Generate with AI"),children:(0,s.jsx)(r.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:C.iconStrokeWidth,onClick:x})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}})]})})]})})]})}),F=(0,s.jsxs)(s.Fragment,{children:[C.emailIdShow&&!!e.id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"email-page-header__email-id",children:"ID"+e.id}),(0,s.jsx)(y.ui_kit$Divider,{orientation:"vertical"})]}),(0,s.jsx)(ha,{emailElement:e,isCollaborationEditor:t}),C.commandButtonsEnabled&&(0,s.jsxs)(s.Fragment,{children:[e.lock?(0,s.jsx)(r.EmIcons,{icon:"Lock",component:y.icons$Lock,size:18,strokeWidth:C.iconStrokeWidth,className:(0,nt.default)("lock-icon",{"lock-icon__disabled":!(_||p||m.id?.toString()===e.author?.toString())}),style:{color:v.colorPrimary,verticalAlign:"sub"}},"Lock"):null,(0,s.jsx)(Tf,{email:e,isHeaderCodeMenuOpen:de},"Buttons")]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(xf,{className:"email-pane__header",leftBlock:u?L:null,rightBlock:u?F:null,isHeaderCodeMenuOpen:de}),(0,s.jsx)(r.PlanUpgradePrompt,{open:z,onCancel:()=>ie(!1),initialSlide:9}),X&&ge.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(no,{open:je,onClose:Qe,title:o(X.titleKey),subtitle:o(X.subtitleKey),usageResource:X.usageResource,previousDisplay:r.presetLimitDisplay(ge.exceeded.previousLimit),nextDisplay:r.presetLimitDisplay(ge.exceeded.nextLimit),onChangePlan:be})}):null]})};Pa.propTypes={};function jf(e){const t=r.parseEmBlockVersion(e);if(!t)return e;const n=o=>String(o).padStart(2,"0");return`${n(t.getDate())}.${n(t.getMonth()+1)}.${t.getFullYear()} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Lf=({open:e,blocks:t,projectId:n,onClose:o})=>{const{__:i,_n:a}=r.useI18n(),c=r.useSendPostMessage(),d=r.useNotification(),[u,m]=(0,l.useState)({});(0,l.useEffect)(()=>{e&&m(Object.fromEntries(t.map(p=>[p.emBlockId,!0])))},[e,t]);const f=(0,l.useMemo)(()=>Object.values(u).filter(Boolean).length,[u]),g=(p,v)=>{m(C=>({...C,[p]:v}))},_=()=>{const p=t.filter(v=>u[v.emBlockId]);p.length&&(p.forEach(v=>{c({operation:r.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,settings:{emBlockId:v.emBlockId,blockHTML:v.savedHtml,type:"project",...n?{project:String(n)}:{}}})}),d.success({message:i("Updated")+" "+p.length+" "+a("block","blocks",p.length),placement:"bottomRight"}),o())};return(0,s.jsxs)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Update global blocks")}),open:e,onOk:_,onCancel:o,footer:(0,s.jsxs)("div",{className:"update-global-blocks-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:o,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",disabled:f===0,onClick:_,children:i("Update")})]}),children:[(0,s.jsx)("div",{className:"update-global-blocks-modal__hint",children:i("These global blocks have a newer saved version. Select the ones to update in the template.")}),(0,s.jsx)("div",{className:"update-global-blocks-modal__list",children:t.map(p=>(0,s.jsxs)("div",{className:"update-global-blocks-modal__row",children:[(0,s.jsx)(y.ui_kit$Switch,{checked:!!u[p.emBlockId],onChange:v=>g(p.emBlockId,v)}),(0,s.jsxs)("span",{className:"update-global-blocks-modal__title",title:p.title,children:[p.title,(0,s.jsxs)("span",{className:"update-global-blocks-modal__version",children:[i("Version of")," ",jf(p.savedVersion)]})]}),p.instances>1&&(0,s.jsxs)("span",{className:"update-global-blocks-modal__count",children:[p.instances," ",a("instance","instances",p.instances)]})]},p.emBlockId))})]})};function Of(e){const t=new Map;return e?.trim()&&new DOMParser().parseFromString(e,"text/html").querySelectorAll('[em="block"][em-block-id]').forEach(n=>{const o=n.getAttribute("em-block-id");if(!o)return;const i=n.getAttribute("em-block-version")??void 0,a=t.get(o);a?(a.versions.add(i),a.count+=1):t.set(o,{versions:new Set([i]),count:1})}),t}function Mf(e,t){const n=Of(e);if(!n.size||!t?.length)return[];const o=[];for(const i of t){if(!i.global_block||!i.id||!i.html)continue;const a=String(i.id),c=n.get(a);if(!c)continue;const d=r.readRootEmBlockAttrs(i.html).emBlockVersion;d&&[...c.versions].some(u=>u!==d)&&o.push({emBlockId:a,title:i.title?.trim()||a,savedHtml:i.html,savedVersion:d,templateVersion:[...c.versions][0],instances:c.count})}return o}var Ra="em-block-id";function Nf({projectId:e,document:t}){const n=r.useEvent(h.events.ON_EMAIL_INIT_ID),o=r.useHeadless(),[i,a]=(0,l.useState)([]),[c,d]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),f=(0,l.useCallback)(v=>t?.subscribe(v)??(()=>{}),[t]),g=(0,l.useSyncExternalStore)(f,()=>!!t?.getContent().includes(Ra)),{data:_}=r.blocksApi.endpoints.getBlocks.useQuery(r.projectBlocksArgs(e),{skip:!e||!g}),p=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{g&&p.current&&t&&(p.current=!1,m(t.getContent()))},[g,t]),(0,l.useEffect)(()=>{const v=new h.Disposable;return v.addDisposable(n(C=>{if(C?.reset)return;const k=C?.html??"",S=k.includes(Ra);p.current=!S,m(S?k:null)})),()=>v.dispose()},[n]),(0,l.useEffect)(()=>{if(u==null||!_)return;if(o){m(null);return}const v=Mf(u,_);v.length&&(a(v),d(!0)),m(null)},[u,_,o]),{outdatedBlocks:i,isOpen:c,close:(0,l.useCallback)(()=>d(!1),[])}}var Df=({open:e,html:t,emBlockId:n,onSaveAsNew:o,onClose:i})=>{const{__:a}=r.useI18n(),c=r.useSendPostMessage(),d=r.useNotification(),[u]=r.useEditBlockMutation(),[m,f]=(0,l.useState)(!1),g=async()=>{if(!n||!t){i();return}f(!0);const _=new Date,p=r.formatEmBlockVersion(_),v=r.injectEmBlockIdIntoBlockHtml(t,String(n),_),C=await u({blockId:String(n),html:v});if(f(!1),"error"in C&&C.error){d.error({message:a("Failed to update the global block."),placement:"bottomRight"});return}c({operation:r.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(n),emBlockVersion:p}}),d.success({message:a("The global block was updated."),placement:"bottomRight"}),i()};return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:a("Saving changes in the block")}),open:e,onCancel:i,footer:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",disabled:m,onClick:o,children:a("Create new block")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",loading:m,onClick:g,children:a("Update current block")})]}),children:(0,s.jsx)("div",{children:a("This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.")})})},Ff=(function(){var e=window.__emailmaker__;if(e&&e.assetUrl)return e.assetUrl("converter-intro.bf4ee74d750b35ae2c10.png");if(e&&e.publicPath)try{return new URL("static/media/converter-intro.bf4ee74d750b35ae2c10.png",e.publicPath).href}catch{}try{return new URL("/static/media/converter-intro.bf4ee74d750b35ae2c10.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/converter-intro.bf4ee74d750b35ae2c10.png"}})(),Bf={closable:!1},Uf=Ff,$f=({open:e,onConfirm:t,onCancel:n,neverSuggestAgain:o,onNeverSuggestAgainChange:i})=>{const{__:a}=r.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{className:"convert-layout-modal",title:(0,s.jsx)("div",{className:"convert-layout-modal__title",children:a("Template conversion")}),open:e,onOk:t,onCancel:n,mask:Bf,width:480,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",style:{display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsx)(y.ui_kit$Switch,{size:"small",checked:o,onChange:i,label:a("Don't suggest again"),labelSize:"small"}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:n,children:a("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:a("Convert")})]})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__content",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24,padding:"0 8px",overflow:"hidden"},children:[(0,s.jsx)("div",{className:"convert-layout-modal__text convert-layout-modal__intro-text",style:{textAlign:"center"},children:a("This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.")}),(0,s.jsx)("img",{src:Uf,alt:"Converter Intro",className:"convert-layout-modal__image",style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",borderRadius:8}})]})})},Gf={closable:!1},zf=({open:e,message:t,onRetry:n,onCancel:o})=>{const{__:i}=r.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Conversion failed")}),open:e,onOk:n,onCancel:o,mask:Gf,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:o,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:n,children:i("Try again")})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__text",children:[i("Something went wrong during layout conversion. You can try running the conversion again."),t?(0,s.jsx)("div",{className:"convert-layout-modal__error-details",children:t}):null]})})},Wf=({open:e,progress:t})=>{const{__:n}=r.useI18n();return e?(0,s.jsx)("div",{className:"conversion-overlay",children:(0,s.jsxs)("div",{className:"conversion-overlay__content",children:[(0,s.jsx)(y.ui_kit$Spin,{size:"large"}),(0,s.jsx)("div",{className:"conversion-overlay__title",children:n("Converting layout…")}),(0,s.jsx)("div",{className:"conversion-overlay__hint",children:n("This may take several minutes. Please keep this tab open.")}),(0,s.jsx)(y.ui_kit$Progress,{className:"conversion-overlay__progress",percent:Math.round(t),status:"active",strokeColor:r.emCssVar("colorPrimary")})]})}):null},br=r.createApi({reducerPath:"layoutConverterApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({createConvertJob:e.mutation({query:({html:t})=>({url:"/ai/converter/jobs",method:"POST",body:{html:t}})}),getConvertJobStatus:e.query({query:t=>({url:`/ai/converter/jobs/${t}`,method:"GET"})})})}),{useCreateConvertJobMutation:Hf,useLazyGetConvertJobStatusQuery:qf}=br;function Vf(){try{return window.localStorage.getItem(r.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)==="true"}catch{return!1}}function Yf(e){try{e?window.localStorage.setItem(r.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest,"true"):window.localStorage.removeItem(r.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)}catch{}}function ja(e){return e==="beefree"?(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/cbcede3f.js")).then(t=>t.convertBeeFreeToEmailMaker),void 0,{}.url):(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/bebf981d.js")).then(t=>t.convertStripoToEmailMaker),void 0,{}.url)}var Kf=5,La=95,Qf=35e3,Xf=1e3,Jf=e=>new Promise(t=>setTimeout(t,e));function Zf(e,t){if(e&&typeof e=="object"){const n=e,o=n.data;if(o&&typeof o=="object"){const i=o.error;if(typeof i=="object"&&i?.message)return i.message;if(typeof i=="string"&&i)return i;if(o.message)return o.message}if(typeof o=="string"&&o)return o;if(n.error)return n.error;if(n.message)return n.message}return t}function eh(){const{__:e}=r.useI18n(),t=r.useContentReplacer(),n=r.useNotification(),o=Sa(),{aiLayoutConverterEnabled:i,anyConverterEnabled:a}=o,c=r.useHeadless(),d=r.useEvent(h.events.ON_EMAIL_INIT_ID),u=r.useEvent(h.events.ON_LAYOUT_CONVERT_REQUEST_ID),[m]=Hf(),[f]=qf(),[g,_]=(0,l.useState)(Vf),p=(0,l.useRef)(g),v=(0,l.useCallback)(se=>{p.current=se,_(se),Yf(se)},[]),[C,k]=(0,l.useState)(!1),[S,I]=(0,l.useState)(!1),[A,Y]=(0,l.useState)(0),[ee,j]=(0,l.useState)(!1),[R,N]=(0,l.useState)(""),B=(0,l.useRef)(""),D=(0,l.useRef)(null),O=(0,l.useRef)(null),$=(0,l.useRef)(!1),de=(0,l.useRef)({cancelled:!0}),ue=(0,l.useRef)(null);(0,l.useEffect)(()=>{$.current=S},[S]);const z=(0,l.useCallback)(()=>{ue.current!==null&&(clearInterval(ue.current),ue.current=null)},[]),ie=(0,l.useCallback)(()=>{z();const se=Date.now();ue.current=setInterval(()=>{const le=Date.now()-se,Se=La*(1-Math.exp(-le/Qf));Y(Te=>Math.max(Te,Math.min(La,Se)))},Xf)},[z]),je=(0,l.useCallback)(se=>{se&&(t(se,{undoable:!0}),O.current=se)},[t]),pe=(0,l.useCallback)(async se=>{const le={cancelled:!1};de.current=le,j(!1);const Se=D.current;if(Se==="beefree"||Se==="stripo"){try{const Te=await ja(Se),Ue=le.cancelled?"":Te(se);if(Ue&&!le.cancelled){je(Ue),n.success({message:r.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"});return}}catch{}if(!i){le.cancelled||(N(e("Layout conversion failed")),j(!0));return}}if(i){I(!0),Y(0),ie();try{const Te=await m({html:se}).unwrap();if(le.cancelled)return;let Ue=Te.retry_after>0?Te.retry_after:Kf;for(;!le.cancelled;){if(await Jf(Ue*1e3),le.cancelled)return;const te=await f(Te.job_id).unwrap();if(le.cancelled)return;if(te.retry_after&&te.retry_after>0&&(Ue=te.retry_after),te.status==="completed"){z(),Y(100),je(te.html??""),n.success({message:r.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"}),setTimeout(()=>{le.cancelled||(I(!1),Y(0))},400);return}if(te.status==="failed")throw new Error(te.error?.message||e("Layout conversion failed"))}}catch(Te){if(le.cancelled)return;z(),I(!1),Y(0),N(Zf(Te,e("Layout conversion failed"))),j(!0)}}},[e,i,je,m,n,f,ie,z]),Qe=(0,l.useCallback)(()=>{k(!1);const se=B.current;se&&pe(se)},[pe]),be=(0,l.useCallback)(()=>{k(!1),O.current=B.current},[]),ge=(0,l.useCallback)(()=>{j(!1);const se=B.current;se&&pe(se)},[pe]),X=(0,l.useCallback)(()=>{j(!1),O.current=B.current},[]),he=(0,l.useCallback)((se,le=!1)=>{const Se=wa(se,o);if(a&&!c&&Se&&!$.current){if(le)O.current=null;else{if(p.current)return;if(O.current===se)return}B.current=se,D.current=Se,Se!=="ai"&&ja(Se).catch(()=>{}),k(!0)}},[a,o,c]);return(0,l.useEffect)(()=>{if(!a)return;const se=new h.Disposable;return se.addDisposable(d(le=>{if(le?.reset)return;const Se=le?.html??"";$.current&&Se!==B.current&&(de.current.cancelled=!0,$.current=!1,z(),I(!1),Y(0)),k(!1),j(!1),he(Se)})),()=>se.dispose()},[a,d,he,z]),(0,l.useEffect)(()=>{if(!a)return;const se=new h.Disposable;return se.addDisposable(u(le=>{he(le?.html??"",!0)})),()=>se.dispose()},[a,u,he]),(0,l.useEffect)(()=>()=>{de.current.cancelled=!0,z()},[z]),{isPromptOpen:C,isConverting:S,progress:A,isErrorOpen:ee,errorMessage:R,confirmConversion:Qe,cancelPrompt:be,retryConversion:ge,closeError:X,neverSuggestAgain:g,setNeverSuggestAgain:v}}var th=6e4,Oa=new Map;function nh(e){const t=e?String(e):"",n=Oa.get(t);if(n&&(Oa.delete(t),!(Date.now()-n.at>th)))return n.promise}var po={data:void 0,isSuccess:!1,isError:!1,error:void 0,isLoading:!1};function rh(e){const t=r.useStore(),n=(0,l.useRef)(t);n.current=t;const[o,i]=(0,l.useState)(po),a=e?String(e):void 0;return(0,l.useEffect)(()=>{if(!a){i(po);return}let c=!1;return i({...po,isLoading:!0}),(nh(a)??r.resolveEmailPort(h.getContainer(n.current)).readEmail(a)).then(d=>{c||i({data:d??void 0,isSuccess:!0,isError:!1,error:void 0,isLoading:!1})}).catch(d=>{c||i({data:void 0,isSuccess:!1,isError:!0,error:d,isLoading:!1})}),()=>{c=!0}},[a]),o}var Bv=2;function oh(){const e=r.useProjectData()?.id,t=!0,{data:n,isError:o,isFetching:i,refetch:a}=r.useGetProjectPlanQuery(e,{skip:t}),[c,d]=(0,l.useState)(0),u=(0,l.useRef)(!1),m=!!o,f=c>=2,g=(0,l.useCallback)(()=>{u.current=!1,d(0),a()},[a]);(0,l.useEffect)(()=>{},[m,i,a,c,t]),(0,l.useEffect)(()=>{},[m,e,f,t]);const _="ready";return(0,l.useMemo)(()=>({status:_,retry:g}),[_,g])}var Uv=300,ih=h.createIdentifier$1("prewarm.queue");function ah(e){const t=[];let n=!1,o=!1,i;const a=()=>{i&&(i.unwatch(),e.clearTimer(i.timer),i=void 0)},c=()=>{const m=t.shift();if(!m)return;o=!0;const f=()=>{o=!1,u()};m.start().then(f,f)},d=()=>{a(),e.idle(()=>{if(!(o||t.length===0)){if(e.activity.inFlight()>0){u();return}c()}})};function u(){if(!n||o||i||t.length===0)return;const m=()=>e.setTimer(d,300),f={timer:e.activity.inFlight()===0?m():void 0,unwatch:e.activity.watch(()=>{e.clearTimer(f.timer),f.timer=e.activity.inFlight()===0?m():void 0})};i=f}return e.whenVisible(()=>{n=!0,u()}),{add(m){t.some(f=>f.name===m.name)||(t.push(m),u())},remove(m){const f=t.findIndex(g=>g.name===m);f>=0&&t.splice(f,1),t.length===0&&a()}}}function sh(e){return e.getOrCreateInstance(ih,()=>ah({activity:h.getNetworkActivity(e),whenVisible:t=>Wt(e).whenVisible(t),idle:Jt,setTimer:(t,n)=>window.setTimeout(t,n),clearTimer:t=>window.clearTimeout(t)}))}function lh({projectId:e,project:t,emailProjectId:n,parentEmailId:o}){const i=r.useContainer(),a=r.useAppDispatch(),d=!!r.useCookieManager().get(r.APP_COOKIES.em_token);(0,l.useEffect)(()=>{const u=sh(i),m=[],f=[],g=(p,v)=>{f.push(p),u.add({name:p,start:()=>{const C=v();return m.push(C),Promise.resolve(C)}})},_=r.parentEmailSource(o);return _&&g("blocks.parentEmail",()=>a(r.blocksApi.endpoints.getParentEmailBlocks.initiate(r.parentEmailBlocksArgs(_)))),g("blocks.template",()=>a(r.blocksApi.endpoints.getTemplateBlocks.initiate(r.templateBlocksArgs()))),e&&g("blocks.list",()=>a(r.blocksApi.endpoints.getBlocks.initiate(r.projectBlocksArgs(e)))),g("blocks.schema",()=>a(r.blocksApi.endpoints.getBlocksSchema.initiate(void 0))),t?.id&&g("blocks.tags",()=>a(r.taxonomiesApi.endpoints.getTerms.initiate({project:t,kind:r.BLOCK_TAGS}))),()=>{f.forEach(p=>u.remove(p)),m.forEach(p=>p.unsubscribe())}},[i,a,e,t,n,o,d])}var fo="AUTOSAVE_RECOVERY";function ch(e,t,n=!1,o){const i=t?.get().serverId??void 0,{__:a}=r.useI18n(),c=r.useNotification(),d=r.useAppConfig(),u=r.useSelector(r.selectMonacoFocusing),m=r.useContainer(),f=m?.getInstance(xa),g=(0,l.useRef)(0),_=r.useSelector(r.selectIsPanelHistoryCollapsed),p=r.useSelector(r.selectActiveSettingsTab),v=r.useDispatch(),C=(0,l.useSyncExternalStore)((0,l.useCallback)(R=>o?.subscribe(R)??(()=>{}),[o]),()=>o?.recoveryFacts()),k=d?.revisionService===!0,S=C?.isRecovering===!0,I=C?.applied,A=(0,l.useCallback)(()=>{v(r.markAppearanceNeedsUpdate());const R=e?.renderGuid,N=e?.preheader,B=e?.subject;R&&(N||B)&&f?.reassert({...N?{preheader:N}:{},...B?{subject:B}:{}})},[v,f,e?.preheader,e?.subject,e?.title,e?.common_styles,e?.renderGuid,t,o]);(0,l.useEffect)(()=>()=>{clearTimeout(g.current),o?.endForcedHeaders()},[i,o]),(0,l.useEffect)(()=>{k&&S&&c.info({key:fo,title:a("Loading latest changes..."),duration:0})},[k,S,c,a]);const Y=(0,l.useRef)({emailId:void 0,seq:0});(0,l.useEffect)(()=>{if(!I||C?.emailId!==i||(Y.current.emailId!==i&&(Y.current={emailId:i,seq:0}),I.seq<=Y.current.seq))return;Y.current={emailId:i,seq:I.seq},A();const{phase:R}=I;!k||R==="normal"||(R==="found"?c.success({key:fo,title:a("Changes loaded"),duration:3}):R==="timeout"?c.warning({key:fo,title:a("Locally saved version applied"),description:a("Syncing with the server in the background..."),duration:5}):R==="bg"&&c.info({key:"AUTOSAVE_BG_SYNCED",title:a("Email synced with the server"),duration:3}))},[k,I,C?.emailId,i,A,c,a]),(0,l.useEffect)(()=>{if(!n)return;const R=N=>{N.preventDefault()};return window.addEventListener("beforeunload",R),()=>window.removeEventListener("beforeunload",R)},[n]);const ee=!_||u||p==="Discuss",j=m?r.provideAutosaveUiFacts(m):void 0;(0,l.useEffect)(()=>{j?.set({...j.get()??{isUserBusy:!1,saveContext:{}},isUserBusy:ee})},[j,ee])}var dh=class extends Error{label;timeoutMs;constructor(e,t){super(`[${e}] timed out after ${t}ms`),this.name="OperationTimeoutError",this.label=e,this.timeoutMs=t}};function uh(e,t,n){return t<=0?e:new Promise((o,i)=>{let a=!1,c;const d=u=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),u())};c=setTimeout(()=>{d(()=>i(new dh(n,t)))},t),e.then(u=>{d(()=>o(u))},u=>{d(()=>i(u))})})}var mh=2,vr=Symbol("sandbox:frame-replaced");function dn(e,t,n,o,i,a,c){const d=`sandbox:${t}`,u=a?.getSandboxTimeoutMs(t)??r.DEFAULT_SANDBOX_OP_TIMEOUT_MS[t],m=()=>{let v=uh(e.sendAsync(n,o),u,d);return v=h.raceWithAbortSignal(v,a?.signal),r.logShowPipelineWait(d,v,i)};if(t==="INIT_START"&&Qi(e)){const v=a?.getSandboxReadyTimeoutMs()??2e4,C=e,k=S=>{const I=Xi(C,v,a?.signal);return r.logShowPipelineWait("sandbox:INIT_START:ready-wait",I,i).then(()=>{if(!c||S<=0)return m();const A=c.getGeneration();let Y;const ee=new Promise((R,N)=>{Y=c.onChange(()=>{c.getGeneration()!==A&&N(vr)})}),j=m();return j.catch(()=>{}),Promise.race([j,ee]).finally(()=>Y?.()).catch(R=>{if(R!==vr)throw R;return{...i},k(S-1)})})};return k(mh)}if(!c)return m();const f=c.getGeneration();let g;const _=new Promise((v,C)=>{g=c.onChange(()=>{c.getGeneration()!==f&&C(vr)})}),p=m();return p.catch(()=>{}),Promise.race([p,_]).finally(()=>g?.()).catch(v=>{throw v===vr&&{...i},v})}function Ma(e,t,n,o){return{html:e,guid:t,...Object.keys(n).length>0?{templateDirectivesPolicy:n}:{},...o!==void 0?{rev:o}:{}}}var Na="self-init:";function ph(e){return e.startsWith(Na)}function Da(e,t){const n=e.getActiveShowRequest();return ph(t)?n===null:n?.showId===t&&e.hasPendingShow(t)}function fh(e){const t=()=>e.initPipeline(),n=e.messageService,o=()=>e.waitScope?.()??t();let i="";const a=()=>e.readDocument()?r.readDocumentContent(e.readDocument()):i,c=()=>ln(e.container).editorPolicy,d=()=>e.readEmail(),u=()=>{const m=d();return{...m,id:e.isTemplate()||m.isNew?void 0:m.id,html:a()}};return{readContent:a,publicEmail:u,sendInitStart:()=>dn(n,"INIT_START",r.EVENT_TYPES.SANDBOX_INIT_START,{guid:d().renderGuid},void 0,o()),sendInited:()=>dn(n,"INITED",r.EVENT_TYPES.SANDBOX_INITED,{guid:d().renderGuid},void 0,o()),async sendContent(){const m=d(),{html:f,hasBrowserExtensionArtifacts:g}=r.prepareEmailHtmlForEditor(m?.html||"");g&&e.events.browserExtensionDetected(),r.loadDocumentContent(e.readDocument(),f),i=f,await dn(n,"SET_ENTITY",r.EVENT_TYPES.SANDBOX_SET_ENTITY,Ma(a(),m.renderGuid,c(),e.readDocument()?.get().version),{guid:m.renderGuid,emailId:m.id??null},o())},refreshContent:()=>dn(n,"SET_ENTITY",r.EVENT_TYPES.SANDBOX_SET_ENTITY,Ma(a(),d().renderGuid,c(),e.readDocument()?.get().version),void 0,o()),sendPreheader:async()=>{const m=d();if(m.preheader!==void 0)return dn(n,"PREHEADER",r.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,{value:m.preheader,guid:m.renderGuid,force:!0},void 0,o())},sendSubject:async()=>{const m=d();if(m.subject!==void 0)return dn(n,"SUBJECT",r.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,{value:m.subject,guid:m.renderGuid,force:!0},void 0,o())},revealFilled:()=>e.revealFilled?.()??Promise.resolve(),showFilled:m=>e.showFilled?.(m),readTarget:()=>e.readTarget?.(),fireWillInit:()=>e.events.willInit(u()),fireInit(m,f){if(!Da(t(),m)){t().getActiveShowRequest()?.showId;return}const g=d();g.id,g.renderGuid,t().completeShow(m),r.writeEmailAttributes(e.readDocument(),{is_inited:!0},{source:"system"});const _=u();return f&&(_.reset=!0),e.events.inited(_)},fireEmailChanged(){e.events.emailChanged(u())},fireContentChanged(){e.events.contentChanged(a())}}}function hh(e){const t=()=>e.initPipeline();let n=!1,o,i,a,c=0,d;const u=fh({...e,waitScope:()=>({getSandboxTimeoutMs:k=>t().getSandboxTimeoutMs(k),getSandboxReadyTimeoutMs:()=>t().getSandboxReadyTimeoutMs(),signal:d?.signal??t().signal})});let m;const f=(k,S)=>{if(m===k)return;m=k;const I=c;setTimeout(()=>{c!==I||t().signal.aborted||v(k,S).catch(()=>{})},0)},g=()=>{d?.abort(),d=void 0};let _;const p=()=>{const k=t().signal;k!==_&&(_?.removeEventListener("abort",g),_=k,k.addEventListener("abort",g))};async function v(k,S){const I=++c;g(),d=new AbortController,p();const A=()=>c!==I,Y=u.readTarget(),ee=t().generation,j=()=>ee===t().generation&&!t().signal.aborted,R=S?"init:reset-":"init:";if(!S){const D=u.publicEmail();D?.id,D?.renderGuid,D?.preheader}let N=!1,B=!1;try{n=!0,await u.sendInitStart(),u.fireWillInit(),await(S?u.refreshContent():u.sendContent()),N=!0,S||u.publicEmail()?.id;try{await u.sendPreheader()}catch(D){r.logShowPipelineError(`${R}preheader-failed`,{showId:k,error:String(D)})}try{await u.sendSubject()}catch(D){r.logShowPipelineError(`${R}subject-failed`,{showId:k,error:String(D)})}if(A()||u.showFilled(Y),await u.sendInited(),B=!0,i===k){const D=e.readSandboxGeneration?.()??a;D!==void 0&&(o=D)}await u.revealFilled()}catch(D){throw A()||r.logShowPipelineError(`${R}failed`,{showId:k,contentApplied:N,sandboxInitedAcked:B,superseded:!1,...e.describeSurface?.(),error:String(D)}),!A()&&Da(t(),k)&&t().failShow(k,D),D}finally{C(k,S,R,{superseded:A(),sessionGeneration:ee,contentApplied:N,sandboxInitedAcked:B,commit:j()})}}function C(k,S,I,A){const{superseded:Y,contentApplied:ee,sandboxInitedAcked:j}=A;if(Y){`${I}`;return}j&&A.commit?u.fireInit(k,S||void 0):j?r.logShowPipelineError(`${I}aborted (stale session or signal)`,{showId:k,sessionGeneration:A.sessionGeneration,currentGeneration:t().generation,aborted:t().signal.aborted}):ee?r.logShowPipelineError(`${I}aborted (sandbox INITED ack missing)`,{showId:k}):r.logShowPipelineError(`${I}aborted (content not applied)`,{showId:k}),n=!1,d=void 0,!j&&i===k&&(i=void 0,o===a&&(o=void 0)),!j&&ee&&f(k,S)}return{channel:u,isEventsLocked:()=>n,filledGeneration:()=>o,markFilled:k=>{o=k},lastCorrelation:()=>i,markCorrelation:k=>{i=k},bumpRunSeq:()=>{c+=1},noteSandboxGeneration:k=>{a=k},fill:k=>v(k,!1),refill:k=>v(k,!0),stop:()=>{c+=1,g(),n=!1,_?.removeEventListener("abort",g),_=void 0}}}function gh(e,t,n){if(!e?.renderGuid||!e.showId||e.showId!==t.showId)return!1;if(t.isNew)return e.id==null;const o=t.emailId??t.navId;return o!=null&&String(e.id??"")!==String(o)?!1:Fa(e,n)}function Fa(e,t){return t?e?.id==null?!1:String(e.id)===String(t):!0}function yh(e){const{pipeline:t,readEmail:n,readDocument:o,readRouteEmailId:i,readSandboxGeneration:a}=e,c=f=>{const g=n(),_=i();if(!gh(g,f,_)){f.showId,f.navId,f.emailId,g?.id,g?.showId,g?.renderGuid;return}f.showId,g?.id,g?.renderGuid,t.markFilled(a()),t.markCorrelation(f.showId),t.fill(f.showId).catch(()=>{})};return{showRequested:f=>{c(f)},showRequestIdentityChanged:()=>{const f=e.initPipeline().getActiveShowRequest();f&&c(f)},selfInitChanged:()=>{if(e.initPipeline().getActiveShowRequest())return;const f=a();if(t.filledGeneration()===f)return;const g=n(),_=i();if(!g?.renderGuid||!Fa(g,_))return;const p=`${Na}${g.renderGuid}`;t.markFilled(f),t.markCorrelation(p);const v=o()?.isReady()===!0;g.id,g.renderGuid,(v?C=>t.refill(C):C=>t.fill(C))(p).catch(()=>{t.lastCorrelation()===p&&t.markFilled(void 0)})},saasChanged:()=>{const f=n();f?.renderGuid,f?.showToken,f?.id,o()}}}var Ba=h.createIdentifier$1("canvas.sandboxFill"),_h=class extends Error{showId;constructor(e,t){super(`[emailmaker] show() timed out after ${t}ms waiting for editor init (showId=${e}). Check earlier console errors: wrong host-plugin publicPath (chunks return HTML), mount element removed without destroy(), or sandbox init never completed. Search for [show-pipeline] and [AMD] messages.`),this.name="ShowPipelineTimeoutError",this.showId=e}},bh=class{_activeRequest=null;_pending=new Map;_listeners=new Set;getActiveShowRequest(){return this._activeRequest}onShowRequested(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}requestShow(e,t,n){return this._rejectPending(h.createAbortError("Superseded by newer show()")),n.aborted?Promise.reject(h.createAbortError(n.reason)):(this._activeRequest=e,new Promise((o,i)=>{const a=setTimeout(()=>{this._settle(e.showId,()=>{i(new _h(e.showId,t))})},t);a.unref?.();const c=()=>{this._settle(e.showId,()=>{i(h.createAbortError(n.reason))})};n.addEventListener("abort",c,{once:!0});const d=()=>{clearTimeout(a),n.removeEventListener("abort",c)};this._pending.set(e.showId,{request:e,resolve:o,reject:i,timeoutId:a,dispose:d});for(const u of this._listeners)u(e)}))}completeShow(e){this._settle(e,t=>{t.resolve()})}hasPendingShow(e){return this._pending.has(e)}failShow(e,t){this._settle(e,n=>{n.reject(t)})}rejectAll(e){this._rejectPending(e),this._activeRequest=null}_settle(e,t){const n=this._pending.get(e);n&&(n.dispose(),this._pending.delete(e),this._activeRequest?.showId===e&&(this._activeRequest=null),t(n))}_rejectPending(e){for(const[,t]of this._pending)t.dispose(),t.reject(e);this._pending.clear()}};function vh(e,t){return{contentReady:t.contentReady??e?.contentReady,sandboxReady:t.sandboxReady??e?.sandboxReady,sandbox:t.sandbox?{...e?.sandbox,...t.sandbox}:e?.sandbox}}function Eh(e){if(!e||!(e.contentReady!==void 0||e.sandboxReady!==void 0||e.sandbox!==void 0))return;const t=r.resolveContentReadyTimeoutMs(e),n=r.resolveSandboxReadyTimeoutMs(e),o=r.resolveSequentialSandboxOpBudgetMs(e.sandbox);t<n+o}var Sh=class{_controller=new AbortController;_externalSignalDisposable=new h.Disposable;_sessionChangeListeners=new Set;_showRegistry=new bh;_timeouts;_generation=0;_sessionStarted=!1;_externalSignal;get signal(){return this._controller.signal}get externalSignal(){return this._externalSignal}get generation(){return this._generation}get contentReadyTimeoutMs(){return r.resolveContentReadyTimeoutMs(this._timeouts)}getSandboxTimeoutMs(e){return r.resolveSandboxOpTimeoutMs(e,this._timeouts?.sandbox)}getSandboxReadyTimeoutMs(){return r.resolveSandboxReadyTimeoutMs(this._timeouts)}bumpGeneration(){this._generation+=1}getActiveShowRequest(){return this._showRegistry.getActiveShowRequest()}onShowRequested(e){return this._showRegistry.onShowRequested(e)}requestShow(e){return this._showRegistry.requestShow(e,this.contentReadyTimeoutMs,this._controller.signal)}completeShow(e){this._showRegistry.completeShow(e)}hasPendingShow(e){return this._showRegistry.hasPendingShow(e)}failShow(e,t){this._showRegistry.failShow(e,t)}rejectAllPendingShows(e){this._showRegistry.rejectAll(e)}onSessionReplaced(e){return this._sessionChangeListeners.add(e),()=>{this._sessionChangeListeners.delete(e)}}configure(e){e.timeouts!==void 0&&(this._timeouts=vh(this._timeouts,e.timeouts),Eh(this._timeouts));const t=e.replaceSession===!0||!this._sessionStarted||e.timeouts!==void 0||e.signal!==void 0;this._sessionStarted=!0,e.signal!==void 0&&(this._externalSignal=e.signal),t&&(this._replaceSessionController(),this.bumpGeneration()),(e.signal!==void 0||t)&&this._linkExternalSignal(e.signal)}relinkExternalSignal(e){this._externalSignal=e,this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new h.Disposable,this._linkExternalSignal(e)}abort(e){const t=e??h.createAbortError("Editor instance destroyed");this._showRegistry.rejectAll(t),this._controller.signal.aborted||(this._controller.abort(t),this.bumpGeneration()),this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new h.Disposable}_replaceSessionController(){this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new h.Disposable,this._showRegistry.rejectAll(h.createAbortError("Init session replaced")),this._controller.signal.aborted||this._controller.abort(h.createAbortError("Init session replaced")),this._controller=new AbortController,this._emitSessionReplaced()}_emitSessionReplaced(){for(const e of this._sessionChangeListeners)e()}_linkExternalSignal(e){if(!e)return;if(e.aborted){this._controller.signal.aborted||(this._controller.abort(e.reason??h.createAbortError()),this.bumpGeneration());return}const t=()=>{this._controller.signal.aborted||(this._controller.abort(e.reason??h.createAbortError()),this.bumpGeneration())};e.addEventListener("abort",t),this._externalSignalDisposable.addDispose(()=>{e.removeEventListener("abort",t)})}},wh=(()=>{const e=new Sh;return e.configure({}),e})();function ho(){const e=r.useStore();return(0,l.useMemo)(()=>h.getContainer(e)?.getInstance(h.INIT_PIPELINE_ID)??wh,[e])}function kh(e){const t=ho(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>{let o;const i=()=>{o?.();const c=t.signal;if(c.aborted){n.current();return}const d=()=>n.current();c.addEventListener("abort",d),o=()=>c.removeEventListener("abort",d)};i();const a=t.onSessionReplaced(i);return()=>{a(),o?.()}},[t])}function Ch(e){const t=ho(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>t.onShowRequested(o=>n.current(o)),[t])}var Th=(e,t,n,o,i)=>{const a=r.useStore(),c=r.useMessageService(),d=ho(),u=(0,l.useRef)(d);u.current=d;const m=r.useEventEmitter(h.events.WILL_EMAIL_INIT_ID),f=r.useEventEmitter(h.events.ON_EMAIL_INIT_ID),g=r.useEventEmitter(h.events.ON_CONTENT_CHANGED_ID),_=r.useEventEmitter(h.events.ON_EMAIL_CHANGED_ID),p=r.useEventEmitter(h.events.ON_BROWSER_EXTENSION_DETECTED_ID),v=e?.id!==void 0,C=e?.showToken??0,k=C,S=(0,l.useRef)(k);S.current=k;const I=(0,l.useRef)(void 0);I.current=e;const[A,Y]=(0,l.useState)(()=>r.getSandboxGeneration(c)),ee=(0,l.useRef)(A);ee.current=A,(0,l.useEffect)(()=>(Y(r.getSandboxGeneration(c)),r.onSandboxGenerationChange(c,()=>{Y(r.getSandboxGeneration(c))})),[c]);const j=(0,l.useRef)(o);j.current=o;const R=(0,l.useRef)(t);R.current=t;const N=i?.standalone?void 0:h.getContainer(a)?.getInstance(Ba),B=!N,D=(0,l.useRef)(N?.pipeline);D.current||(D.current=hh({container:h.getContainer(a),messageService:c,initPipeline:()=>u.current,readDocument:()=>j.current,readEmail:()=>I.current,isTemplate:()=>!!R.current,readSandboxGeneration:()=>ee.current,events:{willInit:z=>m.fire(z),inited:z=>f.fire(z),contentChanged:z=>g.fire(z),emailChanged:z=>_.fire(z),browserExtensionDetected:()=>p.fire()}}));const O=D.current,$=(0,l.useRef)(n);$.current=n;const de=(0,l.useRef)(void 0);B&&!de.current&&(de.current=yh({pipeline:O,initPipeline:()=>u.current,readEmail:()=>I.current,readDocument:()=>j.current,readRouteEmailId:()=>$.current,readSandboxGeneration:()=>ee.current}));const ue=de.current;O.noteSandboxGeneration(ee.current),(0,l.useEffect)(()=>{if(B)return()=>D.current?.stop()},[B]),(0,l.useEffect)(()=>{N?.setRoute({emailId:n,isTemplate:t})},[N,n,t]),(0,l.useEffect)(()=>{const z=I.current;if(B&&!O.isEventsLocked()&&e?.renderGuid===z?.renderGuid&&z?.is_inited&&z){const ie=O.channel.readContent();_.fire({...z,id:t||z.isNew?void 0:z.id,html:ie})}},[O,e?.renderGuid,e?.preheader,e?.common_styles,e?.meta,e?.subject,e?.utm_parameters?.utm_campaign||"",e?.utm_parameters?.utm_content||"",e?.utm_parameters?.utm_medium||"",e?.utm_parameters?.utm_source||"",e?.utm_parameters?.utm_term||"",_,t,B]),(0,l.useEffect)(()=>{if(B){const z=r.subscribeToContent(o,()=>{const ie=I.current;if(!O.isEventsLocked()&&e?.renderGuid===ie?.renderGuid&&ie){const je=O.channel.readContent();g.fire(je),_.fire({...ie,id:t||ie.isNew?void 0:ie.id,html:je})}});return()=>z.dispose()}},[o,O,g,_,e,t,B]),kh(()=>{B&&O.stop()}),Ch(z=>{ue?.showRequested(z)}),(0,l.useEffect)(()=>{ue?.showRequestIdentityChanged()},[ue,d,e?.renderGuid,e?.showId,e?.id,n]),(0,l.useEffect)(()=>{ue?.selfInitChanged()},[ue,d,e?.renderGuid,e?.showId,e?.id,n,o,A]),r.usePrevious(()=>{ue?.saasChanged()},[e?.renderGuid,C,v,ue]),Xr(async()=>{if(!B)return;const z=d.getActiveShowRequest()?.showId;z&&(O.markFilled(ee.current),await O.refill(z))},{async:!0})};function Ih(e){const t=r.useEvent(h.events.ON_EMAIL_INIT_ID);(0,l.useEffect)(()=>{if(!e)return;const n=t(()=>e.clear());return()=>n.dispose()},[e,t])}function Ah(e,t){const n=r.useEventEmitter(h.events.ON_DOCUMENT_SESSION_CHANGE);(0,l.useEffect)(()=>{n.fire({document:e,history:t})},[e,t,n])}function xh(e){return{saving:(0,l.useSyncExternalStore)(e.subscribe,()=>e.saveState().saving),failures:(0,l.useSyncExternalStore)(e.subscribe,()=>e.saveState().failures)}}function Ph({templateEmailId:e,templateEmail:t,newEmail:n}){return e?t&&r.createDraftFromTemplate(t,n):n}function Rh({templateEmailId:e,templateEmail:t,newEmail:n}){return(0,l.useMemo)(()=>Ph({templateEmailId:e,templateEmail:t,newEmail:n}),[e,t,n])}var jh={"not-found":404,forbidden:403,unavailable:500};function Ua(e){const t=r.emailOpenFailureReason(e);return t?jh[t]:e?.status}function Lh(e){const t=e,n=t?.data?.message??t?.error;return typeof n=="string"&&n!==""?n:void 0}function Oh(e,t){return Mh(e,t)??Lh(e)??t("Unknown error")}function Mh(e,t){switch(r.emailOpenFailureReason(e)){case"not-found":return t("This email no longer exists. It may have been deleted.");case"forbidden":return t("You do not have access to this email.");case"unavailable":return t("The email could not be loaded. Please try again.");default:return}}function Nh({routeEmailId:e,draft:t}){const n=r.useStore();(0,l.useRef)(0),(0,l.useRef)(!1),(0,l.useEffect)(()=>{},[n,e,e?void 0:t])}function Dh(e,t){return t}function Fh(e){return!1}function Bh({documents:e,push:t,projectId:n,subscription:o}){(0,l.useEffect)(()=>e.onSaved(i=>{i.intent==="publish"&&t({event:"save",action:"save_email",email_id:i.serverId??void 0,project_id:n,subscription:o})}),[e,t,n,o])}function Uh(e){const t=r.useStore();(0,l.useEffect)(()=>{},[t,e])}function $h(e,t,n){const o=r.useAppNavigate(),i=r.useContainer();(0,l.useEffect)(()=>{},[o,e,t,n,i])}function Gh(e){if(!e)return{status:"unknown"};if("status"in e){const t=e.data,n=t&&typeof t=="object"?t.message:void 0,o=typeof n=="string"?n:typeof t=="string"?t:void 0;return{status:String(e.status),message:o}}return{status:e.name??"unknown",message:e.message}}function $a(e,t,n){const{status:o,message:i}=Gh(n);r.reportMessage(`Failed to load ${e} ${t??"?"}: ${o}`,{origin:"entity-load-error",tags:{mechanism:"entity-load-error",entity_type:e,http_status:o},level:"error",contexts:{entity_load_error:{entityType:e,entityId:t,status:o,message:i,url:window.location.href}}})}var{Content:Ga}=y.ui_kit$Layout,zh={paddingTop:"40px"},Wh=()=>{const{__:e}=r.useI18n(),{owner:t,admin:n}=Xn(),o=r.useDispatch(),i=qr(),a=r.useAppNavigate(),{modal:c}=y.ui_kit$App.useApp(),d=r.useAppConfig(),u=r.useRootElement(),m=r.useCookieManager(),f=r.useMessageService(),{emailId:g,preview:_}=r.useRouteParams(),p=r.useEditorProjectId(),v=r.useAppSearchParams(),C=r.useSelector(r.selectIsCodeMode),k=r.useSelector(r.selectActiveModal),S=r.useCurrentUser(),I=r.useProjectData(),A=(0,l.useMemo)(()=>r.createNewEmailDraft(I?{id:Number(I.id),title:I.name}:void 0),[I]),Y=r.useSelector(r.selectIsGlobalLoading),[ee]=r.useLazyGetMeQuery(),{isSuccess:j,data:R}=r.useGetSubscriptionsQuery(),N=oh(),[B,D]=(0,l.useState)(!1),[O,$]=(0,l.useState)(!1),[de,ue]=(0,l.useState)(),[z,ie]=(0,l.useState)(null),[je,pe]=(0,l.useState)(!1),[Qe,be]=(0,l.useState)(!1),[ge,X]=(0,l.useState)(!1),[he,se]=(0,l.useState)(!1),[le,Se]=(0,l.useState)(!1),Te=(0,l.useRef)(),{confirm:Ue}=c,{counters:te,subscription:ye}=S,we=te?.emails_counter;m.get(r.APP_COOKIES.em_template_email);const ke=v.get("template")||!O&&!g&&m.get(r.APP_COOKIES.em_new_email),{isSuccess:Ie,isLoading:rt,isError:T,error:w,data:x}=rh(g?void 0:ke),L=Rh({templateEmailId:ke,templateEmail:x,newEmail:A});Nh({routeEmailId:g,draft:L});const{document:F,email:b,error:H}=r.useOpenEmail(),Le=b?.id!=null?String(b.id):void 0,Pe=Dh(g,Le);(0,l.useEffect)(()=>{},[g,Le,F,ke]),$h(g,b?.id,p);const qe=r.useStore(),We=r.getEmailDocuments(h.getContainer(qe)),Xe=(0,l.useCallback)((re,Ae)=>We.save(re,Ae),[We]),{saving:mt}=xh(We),_t=(0,l.useCallback)(()=>We.saveState(),[We]),bt=r.usePushToDataLayer();Bh({documents:We,push:bt,projectId:p,subscription:ye?.post_title}),(0,l.useEffect)(()=>{!O&&b?.id&&$(!0)},[$,O,b?.id]);const pt=We.history();Ah(F,pt),Ih(pt),Th(b,Fh(g),Pe,F);const W=r.useDocumentUndo({document:F,history:pt});ch(b,F,mt,We),Uh(p),(0,l.useEffect)(()=>{r.injectEmailRightsResolver(h.getContainer(qe),re=>!!(t||n||S.id?.toString()===re?.author?.toString()))},[qe,t,n,S.id]);const J=hp({email:b,save:Xe,saveState:_t,documentSession:F}),{outdatedBlocks:Z,isOpen:fe,close:et}=Nf({projectId:p,document:F});lh({projectId:p,project:I,emailProjectId:b?.project,parentEmailId:b?.parent_email});const ot=k===r.MODALS.ADD_NEW_EBLOCK_MODAL,me=Tn(ot),Me=Tn(ge),{isPromptOpen:Ut,isConverting:Ne,progress:Ve,isErrorOpen:ae,errorMessage:ne,confirmConversion:G,cancelPrompt:ce,retryConversion:Re,closeError:ve,neverSuggestAgain:De,setNeverSuggestAgain:Je}=eh(),Oe=H??(ke?w:void 0),tt=!!Oe,nn=tt&&!1,Tt=!b&&!tt,vt=!!b;(0,l.useEffect)(()=>{tt&&Oe&&$a("email",g||ke,Oe)},[tt,Oe,g,ke]),(0,l.useEffect)(()=>{ke&&Ie&&($(!0),v.set({}))},[ke,Ie,v]),(0,l.useEffect)(()=>(o(r.switchIsPanelHistoryCollapsed(!0)),()=>o(r.switchIsPanelHistoryCollapsed(!0))),[o]);const Mt=(0,l.useCallback)(()=>{i.toggle(),o(r.resetPanes())},[o,i]);(0,l.useEffect)(()=>{_&&!C&&Mt()},[C,_,Mt]),(0,l.useEffect)(()=>{document.body.classList.add("editor"),o(r.setActiveSettingsTab(r.BUILD))},[o]),(0,l.useEffect)(()=>{!B&&we<3&&(ee(),D(!0))},[ee,we,B]);const It=(0,l.useCallback)(()=>{W.undo()},[W]),$t=(0,l.useCallback)(()=>{W.redo()},[W]);(0,l.useEffect)(()=>{Te.current!==b?.id&&(W.clear(),Te.current=b?.id)},[b,W]);const rn=(0,l.useCallback)(re=>{(window.navigator.appVersion.indexOf("Mac")&&re.metaKey||re.ctrlKey)&&(re.code==="KeyZ"?(re.preventDefault(),re.shiftKey?$t():It()):re.code==="KeyY"&&!re.shiftKey&&(re.preventDefault(),$t()))},[It,$t]),On=()=>{a(`/projects/${p}/emails`)};(0,l.useEffect)(()=>()=>{o(r.resetPanes()),o(r.closeModal()),o(r.closeModal$1()),o(r.resetElementHistorySlice())},[o]);const Mn=(0,l.useCallback)(re=>{const Ae=()=>{o(r.openModal(r.MODALS.ADD_NEW_EBLOCK_MODAL))},Fe=re.data.operation,it=re.data,xe=re.data.action,Kt=u.querySelector("#iframe-scroll-top"),xt=u.querySelector("#iframe-scroll-bottom");if(Fe===r.EVENT_TYPES.APPLICATION_EBLOCK_ADD){const st=it.settings?.emBlockId;st?ie({html:it.data,emBlockId:String(st)}):(ue(it.data),Ae())}if(Fe===r.EVENT_TYPES.APPLICATION_ACTION&&(xe==="undo"?It():xe==="redo"&&$t()),Fe===r.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const st=u.querySelector("#email_iframe_slot"),Et=document.body.getBoundingClientRect().height,Qt=st.getClientRects()[0];Qt.top<0&&(Kt.style.display="block"),Qt.top+Qt.height>Et&&(xt.style.display="block")}Fe===r.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&(Kt.style.display="none",xt.style.display="none")},[o,It,$t,u]);r.useListenPostMessage(Mn);const Nn=re=>{if(re.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const Ae=re.dataTransfer,Fe=(Ae?Array.from(Ae.types||[]):[]).includes(r.DND_SOCIAL_LIST_REORDER_MIME),it=typeof re.composedPath=="function"?re.composedPath():[];re.target?.closest?.(".selected-social-form")||it.some(xe=>xe&&xe.nodeType===1&&typeof xe.classList?.contains=="function"&&xe.classList.contains("selected-social-form"))||Fe||(re.preventDefault(),re.target&&f.send({operation:r.EVENT_TYPES.SANDBOX_DRAG_CANCEL}),u.querySelectorAll(".em-dragging-element").forEach(xe=>{xe.classList.remove("em-dragging-element")}))},dt=(0,l.useRef)({});(0,l.useEffect)(()=>{const re=new h.Disposable,Ae=Fe=>it=>dt.current[Fe]?.(it);return re.addDisposable(r.addWindowListenerFromShadow(u,"drop",Ae("drop"))),re.addDisposable(r.addWindowListenerFromShadow(u,"dragover",Ae("dragover"))),re.addDisposable(r.addWindowListenerFromShadow(u,"dragstart",Ae("dragstart"))),re.addDisposable(r.addWindowListenerFromShadow(u,"dragend",Ae("dragend"))),()=>{re.dispose()}},[u]),(0,l.useEffect)(()=>(window.addEventListener("keydown",rn),()=>{window.removeEventListener("keydown",rn)}),[rn]);const At=re=>{if(re.preventDefault(),re.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const Ae=u.querySelector("#iframe-scroll-top"),Fe=u.querySelector("#iframe-scroll-bottom"),it=d.sidePanelFloating?u.querySelector("#pane-content-wrapper"):u.querySelector(".email-pane__col_preview"),xe=u.querySelector(".blocks-app").getBoundingClientRect().top,{height:Kt,top:xt}=u.querySelector("#email_iframe_slot").getBoundingClientRect(),st=it.getBoundingClientRect().height;xt>96?Ae.style.display==="block"&&(Ae.style.display="none"):(Ae.style.display==="none"||Ae.style.display==="")&&(Ae.style.display="block"),Kt-st+xt-xe<44?Fe.style.display==="block"&&(Fe.style.display="none"):Fe.style.display==="none"&&(Fe.style.display="block"),re.target===Ae&&it.scrollBy(0,-15),re.target===Fe&&it.scrollBy(0,15)},Dn=()=>{const re=u.querySelector("#iframe-scroll-top"),Ae=u.querySelector("#iframe-scroll-bottom");re&&Ae&&(re.style.display="none",Ae.style.display="none"),u.querySelectorAll(".em-dragging-element").forEach(Fe=>{Fe.classList.remove("em-dragging-element")})},Yt=re=>{const Ae=re.target,Fe=Ae instanceof Element?Ae:Ae.parentElement;if(!(Fe instanceof Element)||Fe.closest(".selected-social-form"))return;Fe.parentElement?.classList.add("em-dragging-element");const it=!!Fe.closest(".blocks-search__result-wrapper");var xe=it?r.cloneBlockPreviewForDrag(Fe.querySelector(".blocks-search__result-html")):Fe.cloneNode(!0);xe.classList.add("em-ghost-element"),xe.style.height=it?"auto":"70px",xe.style.width=it?"600px":"109px",xe.style.position="absolute",xe.style.top="0",xe.style.left="0",xe.style.zIndex="-1",Fe.appendChild(xe),re.dataTransfer.setDragImage(xe,0,0),window.setTimeout(function(){xe.parentNode.removeChild(xe)},1e3)};dt.current={drop:Nn,dragover:At,dragstart:Yt,dragend:Dn};const yn=(0,l.useCallback)(()=>{Ue({title:e("You reached the plan limit"),icon:(0,s.jsx)(r.EmIcons,{icon:"ExclamationCircleOutlined",component:y.icons$ExclamationCircleOutlined}),content:(0,s.jsx)("div",{style:{maxWidth:"330px"},children:e("Switch to a different plan to save more emails.")}),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){a("/billing")},onCancel(){}})},[a,e,Ue]);return(0,l.useEffect)(()=>{if(j&&R){const re=R?.find(Ae=>Ae.id?.toString()===ye?.ID?.toString())?.limits?.emails_limit;re&&we>=re&&!je&&!g&&t&&(yn(),pe(!0))}},[R,j,ye,we,je,yn,g,t]),(0,l.useEffect)(()=>{const re=f.onInit(()=>{f.send({operation:r.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})});return()=>re.dispose()},[f]),(0,s.jsx)(r.DocumentSessionProvider,{document:F,history:pt,children:(0,s.jsx)(ba.Provider,{value:J,children:(0,s.jsxs)(y.ui_kit$Layout,{className:"email-page",children:[Tt&&(0,s.jsx)(y.ui_kit$PageLoader,{}),!Tt&&N.status==="pending"&&(0,s.jsx)(y.ui_kit$PageLoader,{}),N.status==="error"&&(0,s.jsx)(Ga,{style:zh,children:(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(y.ui_kit$Result,{status:"warning",title:e("Failed to load plan data"),subTitle:e("Editor features depend on your plan. Check your connection and try again."),extra:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:N.retry,children:e("Try again")})})})}),nn&&(0,s.jsx)(Ga,{style:{paddingTop:"40px"},children:(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(y.ui_kit$Result,{status:Ua(Oe),title:Ua(Oe),subTitle:Oh(Oe,e),extra:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:On,children:e("Back To Project")})})})}),b&&!Tt&&!nn&&N.status==="ready"&&(0,s.jsxs)(y.ui_kit$Layout,{className:"email-pane",children:[Y&&(0,s.jsx)("div",{className:"email-pane__loader",children:(0,s.jsx)(y.ui_kit$PageLoader,{small:!0})}),(0,s.jsx)(Pa,{email:b,isCollaborationEditor:Qe}),(0,s.jsx)(rp,{emailElement:b,isSuccess:vt,setIsCollaborationEditor:be,setIsShowAddAllBlocksModal:X,triggerOpenSavedBlocksTab:he})]}),me&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Wu,{isModalVisible:ot,htmlContent:de,projectId:p,setIsShowAddAllBlocksModal:X,setIsShowAddAllBlocksModalForNewEmail:Se,currentEmail:b})}),(0,s.jsx)(Lf,{open:fe,blocks:Z,projectId:p,onClose:et}),(0,s.jsx)(Df,{open:!!z,html:z?.html,emBlockId:z?.emBlockId,onSaveAsNew:()=>{ue(z?.html),ie(null),o(r.openModal(r.MODALS.ADD_NEW_EBLOCK_MODAL))},onClose:()=>ie(null)}),Me&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Hu,{isModalVisible:ge,currentEmail:b,setIsShowAddAllBlocksModal:X,setTriggerOpenSavedBlocksTab:se,autoStart:!le,projectId:p})}),(0,s.jsx)($f,{open:Ut,onConfirm:G,onCancel:ce,neverSuggestAgain:De,onNeverSuggestAgainChange:Je}),(0,s.jsx)(Wf,{open:Ne,progress:Ve}),(0,s.jsx)(zf,{open:ae,message:ne,onRetry:Re,onCancel:ve})]})})})};function Hh(){const e=r.useStore(),t=r.getEmailDocuments(h.getContainer(e)),n=(0,l.useCallback)(o=>t.subscribe(o),[t]);return(0,l.useSyncExternalStore)(n,()=>!!t.current())}function qh(e,t){const n=r.useStore(),o=r.useAppConfig(),i=r.useStorageProvider();(0,l.useRef)(new Set),(0,l.useEffect)(()=>{},[e,t,o,n,i])}var Vh=30;function Yh(e){const t=r.useContainer(),n=r.useGetProjectQuery(+e,{skip:!e,refetchOnMountOrArgChange:Vh}),{isSuccess:o,isError:i,error:a,data:c,isFetching:d}=n;qh(e,o),(0,l.useEffect)(()=>{t&&r.setCurrentProjectRefreshing(t,d)},[t,d]),(0,l.useEffect)(()=>{t&&o&&c&&String(c.id)===String(e)&&r.setCurrentProjectCard(t,c)},[o,c,t,e]),(0,l.useEffect)(()=>{i&&a&&$a("project",e,a)},[i,a,e]);const u=r.useProjectData(),m=!!u&&String(u.id)===String(e);return{...n,projectReady:m}}var Pn=r.createApi({reducerPath:"promoApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:t,type:n},o)=>r.clientFromApi(o).promo.set_code_create({code:t,type:n})}),getPromoInfo:e.query({queryFn({code:t},n){return r.clientFromApi(n).promo.get_code_info_list({code:t})}})})}),{useCheckPromoMutation:$v,useGetPromoInfoQuery:Gv}=Pn;function Kh(){const e=r.useContainer(),[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{if(!e)return;let o=!0;return r.getAppProject(e).then(i=>{o&&i!=null&&n(String(i))},()=>{}),()=>{o=!1}},[e]),t}var Qh=()=>{const e=r.useDispatch(),t=r.useCookieManager(),n=r.useCurrentUser(),o=r.useContainer();(0,l.useEffect)(()=>{const a=n?.code_editor;a&&o&&r.applyEditorOptions(o,a)},[n,o]),(0,l.useEffect)(()=>{const a=t.get(r.APP_COOKIES.em_token),c=t.get(r.APP_COOKIES.promocode);a&&c&&(e(Pn.endpoints.checkPromo.initiate({code:c,type:"by_link"})),t.remove(r.APP_COOKIES.promocode))},[e,t]),r.useNotifyCommand();const i=Hh();return Yh(Kh()),i?(0,s.jsx)(sc,{hasEmail:!0,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Wh,{})})}):null};function Xh(e,t){const n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!e||n.current||(n.current=!0,r.mark(r.PHASES.appVisible),t&&Wt(t).noteShellVisible())},[e,t])}var Rn=new WeakMap,Jh="data-emailmaker-config-styles";function Zh(e){return typeof e=="string"?e.trim():""}function za(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function eg(e,t,n){if(!e||typeof document>"u")return null;const o=Zh(t),i=Rn.get(e),a=n||e;if(!o)return i&&(i.remove(),Rn.delete(e)),null;if(i)return i.textContent!==o&&(i.textContent=o),(i.parentNode!==a||i!==a.firstChild)&&za(a,i),i;const c=document.createElement("style");return c.setAttribute(Jh,"true"),c.textContent=o,za(a,c),Rn.set(e,c),c}function go(e){if(!e)return;const t=Rn.get(e);t&&(t.remove(),Rn.delete(e))}var tg={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},ng=({children:e,handleBeforeRender:t})=>{const[n,o]=(0,l.useState)(),i=r.useIsLocaleInited();Xh(i,r.useContainer());const a=r.useAppConfig().styles,c=(0,l.useRef)(null),d=(0,l.useRef)(!1),u=(0,l.useRef)(void 0),m=r.useRootElement();return(0,l.useLayoutEffect)(()=>{d.current||(d.current=!0,t&&t())},[]),(0,l.useLayoutEffect)(()=>{if(!m){u.current&&(go(u.current),u.current=void 0);return}u.current&&u.current!==m&&go(u.current),eg(m,a,c.current||void 0),u.current=m},[m,a]),(0,l.useLayoutEffect)(()=>()=>{u.current&&(go(u.current),u.current=void 0)},[]),(0,s.jsxs)(y.ui_kit$StyleProvider,{container:r.findShadowRoot(m)||document.head,children:[(0,s.jsxs)("div",{ref:c,className:"App blocks-app blocks-plugin",style:i?{}:{visibility:"hidden"},children:[(0,s.jsx)(r.ModalRootContext.Provider,{value:n,children:e}),(0,s.jsx)("div",{ref:o,className:"blocks-modal-container"})]}),!i&&(0,s.jsx)(y.ui_kit$Space,{size:"large",style:tg,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})})]})};async function rg({container:e,renderTarget:t,mapKey:n,disposable:o,chunkLoadedFire:i}){const a=await e.getInstanceAsync(h.STORE_ID);return new Promise(c=>{if(o.isDisposed()){c();return}const d=(0,cl.createRoot)(t),u=(0,s.jsx)(r.Provider,{store:a,children:(0,s.jsx)(tc,{onLoad:c,children:(0,s.jsx)(r.RootContext.Provider,{value:{element:n},children:(0,s.jsx)(y.ui_kit$StyleProvider,{container:r.isDocumentFragment(n)?document.head:n,children:(0,s.jsx)(r.LocaleProvider,{children:(0,s.jsx)(ng,{handleBeforeRender:i,children:(0,s.jsx)(El,{children:(0,s.jsx)(ec,{children:(0,s.jsx)(Qh,{})})})})})})})})});d.render(u),o.addDispose(c),o.addDispose(()=>{try{d.unmount()}catch(m){if(m instanceof DOMException&&m.name==="NotFoundError"||m instanceof Error&&m.name==="NotFoundError"&&/removeChild/i.test(m.message)){r.logShowPipelineError("mount:unmount-dom-mismatch (host container was already removed)",{hint:"Usually harmless during host React StrictMode teardown. Ensure instance.destroy() runs before the host removes the mount container."});return}throw m}}),o.addDispose(()=>{h.ELEMENT_MAP.delete(n)})})}var zv="multiple init call on single HTMLELEMENT",og=zn(async e=>{let t=null,n=!1;const o=h.getEmitter(e,h.events.ON_CHUNKS_LOADED),i=e.getInstance(h.DISPOSABLE_ID);let a,c=!1;const d=()=>{c||(c=!0,r.mark(r.PHASES.chunksLoaded),o.fire())},u=vl();i.addDisposable(o.event(()=>u.loaded()));const m=(f,g)=>rg({container:e,renderTarget:f,mapKey:g,disposable:a,chunkLoadedFire:d});return{instance:{getElement(){return t}},async setOptions(f){u.use(f);const g=e.getInstance(h.INIT_PIPELINE_ID),_=await h.waitForElement(f.element,i,g.signal),p=e.getInstance(h.INSTANCE_ID),v=!!f.hidden&&!!_;if(t===_&&n===v)return;const C=t===_&&n&&!v;n=v,t&&h.ELEMENT_MAP.delete(t),_&&h.ELEMENT_MAP.has(_),a&&a.dispose(),a=i.addDisposable(new h.Disposable);const k=f.element!==void 0;if(r.setHeadlessMode(e,!_||v),r.setHiddenMount(e,v),!_){r.mark(r.MOUNT_HEADLESS_MARK);const I=document.createElement("div");I.style.position="absolute",I.style.left="-10000px",I.style.top="-10000px",I.style.width="1600px",I.style.height="1000px",document.body.appendChild(I),t=I,d(),a.addDispose(()=>{I.parentNode===document.body&&I.remove()});return}const S=r.findShadowRoot(_);if(S&&a.addDisposable(new bl({shadowRoot:S})),k&&_ instanceof Element){const I=_;ml(I,()=>{i.isDisposed()||a?.isDisposed()||(r.logShowPipelineError("mount:detached (host removed element without destroy)",{elementId:I.id||null}),g.abort(ul()))},a)}if(v){r.mark(r.MOUNT_HEADLESS_MARK),t=_,d();return}if(k&&_ instanceof Element){const I=_,A=gl(I);t=I;const Y=m(A,I);return yl(I,A,a),Y}return t=_,m(_,_)},dispose(){a&&!a.isDisposed()&&a.dispose()}}});function yo(e){return zn(async t=>(await t.getInstanceAsync(h.STORE_ID),await e(t)))}function ig({html:e,renderGuid:t,...n},o){const{requested:i}=r.getCurrentProject(o);return r.filterUndefined({...n,code:ln(o).toOutputForm(e),project:i===void 0?n.project:i,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}function ag(e,t){return r.filterUndefined({...e,link:void 0,comment_status:void 0})}function sg({html:e,isAutosave:t,...n},o){return r.filterUndefined({...n,autosave:t?!0:void 0,code:e,guid:void 0,compiled:r.filterUndefined({html:e,ampHtml:e&&""})})}var Wa=e=>{const t={current:Promise.resolve(),state:e,decorate:(n,o)=>(o&&(n=n.bind(o)),function(...i){const a=t.current.then(()=>n(...i));return t.current=a.then(c=>{t.state=c},c=>{}),a})};return t},_o=h.createIdentifier$1("NotificationService"),lg=h.createIdentifier$1("emailTemplate.reads");async function cg(e,t){try{return await r.getRestEmailPortFactories(e).email(e).readEmail(t)??void 0}catch(n){r.logShowPipelineError("show:template-read-failed",{templateId:t,error:n instanceof Error?n.message:"неизвестная ошибка"}),ug(e,t,n);return}}var dg=h.createIdentifier$1("emailTemplate.notifiedFailures");function ug(e,t,n){if(n instanceof DOMException&&n.name==="AbortError")return;const o=e.getOrCreateInstance(dg,()=>new Set);o.has(t)||(o.add(t),e.getInstanceAsync(_o).then(()=>{h.getEmitter(e,h.events.ON_NOTIFICATION).fire({type:"error",id:"TEMPLATE_READ_ERROR",data:{templateId:t},innerException:n})},()=>{}))}function mg(e,t){const n=e.getOrCreateInstance(lg,()=>new Map),o=n.get(t);if(o!==void 0)return o;const i=cg(e,t).then(a=>(a===void 0&&n.delete(t),a));return n.set(t,i),i}var kt=class extends h.Disposable{_event;_listener;_disposeEvent;constructor(e){super(),this._event=e}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),e?this._disposeEvent=this._event(e):this._disposeEvent=void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}};function Ct(e,t,n){const o=h.snapshot(e);return(i,a,c)=>{const d=o(async u=>{const m=t?t(u):u;c&&i.bind(c);const f=await i(m);return n?n(f):f},a,c);return()=>d.dispose()}}var Wv=h.createIdentifier("application_block_inserted"),Hv=h.createIdentifier$1("DataController"),qv=h.createIdentifier$1("DataEvents"),pg=h.createIdentifier$1("plugin.startupShow");function fg(e){return e.getInstance(pg)?.current??Promise.resolve()}var Ha=yo(async()=>({instance:{}})),qa=yo(async e=>({instance:{},async setOptions(){await fg(e)}})),Vv=h.combineMixins([Ha,qa]),Va=()=>({title:"",description:"",website:"",company_size:"",industry:"",email:"",phone:"",logo_url:""}),hg={title:"title",description:"description",website:"website",company_size:"company_size",industry:"industry",email:"email",phone:"phone",logo_url:"logo"},Ya=e=>({...Va(),title:e?.title??"",description:e?.description??"",website:e?.website??"",company_size:e?.company_size??"",industry:e?.industry??"",email:e?.email??"",phone:e?.phone??"",logo_url:e?.logo??""}),Ka=e=>(e??[]).filter(t=>!!t?.code).map(({code:t,label:n})=>({value:t,label:n??t})),gg=e=>({company_sizes:Ka(e?.company_sizes),industries:Ka(e?.industries)}),Yv=Object.keys(Va()),Qa="ProjectProfile",jn=r.createApi({reducerPath:"projectSettingsProfileApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Qa],endpoints:e=>({getProjectProfile:e.query({async queryFn(t,n){const o=r.v2ResultOf(await r.getClientV2(h.getContainer(n)).projects.profileList({id:String(t)}));return"error"in o?{error:o.error}:{data:Ya(o.data)}},providesTags:(t,n,o)=>[{type:Qa,id:String(o)}]}),getProjectProfileOptions:e.query({async queryFn(t,n){const o=r.v2ResultOf(await r.getClientV2(h.getContainer(n)).projects.profileOptionsList());return"error"in o?{error:o.error}:{data:gg(o.data)}}}),updateProjectProfileField:e.mutation({async queryFn({projectId:t,field:n,value:o},i){const a={[hg[n]]:o},c=r.v2ResultOf(await r.getClientV2(h.getContainer(i)).projects.profilePartialUpdate({id:String(t)},a));return"error"in c?{error:c.error}:{data:Ya(c.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:o}){try{const{data:i}=await o;n(jn.util.updateQueryData("getProjectProfile",t,()=>i))}catch{}}})})}),{useGetProjectProfileQuery:Kv,useGetProjectProfileOptionsQuery:Qv,useUpdateProjectProfileFieldMutation:Xv}=jn,Xa="ProjectStorage",Ln=r.createApi({reducerPath:"projectSettingsStorageApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Xa],endpoints:e=>({getProjectStorage:e.query({async queryFn(t,n){const o=r.v2ResultOf(await r.getClientV2(h.getContainer(n)).projects.storageList({id:String(t)}));return"error"in o?{error:o.error}:{data:o.data}},providesTags:(t,n,o)=>[{type:Xa,id:String(o)}]}),updateProjectStorage:e.mutation({async queryFn({projectId:t,body:n},o){const i=r.v2ResultOf(await r.getClientV2(h.getContainer(o)).projects.storageUpdate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:o}){const{data:i}=await o;n(Ln.util.upsertQueryData("getProjectStorage",t,i))}}),testProjectStorageConnection:e.mutation({async queryFn({projectId:t,body:n},o){const i=r.v2ResultOf(await r.getClientV2(h.getContainer(o)).projects.storageTestCreate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}}})})}),{useGetProjectStorageQuery:Jv,useUpdateProjectStorageMutation:Zv,useTestProjectStorageConnectionMutation:e0}=Ln,yg=class{http;constructor(e){this.http=e}settings_summary_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/settings-summary/${e}`,method:"GET",...n})},Ja=class{http;constructor(e){this.http=e}developer_credentials_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"GET",...n});developer_credentials_partial_update=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"PATCH",...n});developer_credentials_rotate_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/rotate-secret`,method:"POST",...n});developer_credentials_verify_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/verify-secret`,method:"POST",...n})},_g=class{http;constructor(e){this.http=e}developer_kit_postman_collection_list=(e={})=>this.http.request({path:"/projects/v1/developer-kit/postman-collection",method:"GET",...e})},bg=class{http;constructor(e){this.http=e}billing_context_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}`,method:"GET",...n});billing_context_payments_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}/payments`,method:"GET",query:t,...n})},vg=class{http;constructor(e){this.http=e}usage_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}`,method:"GET",...n});usage_timeseries_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}/timeseries`,method:"GET",query:t,...n})},He={PLUGIN_INIT:"plugin_init",LINK_CHECK:"link_check",IMAGE_CHECK:"image_check",SPAM_ASSASSIN:"spam_assassin",AI_IMAGE:"ai_image",AI_WRITE:"ai_write",AI_REPHRASE:"ai_rephrase"},en={TODAY:"today",WEEK:"week",MONTH:"month",CUSTOM:"custom"},t0=[He.PLUGIN_INIT,He.LINK_CHECK,He.IMAGE_CHECK,He.SPAM_ASSASSIN,He.AI_IMAGE,He.AI_WRITE],un={current:0,limit:null},Eg=()=>({pluginInit:{...un},aiAssistant:{...un},aiImage:{...un},linkCheck:{...un},imageCheck:{...un},spamAssassin:{...un}}),Ze=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ke=(e,t,n="")=>{for(const o of t){const i=e[o];if(typeof i=="string")return i;if(typeof i=="number"&&Number.isFinite(i))return String(i)}return n},Bt=(e,t,n=0)=>{for(const o of t){const i=e[o];if(typeof i=="number"&&Number.isFinite(i))return i;if(typeof i=="string"&&i.trim()&&Number.isFinite(Number(i)))return Number(i)}return n},bo=(e,t,n=!1)=>{for(const o of t){const i=e[o];if(typeof i=="boolean")return i}return n},Er=(e,t)=>{for(const n of t){const o=e[n];if(o===null)return null;if(typeof o=="number"&&Number.isFinite(o))return o;if(typeof o=="string"&&o.trim()&&Number.isFinite(Number(o)))return Number(o)}return null},Sg=new Set(Object.values(He)),wg=e=>Sg.has(e)?e:null,tn=e=>Ze(e)&&"data"in e&&(e.ok===!0||typeof e.success=="boolean"||e.success===void 0)?e.data:e,mn=(e,t)=>{for(const n of t){const o=e[n];if(Ze(o))return o}return null},kg=(e,t)=>{for(const n of t){const o=e[n];if(!Array.isArray(o))continue;const i=o.filter(a=>typeof a=="string");if(i.length>0)return i}},Cg=e=>Ze(e)?{clientId:Ke(e,["clientId","client_id"]),clientSecretConfigured:bo(e,["clientSecretConfigured","client_secret_configured"]),rotatedAt:Ke(e,["rotatedAt","rotated_at"])||void 0,scopesSuggested:kg(e,["scopesSuggested","scopes_suggested"])}:{clientId:"",clientSecretConfigured:!1},Za=(e,t)=>{for(const n of t){const o=e[n];if(typeof o=="boolean")return o}},Tg=e=>{const t=Za(e,["pluginConnected","plugin_connected","connected","is_connected"]);if(t!==void 0)return t;for(const n of["plugin","developer_credentials","developerCredentials"]){const o=mn(e,[n]);if(!o)continue;const i=Za(o,["connected","plugin_connected","is_connected"]);if(i!==void 0)return i;const a=Ke(o,["clientId","client_id"]),c=bo(o,["clientSecretConfigured","client_secret_configured"]);if(a)return c}},Ig=e=>{const t=tn(e);if(!Ze(t))return{};const n=mn(t,["members"]);return{myRole:Ke(t,["myRole","my_role","role"])||(n?Ke(n,["myRole","my_role","role"]):"")||void 0,pluginConnected:Tg(t)}},Ag=e=>Ze(e)?{clientId:Ke(e,["clientId","client_id"]),secret:Ke(e,["secret","clientSecret","client_secret"])}:{clientId:"",secret:""},xg=e=>{if(!Ze(e))return null;const t=Ke(e,["event","type","key"]),n=wg(t);if(!n)return null;const o=e.delta??e.change??e.trend,i=o==null?null:typeof o=="number"&&Number.isFinite(o)?o:Number.isFinite(Number(o))?Number(o):null;return{event:n,total:Bt(e,["total","count","value"],0),delta:i}},es=e=>{if(!Ze(e))return null;const t=Ke(e,["date","day","x"]);if(!t)return null;const n={date:t},o=e.event_counts??e.eventCounts;if(Ze(o)){for(const[i,a]of Object.entries(o))typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n}for(const[i,a]of Object.entries(e))i==="date"||i==="day"||i==="x"||i==="event_counts"||i==="eventCounts"||typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n},Pg=e=>{const t=tn(e);return Ze(t)?(Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:Array.isArray(t.time_series)?t.time_series:Array.isArray(t.history)?t.history:[]).map(es).filter(n=>n!==null):[]},Rg=e=>{if(!Ze(e))return{current:0,limit:null};const t=Bt(e,["current","count","used","value","total"],0),n=Er(e,["limit","max","quota","cap"]);return{current:t,limit:n===null?null:n}},pn=(e,t)=>{for(const n of t)if(n in e)return Rg(e[n]);return{current:0,limit:null}},fn={pluginInit:[He.PLUGIN_INIT,"plugin_init","pluginInit"],aiAssistant:["ai_assistant","aiAssistant","ai"],aiImage:[He.AI_IMAGE,"ai_image","ai_img","aiImg"],linkCheck:[He.LINK_CHECK,"link_check","linkCheck"],imageCheck:[He.IMAGE_CHECK,"image_check","imageCheck"],spamAssassin:[He.SPAM_ASSASSIN,"spam_assassin","spamAssassin","spam_check","spamCheck"]},vo=e=>{const t=Eg(),n=tn(e),o=Ze(n)&&Ze(n.usage)?n.usage:n;if(!Ze(o))return t;const i=Bt(o,["operationsTotal","operations_total"],0),a=Bt(o,["operationsLast30d","operations_last_30d"],0),c=mn(o,["metrics","counters","limits","events","usage_by_event","usageByEvent"])??o;return{pluginInit:pn(c,fn.pluginInit),aiAssistant:pn(c,fn.aiAssistant),aiImage:pn(c,fn.aiImage),linkCheck:pn(c,fn.linkCheck),imageCheck:pn(c,fn.imageCheck),spamAssassin:pn(c,fn.spamAssassin),lastActivityAt:Ke(o,["lastActivityAt","last_activity_at"])||void 0,operationsTotal:i>0?i:void 0,operationsLast30d:a>0?a:void 0}},ts=(e,t)=>{const n=[{event:He.LINK_CHECK,total:e.linkCheck.current,delta:null},{event:He.IMAGE_CHECK,total:e.imageCheck.current,delta:null},{event:He.SPAM_ASSASSIN,total:e.spamAssassin.current,delta:null},{event:He.AI_IMAGE,total:e.aiImage.current,delta:null}],o=t?Pg(t):[];return o.length>0?{cards:n,chart:o}:{cards:n,chart:[]}},jg=e=>{const t=tn(e);if(!Ze(t))return ts(vo(e),e);const n=Array.isArray(t.cards)?t.cards:Array.isArray(t.summary)?t.summary:[],o=Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:[];return n.length>0||o.length>0?{cards:n.map(xg).filter(i=>i!==null),chart:o.map(es).filter(i=>i!==null)}:ts(vo(t),t)},Lg=e=>{if(!Ze(e))return null;const t=Ke(e,["id","payment_id"]);return t?{id:t,date:Ke(e,["date","created_at","paid_at"]),amount:Bt(e,["amount","sum"],0),currency:Ke(e,["currency"],"RUB"),status:Ke(e,["status"],"unknown"),receiptUrl:Ke(e,["receiptUrl","receipt_url","pdf_url"])||void 0}:null},Og=e=>{const t=tn(e),n=Ze(t)&&Array.isArray(t.payments)?t.payments:[];return{payments:n.map(Lg).filter(o=>o!==null),page:Ze(t)?Bt(t,["page"],1):1,perPage:Ze(t)?Bt(t,["perPage","per_page"],20):20,total:Ze(t)?Bt(t,["total"],n.length):n.length,totalPages:Ze(t)?Bt(t,["totalPages","total_pages"],1):1}},Mg=e=>{const t=tn(e);if(!Ze(t))return{viewerSeesBilling:!1};const n=mn(t,["endpoints"])??{},o=mn(t,["documentLinks","document_links"]),i=o?Object.fromEntries(Object.entries(o).filter(f=>typeof f[1]=="string")):void 0,a=Er(t,["ownerUserId","owner_user_id"]),c=mn(t,["tariff","plan","subscription"]),d=Ke(t,["planDescription","plan_description"])||(c?Ke(c,["description","about","plan_description"]):"")||void 0,u=Er(t,["planPrice","plan_price","price","amount"])??(c?Er(c,["price","amount"]):null),m=Ke(t,["planCurrency","plan_currency","currency"])||(c?Ke(c,["currency"]):"")||void 0;return{viewerSeesBilling:bo(t,["viewerSeesBilling","viewer_sees_billing"]),ownerUserId:a??void 0,planName:Ke(t,["planName","plan_name"])||void 0,planDescription:d,planPrice:u??void 0,planCurrency:m||void 0,endpoints:{limitsStats:Ke(n,["limitsStats","limits_stats"])||void 0,subscriptionMe:Ke(n,["subscriptionMe","subscription_me"])||void 0,payments:Ke(n,["payments"])||void 0},documentLinks:i&&Object.keys(i).length>0?i:void 0}},Ng={myRole:"owner"},Dg=()=>({...Ng}),Fg={clientId:"rust-awkward-bear",clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"},ns=()=>({...Fg,clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"}),rs=Object.values(He),Bg={[He.PLUGIN_INIT]:42,[He.LINK_CHECK]:-15,[He.IMAGE_CHECK]:28,[He.SPAM_ASSASSIN]:9,[He.AI_IMAGE]:6,[He.AI_WRITE]:-11,[He.AI_REPHRASE]:4},Ug=(e,t)=>{const n={date:e};return rs.forEach((o,i)=>{const a=Math.sin(t*.65+i*.9),c=t*(i%2===0?.35:.2),d=2+i;n[o]=Math.max(0,Math.round(d+a*4+c))}),n},$g=e=>rs.map(t=>({event:t,total:e.reduce((n,o)=>n+(typeof o[t]=="number"?o[t]:0),0),delta:Bg[t]})),Gg=({period:e,dateFrom:t,dateTo:n})=>{const o=(0,wn.default)().startOf("day");if(e===en.WEEK)return{startDate:o.subtract(6,"day"),days:7};if(e===en.MONTH)return{startDate:o.subtract(29,"day"),days:30};if(e===en.CUSTOM&&t&&n){const i=(0,wn.default)(t),a=(0,wn.default)(n);return{startDate:i,days:Math.max(1,a.diff(i,"day")+1)}}return{startDate:o,days:1}},Eo=(e={period:en.TODAY})=>{const{startDate:t,days:n}=Gg(e),o=Array.from({length:n},(i,a)=>Ug(t.add(a,"day").format("YYYY-MM-DD"),a));return{cards:$g(o),chart:o}},n0=Eo({period:en.WEEK}),zg={pluginInit:{current:0,limit:null},aiAssistant:{current:0,limit:null},aiImage:{current:42,limit:100},linkCheck:{current:128,limit:500},imageCheck:{current:64,limit:200},spamAssassin:{current:31,limit:150},lastActivityAt:"2026-05-02T12:00:00Z"},os={payments:[{id:"98765",date:"2026-05-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success",receiptUrl:"https://receipts.example/98765.pdf"},{id:"98764",date:"2026-04-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success"},{id:"98763",date:"2026-03-12T10:15:00+00:00",amount:990,currency:"RUB",status:"failed"}],page:1,perPage:20,total:3,totalPages:1},Wg={viewerSeesBilling:!0,ownerUserId:1,planName:"Corporate",planDescription:"For fully addressing all necessary tasks in any field.",planPrice:3200,planCurrency:"RUB",endpoints:{limitsStats:"/wp-json/limits/v1/stats",subscriptionMe:"/wp-json/subscription/v2/me",payments:"/wp-json/projects/v1/billing-context/2581/payments"}},Hg={info:{name:"EmailMaker Plugin Requests",schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:[]},qg=e=>e,Vg=()=>!1,Yg=()=>!1,Kg=e=>e,hn="ProjectPlugin",Qg=()=>({}).REACT_APP_PLUGIN_SETTINGS_USE_MOCK==="true",qt=(e,t,n)=>e.error&&Qg()?{data:n(t)}:r.transformResponseFn(n)(e),Xg=e=>qg(Cg(e)),Jg=e=>Kg(Mg(e)),Zg=({period:e,dateFrom:t,dateTo:n})=>{if(e===en.CUSTOM){const o={};return t&&(o.date_from=t),n&&(o.date_to=n),o}return{period:e??en.TODAY}},Sr=r.createApi({reducerPath:"projectSettingsPluginApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}),tagTypes:[hn],endpoints:e=>({getPluginSummary:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[yg]).settings_summary_detail({projectId:t}).then(o=>qt(o,Dg(),Ig))},providesTags:(t,n,{projectId:o})=>[{type:hn,id:o}]}),getPluginCredentials:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[Ja]).developer_credentials_detail({projectId:t}).then(o=>qt(o,ns(),Xg))},providesTags:(t,n,{projectId:o})=>[{type:hn,id:`credentials-${o}`}]}),rotatePluginSecret:e.mutation({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[Ja]).developer_credentials_rotate_secret_create({projectId:t}).then(o=>qt(o,{clientId:ns().clientId,secret:"mock-rotated-secret"},Ag))},invalidatesTags:(t,n,{projectId:o})=>[{type:hn,id:`credentials-${o}`}]}),getPostmanCollection:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[_g]).developer_kit_postman_collection_list({extraQuery:{project_id:String(t)}}).then(o=>qt(o,Hg,i=>tn(i)??i))}}),getPluginAnalytics:e.query({queryFn({projectId:t,period:n,dateFrom:o,dateTo:i},a){const c={period:n,dateFrom:o,dateTo:i};return Vg()?Promise.resolve({data:Eo(c)}):r.getClient(h.getContainer(a)).request({path:`/projects/v1/usage/${t}/timeseries`,method:"GET",query:Zg(c)}).then(d=>qt(d,Eo(c),jg))}}),getPluginBillingContext:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[bg]).billing_context_detail({projectId:t}).then(o=>qt(o,Wg,Jg))},providesTags:(t,n,{projectId:o})=>[{type:hn,id:`billing-${o}`}]}),getPluginUsage:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[vg]).usage_detail({projectId:t}).then(o=>qt(o,zg,vo))}}),getPluginPayments:e.query({queryFn({projectId:t,page:n=1,perPage:o=20},i){return Yg()?Promise.resolve({data:os}):r.getClient(h.getContainer(i)).request({path:`/projects/v1/billing-context/${t}/payments`,method:"GET",query:{page:String(n),per_page:String(o)}}).then(a=>qt(a,os,Og))},providesTags:(t,n,{projectId:o})=>[{type:hn,id:`payments-${o}`}]})})}),{useGetPluginSummaryQuery:r0,useGetPluginCredentialsQuery:o0,useRotatePluginSecretMutation:i0,useLazyGetPostmanCollectionQuery:a0,useGetPluginAnalyticsQuery:s0,useGetPluginBillingContextQuery:l0,useGetPluginPaymentsQuery:c0,useGetPluginUsageQuery:d0}=Sr,is="EmailRaw",wr=r.createApi({reducerPath:"emailRawApi",tagTypes:[is],baseQuery:r.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:t,secret_hash:n},o){return h.getApi(h.getContainer(o),[h.WpEmailApi]).email_detail({id:t},{extraQuery:{secret_hash:n}}).then(r.transformResponseFn(r.WpEmailToEmail))},providesTags:(t,n,o)=>[{type:is,id:o}]})})}),{useGetEmailRawQuery:u0}=wr,kr=r.createApi({reducerPath:"yandexAuthApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateYandexToken:e.mutation({query:t=>({url:"/auth/yandex",method:"POST",body:t})})})}),{useValidateYandexTokenMutation:m0}=kr,Cr=r.createApi({reducerPath:"elamaAuthApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateElamaCode:e.mutation({query:t=>({url:"/auth/elama",method:"POST",body:t})})})}),{useValidateElamaCodeMutation:p0}=Cr,Tr=r.createApi({reducerPath:"googleAuthApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateGoogleToken:e.mutation({query:t=>({url:"/auth/google",method:"POST",body:t})})})}),{useValidateGoogleTokenMutation:f0}=Tr,as=async e=>{const t=await e.text();let n=t;try{n=JSON.parse(t)}catch{n=t}return n},ey=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",headers:{"Content-Type":"application/json"},body:t,responseHandler:as}},ty=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t,responseHandler:as}},Ir=r.createApi({reducerPath:"requestPlaneApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:t=>ty("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",t,"REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC")}),getInvoiceRequest:e.mutation({query:t=>ey("https://webhook.latenode.com/5868/prod/6e2d04a8-6cd9-4ec3-b884-ee2fd67267a3",t,"REACT_APP_REQUEST_PLANE_WEBHOOK_URL")})})}),{useGetRequestMutation:h0,useGetInvoiceRequestMutation:g0}=Ir,Ar=r.createApi({reducerPath:"getCheckoutUrlApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:t=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:t})})})}),{useGetCheckoutUrlMutation:y0}=Ar,So=r.createApi({reducerPath:"recoverPasswordApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:()=>({})}),xr=r.createApi({reducerPath:"addUserToProjectApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn(t,n){return r.clientFromApi(n).userToProject.add_user_create(t,{type:h.ContentType.FormData})}})})}),{useAddUserToProjectMutation:_0}=xr,Pr=r.createApi({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:b0,useGetCanselRecurrenceQuery:v0}=Pr,Rr=r.createApi({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:r.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:E0,useGetRecurrenceQuery:S0}=Rr,ny="https://app.emailmaker.ru/api/v2",jr=r.createApi({reducerPath:"authApi",baseQuery:r.fetchBaseQueryApp({baseUrl:ny,prepareHeaders:e=>{const t=r.api.get(r.APP_COOKIES.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({login:e.mutation({query:t=>({url:"/auth/token",method:"POST",body:t})}),register:e.mutation({query:t=>({url:"/auth/register",method:"POST",body:t})}),refreshToken:e.mutation({query:t=>({url:"/auth/token/refresh",method:"POST",body:t})}),logout:e.mutation({query:()=>({url:"/auth/token",method:"DELETE"})}),getUser:e.query({query:()=>"/auth/user",transformResponse:t=>{const n=Array.isArray(t)?t[0]:t;return r.WpUserToUser(n)}}),changePassword:e.mutation({query:t=>({url:"/auth/password/change",method:"POST",body:t})}),resetPassword:e.mutation({query:t=>({url:"/auth/password/reset",method:"POST",body:t})}),resetPasswordConfirm:e.mutation({query:t=>({url:"/auth/password/reset/confirm",method:"POST",body:t})})})}),{useLoginMutation:w0,useRegisterMutation:k0,useRefreshTokenMutation:C0,useLogoutMutation:T0,useGetUserQuery:I0,useLazyGetUserQuery:A0,useChangePasswordMutation:x0,useResetPasswordMutation:P0,useResetPasswordConfirmMutation:R0}=jr;function ss(e){return{id:e.id??0,name:e.name??"",children:(e.children??[]).map(ss)}}function ry(e){return(e?.folders??[]).map(ss)}function oy(e){return{items:(e?.items??[]).flatMap(t=>t.id?[{kind:t.kind??"email",id:t.id,name:t.name??"",title:t.title??"",preheader:t.preheader??"",folderId:t.folder_id??0,hasAmp:t.has_amp??!1,previewImage:t.preview_image??"",updatedAt:t.updated_at??"",imported:t.imported??!1}]:[]),total:e?.total??0}}function wo(e){const t=e.status??"pending";return{id:e.id??"",status:t,outcome:e.outcome,total:e.total??0,imported:e.imported??0,warnings:e.warnings??0,failed:e.failed??0,finished:t==="done"||t==="failed",items:(e.items??[]).map(n=>({kind:n.kind??"email",stripoId:n.stripo_id??0,name:n.name??"",status:n.status??"failed",reason:n.reason,emailId:n.email_id})),createdAt:e.created_at??"",finishedAt:e.finished_at}}function iy(e){return{selectors:e.map(t=>({kind:t.kind,...t.ids?.length?{ids:t.ids}:{},...t.all?{all:!0}:{},...t.folderId?{folder_id:t.folderId}:{},...t.rootOnly?{root_only:!0}:{},...t.search?{search:t.search}:{}}))}}var ko="StripoItems",Co="StripoFolders",Lr="StripoImportJob",gn=(e,t)=>{const n=r.v2ResultOf(e);return"error"in n?{error:n.error}:{data:t(n.data)}},Or=r.createApi({reducerPath:"stripoImportApi",tagTypes:[ko,Co,Lr],baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({saveStripoKey:e.mutation({async queryFn({projectId:t,apiKey:n},o){return gn(await r.getClientV2(h.getContainer(o)).projects.stripoKeyUpdate({id:String(t)},{api_key:n}),()=>{})},invalidatesTags:[ko,Co]}),getStripoFolders:e.query({async queryFn({projectId:t,kind:n},o){return gn(await r.getClientV2(h.getContainer(o)).projects.stripoFoldersList({id:String(t),kind:n}),ry)},providesTags:[Co]}),getStripoItems:e.query({async queryFn({projectId:t,kind:n,folderId:o,rootOnly:i,search:a,page:c,limit:d},u){return gn(await r.getClientV2(h.getContainer(u)).projects.stripoItemsList({id:String(t),kind:n,...o?{folder_id:o}:{},...i?{root_only:!0}:{},...a?{search:a}:{},page:c,limit:d}),oy)},providesTags:[ko]}),startStripoImport:e.mutation({async queryFn({projectId:t,selectors:n},o){return gn(await r.getClientV2(h.getContainer(o)).projects.stripoImportsCreate({id:String(t)},iy(n)),wo)},invalidatesTags:[Lr]}),getCurrentStripoImport:e.query({async queryFn(t,n){const o=await r.getClientV2(h.getContainer(n)).projects.stripoImportsCurrentList({id:String(t)});return o.status===204?{data:null}:gn(o,wo)},providesTags:[Lr]}),getStripoImport:e.query({async queryFn({projectId:t,jobId:n},o){return gn(await r.getClientV2(h.getContainer(o)).projects.stripoImportsDetail({id:String(t),jobId:n}),wo)},providesTags:[Lr]})})}),{useSaveStripoKeyMutation:j0,useGetStripoFoldersQuery:L0,useGetStripoItemsQuery:O0,useLazyGetStripoItemsQuery:M0,useStartStripoImportMutation:N0,useGetCurrentStripoImportQuery:D0,useGetStripoImportQuery:F0}=Or,ay=r.createState({activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),sy="projectSlice",To=r.createSlice({name:sy,initialState:ay,reducers:{setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(r.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{payload:n,meta:o})=>{const{projectId:i}=o.arg.originalArgs;i?(t.groupsTemplateProjectTotal=+o.baseQueryMeta?.response.headers.get("X-WP-Total"),t.groupsTemplateProjectTotalPages=+o.baseQueryMeta?.response.headers.get("X-WP-TotalPages")):t.groupsTemplateTotal=+o.baseQueryMeta?.response.headers.get("X-WP-Total")})}}),{setActiveGroupsTags:B0,setActiveProjectGroupsTags:U0,resetAllTags:$0}=To.actions,ly=r.createState({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:r.CARDS}),cy="emailsPageSlice";function dy(e){const t=e?.baseQueryMeta?.response;return Number(t?.headers?.get("X-WP-Total"))||0}function ls(e,t){const{emails:n,total:o,isSearch:i,page:a,tagOrFolderId:c}=t;if(t.status==="trash")!i&&o!==void 0&&(e.emailsTrashTotal=o),e.elementsTrashList=n;else if(c){const d=e.customFolders[c];e.customFolders={...e.customFolders,[c]:{list:n,page:a,total:o??d?.total??0}}}else o!==void 0&&(e.emailsTotal=o),e.elementsList=n}var Io=r.createSlice({name:cy,initialState:ly,reducers:{resetElementsList:e=>{e.elementsList=[]},syncElementsList:(e,{payload:t})=>{ls(e,t)},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(o=>o.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(r.emailsApi.endpoints.getEmails.matchFulfilled,(t,{meta:n,payload:o})=>{const i=n.arg.originalArgs;ls(t,{emails:o,total:dy(n),status:i?.status,page:i?.page,isSearch:!!i?.name?.length,tagOrFolderId:i?.folderTag||i?.tags?.[0]})}),e.addMatcher(r.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{meta:n,payload:o})=>{const i=+n.baseQueryMeta?.response.headers.get("X-WP-Total")||0;t.elementsList=o,t.emailsTotal=i;const{projectGroup:a,projectId:c,tags:d}=n.arg.originalArgs;(a?.length&&c||d?.length||!d?.length&&!a?.length)&&(t.emailsTotal=i)}),e.addMatcher(r.emailsApi.endpoints.editEmail.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(o=>o.id?.toString()===n.id?.toString()?Object.assign(o,{lock:n.lock,title:n.title,emailtags:n.emailtags}):o)})}}),{toggleElementsView:G0,resetElementsList:z0,syncElementsList:W0,removeEmailFromList:H0}=Io.actions,cs=r.combineReducers({[r.di.reducerPath]:r.di.reducer,[r.AiApi.reducerPath]:r.AiApi.reducer,[r.userSlice.name]:r.userSlice.reducer,[r.emailSlice.name]:r.emailSlice.reducer,[r.blockSlice.name]:r.blockSlice.reducer,[r.imageApi.reducerPath]:r.imageApi.reducer,[Pn.reducerPath]:Pn.reducer,[yr.reducerPath]:yr.reducer,[To.name]:To.reducer,[r.blocksApi.reducerPath]:r.blocksApi.reducer,[r.emailsApi.reducerPath]:r.emailsApi.reducer,[hr.reducerPath]:hr.reducer,[Jn.reducerPath]:Jn.reducer,[Zn.reducerPath]:Zn.reducer,[er.reducerPath]:er.reducer,[tr.reducerPath]:tr.reducer,[nr.reducerPath]:nr.reducer,[rr.reducerPath]:rr.reducer,[or.reducerPath]:or.reducer,[ir.reducerPath]:ir.reducer,[ar.reducerPath]:ar.reducer,[sr.reducerPath]:sr.reducer,[lr.reducerPath]:lr.reducer,[cr.reducerPath]:cr.reducer,[dr.reducerPath]:dr.reducer,[ur.reducerPath]:ur.reducer,[mr.reducerPath]:mr.reducer,[pr.reducerPath]:pr.reducer,[r.emailPageSlice.name]:r.emailPageSlice.reducer,[r.projectsApi.reducerPath]:r.projectsApi.reducer,[jn.reducerPath]:jn.reducer,[Xt.reducerPath]:Xt.reducer,[Ln.reducerPath]:Ln.reducer,[Sr.reducerPath]:Sr.reducer,[r.saveFileApi.reducerPath]:r.saveFileApi.reducer,[wr.reducerPath]:wr.reducer,[r.commentsApi.reducerPath]:r.commentsApi.reducer,[r.optimiseApi.reducerPath]:r.optimiseApi.reducer,[ro.name]:ro.reducer,[Io.name]:Io.reducer,[fr.reducerPath]:fr.reducer,[Tr.reducerPath]:Tr.reducer,[kr.reducerPath]:kr.reducer,[Cr.reducerPath]:Cr.reducer,[r.taxonomiesApi.reducerPath]:r.taxonomiesApi.reducer,[r.projectsPageSlice.name]:r.projectsPageSlice.reducer,[r.AiApiGenerator.reducerPath]:r.AiApiGenerator.reducer,[Ir.reducerPath]:Ir.reducer,[gr.reducerPath]:gr.reducer,[br.reducerPath]:br.reducer,[Wn.reducerPath]:Wn.reducer,[r.authorizationApi.reducerPath]:r.authorizationApi.reducer,[r.limitsApi.reducerPath]:r.limitsApi.reducer,[r.revisionHistorySlice.name]:r.revisionHistorySlice.reducer,[Ar.reducerPath]:Ar.reducer,[r.defaultModePanesSlice.name]:r.defaultModePanesSlice.reducer,[So.reducerPath]:So.reducer,[xr.reducerPath]:xr.reducer,[_r.reducerPath]:_r.reducer,[Rr.reducerPath]:Rr.reducer,[Pr.reducerPath]:Pr.reducer,[jr.reducerPath]:jr.reducer,[r.projectSettingsV2Api.reducerPath]:r.projectSettingsV2Api.reducer,[Or.reducerPath]:Or.reducer}),uy=(e,t)=>t.type==="authorizationApi/resetApiState"?cs({[r.reducerPath]:e[r.reducerPath]},t):cs(e,t),ds=[r.AiApi,r.imageApi,yr,r.emailsApi,Pn,r.blocksApi,hr,Jn,Zn,er,tr,nr,rr,or,ir,ar,sr,lr,cr,dr,ur,mr,pr,wr,r.projectsApi,jn,Xt,Ln,Sr,r.commentsApi,r.optimiseApi,r.saveFileApi,fr,Tr,r.taxonomiesApi,kr,Cr,r.AiApiGenerator,Ir,r.authorizationApi,r.limitsApi,gr,br,Wn,Ar,So,jr,r.projectSettingsV2Api,Or,xr,_r,Rr,Pr];function my(e){let t={};if(e){const o=h.createIdentifier$1();h.DependencyResolver.inject(o,e),t={INJECTION:o}}const n=r.configureStore({reducer:uy,middleware:o=>o({serializableCheck:!1}).concat(ds.map(i=>i.middleware)),preloadedState:t});return r.setupListeners(n.dispatch),n}var us=h.createIdentifier$1("RtkApiRegistry");function py(e,t){e.inject(us,new Map(t.map(n=>[n.reducerPath,n])))}function lt(e,t){const n=e?.getInstance(us)?.get(t);if(!n)throw new Error(`RTK api "${t}" is not in the container registry (provideRtkApiRegistry did not run)`);return n}function fy(e,t){let n={isCodeMode:void 0,direction:void 0};return r.provideCodeMode(e).watch(o=>{n.isCodeMode!==o.isCodeMode&&t.dispatch(r.setCodeMode(o.isCodeMode)),n.direction!==o.direction&&t.dispatch(r.switchCodeModeDirection(o.direction)),n={isCodeMode:o.isCodeMode,direction:o.direction}})}function hy(e,t){const n=r.provideCurrentUser(e),o=r.authorizationApi.endpoints.getMe.select("");let i=n.get()?.profile;const a=()=>{const c=o(t.getState()).data;!c||c===i||(i=c,n.set({profile:c}))};return a(),{dispose:t.subscribe(a)}}var gy=h.createIdentifier$1("EmailSettingsPort");function yy(e,t){e.inject(gy,{read:()=>r.selectEmailSettings(t.getState())??{},write:n=>{t.dispatch(r.setEmailSettings(n))},markAppearanceChanged:()=>{t.dispatch(r.markAppearanceNeedsUpdate())}})}var _y="Invalid standaloneKey.",by="not implemented",q0=1,vy=h.createIdentifier$1("StandaloneMockGuard");function Ao(){const e=new Error(_y);return e.name="InvalidStandaloneKeyError",e}function xo(e){return r.isStandaloneRuntime(h.getContainer(e))}function Ey(e){return e instanceof Error?e.name==="InvalidStandaloneKeyError"||e.message==="Invalid standaloneKey."||e.message==="not implemented":e===by}function ms(e){if(xo(e))throw Ao()}function Sy(e,t,n){return n instanceof Error&&n.name==="InvalidStandaloneKeyError"?n:Ao()}var wy=()=>()=>{throw Ao()};function ky(e){if(!e)throw new Error("DI container not found for standalone mock guard");e.inject(vy,1)}function Cy(e){return typeof e!="function"}var V0="[plugin-api-mock]";function ps(){return!0}function Ty(e){try{if(e===null||typeof e!="object")return e;const t={};for(const n of Object.keys(e).slice(0,12)){const o=e[n];t[n]=typeof o=="string"&&o.length>120?`${o.slice(0,120)}…(${o.length})`:o}return t}catch{return"(unserializable arg)"}}function Iy(e,t){return n=>{const o=n.query,i=n.queryFn||((a,c,d,u)=>{if(!o)throw new Error("query not found EndpointDefinition");return u(o(a))});i&&(n.query=void 0,n.queryFn=async(a,c,d,u)=>{try{let m;const f=h.getContainer(c).getServices(e);for(let g=f.length-1;g>=0;g--){const _=f[g];if(m=m?await m(async p=>await _.execute(p),c):await _.execute(a),Cy(m))return{data:m,error:null}}if(m)m=await m(async(g,_=c,p=d,v=u)=>{ms(c);const C=await i(g,_,p,v);if(C.error)throw C.error;return C.data},c);else{ms(c),ps();const g=await i(a,c,d,u);if(g.error)throw g.error;m=g.data}return{data:m,error:null}}catch(m){return xo(c)&&Ey(m)?{error:Sy(t,Ty(a),m)}:(ps(),{error:m})}})}}var fs=new Set;function at(e){return(t,n)=>{const o=Object.create(null),i=Object.keys(n),a=new h.Disposable;for(const c of i){const d=`api_listeners_flag_${t.reducerPath}/${c.toString()}`,u=h.createIdentifier$1(`api_listeners_${t.reducerPath}/${c.toString()}`);fs.has(d)||(o[c]=Iy(u,`${t.reducerPath}/${c.toString()}`),fs.add(d)),a.addDisposable(e.addService(u,{execute:n[c]}))}return Object.keys(o).length&&t.enhanceEndpoints({endpoints:o}),r.getDisposable(e).addDisposable(a),a}}function hs(e,t){for(const n of Object.keys(t))try{t[n](e)}catch{}}function Y0(e){return e}function gs(e,t){return e({body:t}).catch(()=>new Promise(n=>setTimeout(n,1e3)))}function Ay(e){at(e)(lt(e,"AiApi"),{sendMessage:({body:t})=>async(n,o)=>{const i=r.getEmitter(e,h.events.AI_TEXT_REQUEST_ID);if(!i.hasListeners())return gs(n,t);const a=t,c={message:a.message??a.context,locale:a.locale,entityId:a.entity_id,projectId:a.project_id!=null?String(a.project_id):void 0,subject:a.subject,preheader:a.preheader,textContent:a.textContent,context:a.context??a.connection,connection:a.connection,onProgress:(d,u)=>{r.getEmitter(e,h.events.AI_TEXT_PROGRESS_ID).fire({progress:Number.isFinite(d)?d:0,status:typeof u=="string"?u:void 0})},onStreamChunk:d=>{typeof d!="string"||!d||r.getEmitter(e,h.events.AI_TEXT_STREAM_ID).fire({partialHtml:d})},signal:o.signal};for(const d of i.getListeners([c])){const u=await d(c);if(u)return{status:200,_eventResult:!0,aiMessage:typeof u.message=="string"?u.message:"",aiHtml:typeof u.html=="string"?u.html:void 0}}return gs(n,t)},getDialog:t=>(n,o)=>xo(o)?Promise.resolve({documents:[],totalCount:0}):n(t)})}function xy(e){const t=at(e),n=r.getEmitter(e,h.events.FILE_PROXY_EVENT_ID);t(lt(e,"proxyApi"),{async getFile({url:o,tryFetch:i=!0,type:a}){return async c=>{const{requested:d}=r.getCurrentProject(e),u=(await n.fire({url:o,project:d})).filter(m=>m instanceof Blob)[0];if(u)switch(a){case"json":return JSON.parse(await u.text());case"text":return u.text();default:return u}else return c({url:o,tryFetch:i,type:a})}}})}function Py(e){at(e)(lt(e,"tokenApi"),{tokenCreate(t){return n=>n(t)},tokenValidate(){return t=>t({})}})}function K0(e){return e}function Ry(e){at(e)(lt(e,"imageApi"),{sendAiImageRequest:function({body:t}){return async(n,o)=>{const i=r.getEmitter(e,h.events.AI_IMAGE_REQUEST_ID);if(!i.hasListeners()||t.request!=="create-image")return n({body:t});const a={prompt:t.message??"",size:t.size,entityId:t.entity_id,projectId:t.project_id!=null?String(t.project_id):void 0,onProgress:(c,d)=>{r.getEmitter(e,h.events.AI_IMAGE_PROGRESS_ID).fire({progress:Number.isFinite(c)?c:0,status:typeof d=="string"?d:void 0})},signal:o.signal};for(const c of i.getListeners([a])){const d=await c(a);if(d&&d.images?.length)return{data:{status:200,_eventResult:!0,task:{images:d.images}}}}return n({body:t})}},getAiImage(t){return n=>n(t)}})}async function ys(e,t,n,o,i){try{const a=(await e.fire({project:String(t),emailId:n})).filter(c=>c!=null);if(a.length)return a.flat()}catch{}return o(i)}function jy(e){if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0}function Ly(e){const t=at(e),n=lt(e,"blocksApi"),o=r.blocksDataSourceProvider(e),i=o.byForeignKey("project"),a=r.blockRevisionsDataSourceProvider(e);a.byForeignKey("parent");const{dispatch:c}=r.getStore(e),d=r.getDisposable(e);d.addDisposable(o.onChange(()=>c(n.util.invalidateTags(["Blocks"])))),d.addDisposable(o.onSave(({prev:f,patch:g,value:_})=>{const p=f?{...f,...g}:g;let v=r.mergeEntityPreservingMeta(f,g,_);return p&&v.html===p.html&&v.title===p.title&&(v={...v,renderGuid:p.renderGuid}),v},Number.MIN_VALUE));const u=r.getEmitter(e,r.READ_COMMON_BLOCKS_EVENT_ID),m=r.getEmitter(e,r.READ_TEMPLATE_BLOCKS_EVENT_ID);t(n,{async getBlocks(f){const g={};f.name&&(g.title=f.name),f.type&&(g.type=f.type);const _=jy(f.projectId)??await r.getBlocksProject(e);return await i.get(_,{filter:g,page:f.page,pageSize:f.pageSize,order:f.order,orderBy:f.orderby}).then(({data:p})=>p)},getBlocksSchema(){return f=>f(void 0)},getParentEmailBlocks(f){return async g=>{const _=r.getCurrentProject(e).requested||"";return ys(m,_,f.emailId||"",g,f)}},getTemplateBlocks(f){return async g=>{const _=r.getCurrentProject(e).requested||"";return ys(u,_,f.emailId||"",g,f)}},async getBlock(f){const g=r.getCurrentProject(e).card?.id;if(g!==void 0)return i.first(Number(g),{filter:{id:f}})},addBlock(f){return async g=>{const _=await o.create(f);return r.getAppConfig(e).preventSendDataToEM||g(_).catch(p=>{}),_}},editBlock({blockId:f,...g}){return o.update(f,g)},deleteBlock(f){return o.remove(typeof f=="object"?f.id:f)},addTag(f){return f},getDeletableTag([f,g]){return[]},autoSaveBlock({blockId:f,body:g}){return a.create({...g,parent:f,isAutosave:!0})}})}function Oy(e){const{emails:t,emailRevisions:n}=r.provideEmailDocuments(e),{dispatch:o}=r.getStore(e),i=r.getDisposable(e),a=at(e),c=lt(e,"emailsApi");i.addDisposable(t.onChange(async()=>{o(c.util.invalidateTags(["Email"]))})),a(c,{getEmails:d=>[],getTemplateEmails:d=>[],async addEmail({source:d,...u}){const m=await t.create(u,{source:d});return m.renderGuid||(m.renderGuid=h.generateUUID()),m},editEmail(d){return async u=>{const{emailId:m,source:f,...g}=d;return r.isRevisionServiceEnabled(e)&&await u(d),t.update(m,g,{source:f})}},deleteEmail(d){return t.remove(typeof d=="object"?d.id:d)},addTag(){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},getDeletableTag([d,u]){return[]},autoSaveEmail({emailId:d,body:u}){return async m=>{r.isRevisionServiceEnabled(e)&&await m({emailId:d,body:u});const f=await n.create({...u,parent:d,modified:new Date().toString()});return f&&!f.html&&u.html?{...f,html:u.html}:f}}})}var My="tmp",Q0=h.createIdentifier$1();function Ny(e){const t=at(e);if(!e.getInstance(h.DISPOSABLE_ID))throw new Error("Something was wrong");const n=r.getEmitter(e,h.events.UPLOAD_EVENT_ID),o=r.getEmitter(e,h.events.ON_SEND_TESTEMAIL_ID),i=r.getEmitter(e,h.events.ON_SEND_LIVEPREVIEW_ID);t(lt(e,"saveFileApi"),{uploadImage(a){return async c=>{const{requested:d}=r.getCurrentProject(e),u=async()=>c({...a,user_id:String((await e.getInstanceAsync(h.APP_ID)).app_id)});if(a.folder===My)return u();const m=await r.fireUploadImageEvent(n,{file:a.file,project:d});if(m.url)return[{file_url:m.url,project:d}];if(!r.shouldFallbackToBuiltInUpload(m,{isStandalone:r.isStandaloneRuntime(e)}))throw r.toUploadImageError(m);return u()}},sendTestEmail(a){return async c=>{const{requested:d}=r.getCurrentProject(e);(await o.fire({project:d,email_id:a.email_id,subject:a.subject,email:a.email,html:a.html,from_name:a.from_name})).some(u=>u===!1)&&await c({...a,user_id:String((await e.getInstanceAsync(h.APP_ID)).app_id)})}},async sendLivePreview(a){const{requested:c}=r.getCurrentProject(e);(await i.fire({project:c,id:a.email,subject:a.subject,html:a.content})).some(d=>d===!1)},sendShortLink(a){return c=>c(a)}})}function Dy(e){at(e)(lt(e,"emailRawApi"),{getEmailRaw({emailId:t,secret_hash:n}){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Vt(e,t){for(var n=e<0?"-":"",o=Math.abs(e).toString();o.length<t;)o="0"+o;return n+o}function Fy(e,t){var n,o;r.requiredArgs(1,arguments);var i=zl(e);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var a=String((n=t?.format)!==null&&n!==void 0?n:"extended"),c=String((o=t?.representation)!==null&&o!==void 0?o:"complete");if(a!=="extended"&&a!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(c!=="date"&&c!=="time"&&c!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var d="",u="",m=a==="extended"?"-":"",f=a==="extended"?":":"";if(c!=="time"){var g=Vt(i.getDate(),2),_=Vt(i.getMonth()+1,2),p=Vt(i.getFullYear(),4);d="".concat(p).concat(m).concat(_).concat(m).concat(g)}if(c!=="date"){var v=i.getTimezoneOffset();if(v!==0){var C=Math.abs(v),k=Vt(Math.floor(C/60),2),S=Vt(C%60,2),I=v<0?"+":"-";u="".concat(I).concat(k,":").concat(S)}else u="Z";var A=Vt(i.getHours(),2),Y=Vt(i.getMinutes(),2),ee=Vt(i.getSeconds(),2),j=d===""?"":"T",R=[A,Y,ee].join(f);d="".concat(d).concat(j).concat(R).concat(u)}return d}function By(e){const t=at(e),n=lt(e,"commentsApi"),o=r.commentsDataSourceProvider(e),i=o.byForeignKey("post"),{dispatch:a}=r.getStore(e);r.getDisposable(e).addDisposable(o.onChange(()=>a(n.util.invalidateTags(["Comments"])))),t(n,{getComments(c){return i.get(c).then(({data:d})=>d)},addComment({subjectId:c,author:d,parent:u,content:m,author_name:f,author_email:g,targetId:_}){const p={post:c,author:d,author_name:f,author_email:g,content:m,parent:u,target_id:_,date:Fy(new Date),author_avatar_urls:{}};return o.create(p)},deleteComment(c){return o.remove(c)},editComment({commentId:c,...d}){return o.update(c,d)},deleteTarget(c){return o.update(c,{target_id:""})}})}function Po(e){return{id:String(e),name:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0,title:"",group:[],folder:[],blockfolder:[]}}function _s(e,t){return{project:Number(e),app_id:t?.app_id||0,app_config:t?.app_config||{},user:t?.user}}function Uy(e,t){const n=Po(String(t)),o=r.getCurrentProject(e).card;return o&&String(o.id)===String(t)?Promise.resolve({...n,...o,id:String(t)}):Promise.resolve({...n,id:String(t)})}function $y(e){let t,n;const o=i=>((t!==i||!n)&&(t=i,n=Uy(e,i)),n);at(e)(lt(e,"projectsApi"),{getProjects(i={page:1}){return[]},getProject(i){return async a=>r.isStandaloneRuntime(e)?a(i):{...await o(i),id:String(i)}},addProject(i){throw new Error},async editProject({projectId:i,...a}){const c={...await o(i),...a,id:String(i)};return t=i,n=Promise.resolve(c),c},deleteProject(i){throw new Error},mutateProjectMembers(){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},addProjectMember(){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},getFrequentProjects(){return[]}})}function Gy(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:r.getCurrentUser(e).profile?.locale,counters:{},avatar_urls:{},autosaves:!0};at(e)(lt(e,"authorizationApi"),{getSchema:()=>n=>n({}),getMe:()=>t,editMe:n=>t={...t,...n},getSubscriptions:()=>[]})}function zy(e){at(e)(lt(e,"notificationsApi"),{getNotifications(t){return[]},notificationShown({id:t,datetime:n}){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Wy(e){at(e)(lt(e,"addUserToProjectApi"),{addUserToProject:()=>{}})}function Hy(e){r.injectEmailTermsResolver(e,{resolve:async()=>{}}),at(e)(lt(e,"taxonomiesApi"),{getTerms:()=>[],getStandardGroups:()=>[],addTerm:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},editTerm:t=>({id:t.id,name:t.name,parent:0,count:0}),deleteTerm:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function qy(e){at(e)(lt(e,"projectSettingsV2Api"),{getProjectIntegrations:()=>({}),getProjectWebhook:()=>"",getProjectStorage:()=>({}),getProjectTestRecipients:()=>[],getIntegrationCredentials:()=>({}),putProjectIntegration:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},deleteProjectIntegration:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectWebhook:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectSettings:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectTestRecipients:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Vy(e){at(e)(lt(e,"stripoImportApi"),{getStripoFolders:()=>[],getStripoItems:()=>({items:[],total:0}),getCurrentStripoImport:()=>null,getStripoImport:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},saveStripoKey:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},startStripoImport:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}var bs={addUserToProjectApiMock:Wy,AiApiMock:Ay,authorizationApiMock:Gy,blocksApiMock:Ly,commentsApiMock:By,emailsApiMock:Oy,emailRawApiMock:Dy,imageApiMock:Ry,notificationsApiMock:zy,projectsApiMock:$y,projectSettingsV2ApiMock:qy,proxyApiMock:xy,saveFileApiMock:Ny,stripoImportApiMock:Vy,taxonomiesApiMock:Hy,tokenApiMock:Py},Ro=r.createApi({reducerPath:"tokenApi",baseQuery:r.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn(t,n){return r.clientFromApi(n).jwtAuth.token_create({body:t,type:h.ContentType.Json})}}),tokenValidate:e.mutation({queryFn(t,n){return r.clientFromApi(n).jwtAuth.token_validate_create({type:h.ContentType.Json})}})})}),{useTokenCreateMutation:X0,useTokenValidateMutation:J0}=Ro;function jo(){const e=new Map;for(const t of ds)e.set(t.reducerPath,t);return e.set(Ro.reducerPath,Ro),[...e.values()]}function Yy(e,t){const n=Object.keys(t.endpoints);n.length&&e(t,Object.fromEntries(n.map(o=>[o,wy])))}function Ky(e){ky(e);const t=at(e);for(const n of jo())Yy(t,n)}function Qy(e){if(!e)return;const t=h.decodeJwt(e)?.data,n=t?.data?.scope??t?.scope;return(Array.isArray(n)?n.flatMap(o=>typeof o=="string"?o.split(/\s+/):[]):typeof n=="string"?n.split(/\s+/):[]).find(o=>/^project_\d+$/.test(o))?.replace(/^project_/,"")||void 0}var Xy={AiApi:new Set(["sendMessage","getDialog"]),imageApi:new Set(["sendAiImageRequest","getAiImage","getAiImageSSE"])};function Jy(e){return r.getAppConfig(h.getContainer(e))}function Zy(e){return e?.backendProxy!==void 0&&e?.backendProxyPolicy?.proxyAi===!0}function e_(e){return Zy(Jy(e))}function t_(e,t,n,o){return Xy[t]?.has(n)?i=>e_(e)?a=>a(i):o(i):o}function n_(e){const t=at(e);return((n,o)=>{if(!n||typeof n.reducerPath!="string")return new h.Disposable;const i=Object.fromEntries(Object.entries(o??{}).map(([a,c])=>[a,typeof c=="function"?t_(e,n.reducerPath,a,c):c]));return t(n,i)})}function r_(e){const t=`blocks_${h.generateUUID().replaceAll("-","")}`,n=document.createElement("script");return n.type="text/javascript",n.text=`window.${t}(function(module, exports, require) { ${e}; })`,new Promise((o,i)=>{window[t]=function(a){const c={exports:{}},d=()=>{};a(c,c.exports,d),o(c.exports)},document.head.appendChild(n)}).finally(()=>{n.remove(),delete window[t]})}async function vs(e){const t=h.getContainer(e),n=t?.getInstance(h.STANDALONE_PROJECT_ID),o=n?void 0:await t?.getInstanceAsync(h.APP_ID).catch(()=>{}),i=n||(o?.project!==void 0?String(o.project):void 0);i&&t&&r.setCurrentProjectCard(t,Po(i))}async function o_(e,t){try{const n=function(d){const u=e.getInstance(h.STANDALONE_PROJECT_ID),m=u?_s(u,d):d;e.injectFactory(h.APP_ID,async()=>m)},o=n_(e),i=await r.readZipFromBase64(t),a=i.key&&r.zipEntryToText(i.key);if(typeof a!="string")return;const c=await r_(a);if(typeof c!="object"||c===null||typeof c.execute!="function")return;c.execute(n,o,jo())}catch{}}async function Es(e,t){Ky(h.getContainer(e)),await o_(h.getContainer(e),t),hs(h.getContainer(e),bs)}var i_=zn(async e=>{const t=my(e);e.inject(h.STORE_ID,t),py(e,jo()),yy(e,t),r.getDisposable(e).addDisposable(hy(e,t)),r.getDisposable(e).addDisposable(fy(e,t));const n=h.getContainer(t);n&&(e.inject(h.MESSAGE_SERVICE_ID,r.getMessageService(n)),e.inject(r.CURRENT_PROJECT_ID,r.provideCurrentProject(n)));const o=e.getInstance(h.SECURITY_MODULE_ID);return o?(await Es(t,o),await vs(t)):hs(h.getContainer(t),bs),{instance:{}}}),Ss=["historyEnabled","commentsEnabled","aiAssistentEnabled","livePreviewEnabled","sendTestEnabled","sharePreviewEnabled","webversionEnabled","optimizeSpamAssassinEnabled","exportWebHookEnabled","aiLayoutConverterEnabled","elementAIimageEnabled","elementAItextEnabled","revisionService"];function a_(e){const t={...e};for(const n of Ss)t[n]=!1;return t}function s_(e){const t={...e};for(const n of Ss)n in t&&typeof t[n]=="boolean"&&(t[n]=!1);return t}function l_(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,o]of Object.entries(e))!o||typeof o!="object"||Array.isArray(o)||(t[n]=s_(o));return Object.keys(t).length>0?t:void 0}function Lo(e){const t=a_(e),n=l_(e.advancedConfigs),o={...t};return n?o.advancedConfigs=n:delete o.advancedConfigs,o}var Z0=1,c_=2592e6;function ws(){return"emailmaker".trim()||void 0}function d_(e){return{schemaVersion:1,savedAt:Date.now(),project:e.project,app_id:e.app_id,app_config:Lo(Cs(e.app_config))}}function ks(e){return{...e,app_config:Cs(e.app_config)}}function Cs(e){if(!e||typeof e!="object"||Array.isArray(e))return{};try{if(typeof structuredClone=="function")return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return{}}}async function u_(e){const t=ws();t&&await __(t,d_(e))}async function m_(e=Date.now()){const t=ws();if(t)return b_(t,e)}function p_(e,t=Date.now()){return e.savedAt>t?!1:t-e.savedAt<=c_}function Ts(e){if(!e||typeof e!="object")return!1;const t=e,n=typeof t.project=="number"&&Number.isFinite(t.project)||typeof t.project=="string"&&t.project.trim()!=="";return t.schemaVersion===1&&typeof t.savedAt=="number"&&Number.isFinite(t.savedAt)&&n&&typeof t.app_id=="number"&&Number.isFinite(t.app_id)&&t.app_config!=null&&typeof t.app_config=="object"&&!Array.isArray(t.app_config)}var Ot="snapshots",f_=1;function h_(){return`${"emailmaker".trim()||"plugin"}-plugin-deferred-config`}function Mr(){return new Promise((e,t)=>{if(typeof indexedDB>"u"){t(new Error("indexedDB is not available"));return}const n=indexedDB.open(h_(),f_);n.onerror=()=>t(n.error||new Error("indexedDB open failed")),n.onupgradeneeded=()=>{const o=n.result;o.objectStoreNames.contains(Ot)||o.createObjectStore(Ot)},n.onsuccess=()=>e(n.result)})}function g_(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error||new Error("indexedDB request failed"))})}function y_(){return{async get(e){const t=await Mr();try{const n=await g_(t.transaction(Ot,"readonly").objectStore(Ot).get(e));return n===void 0?void 0:n}finally{t.close()}},async put(e,t){const n=await Mr();try{const o=n.transaction(Ot,"readwrite");o.objectStore(Ot).put(t,e),await new Promise((i,a)=>{o.oncomplete=()=>i(),o.onerror=()=>a(o.error||new Error("indexedDB write failed")),o.onabort=()=>a(o.error||new Error("indexedDB write aborted"))})}finally{n.close()}},async delete(e){const t=await Mr();try{const n=t.transaction(Ot,"readwrite");n.objectStore(Ot).delete(e),await new Promise((o,i)=>{n.oncomplete=()=>o(),n.onerror=()=>i(n.error||new Error("indexedDB delete failed")),n.onabort=()=>i(n.error||new Error("indexedDB delete aborted"))})}finally{t.close()}},async clear(){const e=await Mr();try{const t=e.transaction(Ot,"readwrite");t.objectStore(Ot).clear(),await new Promise((n,o)=>{t.oncomplete=()=>n(),t.onerror=()=>o(t.error||new Error("indexedDB clear failed")),t.onabort=()=>o(t.error||new Error("indexedDB clear aborted"))})}finally{e.close()}}}}var Is,Oo;function Mo(){return Is||(Oo||(Oo=y_()),Oo)}function As(e){Mo().delete(e).catch(()=>{})}async function __(e,t){if(Ts(t))try{await Mo().put(e,ks(t))}catch{}}async function b_(e,t=Date.now()){try{const n=await Mo().get(e);if(n===void 0)return;if(!Ts(n)){As(e);return}if(!p_(n,t)){As(e);return}return ks(n)}catch{return}}function v_(e,t){if(e.getInstance(h.STANDALONE_FILE_PROXY_REGISTERED_ID))return;e.inject(h.STANDALONE_FILE_PROXY_REGISTERED_ID,!0);const n=h.getEvent(e,h.events.FILE_PROXY_EVENT_ID);t.addDisposable(n(async({url:o})=>(await fetch(o)).blob(),Number.MIN_VALUE))}function xs(e){try{return Qy(e)||void 0}catch{return}}async function E_(e,t,n){if(!e)return;let o;try{const i=await e(t,n,void 0);o=String(i||"").trim()}catch{return}if(o)return{token:o,serverProjectId:xs(o)}}function S_(e){if(e==null)return;const t=String(e).trim();return/^\d+$/.test(t)?t:void 0}function w_(e){const t=String(e.getInstance(h.JWT_TOKEN_ID)||"").trim();if(t)return xs(t)}function Ps(e,t,n){e.inject(h.APP_ID,void 0),e.inject(h.APP_ID,Promise.resolve(_s(t,n)))}function k_(e){return{app_id:e.app_id,app_config:Lo(e.app_config)}}async function Rs(){const e=await m_();return e?k_(e):{app_config:Lo({})}}function C_(e,t){e.getInstance(h.STANDALONE_ACTIVATED_ID)||(e.inject(h.SECURITY_MODULE_ID,void 0),e.inject(h.STANDALONE_BOOTSTRAP_TOKEN_ID,void 0),e.inject(h.STANDALONE_PROJECT_ID,void 0),t&&e.inject(h.APP_ID,void 0),e.inject(h.STANDALONE_FILE_PROXY_REGISTERED_ID,void 0))}async function js(e){const{container:t,store:n,standaloneKey:o,project:i,reason:a,getAuthToken:c,user:d}=e,u=e.disposable||t.getInstance(h.DISPOSABLE_ID);if(t.getInstance(h.STANDALONE_ACTIVATED_ID))return;const m=await E_(c,d,i),f=S_(i),g=m?.serverProjectId??w_(t)??(m?void 0:f);t.inject(h.SECURITY_MODULE_ID,o);let _=!1;try{if(m&&(t.inject(h.STANDALONE_BOOTSTRAP_TOKEN_ID,Promise.resolve(m.token)),c&&h.recreateTokenProvider(t,c,d,i)),g){const p=await Rs();t.inject(h.STANDALONE_PROJECT_ID,g),Ps(t,g,p),_=!0,r.setCurrentProjectCard(t,Po(g))}if(await Es(n,o),_=!0,!g){await vs(n);const p=t.getInstance(h.STANDALONE_PROJECT_ID);if(p)Ps(t,p,await Rs()),_=!0;else if(t.getInstance(h.APP_ID)!==void 0)try{(await t.getInstanceAsync(h.APP_ID))?.project==null}catch{}}u&&v_(t,u),t.inject(h.STANDALONE_ACTIVATED_ID,!0)}catch(p){throw C_(t,_),p}}async function T_(e,t,n,o){const i=o?.attemptTimeout??h.isFailoverEnabled(n),a=h.isFailoverEnabled(n)?h.getOrderedOriginCandidates(n):h.getOriginChain(n).length>0?[h.getActiveBaseUrl(n)]:[];if(a.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const c=e.startsWith("/")?e:`/${e}`;let d,u;for(let m=0;m<a.length;m++){const f=a[m],g=m===a.length-1,_=i?h.beginFailoverAttempt(t.signal):void 0;try{const p=await fetch(`${f}${c}`,{...t,..._?{signal:_.signal}:{}});if(!p.ok&&h.shouldFailoverResponse(p.status)){if(d=p,!g){h.reportOriginFailure(f,n);continue}break}return p.ok&&h.reportOriginSuccess(f,n),p}catch(p){const v=_?.timeoutError();if(!v&&!h.shouldFailoverError(p))throw p;u=v||p,g||h.reportOriginFailure(f,n)}finally{_?.done()}}if(h.isFailoverEnabled(n)&&h.abandonStickyOrigin(),d)return d;throw u instanceof Error?u:new Error("[apiOriginFailover] fetch chain failed")}function I_(e,t){const n=String(t.baseUrl||"").trim();if(n)return h.resolveExplicitApiBaseUrl(n);const o=e.getInstance(h.REST_CLIENT_FACTORY_ID),i=String(o?.getOptions()?.baseUrl||"").trim();return h.resolveExplicitApiBaseUrl(i||void 0)}async function A_(e,t){if(t.getAuthToken)try{const n=await t.getAuthToken(t.user,t.project,void 0);if(String(n||"").trim())return!0}catch{if(!t.jwtAuth)return!1}if(t.jwtAuth)try{if(String(e.getInstance(h.JWT_TOKEN_ID)||"").trim())return!0;const n=I_(e,t);if(!n)return!1;const o=await T_("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.jwtAuth)},n,{attemptTimeout:!0});if(!o.ok)return!1;const i=await o.json();return i.token?(e.inject(h.JWT_ERROR_ID,void 0),e.inject(h.JWT_TOKEN_ID,i.token),!0):!1}catch{return!1}return!1}async function x_(e){try{if(e.getInstance(h.APP_ID)===void 0)return!1;const t=await R_(e.getInstanceAsync(h.APP_ID));return t!=null&&t.project!=null?t:!1}catch{return!1}}function P_(){return h.getFailoverAttemptTimeoutMs()*Math.max(1,h.getOriginChain().length)}function R_(e){const t=P_();return new Promise((n,o)=>{const i=setTimeout(()=>{n(void 0)},t);e.then(a=>{clearTimeout(i),n(a)},a=>{clearTimeout(i),o(a)})})}function Ls(e){return String(e.standaloneKey||"").trim()||void 0}function j_(e){return e.standaloneOnAuthFailure===!0?!0:e.config?.standaloneOnAuthFailure===!0}function L_(e){return j_(e)?!!Ls(e):!1}var O_=zn(async e=>{const t=e.getInstance(h.DISPOSABLE_ID),n=()=>e.getInstanceAsync(h.STORE_ID);return{async setOptions(o){if(!L_(o)){e.getInstance(h.STANDALONE_ACTIVATED_ID);return}const i=Ls(o);if(!i||e.getInstance(h.STANDALONE_ACTIVATED_ID))return;const a=await n(),c=!!(o.getAuthToken||o.jwtAuth),d=c?await A_(e,o):!0;if(c&&!d){await js({container:e,store:a,standaloneKey:i,project:o.project,getAuthToken:o.getAuthToken,user:o.user,disposable:t,reason:"auth pipeline failed"});return}const u=await x_(e);if(u){await u_(u).catch(()=>{});return}await js({container:e,store:a,standaloneKey:i,project:o.project,getAuthToken:o.getAuthToken,user:o.user,disposable:t,reason:"app_init failed"})}}}),M_=h.defineMixin(e=>{let t;const n=r.getDisposable(e),o=h.getEvent(e,h.events.ON_DOCUMENT_SESSION_CHANGE);n.addDisposable(o(({history:a})=>{t=a}));const i=()=>t?r.fromHistory(t):void 0;return{instance:{undoRedoService:{undo:()=>i()?.undo(),redo:()=>i()?.redo(),clear:()=>i()?.clear(),getPast:a=>i()?.getPast(a)??[],getFuture:a=>i()?.getFuture(a)??[],canUndo:()=>i()?.canUndo()??!1,canRedo:()=>i()?.canRedo()??!1,createSnapshot:()=>i()?.createSnapshot(),restoreSnapshot:a=>i()?.restoreSnapshot(a)}}}});function N_(e){return{font_size:e.fontSize,font_family:e.fontFamily,tab_size:e.tabSize,word_wrap:e.wordWrap,minimap:e.minimap,insert_spaces:e.insertSpaces}}function D_(e){return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:e.wordWrap!=="off",minimap:e.minimap?.enabled,insertSpaces:e.insertSpaces}}async function Os(e){const t=r.getCurrentUser(e).profile;if(t)return t;const n=e.getInstance(h.STORE_ID);if(n)return(await n.dispatch(r.authorizationApi.endpoints.getMe.initiate("",{forceRefetch:!0}))).data}function F_(e){const t=r.resolveTemplateDirectivesConfig(e);if(!(Object.keys(t.output).length>0||Object.keys(t.editor).length>0))return ya();const n=new Set(Object.keys(t.output).filter(i=>t.output[i]==="html-comment")),o=new Set(Object.keys(t.output));return{isConfigured:()=>!0,toEditorForm:i=>r.mapper.normalizeToPolicy(i,t.editor),toOutputForm:i=>r.mapper.normalizeToPolicy(i,t.output),keepWrappedOnOutput:n,editorPolicy:t.editor,warnAboutUnconfiguredInput:ga(o)}}function Ms(e){const t=r.getCodeMode(e);return{...Nr(e),editor:D_(r.getEditorOptions(e)),codeModeDirection:t.isCodeMode?t.direction:"none"}}function Nr(e){return e.getInstance(h.CONFIG_SOURCE_ID)?.get()??{}}function No(e){return e.getInstance(h.CONFIG_SOURCE_ID)?.layers()??{base:{},profile:{},serverSide:{},user:{},local:{},advancedConfigs:{}}}var B_=yo(e=>{const t=r.getDisposable(e),n=Ct(r.getEvent(e,h.events.ON_LIMIT_ID)),o=t.addDisposable(new kt(n)),i=Ct(r.getEvent(e,h.events.READ_LOCALE)),a=t.addDisposable(new kt(i)),c=Ct(r.getEvent(e,h.events.ON_TRANSLATE_ID)),d=t.addDisposable(new kt(c)),u=r.getEmitter(e,h.CONFIG_CHANGED_EVENT_ID),m=e.getInstance(h.CONFIG_SOURCE_ID)?.select(D=>D.revisionService===!0).watch(D=>r.getRevisionServiceFlag(e).set(D));m&&t.addDisposable(m);const f=async()=>{try{return e.getInstance(h.APP_ID)===void 0?{}:(await e.getInstanceAsync(h.APP_ID))?.app_config||{}}catch{return{}}},g=Wa(),_=Wa();let p,v=!1,C;const k=async()=>{const D=Ms(e);if(!v){C=h.deepClone(D),v=!0;return}C!==void 0&&h.deepEqual(C,D)||(C=h.deepClone(D),await u.fire(D))},S=D=>{if(typeof D=="number")return String(D);if(typeof D=="string")return D},I=D=>{if(D!==void 0){const O=r.provideCurrentProject(e);O.set({...O.get(),requested:String(D)})}},A=async(D,O)=>{if(!D){const pe=await Os(e);return p=S(pe?.id),{didReset:!1}}const $=await Os(e),de=D.id!==void 0?S(D.id):S($?.id),ue=p!==void 0?String(p):void 0,z=de!==void 0?String(de):void 0,ie=ue!==void 0&&z!==void 0&&ue!==z,je={...$,...r.filterUndefined(D),id:de};if(D.id===void 0&&!$?.id&&delete je.id,r.provideCurrentUser(e).set({profile:je}),ie&&O){const pe=e.getInstance(h.INSTANCE_ID);if(pe?.reset)return await pe.reset(O),{didReset:!0}}return p=z,{didReset:!1}},Y=D=>{const O=e.getInstance(h.CONFIG_SOURCE_ID);O?.setAdvancedConfigs({...D.advancedConfigs,...D.user?.advancedConfigs}),O?.replace(D.user,"user"),O?.replace(D.serverSide,"server")};let ee;const j=async({onlyChangedCodeMode:D=!1}={})=>{await e.getInstance(h.CONFIG_SOURCE_ID)?.ready(),r.getRevisionServiceFlag(e).set(Nr(e).revisionService===!0);const{codeModeDirection:O,editor:$}=Nr(e);$&&r.applyEditorOptions(e,N_($)),O!==void 0&&!(D&&O===ee)&&(ee=O,O==="none"?r.setCodeMode$1(e,!1):(r.setCodeMode$1(e,!0),r.setCodeModeDirection(e,O)))},R=async D=>{Y(D),await j()};let N;const B=g.decorate(async({config:D={},project:O,user:$,advancedConfigs:de},ue)=>{e.getInstance(h.CONFIG_SOURCE_ID)?.replace(await f(),"server"),await j({onlyChangedCodeMode:!0}),e.inject(h.TEMPLATE_DIRECTIVES_ID,F_(Nr(e).templateDirectives)),I(O),ue&&"commonStyles"in ue&&r.setDefaultCommonStyles(e,ue.commonStyles===void 0?void 0:ue.commonStyles);const{didReset:z}=await A($,ue)});return{setOptions:_.decorate(async D=>{const{config:O={},project:$,user:de,advancedConfigs:ue,handleReadLocale:z,handleLimitUsage:ie,handleTranslate:je,storageProvider:pe}=D;e.inject(h.STORAGE_PROVIDER_ID,pe),a.setListener(z),o.setListener(ie),d.setListener(je),await B({config:O,project:$,user:de,advancedConfigs:ue},D).catch(Qe=>{}),await k(),N&&N.dispose(),N=new h.Disposable}),instance:{setConfig:_.decorate(async D=>{const O=D,{commonStyles:$,...de}=O;"commonStyles"in O&&r.setDefaultCommonStyles(e,$===void 0?void 0:$),await R({advancedConfigs:No(e).advancedConfigs,serverSide:await f(),user:de}),await k()}),getConfig:()=>Ms(e),updateConfig:_.decorate(async D=>{const O=D,{commonStyles:$,...de}=O;"commonStyles"in O&&r.setDefaultCommonStyles(e,$===void 0?void 0:$),await R({advancedConfigs:No(e).advancedConfigs,serverSide:await f(),user:{...No(e).user,...de}}),await k()}),handleReadLocale:i,handleLimitUsage:n,handleTranslate:c}}}),Dr;function Do(){return Dr===void 0&&(Dr=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/3b8b6bb0.js")),void 0,{}.url).catch(e=>{throw Dr=void 0,e})),Dr}var Ns;function U_(){return Ns??=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/370f04c3.js")).then(e=>Gt.__toESM(e.require_core())),void 0,{}.url),Ns}function $_(e){const t=[0],n=[];let o=0;for(;o<e.length;){const i=e.charCodeAt(o);i===10||i===13?(n.push(o-t[t.length-1]),o+=i===13&&e.charCodeAt(o+1)===10?2:1,t.push(o)):o+=1}return n.push(e.length-t[t.length-1]),{starts:t,lengths:n}}function Ds({starts:e,lengths:t},n,o){const i=Math.min(Math.max(n,1),e.length)-1;return e[i]+Math.min(Math.max(o,1),t[i]+1)-1}var G_={error:8,warning:4,info:2};function z_(e,t){const n=e.evidence!==""?e.col+e.evidence.length:t.lengths[e.line-1]??e.col+1;return{severity:G_[e.type]??8,message:e.message,startLineNumber:e.line,startColumn:e.col,endLineNumber:e.line,endColumn:n,startOffset:Ds(t,e.line,e.col),endOffset:Ds(t,e.line,n)}}async function W_(e){const{HTMLHint:t}=await U_(),n=$_(e);return t.verify(e,r.EMAIL_CODE_RULESET).map(o=>z_(o,n))}var H_=class extends h.Disposable{_container;_dataSources;_currentEmail;_blockMetaWrites=Promise.resolve();constructor(e){super(),this._container=e,this._dataSources=r.getDataSources(e),this.addDisposable(h.getEvent(e,h.events.ON_EMAIL_CHANGED_ID)(t=>{this._currentEmail=t}))}async getBlocks(){const e=await this._readProjectBlocks();return await this._blockMetaWrites,(await this._dataSources.blocks.cache.values()).filter(t=>String(t.project)===String(e)).map(t=>ig(t,this._container))}async _readProjectBlocks(){const e=await r.getBlocksProject(this._container);return await this._dataSources.blocks.byForeignKey("project").get(e),e}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.post===t.id).map(n=>ag(n,this._container))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.parent===t.id).map(n=>sg(n,this._container))}async getEmailSnapshot(){return lp(r.getOpenEmail(this._container,this._currentEmail),this._container)}async getEmail(e=!0){return this.compile(e)}async compileEmail(e=!0){return this.compile(e)}async compile(e){const{compileEmail:t}=await Do();return t(await this.getEmailSnapshot(),e,ln(this._container).keepWrappedOnOutput)}setEmailMeta(e){const t=r.getOpenDocument(this._container);if(!t)return;const n=t.get().attributes.meta;r.writeEmailAttributes(t,{meta:r.applyMetaPatch({meta:n},e).meta});const o=t.get().serverId;o!=null&&this._dataSources.emails.cache.addOrUpdate(o,i=>i&&r.applyMetaPatch(i,e))}setBlockMeta(e,t){const n=async()=>{await this._readProjectBlocks();const{cache:o}=this._dataSources.blocks;await o.getIfPresent(e)&&await o.addOrUpdate(e,i=>i&&r.applyMetaPatch(i,t))};this._blockMetaWrites=this._blockMetaWrites.then(n).catch(()=>{})}getCodeErrors(){const e=r.getCodeErrors(this._container);return e.length>0?e:void 0}validateCode(){return Promise.resolve(W_(r.getOpenEmail(this._container,this._currentEmail).html??""))}};function Fs(){Do().catch(()=>{})}function q_(e){const t=r.provideHeadlessMode(e).watch(n=>{n&&Fs()});e.getInstance(h.DISPOSABLE_ID)?.addDisposable(t),Wt(e).whenVisible(()=>{Jt(Fs)})}var V_=h.createIdentifier$1("EmailOperationsController");function Bs(e){return e.getOrCreateInstance(V_,()=>{const t=new H_(e);return e.getInstance(h.DISPOSABLE_ID)?.addDisposable(t),t})}function Y_(e){Bs(e),q_(e)}function K_(e){const t=Bs(e);return{getEmailSnapshot:()=>t.getEmailSnapshot(),getEmail:()=>t.getEmail(),async compileEmail(n,o=!0){if(!n)return t.compileEmail(o);const{compileEmail:i}=await Do();return i(n,o,ln(e).keepWrappedOnOutput)},validateCode:()=>t.validateCode(),getCodeErrors:()=>t.getCodeErrors(),getBlocks:()=>t.getBlocks(),getComments:()=>t.getComments(),getEmailRevisions:()=>t.getEmailRevisions(),setEmailMeta:n=>t.setEmailMeta(n),setBlockMeta:(n,o)=>t.setBlockMeta(n,o)}}var Q_=h.defineMixin(e=>{const t=e.getInstance(h.DISPOSABLE_ID),n=h.getEvent(e,h.events.UPLOAD_EVENT_ID),o=h.getEvent(e,h.events.FILE_PROXY_EVENT_ID),i=h.getEmitter(e,h.events.PROXY_URL_EVENT_ID).event,a=Ct(n),c=Ct(i),d=Ct(o),u=t.addDisposable(new kt(a)),m=t.addDisposable(new kt(d)),f=t.addDisposable(new kt(c));return{setOptions(g){u.setListener(g.handleLoadImage),m.setListener(g.handleFileProxy),f.setListener(g.handleUrlProxy)},instance:{handleLoadImage:a,handleFileProxy:d,handleUrlProxy:c}}}),X_=h.defineMixin(e=>{const t=e.getInstance(h.DISPOSABLE_ID),n=h.getEvent(e,h.events.AI_TEXT_REQUEST_ID),o=h.getEvent(e,h.events.AI_IMAGE_REQUEST_ID),i=Ct(n),a=Ct(o),c=t.addDisposable(new kt(i)),d=t.addDisposable(new kt(a));return{setOptions(u){c.setListener(u.handleAITextRequest),d.setListener(u.handleAIImageRequest)},instance:{handleAITextRequest:i,handleAIImageRequest:a}}}),J_=class extends Error{cycle;constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),this.cycle=e}};function Z_(e){const t=new Map;for(const n of e)for(const o of n.provides??[]){const i=t.get(o)??[];i.push(n),t.set(o,i)}return t}function eb(e,t){const n=[];for(const o of e.awaits?.services??[])for(const i of t.get(o)??[])i!==e&&n.push(i);return n}function tb(e){const t=Z_(e),n=[],o=new Set,i=[],a=new Set,c=d=>{if(!o.has(d)){if(a.has(d)){const u=i.indexOf(d);throw new J_([...i.slice(u),d].map(m=>m.name))}a.add(d),i.push(d);for(const u of eb(d,t))c(u);i.pop(),a.delete(d),o.add(d),n.push(d)}};for(const d of e)c(d);return n}var nb="author,slug,date,modified,title,acf.html,id,parent,date_gmt",rb="author,slug,date,modified,modified_gmt,title,acf.html,id,parent",ob=20,Fo=[h.WpEblockApi];function Us(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function ib(e){return{async readRevisions(t,n=1){const o=await h.getApi(e,Fo).eblock_revisions_list({parent:t,per_page:ob,page:n},{extraQuery:{_fields:nb}}),i=(o?.data??[]).map(c=>r.WpBlockRevisionToBlockRevision(c)),a=Number(o?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=h.getApi(e,Fo),[o,i]=await Promise.all([n.eblock_autosaves_list({id:t},{extraQuery:{_fields:rb}}),n.eblock_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(o?.data??[]).map(d=>{const u=d,m=r.WpBlockRevisionToBlockRevision(u),f=Us(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Us(i?.data?.modified_gmt)??"");return r.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const o=n,i=o.global_block&&o.html?r.injectEmBlockIdIntoBlockHtml(o.html,t):o.html??"";r.writePendingData(t,{sentAt:Date.now(),html:i,common_styles:""});const a=await h.getApi(e,Fo).eblock_autosaves_create({id:t},r.BlockAutoSaveToWpBlockAutoSave({title:o.title,html:i,project:o.project,excerpt:new Date().toISOString()}),{type:h.ContentType.FormData});return r.WpBlockRevisionToBlockRevision(a?.data)}}}var ab="author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt",sb="author,slug,date,modified,modified_gmt,title,meta,acf.html,acf.common_styles,id,parent";function $s(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}var lb=20,Bo=[h.WpEmailApi];function cb(e){return{async readRevisions(t,n=1){const o=await h.getApi(e,Bo).email_revisions_list({parent:t,per_page:lb,page:n},{extraQuery:{_fields:ab}}),i=(o?.data??[]).map(c=>r.WpEmailRevisionToEmailRevision(c)),a=Number(o?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=h.getApi(e,Bo),[o,i]=await Promise.all([n.email_autosaves_list({id:t},{extraQuery:{_fields:sb}}),n.email_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(o?.data??[]).map(d=>{const u=d,m=r.WpEmailRevisionToEmailRevision(u),f=$s(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse($s(i?.data?.modified_gmt)??"");return r.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const o=await h.getApi(e,Bo).email_autosaves_create({id:t},r.EmailAutoSaveToWpEmailAutoSave({...n,excerpt:new Date().toISOString()}),{type:h.ContentType.FormData});return r.WpEmailRevisionToEmailRevision(o?.data)}}}function db(e){return e&&typeof e=="object"&&"data"in e?e.data:e}function ub(e){const t=e?.message;return typeof t=="string"&&t.trim()?t:void 0}var Gs=class extends Error{status;data;constructor(e,t,n=ub(t)??""){super(n),this.name="EmailSaveFailedError",this.status=e,this.data=t}};function zs(e){return e?new Gs(e.status,db(e.error)):new Gs(void 0,void 0,"network: no response")}var Ws=["_embedded","id","author","title","meta","emailtags","folder","group","modified","date","type","parent","date_gmt","acf.description","acf.html","acf.common_styles","acf.is_template","acf.lock","acf.parent_email","acf.project","acf.secret_hash","acf.subject","acf.utm_parameters"].join(","),Uo=[h.WpEmailApi],Hs=e=>r.EmailToWpEmail(e);function mb(e){return{async readEmail(t){const n=await h.getApi(e,Uo).email_detail({id:r.toNumberSafe(t)},{extraQuery:{_embed:"wp:term",_fields:Ws}});if(!n)throw new r.EmailOpenFailedError("unavailable");if(n.ok===!1)throw r.openFailureFromResponse(n);return n.data?r.WpEmailToEmail(n.data):null},async createEmail(t){const n={status:"publish",...Hs(t)},o=await h.getApi(e,Uo).email_create(n,{type:h.ContentType.Json});if(!o?.data||o.ok===!1)throw zs(o);return r.WpEmailToEmail(o.data)},async updateEmail(t,n){const o=await h.getApi(e,Uo).email_partial_update({id:t},Hs(n),{type:h.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:Ws}});if(!o?.data||o.ok===!1)throw zs(o);return r.WpEmailToEmail(o.data)}}}function pb(e){r.injectRestEmailPortFactories(e,{email:mb,history:cb,blockHistory:ib})}var $o=20,fb=({source:e,emailtags:t,group:n,tags:o,...i})=>i;function hb({revisions:e,revisionsByBlock:t}){const n=async(o,i)=>(t.clear(),await t.get(o,{page:i}),(await e.cache.values()??[]).filter(a=>String(a?.parent)===String(o)));return{async readRevisions(o,i=1){const a=await n(o,i);return{revisions:a.slice($o*(i-1),$o*i),page:i,hasMore:a.length>$o*i}},async readAutosave(o){return r.autosaveStateFromRevisions(await n(o,1))},async saveAutosave(o,i){const a=fb(i);return await e.create({...a,parent:o,isAutosave:!0,modified:new Date().toString()})}}}var qs=h.createIdentifier$1("blockDocuments.provided");function gb(e){if(e.getInstance(qs))return;e.inject(qs,!0);const t=r.blockRevisionsDataSourceProvider(e);r.injectBlockHistoryPort(e,hb({revisions:t,revisionsByBlock:t.byForeignKey("parent")}))}var yb=Gt.__commonJSMin(((e,t)=>{(function(n){if(typeof window>"u")return;var o=0,i,a=!1,c=!1,d=7,u="[iFrameSizer]",m=u.length,f=null,g=window.requestAnimationFrame,_=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),p={},v=null,C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){B("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function k(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function S(T,w,x){T.addEventListener(w,x,!1)}function I(T,w,x){T.removeEventListener(w,x,!1)}function A(){for(var T=["moz","webkit","o","ms"],w=0;w<T.length&&!g;w+=1)g=window[T[w]+"RequestAnimationFrame"];g?g=g.bind(window):R("setup","RequestAnimationFrame not supported")}function Y(T){var w="Host page: "+T;return window.top!==window.self&&(w=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+T:"Nested host page: "+T),w}function ee(T){return u+"["+Y(T)+"]"}function j(T){return p[T]?p[T].log:a}function R(T,w){D("log",T,w,j(T))}function N(T,w){D("info",T,w,j(T))}function B(T,w){D("warn",T,w,!0)}function D(T,w,x,L){L===!0&&window.console}function O(T){function w(){function G(){Qe(ae),ie(ne),ot("onResized",ae)}b("Height"),b("Width"),be(G,ae,"init")}function x(){var G=Ve.slice(m).split(":"),ce=G[1]?parseInt(G[1],10):0,Re=p[G[0]]&&p[G[0]].iframe,ve=getComputedStyle(Re);return{iframe:Re,id:G[0],height:ce+L(ve)+F(ve),width:G[2],type:G[3]}}function L(G){return G.boxSizing!=="border-box"?0:(G.paddingTop?parseInt(G.paddingTop,10):0)+(G.paddingBottom?parseInt(G.paddingBottom,10):0)}function F(G){return G.boxSizing!=="border-box"?0:(G.borderTopWidth?parseInt(G.borderTopWidth,10):0)+(G.borderBottomWidth?parseInt(G.borderBottomWidth,10):0)}function b(G){var ce=Number(p[ne]["max"+G]),Re=Number(p[ne]["min"+G]),ve=G.toLowerCase(),De=Number(ae[ve]);R(ne,"Checking "+ve+" is in range "+Re+"-"+ce),De<Re&&(De=Re,R(ne,"Set "+ve+" to min value")),De>ce&&(De=ce,R(ne,"Set "+ve+" to max value")),ae[ve]=""+De}function H(){function G(){function ve(){var Je=0,Oe=!1;for(R(ne,"Checking connection is from allowed list of origins: "+Re);Je<Re.length;Je++)if(Re[Je]===ce){Oe=!0;break}return Oe}function De(){var Je=p[ne]&&p[ne].remoteHost;return R(ne,"Checking connection is from: "+Je),ce===Je}return Re.constructor===Array?ve():De()}var ce=T.origin,Re=p[ne]&&p[ne].checkOrigin;if(Re&&""+ce!="null"&&!G())throw new Error("Unexpected message received from: "+ce+" for "+ae.iframe.id+". Message was: "+T.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Le(){return u===(""+Ve).slice(0,m)&&Ve.slice(m).split(":")[0]in p}function Pe(){var G=ae.type in{true:1,false:1,undefined:1};return G&&R(ne,"Ignoring init message from meta parent page"),G}function qe(G){return Ve.slice(Ve.indexOf(":")+d+G)}function We(G){R(ne,"onMessage passed: {iframe: "+ae.iframe.id+", message: "+G+"}"),ot("onMessage",{iframe:ae.iframe,message:JSON.parse(G)}),R(ne,"--")}function Xe(){var G=document.body.getBoundingClientRect(),ce=ae.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:ce.height,iframeWidth:ce.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(ce.top-G.top,10),offsetLeft:parseInt(ce.left-G.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function mt(G,ce){function Re(){ge("Send Page Info","pageInfo:"+Xe(),G,ce)}Te(Re,32,ce)}function _t(){function G(De,Je){function Oe(){p[ve]?mt(p[ve].iframe,ve):ce()}["scroll","resize"].forEach(function(tt){R(ve,De+tt+" listener for sendPageInfo"),Je(window,tt,Oe)})}function ce(){G("Remove ",I)}function Re(){G("Add ",S)}var ve=ne;Re(),p[ve]&&(p[ve].stopPageInfo=ce)}function bt(){p[ne]&&p[ne].stopPageInfo&&(p[ne].stopPageInfo(),delete p[ne].stopPageInfo)}function pt(){var G=!0;return ae.iframe===null&&(B(ne,"IFrame ("+ae.id+") not found"),G=!1),G}function W(G){var ce=G.getBoundingClientRect();return z(ne),{x:Math.floor(Number(ce.left)+Number(f.x)),y:Math.floor(Number(ce.top)+Number(f.y))}}function J(G){function ce(){f=Je,Z(),R(ne,"--")}function Re(){return{x:Number(ae.width)+De.x,y:Number(ae.height)+De.y}}function ve(){window.parentIFrame?window.parentIFrame["scrollTo"+(G?"Offset":"")](Je.x,Je.y):B(ne,"Unable to scroll to requested position, window.parentIFrame not found")}var De=G?W(ae.iframe):{x:0,y:0},Je=Re();R(ne,"Reposition requested from iFrame (offset x:"+De.x+" y:"+De.y+")"),window.top===window.self?ce():ve()}function Z(){ot("onScroll",f)===!1?je():ie(ne)}function fe(G){function ce(){var Oe=W(Je);R(ne,"Moving to in page link (#"+ve+") at x: "+Oe.x+" y: "+Oe.y),f={x:Oe.x,y:Oe.y},Z(),R(ne,"--")}function Re(){window.parentIFrame?window.parentIFrame.moveToAnchor(ve):R(ne,"In page link #"+ve+" not found and window.parentIFrame not found")}var ve=G.split("#")[1]||"",De=decodeURIComponent(ve),Je=document.getElementById(De)||document.getElementsByName(De)[0];Je?ce():window.top===window.self?R(ne,"In page link #"+ve+" not found"):Re()}function et(G){var ce={};if(Number(ae.width)===0&&Number(ae.height)===0){var Re=qe(9).split(":");ce={x:Re[1],y:Re[0]}}else ce={x:ae.width,y:ae.height};ot(G,{iframe:ae.iframe,screenX:Number(ce.x),screenY:Number(ce.y),type:ae.type})}function ot(G,ce){return $(ne,G,ce)}function me(){switch(p[ne]&&p[ne].firstRun&&Ne(),ae.type){case"close":ue(ae.iframe);break;case"message":We(qe(6));break;case"mouseenter":et("onMouseEnter");break;case"mouseleave":et("onMouseLeave");break;case"autoResize":p[ne].autoResize=JSON.parse(qe(9));break;case"scrollTo":J(!1);break;case"scrollToOffset":J(!0);break;case"pageInfo":mt(p[ne]&&p[ne].iframe,ne),_t();break;case"pageInfoStop":bt();break;case"inPageLink":fe(qe(9));break;case"reset":pe(ae);break;case"init":w(),ot("onInit",ae.iframe);break;default:Number(ae.width)===0&&Number(ae.height)===0?B("Unsupported message received ("+ae.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):w()}}function Me(G){var ce=!0;return p[G]||(ce=!1,B(ae.type+" No settings for "+G+". Message was: "+Ve)),ce}function Ut(){for(var G in p)ge("iFrame requested init",X(G),p[G].iframe,G)}function Ne(){p[ne]&&(p[ne].firstRun=!1)}var Ve=T.data,ae={},ne=null;Ve==="[iFrameResizerChild]Ready"?Ut():Le()?(ae=x(),ne=ae.id,p[ne]&&(p[ne].loaded=!0),!Pe()&&Me(ne)&&(R(ne,"Received: "+Ve),pt()&&H()&&me())):N(ne,"Ignored: "+Ve)}function $(T,w,x){var L=null,F=null;if(p[T])if(L=p[T][w],typeof L=="function")F=L(x);else throw new TypeError(w+" on iFrame["+T+"] is not a function");return F}function de(T){var w=T.id;delete p[w]}function ue(T){var w=T.id;if($(w,"onClose",w)===!1){R(w,"Close iframe cancelled by onClose event");return}R(w,"Removing iFrame: "+w);try{T.parentNode&&T.parentNode.removeChild(T)}catch(x){B(x)}$(w,"onClosed",w),R(w,"--"),de(T),i&&(i.disconnect(),i=null)}function z(T){f===null&&(f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset},R(T,"Get page position: "+f.x+","+f.y))}function ie(T){f!==null&&(window.scrollTo(f.x,f.y),R(T,"Set page position: "+f.x+","+f.y),je())}function je(){f=null}function pe(T){function w(){Qe(T),ge("reset","reset",T.iframe,T.id)}R(T.id,"Size reset requested by "+(T.type==="init"?"host page":"iFrame")),z(T.id),be(w,T,"reset")}function Qe(T){function w(b){if(!T.id){R("undefined","messageData id not set");return}T.iframe.style[b]=T[b]+"px",R(T.id,"IFrame ("+F+") "+b+" set to "+T[b]+"px")}function x(b){!c&&T[b]==="0"&&(c=!0,R(F,"Hidden iFrame detected, creating visibility listener"),Ue())}function L(b){w(b),x(b)}var F=T.iframe.id;p[F]&&(p[F].sizeHeight&&L("height"),p[F].sizeWidth&&L("width"))}function be(T,w,x){x!==w.type&&g&&!window.jasmine?(R(w.id,"Requesting animation frame"),g(T)):T()}function ge(T,w,x,L,F){function b(){var We=p[L]&&p[L].targetOrigin;R(L,"["+T+"] Sending msg to iframe["+L+"] ("+w+") targetOrigin: "+We),x.contentWindow.postMessage(u+w,We)}function H(){B(L,"["+T+"] IFrame("+L+") not found")}function Le(){x&&"contentWindow"in x&&x.contentWindow!==null?b():H()}function Pe(){function We(){p[L]&&!p[L].loaded&&!qe&&(qe=!0,B(L,"IFrame has not responded within "+p[L].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}F&&p[L]&&p[L].warningTimeout&&(p[L].msgTimeout=setTimeout(We,p[L].warningTimeout))}var qe=!1;L=L||x.id,p[L]&&(Le(),Pe())}function X(T){return T+":"+p[T].bodyMarginV1+":"+p[T].sizeWidth+":"+p[T].log+":"+p[T].interval+":"+p[T].enablePublicMethods+":"+p[T].autoResize+":"+p[T].bodyMargin+":"+p[T].heightCalculationMethod+":"+p[T].bodyBackground+":"+p[T].bodyPadding+":"+p[T].tolerance+":"+p[T].inPageLinks+":"+p[T].resizeFrom+":"+p[T].widthCalculationMethod+":"+p[T].mouseEvents}function he(T){return typeof T=="number"}function se(T,w){function x(){function J(fe){var et=p[W][fe];et!==1/0&&et!==0&&(T.style[fe]=he(et)?et+"px":et,R(W,"Set "+fe+" = "+T.style[fe]))}function Z(fe){if(p[W]["min"+fe]>p[W]["max"+fe])throw new Error("Value for min"+fe+" can not be greater than max"+fe)}Z("Height"),Z("Width"),J("maxHeight"),J("minHeight"),J("maxWidth"),J("minWidth")}function L(){var J=w&&w.id||C.id+o++;return document.getElementById(J)!==null&&(J+=o++),J}function F(J){if(typeof J!="string")throw new TypeError("Invaild id for iFrame. Expected String");return J===""&&(T.id=J=L(),a=(w||{}).log,R(J,"Added missing iframe ID: "+J+" ("+T.src+")")),J}function b(){switch(R(W,"IFrame scrolling "+(p[W]&&p[W].scrolling?"enabled":"disabled")+" for "+W),T.style.overflow=(p[W]&&p[W].scrolling)===!1?"hidden":"auto",p[W]&&p[W].scrolling){case"omit":break;case!0:T.scrolling="yes";break;case!1:T.scrolling="no";break;default:T.scrolling=p[W]?p[W].scrolling:"no"}}function H(){(typeof(p[W]&&p[W].bodyMargin)=="number"||(p[W]&&p[W].bodyMargin)==="0")&&(p[W].bodyMarginV1=p[W].bodyMargin,p[W].bodyMargin=""+p[W].bodyMargin+"px")}function Le(){var J=p[W]&&p[W].firstRun,Z=p[W]&&p[W].heightCalculationMethod in _;!J&&Z&&pe({iframe:T,height:0,width:0,type:"init"})}function Pe(){p[W]&&(p[W].iframe.iFrameResizer={close:ue.bind(null,p[W].iframe),removeListeners:de.bind(null,p[W].iframe),resize:ge.bind(null,"Window resize","resize",p[W].iframe),moveToAnchor:function(J){ge("Move to anchor","moveToAnchor:"+J,p[W].iframe,W)},sendMessage:function(J){J=JSON.stringify(J),ge("Send Message","message:"+J,p[W].iframe,W)}})}function qe(J){function Z(){ge("iFrame.onload",J,T,n,!0),Le()}function fe(ot){if(!T.parentNode)return null;var me=new ot(function(Me){Me.forEach(function(Ut){Array.prototype.slice.call(Ut.removedNodes).forEach(function(Ne){Ne===T&&ue(T)})})});return me.observe(T.parentNode,{childList:!0}),me}var et=k();et&&(i=fe(et)),S(T,"load",Z),ge("init",J,T,n,!0)}function We(J){if(typeof J!="object")throw new TypeError("Options is not an object")}function Xe(J){for(var Z in C)Object.prototype.hasOwnProperty.call(C,Z)&&(p[W][Z]=Object.prototype.hasOwnProperty.call(J,Z)?J[Z]:C[Z])}function mt(J){return J===""||J.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":J}function _t(J){var Z=J.split("Callback");if(Z.length===2){var fe="on"+Z[0].charAt(0).toUpperCase()+Z[0].slice(1);this[fe]=this[J],delete this[J],B(W,"Deprecated: '"+J+"' has been renamed '"+fe+"'. The old method will be removed in the next major version.")}}function bt(J){J=J||{},p[W]=Object.create(null),p[W].iframe=T,p[W].firstRun=!0,p[W].remoteHost=T.src&&T.src.split("/").slice(0,3).join("/"),We(J),Object.keys(J).forEach(_t,J),Xe(J),p[W]&&(p[W].targetOrigin=p[W].checkOrigin===!0?mt(p[W].remoteHost):"*")}function pt(){return W in p&&"iFrameResizer"in T}var W=F(T.id);pt()?B(W,"Ignored iFrame, already setup."):(bt(w),b(),x(),H(),qe(X(W)),Pe())}function le(T,w){v===null&&(v=setTimeout(function(){v=null,T()},w))}var Se={};function Te(T,w,x){Se[x]||(Se[x]=setTimeout(function(){Se[x]=null,T()},w))}function Ue(){function T(){function F(b){function H(Pe){return(p[b]&&p[b].iframe.style[Pe])==="0px"}function Le(Pe){return Pe.offsetParent!==null}p[b]&&Le(p[b].iframe)&&(H("height")||H("width"))&&ge("Visibility change","resize",p[b].iframe,b)}Object.keys(p).forEach(function(b){F(b)})}function w(F){R("window","Mutation observed: "+F[0].target+" "+F[0].type),le(T,16)}function x(){var F=document.querySelector("body");new L(w).observe(F,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}var L=k();L&&x()}function te(T){function w(){we("Window "+T,"resize")}R("window","Trigger event: "+T),le(w,16)}function ye(){function T(){we("Tab Visible","resize")}document.visibilityState!=="hidden"&&(R("document","Trigger event: Visibility change"),le(T,16))}function we(T,w){function x(L){return p[L]&&p[L].resizeFrom==="parent"&&p[L].autoResize&&!p[L].firstRun}Object.keys(p).forEach(function(L){x(L)&&ge(T,w,p[L].iframe,L)})}function ke(){S(window,"message",O),S(window,"resize",function(){te("resize")}),S(document,"visibilitychange",ye),S(document,"-webkit-visibilitychange",ye)}function Ie(){function T(L,F){function b(){if(F.tagName){if(F.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+F.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}F&&(b(),se(F,L),x.push(F))}function w(L){L&&L.enablePublicMethods&&B("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var x;return A(),ke(),function(F,b){switch(x=[],w(F),typeof b){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(b||"iframe"),T.bind(n,F));break;case"object":T(F,b);break;default:throw new TypeError("Unexpected data type ("+typeof b+")")}return x}}function rt(T){T.fn?T.fn.iFrameResize||(T.fn.iFrameResize=function(x){function L(F,b){se(b,x)}return this.filter("iframe").each(L).end()}):N("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==n&&rt(window.jQuery),typeof define=="function"&&define.amd?define([],Ie):typeof t=="object"&&typeof t.exports=="object"&&(t.exports=Ie()),window.iFrameResize=window.iFrameResize||Ie()})()})),_b=Gt.__toESM(yb()),bb={checkOrigin:!1,minHeight:600,scrolling:!1};function vb(e,t){const n=e.getRootNode(),o=typeof n.getElementById=="function"?n.getElementById(t):null;if(o&&o!==e)return;const i=e.getAttribute("id");e.id=t;try{e.iFrameResizer?.removeListeners?.()}finally{i===null?e.removeAttribute("id"):e.id=i}}function Eb(e){const t=()=>e.iFrameResizer;(0,_b.default)(bb,e);const n=e.id;return{resize:()=>t()?.resize?.(),dispose:()=>vb(e,n)}}function Sb(e){e.inject(Fi,Eb)}function wb(e){const t=r.getMessageService(e),n=e.getInstance(r.LOCALE_SERVICE_ID);if(!n)return;let o="",i;const a=()=>{const u=n.snapshot(),m=u.id??"";if(!t.isInited()||m===o&&u.catalog===i)return;const f=r.createI18n(u.catalog),g=p=>f.__(p),_=r.SANDBOX_TRANSLATIONS_MAP(g);o=m,i=u.catalog,t.send(r.EVENT_TYPES.SANDBOX_TRANSLATIONS,{name:m,data:_})},c=t.onInit(()=>{o="",i=void 0,a()}),d=n.state.watch(a);e.getInstance(h.DISPOSABLE_ID)?.addDispose(()=>{c.dispose(),d.dispose()})}function kb(e){const t=e?.content?.templateId;return t==null||t===""?void 0:String(t)}function Cb(e){e.getInstance(h.OPTIONS_SOURCE_ID)?.watch(t=>{const n=kb(t);n!==void 0&&mg(e,n)})}var Go={en_US:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/45127a77.js")),void 0,{}.url),ru_RU:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/aea078c0.js")).then(e=>e.ru_RU_exports),void 0,{}.url),uk_UA:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/d612bba8.js")),void 0,{}.url),es_ES:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/132074fc.js")),void 0,{}.url),pt_BR:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/9e0696a3.js")),void 0,{}.url),de_DE:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/c5e3e58d.js")),void 0,{}.url),fr_FR:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/5e35e5e8.js")),void 0,{}.url),it_IT:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/dd6e4977.js")),void 0,{}.url),pl_PL:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>Ee("./static/core/2a4178e1.js")),void 0,{}.url)};async function Tb(e){const t=Go[e];if(!t){const n=Go.en_US;return n?(await n()).default:void 0}return(await t()).default}var eE=Object.keys(Go),Ib=e=>e==="uk"?"uk_UA":e;function Ab(e){e.getInstance(r.LOCALE_SERVICE_ID)?.useAntdLoader(t=>Tb(Ib(t)))}var Vs={id:"ru_RU",time:1790948462,hash:"6f5a634557040652c19e81a1da5e19873ed29c5174234c7dbb23ec4499956c38",catalog:JSON.parse(`{"":{"domain":"default","lang":"ru_RU","plural_forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);"}," Add section":["Добавить раздел"]," email was":["письмо","письма","писем"]," from the project successfully.":["из проекта."]," successfully imported.":["импортировано."],"\\" email?":["»?"],"\\" was successfully created.":["\\" создано."],"\\" was successfully removed.":["» удалён."],"%d day":["%d день","%d дня","%d дней"],"%d day left":["%d день остался","%d дня осталось","%d дней осталось"],"%s plan":["Тариф %s"],"+0:00 London, Lisbon, Dublin":["+0:00 Лондон, Лиссабон, Дублин"],"+10:00 Sydney, Melbourne, Port Moresby":["+10:00 Сидней, Мельбурн, Порт-Морсби"],"+11:00 Honiara, Nuku'alofa, Apia":["+11:00 Хониара, Нукуалофа, Апиа"],"+1:00 Paris, Berlin, Rome":["+1:00 Париж, Берлин, Рим"],"+2:00 Athens, Kiev, Istanbul":["+2:00 Афины, Киев, Стамбул"],"+3:00 Istanbul, Doha, Baghdad":["+3:00 Москва, Санкт-Петербург, Киев"],"+4:00 Baku, Dubai, Tbilisi":["+4:00 Баку, Дубай, Тбилиси"],"+5:00 Karachi, Tashkent, Islamabad":["+5:00 Екатеринбург, Ташкент, Исламабад"],"+6:00 Almaty, Dhaka, Bishkek":["+6:00 Алматы, Дакка, Омск"],"+7:00 Bangkok, Ho Chi Minh City, Jakarta":["+7:00 Бангкок, Хошимин, Джакарта"],"+8:00 Beijing, Hong Kong, Singapore":["+8:00 Пекин, Гонконг, Сингапур"],"+9:00 Tokyo, Seoul, Jayapura":["+9:00 Токио, Сеул, Якутск"],"-10:00 Honolulu, Anchorage":["-10:00 Гонолулу, Анкоридж"],"-11:00 Pago Pago, Midway Atoll":["- 11:00 Паго-Паго, атолл Мидуэй"],"-12:00 Apia":["-12:00 Апиа"],"-1:00 Azores, Cape Verde":["-1:00 Азорские острова, Кабо-Верде"],"-2:00 South Georgia, Saint Helena":["-2:00 Южная Джорджия, остров Святой Елены"],"-3:00 Buenos Aires, Santiago, Montevideo":["-3:00 Буэнос-Айрес, Сантьяго, Монтевидео"],"-4:00 Caracas, Santo Domingo":["-4:00 Каракас, Санто-Доминго"],"-5:00 New York, Toronto, Havana":["-5:00 Нью-Йорк, Торонто, Гавана"],"-6:00 Mexico City, Guadalajara":["-6:00 Мехико, Гвадалахара"],"-7:00 Denver, Phoenix":["-7:00 Денвер, Феникс"],"-8:00 Los Angeles, Vancouver":["-8:00 Лос-Анджелес, Ванкувер"],"-9:00 Anchorage, Yukon":["-9:00 Анкоридж, Юкон"],"/ month":["/ месяц"],"1000+":["1000+"],"11–50":["11–50"],"12 hours":["12 часов"],"123456, City, 1 Example St.":["123456, Город, ул. Пример, 1"],"14 days free":["14 дней бесплатно"],"1–10":["1–10"],"20 s":["20 s"],"201–500":["201–500"],"24 hours":["24 часа"],"40 s":["40 s"],"501–1000":["501–1000"],"51–200":["51–200"],"60 s":["60 s"],"<1>Upload your own templates</1> or use <2>ready-made ones</2> to create emails from blocks.":["<1>Загружайте свои шаблоны</1> или используйте <2>готовые</2> для создания писем из блоков."],"A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.":["Расширение браузера (например, Urban VPN Proxy или аналогичные блокировщики рекламы/VPN-сервисы) вставляет код в окно предварительного просмотра письма. Это может привести к повреждению шаблона при сохранении."],"A flexible plan tailored to your needs":["Гибкий план, разработанный с учетом ваших потребностей"],"A shareable link to this page has been copied to the clipboard.":["Ссылка на страницу предпросмотра скопирована в буфер обмена."],"A test email can be sent to a maximum of 10 addresses.":["Тестовое письмо можно отправить максимум на 10 адресов."],"A-Z":["А-Я"],"AI":["AI"],"AI Assistant":["AI Ассистент"],"AI assistant":["AI Ассистент"],"AI email generation":["AI генерация письма"],"AI image":["AI картинка"],"AI image generation":["AI генерация изображений"],"AI requests":["Запросы к ИИ"],"AMP":["AMP"],"AMP visibility":["Видимость в AMP"],"API Key":["Ключ API"],"API Token":["Токен API"],"API URL":["URL API"],"Above":["Сверху"],"Accepted formats: PNG, JPG, WEBP, SVG or GIF.":["Доступные форматы: PNG, JPG, SVG или GIF."],"Access Key ID":["Идентификатор ключа доступа"],"Access keys and integration":["Ключи доступа и интеграция"],"Accessibility":["Доступность"],"Accessibility text":["Текст для людей с ограниченными возможностями"],"Accordion":["Аккордеон"],"Account Login":["Логин"],"Account settings":["Настройки аккаунта"],"Actions with the chosen text":["Действия с выбранным текстом"],"Active date background color":["Цвет фона активной даты"],"Active date font":["Шрифт активной даты"],"Add a common block":["Добавить общий блок"],"Add a font file or a link to the font.":["Добавьте файл шрифта или ссылку на него."],"Add a new folder":["Добавить новую папку"],"Add a new group":["Добавить группу"],"Add a new project":["Создать проект"],"Add a note":["Добавить метку"],"Add a saved block":["Добавить сохранённый блок"],"Add a template block":["Добавить шаблонный блок"],"Add an empty block":["Добавить пустой блок"],"Add block":["Добавить блок"],"Add button":["Добавить кнопку"],"Add card":["Добавить карточку"],"Add color":["Добавить цвет"],"Add column":["Добавить колонку"],"Add first color":["Добавить первый цвет"],"Add first link":["Добавить первую ссылку"],"Add group":["Добавить группу"],"Add image":["Изображение"],"Add inline image":["Вставить картинку"],"Add paragraph":["Добавить абзац"],"Add slide":["Добавить слайд"],"Add social network":["Добавить соцсеть"],"Add social network links to use in your email templates.":["Добавьте ссылки на соцсети, чтобы использовать их в шаблонах писем."],"Add some tags":["Укажите несколько тегов"],"Add up to 10 recipients":["Добавьте до 10 получателей"],"Add value":["Добавить значение"],"Add your brand palette and reuse it in the email editor.":["Добавьте палитру бренда и используйте её в редакторе писем."],"Add your first block to the folder...":["Добавьте свой первый блок в папку..."],"Address of any S3-compatible storage, for example https://storage.example.com":["Адрес любого S3-совместимого хранилища, например https://storage.example.com"],"Adds VML markup so the background image is visible in Outlook.":["Добавляет разметку VML, чтобы фоновое изображение отображалось в Outlook."],"Adds bulletproof VML markup so the button keeps rounded corners in Outlook.":["Добавляет разметку VML, благодаря чему кнопка сохраняет закругленные углы в Outlook."],"Administrator":["Администратор"],"Align bottom":["По нижнему краю"],"Align center":["По центру"],"Align left":["Влево"],"Align middle":["Посередине"],"Align right":["Вправо"],"Align top":["По верхнему краю"],"Alignments":["Выравнивание"],"All":["Все"],"All EmailMaker features are available for 14 days":["Все функции EmailMaker доступны в течение 14 дней."],"All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.":["Все сохраненные на данный момент блоки можно найти в разделе «Сохраненные блоки» на боковой панели."],"All blocks saved successfully.":["Все блоки сохранены."],"All emails sent to this address will be added to your project as a template.":["Все письма, которые придут на этот адрес, будут добавлены в ваш проект в виде шаблона"],"All folders":["Все папки"],"All roles":["Все роли"],"Allow multiple selection":["Разрешить множественный выбор"],"Allowed protocols":["Допустимые протоколы"],"Already imported":["Уже импортировано"],"Altcraft":["Altcraft"],"Alternative text":["Альтернативный текст"],"Always":["Всегда"],"Amount":["Сумма"],"An unexpected error has occurred. Our team has already been notified. Please try reloading the page.":["Произошла непредвиденная ошибка. Наша команда уже получила уведомление. Попробуйте перезагрузить страницу."],"Anchor":["Якорь"],"Anchor links do not work in Outlook, Gmail, and several other email clients.":["Якорные ссылки не работают в Outlook, Gmail и ряде других почтовых клиентов."],"Anchor name":["Имя якоря"],"Animate":["Анимация"],"Annotation type":["Тип аннотации"],"Annotations":["Аннотации"],"Any additional details":["Любые дополнительные сведения"],"Appearance":["Внешний вид"],"Appearance on mobile devices":["Внешний вид на мобильных устройствах"],"Apply":["Применить"],"Apply horizontal padding to height":["Применить горизонтальный отступ к высоте"],"Approaching usage limit. Remaining":["Приближается предел использования. Остаток"],"Apps":["Приложения"],"Are you sure you want to delete project ":["Вы уверены, что хотите удалить проект "],"Are you sure you want to disable this integration?":["Вы уверены, что хотите отключить эту интеграцию?"],"Are you sure you want to leave the project ":["Вы уверены, что хотите покинуть проект "],"Are you sure?":["Вы уверены"],"Around":["Вокруг"],"Arrow":["Стрелка"],"Arrow color":["Цвет стрелки"],"Article":["Статьи"],"At least 8 characters in both cases, including letters, numbers, and special characters.":["Минимум 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.":["Не менее 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least one card needs an image and a link starting with https://":["Нужна хотя бы одна карточка с изображением и ссылкой, начинающейся с https://"],"Author":["Автор"],"Authorization error via Yandex":["Ошибка авторизации через Яндекс"],"Authorization keys":["Ключи авторизации"],"Auto":["Авто"],"Auto-payment enabled":["Автоплатёж включён"],"Auto-payment will be available once the subscription is linked in the payment system.":["Автоматическая оплата станет доступна после привязки подписки в платежной системе."],"Auto-prepend protocol on blur":["Автоматически добавлять протокол при потере фокуса"],"Autoplay":["Автозапуск"],"Autosave in editor":["Автосохранение в редакторе"],"Available formats: HTML, EML, ZIP":["Доступные форматы: HTML, EML, ZIP"],"Available until:":["Оплачен до:"],"BIK (bank ID)":["БИК"],"BIK must be 9 digits":["БИК должен состоять из 9 цифр"],"Back":["Назад"],"Back Home":["Вернуться"],"Back To Project":["Вернуться в проект"],"Back To Projects":["Вернуться к проектам"],"Back to Log In":["Вернуться к авторизации"],"Back to integrations":["К интеграциям"],"Background":["Фон"],"Background color":["Цвет фона"],"Background color of the contrast blocks":["Цвет фона контрастных блоков"],"Background image":["Фоновое изображение"],"Background image in Outlook (VML)":["Фоновое изображение в Outlook (VML)"],"Background image link/route":["Ссылка на фоновое изображение"],"Background image repeat":["Повтор фона"],"Background image size":["Размер фона"],"Bank account (RUB)":["Банковский счет (рубли)"],"Bank name":["Название банка"],"Banners":["Баннеры"],"Base URL for public access to files":["Базовый адрес для публичного доступа к файлам"],"Base background color":["Базовый цвет фона"],"Base colors":["Базовые цвета"],"Base path for uploading files":["Базовый путь для загрузки файлов"],"Base text color":["Базовый цвет текста"],"Before exporting the project, make sure to provide the URL where the webhook request will be sent":["Перед экспортом проекта необходимо заполнить url, на который будет отправляться запрос webHook"],"Below":["Снизу"],"Between bullets and text":["Между буллетами и текстом"],"Between list items":["Между пунктами списка"],"Billing":["Тарифы и оплата"],"Billing period":["Расчетный период"],"Black":["Чёрный"],"Black and White":["Чёрно-белые"],"Black circle":["Чёрный круг"],"Black circle outlined":["Чёрный круг обводка"],"Blank template":["Пустой шаблон"],"Block":["Блок"],"Block name":["Название блока"],"Block not yet loaded or global container not found.":["Код блока не загружен или глобальный контейнер не найден."],"Block styles":["Стили блока"],"Blocks":["Блоки"],"Blocks background color":["Цвет фона блоков"],"Blocks not found":["Блоки не найдены."],"Blocks search":["Поиск блоков"],"Blocks storage":["Хранилище Blocks"],"Blue":["Синий"],"Blur radius":["Размытие"],"Body":["Сообщение"],"Border":["Рамка"],"Border color":["Цвет рамки"],"Border radius":["Скругление"],"Borders":["Рамка"],"Both":["Всегда"],"Bottom":["Снизу"],"Bottom Code panel":["Панель кода снизу"],"Bottom left corner":["Нижний левый угол"],"Bottom margin":["Отступ снизу"],"Bottom padding":["Отступ снизу"],"Bottom padding of the general text":["Нижний отступ у текста"],"Bottom right corner":["Нижний правый угол"],"Box shadow":["Тень"],"Broadcast successfully created!":["Выпуск успешно создан!"],"Browser extension detected":["Обнаружено расширение для браузера"],"Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.":["Включена функция перевода страницы в браузере (например, Google Translate). Это может привести к сбоям в работе редактора и вызывать ошибки при сохранении."],"Browser translation detected":["Обнаружен перевод с помощью браузера"],"Bucket name":["Имя бакета"],"Build newsletters from scratch with <1>structures and elements</1>.":["Собирайте рассылки с нуля с помощью <1>структур и элементов</1>."],"Bulk saving of blocks":["Массовое сохранение блоков"],"Bullet":["Буллет"],"Bullets color":["Цвет буллетов"],"Bullets font":["Шрифт буллетов"],"Bullets size":["Размер буллетов"],"Bullets type":["Тип буллетов"],"Button":["Кнопка"],"Button background color in contrasting blocks":["Цвет фона кнопок в контрастных блоках"],"Button size":["Размер кнопки"],"Button text color in contrasting blocks":["Цвет текста кнопок в контрастных блоках"],"Buttons":["Кнопки"],"Buttons background color":["Цвет фона кнопки"],"Buttons font":["Шрифт кнопки"],"Buttons font size":["Размер текста кнопки"],"Buttons letter spacing":["Межбуквенный интервал кнопки"],"Buttons text color":["Цвет текста кнопки"],"Buy":["Купить"],"Buy generations":["Купить генерации"],"Buy image check package":["Купить пакет проверки изображений"],"Buy link check package":["Купить пакет проверки ссылок"],"Buy optimization package":["Купить пакет оптимизации"],"Buy package":["Купить пакет"],"Buy spam check package":["Купить пакет проверки на спам"],"Buy test sends package":["Купить пакет тестов"],"By card":["Картой"],"Calendar":["Календарь"],"Call to Action":["Призыв к действию"],"Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it.":["Кампания создана. Dotdigital использовал отправителя по умолчанию вашей учетной записи, поскольку этот адрес электронной почты в поле «От» не зарегистрирован в качестве настраиваемого адреса отправителя. Добавьте адрес в Dotdigital и повторно экспортируйте данные, чтобы использовать его."],"Campaign successfully created!":["Кампания успешно создана!"],"Cancel":["Отмена"],"Cannot disable recurring payments":["Не удается отключить автоплатёж"],"Cannot enable recurring payments":["Не удается включить автоплатёж"],"Captcha required":["Требуется ввести капчу"],"Captcha verification failed":["Ошибка при проверке капчи"],"Caption next to checkbox":["Подпись рядом с чекбоксом"],"Caption next to options":["Подпись рядом с пунктами"],"Card":["Карточка"],"Card payment is not available for this change.":["Для данной операции оплата картой недоступна."],"Card payment is not available for this change. Use an invoice for a legal entity.":["Для данного изменения оплата картой недоступна. Для юридического лица воспользуйтесь счётом-фактурой."],"Card payment is not available for this plan change. Please contact support.":["Оплата картой недоступна при изменении тарифного плана. Пожалуйста, обратитесь в службу поддержки."],"Card payment is not available for this plan change. Use an invoice for a legal entity or contact support.":["Для данного изменения тарифного плана оплата картой недоступна. Для юридических лиц воспользуйтесь счетом-фактурой или обратитесь в службу поддержки."],"Cards":["Карточки"],"Cards view":["Карточки"],"Carousel":["Карусель"],"Case Change":["Изменение ситуации"],"Cell":["Ячейка"],"Center horizontally":["По центру"],"Center vertically":["По центру"],"Change":["Изменить"],"Change Stripo key":["Сменить ключ Stripo"],"Change folder name":["Переименовать папку"],"Change group name":["Переименовать группу"],"Change image":["Сменить изображение"],"Change name":["Переименовать"],"Change plan":["Изменить тариф"],"Change role":["Изменить роль"],"Change role to Administrator":["Изменить роль на Администратор"],"Change tariff":["Сменить тариф"],"Changes loaded":["Изменения загружены"],"Character limit":["Ограничение по количеству символов"],"Characters":["Символы"],"Chat support":["Чат поддержки"],"Check how your email appears across various devices and email clients.":["Проверьте, как будет выглядеть ваше письмо на разных устройствах и в разных почтовых клиентах."],"Check who and when made changes to the email template and, if necessary, restore one of the previous versions.":["Проверьте, кто и когда вносил изменения в шаблон, и при необходимости восстановите одну из предыдущих версий."],"Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.":["Проверьте письмо на наличие неработающих ссылок, отсутствующих alt-текстов, тяжелых изображений и других препятствий, которые могут помешать вашим письмам попасть в почтовые ящики."],"Check your network connection and try again.":["Проверьте подключение к сети и попробуйте ещё раз."],"Checkbox":["Чекбокс"],"Checked":["Отмечено"],"Checked fill color":["Цвет заливки отмеченного"],"Checked icon URL":["URL иконки отмеченного"],"Choose":["Выбрать"],"Choose a payment method":["Выберите способ оплаты"],"Choose a plan":["Выбрать тариф"],"Choose allowed protocols":["Выберите разрешенные протоколы"],"Choose block type":["Выберите тип блока"],"Choose complexity rules":["Выберите правила сложности"],"Choose input type":["Выберите тип ввода"],"Choose plan":["Выберите тариф"],"Clear":["Очистить"],"Clear all":["Очистить"],"Clear border":["Очистить рамку"],"Clear chat":["Очистить чат"],"Clear chat history?":["Очистить чат?"],"Clear selection":["Очистить выбор"],"Click or drag a block":["Нажмите или перетащите блок"],"Click the Add a new project button to add your first project.":["Нажмите кнопку «Добавить проект», чтобы создать свой первый проект."],"Click to select, paste from the clipboard, or drag and drop":["Перетащите изображения сюда или вставьте из буфера"],"Client ID":["Client ID"],"Client ID copied to clipboard.":["Client ID скопирован."],"Client Secret":["Client Secret"],"Client secret copied to clipboard.":["Client Secret скопирован."],"Client secret rotated successfully.":["Client Secret перевыпущен."],"Clipboard":["Буфер обмена"],"Clone":["Дублировать"],"Clone block":["Клонировать блок"],"Clone element":["Клонировать элемент"],"Clone group":["Клонировать группу"],"Close":["Закрыть"],"Closed field background":["Фон закрытого поля"],"Code":["Код"],"Code Size Warning":["Предупреждение о размере кода"],"Code editor":["Редактор кода"],"Code mode":["Режим кода"],"Code size":["Размер кода"],"Code that will replace the image \`src\`":["Код, который заменит путь к изображению"],"Collapse section":["Свернуть раздел"],"Collection of all HTTP requests used by the plugin (Postman Collection v2.1 format).":["Коллекция всех HTTP-запросов, которые использует плагин (формат Postman Collection v2.1)."],"Color":["Цвет"],"Color of the general text":["Цвет текста"],"Color settings":["Настройки цвета"],"Colors":["Цвета"],"Column":["Колонка"],"Column gap":["Отступ между колонками"],"Columns":["Колонки"],"Come up with a hint":["Придумайте подсказку"],"Coming soon":["В разработке"],"Comment":["Комментарий"],"Comment was removed.":["Комментарий удалён."],"Common blocks":["Общие блоки"],"Company size":["Размер компании"],"Complexity rules":["Правила сложности"],"Configure":["Настроить"],"Configure %s":["Настройка %s"],"Configure integration":["Настроить интеграцию"],"Configure social network link":["Настройка ссылки на соцсеть"],"Confirmation":["Подтверждение"],"Confirmation email has been sent to {confirmedEmail}.":["На адрес {confirmedEmail} отправлено письмо с подтверждением."],"Confirmation email was sent to":["Подтверждение было отправлено на"],"Connect":["Подключить"],"Connect plugin":["Подключить плагин"],"Connected":["Подключено"],"Connection established":["Соединение установлено"],"Connection test failed.":["Не удалось проверить соединение."],"Contact":["Связаться"],"Contact List ID":["ID списка контактов"],"Contact Us":["Связаться с нами"],"Contact person (full name)":["Контактное лицо (полное имя)"],"Contact sync, content personalization, and real-time campaign results tracking.":["Синхронизация контактов, персонализация содержимого и отслеживание результатов кампаний в реальном времени."],"Contacts":["Контакты"],"Contain":["Contain"],"Container":["Контейнер"],"Container width":["Ширина блока"],"Content":["Контент"],"Content styles":["Стили контента"],"Continue":["Продолжить"],"Continue (%d)":["Продолжить (%d)"],"Continue without saving":["Продолжить без сохранения"],"Contract":["Договор"],"Contract / invoice / public offer":["Договор / счёт-фактура / публичная оферта"],"Contract date":["Дата заключения договора"],"Contract number":["Номер договора"],"Contrast block":["Контрастный блок"],"Contrast block header color":["Цвет заголовка контрастного блока"],"Contrast block text color":["Цвет текста контрастного блока"],"Contrasting background color":["Контрастный цвет фона"],"Contrasting colors":["Контрастные цвета"],"Contrasting text color":["Контрастный цвет текста"],"Conversion failed":["Конвертация не удалась"],"Convert":["Конвертировать"],"Convert into an image":["Преобразовать в изображение"],"Converting layout…":["Конвертация шаблона..."],"Copy":["Копировать"],"Copy block to clipboard":["Скопировать блок в буфер обмена"],"Copy client ID":["Скопировать Client ID"],"Copy client secret":["Скопировать Client Secret"],"Copy code":["Скопировать код"],"Copy column":["Скопировать колонку"],"Copy hex":["Копировать HEX"],"Copy to clipboard":["Скопировать в буфер обмена"],"Copywriter":["Писатель"],"Corner radius":["Скругление"],"Correspondent account":["Корреспондентский счёт"],"Could not activate the trial. Please try again later or contact support.":["Не удалось активировать пробную версию. Попробуйте позже или обратитесь в службу поддержки."],"Could not move files from old storage":["Не удалось переместить файлы со старого хранилища"],"Could not reach the server. Please try again later.":["Не удалось установить соединение с сервером. Пожалуйста, попробуйте позже."],"Could not save the email":["Не удалось сохранить письмо"],"Couldn\`t determine the email width":["Не удалось определить ширину письма."],"Countdown":["Таймер"],"Countdown font settings":["Шрифт таймера"],"Country selector (flag+code)":["Выбор страны (флаг + код)"],"Cover":["Cover"],"Create a new email":["Создать письмо"],"Create a password":["Создайте пароль"],"Create email":["Создать письмо"],"Create folder":["Создать папку"],"Create group":["Создать группу"],"Create new block":["Создать новый блок"],"Create new email":["Создать письмо"],"Create project":["Создать проект"],"Creating an email on request":["Создание письма по запросу"],"Creation date":["Дата создания"],"Cross":["Крест"],"Current password":["Текущий пароль"],"Custom":["Пользовательский"],"Custom fonts":["Пользовательские"],"Custom icon":["Пользовательская иконка"],"Customized solutions for large-scale operations with high productivity":["Индивидуальные решения для крупных компаний с высокой производительностью"],"Dark":["Тёмная"],"Dark theme":["Тёмная тема"],"Dash":["Тире"],"Dashed":["Пунктир"],"Date":["Дата"],"Date format":["Формат даты"],"Days":["Дни"],"Deal Annotation":["Аннотация акции"],"Deal Card":["Карточка акции"],"Default or bound value for the field":["Значение по умолчанию или заданное значение для поля"],"Default value":["Значение по умолчанию"],"Delete":["Удалить"],"Delete column":["Удалить колонку"],"Delete from palette":["Удалить из палитры"],"Delete from styles":["Удалить из стилей"],"Delete permanently":["Удалить навсегда"],"Delete this color from the palette?":["Удалить этот цвет из палитры?"],"Delete this font from styles?":["Удалить этот шрифт из стилей?"],"Delete this social network?":["Удалить эту соцсеть?"],"Deleted":["Удалённые"],"Describe your project":["Опишите свой проект"],"Description":["Описание"],"Description is used in other sections of the service.":["Описание используется в других разделах сервиса."],"Description must be at most 500 characters.":["Описание не длиннее 500 символов."],"Desktop":["Десктоп"],"Desktop view":["Десктопный вид"],"Details":["Подробнее"],"Developer files":["Файлы для разработчика"],"Diamond":["Ромб"],"Didn't receive an email?":["Не получили письмо?"],"Digits (0-9)":["Цифры (0–9)"],"Disable":["Отключить"],"Disable integration":["Отключить интеграцию"],"Disabled":["Отключенный"],"Disconnect Stripo":["Отключить Stripo"],"Discount code":["Промокод"],"Discount description":["Описание скидки"],"Discount description is required":["Нужно описание скидки"],"Discount must be a percentage greater than 0 and up to 100":["Скидка указывается в процентах: больше 0 и не больше 100"],"Discount with promo code: ":["Скидка по промокоду: "],"Discount, %":["Скидка, %"],"Discuss":["Обсуждение"],"Display control":["Видимость"],"Display control & Direction":["Видимость и направление"],"Display the minimap.":["Показывать миникарту кода."],"Divider":["Разделитель"],"Do not repeat background (no-repeat)":["Не повторять фон (no-repeat)"],"Domain that serves this folder: it goes into image links in emails":["Домен, который отдаёт эту папку: он попадает в ссылки на изображения в письмах"],"Don't suggest again":["Больше не предлагать"],"Done":["Готово"],"Dot color":["Цвет точки"],"Dotted":["Точки"],"Double arrow":["Двойная стрелка"],"Double quotation":["Двойная кавычка"],"Download":["Скачать"],"Download as is":["Скачать как есть"],"Draft Name":["Имя черновика"],"Draft campaign created! Open it to review and schedule.":["Проект кампании создан! Откройте его для проверки и планирования."],"Draft successfully created!":["Черновик создан!"],"Drag file here or upload from device":["Перетащите файл сюда или загрузите с устройства"],"Drag to reorder":["Можно перемещать"],"Drop here":["Вставить сюда"],"Dropdown list":["Выпадающий список"],"Duration":["Длительность"],"During export, the element is converted into an image.":["При экспорте элемент преобразуется в изображение."],"E-Commerce":["Электронная коммерция"],"E-mail":["E-mail"],"Edit":["Редактировать"],"Edit block":["Свойства блока"],"Edit element":["Редактировать элемент"],"Edit group":["Свойства группы"],"Edit icon":["Редактировать иконку"],"Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!":["Редактируйте HTML-версию шаблона письма в режиме кода и наблюдайте за изменениями в реальном времени. В EmailMaker нет ограничений на код: вы можете создавать шаблоны любой сложности!"],"Editing comments":["Редактирование комментариев"],"Education":["Образование"],"Element":["Элемент"],"Elements":["Элементы"],"Email":["Email"],"Email Subject":["Тема письма"],"Email background color":["Цвет фона письма"],"Email builder for your teamwork":["Редактор писем для совместной работы"],"Email confirmation required":["Требуется подтверждение email"],"Email generation":["Генерация писем"],"Email generator":["Генератор Email"],"Email layout width":["Ширина письма"],"Email name":["Название письма"],"Email not yet loaded or global container not found.":["Код письма не загружен или глобальный контейнер не найден."],"Email optimization":["Оптимизация шаблона"],"Email platforms":["Платформы"],"Email successfully copied to clipboard.":["Адрес скопирован в буфер обмена."],"Email successfully created!":["Письмо создано!"],"Email synced with the server":["Email синхронизирован с сервером"],"Email testing":["Тестирование шаблона"],"EmailMaker storage":["Хранилище EmailMaker"],"Emails":["Письма"],"Emails not found":["По данному запросу ничего не найдено."],"Embed images in the file?":["Включить изображения в файл?"],"Empty blocks":["Пустые блоки"],"Enable auto-payment":["Включить автоплатёж"],"Enabled":["Включено"],"End date":["Дата окончания"],"End time":["Время окончания"],"Endpoint":["Адрес хранилища"],"Ends":["Окончание"],"Ends in":["Заканчивается через"],"Enter Altcraft API token":["Введите токен API Altcraft"],"Enter Mailganer API key":["Введите ключ API Mailganer"],"Enter Sendsay API key":["Введите ключ API Sendsay"],"Enter URL":["Введите адрес"],"Enter Unisender API key":["Введите ключ API Unisender"],"Enter a URL starting with http:// or https://":["Адрес должен начинаться с http:// или https://"],"Enter a direct link to a font file (.woff2, .woff, .ttf, .otf) or a Google Fonts stylesheet.":["Укажите прямую ссылку на файл шрифта (.woff2, .woff, .ttf, .otf) или на стили Google Fonts."],"Enter a font name.":["Введите название шрифта."],"Enter a port between 1 and 65535":["Укажите порт от 1 до 65535"],"Enter a valid HEX color (e.g. #1F1F1F).":["Введите корректный HEX-цвет (например, #1F1F1F)."],"Enter a valid HEX color.":["Введите корректный HEX-цвет."],"Enter a valid URL (https://example.com or example.com).":["Введите корректный адрес (https://example.com или example.com)."],"Enter block name":["Укажите название блока"],"Enter color name":["Введите название цвета"],"Enter enKod API key":["Введите ключ API enKod"],"Enter font name":["Введите название шрифта"],"Enter heading":["Введите заголовок"],"Enter link":["Введите ссылку"],"Enter name":["Введите название"],"Enter path":["Введите путь"],"Enter preheader here":["Введите прехедер"],"Enter promo code":["Введите промокод"],"Enter subject line here":["Введите тему письма"],"Enter the access key":["Введите ключ доступа"],"Enter the block name":["Введите название блока"],"Enter the bucket name":["Введите имя бакета"],"Enter the confirmation code from the email and set a new password.":["Введите код подтверждения из письма и установите новый пароль."],"Enter the connection login":["Введите логин для подключения"],"Enter the connection password":["Введите пароль для подключения"],"Enter the email name":["Введите название письма"],"Enter the folder name":["Введите имя папки"],"Enter the group name":["Введите имя группы"],"Enter the price as a number to calculate the discount":["Укажите цену числом, чтобы рассчитать скидку"],"Enter the project name":["Введите название проекта"],"Enter the secret key":["Введите секретный ключ"],"Enter the server host":["Введите имя хоста"],"Enter the storage endpoint":["Введите адрес хранилища"],"Enter the title of the image":["Введите название изображения"],"Enter value":["Введите значение"],"Enter your contact details":["Укажите свои контакты"],"Enter your current password":["Введите текущий пароль"],"Enter your email":["Укажите ваш email"],"Enter your email address and we will send you password reset instructions.":["Введите свой адрес электронной почты, и мы вышлем вам инструкции по сбросу пароля."],"Enter your first name":["Укажите ваше имя"],"Enter your last name":["Укажите вашу фамилию"],"Enter your new password":["Введите новый пароль"],"Enter your password":["Введите ваш пароль"],"Enter your phone or email":["Введите телефон или email"],"Equalize":["Сравнять"],"Error":["Ошибка"],"Error when initializing file manager":["Ошибка инициализации файлового менеджера"],"Error when receiving data. Try again (reload page) or contact support.":["Ошибка при получении данных. Попробуйте еще раз (перезагрузите страницу) или обратитесь в службу поддержки."],"Errors":["Ошибки"],"Evaluating the task":["Обдумываю задачу"],"Example:":["Например:"],"Expand only one section":["Раскрывать только один раздел"],"Expand section":["Развернуть раздел"],"Expires":["Действует до"],"Export":["Экспорт"],"Export emails as draft campaigns to ActiveCampaign":["Экспорт писем в ActiveCampaign в виде черновиков кампаний"],"Export emails to Altcraft":["Экспорт писем в Altcraft"],"Export emails to Bento":["Экспорт писем в Bento"],"Export emails to Brevo":["Экспорт писем в Brevo"],"Export emails to Campaign Monitor":["Экспорт писем в Campaign Monitor"],"Export emails to Constant Contact":["Экспорт писем в Constant Contact"],"Export emails to Dotdigital":["Экспорт писем в Dotdigital"],"Export emails to GetResponse":["Экспорт писем в GetResponse"],"Export emails to HubSpot":["Экспорт писем в HubSpot"],"Export emails to Klaviyo":["Экспорт писем в Klaviyo"],"Export emails to Mailchimp":["Экспорт писем в Mailchimp"],"Export emails to Mailganer":["Экспорт писем в Mailganer"],"Export emails to Salesforce":["Экспорт писем в Salesforce"],"Export emails to Sendsay":["Экспорт писем в Sendsay"],"Export emails to Unisender":["Экспорт писем в Unisender"],"Export emails to enKod":["Экспорт писем в enKod"],"Export settings":["Настройки экспорта"],"Extend plan":["Продлить тариф"],"Extra limit package":["Расширенный пакет"],"Extra package is not configured for this limit.":["Для этого ограничения дополнительный пакет не настроен."],"Extra packages are only available with CloudPayments at the moment.":["На данный момент дополнительные пакеты доступны только в CloudPayments."],"Eyedropper":["Пипетка"],"Failed to clean trash":["Не удалось очистить корзину"],"Failed to complete Yandex authorization":["Не удалось пройти авторизацию в «Яндексе»"],"Failed to copy.":["Не удалось скопировать."],"Failed to create broadcast":["Не удалось создать выпуск"],"Failed to create campaign":["Не удалось создать кампанию"],"Failed to create draft":["Не удалось создать черновик"],"Failed to create email":["Не удалось создать письмо"],"Failed to create mailing":["Не удалось создать рассылку"],"Failed to create newsletter":["Не удалось создать рассылку"],"Failed to create template":["Не удалось создать шаблон"],"Failed to download file.":["Не удалось скачать файл."],"Failed to download image from URL.":["Не удалось загрузить изображение по URL-адресу."],"Failed to export the email as images. Please try again.":["Не удалось экспортировать письмо в виде изображений. Попробуйте ещё раз."],"Failed to get file: %s":["Не удалось получить файл: %s"],"Failed to load":["Не удалось загрузить"],"Failed to load GIFs":["Не удалось загрузить GIF-файлы"],"Failed to load GIFs through the configured proxy chain.":["Не удалось загрузить GIF-файлы через настроенную цепочку прокси-серверов."],"Failed to load YaSendSuggestToken script":["Не удалось загрузить скрипт YaSendSuggestToken"],"Failed to load Yandex authorization script":["Не удалось загрузить скрипт авторизации Яндекс"],"Failed to load integrations.":["Не удалось загрузить интеграции."],"Failed to load payments.":["Не удалось загрузить платежи."],"Failed to load plugin analytics.":["Не удалось загрузить аналитику плагина."],"Failed to load plugin settings.":["Не удалось загрузить настройки плагина."],"Failed to load plugin usage.":["Не удалось загрузить статистику использования плагина."],"Failed to load project styles.":["Не удалось загрузить стили проекта."],"Failed to load stock images":["Не удалось загрузить стоковые изображения"],"Failed to load stock images through the configured proxy chain.":["Не удалось загрузить стоковые изображения через настроенную цепочку прокси-серверов."],"Failed to load storage settings.":["Не удалось загрузить настройки хранилища."],"Failed to process image URL.":["Не удалось обработать URL-адрес изображения."],"Failed to rotate client secret.":["Не удалось перевыпустить Client Secret."],"Failed to save blocks.":["Не удалось сохранить блоки."],"Failed to save integration settings.":["Не удалось сохранить настройки интеграции."],"Failed to save project settings.":["Не удалось сохранить настройки проекта."],"Failed to save project styles.":["Не удалось сохранить стили проекта."],"Failed to save storage settings.":["Не удалось сохранить настройки хранилища."],"Failed to save the image. Check the file storage settings.":["Не удалось сохранить изображение. Проверьте настройки хранилища файлов."],"Failed to update the global block.":["Не удалось обновить глобальный блок."],"Failed to update the inbox.":["Не удалось обновить папку «Входящие»."],"Features":["Возможности"],"Fewer settings":["Меньше настроек"],"Field heading":["Заголовок поля"],"Field required":["Обязательное поле"],"Field state appearance":["Внешний вид поля"],"File":["Файл"],"File upload failed":["Не удалось загрузить файл"],"Files ready: %s":["Файлы готовы: %s"],"Fill in at least one offer field":["Заполните хотя бы одно поле акции"],"Filter by type":["Фильтр по типу"],"Finance & Banking":["Финансы и банки"],"First name":["Имя"],"Float block width":["Ширина плавающего блока"],"Folder (Prefix)":["Папка (префикс)"],"Folder name is required":["Имя папки обязательно"],"Folder path":["Путь к папке"],"Folders":["Папки"],"Font":["Шрифт"],"Font family":["Шрифт"],"Font file":["Файл шрифта"],"Font of the general text":["Шрифта текста"],"Font settings":["Настройки шрифта"],"Font size":["Размер текста"],"Font size of the general text":["Размер текста"],"Font type":["Тип шрифта"],"Font weight":["Толщина шрифта"],"Fonts":["Шрифты"],"Footers":["Подвалы"],"For basic tasks in business or personal projects":["Для выполнения основных задач в рамках деловых или личных проектов"],"Forgot the password?":["Забыли пароль?"],"Forgot your password?":["Забыли пароль?"],"Form":["Форма"],"Found so far: %s":["Найдено на данный момент: %s"],"Free trial":["Пробная версия"],"From scratch":["С чистого листа"],"Full legal company name":["Полное юридическое название компании"],"GIF":["GIF"],"General settings":["Общие настройки"],"General text":["Текст"],"Generate":["Сгенерировать"],"Generate Email":["Создать письмо"],"Generate image":["Сгенерировать изображение"],"Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.":["С легкостью создавайте потрясающие визуальные эффекты. Мы обучили нашу модель искусственного интеллекта, чтобы обеспечить высочайшее качество изображений."],"Generate with AI":["Генерация с помощью ИИ"],"Generated images":["Генерация картинок"],"Get a discount":["получить со скидкой"],"Get started":["Начать работу"],"Give your users the ability to build beautiful emails without development costs":["Дайте пользователям возможность собирать красивые письма без затрат на разработку"],"Global block":["Глобальный блок"],"Global styles":["Стили письма"],"Gmail annotation was successfully applied to the template code.":["Аннотация Gmail добавлена в код письма."],"Gmail annotations":["аннотаций в Gmail"],"Gmail annotations were removed from the template code.":["Аннотации Gmail удалены из кода письма."],"Go to project settings?":["Перейти в настройки проекта?"],"Go to projects":["Перейти к проектам"],"Google Fonts":["Шрифты Google"],"Got it":["Понятно"],"Green":["Зелёный"],"Grid":["Сетка"],"Group":["Группа"],"HTML":["HTML"],"HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.":["Требуется URL-адрес HTML-страницы. Сначала сохраните письмо или вставьте собственный URL-адрес размещенной у вас HTML-страницы."],"Half year":["Полгода"],"Header":["Заголовок"],"Header text":["Текст заголовка"],"Headers":["Шапки"],"Heading":["Заголовок"],"Heading color":["Цвет заголовка"],"Heading font":["Шрифт заголовка"],"Heading font size":["Размер заголовка"],"Heading letter spacing":["Межбуквенный интервал заголовка"],"Heading line height":["Высота строки заголовка"],"Headings":["Заголовки"],"Headline":["Заголовок"],"Healthcare":["Здравоохранение"],"Height":["Высота"],"Hello":["Привет"],"Help":["Справка"],"Help menu":["Помощь"],"Helper text":["Подсказка"],"Helper text / tooltip":["Подсказка / всплывающая подсказка"],"Hide payment history":["Скрыть историю платежей"],"High contrast mode":["Режим высокой контрастности"],"Hint text":["Подсказка"],"Horizontal":["Горизонтальный"],"Horizontal alignment":["Горизонтальное выравнивание"],"Horizontal offset":["Гориз. смещение"],"Horizontal padding":["Горизонтальный отступ"],"Horizontal position":["Гориз. смещение"],"Hospitality & Travel":["Гостиничный бизнес и туризм"],"Host":["Имя хоста"],"Hostname or server IP address":["Имя хоста или IP-адрес сервера"],"How to get an API key?":["Как получить ключ API?"],"Hyperlink URL":["Адрес ссылки"],"I agree to the":["Я согласен с"],"I would like to receive updates from Blocks.":["Я хочу получать новости от Blocks"],"I would like to receive updates from EmailMaker.":["Я хочу получать новости от EmailMaker."],"I'd be happy to create an email for you! ":["Я с удовольствием создам для вас электронное письмо! "],"Icon":["Иконка"],"Icon URL":["URL иконки"],"Icon description":["Описание иконки"],"Identifies search terms. For example: utm_term=running+shoes":["Определяет условия поиска. Например: utm_term=running+shoes"],"Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc":["Определяет, какой тип ссылки использовался, например, цена за клик или электронная почта. Например: utm_medium=cpc"],"If \\"Yes\\", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If \\"No\\", images will be loaded from external links.":["Если «Да», изображения будут включены в сам файл. Это полезно для просмотра без интернета или если внешние изображения заблокированы, но увеличивает размер файла. Если «Нет», изображения будут загружаться по внешним ссылкам."],"If different from the legal address":["Если отличается от юридического адреса"],"If you do not pay, you will be switched to the free plan automatically.":["Если вы не оплатите, вы будете автоматически переведены на бесплатный тарифный план."],"If you have problems connecting the plugin — contact us, our specialists will definitely help you.":["Если возникли сложности с подключением плагина — напишите нам, наши специалисты обязательно помогут."],"If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.":["Если параметр отключен, строки никогда не будут переноситься. Если параметр включен, строки будут переноситься по ширине области просмотра."],"Image":["Картинка"],"Image Center":["Центр изображений"],"Image checks":["Проверка картинок"],"Image editor":["Редактор изображений"],"Image path":["Путь к изображению"],"Image replacer":["Замена картинки"],"Image src":["Картинка"],"Images validation":["Проверка изображений"],"Images validation was successfully completed":["Проверка изображений завершена"],"Import":["Импорт"],"Import email":["Импортировать письмо"],"Import finished":["Импорт завершён"],"Import first %d":["Импортировать первые %d"],"Import from Stripo":["Импорт из Stripo"],"Import problems":["Проблемы импорта"],"Import templates and emails from your Stripo project.":["Импорт шаблонов и писем из вашего проекта Stripo."],"Imported":["Импортировано"],"Imported %1$d of %2$d":["Импортировано %1$d из %2$d"],"Imported: %1$d, failed: %2$d.":["Импортировано: %1$d, не удалось: %2$d."],"Importing from Stripo":["Импорт из Stripo"],"Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.":["Улучшает читаемость за счет автоматической настройки формы с учетом требований доступности. Отключите эту функцию, чтобы вернуть прежний вид."],"Inactive date background color":["Цвет фона неактивной даты"],"Inactive date font":["Шрифт неактивной даты"],"Indent":["Отступ"],"Indent between columns":["Горизонтальный отступ"],"Indent height":["Высота"],"Indent in mobile":["Вертикальный отступ"],"Indexing files…":["Индексация файлов…"],"Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale":["Определяет продвижение конкретного продукта или стратегическую кампанию. Например: utm_campaign=spring_sale"],"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":["Определяет, что именно было нажато, чтобы привести пользователя на сайт, например, рекламный баннер или текстовая ссылка. Он часто используется для A/B-тестирования и рекламы, ориентированной на контент. Например: utm_content=logolink или utm_content=textlink."],"Individual corner radii":["Радиусы отдельных углов"],"Individual padding":["Отдельные отступы"],"Industry":["Отрасль"],"Input":["Поле ввода"],"Input field text":["Текст поля ввода"],"Insert column after":["Вставить столбец справа"],"Insert column before":["Вставить столбец слева"],"Insert row after":["Вставить строку после"],"Insert row before":["Вставить строку перед"],"Insert spaces":["Отступы пробелами"],"Inside":["Внутри"],"Integration settings saved.":["Настройки интеграции сохранены."],"Integrations":["Интеграции"],"Integrations are set up in the project settings. Unsaved changes in the email may be lost.":["Интеграции настраиваются в настройках проекта. Несохранённые изменения в письме могут потеряться."],"Internal padding":["Внутренний отступ"],"Invalid file data":["Неверные данные файла"],"Invite members":["Пригласить участников"],"Invited %s":["Приглашён %s"],"Invoice":["Счёт-фактура"],"Invoice for legal entity":["Счёт для юр. лица"],"Invoice request for a legal entity":["Запрос на выставление счета для юридического лица"],"Is a template":["Шаблон"],"It looks like the email was not created in our service, so the content styles won\`t work. Read more about content styles in the help.":["Похоже, письмо создано не в нашем сервисе, поэтому стили контента работать не будут. Подробнее о стилях содержимого читайте в справке."],"It\`s done!":["Готово!"],"Italic":["Курсив"],"Italic ( Ctrl+I )":["Курсив ( Ctrl+I )"],"Italic ( ⌘I )":["Курсив ( ⌘I )"],"Items to import: %d.":["Элементов к импорту: %d."],"Ivan Ivanov":["Иван Иванов"],"Joined the project":["Присоединился к проекту"],"Just now":["Только что"],"KB":["KB"],"KPP":["КПП"],"KPP must be 9 digits":["КПП должен состоять из 9 цифр"],"LLC \\"Example\\"":["ООО «Пример»"],"Label next to checkbox":["Надпись рядом с чекбоксом"],"Label text style":["Стиль текста подписи"],"Landscape":["Горизонтальная"],"Language":["Язык"],"Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.":["Большие электронные письма могут иметь проблемы с доставкой и медленно загружаться. Мы рекомендуем минимизировать код перед экспортом."],"Last login":["Последний вход"],"Last name":["Фамилия"],"Last update: ":["Обновлено:"],"Layout conversion failed":["Ошибка при преобразовании шаблона"],"Layout converted to Blocks format":["Шаблон преобразован в формат Blocks"],"Layout converted to EmailMaker format":["Шаблон преобразован в формат EmailMaker"],"Learn more about %s":["Подробнее о работе %s"],"Leave":["Уйти"],"Leave your comment":["Оставьте ваш комментарий"],"Left":["Слева"],"Left Code panel":["Панель кода слева"],"Left padding":["Отступ слева"],"Left to right":["Слева направо"],"Legal address":["Юридический адрес"],"Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!":["Позвольте нашему помощнику с ИИ улучшить ваше письмо! От создания темы и прехедеров на основе письма до генерации всего письма с учетом особенностей вашего сайта!"],"Letter spacing":["Межбуквенный интервал"],"Light":["Светлая"],"Light theme":["Светлая тема"],"Line break on mobile devices":["Переносить колонки друг под друга"],"Line height":["Высота строки"],"Line height of the general text":["Высота строки текста"],"Line wrap":["Перенос строк"],"Link":["Ссылка"],"Link checks":["Проверка ссылок"],"Link color":["Цвет ссылки"],"Link color in contrasting blocks":["Цвет ссылок в контрастных блоках"],"Link for all slides":["Общая ссылка"],"Link to web version of the font":["Ссылка на веб-версию шрифта"],"Links":["Ссылки"],"Links validation":["Проверка ссылок"],"Links validation was successfully completed":["Проверка ссылок завершена"],"List OL":["Список OL"],"List UL":["Список UL"],"List item appearance":["Внешний вид элемента списка"],"List of projects":["Список проектов"],"List panel background":["Фон панели списка"],"List settings":["Настройки списка"],"List text style":["Стиль текста списка"],"Lists":["Списки"],"Live preview":["Тест в почтовиках"],"Loading latest changes...":["Загрузка последних изменений..."],"Locally saved version applied":["Применена локально сохраненная версия"],"Lock":["Заблокировать"],"Login for connection":["Логин для подключения"],"Logo must be 2 MB or smaller.":["Логотип должен быть не больше 2 МБ."],"Loop":["Зациклить"],"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.":["С другой стороны, разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность как самодостаточных, так и внешне зависимых концептуальных решений."],"Lower scores are better. Aim for a score less than ":["Чем ниже балл, тем лучше. Старайтесь набрать как можно меньше."],"Lowercase":["Строчные"],"Lowercase letters (a-z)":["Строчные буквы (a–z)"],"MB":["MB"],"Magenta":["Пурпурный"],"Mailganer":["Mailganer"],"Mailing Name":["Имя рассылки"],"Mailing address":["Почтовый адрес"],"Mailing automation, audience segmentation, and email personalization.":["Автоматизация рассылок, сегментация аудитории и персонализация писем."],"Mailing successfully created!":["Письмо создано!"],"Make columns the same width.":["Сделать колонки одинаковой ширины."],"Managed in billing settings":["Управляется в настройках оплаты"],"Mandatory. Indicates the traffic source. Example: utm_source=google":["Указывает, какой сайт отправил трафик, и является обязательным параметром. Например: utm_source=google"],"Manufacturing":["Производство"],"Margins":["Отступы"],"Markdown":["Markdown"],"Marker shape":["Форма маркера"],"Marketer":["Маркетолог"],"Mass mailing automation, audience segmentation, and campaign performance analytics.":["Автоматизация массовых рассылок, сегментация аудитории и аналитика по кампаниям."],"Max width":["Ширина изображения"],"Maximum 10 tags available.":["Максимум доступно 10 тегов."],"Maximum 64 characters.":["Не длиннее 64 символов."],"Maximum length":["Максимальная длина"],"Maximum width":["Макс. ширина"],"Maximum {0} colors in the palette.":["В палитре не больше {0} цветов."],"Maximum {0} fonts in the project.":["В проекте не больше {0} шрифтов."],"Maximum {0} social networks.":["Не больше {0} соцсетей."],"Media & Marketing":["Медиа и маркетинг"],"Members":["Участники"],"Menus":["Меню"],"Merchant homepage URL":["Ссылка на сайт магазина"],"Merge bottom cell":["Объединить нижнюю ячейку"],"Merge left cell":["Объединить левую ячейку"],"Merge right cell":["Объединить правую ячейку"],"Merge tags":["Переменные"],"Merge top cell":["Объединить верхнюю ячейку"],"Merge with the chosen block":["Объединить с выделенным блоком"],"Message when validation fails":["Сообщение в случае сбоя проверки"],"Minimap":["Миникарта"],"Minimize code":["Минимизировать код"],"Minimum length 8 characters":["Минимальная длина — 8 символов"],"Minimum width":["Мин. ширина"],"Minus":["Минус"],"Mobile":["На мобильном"],"Mobile L – 425px":["Смартфон L – 425px"],"Mobile M – 375px":["Смартфон M – 375px"],"Mobile S – 320px":["Смартфон S – 320px"],"Mobile view":["Мобильный вид"],"Month":["Месяц"],"More editing features":["Больше возможностей редактирования"],"More options":["Больше настроек"],"More settings":["Больше настроек"],"Move %1$d block to folder “%2$s”?":["Переместить %1$d блок в папку «%2$s»?","Переместить %1$d блока в папку «%2$s»?","Переместить %1$d блоков в папку «%2$s»?"],"Move %1$d template to folder “%2$s”?":["Переместить %1$d шаблон в папку «%2$s»?","Переместить %1$d шаблона в папку «%2$s»?","Переместить %1$d шаблонов в папку «%2$s»?"],"Move block “%1$s” to folder “%2$s”?":["Переместить блок «%1$s» в папку «%2$s»?"],"Move down":["Переместить вниз"],"Move stopped":["Перемещение остановлено"],"Move template “%1$s” to folder “%2$s”?":["Переместить шаблон «%1$s» в папку «%2$s»?"],"Move up":["Переместить вверх"],"Moving files from old storage…":["Перенос файлов со старого хранилища…"],"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).":["Автоматизация мультиканальных кампаний (email, SMS, push, WhatsApp и другие)."],"Name":["Имя"],"Name must be at most 64 characters.":["Название не длиннее 64 символов."],"Need more?":["Нужно больше?"],"New block title":["Название нового блока"],"New blocks":["Новые блоки"],"New email title":["Новое письмо"],"New emails":["Новые письма"],"New file name is required":["Требуется новое имя файла"],"New folder":["Новая папка"],"New folder name is required":["Требуется название новой папки"],"New password":["Новый пароль"],"New project":["Новый проект"],"Newest first":["Сначала новые"],"Newsletter Subscription":["Подписка на новости"],"Newsletter successfully created!":["Рассылка успешно создана!"],"No":["Нет"],"No access to edit the letter.":["Нет доступа к редактированию письма."],"No analytics data for the selected period.":["За выбранный период данных нет."],"No brand colors yet":["Пока нет цветов бренда"],"No card required: we ask for no payment or personal details.":["Карту привязывать не нужно: ни платёжных, ни персональных данных мы не спросим."],"No emails match the search.":["По запросу не найдено ни одного письма."],"No history records available.":["Записи истории отсутствуют."],"No images found.":["Нет изображений."],"No internet connection":["Нет подключения к Интернету"],"No links found.":["Нет ссылок."],"No logo":["Без логотипа"],"No mailing address found. Add one in ActiveCampaign: ":["Почтовый адрес не найден. Добавьте его в ActiveCampaign: "],"No name":["Без названия"],"No one found":["Никого не нашлось"],"No payments yet.":["Платежей пока нет."],"No problems found.":["Проблем не найдено."],"No project fonts yet":["Пока нет шрифтов проекта"],"No projects match the search.":["По запросу не найдено ни одного проекта."],"No properties to edit.":["Нет свойств для редактирования."],"No related blocks found.":["У этого письма нет привязанных шаблонов."],"No social networks yet":["Пока нет соцсетей"],"Non-profit":["Некоммерческая организация"],"None":["Нет"],"Not available for the current payment settings":["Недоступно при текущих настройках оплаты"],"Not available in this context":["Недоступно в данном контексте"],"Not connected":["Не подключено"],"Not defined":["Не определено"],"Not found in Stripo":["Не найдено в Stripo"],"Not imported":["Не импортировано"],"Not now":["Не сейчас"],"Not set":["Не указано"],"Nothing found in Stripo":["В Stripo ничего не найдено"],"Now":["Сейчас"],"Now create an email":["Теперь создайте письмо"],"OGRN / PSRN":["ОГРН / ПСРН"],"OGRN/PSRN must be 13 or 15 digits":["ОГРН / ПСРН должно состоять из 13 или 15 цифр"],"Offer page URL":["Ссылка на страницу акции"],"Offer page or merchant homepage link starting with https:// is required":["Нужна ссылка на страницу акции или на сайт магазина, начинающаяся с https://"],"Ok. I'll be waiting":["Хорошо. Я подожду"],"Okay. I'll log in.":["Хорошо, я авторизуюсь."],"Oldest first":["Сначала старые"],"On request":["По запросу"],"On the left":["Слева"],"On the right":["Справа"],"Onboarding":["Тур по редактору"],"Only a-z, 0-9, hyphen, dot":["Только a-z, 0-9, дефис, точка"],"Oops! Something went wrong":["Ой! Что-то пошло не так"],"Open draft campaign":["Открыть черновик кампании "],"Open in Bento":["Открыть в Bento"],"Open in Brevo":["Открыть в Brevo"],"Open in Campaign Monitor":["Открыть в Campaign Monitor"],"Open in Constant Contact":["Открыть в Constant Contact"],"Open in Dotdigital":["Открыть в Dotdigital"],"Open in GetResponse":["Открыть в GetResponse"],"Open in HubSpot":["Открыть в HubSpot"],"Open in Klaviyo":["Открыть в Klaviyo"],"Open in Mailchimp":["Открыть в Mailchimp"],"Open in Mailganer":["Открыть в Mailganer"],"Open in Marketing Cloud":["Открыть в Marketing Cloud"],"Open in Sendsay":["Открыть в Sendsay"],"Open in Unisender":["Открыть в Unisender"],"Open in enKod":["Открыть в enKod"],"Optimize":["Оптимизация"],"Optional fields":["Необязательные поля"],"Orange":["Оранжевый"],"Ordered list":["Нумерованный список"],"Organization logo":["Логотип компании"],"Other":["Другое"],"Others":["Другие"],"Outlook":["Outlook"],"Outside":["Снаружи"],"PDF":["PDF"],"PJSC Sberbank":["ПАО «Сбербанк»"],"PNG":["PNG"],"Padding":["Внутренний отступ"],"Paid until: ":["Оплачен до: "],"Palette":["Палитра"],"Password":["Пароль"],"Password for connection":["Пароль для подключения"],"Paste block from clipboard":["Вставить блок из буфера обмена"],"Paste image URL here":["Вставьте URL изображения"],"Pay":["Оплата"],"Payment":["Оплата"],"Payment basis":["Условия оплаты"],"Payment history":["История платежей"],"Payment was successful. Limits will update in a few seconds.":["Оплата прошла успешно. Лимиты обновятся через несколько секунд."],"Payment was successful. New AI generations are now available.":["Оплата прошла успешно. Теперь доступны новые генерации с помощью ИИ."],"Payment was successful. Your plan features are now available.":["Оплата прошла успешно. Теперь вы можете пользоваться всеми возможностями вашего тарифного плана."],"Phone":["Телефон"],"Phone must be 3 to 40 characters and contain digits and separators only.":["Телефон — от 3 до 40 символов, только цифры и разделители."],"Phone number":["Телефон"],"Phone or email":["Телефон или email"],"Pick a color.":["Выберите цвет."],"Picture":["Изображение"],"Placeholder":["Плейсхолдер"],"Placeholder text":["Текст плейсхолдера"],"Plain text":["Простой текст"],"Plan":["Тариф"],"Plan usage statistics":["Статистика использования тарифа"],"Play button":["Кнопка воспроизведения"],"Please accept the agreement":["Пожалуйста, примите соглашение"],"Please add a comment to your request":["Введите комментарий к запросу"],"Please choose":["Пожалуйста, выберите"],"Please choose block type":["Пожалуйста, выберите тип блока"],"Please choose the block type":["Пожалуйста, укажите тип блока"],"Please complete payment on the Billing page.":["Пожалуйста, произведите оплату на странице «Тарифы и оплата»."],"Please complete the captcha":["Пожалуйста, пройдите капчу"],"Please complete the captcha to continue.":["Пожалуйста, пройдите капчу, чтобы продолжить."],"Please enter a URL.":["Пожалуйста, введите адрес."],"Please enter a color name.":["Пожалуйста, введите название цвета."],"Please enter a name.":["Пожалуйста, введите название."],"Please enter a valid email address.":["Введите действительный адрес электронной почты."],"Please enter a valid email.":["Пожалуйста, введите корректный email."],"Please enter the URL.":["Пожалуйста, введите адрес"],"Please enter the block name":["Введите название блока"],"Please enter the correct URL.":["Пожалуйста, введите правильный адрес."],"Please enter the correct email address.":["Пожалуйста, введите корректный адрес почты."],"Please enter the correct email.":["Пожалуйста, введите корректную эл. почту"],"Please enter the description":["Введите описание"],"Please enter the email name":["Введите имя письма"],"Please enter the folder name":["Введите имя папки "],"Please enter the group name":["Введите название группы"],"Please enter the project name":["Пожалуйста, введите название проекта"],"Please enter valid email":["Введите действительный адрес электронной почты"],"Please enter your email address":["Пожалуйста, укажите свой адрес эл. почты"],"Please enter your password":["Пожалуйста, введите свой пароль"],"Please input block name":["Пожалуйста укажите название блока"],"Please input container width":["Пожалуйста, укажите ширину блока"],"Please input tags!":["Пожалуйста, введите теги!"],"Please input type!":["Пожалуйста, введите тип!"],"Please log in":["Необходим вход в систему"],"Please select":["Пожалуйста, выберите"],"Please set the 'Type' field in the Settings section.":["Пожалуйста, заполните поле «Тип» в настройках блока."],"Please set the background color":["Пожалуйста, установите цвет фона"],"Please set the font color":["Установите цвет текста"],"Please type correct emails":["Пожалуйста, введите верные адреса получателей"],"Please type emails":["Пожалуйста, введите адреса получателей"],"Please type subject":["Укажите тему письма"],"Please type the project name.":["Пожалуйста, укажите название проекта."],"Please type the webhook URL.":["Пожалуйста, введите адрес вебхука."],"Please type your email address.":["Пожалуйста, укажите свой адрес электронной почты."],"Please type your password confirmation code.":["Пожалуйста, укажите код подтверждения."],"Please type your password.":["Пожалуйста, введите свой пароль."],"Please upgrade your plan.":["Пожалуйста, обновите тарифный план.\\n"],"Please upload a JPG, PNG, or WebP image.":["Загрузите изображение в формате JPG, PNG или WebP."],"Plugin":["Плагин"],"Plugin connected":["Плагин подключён"],"Plugin connection request":["Заявка на подключение плагина"],"Plugin is not connected":["Плагин не подключён"],"Plus":["Плюс"],"Pointer":["Треугольник"],"Polls":["Опросы"],"Port":["Порт"],"Portrait":["Вертикальная"],"Position in cell":["Положение в ячейке"],"Prefer spaces over tabs.":["Делать табуляцию пробелами."],"Prefix path inside the bucket for project files":["Префикс — путь внутри бакета для файлов проекта"],"Preheader":["Прехедер"],"Preheader copied to email settings":["Прехедер скопирован в настройки письма"],"Preparing countdown preview…":["Готовим превью таймера..."],"Preparing video preview…":["Готовим превью видео..."],"Preview":["Предпросмотр"],"Preview mode":["Предпросмотр"],"Price":["Цена"],"Price currency":["Валюта"],"Price currency must be a three-letter ISO 4217 code, for example USD":["Валюта указывается трёхбуквенным кодом ISO 4217, например USD"],"Privacy Policy.":["Политикой конфиденциальности."],"Product carousel":["Карусель товаров"],"Profile":["Профиль"],"Project":["Проект"],"Project files are stored on the built-in Blocks CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN Blocks. Дополнительно настраивать подключение не нужно."],"Project files are stored on the built-in EmailMaker CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN EmailMaker. Дополнительно настраивать подключение не нужно."],"Project information":["Информация о проекте"],"Project name":["Название проекта"],"Project name must be at most 100 characters.":["Название проекта не длиннее 100 символов."],"Project not found.":["Проект не найден."],"Project settings":["Настройки проекта"],"Project styles":["Стили проекта"],"Project styles saved.":["Стили проекта сохранены."],"Project switched to the built-in storage.":["Проект переключён на встроенное хранилище."],"Projects":["Проекты"],"Promo code applied.":["Промокод применен."],"Promocodes":["Промокоды"],"Promotion cards":["Промокарточки"],"Proofreader":["Корректор "],"Psychologist":["Психолог"],"Public URL":["Публичный адрес"],"Public access key":["Публичный ключ доступа"],"Public offer":["Публичная оферта"],"Purple":["Фиолетовый"],"Push block update to all templates":["Применить обновление блока ко всем шаблонам"],"Quarter":["Квартал"],"Radio button":["Радиокнопка"],"Ready-made HTML template for testing the plugin locally.":["Готовый HTML-шаблон, чтобы проверить плагин локально."],"Real Estate":["Недвижимость"],"Real-time notifications about email-related events.":["Уведомления о событиях с письмами в реальном времени."],"Receipt":["Чек"],"Recipients":["Получатели"],"Recommended":["Рекомендуемые"],"Recover":["Восстановить"],"Recover password":["Восстановить пароль"],"Recurring payments disabled":["Автоплатёж отключён"],"Recurring payments enabled":["Автоплатёж включён"],"Red":["Красный"],"Redo (Ctrl+Shift+Z)":["Повторить (Ctrl+Shift+Z)"],"Refresh":["Обновить"],"Refresh inbox":["Обновить почтовый ящик"],"Reload page":["Перезагрузить страницу"],"Remaining:":["Осталось:"],"Remember me":["Запомнить меня"],"Remove":["Удалить"],"Remove annotations":["Удалить аннотации"],"Remove block":["Удалить блок"],"Remove column":["Удалить столбец"],"Remove element":["Удалить элемент"],"Remove element by Delete Key":["Удалить элемент (Delete)"],"Remove file":["Удалить файл"],"Remove group":["Удалить группу"],"Remove logo":["Удалить логотип"],"Remove member":["Удалить участника"],"Remove row":["Удалить строку"],"Remove slide":["Удалить слайд"],"Rename":["Переименовать"],"Rename block":["Переименовать блок"],"Rename email":["Переименовать письмо"],"Reorder block":["Переместить блок"],"Reorder element":["Переместить элемент"],"Reorder group":["Переместить группу"],"Repeat background (repeat)":["Повторять фон (repeat)"],"Repeat background horizontally (repeat-x)":["Горизонтальное повторение фона (repeat-x)"],"Repeat background vertically (repeat-y)":["Вертикальное повторение фона (repeat-y)"],"Repeat the new password":["Повторите новый пароль"],"Replace the preheader":["Вставить в прехедер письма"],"Replace the title":["Вставить в заголовок письма"],"Reply":["Ответить"],"Reply to the comment":["Ответить на комментарий"],"Request for changing the pricing plan":["Запрос на смену тарифа"],"Request sent successfully.":["Запрос отправлен."],"Requests JSON":["JSON с запросами"],"Required field":["Обязательное поле"],"Resend":["Отправить повторно"],"Responsive email":["Адаптировать письмо в моб. устройствах"],"Restore %1$d block to folder “%2$s”?":["Восстановить %1$d блок в папку «%2$s»?","Восстановить %1$d блока в папку «%2$s»?","Восстановить %1$d блоков в папку «%2$s»?"],"Restore %1$d template to folder “%2$s”?":["Восстановить %1$d шаблон в папку «%2$s»?","Восстановить %1$d шаблона в папку «%2$s»?","Восстановить %1$d шаблонов в папку «%2$s»?"],"Restore block “%1$s” to folder “%2$s”?":["Восстановить блок «%1$s» в папку «%2$s»?"],"Restore template “%1$s” to folder “%2$s”?":["Восстановить шаблон «%1$s» в папку «%2$s»?"],"Resume":["Резюме"],"Retail & E-commerce":["Розница и e-commerce"],"Retry":["Повторить"],"Retry failed":["Повторить неудавшиеся"],"Reverse order on desktop":["Изменить порядок в десктопе"],"Revoke the invite":["Отозвать приглашение"],"Right":["Справа"],"Right Code panel":["Панель кода справа"],"Right padding":["Отступ справа"],"Right to left":["Справа налево"],"Role":["Роль"],"Rotate":["Перевыпустить"],"Rotate client secret?":["Перевыпустить Client Secret?"],"Rotate secret":["Перевыпустить секрет"],"Round":["Круглый"],"Rounded corners in Outlook (VML)":["Закругленные углы в Outlook (VML)"],"SMS":["СМС"],"Safe Fonts":["Безопасные шрифты"],"Sandbox HTML file":["HTML-файл песочницы"],"Sans Serif":["Sans Serif"],"Save":["Сохранить"],"Save %d block":["Сохранить %d блок","Сохранить %d блока","Сохранить %d блоков"],"Save all blocks":["Сохранить все блоки"],"Save and continue":["Сохранить и продолжить"],"Save block":["Сохранить блок"],"Save by Ctrl+S":["Ctrl+S"],"Save by ⌘S":["Сохранить ( ⌘S )"],"Save email first.":["Сначала сохраните письмо."],"Save the block before commenting.":["Сохраните блок перед комментированием."],"Save the email before commenting.":["Сохраните письмо перед комментированием."],"Save to Blocks":["Сохранить в Блоки"],"Save to Blocks button.":["Сохранить в Блоки"],"Saved blocks":["Сохранённые блоки"],"Saving changes in the block":["Сохранение изменений в блоке"],"Search":["Поиск"],"Search GIFs":["Поиск GIF"],"Search a block":["Найти блок"],"Search by name":["Поиск по названию"],"Search by title":["Поиск по названию"],"Search image":["Поиск изображения"],"Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.":["В обширной галерее стоковых фотографий и GIF-файлов вы найдете изображения для любого случая. Вы можете отфильтровать результаты по ориентации изображения, цветовой гамме и т. д."],"Secret Access Key":["Секретный ключ доступа"],"Secret access key":["Секретный ключ доступа"],"Secret is masked. Use Rotate to get a new secret once.":["Секрет скрыт. Нажмите «Перевыпустить», чтобы один раз увидеть новый."],"Section":["Раздел"],"Section ":["Раздел"],"Section title":["Заголовок раздела"],"Security":["Безопасность"],"Select a font family":["Выберите шрифт"],"Select a theme":["Выберите тему"],"Select all %d":["Выбрать все: %d"],"Select company size":["Выберите размер компании"],"Select email template":["Выберите шаблон письма"],"Select industry":["Выберите отрасль"],"Select period":["Выберите период"],"Select plan":["Выбрать тариф"],"Select the block type to find any block on the list faster.":["Выберите тип блока, чтобы быстрее найти любой блок в списке."],"Select the time zone":["Выберите часовой пояс"],"Selected %1$d, your plan allows %2$d more emails.":["Выбрано: %1$d, по тарифу можно создать ещё писем: %2$d."],"Send":["Отправить"],"Send a test email":["Отправить тест"],"Send again":["Повторить"],"Sender Email":["Email отправителя"],"Sender Name":["Имя отправителя"],"Sendsay":["Sendsay"],"Separators":["Разделители"],"Serif":["Serif"],"Server is unavailable":["Сервер недоступен"],"Set":["Установить"],"Set new password":["Установить новый пароль"],"Set the type":["Укажите тип"],"Settings":["Настройки"],"Shadow inside or outside of the element":["Если включено, то тень будет внутри элемента."],"Share":["Поделиться"],"Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.":["Поделитесь проектом со своей командой и сотрудничайте в режиме реального времени. Добавляйте комментарии к отдельным блокам писем и обсуждайте необходимые правки прямо в конструкторе."],"Short company name":["Краткое название компании"],"Show eye icon":["Показать иконку глаза"],"Show more":["Показать ещё"],"Shuffle options":["Параметры перемешивания"],"Sign In":["Войти"],"Sign Up":["Зарегистрироваться"],"Sign in to your account to activate the trial period.":["Войдите в свою учетную запись, чтобы активировать пробный период."],"Sign in with eLama":["Войти через eLama"],"Sign out":["Выйти"],"Single image preview":["Одно изображение"],"Single quotation":["Кавычка"],"Site":["Сайт"],"Size":["Размер"],"Small desktop – 768px":["Небольшой десктоп – 768px"],"Social buttons":["Кнопки соцсетей"],"Social media":["Соцсети"],"Social network name":["Название соцсети"],"Social network settings":["Настройки соцсети"],"Social networks":["Соцсети"],"Solid":["Сплошная"],"Some blocks were not saved successfully.":["Некоторые блоки не были сохранены."],"Some images were left as links to Stripo":["Часть картинок осталась ссылками на Stripo"],"Something went wrong":["Ошибка редактирования. Обратитесь в техподдержку."],"Something went wrong during layout conversion. You can try running the conversion again.":["При конвертации шаблона произошла ошибка. Вы можете повторить конвертацию."],"Something went wrong, please try again":["Что-то пошло не так. Попробуйте ещё раз."],"Something went wrong.":["Что-то пошло не так."],"Something went wrong. Try again later.":["Что-то пошло не так. Попробуйте позже."],"Soon":["Скоро"],"Sorry, the page you visited does not exist.":["Извините, страница, которую вы посетили, не существует."],"Source code validation":["Проверка кода"],"Spacer":["Отступ"],"Spacing":["Интервал"],"Spam checks":["Проверка на спам"],"Spam validation was successfully completed":["Проверка на спам завершена"],"SpamAssassin":["SpamAssassin"],"Special characters":["Специальные символы"],"Specifies the block width.":["Задаёт ширину блока."],"Split blocks":["Разделить блоки"],"Split cell":["Разделить ячейку"],"Spread radius":["Распространение"],"Square":["Квадрат"],"Squarish":["Квадратная"],"Star":["Звезда"],"Start Trial":["Начать Триал"],"Start date":["Дата начала"],"Start from scratch":["Начать с чистого листа"],"Start the trial":["Включить пробный период"],"Start typing the title":["Начните писать название"],"Start with a detailed description of your email.":["Начните с подробного описания вашего письма."],"Starts":["Начало"],"Status":["Статус"],"Stay":["Остаться"],"Stock":["Фотосток"],"Stock photos and GIFs":["Стоковые изображения"],"Stopping…":["Остановка…"],"Storage settings":["Настройки хранилища"],"Storage type":["Тип хранилища"],"Stored or bound value for this field":["Сохраненное или заданное значение для этого поля"],"Stored or bound value for this option":["Сохраненное или заданное значение для этого параметра"],"Strikethrough ( Alt+Shift+5 )":["Зачёркнутый ( Alt+Shift+5 )"],"Strikethrough ( ⌘+Shift+X )":["Зачёркнутый ( ⌘+Shift+X )"],"Stripo API key":["API-ключ Stripo"],"Stripo did not accept this key. Check that it is the REST API key of your Stripo project.":["Stripo не принял этот ключ. Проверьте, что это ключ REST API вашего проекта Stripo."],"Stripo did not respond":["Stripo не ответил"],"Stripo is not responding. Try again later.":["Stripo не отвечает. Попробуйте позже."],"Stripo stopped accepting the API key. Update the key and repeat the import.":["Stripo перестал принимать API-ключ. Обновите ключ и повторите импорт."],"Stripo templates become project templates, emails become emails. Folders are recreated, images are copied to the project storage. Items already imported are skipped when you select all.":["Шаблоны Stripo станут шаблонами проекта, письма — письмами. Папки будут воссозданы, картинки скопированы в хранилище проекта. При выборе всех уже импортированные элементы пропускаются."],"Stroke color":["Цвет контура"],"Strong":["Полужирный"],"Strong ( Ctrl+B )":["Полужирный ( Ctrl+B )"],"Strong ( ⌘B )":["Полужирный ( ⌘B )"],"Subject":["Тема"],"Subject line & preheader generator":["Генератор темы и прехедера"],"Subscription ID is missing":["Отсутствует идентификатор подписки"],"Subscription summary":["Сведения о подписке"],"Success":["Готово"],"Success!":["Готово!"],"Supported formats: .woff, .woff2, .ttf, .otf. Maximum file size is 5 MB.":["Поддерживаемые форматы: .woff, .woff2, .ttf, .otf. Файл не больше 5 МБ."],"Supported: .woff, .woff2, .ttf, .otf — up to {0} MB.":["Поддерживаются .woff, .woff2, .ttf, .otf — до {0} МБ."],"Swap columns":["Поменять местами"],"Switch to a different plan to save more emails.":["Перейдите на другой тариф, чтобы иметь возможность сохранять новые шаблоны."],"Syncing with the server in the background...":["Происходит синхронизация с сервером в фоновом режиме..."],"System":["Системная"],"System theme":["Системная тема"],"TIN (INN)":["ИНН"],"TIN (INN) must be 10 or 12 digits":["ИНН должен состоять из 10 или 12 цифр"],"Tab size":["Величина отступа"],"Table":["Таблица"],"Table view":["Таблица"],"Table width":["Ширина таблицы"],"Tags":["Теги"],"Tags help you find the block in the list.":["Теги помогают найти блок в списке."],"Tariff and payment":["Тариф и оплата"],"Teal":["Бирюзовый"],"Team collaboration":["Командная работа"],"Technical support":["Техническая поддержка"],"Technology & Software":["Технологии и ПО"],"Template":[" Шаблон"],"Template Name":["Название шаблона"],"Template blocks":["Блоки шаблона"],"Template conversion":["Конвертация шаблона"],"Template from another editor":["Шаблон из другого редактора"],"Template is not mobile-friendly":["Шаблон может некорректно отображаться в телефоне"],"Template successfully created!":["Шаблон создан!"],"Templates":["Шаблоны"],"Terms":["Условиями использования"],"Test sends":["Тесты отображения"],"Text":["Текст"],"Text & background":["Текст и фон"],"Text align center":["Текст по центру"],"Text align center ( Ctrl+Shift+E )":["По центру ( Ctrl+Shift+E )"],"Text align center ( ⌘+Shift+E )":["По центру ( ⌘+Shift+E )"],"Text align justify":["Текст по ширине"],"Text align justify ( Ctrl+Shift+J )":["По ширине ( Ctrl+Shift+J )"],"Text align justify ( ⌘+Shift+J )":["По ширине ( ⌘+Shift+J )"],"Text align left":["Текст слева"],"Text align left ( Ctrl+Shift+L )":["По левому краю ( Ctrl+Shift+L )"],"Text align left ( ⌘+Shift+L )":["По левому краю ( ⌘+Shift+L )"],"Text align right":["Текст справа"],"Text align right ( Ctrl+Shift+R )":["По правому краю ( Ctrl+Shift+R )"],"Text align right ( ⌘+Shift+R )":["По правому краю ( ⌘+Shift+R )"],"Text background":["Фон текста"],"Text beside the box":["Текст рядом с полем"],"Text color":["Цвет текста"],"Text copied to clipboard":["Скопировано в буфер обмена"],"Text font":["Шрифт текста"],"Text replacer":["Замена текста"],"Text size":["Размер текста"],"Text subscript":["Подстрочный текст"],"Text superscript":["Надстрочный текст"],"Text visible at the start":["Текст, отображаемый в начале"],"That\`s all we could find.":["Это все, что мы смогли найти."],"The ":[" "],"The Pro plan is not available.":["Тариф «Pro» недоступен."],"The URL that the hyperlink directs to.":["URL, на который указывает ссылка."],"The account number must be 20 digits":["Номер счета должен состоять из 20 цифр"],"The align attribute sets the horizontal alignment of the table.":["Атрибут align устанавливает горизонтальное выравнивание таблицы."],"The block \\"":["Блок «"],"The block was successfully renamed.":["Блок переименован."],"The block was successfully saved.":["Блок сохранен."],"The block will change its colors to contrasting colors. You can change them in the Content Styles section.":["Блок изменит свои цвета на контрастные. Вы можете изменить их в разделе «Стили контента»."],"The block “":["Блок «"],"The captcha is invalid or expired. Please try again.":["Капча неверна или срок её действия истек. Пожалуйста, попробуйте ещё раз."],"The code size exceeds the recommended value 90kB":["Размер кода превышает рекомендуемое значение 90 кБ."],"The code that will replace this text":["Код, который заменит этот текст"],"The copies were successfully created.":["Копии созданы."],"The copy of block “":["Копия блока «"],"The copy of email \\"":["Копия письма \\""],"The current code size is":["Текущий размер кода составляет"],"The current template will be changed to the generated one, are you sure about this?":["Текущий шаблон будет заменен на сгенерированный, вы уверены в этом?"],"The draft of the block has been deleted.":["Черновик блока удалён."],"The draft of the email has been deleted.":["Черновик письма удалён."],"The email \\"":["Письмо \\""],"The email has been copied to the clipboard.":["Код письма скопирован в буфер обмена."],"The email limit of your plan has been reached.":["Лимит писем вашего тарифа исчерпан."],"The email was successfully renamed.":["Письмо переименованно."],"The email was successfully saved.":["Письмо сохранено."],"The email “":["Письмо «"],"The feature is under development.":["Функционал находится в разработке."],"The folder \\"":["Папка «"],"The folder “":["Папка «"],"The font-size CSS property sets the size of the font.":["Свойство font-size устанавливает размер шрифта."],"The global block was updated.":["Глобальный блок был обновлён."],"The group “":["Группа «"],"The image could not be uploaded.":["Не удалось загрузить изображение."],"The image was successfully uploaded.":["Изображение загружено."],"The import failed. Try again later.":["Импорт не удался. Попробуйте позже."],"The inbox has been updated.":["Почтовый ящик обновлён."],"The invitation has been sent":["Приглашение отправлено"],"The maximum number of requests for the current subscription period has been reached.\\nSelect the appropriate plan to fulfil more requests":["Максимальное количество запросов для текущего периода подписки достигнуто.\\nВыберите соответствующий тариф для выполнения большего количества запросов."],"The password does not meet the requirements:":["Пароль не соответствует требованиям безопасности:"],"The password is too simple.":["Слишком простой пароль."],"The payment widget failed to load. Refresh the page and try again.":["Не удалось загрузить виджет оплаты. Обновите страницу и попробуйте ещё раз."],"The previous secret will stop working immediately.":["Прежний секрет перестанет работать сразу."],"The project \\"":["Проект «"],"The saved key no longer works. Enter a new one.":["Сохранённый ключ больше не работает. Введите новый."],"The selected element is in the block that supports a multicolumn structure. To add a new column, click the \\"Add a column\\" button.":["Выделенный элемент находится в блоке, в котором можно организовать многоколоночную структуру. Для добавления новой колонки нажмите кнопку «Добавить колонку»."],"The server returned an unexpected response. Please try again or contact support.":["Сервер вернул неожиданный ответ. Попробуйте ещё раз или обратитесь в службу поддержки."],"The specified parameters will be added to all links when exporting the email.":["Специальные параметры будут добавлены во все ссылки при экспорте."],"The test email will be sent to the specified addresses.":["Тестовое письмо будет отправлено на указанные адреса."],"The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it.":["Название отображается в списке шаблонов и зачастую совпадает с темой письма, но вы можете его изменить."],"The trash is empty.":["Корзина пуста."],"The trial has ended. You are on the Free plan.":["Пробный период закончился. Вы пользуетесь тарифом «Free»."],"The two passwords that you entered do not match!":["Два введенных вами пароля не совпадают!"],"The usage limit has been exceeded":["Превышен лимит использования"],"The whole email":["Всё письмо"],"Theme":["Тема"],"There are no blocks for this request.":["По данному запросу ничего не найдено."],"There are no members yet":["Участников пока нет"],"There's no such comment.":["Нет такого комментария."],"There's no such element in the email.":["В письме нет такой метки."],"These global blocks have a newer saved version. Select the ones to update in the template.":["Для этих глобальных блоков имеется более новая сохраненная версия. Выберите в шаблоне те из них, которые необходимо обновить."],"This action cannot be undone.":["Это действие нельзя отменить."],"This and other features are available for you on a higher plan.":["Эти и другие функции доступны для вас на более старшем тарифном плане."],"This can be the name of your company, department, website, project, marketing campaign, or other activity.":["Это может быть название вашей компании, отдела, веб-сайта, проекта или сферы деятельности, для которой вы планируете создать рассылку."],"This element":["Этот элемент"],"This email must be verified in Mailganer":["Адрес необходимо подтвердить в Mailganer"],"This email must be verified in Sendsay":["Адрес необходимо подтвердить в Sendsay"],"This email must be verified in Unisender":["Адрес необходимо подтвердить в Unisender"],"This field is required":["Это обязательное поле"],"This field sets the width of the email.":["Это поле выставляет ширину письма."],"This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.":["Это глобальный блок. Вы можете создать новый блок, чтобы изменения вступили в силу только в этом письме, или обновить текущий — в этом случае изменения будут применены везде, где используется этот блок."],"This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.":["Этот шаблон не был создан в нашем редакторе. Преобразуйте его, чтобы получить доступ ко всем возможностям редактирования: легко изменяйте тексты, заменяйте изображения и управляйте блоками."],"This link cannot be used as a font source.":["Эту ссылку нельзя использовать как источник шрифта."],"This may take several minutes. Please keep this tab open.":["Это может занять несколько минут. Пожалуйста, не закрывайте эту вкладку."],"This promo code is already applied.":["Промокод уже применен."],"This section will be implemented in a separate task.":["Раздел пока в разработке."],"This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control.":["Этот шаблон создан в другом редакторе. Пересоберите его из наших компонентов и получите стабильное отображение, редактирование без ошибок и полный контроль над дизайном."],"Time":["Время"],"Time units font settings":["Шрифт единиц времени"],"Time zone":["Часовой пояс"],"Title":["Название"],"Title copied to email settings":["Заголовок скопирован в настройки письма"],"Title should not be empty":["Заголовок не должен быть пустым"],"Title shown above the control":["Название, отображаемое над элементом управления"],"To add a block from the dashboard click the":["Чтобы добавить блок, нажмите в визуальном редакторе письма кнопку"],"To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.":["Чтобы избежать этой проблемы, отключите перевод данного сайта в настройках браузера или отключите функцию автоматического перевода."],"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.":["Для изменения внешнего вида элемента в мобильном устройстве, внесите правки в поля ниже. Если поле пустое, то в мобильной версии применятся стили для десктопа."],"To create a copy, you need to save the block.":["Чтобы создать копию, вы должны сохранить блок."],"To create a copy, you need to save the email.":["Чтобы создать копию, вы должны сохранить письмо."],"To emails":["В письма"],"To fully address all necessary tasks in any field":["Чтобы в полной мере решить все необходимые задачи в любой области"],"To get started quickly":["Чтобы быстро приступить к работе"],"To import from Stripo, add the REST API key of your Stripo project: <1>open the project settings in Stripo</1>, find “Access the REST API” and generate a key.":["Чтобы импортировать из Stripo, добавьте ключ REST API вашего проекта Stripo: <1>откройте настройки проекта в Stripo</1>, найдите «Access the REST API» и сгенерируйте ключ."],"To leave comments you must be logged into Blocks and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To leave comments you must be logged into EmailMaker and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To preview and edit the uploaded image":["Предварительный просмотр и редактирование загруженного изображения"],"To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.":["Чтобы отправить тестовое письмо, вам необходимо подтвердить свой адрес электронной почты. Если вы не получили ссылку для подтверждения, обратитесь в службу поддержки через чат или по электронной почте {supportEmail}."],"Today":["Сегодня"],"Too many items selected. One import takes up to 1000 items.":["Выбрано слишком много. Один импорт берёт до 1000 элементов."],"Tooltip or hint text":["Всплывающая подсказка или текст подсказки"],"Tooltip text":["Текст всплывающей подсказки"],"Top":["Сверху"],"Top left corner":["Верхний левый угол"],"Top margin":["Отступ сверху"],"Top padding":["Отступ сверху"],"Top right corner":["Верхний правый угол"],"Top up balance":["Пополнить баланс"],"Transfer to folder":["Переместить"],"Translator":["Переводчик"],"Transparency":["Прозрачность"],"Trial":["Триал"],"Trial activated":["Пробная версия активирована"],"Trial active":["Пробная версия активна"],"Trial period activated.":["Пробный период активирован."],"Try again":["Попробовать ещё раз"],"Try every editor feature — free":["Попробуйте все возможности редактора — бесплатно"],"Try for free":["Попробуйте бесплатно"],"Try reloading the page.":["Попробуйте перезагрузить страницу."],"Try sign in with your new password.":["Попробуйте войти с новым паролем."],"Turn on a 14-day trial and the whole editor opens up:":["Включим пробный период на 14 дней — и редактор откроется целиком:"],"Type":["Тип"],"Type category here":["Укажите категорию"],"Type in the project's webhook":["Введите проект webHook"],"Type subject":["Укажите тему письма"],"Type the output parameters of your platform. E.g., ":["Указывайте символы вывода параметра вашей платформы. Например, "],"Type title here":["Введите название"],"Type your description here":["Введите описание"],"Type your request":["Введите ваш запрос"],"Type your tags here":["Укажите теги"],"Typing...":["Ввод текста..."],"Typograf":["Типограф"],"Typography":["Типограф"],"URL":["URL"],"URL must start with https://":["Адрес должен начинаться с https://"],"URL of the video clip.":["URL-адрес видеоклипа."],"UTM parameters":["UTM-метки"],"Unavailable":["Недоступно"],"Underline":["Подчёркнутый"],"Underline ( Ctrl+U )":["Подчёркнутый ( Ctrl+U )"],"Underline ( ⌘U )":["Подчёркнутый ( ⌘U )"],"Undo (Ctrl+Z)":["Отменить (Ctrl+Z)"],"Unisender":["Unisender"],"Unknown error":["Неизвестная ошибка"],"Unknown integration":["Неизвестная интеграция"],"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"Unlock":["Разблокировать"],"Unordered list":["Ненумерованный список"],"Unsaved changes":["Несохранённые изменения"],"Untitled email.":["Письмо без названия."],"Up to parent element":["Перейти к контейнеру"],"Update":["Обновить"],"Update current block":["Обновить текущий блок"],"Update date":["Дата обновления"],"Update global blocks":["Обновить глобальные блоки"],"Updated":["Обновлено"],"Upload":["Загрузить"],"Upload .woff, .woff2, .ttf or .otf files for use in the email editor.":["Загрузите файлы .woff, .woff2, .ttf или .otf, чтобы использовать их в редакторе писем."],"Upload Image":["Загрузить изображение"],"Upload failed":["Загрузка не удалась"],"Upload first font":["Загрузить первый шрифт"],"Upload font":["Загрузить шрифт"],"Upload logo":["Загрузить логотип"],"Upload your email":["Загрузить своё письмо"],"Uppercase":["Заглавные"],"Uppercase letters (A-Z)":["Заглавные буквы (A–Z)"],"Usage analytics":["Аналитика использования"],"Use custom icon for checked state":["Использовать пользовательскую иконку для отмеченного состояния"],"Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.":["Используйте наш визуальный редактор, чтобы настроить каждый элемент под свои нужды: изменить рамки и их радиус, тени, отступы, фон и многое другое."],"Use this email as a template for creating future emails.":["Используйте это письмо в качестве шаблона для создания будущих писем."],"Use this one":["Использовать эту"],"Use your own styles instead of defaults for states such as error, focus, and success.":["Используйте собственные стили вместо стандартных для таких состояний, как «ошибка», «фокус» и «успех»."],"Used":["Используемые"],"User":["Пользователь"],"Username":["Логин"],"VAT":["НДС"],"Valid":["Верно"],"Valid until":["Оплачен до"],"Validation error message":["Сообщение об ошибке проверки"],"Value":["Значение"],"Variable value":["Значение переменной"],"Version history":["Контроль версий"],"Version of":["Версия от"],"Vertical":["Вертикальный"],"Vertical alignment":["Верт. выравнивание"],"Vertical offset":["Верт. смещение"],"Vertical padding":["Вертикальный отступ"],"Vertical position":["Верт. смещение"],"Video":["Видео"],"Video URL":["URL-адрес видео"],"View only — you cannot edit settings in this section.":["Только просмотр — настройки в этом разделе менять нельзя."],"Vimeo":["Vimeo"],"Visibility":["Видимость"],"Visibility in AMP":["Видимость в AMP"],"Visit site":["Перейти на сайт"],"Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.":["Хотите изменить размер изображения, добавить текст или применить фильтр? Не нужно покидать EmailMaker! Все основные изменения вы можете сделать в нашем редакторе изображений."],"Warning":["Предупреждение"],"Warnings":["Предупреждения"],"We are always in touch":["Мы всегда на связи"],"We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.":["Мы автоматически удалили внедренный код. Чтобы избежать этой проблемы, отключите расширение для этого сайта или воспользуйтесь редактором в окне инкогнито без расширений."],"Web version":["Веб-версия"],"Webhook":["WebHook"],"Webhook URL":["Вебхук"],"Webhook settings":["Настройки вебхука"],"Webhook successfully sent!":["WebHook отправлен!"],"Website link":["Ссылка на сайт"],"Week":["Неделя"],"What's new":["Что нового"],"When the trial ends, the service switches to the free plan.":["Когда триал закончится, сервис перейдёт в бесплатный режим."],"When the trial ends, you will return to the Free plan.":["По окончании пробного периода вы вернётесь к тарифу «Free»."],"When you need more letters, additional projects and participants":["Если вам понадобится больше писем, дополнительных проектов и участников"],"While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices.":["Похоже, при редактировании шаблона, некоторые элементы перестали помещаться в экран мобильного устройства. Попробуйте уменьшить их ширину."],"White":["Белый"],"White circle":["Белый круг"],"White circle outlined":["Белый круг обводка"],"Width":["Ширина"],"With VAT":["С НДС"],"With VAT / without VAT":["С НДС / без НДС"],"With warnings":["С предупреждениями"],"Without VAT":["Без НДС"],"Without background color":["Без цвета фона"],"Without button":["Без кнопки"],"Without folder":["Без папки"],"Without image":["Без картинки"],"Without shadow":["Без тени"],"Work with the HTML code":["Работа с HTML-кодом"],"Work with your markup":["Работайте со своей вёрсткой"],"Year":["Год"],"Yes":["Да"],"You are buying a set of AI generation requests:":["Вы приобретаете набор запросов на генерацию с помощью ИИ:"],"You are buying an extra email generation package:":["Вы приобретаете дополнительный пакет для создания писем:"],"You are buying an extra image check package:":["Вы приобретаете дополнительный пакет проверки изображений:"],"You are buying an extra image generation package:":["Вы приобретаете дополнительный пакет для генерации изображений:"],"You are buying an extra link check package:":["Вы приобретаете дополнительный пакет проверки ссылок:"],"You are buying an extra optimization package:":["Вы приобретаете дополнительный пакет оптимизации:"],"You are buying an extra preview/test sends package:":["Вы приобретаете дополнительный пакет тестов:"],"You are buying an extra spam check package:":["Вы приобретаете дополнительный пакет проверки на спам:"],"You are paying for the plan:":["Вы оплачиваете тарифный план:"],"You are running out of AI tool usage.":["Ваш лимит использования инструментов ИИ подходит к концу."],"You can activate a 2-week trial version that includes access to all features.":["Вы можете активировать 2-недельную пробную версию, которая включает доступ ко всем функциям."],"You can add more generations right now; they are billed separately from the generations included in your plan.":["Вы можете добавить дополнительные генерации прямо сейчас; их стоимость оплачивается отдельно от генераций, включенных в ваш тарифный план."],"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.":["Вы также можете сохранить все блоки сразу. ИИ ассистент автоматически определит тип и создаст имя для каждого блока при сохранении."],"You can close this window: the import continues in the background.":["Окно можно закрыть: импорт продолжится в фоне."],"You can get more emails and access to all features.":["Вы сможете создавать больше писем и получить доступ ко всем функциям."],"You can increase the limit by changing your plan or buying an extra package.":["Вы можете увеличить лимит, сменив тарифный план."],"You can increase the number of emails right now.":["Вы можете увеличить количество писем прямо сейчас."],"You can save blocks from the email template.":["Вы можете сохранить блоки из шаблона письма."],"You cannot switch plans because a limit has been exceeded.":["Вы не можете сменить тарифный план, так как превышен лимит."],"You changed the role of ":["Вы поменяли роль "],"You deleted ":["Вы исключили пользователя "],"You deleted yourself from the project successfully.":["Вы исключили себя из проекта."],"You do not have permission to edit project styles.":["У вас нет прав на редактирование стилей проекта."],"You do not have permission to view this section.":["У вас нет прав на просмотр этого раздела."],"You don't have any blocks in this folder.":["У вас нет блоков в этой папке."],"You don't have any blocks yet.":["У вас еще нет сохранённых блоков."],"You don't have any emails in this folder.":["В папке пока нет писем."],"You don't have any emails yet.":["У вас еще нет сохранённых писем."],"You don't have any projects yet.":["У вас пока нет проектов."],"You don\`t have any saved blocks yet.":["У вас ещё нет сохранённых блоков."],"You have reached the limit of AI chat usage.":["Вы достигли предела использования чата ИИ.\\n"],"You have reached the limit of AI generator usage.":["Вы достигли предела использования генератора ИИ.\\n"],"You have unsaved changes. Leave this page without saving?":["У вас есть несохранённые изменения. Покинуть страницу без сохранения?"],"You have used up the number of emails you can create on your current plan":["Вы исчерпали лимит на количество писем, которое можно создать в рамках вашего текущего тарифа"],"You have used up your AI generations":["Вы исчерпали лимит генераций ИИ"],"You have used up your image check limit":["Вы исчерпали лимит проверки изображений"],"You have used up your image generation limit":["Вы исчерпали лимит на генерацию изображений"],"You have used up your link check limit":["Вы исчерпали лимит проверок ссылок"],"You have used up your optimisation limit":["Вы исчерпали лимит оптимизаций"],"You have used up your preview (test send) limit":["Вы исчерпали лимит на просмотр в почтовиках"],"You have used up your spam check limit":["Вы исчерпали лимит проверок на спам"],"You have used up your test send limit":["Вы исчерпали лимит тестовых отправок"],"You reached the plan limit":["Достигнут лимит тарифа"],"You revoke invite for ":["Вы отзываете приглашение для "],"Your Altcraft Platform URL (Cloud: ru.altkraft.com or your On-Premises URL)":["URL вашей платформы Altcraft (облачная версия: ru.altkraft.com или URL вашей локальной версии)"],"Your Sendsay account login (not email). For sublogin use format: account/sublogin":["Ваш логин в Sendsay (не email). Для ввода дополнительного логина используйте формат: account/sublogin"],"Your company":["Ваша компания"],"Your current plan":["Ваш текущий тариф"],"Your email doesn't look like spam.":["Ваше письмо не похоже на спам."],"Your generations are running out soon":["Генерации с помощью ИИ скоро закончатся"],"Your letter contains %d block that can be saved for future use.":["Ваше письмо содержит %d блок, который можно сохранить для использования в будущем.","Ваше письмо содержит %d блока, которые можно сохранить для использования в будущем.","Ваше письмо содержит %d блоков, которые можно сохранить для использования в будущем."],"Your package is activated":["Пакет активирован"],"Your password successfully reset.":["Ваш пароль успешно сброшен."],"Your password was successfully changed.":["Ваш пароль успешно изменен."],"Your plan is activated":["Тариф активирован"],"Your plan will expire soon":["Ваш тариф скоро закончится"],"Your profile was successfully updated.":["Настройки сохранены."],"Your project has incoming email":["У вашего проекта есть входящая почта"],"Your templates and emails":["Ваши шаблоны и письма"],"Youtube Black":["Youtube Чёрный"],"Youtube Red":["Youtube Красный"],"Youtube White":["Youtube Белый"],"Z-A":["Я-А"],"ZIP":["ZIP-архив"],"accordion":["аккордеон"],"and":["и"],"before %s":["до %s"],"block":["Блок","",""],"block\\u0004\\" was successfully removed.":["» удалён."],"block\\u0004Are you sure to delete selected blocks?":["Вы уверены, что хотите удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete selected blocks?":["Вы уверены, что хотите безвозвратно удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete the “":["Вы уверены, что хотите удалить «"],"block\\u0004Are you sure you want to delete the “":["Вы уверены, что хотите удалить блок «"],"block\\u0004locked.":["заблокирован."],"block\\u0004unlocked.":["разблокирован."],"block\\u0004” was successfully created.":["» создана."],"block\\u0004” was successfully removed.":["» удалён."],"border\\u0004Width":["Толщина"],"button":["кнопка"],"carousel":["карусель"],"cell":["ячейка"],"column":["колонка"],"confirmation code":["код подтверждения"],"container":["контейнер"],"copy\\u0004\\" was successfully created.":["» создана."],"countdown":["таймер"],"cpc":["cpc"],"day":["день","дня","дней"],"e.g., 123456":["Например, 123456"],"e.g., Newsletter June 2026":["Например, дайджест за июнь"],"e.g., Special offer for you!":["Например: Специальное предложение!"],"e.g., Your Company":["Например, Ваша компания"],"e.g., https://ru.altkraft.com":["Например, https://ru.altkraft.com"],"e.g., myaccount or myaccount/sublogin":["Например, myaccount или myaccount/sublogin"],"element":["элемент"],"email":["эл. почта"],"email\\u0004\\" was successfully removed.":["\\" удалено."],"email\\u0004Are you sure to delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to delete selected emails?":["Вы уверены, что хотите удалить выбранные письма?"],"email\\u0004Are you sure to irrevocably delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to irrevocably delete selected emails?":["Вы уверены, что хотите безвозвратно удалить выбранные письма?"],"email\\u0004locked.":["заблокировано."],"email\\u0004unlocked.":["разблокировано."],"empty link":["пустая ссылка"],"empty src":["нет картинки"],"enKod":["enKod"],"expanded":["Раскрыт"],"folder\\u0004\\" was successfully created.":["» создана."],"folder\\u0004Are you sure to delete “":["Вы уверены, что хотите удалить папку «"],"folder\\u0004” was successfully changed to “":["» переименована в «"],"google":["google"],"group":["группа"],"group\\u0004All":["Все"],"group\\u0004Are you sure to delete “":["Вы уверенны, что хотите удалить группу «"],"group\\u0004Project":["Проектные"],"group\\u0004Standard":["Стандартные"],"group\\u0004” was successfully changed to “":["» переименована в «"],"hour":["час","часа","часов"],"https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png":["https://emcdn.ru/384263/241017_18_K3O0sad.png"],"https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png":["https://emcdn.ru/644755/241021_5149_MtX8mBz.png"],"https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png":["https://emcdn.ru/384263/241017_18_fsshqsL.png"],"https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png":["https://emcdn.ru/384263/241017_18_I98a6kp.png"],"https://cdn.useblocks.io/1351/241017_18_NDYloAO.png":["https://emcdn.ru/384263/241017_18_QFBYtv0.png"],"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png":["https://emcdn.ru/384263/241017_18_HFSbGb5.png"],"https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png":["https://emcdn.ru/384263/241017_18_Uu6iuFF.png"],"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png":["https://emcdn.ru/384263/241017_18_lkaw2P4.png"],"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png":["https://emcdn.ru/384263/241017_18_ykdbX19.png"],"https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png":["https://emcdn.ru/384263/241017_18_HMNSbZd.png"],"https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png":["https://emcdn.ru/719787/241031_976_jyIsWjj.png"],"https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png":["https://emcdn.ru/719787/241031_976_lgYswn9.png"],"https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png":["https://emcdn.ru/719787/241031_976_XfDnnmK.png"],"images":["Изображения"],"indent":["отступ"],"kB":["kB"],"letter\\u0004Email":["Письмо"],"letter\\u0004email":["Письмо"],"link":["ссылка"],"loading more":["загрузить ещё"],"mail generator":["генератор писем"],"main heading":["основной заголовок"],"max 10":["максимум 10"],"member\\u0004 to ":[" на "],"member\\u0004Administrator":["Администратор"],"member\\u0004Invited":["Приглашённый"],"member\\u0004Owner":["Владелец"],"messeges":["сообщения"],"minute":["минута","минуты","минут"],"ms":["мс"],"new password":["новый пароль"],"not valid":["не верно"],"of":["из"],"or":["или"],"password":["пароль"],"picture":["изображение"],"project\\u0004 across all your projects?":[" во всех ваших проектах?"],"project\\u0004 from project ":[" из проекта "],"project\\u0004 in project ":["в проекте"],"project\\u0004Actions":["Действия"],"project\\u0004Add members":["Добавить участников"],"project\\u0004Are you sure you want to change permissions for user ":["Вы уверены, что хотите изменить права доступа для пользователя "],"project\\u0004Are you sure you want to invite user ":["Вы уверены, что хотите пригласить этого пользователя "],"project\\u0004Are you sure you want to remove user ":["Вы уверены, что хотите удалить пользователя "],"project\\u0004Are you sure you want to revoke the invitation for ":["Вы уверены, что хотите отозвать приглашение для "],"project\\u0004Change in all projects":["Изменить во всех проектах"],"project\\u0004Confirm":["Подтвердить"],"project\\u0004Could not load the project list":["Не удалось загрузить список проектов"],"project\\u0004Could not undo exclusion":["Не удалось отменить исключение"],"project\\u0004Delete":["Удалить"],"project\\u0004Delete project":["Удалить проект"],"project\\u0004Edit member list":["Изменить список участников"],"project\\u0004Email address":["Email"],"project\\u0004Exclude":["Удалить"],"project\\u0004Failed to send invitation":["Не удалось отправить приглашение"],"project\\u0004Failed to send invitations":["Не удалось отправить приглашения"],"project\\u0004Failed to update permissions":["Не удалось обновить права доступа"],"project\\u0004In all projects":["Во всех проектах"],"project\\u0004Invite":["Пригласить"],"project\\u0004Invite participants":["Пригласить участников"],"project\\u0004Invite to all projects":["Пригласить во все проекты"],"project\\u0004Name":["Имя"],"project\\u0004No matching memberships to update in your other projects":["В других ваших проектах нет подходящих участников для обновления"],"project\\u0004Permissions updated":["Права доступа обновлены"],"project\\u0004Project participants":["Участники проекта"],"project\\u0004Project settings":["Настройки проекта"],"project\\u0004Remove from project":["Удалить из проекта"],"project\\u0004Revoke":["Отозвать"],"project\\u0004Revoke invite":["Отозвать приглашение"],"project\\u0004Role in project":["Роль в проекте"],"project\\u0004The invitation was restored":["Приглашение было восстановлено"],"project\\u0004The invitation was sent to all your projects":["Приглашение было отправлено во все ваши проекты"],"project\\u0004The invitation was sent to some of your projects":["Приглашение было отправлено некоторым из ваших проектов"],"project\\u0004The participant was restored to the project":["Участник был восстановлен в проекте"],"project\\u0004Undo":["Отменить"],"project\\u0004You":["Вы"],"project\\u0004You are not the owner of any project":["Вы не являетесь владельцем какого-либо проекта"],"project\\u0004You excluded user ":["Вы заблокировали пользователя "],"recovery\\u0004\\" was successfully recovered.":["» восстановлен."],"recovery\\u0004” was successfully deleted.":["» удалено."],"recovery\\u0004” was successfully recovered.":["» завершено."],"running+shoes":["running+shoes"],"s":["с"],"secure":["безопасно"],"selected":["выбрано"],"selling blue":["продающий синий"],"sender@example.com":["sender@example.com"],"spring_sale":["spring_sale"],"tab\\u0004AI assistant":["AI Ассистент"],"tab\\u0004Build":["Контент"],"tab\\u0004Calendar":["Календарь"],"tab\\u0004Checkbox":["Чекбокс"],"tab\\u0004Discuss":["Обсуждение"],"tab\\u0004Dropdown list":["Выпадающий список"],"tab\\u0004Input":["Поле ввода"],"tab\\u0004Optimize":["Оптимизация"],"tab\\u0004Radio button":["Радиокнопка"],"tab\\u0004Settings":["Настройки"],"tab\\u0004Styles":["Стили"],"table":["таблица"],"test":["тест","теста","тестов"],"text":["текст"],"textlink":["textlink"],"time to load":["время загрузки"],"total size":["общий размер"],"user":["Пользователь"],"utm_campaign":["utm_campaign"],"utm_content":["utm_content"],"utm_medium":["utm_medium"],"utm_source":["utm_source"],"utm_term":["utm_term"],"variable":["переменная"],"verb\\u0004Import":["Импортировать"],"video":["видео"],"was successfully":[" успешно"],"was used":["был использован","было использовано","было использовано"],"which exceeds the recommended 90 KB limit.":["что превышает рекомендуемый предел в 90 КБ."],"–":["–"],"—":["—"],"“":["«"],"”":["»"],"” block?":["»?"],"” folder?":["»?"],"” group and all nested groups?":["» вместе со всеми вложениями?"],"” was successfully created.":["» создан."],"” was successfully imported.":["» импортировано."],"” was successfully sent.":["» отправлено."],"”.":["»."],"🎉 Welcome! Pro plan is activated":["🎉 Привет! Тариф Pro активирован"]}`)};function xb(e){if(!Vs)return;const{id:t,catalog:n,time:o,hash:i}=Vs;e.getInstance(r.LOCALE_SERVICE_ID)?.prime(t,n,{time:o,hash:i})}function Ys(e,t,n){let o=!1;const i=e.watch(a=>{o||!t(a)||(o=!0,n())});o&&i.dispose()}function Pb(e,t){const n=e.getInstance(h.CONFIG_SOURCE_ID);n&&Ys(n,o=>!!o?.codeEnabled||!!o?.codeSideEnabled,()=>{Lb(e,()=>{Ob(e,()=>{jb(e,()=>{Wt(e).whenVisible(()=>{Jt(()=>{Rb(t).catch(()=>{})})})})})})})}async function Rb(e){await e()}function jb(e,t){const n=e.getInstance(Ba);if(!n){Jt(t);return}const o=()=>{if(n.pipeline.filledGeneration()!==void 0){t();return}Jt(o)};Jt(o)}function Lb(e,t){const n=e.getInstance(r.EMAIL_DOCUMENTS_ID);if(!n)return;if(n.current()){t();return}let o=!1;const i=n.subscribe(()=>{o||!n.current()||(o=!0,t())});o&&i()}function Ob(e,t){const n=e.getInstance(h.OPTIONS_SOURCE_ID);n&&Ys(n,o=>!!o?.element,t)}function Mb(e){Pb(e,vu)}function Ks(e,t="success"){return typeof e=="string"&&(e={message:e}),r.filterUndefined({type:e.type||t,data:e.data,innerException:e.innerException,title:e.message,description:e.description,actions:e.btn,onClose:e.onClose,duration:e.duration,icon:e.icon,placement:e.placement,style:e.style,closeIcon:e.closeIcon,props:e.props,role:e.role})}var Nb="bottomRight";function zo(e,t){return typeof e=="string"||typeof e=="object"?Ks(e,t):e}var Db=class extends h.Disposable{send;onNotify;onError;onSuccess;constructor(e,t,n){super(),this.send=n,this.onNotify=Ct(t,c=>c,c=>zo(c)),this.onError=Ct(h.filter(t,c=>c.type==="error"),c=>c,c=>zo(c,"error")),this.onSuccess=Ct(h.filter(t,c=>c.type==="success"),c=>c,c=>zo(c));const o=this.addDisposable(new kt(this.onNotify)),i=this.addDisposable(new kt(this.onError)),a=this.addDisposable(new kt(this.onSuccess));this.addDisposable(e.watch(({handleNotify:c,handleError:d,handleSuccess:u})=>{o.setListener(c),i.setListener(d),a.setListener(u)}))}notify(e){this.send({placement:Nb,...Ks(e)})}};function Fb(e){e.injectFactory(_o,(t,n)=>{if(n)return n;const o=new Db(e.getInstance(h.OPTIONS_SOURCE_ID),h.getEvent(e,h.events.ON_NOTIFICATION),i=>{r.executeCommand(e,r.NOTIFY_COMMAND_ID,i)});return e.getInstance(h.DISPOSABLE_ID)?.addDisposable(o),o},!0)}function Bb(e){const t=r.getEmailDocuments(e),n=i=>{e.getInstance(h.STORE_ID)?.dispatch(r.taxonomiesApi.util.invalidateTags([{type:"folder",id:i}]))},o=t.onSaved(i=>{i.created&&n("folder")});e.getInstance(h.DISPOSABLE_ID)?.addDispose(o)}function tE(e){return e}var Ub=[{name:"rest.legacySections",provides:[h.REST_CLIENT_ID],setup:h.provideLegacyRestSections},{name:"canvas.resizer",provides:[Fi],setup:Sb},{name:"canvas.sandboxLocale",awaits:{services:[r.LOCALE_SERVICE_ID]},setup:wb},{name:"locale.brandCatalog",awaits:{services:[r.LOCALE_SERVICE_ID]},setup:xb},{name:"email.restPorts",provides:[r.REST_EMAIL_PORTS_ID],setup:pb},{name:"block.historyPort",setup:gb},{name:"email.templatePrefetch",setup:Cb},{name:"locale.antd",awaits:{services:[r.LOCALE_SERVICE_ID]},setup:Ab},{name:"save.listsFollow",setup:Bb},{name:"monaco.prewarm",awaits:{services:[h.CONFIG_SOURCE_ID]},setup:Mb},{name:"notifications",provides:[_o],setup:Fb},{name:"email.operations",setup:Y_}],$b=h.defineMixin(e=>{for(const t of tb(Ub))t.setup(e);return{instance:K_(e)}}),Gb=h.combineMixins([$b,i_,O_,B_,Q_,X_,og,M_,Ha,qa]);async function zb(e){const t=new Map;typeof e=="object"&&(e=e.code);const{amp2html:n,html2amp:o}=await(0,Ye.__vitePreload)(async()=>{const{amp2html:c,html2amp:d}=await Promise.resolve().then(()=>Ee("./static/core/99c2b321.js"));return{amp2html:c,html2amp:d}},void 0,{}.url),i=await gt.changeHtml(e,async c=>{await gt.replaceImagesInDocument(c.document,d=>r.mapper.getEscapedText(d)!==d?d:r.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-disabled"))d.remove();c.handleRender(async({contentDocument:d,managedNodeController:u})=>{await o(d,{mappedTags:{script:"___script"},commit:()=>u.commit()})})},[800]),a=await gt.changeHtml(e,async c=>{await gt.replaceImagesInDocument(c.document,d=>r.mapper.getEscapedText(d)!==d?d:r.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-only"))d.remove();await n(c.document,{mappedTags:{script:"___script"}})},[800]);return{code:e,html:a,ampHtml:i}}async function Wb(){const{installDiagnostics:e}=await(0,Ye.__vitePreload)(async()=>{const{installDiagnostics:t}=await Promise.resolve().then(()=>Ee("./static/core/1c13f798.js"));return{installDiagnostics:t}},void 0,{}.url);return e()}async function Hb(e,t){const{initDevTools:n}=await(0,Ye.__vitePreload)(async()=>{const{initDevTools:o}=await Promise.resolve().then(()=>Ee("./static/core/3364944b.js"));return{initDevTools:o}},void 0,{}.url);n(e,t)}var qb="1.1.85-dev.10";an.asyncMixins=Gb,an.initDevTools=Hb,an.installDiagnostics=Wb,an.parseAMP=zb,an.version=qb});
|