Your IP : 3.12.148.140


Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/main/dist/
Upload File :
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/landing/main/dist/main.bundle.js.map

{"version":3,"file":"main.bundle.js","sources":["../src/internal/has-block.js","../src/internal/has-create-button.js","../src/internal/on-animation-end.js","../src/internal/is-empty.js","../src/external.controls.js","../src/main.js"],"sourcesContent":["/**\n * Checks that element contains block\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport default function hasBlock(element: HTMLElement): boolean\n{\n\treturn !!element && !!element.querySelector('.block-wrapper');\n}","/**\n * Checks that element contains \"Add new Block\" button\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport default function hasCreateButton(element: HTMLElement): boolean\n{\n\treturn !!element && !!element.querySelector('button[data-id=\"insert_first_block\"]');\n}","import {Event} from 'main.core';\n\nexport default function onAnimationEnd(element: HTMLElement, animationName: string)\n{\n\treturn new Promise(((resolve) => {\n\t\tconst onAnimationEndListener = (event) => {\n\t\t\tif (!animationName || (event.animationName === animationName))\n\t\t\t{\n\t\t\t\tresolve(event);\n\t\t\t\tEvent.bind(element, 'animationend', onAnimationEndListener);\n\t\t\t}\n\t\t};\n\n\t\tEvent.bind(element, 'animationend', onAnimationEndListener);\n\t}));\n}","import {Type} from 'main.core';\n\nexport default function isEmpty(value): boolean\n{\n\tif (Type.isNil(value))\n\t{\n\t\treturn true;\n\t}\n\n\tif (Type.isArrayLike(value))\n\t{\n\t\treturn !value.length;\n\t}\n\n\tif (Type.isObject(value))\n\t{\n\t\treturn Object.keys(value).length <= 0;\n\t}\n\n\treturn true;\n}","import { Dom } from 'main.core';\n\nimport { Main } from './main';\n\ntype Block = {\n\tid: number,\n\tstate: boolean,\n\tpermissions: {\n\t\tallowDesignBlock: boolean,\n\t\tallowModifyStyles: boolean,\n\t\tallowEditContent: boolean,\n\t\tallowSorting: boolean,\n\t\tallowRemove: boolean,\n\t\tallowChangeState: boolean,\n\t},\n};\n\ntype MobileTop = {\n\tblockId: number,\n\ttop: number,\n\theight: number,\n};\n\nexport class ExternalControls\n{\n\t#postMessages = {\n\t\tmode: 'mode',\n\t\tregister: 'register',\n\t\tchangeState: 'changestate',\n\t\teditorEnable: 'editorenable',\n\t\tshowControls: 'showcontrols',\n\t\tshowBlockControls: 'showblockcontrols',\n\t\thideAll: 'hideall',\n\t\tbackendAction: 'backendaction',\n\t};\n\n\t#currentMobileTop: number = -1;\n\t#mouseEntered: boolean = false;\n\t#disableControls: boolean = false;\n\t#currentMousePosition: number = 0;\n\t#blocksMobileTops: Array<MobileTop> = [];\n\n\tconstructor()\n\t{\n\t\tif (Main.isExternalControlsEnabled())\n\t\t{\n\t\t\tthis.#registerListeners();\n\t\t}\n\t}\n\n\t/**\n\t * Registers all required listeners.\n\t */\n\t#registerListeners()\n\t{\n\t\tsetTimeout(() => {\n\t\t\tthis.#registerBlocks();\n\t\t}, 0);\n\n\t\t// listening commands from outer frame\n\t\twindow.addEventListener('message', (event) => {\n\t\t\tif (this.isControlsExternal())\n\t\t\t{\n\t\t\t\tthis.listenExternalCommands(event.data.action, event.data.payload);\n\t\t\t}\n\t\t});\n\n\t\t// catching the mouse and scrolling\n\t\tdocument.addEventListener('mouseenter', (event) => {\n\t\t\tthis.#mouseEntered = true;\n\t\t});\n\t\tdocument.addEventListener('mouseleave', (event) => {\n\t\t\tthis.#mouseEntered = false;\n\t\t});\n\t\tdocument.addEventListener('mousemove', (event) => {\n\t\t\tthis.onMobileMouseMove(event.y);\n\t\t});\n\t\tdocument.addEventListener('scroll', () => {\n\t\t\tif (this.#mouseEntered)\n\t\t\t{\n\t\t\t\tthis.recalculateTopsIfExternals();\n\t\t\t}\n\t\t});\n\n\t\t// checking when external commands become enabled\n\t\tBX.addCustomEvent('BX.Landing.Main:changeControls', (type, topInPercent) =>\n\t\t{\n\t\t\tif (type === 'internal')\n\t\t\t{\n\t\t\t\tthis.postExternalCommand(this.#postMessages.hideAll, {});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// mode switching some time\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.recalculateTops(true);\n\t\t\t\t}, 400);\n\t\t\t}\n\t\t});\n\n\t\t// checking inline editor — enabled or disabled\n\t\tBX.addCustomEvent('BX.Landing.Editor:enable', () =>\n\t\t{\n\t\t\tthis.#disableControls = true;\n\t\t\tif (this.isControlsExternal())\n\t\t\t{\n\t\t\t\tthis.postExternalCommand(this.#postMessages.hideAll, {});\n\t\t\t}\n\t\t});\n\t\tBX.addCustomEvent('BX.Landing.Editor:disable', () =>\n\t\t{\n\t\t\tthis.#disableControls = false;\n\t\t\tthis.recalculateTopsIfExternals(true);\n\t\t});\n\n\t\t// checking that new block was added and any block changed its active status\n\t\tBX.addCustomEvent('BX.Landing.Block:onAfterAdd', (event) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst blockData = event.getData();\n\t\t\t\tthis.#registerNewBlock(blockData.id);\n\t\t\t}, 500);\n\t\t});\n\t\tBX.addCustomEvent('BX.Landing.Block:changeState', (blockId, state) => {\n\t\t\tthis.postExternalCommand(this.#postMessages.changeState, { blockId, state });\n\t\t});\n\n\t\t// form's settings were opened and then closed\n\t\tBX.addCustomEvent('BX.Landing.Block:onFormSettingsOpen', () => {\n\t\t\tif (this.isControlsExternal())\n\t\t\t{\n\t\t\t\tthis.postExternalCommand(this.#postMessages.hideAll, {});\n\t\t\t}\n\t\t\tthis.#disableControls = true;\n\t\t});\n\t\tBX.addCustomEvent('BX.Landing.Block:onFormSettingsClose', (blockId) => {\n\t\t\t// after form completely closed\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.#disableControls = false;\n\t\t\t\tthis.recalculateTopsIfExternals(true);\n\t\t\t}, 400);\n\t\t\tthis.postExternalCommand(this.#postMessages.hideAll, {});\n\t\t});\n\t\tBX.addCustomEvent('BX.Landing.Block:onAfterFormSave', (blockId) =>\n\t\t{\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.postExternalCommand(this.#postMessages.backendAction, {\n\t\t\t\t\taction: 'Landing\\\\Block::saveForm', data: {block: blockId},\n\t\t\t\t});\n\t\t\t}, 1000);\n\t\t});\n\t\tBX.addCustomEvent('BX.Landing.Block:onBlockEditClose', () => {\n\t\t\tthis.#disableControls = false;\n\t\t\tthis.recalculateTopsIfExternals(true);\n\t\t});\n\n\t\tBX.addCustomEvent('BX.Landing.Block:onContentSave', this.recalculateTopsIfExternals.bind(this));\n\t\tBX.addCustomEvent('BX.Landing.Block:onDesignerBlockSave', this.recalculateTopsIfExternals.bind(this));\n\t\tBX.addCustomEvent('BX.Landing.Block:Card:add', this.recalculateTopsIfExternals.bind(this));\n\t\tBX.addCustomEvent('BX.Landing.Block:Card:remove', this.recalculateTopsIfExternals.bind(this));\n\t\tBX.addCustomEvent('BX.Landing.Block:afterRemove', this.recalculateTopsIfExternals.bind(this));\n\t\tBX.addCustomEvent('BX.Landing.Backend:action', this.onBackendAction.bind(this));\n\t\tBX.addCustomEvent('BX.Landing.Backend:batch', this.onBackendAction.bind(this));\n\t}\n\n\t/**\n\t * Invokes when backend action occurred.\n\t */\n\tonBackendAction(action, data)\n\t{\n\t\tthis.#disableControls = false;\n\t\tthis.postExternalCommand(this.#postMessages.backendAction, { action, data });\n\t}\n\n\t/**\n\t * Creates and returns Block object for sending to external window.\n\t *\n\t * @param {BX.Landing.} block\n\t * @return {Block}\n\t */\n\t#createBlockObject(block: BX.Landing.Block): Block\n\t{\n\t\treturn {\n\t\t\tid: parseInt(block.id),\n\t\t\tstate: block.isEnabled(),\n\t\t\tpermissions: {\n\t\t\t\tallowDesignBlock: block.isDesignBlockAllowed(),\n\t\t\t\tallowModifyStyles: block.isStyleModifyAllowed(),\n\t\t\t\tallowEditContent: block.isEditBlockAllowed(),\n\t\t\t\tallowSorting: block.isEditBlockAllowed(),\n\t\t\t\tallowRemove: block.isRemoveBlockAllowed(),\n\t\t\t\tallowChangeState: block.isChangeStateBlockAllowed(),\n\t\t\t\tallowPaste: block.isPasteBlockAllowed(),\n\t\t\t\tallowSaveInLibrary: block.isSaveBlockInLibraryAllowed(),\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Registers all blocks on entire page.\n\t */\n\t#registerBlocks()\n\t{\n\t\tconst blocksCollection = BX.Landing.PageObject.getBlocks();\n\t\tconst data = [];\n\n\t\t[...blocksCollection].map(block => data.push(this.#createBlockObject(block)));\n\n\t\tthis.postExternalCommand(this.#postMessages.register, {\n\t\t\tblocks: data,\n\t\t});\n\t}\n\n\t/**\n\t * Registers new block.\n\t *\n\t * @param {number} blockId\n\t */\n\t#registerNewBlock(blockId: number)\n\t{\n\t\tconst block = BX.Landing.PageObject.getBlocks().get(blockId);\n\t\tif (block)\n\t\t{\n\t\t\tthis.postExternalCommand(this.#postMessages.register, {\n\t\t\t\tblocks: [this.#createBlockObject(block)],\n\t\t\t});\n\t\t\t// because new block adding some time\n\t\t\tif (this.isControlsExternal()) {\n\t\t\t\tthis.recalculateTops();\n\t\t\t} else {\n\t\t\t\tthis.postExternalCommand(this.#postMessages.hideAll, {});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks that landing controls is external\n\t *\n\t * @return {boolean}\n\t */\n\tisControlsExternal()\n\t{\n\t\treturn Dom.hasClass(document.body, 'landing-ui-external-controls');\n\t}\n\n\t/**\n\t * Recalculates block tops.\n\t *\n\t * @param {boolean} resetMobileTop\n\t */\n\trecalculateTops(resetMobileTop: boolean)\n\t{\n\t\tthis.#blocksMobileTops = [];\n\n\t\tif (resetMobileTop)\n\t\t{\n\t\t\tthis.#currentMobileTop = -1;\n\t\t}\n\n\t\t[...document.body.querySelectorAll('.block-wrapper')].map(block => {\n\t\t\tconst blockRect = block.getBoundingClientRect();\n\t\t\tif (blockRect.height > 1)// hidden on mobile blocks\n\t\t\t{\n\t\t\t\tthis.#blocksMobileTops.push({\n\t\t\t\t\tblockId: parseInt(block.getAttribute('data-id')),\n\t\t\t\t\ttop: blockRect.top,\n\t\t\t\t\theight: blockRect.height,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tthis.onMobileMouseMove(this.#currentMousePosition);\n\t}\n\n\t/**\n\t * Recalculates block tops only if external controls are enabled.\n\t *\n\t * @param {boolean} resetMobileTop\n\t */\n\trecalculateTopsIfExternals(resetMobileTop: boolean)\n\t{\n\t\tif (this.isControlsExternal())\n\t\t{\n\t\t\tthis.recalculateTops(resetMobileTop);\n\t\t}\n\t}\n\n\t/**\n\t * Call when user moves mouse over the mobile page.\n\t *\n\t * @param {number} top\n\t */\n\tonMobileMouseMove(top: number)\n\t{\n\t\tif (this.#disableControls || !this.isControlsExternal())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (top <= 0)\n\t\t{\n\t\t\tthis.#currentMobileTop = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#currentMousePosition = top;\n\n\t\tfor (let i = 0, c = this.#blocksMobileTops.length; i < c; i++)\n\t\t{\n\t\t\tif (\n\t\t\t\ttop >= this.#blocksMobileTops[i]['top']\n\t\t\t\t&& (!this.#blocksMobileTops[i+1] || top < this.#blocksMobileTops[i+1]['top'])\n\t\t\t)\n\t\t\t{\n\t\t\t\tif (this.#blocksMobileTops[i]['top'] !== this.#currentMobileTop)\n\t\t\t\t{\n\t\t\t\t\tthis.#currentMobileTop = this.#blocksMobileTops[i]['top'];\n\n\t\t\t\t\tthis.postExternalCommand(this.#postMessages.showControls, {\n\t\t\t\t\t\tblockId: this.#blocksMobileTops[i]['blockId'],\n\t\t\t\t\t\ttop: this.#blocksMobileTops[i]['top'],\n\t\t\t\t\t\theight: this.#blocksMobileTops[i]['height'],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Sends action with payload to parent window.\n\t *\n\t * @param {string} action\n\t * @param {Object} payload\n\t */\n\tpostExternalCommand(action, payload)\n\t{\n\t\tif (window.parent)\n\t\t{\n\t\t\twindow.parent.postMessage({action, payload}, window.location.origin);\n\t\t}\n\t}\n\n\t/**\n\t * Receives actions with payload from parent window.\n\t *\n\t * @param {string} action\n\t * @param {Object} payload\n\t */\n\tlistenExternalCommands(action, payload)\n\t{\n\t\tconst block = BX.Landing.PageObject.getBlocks().get(\n\t\t\tpayload?.blockId ? payload.blockId : -1\n\t\t);\n\n\t\tif (payload?.blockId && !block)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tconst successCallback = () => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.#currentMousePosition = 0;\n\t\t\t\tthis.recalculateTops();\n\t\t\t}, 300);\n\t\t};\n\n\t\tswitch (action)\n\t\t{\n\t\t\tcase 'onDesignerBlockClick':\n\t\t\t{\n\t\t\t\tblock.onDesignerBlockClick();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onEditBlockClick':\n\t\t\t{\n\t\t\t\tblock.onShowContentPanel();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onStyleBlockClick':\n\t\t\t{\n\t\t\t\tblock.onStyleShow();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onSortDownBlockClick':\n\t\t\t{\n\t\t\t\tblock.moveDown();\n\t\t\t\tsuccessCallback();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onSortUpBlockClick':\n\t\t\t{\n\t\t\t\tblock.moveUp();\n\t\t\t\tsuccessCallback();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onRemoveBlockClick':\n\t\t\t{\n\t\t\t\tblock.deleteBlock();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onChangeStateBlockClick':\n\t\t\t{\n\t\t\t\tblock.onStateChange();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onCutBlockClick':\n\t\t\t{\n\t\t\t\tMain.getInstance().onCutBlock.bind(Main.getInstance(), block)();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onCopyBlockClick':\n\t\t\t{\n\t\t\t\tMain.getInstance().onCopyBlock.bind(Main.getInstance(), block)();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onPasteBlockClick':\n\t\t\t{\n\t\t\t\tMain.getInstance().onPasteBlock.bind(\n\t\t\t\t\tMain.getInstance(),\n\t\t\t\t\tblock,\n\t\t\t\t\t(blockId) => {\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tthis.#registerNewBlock(blockId);\n\t\t\t\t\t\t}, 300);\n\t\t\t\t\t}\n\t\t\t\t)();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onFeedbackClick':\n\t\t\t{\n\t\t\t\tblock.showFeedbackForm();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onSaveInLibraryClick':\n\t\t\t{\n\t\t\t\tblock.saveBlock();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'onHideEditorPanel':\n\t\t\t{\n\t\t\t\tBX.Landing.UI.Panel.EditorPanel.getInstance().hide();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Type, Dom, Cache, Tag, Text, Runtime} from 'main.core';\nimport {EventEmitter} from 'main.core.events';\nimport {Env} from 'landing.env';\nimport {Loc} from 'landing.loc';\nimport {Content} from 'landing.ui.panel.content';\nimport {SaveBlock} from 'landing.ui.panel.saveblock';\nimport {SliderHacks} from 'landing.sliderhacks';\nimport {PageObject} from 'landing.pageobject';\nimport hasBlock from './internal/has-block';\nimport hasCreateButton from './internal/has-create-button';\nimport onAnimationEnd from './internal/on-animation-end';\nimport isEmpty from './internal/is-empty';\nimport {ExternalControls} from './external.controls';\nimport {Backend} from 'landing.backend';\n\nBX.Landing.getMode = () => 'edit';\n\n/**\n * @memberOf BX.Landing\n */\nexport class Main extends EventEmitter\n{\n\tstatic TYPE_PAGE = 'PAGE';\n\tstatic TYPE_STORE = 'STORE';\n\tstatic TYPE_KNOWLEDGE = 'KNOWLEDGE';\n\tstatic TYPE_GROUP = 'GROUP';\n\n\tstatic getMode()\n\t{\n\t\treturn 'edit';\n\t}\n\n\tstatic createInstance(id: number)\n\t{\n\t\tconst rootWindow = BX.Landing.PageObject.getRootWindow();\n\t\trootWindow.BX.Landing.Main.instance = new BX.Landing.Main(id);\n\t}\n\n\tstatic getInstance(): Main\n\t{\n\t\tconst rootWindow = BX.Landing.PageObject.getRootWindow();\n\t\trootWindow.BX.Reflection.namespace('BX.Landing.Main');\n\t\tif (rootWindow.BX.Landing.Main.instance)\n\t\t{\n\t\t\treturn rootWindow.BX.Landing.Main.instance;\n\t\t}\n\n\t\trootWindow.BX.Landing.Main.instance = new Main(-1);\n\n\t\treturn rootWindow.BX.Landing.Main.instance;\n\t}\n\n\t/**\n\t * Returns true, if current page is Editor.\n\t * @return {boolean}\n\t */\n\tstatic isEditorMode()\n\t{\n\t\treturn Dom.hasClass(document.body, 'landing-editor');\n\t}\n\n\t/**\n\t * Returns true, if external controls is enabled.\n\t * @return {boolean}\n\t */\n\tstatic isExternalControlsEnabled()\n\t{\n\t\treturn Dom.hasClass(document.body, 'enable-external-controls');\n\t}\n\n\t/**\n\t * Returns in percent scroll position of page.\n\t *\n\t * @return {number}\n\t */\n\tstatic topInPercent(): number\n\t{\n\t\tconst scrollHeight = Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t);\n\n\t\tconst scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n\n\t\treturn scrollTop / scrollHeight * 100;\n\t}\n\n\t/**\n\t * Landing ID\n\t * @type {number}\n\t */\n\tid: number;\n\n\tconstructor(id: number)\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.Landing.Main');\n\n\t\tconst options = Env.getInstance().getOptions();\n\n\t\tthis.id = id;\n\t\tthis.options = Object.freeze(options);\n\t\tthis.blocks = this.options.blocks;\n\t\tthis.currentBlock = null;\n\t\tthis.isDesignBlockModeFlag = this.options[\"design_block\"] === true;\n\t\tthis.loadedDeps = {};\n\t\tthis.cache = new Cache.MemoryCache();\n\t\tthis.externalControls = new ExternalControls;\n\n\t\tthis.onSliderFormLoaded = this.onSliderFormLoaded.bind(this);\n\t\tthis.onBlockDelete = this.onBlockDelete.bind(this);\n\n\t\tBX.addCustomEvent('Landing.Block:onAfterDelete', this.onBlockDelete);\n\n\t\tthis.adjustEmptyAreas();\n\n\t\tBX.Landing.UI.Panel.StatusPanel.setLastModified(options.lastModified);\n\t\tif (!this.isDesignBlockModeFlag)\n\t\t{\n\t\t\tBX.Landing.UI.Panel.StatusPanel.getInstance().show();\n\t\t}\n\n\t\tconst pageType = Env.getInstance().getType();\n\t\tif (\n\t\t\tpageType === Main.TYPE_KNOWLEDGE\n\t\t\t|| pageType === Main.TYPE_GROUP\n\t\t)\n\t\t{\n\t\t\tconst mainArea = document.querySelector('.landing-main');\n\t\t\tif (Type.isDomNode(mainArea))\n\t\t\t{\n\t\t\t\tDom.addClass(mainArea, 'landing-ui-collapse');\n\t\t\t}\n\t\t}\n\t}\n\n\tisCrmFormPage(): boolean\n\t{\n\t\treturn Env.getInstance().getOptions().specialType === 'crm_forms';\n\t}\n\n\tisDesignBlockMode()\n\t{\n\t\treturn this.isDesignBlockModeFlag;\n\t}\n\n\tgetSaveBlockPanel(): Content\n\t{\n\t\tconst panel = new SaveBlock('save_block_panel', {block: this.currentBlock});\n\t\tpanel.layout.hidden = true;\n\t\tpanel.content.hidden = false;\n\t\tDom.append(panel.layout, window.parent.document.body);\n\n\t\treturn panel;\n\t}\n\n\tgetBlocksPanel(): Content\n\t{\n\t\treturn this.cache.remember('blockPanel', () => {\n\t\t\tconst blocksPanel = this.createBlocksPanel();\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (blocksPanel.sidebarButtons.get(this.options.default_section))\n\t\t\t\t{\n\t\t\t\t\tblocksPanel.sidebarButtons.get(this.options.default_section).layout.click();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t[...blocksPanel.sidebarButtons][0].layout.click();\n\t\t\t\t}\n\t\t\t});\n\t\t\tblocksPanel.layout.hidden = true;\n\t\t\tblocksPanel.content.hidden = false;\n\t\t\tDom.append(blocksPanel.layout, window.parent.document.body);\n\n\t\t\treturn blocksPanel;\n\t\t});\n\t}\n\n\thideBlocksPanel()\n\t{\n\t\tif (this.getBlocksPanel())\n\t\t{\n\t\t\treturn this.getBlocksPanel().hide();\n\t\t}\n\n\t\treturn Promise.resolve();\n\t}\n\n\tgetLayoutAreas(): Array<HTMLElement>\n\t{\n\t\treturn this.cache.remember('layoutAreas', () => {\n\t\t\treturn [\n\t\t\t\t...document.body.querySelectorAll('.landing-header'),\n\t\t\t\t...document.body.querySelectorAll('.landing-sidebar'),\n\t\t\t\t...document.body.querySelectorAll('.landing-main'),\n\t\t\t\t...document.body.querySelectorAll('.landing-footer'),\n\t\t\t];\n\t\t});\n\t}\n\n\t/**\n\t * Creates insert block button\n\t * @param {HTMLElement} area\n\t * @return {BX.Landing.UI.Button.Plus}\n\t */\n\tcreateInsertBlockButton(area: HTMLElement)\n\t{\n\t\tconst button = new BX.Landing.UI.Button.Plus('insert_first_block', {\n\t\t\ttext: Loc.getMessage('ACTION_BUTTON_CREATE'),\n\t\t});\n\n\t\tbutton.on('click', this.showBlocksPanel.bind(this, null, area, button));\n\t\tbutton.on('mouseover', this.onCreateButtonMouseover.bind(this, area, button));\n\t\tbutton.on('mouseout', this.onCreateButtonMouseout.bind(this, area, button));\n\n\t\treturn button;\n\t}\n\n\tonCreateButtonMouseover(area: HTMLElement, button)\n\t{\n\t\tif (\n\t\t\tDom.hasClass(area, 'landing-header')\n\t\t\t|| Dom.hasClass(area, 'landing-footer')\n\t\t)\n\t\t{\n\t\t\tconst areas = this.getLayoutAreas();\n\n\t\t\tif (areas.length > 1)\n\t\t\t{\n\t\t\t\tconst createText = Loc.getMessage('ACTION_BUTTON_CREATE');\n\n\t\t\t\tif (Dom.hasClass(area, 'landing-main'))\n\t\t\t\t{\n\t\t\t\t\tbutton.setText(\n\t\t\t\t\t\t`${createText} ${Loc.getMessage('LANDING_ADD_BLOCK_TO_MAIN')}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (Dom.hasClass(area, 'landing-header'))\n\t\t\t\t{\n\t\t\t\t\tbutton.setText(\n\t\t\t\t\t\t`${createText} ${Loc.getMessage('LANDING_ADD_BLOCK_TO_HEADER')}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (Dom.hasClass(area, 'landing-sidebar'))\n\t\t\t\t{\n\t\t\t\t\tbutton.setText(\n\t\t\t\t\t\t`${createText} ${Loc.getMessage('LANDING_ADD_BLOCK_TO_SIDEBAR')}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (Dom.hasClass(area, 'landing-footer'))\n\t\t\t\t{\n\t\t\t\t\tbutton.setText(\n\t\t\t\t\t\t`${createText} ${Loc.getMessage('LANDING_ADD_BLOCK_TO_FOOTER')}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tclearTimeout(this.fadeTimeout);\n\t\t\t\tthis.fadeTimeout = setTimeout(() => {\n\t\t\t\t\tDom.addClass(area, 'landing-area-highlight');\n\n\t\t\t\t\tareas\n\t\t\t\t\t\t.filter((currentArea) => currentArea !== area)\n\t\t\t\t\t\t.forEach((currentArea) => {\n\t\t\t\t\t\t\tDom.addClass(currentArea, 'landing-area-fade');\n\t\t\t\t\t\t});\n\t\t\t\t}, 400);\n\t\t\t}\n\t\t}\n\t}\n\n\tonCreateButtonMouseout(area, button)\n\t{\n\t\tclearTimeout(this.fadeTimeout);\n\n\t\tif (Dom.hasClass(area, 'landing-header')\n\t\t\t|| Dom.hasClass(area, 'landing-footer'))\n\t\t{\n\t\t\tconst areas = this.getLayoutAreas();\n\n\t\t\tif (areas.length > 1)\n\t\t\t{\n\t\t\t\tbutton.setText(Loc.getMessage('ACTION_BUTTON_CREATE'));\n\t\t\t\tareas.forEach((currentArea) => {\n\t\t\t\t\tDom.removeClass(currentArea, 'landing-area-highlight');\n\t\t\t\t\tDom.removeClass(currentArea, 'landing-area-fade');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tinitEmptyArea(area: HTMLElement)\n\t{\n\t\tif (area)\n\t\t{\n\t\t\tarea.innerHTML = '';\n\t\t\tDom.append(this.createInsertBlockButton(area).layout, area);\n\t\t\tDom.addClass(area, 'landing-empty');\n\t\t}\n\t}\n\n\n\t// eslint-disable-next-line class-methods-use-this\n\tdestroyEmptyArea(area: HTMLElement)\n\t{\n\t\tif (area)\n\t\t{\n\t\t\tconst button = area.querySelector('button[data-id=\"insert_first_block\"]');\n\n\t\t\tif (button)\n\t\t\t{\n\t\t\t\tDom.remove(button);\n\t\t\t}\n\n\t\t\tDom.removeClass(area, 'landing-empty');\n\t\t}\n\t}\n\n\n\t/**\n\t * Adjusts areas\n\t */\n\tadjustEmptyAreas()\n\t{\n\t\tthis.getLayoutAreas()\n\t\t\t.filter((area) => {\n\t\t\t\treturn hasBlock(area) && hasCreateButton(area);\n\t\t\t})\n\t\t\t.forEach(this.destroyEmptyArea, this);\n\n\t\tthis.getLayoutAreas()\n\t\t\t.filter((area) => {\n\t\t\t\treturn !hasBlock(area) && !hasCreateButton(area);\n\t\t\t})\n\t\t\t.forEach(this.initEmptyArea, this);\n\n\t\tconst main = document.body.querySelector('main.landing-edit-mode');\n\t\tconst isAllEmpty = !this.getLayoutAreas().some(hasBlock);\n\n\t\tif (main)\n\t\t{\n\t\t\tif (isAllEmpty)\n\t\t\t{\n\t\t\t\tDom.addClass(main, 'landing-empty');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tDom.removeClass(main, 'landing-empty');\n\t\t}\n\t}\n\n\n\t/**\n\t * Enables landing controls\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tenableControls()\n\t{\n\t\tDom.removeClass(document.body, 'landing-ui-hide-controls');\n\t}\n\n\n\t/**\n\t * Disables landing controls\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tdisableControls()\n\t{\n\t\tDom.addClass(document.body, 'landing-ui-hide-controls');\n\t}\n\n\n\t/**\n\t * Checks that landing controls is enabled\n\t * @return {boolean}\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tisControlsEnabled()\n\t{\n\t\treturn !Dom.hasClass(document.body, 'landing-ui-hide-controls');\n\t}\n\n\t/**\n\t * Makes landing controls internal.\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tmakeControlsInternal()\n\t{\n\t\tBX.onCustomEvent('BX.Landing.Main:changeControls', ['internal', Main.topInPercent()]);\n\t\tDom.removeClass(document.body, 'landing-ui-external-controls');\n\t}\n\n\t/**\n\t * Makes landing controls external.\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tmakeControlsExternal()\n\t{\n\t\tBX.onCustomEvent('BX.Landing.Main:changeControls', ['external', Main.topInPercent()]);\n\t\tDom.addClass(document.body, 'landing-ui-external-controls');\n\t}\n\n\t/**\n\t * Checks that landing controls is external.\n\t * @return {boolean}\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tisControlsExternal()\n\t{\n\t\treturn Dom.hasClass(document.body, 'landing-ui-external-controls');\n\t}\n\n\t/**\n\t * Set device code in body data-attribute.\n\t * @param {string} code\n\t */\n\tsetDeviceCode(code: string)\n\t{\n\t\tdocument.body.setAttribute('data-device', code);\n\t}\n\n\t/**\n\t * Get device code from body attribute.\n\t * @return {string}\n\t */\n\tgetDeviceCode(): ?string\n\t{\n\t\treturn document.body.getAttribute('data-device');\n\t}\n\n\t/**\n\t * Set BX classes to mark this landing frame as mobile (touch) device\n\t */\n\tsetTouchDevice()\n\t{\n\t\tDom.removeClass(document.documentElement, 'bx-no-touch');\n\t\tDom.addClass(document.documentElement, 'bx-touch');\n\t}\n\n\t/**\n\t * Set BX classes to mark this landing frame as desktop (no touch) device\n\t */\n\tsetNoTouchDevice()\n\t{\n\t\tDom.removeClass(document.documentElement, 'bx-touch');\n\t\tDom.addClass(document.documentElement, 'bx-no-touch');\n\t}\n\n\n\t/**\n\t * Appends block\n\t * @param {addBlockResponse} data\n\t * @param {boolean} [withoutAnimation]\n\t * @returns {HTMLElement}\n\t */\n\tappendBlock(data, withoutAnimation)\n\t{\n\t\tconst block = Tag.render`${data.content}`;\n\t\tblock.id = `block${data.id}`;\n\n\t\tif (!withoutAnimation)\n\t\t{\n\t\t\tDom.addClass(block, 'landing-ui-show');\n\t\t\tonAnimationEnd(block, 'showBlock').then(() => {\n\t\t\t\tDom.removeClass(block, 'landing-ui-show');\n\t\t\t});\n\t\t}\n\n\t\tthis.insertToBlocksFlow(block);\n\n\t\treturn block;\n\t}\n\n\n\t/**\n\t * Shows blocks list panel\n\t * @param {BX.Landing.Block} block\n\t * @param {HTMLElement} [area]\n\t * @param [button]\n\t * @param [insertBefore]\n\t */\n\tshowBlocksPanel(block, area, button, insertBefore)\n\t{\n\t\tthis.currentBlock = block;\n\t\tthis.currentArea = area;\n\t\tthis.insertBefore = insertBefore;\n\n\t\tBX.Landing.UI.Panel.EditorPanel.getInstance().hide();\n\n\t\tif (this.isCrmFormPage() || this.isControlsExternal())\n\t\t{\n\t\t\tconst rootWindow = PageObject.getRootWindow();\n\t\t\tDom.append(this.getBlocksPanel().layout, rootWindow.document.body);\n\t\t\tDom.append(this.getBlocksPanel().overlay, rootWindow.document.body);\n\t\t}\n\n\t\tthis.getBlocksPanel().show();\n\t\tthis.disableAddBlockButtons();\n\n\t\tif (!!area && !!button)\n\t\t{\n\t\t\tthis.onCreateButtonMouseout(area, button);\n\t\t}\n\t}\n\n\tshowSaveBlock(block)\n\t{\n\t\tthis.currentBlock = block;\n\t\tthis.getSaveBlockPanel().show();\n\t}\n\n\tdisableAddBlockButtons()\n\t{\n\t\tPageObject.getBlocks().forEach((block) => {\n\t\t\tconst panel = block.panels.get('create_action');\n\t\t\tif (panel)\n\t\t\t{\n\t\t\t\tconst button = panel.buttons.get('insert_after');\n\t\t\t\tif (button)\n\t\t\t\t{\n\t\t\t\t\tbutton.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tenableAddBlockButtons()\n\t{\n\t\tPageObject.getBlocks().forEach((block) => {\n\t\t\tconst panel = block.panels.get('create_action');\n\t\t\tif (panel)\n\t\t\t{\n\t\t\t\tconst button = panel.buttons.get('insert_after');\n\t\t\t\tif (button)\n\t\t\t\t{\n\t\t\t\t\tbutton.enable();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Creates blocks list panel\n\t * @returns {BX.Landing.UI.Panel.Content}\n\t */\n\tcreateBlocksPanel()\n\t{\n\t\tconst {blocks} = this.options;\n\t\tconst categories = Object.keys(blocks);\n\n\t\tconst panel = new Content('blocks_panel', {\n\t\t\ttitle: Loc.getMessage('LANDING_CONTENT_BLOCKS_TITLE'),\n\t\t\tclassName: 'landing-ui-panel-block-list',\n\t\t\tscrollAnimation: true,\n\t\t});\n\n\t\tpanel.subscribe('onCancel', () => {\n\t\t\tthis.enableAddBlockButtons();\n\t\t});\n\n\t\tcategories.forEach((categoryId) => {\n\t\t\tconst hasItems = !isEmpty(blocks[categoryId].items);\n\t\t\tconst isPopular = categoryId === 'popular';\n\t\t\tconst isSeparator = blocks[categoryId].separator;\n\n\t\t\tif ((hasItems && !isPopular) || isSeparator)\n\t\t\t{\n\t\t\t\tpanel.appendSidebarButton(\n\t\t\t\t\tthis.createBlockPanelSidebarButton(categoryId, blocks[categoryId]),\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\tpanel.appendSidebarButton(\n\t\t\tnew BX.Landing.UI.Button.SidebarButton('feedback_button', {\n\t\t\t\tclassName: 'landing-ui-button-sidebar-feedback',\n\t\t\t\ttext: Loc.getMessage('LANDING_BLOCKS_LIST_FEEDBACK_BUTTON'),\n\t\t\t\tonClick: this.showFeedbackForm.bind(this),\n\t\t\t}),\n\t\t);\n\n\t\treturn panel;\n\t}\n\n\n\t/**\n\t * Shows feedback form\n\t * @param data\n\t */\n\tshowSliderFeedbackForm(data = {})\n\t{\n\t\tRuntime.loadExtension('ui.feedback.form').then(() => {\n\t\t\tconst data = {};\n\t\t\tdata.bitrix24 = this.options.server_name;\n\t\t\tdata.siteId = this.options.site_id;\n\t\t\tdata.siteUrl = this.options.url;\n\t\t\tdata.siteTemplate = this.options.xml_id;\n\t\t\tdata.productType = this.options.productType || 'Undefined';\n\t\t\tdata.typeproduct = (() =>\n\t\t\t{\n\t\t\t\tif (this.options.params.type === Main.TYPE_GROUP)\n\t\t\t\t{\n\t\t\t\t\treturn 'KNOWLEDGE_GROUP';\n\t\t\t\t}\n\n\t\t\t\treturn this.options.params.type;\n\t\t\t})();\n\n\t\t\tBX.UI.Feedback.Form.open(\n\t\t\t\t{\n\t\t\t\t\tid: Math.random()+'',\n\t\t\t\t\tforms: this.getFeedbackFormOptions(),\n\t\t\t\t\tpresets: data,\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t}\n\n\n\t/**\n\t * Gets feedback form options\n\t * @return {{id: string, sec: string, lang: string}}\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tgetFeedbackFormOptions()\n\t{\n\t\treturn [\n\t\t\t{zones: ['en', 'eu', 'in', 'uk'], id: 16, lang: 'en', sec: '3h483y'},\n\t\t\t{zones: ['ru', 'by', 'kz'], id: 8, lang: 'ru', sec: 'x80yjw'},\n\t\t\t{zones: ['ua'], id: 18, lang: 'ua', sec: 'd9e09o'},\n\t\t\t{zones: ['la', 'co', 'mx'], id: 14, lang: 'la', sec: 'wu561i'},\n\t\t\t{zones: ['de'], id: 10, lang: 'de', sec: 'eraz2q'},\n\t\t\t{zones: ['com.br', 'br'], id: 12, lang: 'br', sec: 'r6wvge'},\n\t\t];\n\t}\n\n\n\t/**\n\t * Handles feedback loaded event\n\t */\n\tonSliderFormLoaded()\n\t{\n\t\tthis.sliderFormLoader.hide();\n\t}\n\n\n\t/**\n\t * Shows feedback form for blocks list panel\n\t */\n\tshowFeedbackForm()\n\t{\n\t\tthis.showSliderFeedbackForm({target: 'blocksList'});\n\t}\n\n\n\t/**\n\t * Initialises feedback form\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tinitFeedbackForm()\n\t{\n\t\tconst rootWindow = PageObject.getRootWindow();\n\t\t((w, d, u, b) => {\n\t\t\tw.Bitrix24FormObject = b; w[b] = w[b] || function() {\n\t\t\t\t// eslint-disable-next-line prefer-rest-params\n\t\t\t\targuments[0].ref = u;\n\t\t\t\t// eslint-disable-next-line prefer-rest-params\n\t\t\t\t(w[b].forms = w[b].forms || []).push(arguments[0]);\n\t\t\t};\n\t\t\tif (w[b].forms) return;\n\t\t\tconst s = d.createElement('script');\n\t\t\tconst r = 1 * new Date(); s.async = 1; s.src = `${u}?${r}`;\n\t\t\tconst h = d.getElementsByTagName('script')[0]; h.parentNode.insertBefore(s, h);\n\t\t})(rootWindow, rootWindow.document, 'https://product-feedback.bitrix24.com/bitrix/js/crm/form_loader.js', 'b24formFeedBack');\n\t}\n\n\n\t/**\n\t * Creates blocks list panel sidebar button\n\t * @param {string} category\n\t * @param {object} options\n\t * @returns {BX.Landing.UI.Button.SidebarButton}\n\t */\n\tcreateBlockPanelSidebarButton(category, options)\n\t{\n\t\treturn new BX.Landing.UI.Button.SidebarButton(category, {\n\t\t\ttext: options.name,\n\t\t\tchild: !options.separator,\n\t\t\tclassName: options.new ? 'landing-ui-new-section' : '',\n\t\t\tonClick: this.onBlocksListCategoryChange.bind(this, category),\n\t\t});\n\t}\n\n\t/**\n\t * Adds dynamically new block to the category.\n\t * @param {string} category Category code.\n\t * @param {{code: string, name: string, preview: string, section: Array<string>}} block Block data.\n\t */\n\taddNewBlockToCategory(category, block)\n\t{\n\t\tif (this.blocks[category])\n\t\t{\n\t\t\tconst blockCode = block['codeOriginal'] || block['code'];\n\t\t\tif (category === 'last')\n\t\t\t{\n\t\t\t\tif (!this.lastBlocks)\n\t\t\t\t{\n\t\t\t\t\tthis.lastBlocks = Object.keys(this.blocks.last.items);\n\t\t\t\t}\n\t\t\t\tthis.lastBlocks.unshift(blockCode);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.blocks[category].items[blockCode] = block;\n\t\t\t}\n\t\t\tthis.onBlocksListCategoryChange(category);\n\t\t}\n\t}\n\n\tremoveBlockFromList(blockCode: string)\n\t{\n\t\tlet removed = false;\n\t\tfor (let category in this.blocks)\n\t\t{\n\t\t\tif (this.blocks[category].items[blockCode] !== undefined)\n\t\t\t{\n\t\t\t\tdelete this.blocks[category].items[blockCode];\n\t\t\t\tremoved = true;\n\t\t\t}\n\t\t}\n\t\tif (this.lastBlocks.indexOf(blockCode) !== -1)\n\t\t{\n\t\t\tthis.lastBlocks.splice(this.lastBlocks.indexOf(blockCode), 1);\n\t\t\tremoved = true;\n\t\t}\n\n\t\t// refresh panel\n\t\tif (removed)\n\t\t{\n\t\t\tconst activeCategoryButton = this.getBlocksPanel().sidebarButtons.find((button) => {\n\t\t\t\treturn Dom.hasClass(button.layout, 'landing-ui-active');\n\t\t\t});\n\t\t\tif (activeCategoryButton)\n\t\t\t{\n\t\t\t\tthis.onBlocksListCategoryChange(activeCategoryButton.id);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns page's template code if exists.\n\t * @return {string|null}\n\t */\n\tgetTemplateCode()\n\t{\n\t\tlet { tplCode } = Env.getInstance().getOptions();\n\t\tif (tplCode.indexOf('@') > 0)\n\t\t{\n\t\t\ttplCode = tplCode.split('@')[1];\n\t\t}\n\t\tif (!tplCode || tplCode.length <= 0)\n\t\t{\n\t\t\ttplCode = null;\n\t\t}\n\t\treturn tplCode;\n\t}\n\n\n\t/**\n\t * Handles event on blocks list category change\n\t * @param {string} category - Category id\n\t */\n\tonBlocksListCategoryChange(category)\n\t{\n\t\tconst templateCode = this.getTemplateCode();\n\t\tthis.getBlocksPanel().content.hidden = false;\n\n\t\tthis.getBlocksPanel().sidebarButtons.forEach((button) => {\n\t\t\tconst action = button.id === category ? 'add' : 'remove';\n\t\t\tbutton.layout.classList[action]('landing-ui-active');\n\t\t});\n\n\t\tthis.getBlocksPanel().content.innerHTML = '';\n\n\t\tif (category === 'last')\n\t\t{\n\t\t\tif (!this.lastBlocks)\n\t\t\t{\n\t\t\t\tthis.lastBlocks = Object.keys(this.blocks.last.items);\n\t\t\t}\n\n\t\t\tthis.lastBlocks = [...new Set(this.lastBlocks)];\n\n\t\t\tthis.lastBlocks.forEach((blockKey) => {\n\t\t\t\tconst block = this.getBlockFromRepository(blockKey);\n\t\t\t\tthis.getBlocksPanel().appendCard(this.createBlockCard(blockKey, block));\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\n\t\tObject.keys(this.blocks[category].items).forEach((blockKey) => {\n\t\t\tconst block = this.blocks[category].items[blockKey];\n\t\t\tconst blockTplCode = (block['tpl_code'] && block['tpl_code'].length > 0) ? block['tpl_code'] : null;\n\t\t\tif (\n\t\t\t\t!templateCode || !blockTplCode ||\n\t\t\t\t(blockTplCode && blockTplCode === templateCode)\n\t\t\t)\n\t\t\t{\n\t\t\t\tthis.getBlocksPanel().appendCard(this.createBlockCard(blockKey, block));\n\t\t\t}\n\t\t});\n\n\t\tif (this.getBlocksPanel().content.scrollTop)\n\t\t{\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tthis.getBlocksPanel().content.scrollTop = 0;\n\t\t\t});\n\t\t}\n\t}\n\n\t// eslint-disable-next-line consistent-return\n\tgetBlockFromRepository(code)\n\t{\n\t\tconst {blocks} = this.options;\n\t\tconst categories = Object.keys(blocks);\n\t\tconst category = categories.find((categoryId) => {\n\t\t\treturn code in blocks[categoryId].items;\n\t\t});\n\n\t\tif (category)\n\t\t{\n\t\t\treturn blocks[category].items[code];\n\t\t}\n\t}\n\n\n\t/**\n\t * Handles copy block event\n\t * @param {BX.Landing.Block} block\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tonCopyBlock(block)\n\t{\n\t\twindow.localStorage.landingBlockId = block.id;\n\t\twindow.localStorage.landingBlockName = block.manifest.block.name;\n\t\twindow.localStorage.landingBlockAction = 'copy';\n\n\t\ttry\n\t\t{\n\t\t\twindow.localStorage.requiredUserAction = JSON.stringify(\n\t\t\t\tblock.requiredUserActionOptions,\n\t\t\t);\n\t\t}\n\t\tcatch (err)\n\t\t{\n\t\t\twindow.localStorage.requiredUserAction = '';\n\t\t}\n\t}\n\n\n\t/**\n\t * Handles cut block event\n\t * @param {BX.Landing.Block} block\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tonCutBlock(block)\n\t{\n\t\twindow.localStorage.landingBlockId = block.id;\n\t\twindow.localStorage.landingBlockName = block.manifest.block.name;\n\t\twindow.localStorage.landingBlockAction = 'cut';\n\n\t\ttry\n\t\t{\n\t\t\twindow.localStorage.requiredUserAction = JSON.stringify(\n\t\t\t\tblock.requiredUserActionOptions,\n\t\t\t);\n\t\t}\n\t\tcatch (err)\n\t\t{\n\t\t\twindow.localStorage.requiredUserAction = '';\n\t\t}\n\n\t\tBX.Landing.PageObject.getBlocks().remove(block);\n\t\tDom.remove(block.node);\n\t\tBX.onCustomEvent('Landing.Block:onAfterDelete', [block]);\n\t}\n\n\n\t/**\n\t * Handles paste block event\n\t * @param {BX.Landing.Block} block\n\t * @param {() => {}} callback\n\t */\n\tonPasteBlock(block, callback)\n\t{\n\t\tif (window.localStorage.landingBlockId)\n\t\t{\n\t\t\tlet action = 'Landing::copyBlock';\n\n\t\t\tif (window.localStorage.landingBlockAction === 'cut')\n\t\t\t{\n\t\t\t\taction = 'Landing::moveBlock';\n\t\t\t}\n\n\t\t\tconst requestBody = {};\n\n\t\t\trequestBody[action] = {\n\t\t\t\taction,\n\t\t\t\tdata: {\n\t\t\t\t\tlid: block.lid || BX.Landing.Main.getInstance().id,\n\t\t\t\t\tblock: window.localStorage.landingBlockId,\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tAFTER_ID: block.id,\n\t\t\t\t\t\tRETURN_CONTENT: 'Y',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tBX.Landing.Backend.getInstance()\n\t\t\t\t.batch(action, requestBody, {action})\n\t\t\t\t.then((res) => {\n\t\t\t\t\tthis.currentBlock = block;\n\t\t\t\t\treturn this.addBlock(res[action].result.content, false, false, callback);\n\t\t\t\t});\n\t\t}\n\t}\n\n\n\t/**\n\t * Adds block from server response\n\t * @param {addBlockResponse} res\n\t * @param {boolean} [withoutAnimation = false]\n\t * @param {boolean} [insertBefore = false]\n\t * @param {() => {}} callback\n\t * @return {Promise<T>}\n\t */\n\taddBlock(res, withoutAnimation, insertBefore = false, callback)\n\t{\n\t\tif (this.lastBlocks)\n\t\t{\n\t\t\tthis.lastBlocks.unshift(res.manifest.codeOriginal || res.manifest.code);\n\t\t}\n\n\t\tconst self = this;\n\t\tconst block = this.appendBlock(res, withoutAnimation);\n\n\t\treturn this.loadBlockDeps(res)\n\t\t\t.then((blockRes) => {\n\t\t\t\tself.currentBlock = null;\n\t\t\t\tself.currentArea = null;\n\n\t\t\t\tconst blockId = parseInt(res.id);\n\t\t\t\tconst allOldBlocks = BX.Landing.PageObject.getBlocks();\n\t\t\t\tif (allOldBlocks)\n\t\t\t\t{\n\t\t\t\t\tallOldBlocks.forEach((oldBlock) => {\n\t\t\t\t\t\tif (oldBlock.id === blockId)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tDom.remove(oldBlock.node);\n\t\t\t\t\t\t\tBX.Landing.PageObject.getBlocks().remove(oldBlock);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// Init block entity\n\t\t\t\tvoid new BX.Landing.Block(block, {\n\t\t\t\t\tid: blockId,\n\t\t\t\t\tsections: res.sections,\n\t\t\t\t\trequiredUserAction: res.requiredUserAction,\n\t\t\t\t\tmanifest: res.manifest,\n\t\t\t\t\taccess: res.access,\n\t\t\t\t\tactive: Text.toBoolean(res.active),\n\t\t\t\t\tphp: res.php,\n\t\t\t\t\tdesigned: res.designed,\n\t\t\t\t\tanchor: res.anchor,\n\t\t\t\t\tdynamicParams: res.dynamicParams,\n\t\t\t\t\trepoId: res.repoId,\n\t\t\t\t});\n\n\t\t\t\treturn self.runBlockScripts(res)\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tif (callback)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcallback(blockId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn block;\n\t\t\t\t\t});\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\tconsole.warn(err);\n\t\t\t});\n\t}\n\n\n\t/**\n\t * Handles edd block event\n\t * @param {string} blockCode\n\t * @param {*} [restoreId]\n\t * @param {?boolean} [preventHistory = false]\n\t * @return {Promise<BX.Landing.Block>}\n\t */\n\tonAddBlock(blockCode, restoreId, preventHistory: ?boolean  = false)\n\t{\n\t\tconst id = Text.toNumber(restoreId);\n\n\t\tthis.hideBlocksPanel();\n\n\t\treturn this.showBlockLoader()\n\t\t\t.then(this.loadBlock(blockCode, id, preventHistory))\n\t\t\t.then((res) => {\n\t\t\t\treturn new Promise((resolve) => {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tresolve(res);\n\t\t\t\t\t}, 500);\n\t\t\t\t});\n\t\t\t})\n\t\t\t.then((res) => {\n\t\t\t\tres.manifest.codeOriginal = blockCode;\n\t\t\t\tconst p = this.addBlock(res, false, this.insertBefore);\n\t\t\t\tthis.insertBefore = false;\n\t\t\t\tthis.adjustEmptyAreas();\n\t\t\t\tvoid this.hideBlockLoader();\n\t\t\t\tthis.enableAddBlockButtons();\n\t\t\t\tBX.onCustomEvent('BX.Landing.Block:onAfterAdd', res);\n\t\t\t\treturn p;\n\t\t\t});\n\t}\n\n\n\t/**\n\t * Inserts element to blocks flow.\n\t * Element can be inserted after current block or after last block\n\t * @param {HTMLElement} element\n\t */\n\tinsertToBlocksFlow(element)\n\t{\n\t\tconst isCurrentBlockAvailable = (\n\t\t\tthis.currentBlock\n\t\t\t&& this.currentBlock.node\n\t\t\t&& this.currentBlock.node.parentNode\n\t\t);\n\n\t\tif (isCurrentBlockAvailable && !this.insertBefore)\n\t\t{\n\t\t\tDom.insertAfter(element, this.currentBlock.node);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isCurrentBlockAvailable && this.insertBefore)\n\t\t{\n\t\t\tDom.insertBefore(element, this.currentBlock.node);\n\t\t}\n\n\t\tDom.prepend(element, this.currentArea);\n\t}\n\n\n\t/**\n\t * Gets block loader\n\t * @return {HTMLElement}\n\t */\n\tgetBlockLoader()\n\t{\n\t\tif (!this.blockLoader)\n\t\t{\n\t\t\tthis.blockLoader = new BX.Loader({size: 60});\n\t\t\tthis.blockLoaderContainer = Dom.create('div', {\n\t\t\t\tprops: {className: 'landing-block-loader-container'},\n\t\t\t\tchildren: [this.blockLoader.layout],\n\t\t\t});\n\t\t}\n\n\t\treturn this.blockLoaderContainer;\n\t}\n\n\n\t/**\n\t * Shows block loader\n\t * @return {Function}\n\t */\n\tshowBlockLoader()\n\t{\n\t\tthis.insertToBlocksFlow(this.getBlockLoader());\n\t\tthis.blockLoader.show();\n\t\treturn Promise.resolve();\n\t}\n\n\n\t/**\n\t * Hides block loader\n\t * @return {Function}\n\t */\n\thideBlockLoader()\n\t{\n\t\tDom.remove(this.getBlockLoader());\n\t\tthis.blockLoader = null;\n\t\treturn Promise.resolve();\n\t}\n\n\n\t/**\n\t * Loads block dependencies\n\t * @param {addBlockResponse} data\n\t * @returns {Promise<addBlockResponse>}\n\t */\n\tloadBlockDeps(data)\n\t{\n\t\tconst ext = BX.processHTML(data.content_ext);\n\n\t\tif (BX.type.isArray(ext.SCRIPT))\n\t\t{\n\t\t\text.SCRIPT = ext.SCRIPT.filter((item) => {\n\t\t\t\treturn !item.isInternal;\n\t\t\t});\n\t\t}\n\n\t\tlet loadedScripts = 0;\n\t\tconst scriptsCount = (data.js.length + ext.SCRIPT.length + ext.STYLE.length + data.css.length);\n\t\tlet resPromise = null;\n\n\t\tif (!this.loadedDeps[data.manifest.code] && scriptsCount > 0)\n\t\t{\n\t\t\tresPromise = new Promise(((resolve) => {\n\t\t\t\tfunction onLoad()\n\t\t\t\t{\n\t\t\t\t\tloadedScripts += 1;\n\n\t\t\t\t\tif (loadedScripts === scriptsCount)\n\t\t\t\t\t{\n\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (scriptsCount > loadedScripts)\n\t\t\t\t{\n\t\t\t\t\t// Load extensions files\n\t\t\t\t\text.SCRIPT.forEach((item) => {\n\t\t\t\t\t\tif (!item.isInternal)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tBX.loadScript(item.JS, onLoad);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\text.STYLE.forEach((item) => {\n\t\t\t\t\t\tBX.loadScript(item, onLoad);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Load block files\n\t\t\t\t\tdata.css.forEach((item) => {\n\t\t\t\t\t\tBX.loadScript(item, onLoad);\n\t\t\t\t\t});\n\n\t\t\t\t\tdata.js.forEach((item) => {\n\t\t\t\t\t\tBX.loadScript(item, onLoad);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tonLoad();\n\t\t\t\t}\n\n\t\t\t\tthis.loadedDeps[data.manifest.code] = true;\n\t\t\t}));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresPromise = Promise.resolve(data);\n\t\t}\n\n\t\treturn resPromise;\n\t}\n\n\n\t/**\n\t * Executes block scripts\n\t * @param data\n\t * @return {Promise}\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\trunBlockScripts(data)\n\t{\n\t\treturn new Promise(((resolve) => {\n\t\t\tconst scripts = BX.processHTML(data.content).SCRIPT;\n\n\t\t\tif (scripts.length)\n\t\t\t{\n\t\t\t\tBX.ajax.processScripts(scripts, undefined, () => {\n\t\t\t\t\tresolve(data);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresolve(data);\n\t\t\t}\n\t\t}));\n\t}\n\n\n\t/**\n\t * Load new block from server\n\t * @param {string} blockCode\n\t * @param {int} [restoreId]\n\t * @param {boolean} [preventHistory = false]\n\t * @returns {Function}\n\t */\n\tloadBlock(blockCode, restoreId, preventHistory)\n\t{\n\t\treturn () => {\n\t\t\tlet lid = this.id;\n\t\t\tlet siteId = this.options.site_id;\n\n\t\t\tif (this.currentBlock)\n\t\t\t{\n\t\t\t\tlid = this.currentBlock.lid;\n\t\t\t\tsiteId = this.currentBlock.siteId;\n\t\t\t}\n\n\t\t\tif (this.currentArea)\n\t\t\t{\n\t\t\t\tlid = Dom.attr(this.currentArea, 'data-landing');\n\t\t\t\tsiteId = Dom.attr(this.currentArea, 'data-site');\n\t\t\t}\n\n\t\t\tlet requestBody = {\n\t\t\t\tlid,\n\t\t\t\tsiteId,\n\t\t\t\tpreventHistory: preventHistory ? 1 : 0,\n\t\t\t};\n\n\t\t\tconst fields = {\n\t\t\t\tACTIVE: 'Y',\n\t\t\t\tCODE: blockCode,\n\t\t\t\tAFTER_ID: this.currentBlock ? this.currentBlock.id : 0,\n\t\t\t\tRETURN_CONTENT: 'Y',\n\t\t\t};\n\n\t\t\tif (!Type.isBoolean(preventHistory) || preventHistory === false)\n\t\t\t{\n\t\t\t\t// Change history steps\n\t\t\t\tBX.Landing.History.getInstance().push();\n\t\t\t}\n\n\t\t\tif (!restoreId)\n\t\t\t{\n\t\t\t\trequestBody.fields = fields;\n\t\t\t\treturn Backend\n\t\t\t\t\t.getInstance()\n\t\t\t\t\t.action('Landing::addBlock', requestBody, {code: blockCode})\n\t\t\t\t\t.then(result => {\n\t\t\t\t\t\tif (this.insertBefore)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn Backend\n\t\t\t\t\t\t\t\t.getInstance()\n\t\t\t\t\t\t\t\t.action('Landing::upBlock', {\n\t\t\t\t\t\t\t\t\tlid,\n\t\t\t\t\t\t\t\t\tsiteId,\n\t\t\t\t\t\t\t\t\tblock: result.id,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn BX.Landing.Backend.getInstance()\n\t\t\t\t.action('Block::getContent', {\n\t\t\t\t\tblock: restoreId,\n\t\t\t\t\tlid,\n\t\t\t\t\tfields,\n\t\t\t\t\teditMode: 1,\n\t\t\t\t})\n\t\t\t\t.then((res) => {\n\t\t\t\t\tres.id = restoreId;\n\t\t\t\t\treturn res;\n\t\t\t\t});\n\t\t};\n\t}\n\n\n\t/**\n\t * Creates block preview card\n\t * @param {string} blockKey - Block key (folder name)\n\t * @param {{name: string, [preview]: ?string, [new]: ?boolean}} block - Object with block data\n\t * @param {string} [mode]\n\t * @returns {BX.Landing.UI.Card.BlockPreviewCard}\n\t */\n\tcreateBlockCard(blockKey, block, mode)\n\t{\n\t\treturn new BX.Landing.UI.Card.BlockPreviewCard({\n\t\t\ttitle: block.name,\n\t\t\timage: block.preview,\n\t\t\tcode: blockKey,\n\t\t\tapp_expired: block.app_expired,\n\t\t\tfavorite: !!block.favorite,\n\t\t\tfavoriteMy: !!block.favoriteMy,\n\t\t\trepo_id: block.repo_id,\n\t\t\tmode,\n\t\t\tisNew: block.new === true,\n\t\t\tonClick: this.onAddBlock.bind(this, blockKey),\n\t\t});\n\t}\n\n\n\t/**\n\t * Handles block delete event\n\t */\n\tonBlockDelete(block)\n\t{\n\t\tif (!block.parent.querySelector('.block-wrapper'))\n\t\t{\n\t\t\tthis.adjustEmptyAreas();\n\t\t}\n\t}\n\n\n\t/**\n\t * Shows page overlay\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\tshowOverlay()\n\t{\n\t\tconst main = document.querySelector('main.landing-edit-mode');\n\t\tif (main)\n\t\t{\n\t\t\tDom.addClass(main, 'landing-ui-overlay');\n\t\t}\n\t}\n\n\n\t/**\n\t * Hides page overlay\n\t */\n\t// eslint-disable-next-line class-methods-use-this\n\thideOverlay()\n\t{\n\t\tconst main = document.querySelector('main.landing-edit-mode');\n\t\tif (main)\n\t\t{\n\t\t\tDom.removeClass(main, 'landing-ui-overlay');\n\t\t}\n\t}\n\n\treloadSlider(url: string): Promise<any>\n\t{\n\t\treturn SliderHacks.reloadSlider(url, window.parent);\n\t}\n}"],"names":["hasBlock","element","querySelector","hasCreateButton","onAnimationEnd","animationName","Promise","resolve","onAnimationEndListener","event","Event","bind","isEmpty","value","Type","isNil","isArrayLike","length","isObject","Object","keys","ExternalControls","mode","register","changeState","editorEnable","showControls","showBlockControls","hideAll","backendAction","Main","isExternalControlsEnabled","action","data","postExternalCommand","Dom","hasClass","document","body","resetMobileTop","querySelectorAll","map","block","blockRect","getBoundingClientRect","height","push","blockId","parseInt","getAttribute","top","onMobileMouseMove","isControlsExternal","recalculateTops","i","c","payload","window","parent","postMessage","location","origin","BX","Landing","PageObject","getBlocks","get","successCallback","setTimeout","onDesignerBlockClick","onShowContentPanel","onStyleShow","moveDown","moveUp","deleteBlock","onStateChange","getInstance","onCutBlock","onCopyBlock","onPasteBlock","showFeedbackForm","saveBlock","UI","Panel","EditorPanel","hide","addEventListener","listenExternalCommands","y","recalculateTopsIfExternals","addCustomEvent","type","topInPercent","blockData","getData","id","state","onBackendAction","isEnabled","permissions","allowDesignBlock","isDesignBlockAllowed","allowModifyStyles","isStyleModifyAllowed","allowEditContent","isEditBlockAllowed","allowSorting","allowRemove","isRemoveBlockAllowed","allowChangeState","isChangeStateBlockAllowed","allowPaste","isPasteBlockAllowed","allowSaveInLibrary","isSaveBlockInLibraryAllowed","blocksCollection","blocks","getMode","rootWindow","getRootWindow","instance","Reflection","namespace","scrollHeight","Math","max","documentElement","offsetHeight","clientHeight","scrollTop","setEventNamespace","options","Env","getOptions","freeze","currentBlock","isDesignBlockModeFlag","loadedDeps","cache","Cache","MemoryCache","externalControls","onSliderFormLoaded","onBlockDelete","adjustEmptyAreas","StatusPanel","setLastModified","lastModified","show","pageType","getType","TYPE_KNOWLEDGE","TYPE_GROUP","mainArea","isDomNode","addClass","specialType","panel","SaveBlock","layout","hidden","content","append","remember","blocksPanel","createBlocksPanel","sidebarButtons","default_section","click","getBlocksPanel","area","button","Button","Plus","text","Loc","getMessage","on","showBlocksPanel","onCreateButtonMouseover","onCreateButtonMouseout","areas","getLayoutAreas","createText","setText","clearTimeout","fadeTimeout","filter","currentArea","forEach","removeClass","innerHTML","createInsertBlockButton","remove","destroyEmptyArea","initEmptyArea","main","isAllEmpty","some","onCustomEvent","code","setAttribute","withoutAnimation","Tag","render","then","insertToBlocksFlow","insertBefore","isCrmFormPage","overlay","disableAddBlockButtons","getSaveBlockPanel","panels","buttons","disable","enable","categories","Content","title","className","scrollAnimation","subscribe","enableAddBlockButtons","categoryId","hasItems","items","isPopular","isSeparator","separator","appendSidebarButton","createBlockPanelSidebarButton","SidebarButton","onClick","Runtime","loadExtension","bitrix24","server_name","siteId","site_id","siteUrl","url","siteTemplate","xml_id","productType","typeproduct","params","Feedback","Form","open","random","forms","getFeedbackFormOptions","presets","zones","lang","sec","sliderFormLoader","showSliderFeedbackForm","target","w","d","u","b","Bitrix24FormObject","arguments","ref","s","createElement","r","Date","async","src","h","getElementsByTagName","parentNode","category","name","child","onBlocksListCategoryChange","blockCode","lastBlocks","last","unshift","removed","undefined","indexOf","splice","activeCategoryButton","find","tplCode","split","templateCode","getTemplateCode","classList","Set","blockKey","getBlockFromRepository","appendCard","createBlockCard","blockTplCode","requestAnimationFrame","localStorage","landingBlockId","landingBlockName","manifest","landingBlockAction","requiredUserAction","JSON","stringify","requiredUserActionOptions","err","node","callback","requestBody","lid","AFTER_ID","RETURN_CONTENT","Backend","batch","res","addBlock","result","codeOriginal","self","appendBlock","loadBlockDeps","blockRes","allOldBlocks","oldBlock","Block","sections","access","active","Text","toBoolean","php","designed","anchor","dynamicParams","repoId","runBlockScripts","console","warn","restoreId","preventHistory","toNumber","hideBlocksPanel","showBlockLoader","loadBlock","p","hideBlockLoader","isCurrentBlockAvailable","insertAfter","prepend","blockLoader","Loader","size","blockLoaderContainer","create","props","children","getBlockLoader","ext","processHTML","content_ext","isArray","SCRIPT","item","isInternal","loadedScripts","scriptsCount","js","STYLE","css","resPromise","onLoad","loadScript","JS","scripts","ajax","processScripts","attr","fields","ACTIVE","CODE","isBoolean","History","editMode","Card","BlockPreviewCard","image","preview","app_expired","favorite","favoriteMy","repo_id","isNew","onAddBlock","SliderHacks","reloadSlider","EventEmitter"],"mappings":";;;;CAAA;CACA;CACA;CACA;CACA;AACA,CAAe,SAASA,QAAQ,CAACC,OAAoB,EACrD;GACC,OAAO,CAAC,CAACA,OAAO,IAAI,CAAC,CAACA,OAAO,CAACC,aAAa,CAAC,gBAAgB,CAAC;CAC9D;;CCRA;CACA;CACA;CACA;CACA;AACA,CAAe,SAASC,eAAe,CAACF,OAAoB,EAC5D;GACC,OAAO,CAAC,CAACA,OAAO,IAAI,CAAC,CAACA,OAAO,CAACC,aAAa,CAAC,sCAAsC,CAAC;CACpF;;CCNe,SAASE,cAAc,CAACH,OAAoB,EAAEI,aAAqB,EAClF;GACC,OAAO,IAAIC,OAAO,CAAE,UAACC,OAAO,EAAK;KAChC,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsB,CAAIC,KAAK,EAAK;OACzC,IAAI,CAACJ,aAAa,IAAKI,KAAK,CAACJ,aAAa,KAAKA,aAAc,EAC7D;SACCE,OAAO,CAACE,KAAK,CAAC;SACdC,eAAK,CAACC,IAAI,CAACV,OAAO,EAAE,cAAc,EAAEO,sBAAsB,CAAC;;MAE5D;KAEDE,eAAK,CAACC,IAAI,CAACV,OAAO,EAAE,cAAc,EAAEO,sBAAsB,CAAC;IAC3D,CAAE;CACJ;;CCbe,SAASI,OAAO,CAACC,KAAK,EACrC;GACC,IAAIC,cAAI,CAACC,KA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