/*! For license information please see bundle.modals.3cca01cb.js.LICENSE.txt */ (window.webpackETJsonp=window.webpackETJsonp||[]).push([[6],Array(507).concat([function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=s(n(3)),i=s(n(40)),l=s(n(809));n(810);var u=["tip","ripple","className","children","forwardedRef"];function s(e){return e&&e.__esModule?e:{default:e}}function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n0,a="et-common-scroll-lock--added-margin",l=parseInt(t.attr("data-et-common-scroll-lock-offset"))||0,u=t.find("#wpadminbar");if(o&&(0,s.windowHasScrollbar)(window)){var c=(0,s.getScrollbarWidth)();t.addClass(a),t.css("margin".concat(r?"Left":"Right"),"".concat(c,"px")),u.length>0&&u.css("width","calc(100% - ".concat(c,"px)"))}!o&&t.hasClass(a)&&(t.removeClass(a),t.css("margin".concat(r?"Left":"Right"),""),u.length>0&&u.css("width","")),o&&0===l?t.attr("data-et-common-scroll-lock-offset",n.scrollTop()):o||0===l||(n.scrollTop(parseInt(t.attr("data-et-common-scroll-lock-offset"))||0),t.removeAttr("data-et-common-scroll-lock-offset")),t.toggleClass("et-common-scroll-lock",o)})),v(g(e),"getLocks",(function(){return(0,l.default)(((0,i.default)("body").attr("data-et-common-scroll-locks")||"").split(","),(function(e){return!!e}))})),v(g(e),"setLocks",(function(e){(0,i.default)("body").attr("data-et-common-scroll-locks",e.join(","))})),v(g(e),"addLock",(function(t){var n=e.getLocks();n.push(t),e.setLocks((0,u.default)(n))})),v(g(e),"removeLock",(function(t){var n=e.getLocks();e.setLocks((0,l.default)(n,(function(e){return e!==t})))})),e}return t=a,(n=[{key:"componentDidMount",value:function(){this.addLock(this.props.lockId),this.toggleBodyClass()}},{key:"componentDidUpdate",value:function(e){this.removeLock(e.lockId),this.addLock(this.props.lockId),this.toggleBodyClass()}},{key:"componentWillUnmount",value:function(){this.removeLock(this.props.lockId),this.toggleBodyClass()}},{key:"render",value:function(){return null}}])&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.PureComponent);v(_,"propTypes",{lockId:a.default.string.isRequired});var w=_;t.default=w},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(!document.documentMode&&!window.StyleMedia&&!r)return new window.File(e,t,n);var o=new Blob(e,n);return o.lastModified=Date.now(),o.name=t,o};var r=navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},function(e,t,n){var r=n(54)("toPairs",n(459),n(130));r.placeholder=n(48),e.exports=r},function(e,t,n){var r=n(54)("fromPairs",n(366));r.placeholder=n(48),e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versions=t.default=void 0;var r=["1.12.4","1.12.3","1.12.2","1.12.1","1.12.0","1.11.3","1.11.2","1.11.1","1.11.0","1.10.2","1.10.1","1.10.0","1.9.1","1.9.0","1.8.3","1.8.2","1.8.1","1.8.0","1.7.2","1.7.1","1.7.0","1.7.0","1.6.4","1.6.3","1.6.2","1.6.1","1.6.0","1.5.2","1.5.1","1.5.0","1.4.4","1.4.3","1.4.2","1.4.1","1.4.0","1.3.2","1.3.1","1.3.0","1.2.6","1.2.5","1.2.4","1.2.3","1.2.2","1.2.1","1.2.0","1.1.4","1.1.3","1.1.2","1.1.1","1.1.0","1.0.4","1.0.3","1.0.2","1.0.1","1.0.0","2.2.4","2.2.3","2.2.2","2.2.1","2.2.0","2.1.4","2.1.3","2.1.2","2.1.1","2.1.0","2.0.3","2.0.2","2.0.1","2.0.0","3.4.1","3.4.0","3.3.1","3.3.0","3.2.1","3.2.0","3.1.1","3.1.0","3.0.0"];t.versions=r;var o={versions:r};t.default=o},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=q(n(0)),a=H(n(3)),i=H(n(13)),l=q(n(27)),u=n(67),s=H(n(200)),c=H(n(31)),d=H(n(11)),f=H(n(65)),p=(H(n(9)),H(n(5))),h=H(n(42)),m=H(n(184)),y=H(n(41)),g=H(n(214)),b=H(n(7)),v=H(n(10)),_=H(n(40)),w=H(n(1)),O=(H(n(369)),H(n(127))),k=H(n(146)),S=H(n(162)),C=H(n(126)),E=H(n(163)),P=H(n(1889)),T=H(n(1566)),M=H(n(59)),j=H(n(22)),x=H(n(283)),D=H(n(43)),N=H(n(1902)),L=H(n(1903)),R=H(n(6)),A=H(n(1920)),I=H(n(2)),B=n(1570);n(1922);H(n(784));var F=H(n(63)),W=(H(n(1491)),H(n(303)),H(n(457))),V=n(284),U=H(n(1923)),G=H(n(1925));function H(e){return e&&e.__esModule?e:{default:e}}function z(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(z=function(e){return e?n:t})(e)}function q(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=z(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],r={"et-fb-settings-options-tab":!0,"et-fb-all-modules":!0,"et-fb-modules-list":!t,"et-fb-settings-options":!0};return r["et-fb-settings-options-tab-"+e]=!0,e===n.state.active_tab&&(r["et-fb-settings-options-tab--active"]=!0),(0,i.default)(r)})),ne(ee(n),"_onLibraryDoneLoading",(function(){R.default.setProductTourElementReady("selectLayoutPack"),n.setState({library_loading:!1})})),ne(ee(n),"_onClickLibraryBackButton",(function(){n.setState({libraryBackToLayouts:!0})})),ne(ee(n),"_onClickLibraryPortability",(function(){n.setState({libraryPortabilityActive:!n.state.libraryPortabilityActive})})),ne(ee(n),"closeLibraryPortability",(function(){n.setState({libraryPortabilityActive:!1})})),ne(ee(n),"_onLibraryPageChanged",(function(t,r){var o={libraryBackToLayouts:!1,pageTitle:r};(n.state.hasBackButton&&!t||t&&!n.state.hasBackButton)&&(o.hasBackButton=t),n.setState(o),t&&R.default.isProductTourActive()&&(R.default.setProductTourElementReady("loadLayoutItem"),e("body").trigger("et_fb_product_tour_element_clicked"))})),ne(ee(n),"onPortabilityProgressBarChange",(function(e,t){n.setState({hasProgressBar:t})})),ne(ee(n),"renderLibraryBackButton",(function(){var e={position:(0,u.spring)(-12,{stiffness:300,damping:20}),opacity:(0,u.spring)(1,{stiffness:300,damping:20})},t=n.state.pageTitle?n.state.pageTitle:"layoutDetails",r=(0,w.default)(re,t,t);return o.default.createElement(u.Motion,{defaultStyle:{position:-40,opacity:0},style:e},(function(e){return o.default.createElement("div",null,o.default.createElement(F.default,{className:"et-fb-settings-button--back",buttonName:M.default.LIBRARY_MODAL_BACK_BUTTON,_onClick:n._onClickLibraryBackButton,primary:!0,style:{opacity:e.opacity,transform:"translateX( ".concat(e.position,"% )")}},o.default.createElement(D.default,{size:"14",icon:"back",color:"#FFFFFF"})),r)}))})),ne(ee(n),"_renderTabs",(function(){for(var e=arguments.length,t=new Array(e),r=0;r0?100:60,a=0,i=t.find(".et-fb-save-library-button").length>0?40:0;return t.find(r).length>0&&(!(0,d.default)(this.props.modalWidth)&&this.props.modalWidth&&t.find(r).width(this.props.modalWidth),a=0===n?t.find(r).innerHeight():n,!(0,d.default)(this.props.modalWidth)&&this.props.modalWidth&&t.find(r).width("auto")),ae||"portability"!==this.props.actionType||(i=40),a+i+o}},{key:"setInputFocus",value:function(){var e=I.default.$appWindow(this.modal.current),t=(0,w.default)(e.find(".et-fb-settings-options-wrap").offset(),"top",0),n=(0,w.default)(e.find(".et-fb-settings-options-tab--active").offset(),"top",0)-t;if(e.trigger("focus").find('input[type="text"]:visible').first().trigger("focus"),n<0&&e.find(".et-fb-settings-options-tab").length){var r=parseInt(e.find(".et-fb-settings-options").css("paddingTop")),o=Math.abs(n)+r;e.find(".et-fb-settings-options-wrap").scrollTop(o),setTimeout((function(){e.find(".et-fb-settings-options-wrap").scrollTop(o)}),0)}}},{key:"_handleStartMovement",value:function(e){if(!this.state.move)return!1;var t=this.state.modalPositionData,n="absolute"===t.style.position?e.pageX:e.pageX-I.default.$topWindow().scrollLeft(),r="absolute"===t.style.position?e.pageY:e.pageY-I.default.$topWindow().scrollTop();return n-=this.state.reactive.x,r-=this.state.reactive.y,t.style.top=r,t.style.left=n,this.setState({resetModalStyles:(0,s.default)(),modalPositionData:t})}},{key:"_handleMove",value:function(t){if(this.props.movable){var n="absolute"===this.state.modalPositionData.style.position?e((0,l.findDOMNode)(this)).position():e((0,l.findDOMNode)(this)).offset();this.setState({reactive:{x:t.pageX-n.left,y:t.pageY-n.top},move:!this.state.move})}}},{key:"_handleEndMovement",value:function(t){if(this.state.move){var n=e("#et-fb-app").offset(),r=I.default.topViewportWidth(),o=I.default.$topWindow().height(),a=this.state.modalPositionData;if("absolute"!==a.style.position&&(a.style.top+400>o||a.style.top<0)||"absolute"===a.style.position&&a.style.top<0&&Math.abs(a.style.top)>n.top){var i=50;"absolute"===a.style.position&&a.style.top<0&&Math.abs(a.style.top)>n.top&&(i+=a.style.top+(Math.abs(a.style.top)-n.top)),a.style.top=a.style.top<0?i:o-400}if("absolute"!==a.style.position&&a.style.left<0||a.style.left+400>r||"absolute"===a.style.position&&a.style.left<0&&Math.abs(a.style.left)>n.left){var l=50;"absolute"===a.style.position&&a.style.left<0&&Math.abs(a.style.left)>n.left&&(l+=a.style.left+(Math.abs(a.style.left)-n.left)),a.style.left=a.style.left<0?l:r-400}return this.setState({move:!1,modalPositionData:a})}}},{key:"_onProductTourElementChange",value:function(){this.setState({currentTourElement:R.default.getActiveProductTourElement()})}},{key:"_onModuleItemMouseEnter",value:function(e){this.setState({selectedItemIndex:e})}},{key:"_onModuleItemMouseLeave",value:function(){this.setState({selectedItemIndex:0})}},{key:"setMaxItemIndex",value:function(e,t){this.maxItemIndex[t]=e}},{key:"tabNavClassName",value:function(e){var t={};return t["et-fb-settings-options_tab_"+e]=!0,t["et-fb-settings-tabs-nav-item"]=!0,e===this.state.active_tab&&(t["et-fb-settings-tabs-nav-item--active"]=!0),(0,i.default)(t)}},{key:"centerizeSelectedItem",value:function(){var t=e(l.default.findDOMNode(this)),n=t.find(".et-fb-settings-options-wrap"),r=t.find(".et-fb-settings-options-tab:visible .et-fb-selected-item");if(r.length){var o=r.offset(),a=r.parent().offset();n.stop().animate({scrollTop:o.top-a.top})}}},{key:"_onKeyDownEvent",value:function(t){if(!R.default.isProductTourActive()){var n,r,o=this,a=e(l.default.findDOMNode(this)),i=this.state.selectedItemIndex,u=t.keyCode;if(13===u&&(a.find(".et-fb-selected-item:visible").trigger("click"),"change_structure"===this.props.actionType&&j.default.cancelTooltip()),(0,b.default)([38,39,40,37],u))if((0,b.default)([38,40],u)&&t.preventDefault(),"change_structure"===this.props.actionType?(a.find(".et-fb-module-settings"),r=(n=a.find(".et-fb-columns-layout")).find(".et-fb-selected-item")):(a.find(".et-fb-settings-options-wrap"),r=(n=a.find(".et-fb-settings-options-tab:visible")).find(".et-fb-selected-item")),r.length){var s=n.width(),c=r.width(),d=Math.floor(s/c),f=0;switch(u){case 38:f=i-d;break;case 39:f=i+1;break;case 40:f=i+d;break;case 37:f=i-1}f>0&&f<=this.maxItemIndex[this.state.active_tab]&&this.setState({selectedItemIndex:f,selectedItemUpdated:!0})}else this.setState({selectedItemIndex:1,selectedItemUpdated:!0});if(27===u&&(this.isLibrary()&&window.ETCloudApp?window.ETCloudApp.emitSignal({signal:"checkCloudItemProgress",data:{}}):j.default.cancelTooltip()),9===u&&!a.closest(".et-fb-modal-settings--library")&&!e(t.target).is("input:focus, button:focus")){var p="modules_all"===this.state.active_tab?"modules_library":"modules_all",h=a.find(".et-fb-columns-layout");if(this.setState({active_tab:p}),h.length&&"change_structure"===this.props.actionType){var m=h.find(".et-fb-column-layout--selected"),y=m;(y=t.shiftKey?m.prev().length?m.prev():h.find("li").last():m.next().length?m.next():h.find("li").first()).trigger("click"),setTimeout((function(){o.setState({selectedItemIndex:y.index()+1})}),0)}return t.preventDefault(),!1}}}},{key:"getModuleType",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.isLibrary())return"layout";var t="et_pb_",n=R.default.getModuleAddAfter(),r=["section","row","row_inner"],o=(0,g.default)(n.type,"et_pb_",""),a="";if(n.is_parent)switch(o){case"section":o="yes"===n.fullwidth?"module":"row";break;case"column":n.is_inner_row?(o="row",a="_inner"):o="module"}return"row_inner"===o&&(o="row",a="_inner"),(0,b.default)(r,o)||(o="module"),e&&(o="".concat(t).concat(o).concat(a)),o}},{key:"isAddingIntoGlobal",value:function(){return R.default.getModuleAddAfter().is_global}},{key:"_preventRightClick",value:function(t){this.props.enableContextMenu||e(t.target).is("input:focus")||t.preventDefault()}},{key:"getAdditionalFolders",value:function(e){e.map((function(e){var t=e.replace("et_pb_","");return t=t.replace(/_/g," "),that.maxItemIndex.modules_all++,o.default.createElement(N.default,{label:e,title:t,fbSupport:"off",key:e,itemIndex:that.maxItemIndex.modules_all,selectedItemIndex:that.state.selectedItemIndex,icon:"",iconSvg:"",onMouseEnter:that._onModuleItemMouseEnter,classnames:{et_pb_folder:!0},onClickAction:function(){return that.onClick(e)}})}))}},{key:"shouldModuleBeSkipped",value:function(e){return this.state.isFolderView?e.folder_name!==this.state.folderName:""===this.state.filterByTitle&&!(0,p.default)(e.folder_name)}},{key:"generateAddModuleContent",value:function(){var e=this,t=(0,f.default)(ETBuilderBackend.modules,{is_parent:"on"}),n=R.default.getModuleAddAfter(),r=n.type,a=this.props.specialtyModal,i=n.is_specialty_placeholder,l=!e.state.isFolderView&&""===e.state.filterByTitle,u=(0,c.default)(t,"folder_name"),s=(0,S.default)(u);s=(0,C.default)(s);var d="",p={allModulesList:{},mainTabTitle:"",modalTitle:"",moduleType:"",settingsModalClass:[]},h=[];if(this.maxItemIndex.modules_all=0,p.mainTabTitle=re.newModule,p.modalTitle=re.insertModule,!0===a){var m=0;p.modalTitle=re.insertColumn,this.maxItemIndex.modules_all=0,d=(0,c.default)([["1_2,1_2","1,0"],["1_2,1_2","0,1"],["1_4,3_4","0,1"],["3_4,1_4","1,0"],["1_4,1_2,1_4","0,1,0"],["1_2,1_4,1_4","1,0,0"],["1_4,1_4,1_2","0,0,1"],["1_3,2_3","0,1"],["2_3,1_3","1,0"]],(function(t,n){var r=t[0].split(","),a={layoutType:t[1],layoutFormat:t[0],columns:r,specialtyColumns:3};return m++,e.maxItemIndex.modules_all++,o.default.createElement(N.default,{label:t[0],title:t[0],key:m,specialtyLayout:a,itemIndex:e.maxItemIndex.modules_all,selectedItemIndex:e.state.selectedItemIndex,onMouseEnter:e._onModuleItemMouseEnter,isProcessingPlaceholder:i})})),p.allModulesList=o.default.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},d)}else if("et_pb_section"!==r&&"et_pb_row"!==r&&"et_pb_row_inner"!==r&&!n.is_inner_row||"et_pb_section"===r&&"yes"===n.fullwidth&&n.is_parent)d=(0,c.default)(t,(function(t){if(!(0,b.default)(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"],t.label)&&!e.shouldModuleBeSkipped(t)){var n=void 0!==t.fullwidth_only&&"on"===t.fullwidth_only,r=R.default.getModuleAddAfter(),a=R.default.getProductTourModuleName(),i=r.fullwidth,l={};if(!("yes"===i&&!n||"no"===i&&n||""!==e.state.filterByTitle&&-1===t.title.toLowerCase().indexOf(e.state.filterByTitle.toLowerCase()))){if((0,V.isPostContentModule)(t.label)){if(ETBuilderBackend.postType!==ETBuilderBackend.themeBuilder.bodyLayoutPostType&&!r.is_theme_builder_body_area)return;if((0,O.default)(ETBuilderBackend.themeBuilder.postContentModules,(function(e,t){return e+R.default.getModuleCount(t)}),0)>0)return}return"selectModule"===e.state.currentTourElement&&a===t.label&&(l["et-fb-product-tour-element"]=!0),e.maxItemIndex.modules_all++,o.default.createElement(N.default,{label:t.label,title:t.title,fbSupport:t.vb_support,key:t.label,itemIndex:e.maxItemIndex.modules_all,selectedItemIndex:e.state.selectedItemIndex,icon:(0,w.default)(t,"icon",""),iconSvg:(0,w.default)(t,"icon_svg",""),onMouseEnter:e._onModuleItemMouseEnter,classnames:l})}}})),l?(h=s.map((function(t){var n=t.replace("et_pb_","");return n=n.replace(/_/g," "),e.maxItemIndex.modules_all++,o.default.createElement(N.default,{label:t,title:n,fbSupport:"off",key:t,itemIndex:e.maxItemIndex.modules_all,selectedItemIndex:e.state.selectedItemIndex,icon:"",iconSvg:"",onMouseEnter:e._onModuleItemMouseEnter,classnames:{et_pb_folder:!0},onClickAction:function(){return e.onFolderClick(t)}})})),d=(0,k.default)(d,h)):p.settingsModalClass["et-fb-modal-settings--modules_filtered"]=!0,p.settingsModalClass.et_fb_insert_new_module=!0,p.allModulesList=o.default.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},d),p.moduleType="module";else if("et_pb_section"!==r||n.is_parent){if(("et_pb_row"===r||"et_pb_row_inner"===r)&&!n.is_parent||n.is_inner_row||"et_pb_section"===r&&n.is_parent){R.default.getLastAddedModuleData();var y={},g="regular",v="et_pb_column"===r?"et_pb_row_inner":r;p.settingsModalClass.et_fb_add_row_modal=!0,y.props={},"et_pb_row_inner"===v&&(g="specialty"),"on"===n.fullwidth&&(g="fullwidth"),y.props.section_parent=g,y.props.specialty_layout=n.specialty_layout,p.modalTitle=re.insertRow,p.mainTabTitle=re.newRow,p.allModulesList=o.default.createElement(A.default,Y({active:"true",_onClick:this.addRow,row:y,selectedItemIndex:e.state.selectedItemIndex,setMaxItemIndex:e.setMaxItemIndex,currentTourElement:e.state.currentTourElement},this.props))}}else{var _=i?["et_fb_specialty"]:["et_fb_regular","et_fb_specialty","et_fb_fullwidth"],E={et_fb_regular:re.regular,et_fb_fullwidth:re.fullwidth,et_fb_specialty:re.specialty};this.maxItemIndex.modules_all=0,p.modalTitle=re.insertSection,p.mainTabTitle=re.newSection,p.settingsModalClass.et_fb_add_section_modal=!0,d=(0,c.default)(_,(function(t){var n={};return e.maxItemIndex.modules_all++,"selectSectionType"===e.state.currentTourElement&&"et_fb_regular"===t&&(n["et-fb-product-tour-element"]=!0),o.default.createElement(N.default,{label:t,title:E[t],key:t,itemIndex:e.maxItemIndex.modules_all,selectedItemIndex:e.state.selectedItemIndex,onMouseEnter:e._onModuleItemMouseEnter,classnames:n})})),p.allModulesList=o.default.createElement("ul",{onMouseLeave:this._onModuleItemMouseLeave},d)}return p}},{key:"handle_tab_click",value:function(e){e.preventDefault();var t=e.target.className;this.isLibrary()&&window.ETCloudApp?window.ETCloudApp.emitSignal({signal:"checkCloudItemProgress",data:{activeTab:t}}):this.setState({active_tab:t,libraryBackToLayouts:!0})}},{key:"insertLayout",value:function(e){var t="on"===this.state.replace_layout;j.default.insertSavedModule(e,!0,t),j.default.cancelTooltip()}},{key:"loadLibraryModules",value:function(){var e=this.getModuleType(),t="et_pb_row_inner"===e?"et_pb_row":e,n="yes"===R.default.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";!1===R.default.getLibraryModules(t,n)&&j.default.getLibraryModules(t,n)}},{key:"_onLibraryLoaded",value:function(){var e=this.getModuleType();"et_pb_row_inner"===e&&(e="et_pb_row");var t="yes"===R.default.getModuleAddAfter().fullwidth&&"et_pb_module"===e?"fullwidth":"regular";this.setState({library_modules_updated:t+e,currentTourElement:R.default.getActiveProductTourElement()})}},{key:"setModalPosition",value:function(t){if(this.props.ignorePosition)return{};var n=R.default.getModuleAddAfter(),r=n.type,o=this.props.specialtyModal,a=this.props.modalPosition,i=!(0,d.default)(a)&&a,l=e(a.element).closest(".et-fb-skeleton"),u=ae?I.default.$topWindow("#et_pb_layout"):"",s=ae?u.offset().top:0,c=ae?u.offset().left:0,f=(0,w.default)(this,"props.previewMode"),p=!(0,d.default)(a)&&e((0,w.default)(a,"element","")),h=I.default.getAdminBarHeight(),m={},y=!1,g=!1;i&&!1!==a.element&&"rightClickMenu"!==a.element&&(0===(y=p&&p.length>0?p:I.default.$topWindow(".et-fb-page-settings-bar .et-fb-button--toggle-portability")).length&&(y=I.default.$topWindow(".et-fb-page-settings-bar .et-fb-button--toggle-add")),g=y.hasClass("et-fb-page-settings--tools"),(y.hasClass("et-fb-button-group")||g)&&(y.context?y=I.default.$topWindow(y.context):(0,w.default)(a,"element.prevObject")&&(y=I.default.$topWindow((0,w.default)(a,"element.prevObject"))))),!ae&&!ie&&y&&y.length>0&&!I.default.isElementInViewport(y)&&y[0].scrollIntoView({block:"center"});var v=y&&y.closest(".et-fb-page-settings-bar").length>0,_=y?y.innerHeight()/2:0,O=y?y.innerWidth()/2:0,k=I.default.topViewportWidth(),S=I.default.topViewportHeight(),C=y?y.offset():a,E=ae||(0,b.default)(["zoom","tablet","phone"],f)?I.default.$topWindow().scrollTop():I.default.$appWindow().scrollTop(),P="rightClickMenu"===a.element;(0,b.default)(["save_to_library","save_to_cloud"],this.props.actionType)&&P&&(C.top=this.props.rightClickPosition.top,"zoom"===f&&(C.top=C.top/2),"app"===I.default.getWindowScrollLocation(f)&&(C.left=this.props.rightClickPosition.left)),ae&&(E-=s,E-=parseFloat(I.default.$topWindow("#et-bfb-app-frame").css("marginTop"))),m.class={};var T="modules_library"===this.state.active_tab&&"add_module"===this.props.actionType;if(k<=502&&(this.isLibrary()||T))return m.style={top:0,left:0,right:!1,width:k,height:S,position:"fixed"},m;if(0===C.top&&0===C.left&&(C.top=a.top,C.left=a.left),!ae&&I.default.isResponsiveView(R.default.getPreviewMode())){var M=I.default.$topWindow("#et-fb-app-frame"),D=I.default.getIntegerValue(M.css("paddingTop"));C.top=C.top+D}var N=k<493?k-20:400,L=t||this.state.autoHeight,A=ae?-1*I.default.$topWindow("#adminmenuwrap").innerWidth():(0,b.default)(["tablet","phone"],f)?-1*I.default.$topWindow("#et-fb-app-frame").innerWidth()/2:0,B=(0,d.default)(this.props.modalHeight)||""===this.props.modalHeight?274:this.props.modalHeight,F=B,W=(0,d.default)(this.props.modalWidth)||""===this.props.modalWidth?N:this.props.modalWidth,V="zoom"!==f||v||"rightClickMenu"===a.element?C.left:C.left/2,U=!1,G=0;(V=V-W/2+O)>0?V=C.left+W/2+O>k?k-W-O-30:V:(U=Math.abs(A)<=Math.abs(V),G=Math.abs(V)-Math.abs(A),V=U?A:V),"et_pb_section"!==r||n.is_parent||o?"et_pb_row_inner"===r||n.is_inner_row?B=188:"modules_library"!==this.state.active_tab&&"portability"!==this.props.actionType&&("et_pb_row"===r||"et_pb_section"===r&&n.is_parent&&!o&&"yes"!==n.fullwidth)?B=284:"et_pb_section"===r&&o?B=320:"add_module"===this.props.actionType&&(B=385):B=198,g&&(B=290),"change_structure"===this.props.actionType&&p&&p.length>0&&p.closest(".et_pb_row_inner").length>0&&(B=148),"clear_layout"===this.props.actionType&&(B=200),F=(0,d.default)(L)||""===L?B:Math.max(B,Math.min(936,L));var H=E;!P||(0,b.default)(["save_to_library","save_to_cloud"],this.props.actionType)||ae||(0,b.default)(["zoom","tablet","phone"],f)||(H=0),ie&&(H+=I.default.viewportScrollTop());var z=H+S,q=H+S/2,K=(!ae||!v)&&C.top>=q,$=K?C.top-H:z-C.top,Y=x.default.tooltipModal.top,X=x.default.tooltipModal.bottom,J=K?Y:X;if(C.top,ae&&v&&(0,b.default)(["save_to_library","save_to_cloud","portability"],this.props.actionType)&&($=S+E),F+J>$&&(F=Math.max(B,$-J)),v||T||this.isExpandedIconPicker()){this.isExpandedIconPicker()&&(0===y.closest(".et-fb-page-settings-bar").length&&(y=ae?I.default.$topWindow(".et-fb-page-settings-bar .et-fb-button--toggle-history"):I.default.$topWindow(".et-fb-page-settings-bar .et-fb-button--toggle-add")),ae&&I.default.$topWindow("html, body").animate({scrollTop:0},100,"swing"));var Q=I.default.$topWindow(".et-fb-page-settings-bar"),Z=Q.hasClass("et-fb-page-settings-bar--vertical"),ee=Q.hasClass("et-fb-page-settings-bar--corner"),te=ee&&Q.hasClass("et-fb-page-settings-bar--right-corner"),ne=ee&&Q.hasClass("et-fb-page-settings-bar--left-corner"),re=Q.hasClass("et-fb-page-settings-bar--right"),oe=ee&&Q.hasClass("et-fb-page-settings-bar--top-corner"),le=Q.position().top,ue=ae?Q.offset().top+parseInt(Q.height())+13:Q.outerHeight(!0)+I.default.getAdminBarHeight(),se=95,ce=ne?se:V<(Z?80:10)?Z?80:10:Z?V-70:V,de=this.isLibrary()||T;if(re&&(ce-=I.default.maybeGetScrollbarWidth(f)),("modules_library"===this.state.active_tab||(0,b.default)(["save_to_library","save_to_cloud","portability","load_layout"],this.props.actionType)||T)&&k<493&&(W=k<493?k-100-30:400),de||this.isExpandedIconPicker()){var fe=Z||ae?30:parseInt(Q.height()),pe=ae||!Z&&!ee?50:se,he=ae?0:60-h;ie&&(he=-8),!ae&&860<=k&&1080>=k&&(pe=pe/2-5),!ae&&860>k&&(pe=0),F=S-h-fe-he,W=k-2*pe,ae&&(se=0),Z||ee||ae?(ue=oe?ue:h+he,(V=(k-W)/2)<15&&(V=15)):V=(k-W-I.default.getScrollbarWidth())/2}if((Z||ee||this.props.helpModalActive&&!this.state.helpModalMoved||ae||T)&&(m.class["et-fb-tooltip--no-arrow"]=!0),I.default.getAdminBarHeight()===le||ae)m.class={"et-fb-modal-settings--inversed":!ae||!de,"et-fb-tooltip--no-arrow":Z||ee||this.props.helpModalActive&&!this.state.helpModalMoved||ae&&de,"et-fb-tooltip--vertical-center":Z},!de&&!this.isExpandedIconPicker()||ae||(F-=25,ie&&!Z&&(F-=24));else{var me=ae?0:Y;if((ue=le-F)=k&&(ge=20),!ae&&de&&860>k&&(ge=0),m.style={top:ue,left:ge,right:!!te&&se,width:W,height:F,position:ae&&!de?"absolute":"fixed"},m}var be=(ae?I.default.$topWindow("#et-bfb-app-frame"):I.default.$topWindow("#et-fb-app-frame")).offset(),ve=be.top;if(l.length>0){(0,b.default)(["save_to_library","save_to_cloud"],this.props.actionType)&&l.hasClass("et-fb-skeleton--row");l.offset().left}"app"===I.default.getWindowScrollLocation(f)&&0===E&&0===ve&&C.top>S&&setTimeout((function(){j.default.cancelTooltip()}),300),ve=ae||(0,b.default)(["zoom","tablet","phone"],f)||P&&!(0,b.default)(["save_to_library","save_to_cloud"],this.props.actionType)||this.props.renderInsideApp?ve:ve-E;var _e="zoom"===f&&"rightClickMenu"!==a.element?C.top/2:C.top;_e=_e-F+(ie?0:ve),this.props.forceFixedPosition||(V+=P?c:be.left),V+W>k&&(V=k-W);var we=0>V&&(this.props.forceFixedPosition||Math.abs(V)>be.left)?10:V;if(we=30>we?30:we,m.style={top:_e,left:we,width:W,height:F,position:this.props.forceFixedPosition?"fixed":"absolute"},this.props.forceFixedPosition&&"custom_content"===this.props.actionType)return(m.style.top<0||m.style.top+F>S)&&(m.style.top=m.style.top<0?50:S-F-100),(m.style.left<0||m.style.left+W>k)&&(m.style.left=m.style.left<0?50:k-W-100),m;(0,b.default)(["save_to_library","save_to_cloud"],this.props.actionType)&&((0,w.default)(this.state,"cloudStatus.error")?m.class["et-fb-modal-settings--red-bottom"]=!0:m.class["et-fb-modal-settings--blue-bottom"]=!0);var Oe="app"===I.default.getWindowScrollLocation(f),ke=P&&Oe?I.default.$appWindow().scrollTop()-this.state.appWindowScrollTopOnload:0;if(m.style.top=m.style.top-ke,!K){var Se=F+_+15;m.style.top=m.style.top+Se,!ae&&m.style.height+J+_+15>$&&(m.style.height=m.style.height-_-15),m.class={"et-fb-modal-settings--inversed":!0},(0,b.default)(["save_to_library","save_to_cloud"],this.props.actionType)&&(m.class["et-fb-modal-settings--blue-bottom"]=!1)}var Ce=K&&ae?F:F+J;if(!this.windowScrolled&&F===B&&Ce>$){var Ee=Ce-$,Pe="desktop"!==f||ae?I.default.$topWindow().scrollTop():I.default.$appWindow().scrollTop(),Te=K?Pe-Ee:Pe+Ee;("desktop"!==f||ae?I.default.$topWindow("html, body"):I.default.$appWindow("html, body")).animate({scrollTop:Te},500,"swing")}if(U){var Me=I.default.$topWindow("head"),je="et-fb-modal-edge-style",xe=200-G-30,De="".concat(ETBuilderBackend.css.prefix," .et-fb-modal-add-module-container.et-fb-modal-settings--left-side:after {left: ").concat(xe,"px;}");Me.remove("#"+je),Me.append('")),m.class["et-fb-modal-settings--left-side"]=!0}return this.windowScrolled=!0,m}},{key:"addRow",value:function(e,t){t=(0,d.default)(t)?"et_pb_row":t,j.default.insertNewModule(t,e)}},{key:"_onClearLayout",value:function(e){e.preventDefault();var t=R.default.getActiveThemeBuilderArea();R.default.abIsMode("off",t)&&(j.default.performLayoutClearing(),j.default.cancelTooltip())}},{key:"_closePromptAndModal",value:function(e,t){window.ETCloudApp&&window.ETCloudApp.emitSignal({signal:"haltCloudItemProgress",data:{}}),(0,E.default)(t)||""===t?j.default.cancelTooltip():this.setState({active_tab:t,libraryBackToLayouts:!0})}},{key:"_closePrompt",value:function(){this.setState({isPromptOpen:!1})}},{key:"_openPrompt",value:function(){this.setState({isPromptOpen:!0})}},{key:"_onClose",value:function(){if(this.state.hasBackButton)this._onClickLibraryBackButton();else if(_.default!==this.props._closeFunction)this.props._closeFunction();else{var e=this.props.actionType;(0,b.default)(["load_layout","add_module"],e)&&this.isLibrary()&&window.ETCloudApp?window.ETCloudApp.emitSignal({signal:"checkCloudItemProgress",data:{}}):j.default.cancelTooltip()}}},{key:"_onInput",value:function(e,t){var n=ne({},e,t);"filterByTitle"===e&&I.default.hasValue(this.state.filterByTitle)&&(n.selectedItemIndex=1,n.selectedItemUpdated=!0),this.setState(n)}},{key:"isPreloadingItems",value:function(e){return!!this.props.preloadingItems&&R.default.isPreloadingItem(e)}},{key:"onFolderClick",value:function(e){this.setState({isFolderView:!0,folderName:e})}},{key:"onClickModulesFilteredListBackBtn",value:function(){this.setState({isFolderView:!1,folderName:""})}},{key:"render",value:function(){var e,t=this;if(!this.props.active)return!1;var n=R.default.getAppPreference("builder_animation"),r=(0,v.default)((ne(e={"et-fb-settings":!0,"et-fb-tooltip-modal":!0},"et-fb-tooltip-modal--".concat(this.props.actionType),!0),ne(e,"et-fb-modal-settings--container",!0),ne(e,"et-fb-modal-settings--".concat(this.state.active_tab),!0),ne(e,"et-fb-modal-add-module-container",!0),ne(e,"et-fb-moving",this.state.move),ne(e,"et-fb-movable-modal",this.props.movable),ne(e,"et-fb-tooltip-modal-animated","normal"===this.state.applyTransitionAnimation),ne(e,"et-fb-tooltip-modal-animated-fast","fast"===this.state.applyTransitionAnimation),ne(e,"et-fb-tooltip-modal-folder-view",this.state.isFolderView),e),this.props.classNames),a=!(0,d.default)(this.state.modalPositionData),s=a&&!(0,p.default)(this.state.modalPositionData)?this.state.modalPositionData:this.setModalPosition(),c=s.style,f="",h="";(0,d.default)(s.class)||(0,v.default)(r,s.class);var m="";switch(this.props.actionType){case"add_module":var y=this.generateAddModuleContent(),g=y.allModulesList,b=y.mainTabTitle,O=R.default.isProductTourActive()?R.default.getActiveProductTourElement():"",k={maxHeight:(0,w.default)(c,"height",100)-100},S=R.default.getModuleAddAfter(),C=S.is_specialty_placeholder,E=this.getModuleType(!1),j=S.saved_specialty_column_type,x=!1,N="regular";if("module"===E&&(N="no"!==(0,w.default)(S,"fullwidth","no")?"fullwidth":"regular"),"row"===E&&j&&(x="2_3"===j?4:3),"selectSectionType"===O&&(k.overflow="visible"),"modules_library"===this.state.active_tab&&this.state.hasBackButton)f=this.renderLibraryBackButton();else if(this.state.isFolderView){var V={position:(0,u.spring)(-12,{stiffness:100,damping:10}),opacity:(0,u.spring)(1,{stiffness:100,damping:10})};f=o.default.createElement(u.Motion,{defaultStyle:{position:-40,opacity:0},style:V},(function(e){return o.default.createElement("div",null,o.default.createElement(F.default,{className:"et-fb-settings-button--back",buttonName:M.default.MODULES_FILTERED_LIST_BACK_BUTTON,_onClick:t.onClickModulesFilteredListBackBtn,primary:!0,style:{opacity:e.opacity,transform:"translateX( ".concat(e.position,"% )")}},o.default.createElement(D.default,{size:"14",icon:"back",color:"#FFFFFF"})),y.modalTitle)}))}else f=y.modalTitle;(0,v.default)(r,y.settingsModalClass);var G="module"===y.moduleType?o.default.createElement("div",{className:"et-fb-modules-filters et-fb-module-single-filter"},o.default.createElement(W.default,{type:"text",value:this.state.filterByTitle,name:"filterByTitle",_onChange:this._onInput,onKeyDown:this._onKeyDownEvent,additional_attrs:{placeholder:re.search,autoComplete:"off"}})):"",H=R.default.isAllowedAction("add_library")&&R.default.isAllowedAction("divi_library")&&!C?o.default.createElement("li",{className:this.tabNavClassName("modules_library")},o.default.createElement("a",{href:"#",className:"modules_library",onClick:this.handle_tab_click},re.addFromLibrary)):"",z=R.default.isAllowedAction("add_library")&&R.default.isAllowedAction("divi_library")&&"modules_library"===this.state.active_tab?o.default.createElement("div",{className:this.tabClassName("modules_library",!0)},o.default.createElement(P.default,{isLoading:this.state.library_loading,_renderTabs:_.default,doneLoading:this._onLibraryDoneLoading,pageChanged:this._onLibraryPageChanged,backToLayouts:this.state.libraryBackToLayouts,importItemsOpened:this.state.libraryPortabilityActive,closeLibraryPortability:this.closeLibraryPortability,tabClassName:this.tabClassName,active_tab:"modules_library",type:E,moduleWidth:N,maxColumns:x,isProductTour:!1,modalMoving:!1,closeToolTipModal:this._closePromptAndModal,openPrompt:this._openPrompt})):"";m=o.default.createElement("div",{className:"et-fb-main-settings et-fb-main-settings--add_new_module"},o.default.createElement("ul",{className:"et-fb-settings-tabs-nav",ref:"settingsTabsNav"},o.default.createElement("li",{className:this.tabNavClassName("modules_all")},o.default.createElement("a",{href:"#",className:"modules_all",onClick:this.handle_tab_click},b)),H),o.default.createElement("div",{className:"et-fb-settings-options-wrap",style:k},o.default.createElement("div",{className:"et-fb-settings-options"},o.default.createElement("div",{className:this.tabClassName("modules_all")},G,g,"module"===y.moduleType&&o.default.createElement("a",{className:"et-fb-button et-fb-button--info et-fb-module-upsell-button",href:"https://www.elegantthemes.com/marketplace/?utm_source=Divi+Marketplace&utm_medium=Visual+Builder&utm_campaign=Native",style:{textAlign:"center",width:"100%",marginBottom:"20px"},target:"_blank"},oe.modals.exploreDiviModules)),z)));break;case"load_layout":var q="et-fb-modal-settings--library";r[q]=!0,this.state.hasBackButton?(r["".concat(q,"__layout")]=!0,f=this.renderLibraryBackButton()):f=re.loadLayout,m=o.default.createElement(P.default,{isLoading:this.state.library_loading,_renderTabs:this._renderTabs,doneLoading:this._onLibraryDoneLoading,pageChanged:this._onLibraryPageChanged,backToLayouts:this.state.libraryBackToLayouts,importItemsOpened:this.state.libraryPortabilityActive,closeLibraryPortability:this.closeLibraryPortability,tabClassName:this.tabClassName,active_tab:this.state.active_tab,layoutFilters:this.props.layoutFilters,type:"layout",isProductTour:R.default.isProductTourActive(),productTourElement:this.state.currentTourElement,modalMoving:this.props.modalMoving,closeToolTipModal:this._closePromptAndModal,openPrompt:this._openPrompt});break;case"save_to_library":case"save_to_cloud":r.et_fb_save_module_modal=!0;var K=R.default.getModuleLibrarySave();f=(0,B.getSaveModalTitle)(K),m=o.default.createElement(L.default,{maxHeight:(0,w.default)(c,"height",70)-70,action:this.props.actionType});break;case"expanded_icon_picker":r["et-fb-modal-add-module-container"]=!1,f=re.selectIcon,m=o.default.createElement(U.default,{selectedIcon:this.props.selectedIcon,handleChangeIcon:this.props.handleChangeIcon,closeModal:this.props._closeFunction,modalHeight:c.height,attrs:this.props.currentIconAttrs});break;case"change_structure":var Y=R.default.getStructurallyChangedRow();f=re.changeRow,m=o.default.createElement("div",{className:"et-fb-settings-options-wrap",style:{maxHeight:(0,w.default)(c,"height",100)-60}},o.default.createElement("div",{className:"et-fb-settings-options"},o.default.createElement(A.default,{row:Y,selectedItemIndex:this.state.selectedItemIndex,setMaxItemIndex:this.setMaxItemIndex})));break;case"clear_layout":f=re.clearLayout,m=o.default.createElement("div",{className:"et_fb_save_module_modal et_fb_clear_layout"},o.default.createElement("div",{className:"et-fb-settings-options"},re.clearLayoutText),o.default.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:this._onClearLayout},re.yes));break;case"portability":f=re.portability.replace(/&/,"&"),m=o.default.createElement(T.default,{_renderTabs:this._renderTabs,preloadingItems:this.props.preloadingItems,tabClassName:this.tabClassName,active_tab:this.state.active_tab,maxHeight:(0,w.default)(c,"height",140)-140,hasProgressBar:this.state.hasProgressBar}),I.default.isBFB()||(r["et-fb-modal-settings--blue-bottom"]=!this.state.hasProgressBar&&!this.props.preloadingItems);break;case"custom_content":f=this.props.tooltipTitle,h=(0,d.default)(this.props.buttons)?"":this.props.buttons,m=o.default.createElement("div",{className:"et-fb-main-settings et-fb-settings-options"},this.props.children)}var X=a?1:0,J="custom_content"!==this.props.actionType?"et-fb-tooltip-helper-container":"et-fb-tooltip-helper-container-custom",Q=(0,w.default)(c,"position",""),Z=o.default.createElement(o.Fragment,null,o.default.createElement(u.Motion,{key:Q,defaultStyle:{size:.8},style:{size:n?(0,u.spring)(1,{stiffness:300,damping:20}):1}},(function(e){return o.default.createElement("div",{key:"modal",id:"et-fb-settings-column",ref:t.modal,className:(0,i.default)(r),onContextMenu:t._preventRightClick,onKeyDown:t._onKeyDownEvent,tabIndex:"0",style:$($({},c),{},{opacity:X,transform:"scale( ".concat(e.size," )")})},o.default.createElement("div",{className:J},o.default.createElement("div",{className:"et-fb-module-settings"},o.default.createElement("h3",{className:"et-fb-settings-heading",onMouseDown:t._handleMove},f,t.renderPortabilityButton(),o.default.createElement(F.default,{className:"et-fb-settings-button--close",buttonName:M.default.MODAL_SETTINGS_BUTTON_CLOSE,_onClick:t._onClose,primary:!0},o.default.createElement(D.default,{size:"14",icon:"close",color:"#FFFFFF"}))),m,h)))})),this.isLibrary()&&I.default.isBFB()&&o.default.createElement("div",{className:"et-core-modal-overlay et-core-active et-core-modal-overlay--library"}),this._renderRequestInProgressPrompt());return this.props.renderInsideApp?Z:l.default.createPortal(Z,I.default.$topWindow("".concat(ETBuilderBackend.css.layoutPrefix," #et-fb-app"))[0])}}],r&&X(n.prototype,r),a&&X(n,a),Object.defineProperty(n,"prototype",{writable:!1}),z}(o.default.Component);se.propTypes=le,se.defaultProps=ue;var ce=se;t.default=ce}).call(this,n(8))},function(e,t,n){"use strict";(function(e,r){function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=qe(n(40)),i=qe(n(215)),l=qe(n(199)),u=qe(n(334)),s=qe(n(371)),c=qe(n(149)),d=qe(n(522)),f=qe(n(516)),p=qe(n(69)),h=qe(n(147)),m=qe(n(359)),y=qe(n(392)),g=qe(n(135)),b=qe(n(41)),v=qe(n(124)),_=qe(n(56)),w=qe(n(162)),O=qe(n(185)),k=qe(n(125)),S=qe(n(17)),C=qe(n(10)),E=qe(n(1)),P=qe(n(72)),T=qe(n(64)),M=qe(n(37)),j=qe(n(12)),x=qe(n(4)),D=qe(n(163)),N=qe(n(11)),L=qe(n(7)),R=qe(n(197)),A=qe(n(96)),I=qe(n(42)),B=qe(n(5)),F=qe(n(9)),W=qe(n(34)),V=qe(n(127)),U=qe(n(107)),G=qe(n(399)),H=qe(n(31)),z=qe(n(58)),q=n(520),K=qe(n(164)),$=ze(n(0)),Y=qe(n(3)),X=n(27),J=n(67),Q=qe(n(13)),Z=qe(n(617)),ee=n(618),te=qe(n(2)),ne=qe(n(18)),re=n(138),oe=qe(n(15)),ae=qe(n(39)),ie=qe(n(59)),le=qe(n(283)),ue=qe(n(22)),se=qe(n(6)),ce=qe(n(14)),de=qe(n(784)),fe=qe(n(781)),pe=qe(n(43)),he=qe(n(806)),me=qe(n(63)),ye=ze(n(782)),ge=ze(n(506)),be=qe(n(1517)),ve=qe(n(1575)),_e=qe(n(1484)),we=qe(n(1850)),Oe=qe(n(281)),ke=qe(n(1550)),Se=qe(n(285)),Ce=n(66),Ee=qe(n(337)),Pe=qe(n(1498)),Te=n(60),Me=qe(n(791)),je=n(284),xe=n(396),De=qe(n(84)),Ne=qe(n(629)),Le=qe(n(519)),Re=qe(n(623)),Ae=n(405),Ie=qe(n(406)),Be=n(630),Fe=n(400),We=qe(n(1852)),Ve=qe(n(512)),Ue=qe(n(1551)),Ge=qe(n(1553));function He(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(He=function(e){return e?n:t})(e)}function ze(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var n=He(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function qe(e){return e&&e.__esModule?e:{default:e}}function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n600?300:10;t.mouseLeaveTimeout=setTimeout((function(){return t.setState({hoveredGroup:null})}),n)}t._setHoveredElement(!1)})),at(rt(t),"_onToggleRightMenu",(function(e){t.props.onToggleRightMenu(e)})),at(rt(t),"_onMouseEnterTitle",(function(){var e=t.props.module;if((0,E.default)(e,"props.is_module_child")){var n=Se.default.getHelper("child_item").preparePayload(e),r=(0,E.default)(e,"props.type","");t._setHoveredElement("child_item",r,n)}else ue.default.setHoveredModuleElement(e,{fromModalTitle:!0})})),at(rt(t),"_onMouseLeaveTitle",(function(){ue.default.setHoveredElement(!1)})),at(rt(t),"_onClickHelp",(function(e){e=ne.default.getFieldBaseName(e);var n=t.state.activeDescription===e?null:e;t.setState({activeDescription:n})})),at(rt(t),"_onSwitchTab",(function(e,n,r){var o=t.state.toggleTabs,a=[e,n];(0,E.default)(o,a)!==r&&t.setState({toggleTabs:(0,_.default)(Ze({},o),a,r)})})),at(rt(t),"_setHoveredElement",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ue.default.setHoveredElement(e,t,n)})),at(rt(t),"isOptionHovered",(function(e){var t=se.default.getMouseHoveredElement().elementId===e;return!t||"admin_label"!==e&&"background"!==e?t:"option"===se.default.getMouseHoveredElement().type})),at(rt(t),"_onTabSelect",(function(e){t.setState({tabSelectedIndex:e})})),at(rt(t),"_setActiveCustomCSSTab",(function(e){t.setState({activeCustomCSSTabIndex:e}),t.setState({activeCustomCSSTab:["freeFormCSS","moduleElements"][e]})})),at(rt(t),"_onGlobalPresetsStateChange",(function(){var e=se.default.getGlobalPresetsState().submitDialog;t.setState({isGlobalPresetsSubmitDialogVisible:e.isVisible,isGlobalPresetsSubmitDialogWaiting:e.showSpinner})})),at(rt(t),"_onBackToParent",(function(){var e=t.props.isGlobalPresetsMode?ie.default.BUTTON_GLOBAL_PRESETS_BACK_TO_PARENT:ie.default.MODULE_ITEM_BACK_TO_PARENT;ue.default.buttonClick({props:{buttonName:e}},t._getModule())})),at(rt(t),"_setHoveredElementWrapper",(function(e,n){var r=Se.default.getHelper("modal_tab");if(e){var o=(0,z.default)(t._getTabs(),(function(e){return e.slug===n}));if(!o)return;var a=t._getNonEmptyToggles(t.props.module.props.type,n+".toggles",n),i=t._getOptionsFields(n),l=r.preparePayload(n,o.title,a,i,t.props.module);t._setHoveredElement(e,n,l)}else t._setHoveredElement(!1)})),t.displayName="ETBuilderSettingsModal",t.cache=new mt;var r=e.module,a=e.isGlobalPresetsMode;if(t.module_type=(0,Ae.maybeConvertModuleType)(r),t.state=(0,C.default)({activeDescription:null,activeHover:null,activeHoverField:null,hoveredGroup:null,openedToggle:"main_content",openedGeneralGroup:"main_content",openedDesignGroup:"",openedCSSGroup:"",advancedFields:t.module_type&&t.getComponentAdvancedFields(r,a),generalFields:t.module_type&&t.getComponentFields(r,a),cssFields:t.module_type&&t.getComponentCSSFields(r,a),filterOptions:e.filterOptions||"",filterSelected:e.filterSelected,filterNotice:!1,toggleTabs:{},isGlobalPresetsSubmitDialogVisible:!1,tabSelectedIndex:e.tabSelectedIndex||0,isModalRest:!1,activeCustomCSSTabIndex:0,activeCustomCSSTab:"freeFormCSS"},t.getCustomTabsFields(t.module_type)),t.setting_resolver=t.getSettingResolver(),t.updatedAttrs={},!(0,E.default)(rt(t),"props.module.props.is_official_module")){var i=t.maybeGetFirstOpenedToggle();i&&(t.state.openedToggle=i,t.state.openedGeneralGroup=i)}return t.settingsModalTabPanelNode=$.default.createRef(),t._hasColumnsFields=t._hasColumnsFields.bind(rt(t)),t._onChange=t._onChange.bind(rt(t)),t._onChangeDynamic=t._onChangeDynamic.bind(rt(t)),t._resetOption=t._resetOption.bind(rt(t)),t._isResetActive=t._isResetActive.bind(rt(t)),t._onClickHelp=t._onClickHelp.bind(rt(t)),t._onClickHover=t._onClickHover.bind(rt(t)),t._onClickResponsive=t._onClickResponsive.bind(rt(t)),t._onClickSticky=t._onClickSticky.bind(rt(t)),t._onClickReset=t._onClickReset.bind(rt(t)),t._onMouseEnterGroup=t._onMouseEnterGroup.bind(rt(t)),t._onMouseLeaveGroup=t._onMouseLeaveGroup.bind(rt(t)),t._onToggleRightMenu=t._onToggleRightMenu.bind(rt(t)),t._onClickToggle=t._onClickToggle.bind(rt(t)),t._handleFormSubmission=t._handleFormSubmission.bind(rt(t)),t._unsyncGlobalSetting=t._unsyncGlobalSetting.bind(rt(t)),t._unsyncGlobalContent=t._unsyncGlobalContent.bind(rt(t)),t._onFilterInput=t._onFilterInput.bind(rt(t)),t._onFilterSelect=t._onFilterSelect.bind(rt(t)),t._onFilterChanged=t._onFilterChanged.bind(rt(t)),t._onGoToOption=t._onGoToOption.bind(rt(t)),t._isOptionMatchesFilter=t._isOptionMatchesFilter.bind(rt(t)),t._handleShortcuts=t._handleShortcuts.bind(rt(t)),t._onComponentAdvancedFieldDefinitionChange=t._onComponentAdvancedFieldDefinitionChange.bind(rt(t)),t._onComponentFieldDefinitionChange=t._onComponentFieldDefinitionChange.bind(rt(t)),t._onComponentCSSFieldDefinitionChange=t._onComponentCSSFieldDefinitionChange.bind(rt(t)),t._onComponentDefinitionsChange=t._onComponentDefinitionsChange.bind(rt(t)),t._onModalRest=t._onModalRest.bind(rt(t)),t._getOptionsFields=t._getOptionsFields.bind(rt(t)),t.getTabsCount=t.getTabsCount.bind(rt(t)),t.maybeGetFirstOpenedToggle=t.maybeGetFirstOpenedToggle.bind(rt(t)),t._isModuleItemSettings=t._isModuleItemSettings.bind(rt(t)),t._renderCustomCSSTabs=t._renderCustomCSSTabs.bind(rt(t)),t._setActiveCustomCSSTab=t._setActiveCustomCSSTab.bind(rt(t)),t._onQuickAccessSwitchTab=t._onQuickAccessSwitchTab.bind(rt(t)),t._onQuickAccessActive=t._onQuickAccessActive.bind(rt(t)),t._setHoveredToggleElement=t._setHoveredToggleElement.bind(rt(t)),t._setHoveredSubToggleElement=t._setHoveredSubToggleElement.bind(rt(t)),t.productTourOptionToggle=!1,t.builder_display_modal_settings=se.default.getAppPreference("builder_display_modal_settings"),t._onPromptUseTextClick=t._onPromptUseTextClick.bind(rt(t)),t.mouseLeaveTimeout=0,t.hoverStarted=0,t.isModalRestTimeout=null,t}return ut(o,[{key:"getComponentFields",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=n||(0,Ae.maybeConvertModuleType)(e),o=n?"general_fields__".concat(n):r;if(this.cache.has(r,o))return this.cache.get(r,o);var a=se.default.filterUserFields(ce.default.getComponentFields(n?{props:{type:n}}:e,t));return this.cache.set(r,o,a),a}},{key:"getComponentAdvancedFields",value:function(e,t){var n=(0,Ae.maybeConvertModuleType)(e);if(this.cache.has(n,"advanced_fields"))return this.cache.get(n,"advanced_fields");var r=se.default.filterUserFields(ce.default.getComponentAdvancedFields(e,t));return this.cache.set(n,"advanced_fields",r),r}},{key:"getComponentCSSFields",value:function(e,t){var n=(0,Ae.maybeConvertModuleType)(e);if(this.cache.has(n,"css_fields"))return this.cache.get(n,"css_fields");var r=se.default.filterUserFields(ce.default.getComponentCSSFields(e,t));return this.cache.set(n,"css_fields",r),r}},{key:"getComponentCustomTabFields",value:function(e,t){if(this.cache.has(e,"custom_tab-".concat(t)))return this.cache.get(e,"custom_tab-".concat(t));var n=se.default.filterUserFields(ce.default.getComponentCustomTabFields(e,t));return this.cache.set(e,"custom_tab-".concat(t),n),n}},{key:"getModuleCustomTabs",value:function(e){if(this.cache.has(e,"module_custom_tabs"))return this.cache.get(e,"module_custom_tabs");var t=ce.default.getComponentCustomTabs(e);return this.cache.set(e,"module_custom_tabs",t),t}},{key:"UNSAFE_componentWillMount",value:function(){this.cache.reset(),ce.default.addComponentAdvancedFieldDefinitionChangeListener(this._onComponentAdvancedFieldDefinitionChange),ce.default.addComponentFieldDefinitionChangeListener(this._onComponentFieldDefinitionChange),ce.default.addComponentFieldDefinitionsChangeListener(this._onComponentFieldDefinitionsChange),ce.default.addComponentCSSFieldDefinitionChangeListener(this._onComponentCSSFieldDefinitionChange),se.default.addGoToOptionListener(this._onGoToOption),se.default.addQuickAccessSwitchTabListener(this._onQuickAccessSwitchTab),se.default.addQuickAccessActiveListener(this._onQuickAccessActive),se.default.addOptionsFilterChangeListener(this._onFilterChanged),this._onChangeCacheReset=(0,b.default)(this._onChangeCacheReset,400,{leading:!0,trailing:!1})}},{key:"componentDidMount",value:function(){this.props.moduleRenderMode!==this.props.activeTabMode&&ue.default.setModuleSettingMode(this.props.moduleRenderMode,!1),te.default.topWindow().document.addEventListener("keydown",this._handleShortcuts),this.setState({tabsCount:this.getTabsCount()}),se.default.addGlobalPresetsStateChangeListener(this._onGlobalPresetsStateChange),se.default.addModulePresetChangeListener(this._onModulePresetChange),ce.default.addComponentDefinitionsChangeListener(this._onComponentDefinitionsChange),window.addEventListener("ai_prompt_use_text_click",this._onPromptUseTextClick)}},{key:"componentDidUpdate",value:function(e,t){var n=this.props;if((0,E.default)(n,"module.props.address","")!==(0,E.default)(e,"module.props.address","")){var r=(0,E.default)(e,"module.props.is_module_child"),o=this.maybeGetFirstOpenedToggle(r);o&&this.setState({openedToggle:o})}this.props.module!==e.module&&(this.setting_resolver=this.getSettingResolver(),this.setState({tabsCount:this.getTabsCount()})),this.props.isGlobalPresetsMode!==e.isGlobalPresetsMode&&(this.setting_resolver=this.getSettingResolver()),n.isVisible&&!e.isVisible&&(this.setState({filterOptions:"",openedToggle:"main_content",filterSelected:void 0,filterNotice:!1}),this.productTourOptionToggle=!1),this.maybeShowFilterNotice()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){(0,B.default)(e.optionsFilter)||this.cache.reset();var t=(0,E.default)(e,"module.props.type");if(e.module&&this.props.module.type!==t&&!(0,I.default)(this.props,e)){this.props.isGlobalPresetsMode!==e.isGlobalPresetsMode&&this.cache.reset();var n=this.getComponentAdvancedFields(e.module,e.isGlobalPresetsMode),r=this.getComponentFields(e.module,e.isGlobalPresetsMode),o=this.getComponentCSSFields(e.module,e.isGlobalPresetsMode),a=(0,Ae.maybeConvertModuleType)(e.module),i=this.getCustomTabsFields(a);this.module_type=a,this.setState(Ze({advancedFields:n,generalFields:r,cssFields:o},i))}}},{key:"UNSAFE_componentWillUpdate",value:function(e){if(!(0,I.default)((0,E.default)(this,"props.isVisible"),(0,E.default)(e,"isVisible"))){var t=se.default.getAppPreference("builder_display_modal_settings"),n=(0,E.default)(e,"module.props.type");if(t&&!(0,N.default)(n)){var r=(0,k.default)(ce.default.getComponentFieldsByFieldTypes(e.module,["custom_margin","custom_padding","range"]));ue.default.setListenerQuotaForGroup("settings-modal",r)}}}},{key:"componentWillUnmount",value:function(){te.default.appWindow().clearTimeout(te.default.appWindow().ETBuilderFormGroupMouseEnterTimeout),te.default.appWindow().clearTimeout(this.mouseLeaveTimeout),ct.flush(),ce.default.removeComponentAdvancedFieldDefinitionChangedListener(this._onComponentAdvancedFieldDefinitionChange),ce.default.removeComponentFieldDefinitionChangedListener(this._onComponentFieldDefinitionChange),ce.default.removeComponentFieldDefinitionsChangedListener(this._onComponentFieldDefinitionsChange),ce.default.removeComponentCSSFieldDefinitionChangedListener(this._onComponentCSSFieldDefinitionChange),ce.default.removeComponentDefinitionsChangeListener(this._onComponentDefinitionsChange),se.default.removeQuickAccessSwitchTabListener(this._onQuickAccessSwitchTab),se.default.removeQuickAccessActiveListener(this._onQuickAccessActive),se.default.removeOptionsFilterChangeListener(this._onFilterChanged),te.default.topWindow().document.removeEventListener("keydown",this._handleShortcuts),clearTimeout(this.focusTimer),clearTimeout(this.filterNoticeTimer),clearTimeout(this.filterTimer),clearTimeout(this.goToOptionTimer),clearTimeout(this.quickAccessScrollUp),clearTimeout(this.quickAccessOpenToggle),clearTimeout(this.isModalRestTimeout),se.default.removeGoToOptionListener(this._onGoToOption),se.default.removeGlobalPresetsStateChangeListener(this._onGlobalPresetsStateChange),se.default.removeModulePresetChangeListener(this._onModulePresetChange),window.removeEventListener("ai_prompt_use_text_click",this._onPromptUseTextClick)}},{key:"_onPromptUseTextClick",value:function(e){var t=(0,E.default)(this,"props.module"),n=e.detail,r=n.text,o=n.fieldName,a=n.intent,i=n.settings;if("background_image"!==o&&!(0,l.default)("_bg_image"))return"module_fields_autofill"===a?(0,Fe.aiAutofillModuleSettings)(i,t):void((0,Fe.isAIContentField)(o,t.props.type)?ue.default.moduleContentChange(t,r,!0,!1):this._onChange(o,r))}},{key:"maybeGetFirstOpenedToggle",value:function(e){var t=this.props.module,n=(0,E.default)(t,"props.type"),r=this._getNonEmptyToggles(n,"general.toggles","general"),o=(0,E.default)(r,"toggles"),a=(0,E.default)(o,this.state.openedToggle);if(e){var i=(0,E.default)(t,"props.module_items_config",{}),l=(0,E.default)(i,"toggle_slug");if(l)return l;if(!a)return"main_content"}if(a)return!1;if(!o)return!1;var u=(0,H.default)(o,(function(e,t){var n=(0,j.default)(e)?e:{title:e,priority:10};return n.name=t,n})),s=(0,m.default)(u,"priority","asc");return(0,E.default)((0,h.default)(s),"name","main_content")}},{key:"_updateSettingResolverGlobalPresetsAttrs",value:function(e,t){this.props.isGlobalPresetsMode&&(0,_.default)(this.setting_resolver,"source_object.props.attrs.".concat(e),t)}},{key:"_handleShortcuts",value:function(e){var t=this,n=e.metaKey,r=e.altKey,o=e.ctrlKey,a=27===e.keyCode,i=e.shiftKey,l=32===e.keyCode,u=te.default.$topWindow((0,X.findDOMNode)(this)).find(".et-fb-options-filter input"),s=u.length>0&&u.is(":focus");if(s&&i&&l)e.preventDefault();else{if(a&&this._isFilterActive())return e.preventDefault(),this.filterTimer=setTimeout((function(){t.setState({filterOptions:"",filterSelected:void 0,filterNotice:!1})}),300),!1;!s||n||r||o||27===e.keyCode||e.stopPropagation(),a&&this.props.isGlobalPresetsMode&&(ue.default.saveModulePresetSettings(this._getModule()),e.stopPropagation())}}},{key:"_onComponentAdvancedFieldDefinitionChange",value:function(e,t,n){if(!this.props.isGlobalPresetsMode){var r=(0,C.default)({},this.state.advancedFields);(0,_.default)(r,[e,t],n),this.cache.reset(),this.setState({advancedFields:r})}}},{key:"_onComponentFieldDefinitionChange",value:function(e,t,n){var r=(0,C.default)({},this.state.generalFields);(0,_.default)(r,[e,t],n),this.cache.reset(),this.setState({generalFields:r})}},{key:"_onComponentCSSFieldDefinitionChange",value:function(e,t,n){var r=(0,C.default)({},this.state.cssFields);(0,_.default)(r,[e,t],n),this.setState({cssFields:r})}},{key:"_onComponentDefinitionsChange",value:function(e){e===(0,E.default)(this._getModule(),"props.type")&&this._updateComponentDefinitions()}},{key:"_onModalRest",value:function(){var e=this;this.isModalRestTimeout=setTimeout((function(){e.setState({isModalRest:!0})}),1)}},{key:"getSettingResolver",value:function(){var e=this,t=new Z.default(this._getModule(),{},"props.attrs.");if(this.props.isGlobalPresetsMode){var n=te.default.flattenFields(Ze(Ze(Ze({},this.getComponentFields(this._getModule())),this.getComponentAdvancedFields(this._getModule())),this.getComponentFields(this._getModule()))),r={};(0,F.default)(n,(function(t){t.show_if&&(0,F.default)((0,S.default)(t.show_if),(function(t){r[t]=(0,E.default)(e.props,"module.props.attrs.".concat(t))})),t.show_if_not&&(0,F.default)((0,S.default)(t.show_if_not),(function(t){r[t]=(0,E.default)(e.props,"module.props.attrs.".concat(t))}))})),t.source_object={props:{attrs:(0,C.default)({},r,this.getModuleAttrs())}}}return t}},{key:"getCustomTabsList",value:function(){var e=this.props.module,t=this.getModuleCustomTabs(e.props.type);return!(0,B.default)(t)&&t}},{key:"getCustomTabsFields",value:function(e){var t=this,n=this.getCustomTabsList();if(!n)return!1;var r={};return(0,F.default)(n,(function(n,o){var a="".concat(o,"Fields");r[a]=t.getComponentCustomTabFields(e,o)})),r}},{key:"_getModule",value:function(){return this.props.module}},{key:"getBulk",value:function(){var e=this._getModule(),t=(0,E.default)(e,"props.address");return(0,B.default)(e)?{}:se.default.isMultiItemSelected(t)?se.default.getMultiSelectItemsData():at({},t,e)}},{key:"getModuleAttrs",value:function(){var e=this._getModule(),t=(0,E.default)(e,"props.type"),n=(0,E.default)(e,"props.address"),r=se.default.isMultiItemSelected(n);return this.props.isGlobalPresetsMode?ce.default.getComponentGlobalPresets(e):r?Ee.default.generateSelectedAttrs(t,(0,E.default)(e,"props.attrs",{}),this.updatedAttrs):(0,E.default)(e,"props.attrs",{})}},{key:"_isVisible",value:function(e,t){var n=this;if(this.props.isGlobalPresetsMode){var r=(0,u.default)(["animation"],(function(t){return!(0,P.default)(e.name,t)})),o=(0,u.default)(["text_shadow"],(function(t){return-1===e.name.indexOf(t)}));if(r&&o)return!0}var a=this.getModuleAttrs(),i=ce.default.getComponentDefaults(this.module_type),l=[];return(0,F.default)(e.depends_on,(function(r){var o=r,u=Me.default.isHoverMode()&&Me.default.isHoverEnabled(r,a),s=Me.default.isResponsiveMode()&&Me.default.isResponsiveEnabled(r,a);(u||s)&&(r=Me.default.getNameByMode(r,a));var c=(0,E.default)(t[r],"type","");if((0,E.default)(t[r],"depends_on",!1)&&!n._isVisible(t[r],t))return!1;var d=(0,E.default)(a,r,(0,E.default)(i,r,""));if((u||s)&&(0,N.default)(d)&&(d=(0,E.default)(i,o,(0,E.default)(t[o],"shortcode_default"))),"upload"!==c&&"text"!==c||""===d||(d="on"),(0,N.default)(e.depends_show_if)||d!==e.depends_show_if||l.push(r),!(0,N.default)(e.depends_show_if_not)){var f=e.depends_show_if_not;if((0,W.default)(e,"depends_on_responsive")&&(0,L.default)(e.depends_on_responsive,r)){var p=(0,E.default)(a,"".concat(r),""),h=(0,E.default)(a,"".concat(r,"_tablet"),""),m=(0,E.default)(a,"".concat(r,"_phone"),"");te.default.getResponsiveStatus((0,E.default)(a,"".concat(r,"_last_edited")))?(0,L.default)(f,p)&&(0,L.default)(f,h)&&(0,L.default)(f,m)||l.push(r):(0,L.default)(f,p)||l.push(r)}else{((0,x.default)(f)?!(0,L.default)(f,d):d!==f)&&l.push(r)}}})),!(0,B.default)(l)}},{key:"_isModuleItemSettings",value:function(){return!(0,N.default)(this.props.module.isModuleItem)}},{key:"_isModalExpanded",value:function(){var e=(0,xe.getModalPreferredSnapSettings)(),t=e.snap,n=e.snapLocation,r=(0,xe.getModalPreferredDimensions)().width,o=(0,L.default)(["top","bottom"],n),a=te.default.topWindow().innerWidth1200||r>1200)&&!a}},{key:"_isToggleOpened",value:function(e,t){var n="general"===t,r="design"===t,o="css"===t,a=this._isModalExpanded();if(t&&a){if(n)return this.state.openedGeneralGroup===e;if(r)return this.state.openedDesignGroup===e;if(o)return this.state.openedCSSGroup===e}return this.state.openedToggle===e}},{key:"_isMultiSelectMode",value:function(){var e=(0,E.default)(this._getModule(),"props.address");return se.default.isMultiItemSelected(e)}},{key:"_hasColumnsFields",value:function(){var e=this.props.module.props.type,t=this.getModuleAttrs(),n=te.default.isOn(t.specialty)&&"et_pb_section"===e;return(0,L.default)(["et_pb_row","et_pb_row_inner"],e)||n}},{key:"_hasModuleItem",value:function(){return!(0,T.default)(this.props.module.props.child_slug)&&!(0,N.default)(this.props.module.props.child_slug)}},{key:"_onChange",value:function(e,t,n,o,a){var i=this;this._onChangeCacheReset(),this._updateSettingResolverGlobalPresetsAttrs(e,t),this.updatedAttrs[e]=t;var l=(0,E.default)(this.props.module,"props.address"),u=se.default.isMultiItemSelected(l);if("raw_content"!==e){var s=e.split("_"),c="padding_mobile"!==e&&"padding"===s[0]&&2===s.length;if(o)!(0,N.default)(this.props.module)&&this.props.module&&(u?ue.default.multiSelectContentChange(this.props.module,t):ue.default.moduleContentChange(this.props.module,t));else{(0,N.default)(this.props.module)||(0,N.default)(this.props.module.props)||"et_pb_social_media_follow_network"!==this.props.module.props.type||"social_network"!==e||(u?ue.default.multiSelectContentChange(this.props.module,t):ue.default.moduleContentChange(this.props.module,t));var d=(0,L.default)(["custom_css_before","custom_css_main_element","custom_css_after"],e)?e.replace("custom_css_",""):e,f=this._getModule(),p=this.getModuleAttrs(),h=(0,E.default)(f,"props.type"),m=(0,E.default)(p,"".concat(e)),y=se.default.getHoverMode(),g=this._getAllOptionsFields()[d],b=(0,N.default)(g)||(0,N.default)(g.depends_on)?e:g.depends_on[0],v=!(0,N.default)(g)&&!!g.hover&&(ne.default.isEnabled(e,p)||ne.default.isEnabled(b,p)),_=!0===y&&!0===v?ne.default.hoverSuffix():"",w=!1;if((0,P.default)(h,"et_pb_signup")){var O=ETBuilderBackend.emailPredefinedCustomFields,k=(0,E.default)(f,"parentModule.props.attrs"),S=this.getComponentFields({props:{type:"et_pb_signup"}}),C=(0,E.default)(S,"provider.default"),T=(0,E.default)(p,"provider",(0,E.default)(k,"provider",C)),j=Ye((0,E.default)(p,"".concat(T,"_list"),(0,E.default)(k,"".concat(T,"_list"),"")).split("|"),2),x=j[0],D=j[1];if("et_pb_signup"===h){var R=(0,W.default)(O,[T,x,D]);("provider"===e&&t!==m||R&&"".concat(T,"_list")===e&&t!==m)&&(w=!0)}else if("et_pb_signup_custom_field"===h&&(0,P.default)(e,"predefined_field_")&&t!==m){u?ue.default.multiSelectSettingsChange(r,"predefined_field",t):this._emitSettingsChange(f,"predefined_field",t);var A=[T,x];(0,W.default)(O,[T,x,"custom_fields"])?A.push("custom_fields"):A.push(D),A.push(t);var I=(0,E.default)(O,A);if(I){if(I.field_id!==p.field_id&&(u?ue.default.multiSelectSettingsChange(r,"field_id",I.field_id.toString()):this._emitSettingsChange(f,"field_id",I.field_id.toString())),I.name!==p.field_title&&(u?ue.default.multiSelectSettingsChange(r,"field_title",I.name):this._emitSettingsChange(f,"field_title",I.name)),!(0,N.default)(I.hidden)||"on"===(0,E.default)(p,"hidden")){var B=I.hidden?"on":"off";B!==p.hidden&&(u?ue.default.multiSelectSettingsChange(r,"hidden",B):this._emitSettingsChange(f,"hidden",B))}if("any"!==I.type&&I.type!==p.field_type&&(u?ue.default.multiSelectSettingsChange(r,"field_type",I.type):this._emitSettingsChange(f,"field_type",I.type),I.options)){var V=(0,H.default)(I.options,(function(e,t){return{checked:0,value:e,id:t}}));u?ue.default.multiSelectSettingsChange(r,"".concat(I.type,"_options"),JSON.stringify(V)):this._emitSettingsChange(f,"".concat(I.type,"_options"),JSON.stringify(V))}}}}if(c){var U=s[1],G=["padding_top_".concat(U).concat(_),"padding_right_".concat(U).concat(_),"padding_bottom_".concat(U).concat(_),"padding_left_".concat(U).concat(_),"padding_top_bottom_link_".concat(U).concat(_),"padding_left_right_link_".concat(U).concat(_)],z=(0,M.default)(t)?t.split("|"):["","","","","",""];(0,F.default)(G,(function(e,t){var r=(0,N.default)(z[t])?"":z[t];r!==p[e]&&(u?ue.default.multiSelectSettingsChange(i.props.module,e,r,null,n):i._emitSettingsChange(f,e,r,null,n))}))}else 0===e.indexOf("custom_css")&&(st.addClass("et_fb_preview_container__disable_animations"),ct()),u?ue.default.multiSelectSettingsChange(this.props.module,"".concat(e).concat(_),t,null,n,a):this._emitSettingsChange(f,"".concat(e).concat(_),t,null,n,a),w&&ue.default.deleteModuleChildren((0,E.default)(f,"props.address"))}}else u?ue.default.multiSelectContentChange(this.props.module,t):ue.default.moduleContentChange(this.props.module,t)}},{key:"_isFilterActive",value:function(){return te.default.hasValue(this.state.filterOptions)||te.default.hasValue(this.state.filterSelected)}},{key:"_onChangeDynamic",value:function(e,t,n,r,o){"et_pb_counter"===this.props.module.props.type&&"content"===Me.default.getBaseName(e)&&this._onChange(e,"",n,!0),this._onChange(e,t,n,r,o)}},{key:"_resetOption",value:function(e){if(!(0,N.default)(e)&&""!==e){var t=this._getModule();this._emitSettingsChange(t,e,"")}}},{key:"_onClickHover",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this._getModule();if(r){var o=n&&(0,x.default)(n)?[e].concat($e(n)):[e],a=Me.default.getHoverEnabledToggleValue(e,this.getModuleAttrs(),this.props.activeTabMode),i=se.default.isMultiItemSelected((0,E.default)(r,"props.address"));(0,F.default)(o,(function(e){var n=Me.default.getHoverEnabledName(e);i?ue.default.multiSelectSettingsChange(r,n,a):t._emitSettingsChange(r,n,a)})),0===a.indexOf("on")||Me.default.isAnyHoverEnabled(this.getModuleAttrs())||(i?ue.default.multiSelectSettingsChange(r,"hover_enabled",0):ue.default.moduleSettingsChange(r,"hover_enabled",0),Me.default.isHoverMode()&&ue.default.setModuleSettingMode("desktop",!0))}}},{key:"_onClickSticky",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this._getModule();if(r){var o=n&&(0,x.default)(n)?[e].concat($e(n)):[e],a=Me.default.getStickyEnabledToggleValue(e,this.getModuleAttrs(),this.props.activeTabMode),i=se.default.isMultiItemSelected((0,E.default)(r,"props.address"));(0,F.default)(o,(function(e){var n=Me.default.getStickyEnabledName(e);i?ue.default.multiSelectSettingsChange(r,n,a):t._emitSettingsChange(r,n,a)})),0===a.indexOf("on")||Me.default.isAnyStickyEnabled(this.getModuleAttrs())||(i?ue.default.multiSelectSettingsChange(r,"sticky_enabled",0):ue.default.moduleSettingsChange(r,"sticky_enabled",0),Me.default.isStickyMode()&&ue.default.setModuleSettingMode("desktop",!0))}}},{key:"_onClickResponsive",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this._getModule();if(r){var o=n&&(0,x.default)(n)?[e].concat($e(n)):[e],a=Me.default.getResponsiveEnabledToggleValue(e,this.getModuleAttrs(),this.props.activeTabMode),i=se.default.isMultiItemSelected((0,E.default)(r,"props.address"));(0,F.default)(o,(function(e){var n=Me.default.getResponsiveEnabledName(e);i?ue.default.multiSelectSettingsChange(r,n,a):t._emitSettingsChange(r,n,a)})),0!==a.indexOf("on")&&Me.default.isResponsiveMode()&&!Me.default.isAnyResponsiveEnabled(this.getModuleAttrs())&&ue.default.setModuleSettingMode("desktop",!0)}}},{key:"_onClickReset",value:function(e){var t=this,n=(0,E.default)(e,"props.name",!1);if(n){var r=this._getAllOptionsFields()[e.props.name],o=r&&r.type;if("select_box_shadow"!==o&&"presets_shadow"!==o){var a=this._getModule();if(a){var i=this.getModuleAttrs(),l=(0,E.default)(a,"props.address"),u=se.default.isMultiItemSelected(l),s=(0,E.default)(e,"props.backgroundFields",!1),c=u?[]:K.default.getModuleAttrsUsingGlobalColors(a.props),d=function(e){c.includes(e)&&(0,q.removeFieldFromGlobalColors)(e,a.props,(function(e){var n=e.module,r=e.setting,o=e.newValue;t._emitSettingsChange(n,r,o)}))};if("display_conditions"!==n)if(s)(0,F.default)((0,S.default)(s),(function(e){var n=Me.default.getNameByMode(e,i);u?ue.default.multiSelectSettingsChange(a,n,void 0,!1,void 0,!0):(t._emitSettingsChange(a,n,void 0,!1,void 0,!0),d(n))}));else if(ft(n)){var f=ht(pt(n));u?f.map((function(e){return ue.default.multiSelectSettingsChange(a,ne.default.getCompositeFieldOnHover(e,n,i),void 0,!1,void 0,!0)})):f.map((function(e){return ue.default.moduleSettingsChange(a,ne.default.getCompositeFieldOnHover(e,n,i),void 0,!1,void 0,!0)}))}else{var p=Me.default.getNameByMode(n,i);if("content"===p){var h=te.default.get((0,E.default)(e,"props.default_on_front"),te.default.get((0,E.default)(e,"props.defaultValue"),(0,E.default)((0,E.default)(this._getAllOptionsFields(),n,{}),"default","")));u?ue.default.multiSelectContentChange(a,h):ue.default.moduleContentChange(a,h)}else u?ue.default.multiSelectSettingsChange(a,p,void 0,!1,void 0,!0):(this._emitSettingsChange(a,p,void 0,!1,void 0,!0),d(p))}else{ue.default.triggerDisplayConditionsReset();var m=Me.default.getNameByMode(n,i);this._emitSettingsChange(a,m,void 0,!1,void 0,!0)}}}else{var y=Ie.default.getResetAction();ue.default.rightClickMenuAction(y,"",{simulateRightClick:!0})}}}},{key:"_isResetActive",value:function(e){var t=this,n=(0,E.default)(e,"name",!1),r=this._getModule(),o=this.getModuleAttrs(),a=this.props.activeTabMode;if(!n||!(0,j.default)(r))return!1;var i=function(e){var t="desktop"!==a?te.default.get((0,E.default)(e,"default"),(0,E.default)(e,"default_".concat(a))):(0,E.default)(e,"default");return(0,x.default)(t)?(0,E.default)((0,E.default)(t,1,{}),(0,E.default)(o,(0,E.default)(t,0))):t},u=function(e){return"content"===e?(0,E.default)(r,"props.content"):(0,E.default)(o,e)},s=(0,E.default)(e,"backgroundFields",!1)||(0,E.default)(e,"background_fields",!1);if(s){var c=(0,S.default)(s).filter((function(e){return!!(0,l.default)("_use_color_gradient",e)||(-1!==e.indexOf("_enable_")||"use_background_color_gradient"===e)}));return(0,p.default)(s,(function(e,t){var n=Me.default.getBaseName(t,o);if((0,L.default)(c,n))return!1;var r=Me.default.getNameByMode(n,o),l=u(r);if((0,N.default)(l))return!1;var s=i(e);return!("desktop"===a&&""===l&&!te.default.hasValue(s))&&s!==l}))}if(ft(n)){var d=pt(n);return ht(d).map((function(e){return(0,E.default)(t.state.advancedFields,"".concat(e,".default"),"")})).join("|")!==ht(d).map((function(e){return(0,E.default)(o,"".concat(ne.default.getCompositeFieldOnHover(e,n,o)))})).join("|")}var f=u(Me.default.getNameByMode(n,o));if((0,N.default)(f))return!1;var h=i(e);return!("desktop"===a&&""===f&&!te.default.hasValue(h))&&h!==f}},{key:"_onClickToggle",value:function(e,t,n,r){if(!se.default.getAppPreference("builder_display_modal_settings")){var o=this._isModalExpanded(),a=o?le.default.topbar.mobile:10,i="general"===n,l="design"===n,u="css"===n;if(this._isToggleOpened(e,n)&&(0,N.default)(r)){if(i)return this.setState({openedGeneralGroup:"",openedToggle:""});if(l)return this._setHoveredToggleElement(e,!1,!0),this.setState({openedDesignGroup:"",openedToggle:""});if(u)return this.setState({openedCSSGroup:"",openedToggle:""})}if(!this._isToggleOpened(e)||(this.setState({openedToggle:""}),!(0,N.default)(r))){var s="design"===n?"advanced":n,c=".et-fb-tabs__panel--".concat(s," .et-fb-form__toggle[data-name='").concat(e,"']"),d=te.default.$topWindow(c).prevAll(".et-fb-form__toggle").length+1,f=1===d?0:61*d-a,p=".et-fb-tabs__panel--".concat(s," .et-fb-settings-module-items-wrap");"general"===s&&te.default.$topWindow(p).length&&(1===d&&(f+=te.default.$topWindow(".et-fb-options-filter-input-wrap").height()),f+=te.default.$topWindow(p).outerHeight()+30),o?te.default.$topWindow((0,X.findDOMNode)(this)).find(".et-fb-tabs__panel--".concat(s)).animate({scrollTop:f},300):te.default.$topWindow((0,X.findDOMNode)(this)).find(".et-fb-tabs__panel--active").animate({scrollTop:f},300),this.setState({openedToggle:e,openedGeneralGroup:"general"===n?e:this.state.openedGeneralGroup,openedDesignGroup:"design"===n?e:this.state.openedDesignGroup,openedCSSGroup:"css"===n?e:this.state.openedCSSGroup}),l&&this._setHoveredToggleElement(e,!0,!0)}}}},{key:"_onQuickAccessSwitchTab",value:function(){var e=se.default.getActiveQuickAccess().clickedToggle.toggleGroupId,t="design"===e?"advanced":e,n=(0,i.default)(this._getTabs(),(function(e){return e.slug===t}));-1!==n&&this.setState({tabSelectedIndex:n})}},{key:"_onQuickAccessActive",value:function(){var e=this,t=se.default.getActiveQuickAccess().clickedToggle,n=t.toggleId,r=t.toggleGroupId,o=t.toggleSubIdName,a=this._isModalExpanded(),i=se.default.getAppPreference("builder_display_modal_settings"),l=a||i?le.default.topbar.mobile:10,u="design"===r?"advanced":r,s=".et-fb-tabs__panel--".concat(u," .et-fb-form__toggle[data-name='").concat(n,"']");if(i)return clearTimeout(this.quickAccessScrollUp),void(this.quickAccessScrollUp=setTimeout((function(){var t=te.default.$topWindow((0,X.findDOMNode)(e)).find(".et-fb-tabs__panel--".concat(u)),n=te.default.$topWindow(s);if(0!==n.length){var r=n[0].offsetTop;t.animate({scrollTop:r},300)}}),0));var c=te.default.$topWindow(s).prevAll(".et-fb-form__toggle").length+1,d=1===c?0:61*c-l;a?(te.default.$topWindow((0,X.findDOMNode)(this)).find(".et-fb-tabs__panel--".concat(u)).animate({scrollTop:d},300),this.setState({openedToggle:n,openedGeneralGroup:"general"===r?n:this.state.openedGeneralGroup,openedDesignGroup:"design"===r?n:this.state.openedDesignGroup,openedCSSGroup:"css"===r?n:this.state.openedCSSGroup,toggleTabs:(0,_.default)(Ze({},this.state.toggleTabs),[r,n],o),filterOptions:"",filterSelected:void 0,filterNotice:!1})):(clearTimeout(this.quickAccessScrollUp),this.quickAccessScrollUp=setTimeout((function(){te.default.$topWindow((0,X.findDOMNode)(e)).find(".et-fb-tabs__panel--active").animate({scrollTop:d},300)}),0),clearTimeout(this.quickAccessOpenToggle),this.quickAccessOpenToggle=setTimeout((function(){e.setState({openedToggle:n,openedGeneralGroup:"general"===r?n:e.state.openedGeneralGroup,openedDesignGroup:"design"===r?n:e.state.openedDesignGroup,openedCSSGroup:"css"===r?n:e.state.openedCSSGroup,toggleTabs:(0,_.default)(Ze({},e.state.toggleTabs),[r,n],o),filterOptions:"",filterSelected:void 0,filterNotice:!1})}),300))}},{key:"_setHoveredToggleElement",value:function(e,t,n){var r=this.props.module,o=(0,E.default)(r,"props.type"),a=(0,E.default)(r,"props.address");if(!(0,N.default)(Ce.quickAccessModuleToggleId[o])){var i=Ce.quickAccessModuleToggleId[o];if(!(0,N.default)(i[e])){var l={moduleAddress:a,toggleId:e,elementAddress:a,elementOrder:10,elementKey:null,elementOuter:null,toggleSubId:0,isChild:!(0,N.default)(r.isModuleItem),src:"settings",isOpened:t,hovered:n,isSubOpened:!1,subHovered:!1};ue.default.quickAccessHighlight(l)}}}},{key:"_setHoveredSubToggleElement",value:function(e,t,n,r){var o=this.props.module,a=(0,E.default)(o,"props.address");if(!(0,N.default)(Ce.quickAccessIdTextModule[e])){var i=Ce.quickAccessIdTextModule[e],l=(0,d.default)(i);if(!(0,N.default)(l[t])){var u={moduleAddress:a,toggleId:e,elementAddress:a,elementOrder:10,elementKey:null,elementOuter:null,toggleSubId:t,isChild:!(0,N.default)(o.isModuleItem),src:"settings",isOpened:!0,hovered:!1,isSubOpened:n,subHovered:r};ue.default.quickAccessHighlight(u)}}}},{key:"_unsyncGlobalContent",value:function(){this._unsyncGlobalSetting("et_pb_content_field",!0)}},{key:"_unsyncGlobalSetting",value:function(e,t){ue.default.unsyncGlobalSetting(e,this.props.module,t)}},{key:"_handleFormSubmission",value:function(t){if(t.preventDefault(),((0,N.default)((0,E.default)(this,"props.module.props.loading"))||!this.props.module.props.loading)&&!e((0,X.findDOMNode)(this)).find(":focus").hasClass("wp-color-picker")){var n=this,r=this.props.module;(0,F.default)(this.state.generalFields,(function(e){"text"===e.type&&((0,N.default)(e.name)||-1===e.name.indexOf("url")&&-1===e.name.indexOf("alt")&&-1===e.name.indexOf("link")&&n._onChange(e.name,te.default.decodeHtmlEntities(r.props.attrs[e.name])))})),ue.default.closeSettings(this._isModuleItemSettings())}}},{key:"_handleFieldConditionalDefaults",value:function(e,t,n){if((0,x.default)(e.default)&&"filter"===(0,E.default)(e,"default.0")){var r=(0,E.default)(e,"default.1").split("_").join(".");return Ze(Ze({},e),{},{default:(0,re.applyFilters)(r,e)})}return(0,x.default)(e.default)&&!(0,B.default)(e.default)?Ze(Ze({},e),{},{conditionalDefaults:e.default,default:n&&!(0,B.default)((0,E.default)(t,e.name))?(0,E.default)(t,e.name):te.default.getConditionalDefault(e.default,t,!1,n)}):Ze({},e)}},{key:"isGlobalModuleOpened",value:function(e){if(this.props.isGlobalPresetsMode)return!1;var t=this._getModule(),n=(0,L.default)(["et_pb_section","et_pb_row","et_pb_row_inner"],(0,E.default)(t,"props.type",""))?(0,E.default)(t,"props.type",""):"et_pb_module";if(se.default.isLibraryPostType()&&"global"===ETBuilderBackend.layoutScope){if(e){var r="et_pb_".concat(ETBuilderBackend.layoutType);return!(0,E.default)(t,"isModuleItem")&&r===n}return!0}var o=this.getModuleAttrs(),a=(0,E.default)(o,"global_parent",""),i=(0,E.default)(o,"global_module",""),l=(0,E.default)(t,"props.address").split(".");if(!e&&l.length>1){var u=!1,s=te.default.getModuleAddressSequence(l);return(0,F.default)(s,(function(e){var t=(0,z.default)(se.default.getSectionsFlattened(),{address:e});if(""!==(0,E.default)(t,"attrs.global_module",""))return u=!0,!1})),u}return!e&&""!==a&&"et_pb_section"!==n||(""!==i||!(0,N.default)(t.props.libraryModuleScope)&&"global"===t.props.libraryModuleScope)}},{key:"getGlobalTabClass",value:function(){if(this.isGlobalModuleOpened())return"et-fb-tabs__item__global"}},{key:"getGlobalModalClass",value:function(e){var t=(0,N.default)(e)?"":e;if(this.isGlobalModuleOpened())return"".concat(t,"__global")}},{key:"isGlobalOptionSynced",value:function(e){if(!this.isGlobalModuleOpened())return!0;var t=(0,E.default)(this.props.module,"props.unsyncedGlobalSettings",[]);return!(0,L.default)(t,e)}},{key:"isSelectiveSyncAvailable",value:function(e){return!(0,E.default)(e,"hide_sync",!1)&&(this.isGlobalModuleOpened(!0)&&!(0,L.default)(["et_pb_section","et_pb_row","et_pb_row_inner"],this.props.module.props.type))}},{key:"_onFilterInput",value:function(e){ue.default.setOptionsFilter({filterOptions:e,filterSelected:this.state.filterSelected}),this.setState({filterOptions:e,filterNotice:!1})}},{key:"_onFilterSelect",value:function(e){ue.default.setOptionsFilter({filterOptions:this.state.filterOptions,filterSelected:e}),this.setState({filterSelected:e,filterNotice:!1})}},{key:"_onFilterChanged",value:function(e){this.setState({filterSelected:e,filterNotice:!1})}},{key:"_onGoToOption",value:function(t){var n=this;if(!(0,B.default)(t)){(0,P.default)(t.elementId,"transform_")&&(t.elementId="transform_styles");var r=this.props.module,o=[{slug:"general",toggleGroupId:"general"},{slug:"advanced",toggleGroupId:"design"},{slug:"css",toggleGroupId:"css"}],a=this.getCustomTabsList();a&&(0,F.default)(a,(function(e,t){o.push({slug:t,toggleGroupId:t})}));var i={};(0,F.default)(o,(function(e,o){var a=n._getNonEmptyToggles(r.props.type,"".concat(e.slug,".toggles"),e.slug).toggles;if("option"===(0,E.default)(t,"type")){var l=n._getOptionsFields(e.slug);if((0,F.default)(l,(function(n,r){var a=(0,N.default)(n.name)?r:n.name;((0,x.default)(t.elementId)&&(0,L.default)(t.elementId,a)||(0,M.default)(t.elementId)&&t.elementId===a)&&(i={tabSlug:e.slug,toggleGroupId:e.toggleGroupId,keyCompare:a,fieldData:n,tabSelectedIndex:o})})),!(0,B.default)(i)){var u=0;(0,F.default)(a,(function(e,t){u++,t===i.fieldData.toggle_slug&&(i.toggleId=t,i.toggleOrder=u)}))}}else if(e.toggleGroupId===(0,E.default)(t,"payload.toggleGroupId")){i={tabSlug:e.slug,toggleGroupId:e.toggleGroupId,tabSelectedIndex:o};var s=0;(0,F.default)(a,(function(e,n){s++,n===(0,E.default)(t,"payload.toggleId")&&(i.toggleId=n,i.toggleOrder=s)}))}})),(0,B.default)(i)||(0,N.default)(i.toggleId)||(0,N.default)(i.toggleOrder)?this.setState({filterOptions:"",filterSelected:void 0,filterNotice:!1}):(this.setState({tabSelectedIndex:i.tabSelectedIndex,filterOptions:"",filterSelected:void 0,filterNotice:!1}),clearTimeout(this.goToOptionTimer),this.goToOptionTimer=setTimeout((function(){e((0,X.findDOMNode)(n)).find(".et-fb-tabs__item").each((function(t,n){t===i.tabSelectedIndex&&e(n).trigger("click")})),n._onClickToggle(i.toggleId,i.toggleOrder,i.toggleGroupId,!0)}),100))}}},{key:"_getNonEmptyToggles",value:function(e,t,n){var r="css.toggles"===t?"custom_css.toggles":t,o="".concat(r,"_").concat(n,"_toggles"),a=(0,E.default)(this.props,"module.props.address"),i=se.default.isMultiItemSelected(a),l=se.default.getMultiSelectElementsType();if(this.cache.has(e,o)&&!i)return this.cache.get(e,o);var u={};if(i){if(this.cache.hasElements(l,o))return this.cache.getElements(l,o);u=Ee.default.generateSelectedToggles(r)}var s=(0,B.default)(u)?(0,C.default)({unclassified:{title:"",priority:10}},(0,E.default)(ce.default.getOptionsToggles(e),r,{})):u,c=this._getOptionsFields(n),d=(this.getBackgroundFieldsNames(),{}),f={};(0,F.default)(c,(function(e){var t=e.toggle_slug,n=e.name,r=e.depends_on,o=e.show_if,a=e.show_if_not,i=e.type;(0,L.default)(["skip","computed"],i)||(0,N.default)(n)||(t=(0,N.default)(t)?"unclassified":t,(0,_.default)(d,t,!0),r||o||a||(0,_.default)(f,t,!0))}));var p={toggles:(0,v.default)(s,(function(e,t){return(0,W.default)(d,t)})),safe:f};return i?this.cache.setElements(l,o,p):this.cache.set(e,o,p),p}},{key:"_isFieldValueModified",value:function(e,t,n,r){var o=this,a=!1,i=(0,N.default)(e.name)?void 0:t[e.name],u=e.default;if((0,N.default)(i)&&"content"===e.name&&!(0,N.default)(this.props.module.props.content)&&(i=(0,E.default)(this,"props.module.props.content")),!(0,N.default)(e.default_from)){var s=e.default_from.split(".").pop();!s||(0,N.default)(r[s])||(0,N.default)(r[s].default)||(u=r[s].default)}if(!(0,N.default)(e.name)&&((0,l.default)(e.name,"_tablet")||(0,l.default)(e.name,"_phone"))){var c=oe.default.getFieldBaseName(e.name),d=e.name.replace(c,"");if((0,W.default)(r,c)){var p=r[c];(0,W.default)(p,"default".concat(d))&&(u=p["default".concat(d)])}}switch(!(0,B.default)(i)&&(0,M.default)(i)&&(i=i.toLowerCase()),!(0,B.default)(u)&&(0,M.default)(u)&&(u=u.toLowerCase()),e.type){case"font":a=!(0,B.default)(i)&&"||||||||"!==i&&i!==u;break;case"custom_padding":case"custom_margin":a=!(0,B.default)(i)&&i!==u;break;case"border-radius":a=!(0,B.default)(i)&&"||||"!==i&&"on||||"!==i&&i!==u;break;case"multiple_checkboxes":a=!((0,B.default)(i)||(0,M.default)(i)&&-1===i.indexOf("on"))&&i!==u;break;case"tiny_mce":a=!((0,B.default)(i)||(0,M.default)(i)&&!i.replace(/(?:
|\n)/g,"").length)&&i!==u;break;case"range":var h=e.default_unit;if(!(0,N.default)(e.default_from)){var m=e.default_from.split(".").pop();(0,N.default)(r[m])||(0,N.default)(r[m].default_unit)||(h=r[m].default_unit)}(0,x.default)(u)&&(u=u[1][t[u[0]]]),h&&(i&&-1===i.indexOf(h)&&(i="".concat(i).concat(h)),u&&-1===u.indexOf(h)&&(u="".concat(u).concat(h))),a=!(0,B.default)(i)&&i!==u;break;case"color-alpha":a=!(0,B.default)(i)&&u!==i;break;case"yes_no_button":a=!(0,B.default)(i)&&"off"!==i&&u!==i;break;case"select":a=!(!te.default.hasValue(i)||(0,j.default)(e.options)&&!(0,B.default)(e.options)&&Object.keys(e.options)[0]===i)&&u!==i;break;case"composite":(0,N.default)(e.composite_structure)||(0,F.default)(e.composite_structure,(function(e){(0,N.default)(e.controls)||(0,F.default)(e.controls,(function(i,l){var u=Ze(Ze({},i),{},{name:l}),s=Ze(Ze({},r),e.controls);!o._isFieldDependencyExcluded(u,s)&&o._isFieldValueModified(u,t,n,s)&&(a=!0)}))}));break;case"background":if(!(a=(!(0,M.default)(i)||!(0,B.default)(i))&&u!==i)&&!(0,B.default)(e.backgroundFields)){var y=e.name.split("_").slice(-1).pop();y&&(0,F.default)(["background_color_%s","use_background_color_gradient_%s","bg_img_%s","background_video_mp4_%s","background_video_webm_%s"],(function(e){var n=e.replace("%s",y);(0,B.default)(t[n])||"off"===t[n]||(a=!0)}))}break;default:a=!(!(0,A.default)(i)&&!(0,f.default)(i)&&(0,B.default)(i))&&u!==i}if(!a&&this._isOptionMatchesStylesResponsive(e,t)){var g=Ze(Ze({},e),{},{name:"".concat(e.name,"_tablet"),default:(0,W.default)(e,"default_tablet")?e.default_tablet:u,mobile_options:void 0});if(this._isFieldValueModified(g,t,n,r)&&(a=!0),!a){var b=Ze(Ze({},e),{},{name:"".concat(e.name,"_phone"),default:(0,W.default)(e,"default_phone")?e.default_tablet:g.default,mobile_options:void 0});this._isFieldValueModified(b,t,n,r)&&(a=!0)}}return a}},{key:"_isOptionMatchesStylesModified",value:function(e,t,n,r){var o=this;if("general"===n&&!(0,N.default)(e.toggle_slug)&&"background"!==e.toggle_slug)return!1;if(!(0,L.default)(["general","advanced","css"],n)&&(0,L.default)(["text","textarea","tiny_mce","date_picker"],e.type))return!1;var a=this._isFieldValueModified(e,t,n,r);return a||"background_color"!==e.name||(0,F.default)(dt,(function(e){(0,N.default)(r[e])||o._isFieldValueModified(r[e],t,n,r)&&(a=!0)})),a}},{key:"_isOptionMatchesStylesResponsive",value:function(e,t){if((0,N.default)(e.mobile_options))return!1;var n=t["".concat(e.name,"_last_edited")],r=(0,N.default)(n)?["off","desktop"]:n.split("|");return!(0,N.default)(r[0])&&"on"===r[0]}},{key:"_isOptionMatchesStylesHover",value:function(e,t){var n="background_color"===e.name?"background":e.name;return ne.default.isEnabled(n,t)}},{key:"_isOptionMatchesStylesSticky",value:function(e,t){var n="background_color"===e.name?"background":e.name;return ae.default.isEnabled(n,t)}},{key:"_isOptionMatchesActiveContent",value:function(e,t,n,r){return!("general"===n&&!(0,N.default)(e.toggle_slug)&&"background"===e.toggle_slug)&&(!(0,L.default)(["advanced","css"],n)&&(!(!(0,L.default)(["general","advanced","css"],n)&&!(0,L.default)(["text","textarea","tiny_mce","date_picker"],e.type))&&this._isFieldValueModified(e,t,n,r)))}},{key:"_isFieldDependencyExcluded",value:function(e,t){return!(0,N.default)(e.depends_on)&&!this._isVisible(e,t)||!((0,N.default)(e.show_if)&&(0,N.default)(e.show_if_not)||(0,ee.canShowField)(e,this.setting_resolver))}},{key:"_getFilteredFields",value:function(e){var t=this,n=this._getOptionsFields(e),r=this.state.filterOptions,o=this.state.filterSelected;if(!this._isFilterActive())return n;var a=this.props.module.props.type,i="".concat(e,"_filter");if(this.cache.has(a,i)){var l=this.cache.get(a,i);if(l.search===r&&l.filterSelected===o)return l.filtered}var u=this.getModuleAttrs(),s=(0,E.default)(this,"props.module.props.content"),c={};(0,F.default)(n,(function(e){var t=e.type,n=e.name,r=e.is_fb_content;if("codemirror"===t||n&&0===n.indexOf("custom_css_")){var o=r?s:u[n];o&&(c[n]=o)}}));var d=(0,v.default)(n,(function(e){var n=e.type,r=e.label,o=e.description,a=e.name;return"composite"===n||t._isOptionMatchesFilter(r,o,c[a])}));return te.default.hasValue(o)?(d=this._isOptionMatchesFilterSelected(d,e),this.cache.set(a,i,{search:r,filterSelected:o,filtered:d}),d):(this.cache.set(a,i,{search:r,filterSelected:o,filtered:d}),d)}},{key:"_getFilteredToggleFields",value:function(e,t,n){var r=this.state.filterOptions,o=this.state.filterSelected;if(!this._isFilterActive())return t;var a=this.props.module.props.type,i="".concat(n,"_").concat(e,"_filter_toggle");if(this.cache.has(a,i)){var l=this.cache.get(a,i);if(l.search===r&&l.filterSelected===o)return l.filtered}return this._isOptionMatchesFilter(e)&&(t=this._getOptionsFields(n)),te.default.hasValue(o)?(t=this._isOptionMatchesFilterSelected(t,n),this.cache.set(a,i,{search:r,filterSelected:o,filtered:t}),t):(this.cache.set(a,i,{search:r,filterSelected:o,filtered:t}),t)}},{key:"_isOptionMatchesFilterSelected",value:function(e,t){var n=this,r=this._getOptionsFields(t),o=this.getModuleAttrs();return(0,v.default)(e,(function(e){if(n._isFieldDependencyExcluded(e,r))return!1;switch(n.state.filterSelected){case"styles_modified":return n._isOptionMatchesStylesModified(e,o,t,r);case"styles_responsive":return n._isOptionMatchesStylesResponsive(e,o);case"styles_hover":return n._isOptionMatchesStylesHover(e,o);case"styles_sticky":return n._isOptionMatchesStylesSticky(e,o);case"active_content":return n._isOptionMatchesActiveContent(e,o,t,r);default:return!1}}))}},{key:"_isOptionMatchesFilter",value:function(){for(var e=this.state.filterOptions.toLowerCase(),t=!1,n=arguments.length,r=new Array(n),o=0;o1&&(c.name="background",c.label=ETBuilderBackend.i18n.modules.background.label,c.type="background",v="background",c._onChange=h._onChange,c._unsyncGlobalSetting=h._unsyncGlobalSetting,c.description=ETBuilderBackend.i18n.modules.background.description,(0,N.default)(c.is_toggleable)&&delete c.depends_on,delete c.additional_code,delete c.depends_show_if);else if(Y&&(0,L.default)(dt,ne.default.getFieldBaseName((0,E.default)(c,"name",""))))return!1;("background-field"===c.type&&(c.onMouseEnterGroup=h._onMouseEnterGroup,c.onMouseLeaveGroup=h._onMouseLeaveGroup,c.isDescriptionVisible=h._isDescriptionVisible,c.isHoveredGroup=h._isHoveredGroup,c.onClickHelp=h._onClickHelp,c.background_fields=(0,U.default)(c.background_fields,(function(e,t){var n=Ke({},e);return n._unsyncGlobalSetting=h._unsyncGlobalSetting,n.isGlobalOptionSynced=h.isGlobalOptionSynced(t),n.isSelectiveSyncAvailable=h.isSelectiveSyncAvailable(),n.isGlobalOptionSynced=h.isGlobalOptionSynced(t),n})),c.isResetActive=h._isResetActive,c.onClickReset=h._onClickReset),f&>(c))&&(c=bt(c,n,"general"===r?"":r,!t.props.isGlobalPresetsMode));var me=t._getModule(),ye=!1!==(0,E.default)(c,"depends_on[0]",!1)&&(0,E.default)(c,"depends_on[0]",!1),ve=c.name||"",we=c.name||"",Se="tabs"===(0,E.default)(c,"hover",!1),Ce=!1!==(0,E.default)(c,"hover",!1)||void 0,De=ne.default.isHoverMode(),Ne=De&&Se&&ne.default.isEnabled(c.name,T);De&&ne.default.doesSupport(c)&&(ne.default.isEnabled(c.name,T)||ne.default.isEnabled(ye,T))&&(ve=ne.default.getHoverField(c.name||""),we=ne.default.getFieldBaseName(ve));var Le=ae.default.isStickyMode(),Re=ae.default.doesSupport(c)&&ae.default.hasStickyOptions((0,E.default)(me,"props",{})),Ue=Le&&Re&&(ae.default.isEnabled(c.name,T)||ae.default.isEnabled(ye,T));Ue&&(ve=ae.default.getStickyField(c.name||""),we=ae.default.getFieldBaseName(ve));var Ge=c.mobile_options;if(Fe&&Ve&&(Ce=!1,Re=!1,Ge=!1),"custom_padding"===v&&t._hasColumnsFields()&&"custom_padding"!==we){var He="";De?He=ne.default.hoverSuffix():Le&&(He=ae.default.stickySuffix());var ze=c.name.replace("padding_",""),qe=te.default.hasValue(T["padding_".concat(ze,"_last_edited")])?T["padding_".concat(ze,"_last_edited")].split("|"):[],$e=((0,E.default)(T,"padding_top_".concat(ze).concat(He),"")||"").trim(),Ye=((0,E.default)(T,"padding_right_".concat(ze).concat(He),"")||"").trim(),Xe=((0,E.default)(T,"padding_bottom_".concat(ze).concat(He),"")||"").trim(),Je=((0,E.default)(T,"padding_left_".concat(ze).concat(He),"")||"").trim(),Qe=((0,E.default)(T,"padding_top_bottom_link_".concat(ze).concat(He),"")||"").trim(),et=((0,E.default)(T,"padding_left_right_link_".concat(ze).concat(He),"")||"").trim(),tt="".concat($e,"|").concat(Ye,"|").concat(Xe,"|").concat(Je,"|").concat(Qe,"|").concat(et),nt=t.state.advancedFields,rt=(0,E.default)(nt,"padding_top_".concat(ze).concat(He,".default"),"").trim(),ot=(0,E.default)(nt,"padding_right_".concat(ze).concat(He,".default"),"").trim(),at=(0,E.default)(nt,"padding_bottom_".concat(ze).concat(He,".default"),"").trim(),it=(0,E.default)(nt,"padding_left_".concat(ze).concat(He,".default"),"").trim(),lt=(0,E.default)(nt,"padding_top_bottom_link_".concat(ze).concat(He,".default"),"").trim(),ut=(0,E.default)(nt,"padding_left_right_link_".concat(ze).concat(He,".default"),"").trim(),st="".concat(rt,"|").concat(ot,"|").concat(at,"|").concat(it,"|").concat(lt,"|").concat(ut);if(c.default=st,j={desktop:tt,tablet:(0,E.default)(T,"padding_".concat(ze,"_tablet"),""),phone:(0,E.default)(T,"padding_".concat(ze,"_phone"),""),isResponsive:!(0,N.default)(qe[0])&&"on"===qe[0],activeTab:(0,N.default)(qe[1])?"desktop":qe[1]},De||Le){var ct=(0,E.default)(T,"padding_top_".concat(ze),"").trim(),ft=(0,E.default)(T,"padding_right_".concat(ze),"").trim(),pt=(0,E.default)(T,"padding_bottom_".concat(ze),"").trim(),ht=(0,E.default)(T,"padding_left_".concat(ze),"").trim();V="".concat(ct,"|").concat(ft,"|").concat(pt,"|").concat(ht)}de=tt}else if((0,L.default)(["custom_margin","custom_padding"],v)&&c.mobile_options){c=t._handleFieldConditionalDefaults(c,T,c.name!==ve);var mt=T["".concat(c.name,"_last_edited")],yt=(0,N.default)(mt)?["off","desktop"]:mt.split("|"),vt=(0,E.default)(h,"props.module.props.is_module_child",!1)&&((0,W.default)(c,"default_tablet")||(0,W.default)(c,"default_phone")),_t=(0,E.default)(T,ve,""),wt=(0,E.default)(T,c.name,""),Ot=(0,E.default)(T,"".concat(c.name,"_tablet"),""),kt=(0,E.default)(T,"".concat(c.name,"_phone"),"");if(H=se.default.getPreviewMode(),!vt&&(0,E.default)(c,"default_value_depends",!1)){var St=c.default_value_depends,Ct=c.default_values_mapping;Z.getDefaultFrom=(0,E.default)(T,St,!1),wt=te.default.hasValue(T[c.name])&&c.default!==T[c.name]?T[c.name]:(0,E.default)(Ct,Z.getDefaultFrom,c.default),_t=te.default.hasValue(T[ve])&&c.default!==T[ve]?T[ve]:wt}Ot&&!(0,W.default)(c,"default_phone")&&(c.default_phone=Ot),Ot||!(0,W.default)(c,"default_tablet")||(0,W.default)(c,"default_phone")||(c.default_phone=c.default_tablet),_t&&!(0,W.default)(c,"default_tablet")&&(c.default_tablet=_t),_t&&!(0,W.default)(c,"default_phone")&&(c.default_phone=_t),V=wt,j={desktop:_t,tablet:Ot,phone:kt,isResponsive:oe.default.isResponsiveEnabled(T,c.name),activeTab:yt[1]},de=_t||(0,E.default)(c,"default","")}else if(c.mobile_options){c=t._handleFieldConditionalDefaults(c,T,c.name!==ve),H=se.default.getPreviewMode();var Et=oe.default.isResponsiveEnabled(T,c.name),Pt=(0,L.default)(["tablet","phone"],p)&&Et,Tt=Pt?"_".concat(p):"",Mt=S&&!ne.default.isHoverMode()&&ae.default.isStickyMode()?X:(0,E.default)(T,ve,""),jt=S&&!ne.default.isHoverMode()&&ae.default.isStickyMode()?X:(0,E.default)(T,ve,""),xt=(0,E.default)(T,"".concat(c.name,"_tablet"),"");(0,E.default)(T,"".concat(c.name,"_phone"),"");if(!((0,E.default)(h,"props.module.props.is_module_child",!1)&&((0,W.default)(c,"default_tablet")||(0,W.default)(c,"default_phone")))&&(0,E.default)(c,"default_value_depends",!1)){var Dt=(0,E.default)(c,"default_value_depends",""),Nt=(0,E.default)(c,"default_values_mapping",{});Z.getDefaultFrom=(0,E.default)(n.props.attrs,Dt,!1),jt=te.default.hasValue(jt)&&c.default!==jt?jt:(0,E.default)(Nt,Z.getDefaultFrom,c.default),Mt=te.default.hasValue(Mt)&&c.default!==Mt?Mt:jt}xt&&!(0,W.default)(c,"default_phone")&&(c.default_phone=xt),xt||!(0,W.default)(c,"default_tablet")||(0,W.default)(c,"default_phone")||(c.default_phone=c.default_tablet),Mt&&!(0,W.default)(c,"default_tablet")&&(c.default_tablet=Mt),Mt&&!(0,W.default)(c,"default_phone")&&(c.default_phone=Mt),j=Pt?(0,E.default)(T,"".concat(c.name).concat(Tt),""):Mt,V=jt,de=Mt||(0,E.default)(c,"default",""),Pt&&(ie.default=(0,E.default)(c,"default".concat(Tt),(0,E.default)(c,"default","")),c.default=ie.default,ie.name="".concat(c.name).concat(Tt),ie.baseName=c.name,"yes_no_button"===v?(ie.defaultValue=ie.default,c.defaultValue=ie.defaultValue):"background-field"===v&&delete ie.name),c.dynamic_content&&(0,A.default)(j)&&(j="".concat(j))}else if(S)j=(0,N.default)(T.content)?n.props.content:T.content;else if("composite"!==v){c=t._handleFieldConditionalDefaults(c,T,c.name!==ve);var Lt=(0,E.default)(c,"default","");if((0,E.default)(c,"default_from",!1)){var Rt=c.default_from;Lt=(0,E.default)(T,Rt,Lt)}V=(0,E.default)(T,c.name,Lt),j=(0,E.default)(T,ve,Ne||Ue?V:Lt),(0,A.default)(j)&&(j="".concat(j)),(0,A.default)(V)&&(V="".concat(V)),j||(j=""),V||(V=""),de=te.default.hasValue(j)?j:(0,E.default)(c,"default","")}if("font"===v&&(de=(0,N.default)(de)||(0,B.default)((0,w.default)(de.split("|")))?"":de,fe=(0,N.default)(fe)?"":fe),"select_with_option_groups"===v&&!(0,L.default)(["provider","spam"],(0,E.default)(c,"toggle_slug",""))&&te.default.hasValue(j)&&-1!==j.indexOf("|")&&(j=(0,M.default)(j)?j.split("|")[1]:j),"select_with_option_groups"===v&&te.default.hasValue(V)&&-1!==V.indexOf("|")&&(V=(0,M.default)(V)?V.split("|")[1]:V),(0,N.default)(c.depends_default)&&(0,N.default)(c.depends_show_if)&&(0,N.default)(c.depends_show_if_not)||(P=(0,Q.default)("et-fb-option--depends-on",P)),"select_with_option_groups"===v&&c.groups&&(P=(0,Q.default)("et-fb-option--select-with-option-groups",P)),"text"===v&&(J=(0,Q.default)("et-fb-settings-option-input--block",J)),"color-alpha"===v&&"et_pb_section"===(0,E.default)(n,"props.type")&&"background_color"===(0,E.default)(c,"name")&&(c.default=se.default.getPageSetting("et_pb_section_background_color")||se.default.getPageSettingField("et_pb_section_background_color").default),"admin_label"===u&&(c.default=g,c.defaultIfEmpty=!0),(0,N.default)(c.readonly_if)&&(0,N.default)(c.readonly_if_not)||!(0,ee.isReadOnlyField)(c,t.setting_resolver)||(c.readonly=!0,c.useAddNewButton=!1),(0,N.default)(v)||!_e.default.getControl(v))return!1;if("warning"===v&&c.display_if!==c.value)return!1;if(!(0,N.default)(c.depends_on)&&(0,N.default)(c.show_if_not)&&(0,N.default)(c.show_if)&&!t._isVisible(c,y))return re.push(c.name),!1;if(!((0,N.default)(c.show_if)&&(0,N.default)(c.show_if_not)||(0,ee.canShowField)(c,t.setting_resolver)))return re.push(c.name),!1;if(!(0,N.default)(c.depends_on)&&(0,I.default)(c.depends_on,(0,R.default)(c.depends_on,re)))return!1;if("position"===v){var At=(0,E.default)(t.state.cssFields,"positioning.default","none"),It=(0,Be.positionByDevice)(T,At,t.props.activeTabMode);if("none"===It||"position_origin_".concat(It.substr(0,1))!==c.name)return!1}if((0,L.default)(["vertical_offset","horizontal_offset"],c.name)){var Bt=(0,E.default)(t.state.cssFields,"positioning.default","none"),Ft=(0,Be.positionByDevice)(T,Bt,t.props.activeTabMode);if("none"===Ft)return!1;var Wt=(0,Be.originByDevice)(T,Ft,t.props.activeTabMode);if("center"===Wt[1]&&"center"===Wt[0]||"vertical_offset"===c.name&&"center"===Wt[0]||"horizontal_offset"===c.name&&"center"===Wt[1])return!1}if("composite"===v)return ke.default.createControl(c,{uniqueKey:ue,module:h,moduleAttrs:T,_onChange:h._onChange.bind(h),onClickHelp:h._onClickHelp,activeHover:ne.default.isEnabled(we,T),activeSticky:ae.default.isEnabled(we,T),onClickHover:h._onClickHover,onClickReset:h._onClickReset,onClickResponsive:h._onClickResponsive,onClickSticky:h._onClickSticky,hasHoverOptions:Ce,hasStickyOptions:Re,isDescriptionVisible:h._isDescriptionVisible,isHoveredGroup:h._isHoveredGroup,onMouseEnterGroup:h._onMouseEnterGroup,onMouseLeaveGroup:h._onMouseLeaveGroup,isSelectiveSyncAvailable:h.isSelectiveSyncAvailable.bind(h),isGlobalOptionSynced:h.isGlobalOptionSynced.bind(h),_unsyncGlobalSetting:h._unsyncGlobalSetting.bind(h),isResetActive:h._isResetActive,setting_resolver:h.setting_resolver,animate:h.props.options.animate,rightClickOpened:h.props.rightClickOpened,toggleGroupId:a,isSettingsModal:!0,isResponsiveEnabled:oe.default.isResponsiveEnabled(T,c.name),_isOptionMatchesFilter:h._isOptionMatchesFilter,toggleId:o,onToggleRightMenu:h._onToggleRightMenu,activeTabMode:p,isGlobalPresetsMode:h.props.isGlobalPresetsMode,isItemSelected:d,optionSubToggle:c.sub_toggle});var Vt=!(0,N.default)(c.description)&&""!==c.description,Ut=(0,L.default)(["content","raw_content"],u)||!(0,N.default)(c.is_fb_content)&&c.is_fb_content,Gt=Ut?"et_pb_content_field":c.name,Ht=(0,N.default)(c.priority)?10:c.priority,zt=!!(0,N.default)(c.vb_support)||c.vb_support?"":$.default.createElement("span",{className:"et-fb-no-vb-support-warning"},ETBuilderBackend.i18n.modals.moduleSettings.noSupport),qt=fe===de,Kt=c,$t=Kt.sub_toggle,Yt=Kt.toggle_slug;if(x||!$t||!ce||$t===(0,E.default)(q,Yt,xe)){var Xt=Vt?c.description:"",Jt={},Qt=c.label,Zt="",en=(0,N.default)(c.additional_button_type)?"":$.default.createElement(be.default,{type:c.additional_button_type,name:c.name,attrs:c.additional_button_attrs,module:n,_onChange:t._onChange});if("css"===r){var tn=!(0,N.default)(c.isColumnField)&&c.isColumnField,nn=tn?c.columnType:n.props.type,rn=tn?c.columnIndex:n.props.shortcode_index,on=".".concat((0,je.getModuleOrderClass)(nn,rn,n.props.theme_builder_suffix)),an=!(0,N.default)(c.selector)&&!Vt&&c.selector;if(!1!==an){if(-1!==an.indexOf("%%order_class%%"))an=an.replace(/%%order_class%%/g,on);else an=on+(!(0,N.default)(c.no_space_before_selector)&&c.no_space_before_selector?"":" ")+an;Vt=!0,Xt=Fe&&Ve?ETBuilderBackend.i18n.controls.cssSelectorFree:"".concat(ETBuilderBackend.i18n.controls.cssSelector," ").concat(an)}"custom_css"===c.toggle_slug&&t._isFilterActive()&&"freeFormCSS"!==Ie&&(Qt="".concat(c.label," ").concat(ETBuilderBackend.i18n.controls.cssText))}var ln=Me.default.getNameByMode(c.name,t.getModuleAttrs());if(Ut&&ln!==c.name&&(X=j),Me.default.isHoverEnabled(c.name,t.getModuleAttrs())&&Me.default.isHoverMode()&&(ie.name=ln,c.default=c["default".concat(ne.default.hoverSuffix())]?c["default".concat(ne.default.hoverSuffix())]:Me.default.getDesktopValue(c.name,t.getModuleAttrs(),c.default),"yes_no_button"===v&&(c.defaultValue=c.default)),Me.default.isStickyEnabled(c.name,t.getModuleAttrs())&&Me.default.isStickyMode()){ie.name=ln;var un=Me.default.getDesktopValue(c.name,t.getModuleAttrs(),c.default);!te.default.hasValue(un)&&te.default.hasValue(c.default)&&(un=c.default),c.default=c["default".concat(ae.default.stickySuffix())]?c["default".concat(ae.default.stickySuffix())]:un,"yes_no_button"===v&&(c.defaultValue=c.default)}if("general"===r&&"background"!==c.toggle_slug&&!Me.default.isDesktopMode()){var sn=Me.default.getBaseName(c.name),cn=Me.default.getNameByMode(c.name,T);if(sn&&cn&&sn!==cn&&!(0,W.default)(T,cn)){var dn=null;dn="content"===sn?Me.default.getContentByMode((0,C.default)({},T,{content:(0,E.default)(t,"props.module.props.content")})):"raw_content"===sn?Me.default.getRawContentByMode((0,C.default)({},T,{content:(0,E.default)(t,"props.module.props.content")})):Me.default.getValueByMode(sn,T),(0,D.default)(dn)||dn===j||(j=dn,X=dn,c.default=dn)}(0,F.default)(["value","default","default_on_front","default_tablet","default_phone","defaultValue"],(function(e){var t="value"===e?j:(0,E.default)(c,e);if(t&&(0,Te.isDynamicContent)(t)){var n=(0,Te.getDynamicContent)(t);if(!(0,B.default)(n)&&(0,W.default)(n,"content")&&(0,W.default)(n,"settings")){var r=se.default.getPostContentFieldValue("dynamic",n.content,n.settings,sn);!r&&Me.default.isPhoneMode()&&(r=se.default.getPostContentFieldValue("dynamic",n.content,n.settings,Me.default.getTabletName(sn))),(0,D.default)(r)||("value"===e&&(j=r,c.default=r,ie.default=r),(0,W.default)(c,e)&&(c[e]=r),(0,W.default)(ie,e)&&(ie[e]=r))}}}))}"upload"===v&&!1===(0,E.default)(c,"data_type",!1)&&(ie.showDeleteButton=!0,ie.showResetButton=!0);var fn=c.default_on_front||c.defaultValue||c.default,pn=ne.default.isEnabled(we,T),hn=ae.default.isEnabled(we,T),mn=(0,N.default)(c.linked_responsive)?[]:c.linked_responsive,yn=(0,E.default)(c,"context_menu",!0);Jt.activeHover=pn,Jt.isHoverTab=De,Jt.activeSticky=hn,Jt.isStickyTab=Le;var gn=(0,N.default)(c.label)||""===c.label?"":$.default.createElement(ge.ETBuilderFormLabel,{name:ve,backgroundFields:c.backgroundFields||c.background_fields,defaultValue:fn,activeHelp:h._isDescriptionVisible(we),activeHover:pn,activeSticky:hn,hoveredGroup:h._isHoveredGroup(we),key:"".concat(r,"-form-label-").concat(c.name),onClickHelp:!!Vt&&h._onClickHelp,onClickHover:!!Se&&h._onClickHover,onClickSticky:h._onClickSticky,onClickResponsive:h._onClickResponsive,onClickReset:h._onClickReset,isResetActive:h._isResetActive(c),hasResponsiveOptions:Ge,hasHoverOptions:Ce,hasStickyOptions:Re,onToggleRightMenu:!!yn&&h._onToggleRightMenu,isResponsiveEnabled:oe.default.isResponsiveEnabled(T,c.name),linkedResponsive:mn},Qt),bn=Vt?$.default.createElement(ge.ETBuilderFormDescription,{active:h._isDescriptionVisible(c.name),key:"".concat(r,"-form-description-").concat(c.name)},Xt):"",vn=c.mobile_options&&oe.default.isResponsiveEnabled(T,c.name)||Se&&ne.default.isEnabled(we,T)||ae.default.isEnabled(we,T)?$.default.createElement(Oe.default,null,$.default.createElement(ge.ETBuilderFormSettingModeTabs,{module:t._getModule(),moduleAttrs:T,fieldName:we,activeTabMode:p,isGlobalPresetsMode:t.props.isGlobalPresetsMode,isResponsiveEnabled:oe.default.isResponsiveEnabled(T,we),isHoverEnabled:ne.default.isEnabled(we,T),isStickyEnabled:Re&&ae.default.isEnabled(we,T),isItemSelected:d})):"";if(G||c.isColumnBackground||!t._isValidProductTourToggle(o,O)||(Zt="et-fb-product-tour-element","text"===v?Zt+=" et-fb-product-tour-element-text":"background"===v&&(Zt+=" et-fb-product-tour-element-background"),t.productTourOptionToggle=o,G=!0),"codemirror"===v&&(Jt.search=t.state.filterOptions),"font"===v&&(Jt.formLabel=gn,Jt.formDescription=bn),(0,E.default)(c,"attributes.data-old-option-ref",!1)){var _n=c.attributes["data-old-option-ref"];Z.oldOptionValue=(0,E.default)(T,_n,!1)}var wn={slug:c.type,type:"field"},On=(0,C.default)({processedKey:ue,value:j,className:J,module:h,moduleAttrs:T,parentModuleAttrs:le,content:X,resetValue:!1,previewMode:H,_onChange:t._onChange,_resetOption:t._resetOption,visible:!0,additionalAttrs:Z,filterSelected:t.state.filterSelected,animate:t.props.options.animate,rightClickOpened:t.props.rightClickOpened,isSettingsModal:!0,isResponsive:oe.default.isResponsiveEnabled(T,c.name),fieldDefinition:e,matching:wn,activeTabMode:p,isItemSelected:d,onToggleRightMenu:t._onToggleRightMenu},Jt,c,ie),kn=(0,E.default)(c,"data_type",!1),Sn=v+(kn?"_".concat(kn):""),Cn=(0,$.createElement)(_e.default.getControl(v),On),En={fieldName:c.name,fieldLabel:Qt,fieldType:Sn,toggleId:o,toggleGroupId:a,fieldContextMenu:yn,tabSlug:(0,E.default)(c,"tab_slug",a)};return $.default.createElement(ge.ETBuilderFormGroup,{name:c.name,key:"".concat(r,"-form-group-").concat(ue),onMouseEnterGroup:function(){t._onMouseEnterGroup(En)},onMouseLeaveGroup:function(){t._onMouseLeaveGroup(En)},hovered:t.isOptionHovered(c.name),isSelectiveSyncAvailable:t.isSelectiveSyncAvailable(c),isGlobalOptionSynced:t.isGlobalOptionSynced(Gt),_unsyncGlobalSetting:t._unsyncGlobalSetting,optionSubToggle:c.sub_toggle,globalName:Gt,className:Zt,priority:Ht,isDefaultValue:qt},!(0,L.default)(["font"],v)&&gn,vn,!(0,L.default)(["font"],v)&&bn,$.default.createElement("div",{className:P,key:"et-fb-option-".concat(r,"_").concat(ue)},$.default.createElement("div",{className:"et-fb-option-container",key:"et-fb-option-container-".concat(ue)},$.default.createElement(Oe.default,{componentName:c.name},c.dynamic_content?$.default.createElement(Pe.default,{type:c.dynamic_content,fieldName:ln,fieldType:v,isContentField:!S&&ln===c.name&&Ut,value:Ut&&ln===c.name?X:j,defaultValue:fn,dynamicAttributes:(0,Te.getEnabledDynamicAttributes)(T),onChange:function(){S&&t._onChange(c.name,"",v,!0),t._onChange.apply(t,arguments)},onReset:t._resetOption,modalWidth:z,moduleType:n.props.type},Cn):Cn),en,zt)),i&&(0,N.default)(l)&&m&&"column_structure"===c.name&&s)}(0,_.default)(Ae,$t,(0,E.default)(Ae,$t)||!qt)})),i&&o===l&&"bottom"===u&&s))}})),ue}},{key:"_renderTabOptionsPanel",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=["general","advanced","css"],o="advanced"===e?"design":e,a=(0,L.default)(r,e)?"".concat(e,"_settings"):e;if(a="css"===e?"custom_css_settings":a,!se.default.isAllowedAction(a))return!1;var i=this,l=i.props,u=l.module,s=l.activeTabMode,c=se.default.isMultiItemSelected(u.props.address),d=(0,L.default)(["et_pb_column","et_pb_column_inner"],u.props.type),f=!(!u.isModuleItem||(0,N.default)(u.parentModule.props.type)||d)&&u.parentModule.props.type,p=this._getAllOptionsFields();this.setting_resolver.property_definitions=p,"et_pb_signup_custom_field"===(0,E.default)(u,"props.child_slug")&&(this.setting_resolver.child_property_definitions=this.getComponentFields(u,!1,"et_pb_signup_custom_field")),"et_pb_signup_custom_field"===(0,E.default)(u,"props.type")&&(this.setting_resolver.property_definitions.parentModule=this.getComponentFields({props:{type:"et_pb_signup"}}));var h="general"===e&&!c&&this._renderModuleItems(),m=(0,E.default)(u,"props.module_items_config",{}),y=(0,E.default)(m,"toggle_slug"),g=(0,E.default)(m,"location"),b=(0,B.default)(m)||(0,ee.canShowField)(m,this.setting_resolver),v=["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column"],_="";if((0,L.default)(v,u.props.type))_=(0,z.default)(ETBuilderBackend.structureModules,{slug:u.props.type}).name;else{var w=(0,z.default)(ETBuilderBackend.modules,{label:u.props.type});(0,N.default)(w)||(0,N.default)(w.title)||(_=w.title)}var O=(0,E.default)(this,"props.module.props.type"),k=(0,L.default)(["et_pb_row","et_pb_row_inner"],O)&&!this.props.isGlobalPresetsMode,S=this.props.isGlobalPresetsMode?"settings-modal-back":"settings-modal-front",C={module:u,tabSlug:e,productTourTab:t,processedTabSlug:o,canShowModuleItems:b,moduleItemsToggle:y,moduleItemsLocation:g,moduleItems:h,moduleType:O,isItemSelected:c,moduleParentName:f,activeTabMode:s,thisClass:i,isRow:k,allOptionsFields:p,moduleName:_};return $.default.createElement(ye.ETBuilderTabPanel,{key:"et-fb-tabs__panel--".concat(o),className:"et-fb-tabs__panel--".concat(e),slug:e,isModuleItemSettings:this._isModuleItemSettings(),displayFilter:n,filterValue:this.state.filterOptions,_onFilterInput:this._onFilterInput,tabsCount:this.state.tabsCount,filterItems:this._getFilterItems(),filterGroups:{show_only:ETBuilderBackend.i18n.modals.show_only},filterSelected:this.state.filterSelected,filterNotice:this.state.filterNotice,_onFilterSelect:this._onFilterSelect,filterName:S,passedRef:this.settingsModalTabPanelNode},$.default.createElement(ge.default,{onSubmit:this._handleFormSubmission},$.default.createElement("input",{type:"submit",className:"et-fb-hide"}),b&&(0,N.default)(y)&&!k&&h,this._renderTabToggles(C),$.default.createElement("div",{className:"et-fb-modal__tab-footer"},this._isFilterActive()||this.renderSupportNotice((0,E.default)(this,"props.module.props.vb_support","off")),this._maybeRenderHelpButton(f),this._isFilterActive()||$.default.createElement(we.default,{moduleTitle:this._getModuleTitle(),moduleType:u.props.type}))))}},{key:"_getTabs",value:function(){var e=this,t=[];se.default.isAllowedAction("general_settings")&&this.hasOptionTab("general",!0)&&t.push({slug:"general",title:ETBuilderBackend.i18n.controls.tabs.general,custom:!1}),se.default.isAllowedAction("advanced_settings")&&!(0,B.default)(this.state.advancedFields)&&t.push({slug:"advanced",title:ETBuilderBackend.i18n.controls.tabs.design,custom:!1}),se.default.isAllowedAction("custom_css_settings")&&!(0,B.default)(this.state.cssFields)&&t.push({slug:"css",title:ETBuilderBackend.i18n.controls.tabs.css,custom:!1});var n=this.getCustomTabsList();return(0,B.default)(n)||(0,F.default)(n,(function(n,r){se.default.isAllowedAction(r)&&e.hasOptionTab(r)&&t.push({slug:r,title:n.name||r,custom:!0})})),t}},{key:"getTabsCount",value:function(){return this._getTabs().length}},{key:"hasOptionTab",value:function(e,t){var n=t?this._getOptionsFields(e):this._getFilteredFields(e),r=!(0,B.default)((0,g.default)(n,["toggles_".concat(e,"_toggles"),"_builder_version"])),o=!1;return"general"===e&&(o=this._hasModuleItem()),r||o}},{key:"renderSupportNotice",value:function(e){if(te.default.isOn(e))return"";var t=(0,L.default)(["off","partial"],e)?e:"off";return $.default.createElement("div",{className:"et-fb-modal__support-notice",dangerouslySetInnerHTML:{__html:(0,y.default)((0,E.default)(ETBuilderBackend,["i18n","vbSupport","modalSupportNotices",t],""))}})}},{key:"_getModuleTitle",value:function(){var e=this.props.module;return(0,Re.default)(e)}},{key:"_getFilterItems",value:function(){var e=this._getModule();return ae.default.hasStickyOptions((0,E.default)(e,"props",{}))?ETBuilderBackend.searchFilterItems:(0,U.default)(ETBuilderBackend.searchFilterItems,(function(e){return(0,g.default)(e,"styles_sticky")}))}},{key:"maybeShowFilterNotice",value:function(){var t=e((0,X.findDOMNode)(this)).find(".et-fb-tabs__panel--filter-active"),n=!(0,B.default)(this.state.filterOptions)||!(0,B.default)(this.state.filterSelected);t.length&&t.each((function(t,r){te.default.hasValue(e(r).find(".et-fb-form__group:not(:empty)").text())&&(n=!1)})),n!==this.state.filterNotice&&this.setState({filterNotice:n})}},{key:"_renderGlobalPresetsCloseBadge",value:function(){if(!this.props.isGlobalPresetsMode||this.state.isGlobalPresetsSubmitDialogVisible)return!1;var e=(0,Q.default)({"et-fb-modal__badge__button":!0,"et-fb-modal__badge__button--back-to-settings":!0});return $.default.createElement(me.default,{buttonName:ie.default.BUTTON_SAVE_MODULE_PRESET_SETTINGS,tooltip:ETBuilderBackend.i18n.tooltip.modal.globalPresets.exit,disableClick:this.props.nonInteractiveMode,className:e,editingModule:this._getModule()},$.default.createElement(pe.default,{icon:"global-presets-return",color:De.default.success,size:"14"}))}},{key:"_getModalMinWidth",value:function(){return this.isGlobalModuleOpened()?430:400}},{key:"_renderModalOverlay",value:function(){if(this.props.nonInteractiveMode)return $.default.createElement("div",{className:"et-fb-modal__overlay"});var e=se.default.getGlobalPresetsState().submitDialog,t=e.confirmationAction,n=e.actionPayload,r=e.type;if(!this.state.isGlobalPresetsSubmitDialogVisible||r!==Le.default.CONFIRMATION_DIALOG_TYPE_DEFAULT)return!1;var o=this._getModule();return $.default.createElement("div",{className:"et-fb-modal__overlay"},$.default.createElement("div",{className:"et-fb-modal__overlay__header"}),$.default.createElement("div",{className:"et-fb-modal__overlay__content"},$.default.createElement(Ne.default,{animate:this.props.options.animate,onConfirm:function(){return ue.default.confirmGlobalPresetDialog(t,o,n)},dangerouslySetInnerHTML:{__html:e.confirmationText},isLoading:this.state.isGlobalPresetsSubmitDialogWaiting})))}},{key:"_renderButtons",value:function(){var e=this.props.module,t=(0,xe.getModalPreferredSnapSettings)(),n=t.snap,r=t.snapLocation,o=se.default.getGlobalPresetsState().history.isLoading,a=o?"loading":"check",i="wireframe"===se.default.getPreviewMode(),l="saveModule"===this.props.currentTourElement?e:{},u=(0,E.default)(this.props,"module.props.loading",!1)&&!i,s={"et-fb-product-tour-element":"saveModule"===this.props.currentTourElement},c={"et-fb-product-tour-element":"saveModule"===this.props.currentTourElement||"saveRow"===this.props.currentTourElement};return this.props.isGlobalPresetsMode?[$.default.createElement(me.default,{block:!0,danger:!0,buttonName:ie.default.BUTTON_GLOBAL_PRESETS_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel,disableClick:this.props.nonInteractiveMode,additionalAttrs:{skipReset:n&&r}},$.default.createElement(pe.default,{icon:"exit",color:"#FFFFFF"})),$.default.createElement(me.default,{block:!0,primary:!0,alt:!0,buttonName:ie.default.BUTTON_GLOBAL_PRESETS_SUBHISTORY_UNDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.undo,disableClick:this.props.nonInteractiveMode},$.default.createElement(pe.default,{icon:"undo",color:"#FFFFFF"})),$.default.createElement(me.default,{block:!0,info:!0,buttonName:ie.default.BUTTON_GLOBAL_PRESETS_SUBHISTORY_REDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.redo,disableClick:this.props.nonInteractiveMode},$.default.createElement(pe.default,{icon:"redo",color:"#FFFFFF"})),$.default.createElement(me.default,{block:!0,success:!0,buttonName:ie.default.BUTTON_SAVE_MODULE_PRESET_SETTINGS,tooltip:ETBuilderBackend.i18n.tooltip.modal.save,disabled:o,disableClick:this.props.nonInteractiveMode||o,additionalAttrs:{skipReset:n&&r},editingModule:e},$.default.createElement(pe.default,{icon:a,color:"#FFFFFF"}))]:[$.default.createElement(me.default,{block:!0,danger:!0,buttonName:ie.default.MODAL_SETTINGS_BUTTON_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel,disableClick:u,className:s,editingModule:l,additionalAttrs:{skipReset:n&&r}},$.default.createElement(pe.default,{icon:"exit",color:"#FFFFFF"})),$.default.createElement(me.default,{block:!0,primary:!0,alt:!0,buttonName:ie.default.MODAL_SETTINGS_BUTTON_UNDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.undo,disableClick:u},$.default.createElement(pe.default,{icon:"undo",color:"#FFFFFF"})),$.default.createElement(me.default,{block:!0,info:!0,buttonName:ie.default.MODAL_SETTINGS_BUTTON_REDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.redo,disableClick:u},$.default.createElement(pe.default,{icon:"redo",color:"#FFFFFF"})),$.default.createElement(me.default,{block:!0,success:!0,buttonName:this._isModuleItemSettings()?ie.default.MODULE_ITEM_BACK_TO_PARENT:ie.default.MODAL_SETTINGS_BUTTON_SAVE,tooltip:ETBuilderBackend.i18n.tooltip.modal.save,disableClick:u,className:c,editingModule:l,additionalAttrs:{skipReset:n&&r}},$.default.createElement(pe.default,{icon:"check",color:"#FFFFFF"}))]}},{key:"_renderHeaderDropdown",value:function(){return this._isMultiSelectMode()?null:$.default.createElement(We.default,{module:this.props.module,onMouseEnter:this._onMouseEnterTitle,onMouseLeave:this._onMouseLeaveTitle})}},{key:"_renderTabNavs",value:function(){var e=this,t=this._getTabs();return!(0,B.default)(t)&&t.map((function(t){var n=e.getGlobalTabClass();return $.default.createElement(ye.ETBuilderTabItem,{key:t.slug,className:n,panelId:t.slug,setHoveredElement:e._setHoveredElementWrapper},t.title)}))}},{key:"_renderTabPanels",value:function(){var e=this,t=this._getTabs();if((0,B.default)(t))return!1;var n=(0,z.default)(t,(function(e){return"general"===e.slug})),r=this.props,o=r.currentTourElement,a=r.module,i=se.default.getProductTourModuleName(),l="configureModule"===o&&i===a.props.type||"editRow"===o&&"et_pb_row"===a.props.type,u=l?"general":"";l&&!n&&(u=hasDesignTab&&advancedTabOutput?"advanced":"css");this._isModalExpanded();var s=this._isFilterActive();return t.map((function(t,n){var r=s?0===n:e.state.tabSelectedIndex===n;return t.custom?e._renderTabOptionsPanel(t.slug,void 0,r):e._renderTabOptionsPanel(t.slug,u,r)}))}},{key:"render",value:function(){var e=this.props,t=e.isVisible,n=e.module;if(!t)return!1;if((0,N.default)(n.props))return!1;var r=this.state.isModalRest,o=this._isFilterActive(),a=!r&&!o,i=this._getModuleTitle(),l=(0,xe.getModalPreferredSnapSettings)().snapLocation,u=(0,Q.default)({"et-fb-modal__module-settings":!0,"et-fb-modal__filter-active":o,"et-fb-modal__selective-sync":this.isSelectiveSyncAvailable(),"et-fb-modal__global-presets-mode":this.props.isGlobalPresetsMode,"et-fb-modal--with-header-dropdown":!this._isMultiSelectMode()},this.getGlobalModalClass("et-fb-modal")),s=this.props.ignorePosition?{x:0,y:0}:(0,xe.getModalPreferredCoordinates)(),c=(0,xe.getModalPreferredFullscreen)(),d=(0,xe.getModalPreferredDimensions)().width,f=this.props.isGlobalPresetsMode?"settings-modal-back":"settings-modal-front",p=this.props.isGlobalPresetsMode?ETBuilderBackend.i18n.modals.globalPresets.title.replace("%s",i):ETBuilderBackend.i18n.modals.moduleSettings.title.replace("%s",i),h=this.props.isGlobalPresetsMode&&this._renderGlobalPresetsCloseBadge(),m=this._renderModalOverlay(),y=se.default.isViewGlobalPresetsAllowed()&&!se.default.isProductTourActive();return $.default.createElement(fe.default,Ke({key:f,className:u,disableEscShortcut:o,footerButtons:this._renderButtons(),fullscreen:c,globalUpdate:!0,isModuleItemSettings:this._isModuleItemSettings(),label:p,headerContent:this._renderHeaderDropdown(),passthroughClicksFor:["et-fb-modal__module-settings__header-dropdown__overflow-container","et-core-popup__wrapper"],badge:y&&h,modalMinimalWidth:this._getModalMinWidth(),measurement:(0,xe.getModalPreferredDimensions)(),animate:this.props.options.animate,disablePopupAnimation:this.props.disablePopupAnimation,onModalChange:this.props.onModalChange,ignorePosition:this.props.ignorePosition,snapLocation:l,tabsCount:this.state.tabsCount,onMouseEnterTitle:this._onMouseEnterTitle,onMouseLeaveTitle:this._onMouseLeaveTitle,overlay:m,onBackToParent:this._onBackToParent,_setHoveredElement:this._onMouseEnterTitle},this.props,{position:s,onRest:this._onModalRest}),$.default.createElement(ye.default,{selectedIndex:this.state.tabSelectedIndex,module:this.props.module,onSelect:this._onTabSelect,renderOnSelectedOnce:a},$.default.createElement(ye.ETBuilderTabList,{className:this.getGlobalModalClass("et-fb-tabs__list"),modalWidth:d,snapLocation:l,fullscreen:c,showScroll:!o},this._renderTabNavs()),this._renderTabPanels()))}}]),o}($.Component);vt.propTypes=yt,vt.defaultProps={additionalClasses:{},ignorePosition:!1,isGlobalPresetsMode:!1,nonInteractiveMode:!1,disablePopupAnimation:!1};var _t=vt;t.default=_t}).call(this,n(8),n(97)(e))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=x(n(0)),a=M(n(7)),i=M(n(360)),l=M(n(10)),u=M(n(1)),s=M(n(129)),c=M(n(11)),d=M(n(184)),f=M(n(34)),p=M(n(368));n(1571);var h=M(n(2)),m=M(n(22)),y=M(n(59)),g=M(n(283)),b=M(n(63)),v=M(n(198)),_=x(n(506)),w=n(782),O=M(n(43)),k=M(n(781)),S=M(n(1491)),C=M(n(1489)),E=M(n(6)),P=M(n(14)),T=["builderAnimation","builderDisplayModalSettings","builderEnableDummyContent","builderEventMode","builderViewMode","builderHideDisabledModules","builderModalPreference","builderPageCreationFlow","builderEnableVisualThemeBuilder","historyIntervals","toolbarButtons"];function M(e){return e&&e.__esModule?e:{default:e}}function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(j=function(e){return e?n:t})(e)}function x(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=j(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function L(e,t){for(var n=0;nV.innerWidth,c=s?0:g.default.pageSettingsBar,d=s?0:30,f=!!G&&h.default.$topWindow("#et_pb_layout");if("top"===e){if(G&&f){var p=h.default.$topWindow().scrollTop();return(0,u.default)(f.offset(),"top",0)+f.find("h2.hndle").outerHeight()+z-p}return i||o?g.default.topbar.desktop+d:r||n?c+g.default.topbar.desktop:"auto"}return"bottom"===e?G||r||n||i||o?"auto":c:"right"===e?G?H?"auto;":h.default.$topWindow().width()-((0,u.default)(f.offset(),"left",0)+f.width())+10:l||o?c:i?"auto":!(!h.default.condition("is_rtl")||h.default.condition("is_no_rtl"))&&d:"left"===e?G?H?(0,u.default)(f.offset(),"left",0)+10:"auto":i?c:l||o?"auto":n?c:!(!r&&h.default.condition("is_rtl")&&!h.default.condition("is_no_rtl"))&&d:void 0}},{key:"_handleScroll",value:function(){this._handleResize()}},{key:"_handleShortcuts",value:function(e){27===e.keyCode&&m.default.buttonClick({props:{buttonName:y.default.MODAL_APP_BUTTON_CLOSE}})}},{key:"_handleResize",value:function(){var e=G?h.default.$topWindow("#et_pb_layout").offset().top:0,t=G?h.default.$topWindow().scrollTop():0,n=G?96:146;V.innerHeight<940+n+(e-t)+30?V.innerHeight<200?this.setState({height:100}):this.setState({height:V.innerHeight-n-30-e+t}):this.setState({height:940})}},{key:"_handleAnimationChange",value:function(){var e=this.props.builderAnimation;m.default.preferencesChange({builder_animation:!e})}},{key:"_handleDisabledModules",value:function(){var e=this.props.builderHideDisabledModules;m.default.preferencesChange({hide_disabled_modules:!e})}},{key:"_handleAllModalSettings",value:function(){var e=this.props.builderDisplayModalSettings;m.default.preferencesChange({builder_display_modal_settings:!e})}},{key:"_handleDummyContent",value:function(){var e=this.props.builderEnableDummyContent;m.default.preferencesChange({builder_enable_dummy_content:!e})}},{key:"_handleEventModeChange",value:function(e,t){m.default.preferencesChange({event_mode:K(t)})}},{key:"_handleVisualThemeBuilder",value:function(){var e=this.props.builderEnableVisualThemeBuilder;e&&m.default.setActiveThemeBuilderArea("post_content"),m.default.preferencesChange({builder_enable_visual_theme_builder:!e})}},{key:"_handleViewModeChange",value:function(e,t){var n=(0,c.default)(t)?$():t;m.default.preferencesChange({view_mode:n})}},{key:"_handleHistoryChange",value:function(e,t){m.default.preferencesChange({history_intervals:Y(t)})}},{key:"_handlePageCreationFlowChange",value:function(e,t){m.default.preferencesChange({page_creation_flow:J(t)})}},{key:"_handleModalChange",value:function(e,t){m.default.preferencesChange({modal_preference:X(t)})}},{key:"_handleReset",value:function(e,t,n){return e!==t&&o.default.createElement(b.default,{__onClick:n},o.default.createElement(O.default,{icon:"reset"}))}},{key:"_getViewModesList",value:function(){var e=h.default.condition("is_bfb"),t=U.view_mode_select;if(e){var n=t.wireframe;(0,i.default)(t.wireframe),t=(0,l.default)({wireframe:n},t)}return t}},{key:"render",value:function(){var e=this.props,t=e.builderAnimation,n=e.builderDisplayModalSettings,r=e.builderEnableDummyContent,i=e.builderEventMode,l=e.builderViewMode,s=e.builderHideDisabledModules,c=e.builderModalPreference,d=e.builderPageCreationFlow,f=e.builderEnableVisualThemeBuilder,p=e.historyIntervals,m=e.toolbarButtons,g=N(e,T),P=this.state,M=P.height,j=P.width,x=E.default.getAppPreferences();return o.default.createElement(k.default,D({className:"et-fb-modal--app",forceUpdate:!0,headerButtons:[o.default.createElement(b.default,{buttonName:y.default.MODAL_APP_BUTTON_CLOSE,inverse:!0,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel},o.default.createElement(O.default,{icon:"exit",color:"#FFFFFF"}))],label:U.title,measurement:{height:M,width:j},animate:this.props.options.animate,style:{top:this._getPosition("top"),bottom:this._getPosition("bottom"),left:this._getPosition("left"),right:this._getPosition("right")}},g),o.default.createElement(w.ETBuilderTabPanel,{selected:!0},o.default.createElement("div",{className:"et-fb-form"},o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.toolbar),o.default.createElement(v.default,null,o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"wireframe"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,stopPropagation:!0,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("wireframe",m),icon:"wireframe"})),o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"zoom"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,stopPropagation:!0,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("zoom",m),icon:"zoom-in"})),o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"desktop"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("desktop",m),icon:"desktop"})),o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"tablet"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("tablet",m),icon:"tablet"})),o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"phone"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("phone",m),icon:"phone"}))),o.default.createElement(v.default,{style:h.default.condition("is_rtl")&&!h.default.condition("is_no_rtl")?{marginRight:3}:{marginLeft:3}},o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"hover"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("hover",m),icon:"hover"})),o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"click"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("click",m),icon:"click"})),o.default.createElement(b.default,{additionalAttrs:{toolbarButton:"grid"},buttonName:y.default.TOGGLE_TOOLBAR_BUTTON,style:{background:"#F2F6F9"}},o.default.createElement(O.default,{color:q("grid",m),icon:"grid"})))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.view_mode),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(S.default,{name:"builder_view_mode",value:l,options:this._getViewModesList(),_onChange:this._handleViewModeChange}),l!==$()&&""!==l&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleViewModeChange,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.interaction_mode),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(S.default,{name:"view_mode",value:K(i,!0),options:U.interaction_mode_select,_onChange:this._handleEventModeChange}),!(0,a.default)(["","hover","default"],i)&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleEventModeChange,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.history),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(S.default,{name:"history",value:Y(p,!0),options:U.history_intervals_select,_onChange:this._handleHistoryChange}),1!==p&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleHistoryChange,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.modal_position),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(S.default,{name:"modal_position",value:X(c,!0),options:this._getModalOptions(),_onChange:this._handleModalChange}),"default"!==c&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleModalChange,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.page_creation_flow),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(S.default,{name:"page_creation",value:J(d,!0),options:U.page_creation_flow_select,_onChange:this._handlePageCreationFlowChange}),"default"!==d&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handlePageCreationFlowChange,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.animation),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(C.default,{onClick:this._handleAnimationChange,options:{on:U.builder_animation_toggle.on,off:U.builder_animation_toggle.off},value:t?"on":"off"}),t!==(0,u.default)(x,"builder_animation.default")&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleAnimationChange,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.disabled_modules),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(C.default,{onClick:this._handleDisabledModules,options:{on:U.hide_disabled_module_toggle.on,off:U.hide_disabled_module_toggle.off},value:s?"off":"on"}),s!==(0,u.default)(x,"hide_disabled_modules.default")&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleDisabledModules,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.group_settings),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(C.default,{onClick:this._handleAllModalSettings,options:{on:U.display_modal_settings.on,off:U.display_modal_settings.off},value:n?"off":"on"}),n!==(0,u.default)(x,"builder_display_modal_settings.default")&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleAllModalSettings,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.dummy_content),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(C.default,{onClick:this._handleDummyContent,options:{on:U.enable_dummy_content.on,off:U.enable_dummy_content.off},value:r?"on":"off"}),r!==(0,u.default)(x,"builder_enable_dummy_content.default")&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleDummyContent,small:!0},o.default.createElement(O.default,{icon:"reset"}))))),o.default.createElement(_.ETBuilderFormGroup,null,o.default.createElement(_.ETBuilderFormLabel,null,U.labels.visual_theme_builder),o.default.createElement("div",{className:"et-fb-settings-option"},o.default.createElement("div",{className:"et-fb-settings-option-container"},o.default.createElement(C.default,{onClick:this._handleVisualThemeBuilder,options:{on:U.enable_visual_theme_builder.on,off:U.enable_visual_theme_builder.off},value:f?"on":"off"}),f!==(0,u.default)(x,"builder_enable_visual_theme_builder.default")&&o.default.createElement(b.default,{className:"et-fb-button--reset",__onClick:this._handleVisualThemeBuilder,small:!0},o.default.createElement(O.default,{icon:"reset"}))))))))}}],n&&L(t.prototype,n),r&&L(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.Component);Q.propTypes={},Q.defaultProps={toolbarButtons:{}};var Z=Q;t.default=Z},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=H(n(0)),a=n(27),i=H(n(13)),l=H(n(3)),u=H(n(11)),s=H(n(9)),c=H(n(5)),d=H(n(7)),f=H(n(42)),p=H(n(197)),h=H(n(31)),m=H(n(34)),y=H(n(56)),g=H(n(332)),b=H(n(10)),v=H(n(136)),_=H(n(124)),w=H(n(12)),O=H(n(125)),k=H(n(1)),S=H(n(28)),C=H(n(135)),E=H(n(14)),P=H(n(59)),T=H(n(283)),M=H(n(22)),j=H(n(63)),x=H(n(784)),D=H(n(43)),N=H(n(781)),L=H(n(6)),R=G(n(782)),A=G(n(506)),I=H(n(2)),B=H(n(1484)),F=H(n(807)),W=n(396);n(1549);var V=["onModalChange"];function U(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(U=function(e){return e?n:t})(e)}function G(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=U(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function H(e){return e&&e.__esModule?e:{default:e}}function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function K(e,t){for(var n=0;n1200||u>1200)&&!c;if(t&&f){if(n)return this.state.openedContentGroup===e;if(r)return this.state.openedDesignGroup===e;if(o)return this.state.openedAdvancedGroup===e}return this.state.openedToggle===e}},{key:"_onMouseEnterGroup",value:function(e){this.setState({hoveredGroup:e})}},{key:"_onMouseLeaveGroup",value:function(e){this.state.hoveredGroup===e&&this.setState({hoveredGroup:null})}},{key:"_onClickHelp",value:function(e){var t=this.state.activeDescription===e?null:e;this.setState({activeDescription:t})}},{key:"_onClickToggle",value:function(t,n,r){var o=(0,W.getModalPreferredSnapSettings)(),i=o.snap,l=o.snapLocation,u=(0,W.getModalPreferredDimensions)().width,s=(0,d.default)(["top","bottom"],l),c=I.default.topWindow().innerWidth1200||u>1200)&&!c,p="content"===r,h="design"===r,m="advanced"===r;if(this._isToggleOpened(t,r)&&f){if(p)return this.setState({openedContentGroup:"",openedToggle:""});if(h)return this.setState({openedDesignGroup:"",openedToggle:""});if(m)return this.setState({openedAdvancedGroup:"",openedToggle:""})}if(this._isToggleOpened(t))this.setState({openedToggle:""});else{var y=1===n?0:61*n-10;f?e((0,a.findDOMNode)(this)).find(".et-fb-tabs__panel--".concat(r)).animate({scrollTop:y},300):e((0,a.findDOMNode)(this)).find(".et-fb-tabs__panel--active").animate({scrollTop:y},300),this.setState({openedToggle:t,openedContentGroup:"content"===r?t:this.state.openedContentGroup,openedDesignGroup:"design"===r?t:this.state.openedDesignGroup,openedAdvancedGroup:"advanced"===r?t:this.state.openedAdvancedGroup})}}},{key:"_onFilterInput",value:function(e){this.setState({filterOptions:e,filterNotice:!1})}},{key:"_onFilterSelect",value:function(e){this.setState({filterSelected:e,filterNotice:!1})}},{key:"_isOptionMatchesFilter",value:function(e,t,n){var r=this.state.filterOptions,o=[e.label,e.description,t,n],a=this.state.filterSelected;if(""===r&&(0,c.default)(a))return!0;var i=!1;if(r&&(0,s.default)(o,(function(e){(0,u.default)(e)||-1===e.toLowerCase().indexOf(r.toLowerCase())||(i=!0)})),"styles_modified"===a){if("content"===e.tab_slug&&"background"!==e.toggle_slug)return!1;var l=this._isOptionDefaultValue(e);i=r?i&&!l:!l}return i}},{key:"_isOptionDefaultValue",value:function(e){var t=e.default,n=L.default.getPageSetting(e.id);return!(0,u.default)(e.depends_on)&&!this.isVisible(e,this.fields)||(!(!(0,u.default)(e.readonly)||"readonly"!==e.readonly)||("yes_no_button"===e.type?!(!(0,c.default)(t)||"off"!==n)||t===n:!(!(0,c.default)(t)||!(0,c.default)(n))||t===n))}},{key:"renderToggleFields",value:function(e,t){return!!this.builder_display_modal_settings||!(""===this.state.filterOptions&&!I.default.hasValue(this.state.filterSelected))||this._isToggleOpened(e,t)}},{key:"_getTogglesForTab",value:function(e){var t={};return(0,s.default)(this.fields,(function(n){var r=n.tab_slug,o=n.toggle_slug,a=n.hide_on_fb,i=n.type;r!==e||a||"hidden"===i||(0,y.default)(t,o,!0)})),(0,_.default)(this.toggles,(function(e,n){return(0,m.default)(t,n)||"unclassified"===n}))}},{key:"_renderTab",value:function(e){var t=this,n=[],r=0,a=this._getTogglesForTab(e);return(0,h.default)(a,(function(l,s){r++;var m=(0,w.default)(l)?l.title:l,y=(0,w.default)(l)?l.sub_toggles:{};return o.default.createElement(A.ETBuilderFormToggle,{key:s,title:m,toggleId:s,toggleGroupId:e,_onClickToggle:t._onClickToggle,isToggleOpened:t._isToggleOpened(s,e),toggleOrder:r,isLastToggle:(0,O.default)(a)===r,isFilterActive:""!==t.state.filterOptions||I.default.hasValue(t.state.filterSelected),subToggles:y},!!t.renderToggleFields(s,e)&&(0,h.default)((0,v.default)((0,g.default)(t.fields),["index"]),(function(r,a){var l=r;a=r.id;var h,y=(0,d.default)(["et_pb_post_settings_title","et_pb_post_settings_excerpt","et_pb_post_settings_image"],a);if(r.name&&r.name.indexOf("custom_css")>=0&&(h=L.default.getPageSetting(r.id)),!t._isOptionMatchesFilter(r,m,h))return!1;if(r.tab_slug!==e)return"";if(r.toggle_slug!==s)return!1;if(r.hide_on_fb)return"";if((0,u.default)(r.name)&&(r.name=r.id),"categories"===r.type&&(r.categories_list={},r.taxonomy_name=(0,u.default)(r.taxonomy_name)?"category":r.taxonomy_name),"select_sidebar"===r.type&&(r.sidebars_list={}),(0,u.default)(r.type)||!B.default.getControl(r.type))return!1;var g={isPageSetting:!0};if("codemirror"===r.type&&(g.search=t.state.filterOptions),!(0,u.default)(r.depends_on_post_type)&&-1===r.depends_on_post_type.indexOf(ETBuilderBackend.postType))return n.push(r.name),!1;if(!(0,u.default)(r.depends_on)&&!t.isVisible(r,t.fields))return n.push(r.name),!1;if(!(0,u.default)(r.depends_on)&&(0,f.default)(r.depends_on,(0,p.default)(r.depends_on,n)))return!1;var v={};v["".concat("et-fb-settings-options")]=!0,v["et-fb-option--".concat(r.type.replace("_","-"))]=!0,(0,u.default)(r.depends_show_if)||(v[" et-fb-settings-option--depends-on"]=!0),"categories"!==r.type||(0,u.default)(r.taxonomy_name)||""===r.taxonomy_name||(v["et-fb-option--".concat(r.taxonomy_name)]=!0);var _="",w="",O=!(0,u.default)(r.description)&&""!==r.description,C=(0,S.default)(function(e){return I.default.get((0,k.default)(e,"default_on_front"),I.default.get((0,k.default)(e,"defaultValue"),I.default.get((0,k.default)(e,"default"),"")))}(r)),E=(0,S.default)(L.default.getPageSetting(r.id)),P=C===E?"":E;(0,u.default)(r.label)||""===r.label||(_=o.default.createElement(A.ETBuilderFormLabel,{name:r.name,activeHelp:t._isDescriptionVisible(r.name),hoveredGroup:t._isHoveredGroup(r.name),isResetActive:I.default.get(P,C)!==C,onClickReset:t._onClickReset,key:"et-fb-settings-option-label-".concat(a),onClickHelp:!!O&&t._onClickHelp},r.label)),O&&(w=o.default.createElement(A.ETBuilderFormDescription,{active:t._isDescriptionVisible(r.name),key:"et-fb-settings-option-description-".concat(a)},r.description));var T={slug:r.type,type:"field"},M=L.default.getPageSettings(!0,L.default.getActiveThemeBuilderArea()),j="et_pb_post_settings_image"===a,x=!j||j&&("0"===P||(0,c.default)(P)),D=(j||r.type,j||(0,c.default)(P),t.state),N=D.aiImageID,R=D.aiImageURL;return o.default.createElement(A.ETBuilderFormGroup,{name:r.name,key:"et-fb-settings-option-form-group-".concat(a),onMouseEnterGroup:t._onMouseEnterGroup,onMouseLeaveGroup:t._onMouseLeaveGroup,hovered:t.isOptionHovered(r.name)},_,w,o.default.createElement("div",{className:(0,i.default)(v),key:"et-fb-settings-option-".concat(a)},o.default.createElement("div",{className:"et-fb-settings-option-container",key:"et-fb-settings-option-container-".concat(a)},o.default.createElement(B.default.getControl(r.type),(0,b.default)({key:r.id,value:P,name:r.id,content:P,_onChange:t._onChange,animate:t.props.options.animate,defaultValue:C,fieldDefinition:l,matching:T,attrs:M,aiImageID:N,aiImageURL:R},g,r)),y&&o.default.createElement(o.default.Fragment,null,x&&o.default.createElement(F.default,{ref:function(e){return t.AIButtonRef=e},type:r.type,className:(0,i.default)("et-fb-settings-option-ai__enable","et-fb-settings-option-ai__enable--".concat(t.props.fieldType)),name:r.name,onOpen:function(){},onClose:function(){},value:P,label:r.label,tooltip:ETBuilderBackend.i18n.ai.tooltips.divi_ai_options})))))})))}))}},{key:"_handleFormSubmission",value:function(e){e.preventDefault(),M.default.pageSettingsClose()}},{key:"maybeShowFilterNotice",value:function(){var t=this;this.state.filterNotice||(0,c.default)(this.state.filterOptions)&&(0,c.default)(this.state.filterSelected)||(clearTimeout(ee),ee=setTimeout((function(){e((0,a.findDOMNode)(t)).find(".et-fb-form__group").length||(e((0,a.findDOMNode)(t)).find(".et-fb-options-filter input").trigger("blur"),t.setState({filterNotice:!0}))}),300))}},{key:"_renderPageSettingsPanel",value:function(e){var t={},n=["styles_modified"];return(0,s.default)(ETBuilderBackend.searchFilterItems,(function(e,r){(0,u.default)(t[r])&&(t[r]={}),(0,s.default)(e,(function(e,o){n.includes(o)&&(t[r][o]=e)}))})),o.default.createElement(R.ETBuilderTabPanel,{className:"et-fb-tabs__panel--".concat(e),key:"et-fb-tabs__panel--".concat(e),displayFilter:!0,filterValue:this.state.filterOptions,filterSelected:this.state.filterSelected,filterItems:t,filterGroups:{show_only:ETBuilderBackend.i18n.modals.show_only},filterNotice:this.state.filterNotice,_onFilterInput:this._onFilterInput,_onFilterSelect:this._onFilterSelect},o.default.createElement(A.default,{onSubmit:this._handleFormSubmission},o.default.createElement("input",{type:"submit",className:"et-fb-hide"}),this._renderTab(e),!(this.state.filterNotice||(this.state.filterOptions||this.state.filterSelected)&&(0,d.default)(["content","design"],e))&&o.default.createElement(x.default,{id:"et_pb_default"})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.onModalChange,r=q(t,V),a=ETBuilderBackend.i18n.modals.pageSettings.tabs,l=[o.default.createElement(j.default,{block:!0,danger:!0,buttonName:P.default.PAGE_SETTINGS_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.cancel},o.default.createElement(D.default,{icon:"exit",color:"#FFFFFF"})),o.default.createElement(j.default,{block:!0,primary:!0,alt:!0,buttonName:P.default.PAGE_SETTINGS_BUTTON_UNDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.undo},o.default.createElement(D.default,{icon:"undo",color:"#FFFFFF"})),o.default.createElement(j.default,{block:!0,info:!0,buttonName:P.default.PAGE_SETTINGS_BUTTON_REDO,tooltip:ETBuilderBackend.i18n.tooltip.modal.redo},o.default.createElement(D.default,{icon:"redo",color:"#FFFFFF"})),o.default.createElement(j.default,{block:!0,success:!0,buttonName:P.default.PAGE_SETTINGS_EDIT,tooltip:ETBuilderBackend.i18n.tooltip.modal.save},o.default.createElement(D.default,{icon:"check",color:"#FFFFFF"}))],u=(0,i.default)({"et-fb-modal__module-settings":!0,"et-fb-modal__filter-active":""!==this.state.filterOptions||I.default.hasValue(this.state.filterSelected),"et-fb-modal__page-settings":!0}),s=(0,W.getModalPreferredSnapSettings)().snapLocation,c=this.props.activeTab||0,d=L.default.getActiveThemeBuilderArea(),f=ETBuilderBackend.i18n.modals.pageSettings.title[d];return o.default.createElement(N.default,z({className:u,footerButtons:l,fullscreen:(0,W.getModalPreferredFullscreen)(),globalUpdate:!0,label:f,measurement:(0,W.getModalPreferredDimensions)(),animate:this.props.options.animate,onModalChange:n,position:(0,W.getModalPreferredCoordinates)(),snapLocation:s},r),o.default.createElement(R.default,{selectedIndex:c},o.default.createElement(R.ETBuilderTabList,null,(0,h.default)(a,(function(e,t){return o.default.createElement(R.ETBuilderTabItem,{key:"et-fb-modal--builder-settings-".concat(t)},e)}))),(0,h.default)(a,(function(t,n){return e._renderPageSettingsPanel(n)}))))}},{key:"_onChange",value:function(e,t){"et_pb_enable_ab_testing"===e&&I.default.isOff(t)&&L.default.abIsMode("on",L.default.getActiveThemeBuilderArea())?M.default.abDisable():M.default.pageSettingsChange(e,t)}}])&&K(n.prototype,r),l&&K(n,l),Object.defineProperty(n,"prototype",{writable:!1}),G}(o.default.Component);ne.propTypes=te;var re=ne;t.default=re}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=oe(n(1559)),a=oe(n(786)),i=re(n(0)),l=oe(n(13)),u=n(93),s=oe(n(10)),c=oe(n(58)),d=oe(n(9)),f=oe(n(1)),p=oe(n(34)),h=oe(n(147)),m=oe(n(7)),y=oe(n(4)),g=oe(n(5)),b=oe(n(12)),v=oe(n(37)),_=oe(n(11)),w=oe(n(17)),O=oe(n(31)),k=oe(n(107)),S=oe(n(40)),C=oe(n(129)),E=oe(n(124)),P=oe(n(214)),T=oe(n(56)),M=oe(n(69)),j=oe(n(72)),x=oe(n(395)),D=oe(n(28)),N=oe(n(63)),L=oe(n(1498)),R=n(60),A=oe(n(43)),I=oe(n(1484)),B=oe(n(281)),F=oe(n(781)),W=re(n(782)),V=n(506),U=oe(n(22)),G=oe(n(6)),H=oe(n(14)),z=oe(n(800)),q=n(2),K=oe(n(398)),$=n(18),Y=n(39),X=n(396),J=oe(n(791)),Q=n(358),Z=n(282),ee=n(1481),te=n(783);function ne(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(ne=function(e){return e?n:t})(e)}function re(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=ne(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function oe(e){return e&&e.__esModule?e:{default:e}}function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0],t=this._getHoveredElement("payload.toggleId"),n=this._getEditedModule(),r=this._getHoveredElement("payload.toggleGroupId"),o=this._getHoveredElement("elementId");e||(r="css"===r?"custom_css":r);var a=(0,c.default)(G.default.getModuleFields(n),{name:o,tab_slug:r,toggle_slug:t}),i=(0,s.default)({},{name:o,type:this._getHoveredElement("payload.option_family"),label:this._getHoveredElement("payload.optionTitle"),subField:this._getHoveredElement("subElementId")},a);if("categories"===i.type&&(i=(0,s.default)({},i,{categories_list:{},taxonomy_name:(0,_.default)(i.taxonomy_name)?"category":i.taxonomy_name})),"conditional_logic"===i.type&&(i=(0,s.default)({},i,{hideAddButton:!0,hideDeleteButton:!0})),"select"===i.type&&(0,_.default)(i.default)&&!(0,g.default)(i.options)){var l=(0,y.default)(i.options)?[]:{};(0,d.default)(i.options,(function(e,t){(0,b.default)(e)||(0,y.default)(e)?(0,d.default)(e,(function(e,t){l[t]=e})):l[t]=e})),l&&(i=(0,s.default)({},i,{default:(0,y.default)(l)?l[0]:(0,h.default)((0,w.default)(l))}))}return"center_map"===i.type&&(i=(0,s.default)({},i,{disableAction:!0,hideUpdateButton:!0})),i}},{key:"_getSelectedFieldType",value:function(){return(0,f.default)(this._getSelectedField(),"type","text")}},{key:"_getSelectedFieldLabel",value:function(){var e=this._getSelectedField(),t=(0,f.default)(e,"label","");if("font"===e.type){var n=(0,f.default)(this._getSelectedField(),"group_label",""),r=this._getHoveredElementSubId(),o=(this._getSelectedFieldValue()||"||||||||").split("|"),a={family:(0,f.default)(o,0,""),weight:(0,f.default)(o,1,""),italic:(0,f.default)(o,2,""),uppercase:(0,f.default)(o,3,""),underline:(0,f.default)(o,4,""),capitalize:(0,f.default)(o,5,""),strikethrough:(0,f.default)(o,6,""),line_style:(0,f.default)(o,7,""),line_color:(0,f.default)(o,8,"")},i=(0,q.isOn)((0,f.default)(a,"underline"));switch(r){case"weight":t=ye.fontWeight;break;case"style":t=ye.fontStyle;break;case"line_color":var l=i?ye.underline:ye.strikethrough,u=ye.color;t="".concat(l," ").concat(u);break;case"line_style":var s=i?ye.underline:ye.strikethrough,c=ye.style;t="".concat(s," ").concat(c);break;default:t=(0,f.default)(ye,r,"")}return(0,_.default)(n)?t:"".concat(n," ").concat(t)}return t}},{key:"_getSelectedFieldValue",value:function(){var e=(0,f.default)(this._getSelectedField(!0),"name");return"desktop"!==this.moduleSettingMode&&(e=J.default.getNameByMode(e,this._getEditedModule("props.attrs"))),this._getFieldValue(e)}},{key:"_getFieldValue",value:function(e,t,n){var r=(0,_.default)(e)?(0,f.default)(this._getSelectedField(),"name"):e,o=(0,_.default)(t)?this._getSelectedField():t,a=(0,_.default)(n)?this._getEditedModule("props"):n,i=a.attrs||{};if(!((0,g.default)(o)||(0,_.default)(r)||(0,_.default)(o.type))){var l;if(("content"===r||(0,f.default)(o,"is_fb_content",!1))&&(l=(0,f.default)(a,"content")),"gradient-stops"===o.type){var u=(0,te.getStopWithinGradient)(o.subField,(0,f.default)(a.attrs,r));l=null==u?void 0:u.color}if("custom_padding"===o.type&&"custom_padding"!==r&&this._isModuleHasColumn(a)){var s=r.replace("padding_",""),c=(0,q.hasValue)(i["padding_".concat(s,"_last_edited")])?i["padding_".concat(s,"_last_edited")].split("|"):[],d=((0,f.default)(i,"padding_top_".concat(s),"")||"").trim(),p=((0,f.default)(i,"padding_right_".concat(s),"")||"").trim(),h=((0,f.default)(i,"padding_bottom_".concat(s),"")||"").trim(),m=((0,f.default)(i,"padding_left_".concat(s),"")||"").trim(),y=((0,f.default)(i,"padding_top_bottom_link_".concat(s),"")||"").trim(),b=((0,f.default)(i,"padding_left_right_link_".concat(s),"")||"").trim(),v="".concat(d,"|").concat(p,"|").concat(h,"|").concat(m,"|").concat(y,"|").concat(b);switch((0,_.default)(c[1])?"desktop":c[1]){case"phone":l=(0,f.default)(i,"padding_".concat(s,"_phone"),"");break;case"tablet":l=(0,f.default)(i,"padding_".concat(s,"_tablet"),"");break;default:l=v}}return"center_map"===o.type&&(l="et_pb_map_pin"===a.type?JSON.stringify((0,C.default)(i,["pin_address","pin_address_lat","pin_address_lng","zoom_level"])):JSON.stringify((0,C.default)(i,["address_lat","address_lng","zoom_level"]))),(0,_.default)(l)&&(l=(0,f.default)(i,r,(0,f.default)(o,"default"))),l}}},{key:"_getWithinOptions",value:function(){var e=this,t=this._getModuleStructure(),n={};return(0,d.default)(ETBuilderBackend.findReplace.within,(function(r,o){if("locations"===o){var a=(0,w.default)(r).filter((function(t){return"this_page"===t||e._getSourceModuleAddressScope(t)}));(0,g.default)(a)||(n[o]=(0,C.default)(r,a))}else{var i=["this_module","all_same_type"];"module"===t&&i.push(["all_modules"]),(0,g.default)(i)||(n[o]=(0,k.default)((0,C.default)(r,i),(function(t){return t.replace("%s",e._getModuleTitle())})))}})),n}},{key:"_getThroughoutOptions",value:function(){var e=this,t=this._getModuleStructure(),n=(0,f.default)(ETBuilderBackend,"findReplace.throughout",{}),r=(0,w.default)(n).filter((function(n){return"this_".concat(t)!==n&&("this_page"===n||e._getSourceModuleAddressScope(n))}));return(0,C.default)(n,r)}},{key:"_isReplaceValueValid",value:function(e,t){var n=e||this.state.replace,r=t||this._getSelectedField();if(!(0,f.default)(r,"required",!1)&&!(0,q.hasValue)(n))return!0;switch((0,f.default)(r,"type")){case"color":case"color-alpha":case"button-bg-color":case"background-field":return K.default.isColorValid(n.toLowerCase())||(0,j.default)(n,"gcid-");case"gradient-stops":return(0,v.default)(n)?K.default.isColorValid(n.toLowerCase())||(0,j.default)(n,"gcid-"):(0,O.default)(n,(function(e){return K.default.isColorValid(e.color.toLowerCase())||(0,j.default)(e.color,"gcid-")}));case"range":var o=/^-?\d*\.?\d+$/,a=(0,f.default)(r,"default_unit",(0,f.default)(r,"fixed_unit",!1)),i=a?o.test(n.replace(a,"")):o.test(n);if(i&&(0,f.default)(r,"fixed_range",!1)){var l=r.range_settings||{min:0,max:100,step:1},u=(0,f.default)(r,"fixed_unit",(0,f.default)(r,"default_unit",!1)),s=u?parseFloat(n.replace(u,"")):parseFloat(n);i=s>=(0,f.default)(l,"min",0)&&s<=(0,f.default)(l,"max",100)}return i;case"font":return 9===(0,D.default)(n).split("|").length;case"center_map":return(0,q.isJson)(n);default:return!0}}},{key:"_isFieldTypeMatch",value:function(e){var t=!1,n=(0,m.default)(["color","color-alpha","gradient-stops","button-bg-color","background-field"],this._getSelectedFieldType()),r=function(){return e.type||"custom_css"!==e.toggle_slug?n?"color-alpha":e.type:"codemirror"};switch(r()){case"upload":var o=(0,f.default)(e,"data_type","image"),a=(0,f.default)(this._getSelectedField(),"data_type","image");(t=r()===this._getSelectedFieldType()&&o===a)&&"video"===a&&(t=(0,f.default)(e,"field_template",!0)===(0,f.default)(this._getSelectedField(),"field_template",!1));break;case"color":case"color-alpha":case"gradient-stops":case"button-bg-color":case"background-field":t=n;break;default:t=r()===this._getSelectedFieldType()}return t}},{key:"_isFieldNameMatch",value:function(e,t,n){if((0,q.isOn)(this.state.all))return!0;if(n&&(0,m.default)(this._getHoveredElement("payload.option"),n))return!0;var r={moduleType:this._getEditedModuleType(),field:this._getSelectedField(),value:this._getSelectedFieldValue()},o={moduleType:t.type,field:e,value:this._getFieldValue((0,f.default)(e,"name"),e,t)};return G.default.getModuleFieldsMapping(r,o)}},{key:"_isButtonEnabled",value:function(){return!((0,D.default)(this.state.find)===(0,D.default)(this.state.replace)||(0,g.default)(this.state.within)||this._isThroughoutEnabled()&&(0,g.default)(this.state.throughout)||!this._isReplaceValueValid())}},{key:"_isThroughoutEnabled",value:function(){return(0,m.default)(["all_modules","all_same_type"],this.state.within)}},{key:"_isDescriptionVisible",value:function(e){return this.state.activeDescription===e}},{key:"_isModuleHasColumn",value:function(e){var t=e||this._getModuleEdited("props"),n=(0,m.default)(["et_pb_row","et_pb_row_inner"],t.type),r=(0,q.isOn)((0,f.default)(t,"attrs.specialty")&&"et_pb_section"===(0,f.default)(t,"type"));return n||r}},{key:"_onKeyDown",value:function(e){27===e.keyCode&&this._onClose()}},{key:"_onClose",value:function(){U.default.findReplaceModalClose(this._getEditedModule(),this._getHoveredElement())}},{key:"_onMouseEnterGroup",value:function(e){this.setState({hoveredGroup:e})}},{key:"_onMouseLeaveGroup",value:function(){this.setState({hoveredGroup:!1})}},{key:"_onClickHelp",value:function(e){this.setState({activeDescription:this.state.activeDescription!==e&&e})}},{key:"_onChangeMap",value:function(e,t){try{this.setState({replace:JSON.stringify((0,T.default)(JSON.parse(this.state.replace),e,t))})}catch(n){this.setState(he({},e,t))}}},{key:"_onChangeField",value:function(e,t){e!==(0,f.default)(this._getSelectedField(),"name")?this.setState(he({},e,t)):this.setState({replace:t})}},{key:"_onChangeFieldWithin",value:function(e){this.setState({within:e})}},{key:"_onChangeFieldThroughout",value:function(e){this.setState({throughout:e})}},{key:"_onFindReplace",value:function(){var e=this;this.setState({buttonState:"loading"});var t=(0,D.default)(this.state.replace),n=(0,D.default)(this.state.find),r=!(0,q.hasValue)(n),i="font"===this._getHoveredElement("payload.option_family"),l=i&&this._getHoveredElement("subElementId"),u=l&&(0,q.getFontFieldIndexes)(l),s="gradient-stops"===this._getHoveredElement("payload.option_family"),h=this._getEditedModule("props.address"),y=this._getHoveredElement("payload.option"),b="display_conditions"===this._getHoveredElement("payload.option_family");new Promise((function(v){setTimeout((function(){var _=e._getTargetModules();return(0,g.default)(_)?v(!1):((0,d.default)(_,(function(v){var _=e._getModuleFields(v);"et_pb_icon"!==v.type||(0,p.default)(v.attrs.font_icon)||(v.attrs.font_icon=_.font_icon.default);var w={};(0,d.default)(v.attrs,(function(e,t){w[t]=e})),(0,d.default)(y,(function(e){(0,p.default)(w,e)||(w[e]="")}));var O=(0,E.default)(w,(function(e){if(e===n)return!0;if(i&&l){var t=e?e.split("|"):"||||||||".split("|"),o=n?n.split("|"):"||||||||".split("|");if(9===t.length&&t.length===o.length&&t[u]===o[u])return!0}return!!(0,ee.isMatchingGradientStopColorFound)(s,n,e)||!!(0,ee.isDisplayConditionsFoundInFindReplace)(b,n,e)||!(!r||(0,q.hasValue)(e))}));if(!(0,g.default)(O)){var k={};if((0,d.default)(O,(function(r,i){var l=J.default.getBaseName(i),u=(0,f.default)(_,l);if(!u&&(0,j.default)(l,"custom_css_")&&(u=(0,f.default)(_,(0,P.default)(l,"custom_css_",""))),u&&("skip"===u.type&&l.match(/_\d+$/)&&(u=(0,f.default)(_,l.replace(/_\d+$/,""),u)),u&&e._isFieldNameMatch(u,v,i)&&e._isFieldTypeMatch(u)&&e._isReplaceValueValid(t,u)))switch(u.type){case"font":var s=e._getFindReplaceFont(n,r,t);s&&(k[i]=s);break;case"select_box_shadow":var p=(0,c.default)(u.presets,(function(e){return e.value===t}));p&&((0,d.default)(p.fields,(function(e,t){k[t]=e})),k[i]=t);break;case"center_map":(0,d.default)(JSON.parse(t),(function(e,t){k[t]=e}));break;case"display_conditions":var h=(0,ee.decodeString)(t),m=(0,Q.isJson)(h)?JSON.parse(h):null;if(m){var y=(0,a.default)((function(e){return(0,o.default)("id",(0,Z.v4)(),e)}),m);k[i]=(0,ee.encodeString)(JSON.stringify(y))}break;default:k[i]=t}})),!(0,g.default)(k)){var S={};if((0,d.default)(k,(function(t,r){if(!(0,R.isDynamicContent)(t)||(0,R.isDynamicContentSupported)((0,f.default)(v,"type"),r)){if(r.includes("gradient")){var o=(0,te.parseGradientString)(v.attrs[r]);(0,d.default)(o,(function(e,t){(0,m.default)((0,x.default)(e.color),(0,x.default)(n))&&(o[t].color=k[r])})),t=(0,te.toGradientString)(o)}S[r]={value:t,isContent:(0,m.default)(["content","raw_content"],r)&&"et_pb_counter"!==(0,f.default)(v,"type")},(r.includes("color")||r.includes("gradient"))&&e._findReplaceColorValue(v,r)}})),!(0,g.default)(S)){var C=v.address,T=C===h;U.default.findReplaceModuleUpdate(C,S,T)}}}})),v(!0))}),0)})).then((function(){e._onClose()}))}},{key:"_getFindReplaceData",value:function(e,t,n){var r=this,o=(0,D.default)(this.state.find),a=(0,D.default)(this.state.replace),i={};if(!this._isFieldTypeMatch(t))return!1;if(!this._isFieldNameMatch(t,n))return!1;if(!this._isReplaceValueValid(a,t))return!1;var l=[e];if(t.mobile_options&&J.default.isResponsiveEnabled(e,n)&&(l.push("".concat(e,"_tablet")),l.push("".concat(e,"_phone"))),"tabs"===t.hover&&J.default.isHoverEnabled(e,n)&&l.push("".concat(e,"__hover")),t.sticky&&J.default.isStickyEnabled(e,n)&&l.push("".concat(e,"__sticky")),(0,d.default)(l,(function(l){var u=l,s=(0,f.default)(t,"tab_slug",""),c=(0,f.default)(t,"toggle_slug","");"custom_css"===s&&"classes"!==c&&(0,j.default)(u,"custom_css_")&&(u=(0,P.default)(u,"custom_css_",""));var p=(0,D.default)(r._getFieldValue(u,t,n));switch((0,f.default)(t,"type")){case"skip":case"hidden":break;case"font":var h=r._getFindReplaceFont(o,p,a);h&&(0,T.default)(i,u,h);break;case"center_map":o.toLowerCase()===p.toLowerCase()&&(0,d.default)(JSON.parse(a),(function(e,t){(0,T.default)(i,t,e)}));break;default:if(p.toLowerCase()===o.toLowerCase()&&(0,T.default)(i,u,a),0===u.indexOf("padding_")&&r._isModuleHasColumn(n.props)&&e!==u){var m=u.replace("padding_",""),y=a.split("|");e==="padding_top_".concat(m)?(0,T.default)(i,e,(0,f.default)(y,0,"")):e==="padding_right_".concat(m)?(0,T.default)(i,e,(0,f.default)(y,1,"")):e==="padding_bottom_".concat(m)?(0,T.default)(i,e,(0,f.default)(y,2,"")):e==="padding_left_".concat(m)?(0,T.default)(i,e,(0,f.default)(y,3,"")):e==="padding_top_bottom_link_".concat(m)?(0,T.default)(i,e,(0,f.default)(y,4,"")):e==="padding_left_right_link_".concat(m)&&(0,T.default)(i,e,(0,f.default)(y,5,""))}}})),!(0,g.default)(i)&&(0,f.default)(t,"presets",!1)){var u=t.presets.filter((function(e){return(0,f.default)(e,"value")===a}));(0,d.default)(u,(function(e){var t=(0,f.default)(e,"fields",!1);t&&(0,d.default)(t,(function(e,t){(0,T.default)(i,t,e)}))}))}return i}},{key:"_getFindReplaceFont",value:function(e,t,n){var r=(0,D.default)(e).split("|");9!==r.length&&(r="||||||||".split("|"));var o=(0,D.default)(t).split("|");9!==o.length&&(o="||||||||".split("|"));var a=(0,D.default)(n).split("|");9!==a.length&&(a="||||||||".split("|"));var i=(0,q.getFontFieldIndexes)(this._getHoveredElementSubId());return!(0,M.default)(i,(function(e){return(0,f.default)(r,e,"")!==(0,f.default)(o,e,"")}))&&((0,d.default)(i,(function(e){o[e]=(0,f.default)(a,e,"")})),o.join("|"))}},{key:"_resetOption",value:function(){this.setState({replace:""})}},{key:"_renderSubHeader",value:function(){if("replace_global_color"===this.props.element.intent)return i.default.createElement("p",{className:"et-fb-modal__find-replace__header-desc"},ge.description)}},{key:"_getColorFindReplaceConfig",value:function(e){return e.findReplaceModalFind?{hideColorManagerLinks:!0,hideHarmoniousPalette:!0,hideCurrentColorWrapper:!0,hideColorResetButton:!0,showCustomInput:!0}:e.findReplaceModalReplace?{hasColorManager:!0,showPickerPalettes:!1,hidePickerOnPaletteSelect:!0,hidePaletteOnPickerActive:!1}:void 0}},{key:"_getReplaceGloablColorConfig",value:function(e){var t=this.props.element,n=t.color,r=t.colorId;return e.findReplaceModalFind?{hideColorManagerLinks:!0,hideHarmoniousPalette:!0,hideCurrentColorWrapper:!0,hideColorResetButton:!0,showCustomInput:!0,colorPaletteMode:"global",colorId:r,value:n}:e.findReplaceModalReplace?{hideColorManagerLinks:!0,colorPaletteMode:"global",colorId:r,color:n}:void 0}},{key:"_findReplaceColorValue",value:function(e,t){var n=this.props.element,r=null;"replace_global_color"===n.intent&&(r=n.colorId),U.default.maybeUpdateGlobalColorsInfo(e,t,r)}},{key:"_renderField",value:function(e,t,n){var r=this._getEditedModule(),o=r.isModuleItem&&!(0,_.default)(r.parentModule.props.type)&&r.parentModule.props.type?"".concat(e.name,"_child"):e.name;e.findReplaceModalFind?o="".concat(o,"__find"):e.findReplaceModalReplace?o="".concat(o,"__replace"):e.findReplaceModalWithin?o="".concat(o,"__within"):e.findReplaceModalThroughout?o="".concat(o,"__throughout"):e.findReplaceModalReplaceAll&&(o="".concat(o,"__all"));var a,u={slug:e.type,type:"field"},c=(0,s.default)({},e,{resetValue:!1,mobile_options:!1,disableReset:!0,uniqueKey:o,processedKey:o,fieldDefinition:e,matching:u});if("transform"===c.type){var d=(0,f.default)(H.default.getComponentAdvancedFields(this.props.module),"transform_styles.composite_structure"),p="".concat(c.name).replace("transform_",""),h=(0,f.default)(d,"".concat(p,".controls.transform_").concat(p));c.default_unit=h.default_unit,c.transform_type="".concat(c.name).replace("transform_",""),(0,q.hasValue)(c.default)||(c.default=h.default),(0,q.hasValue)(c.value)||(c.value=h.default)}(e.findReplaceModalFind||e.findReplaceModalReplace)&&((0,m.default)(["color","color-alpha","gradient-stops"],c.type)&&(a="replace_global_color"===this.props.element.intent?this._getReplaceGloablColorConfig(e):this._getColorFindReplaceConfig(e),c=(0,s.default)({},c,le(le({},a),{},{moduleAttrs:(0,f.default)(r,"props.attrs")}))),"font"===c.type&&(c=(0,s.default)({},c,{subFieldLabel:!1,subField:this._getHoveredElementSubId()?this._getHoveredElementSubId():"font"})),"select_with_option_groups"===c.type&&(c=(0,s.default)({},c,{value:(0,f.default)((0,D.default)(c.value).split("|"),1,"none"),hideAddButton:!0,hideRemoveButton:!0,hideFetchButton:!0})),"multiple_checkboxes"===c.type&&(c=(0,s.default)({},c,{shortcut_index:o})));var y=(0,f.default)(c,"type","text"),g=y.replace("_","-");"custom_css_free_form"===(0,f.default)(e,"name")&&(c=(0,s.default)({},c,{inline:!1}));var b=(0,l.default)(he({"et-fb-form__group--find-replace":!0,"et-fb-form__group--find-replace__find":e.findReplaceModalFind,"et-fb-form__group--find-replace__replace":e.findReplaceModalReplace,"et-fb-form__group--find-replace__within":e.findReplaceModalWithin,"et-fb-form__group--find-replace__throughout":e.findReplaceModalThroughout,"et-fb-form__group--find-replace__all":e.findReplaceModalReplaceAll,"et-fb-settings-option-select--column-structure":"column-structure"===y},"et-fb-form__group--".concat(g),!0)),v=(0,l.default)(he({"et-fb-settings-options":!0,"et-fb-option--depends-on":!(0,_.default)(e.depends_default)||!(0,_.default)(e.depends_show_if)||!(0,_.default)(e.depends_show_if_not),"et-fb-option--select-with-option-groups":"select_with_option_groups"===y&&e.groups},"et-fb-option--".concat(g),!0)),w=(0,l.default)(he({"et-fb-option-container":!0},"et-fb-option-container--".concat(g),!0)),O=(0,i.createElement)(I.default.getControl(y),c);return i.default.createElement(V.ETBuilderFormGroup,{className:b,name:o,key:"".concat(this.tabSlug,"-form-group-").concat(o),hovered:this.isOptionHovered(c.name),onMouseEnterGroup:this._onMouseEnterGroup,onMouseLeaveGroup:this._onMouseLeaveGroup},i.default.createElement(V.ETBuilderFormLabel,{name:o,hoveredGroup:this.state.hoveredGroup===o,activeHelp:this.state.activeDescription===o,onClickHelp:this._onClickHelp},t),i.default.createElement(V.ETBuilderFormDescription,{active:this.state.activeDescription===o},n),i.default.createElement("div",{className:v},i.default.createElement("div",{className:w},i.default.createElement(B.default,{componentName:o},(this.isDynamic||c.findReplaceModalReplace)&&(0,m.default)(L.default.supportedFieldTypes,y)?i.default.createElement(L.default,{type:c.dynamic_content||y,fieldName:c.name,fieldType:y,value:c.value,dynamicAttributes:[c.name],showSettingsButton:!c.readonly,showDisableButton:!c.readonly,onChange:c._onChange,onReset:this._resetOption},O):O))))}},{key:"_renderFieldFind",value:function(){var e,t=(0,s.default)({},this._getSelectedField(),{module:this,type:this._getSelectedFieldType(),value:this.state.find,findReplaceModalFind:!0,readonly:!0,_onChange:S.default}),n=this.state.find;"text"===t.type||(0,_.default)(n)||(0,T.default)(t,"default",n),"codemirror"===t.type&&(0,f.default)(t,"is_fb_content")&&(0,T.default)(t,"content",n),e="replace_global_color"===this.props.element.intent?ge.find.label:ge.find.label.replace("%s",this._getSelectedFieldLabel());var r=ge.find.description;return this._renderField(t,e,r)}},{key:"_renderFieldWithin",value:function(){if("replace_global_color"!==this.props.element.intent&&"global"!==this.state.colorPaletteMode){var e={name:"within",type:"select",value:this.state.within,options:this._getWithinOptions(),optionGroups:ETBuilderBackend.findReplace.groups,groupSeparator:!1,findReplaceModalWithin:!0,__onChange:this._onChangeFieldWithin},t=ge.within.label,n=ge.within.description;return this._renderField(e,t,n)}}},{key:"_renderFieldThroughout",value:function(){if(!this._isThroughoutEnabled())return!1;var e={name:"throughout",type:"select",value:this.state.throughout,options:this._getThroughoutOptions(),findReplaceModalThroughout:!0,__onChange:this._onChangeFieldThroughout},t=ge.throughout.label,n=ge.throughout.description;return this._renderField(e,t,n)}},{key:"_renderFieldReplace",value:function(){var e=this,t=(0,s.default)({},this._getSelectedField(),{module:this,type:this._getSelectedFieldType(),default:(0,R.isDynamicContent)(this.state.find)?"":this.state.find,value:(0,_.default)(this.state.replace)?"":this.state.replace,findReplaceModalReplace:!0,_onChange:S.default}),n=(0,f.default)(t,"readonly_if",!1);n&&(0,d.default)(n,(function(n,r){(0,m.default)(n,e._getEditedModule(r.replace(":",".props.attrs.")))&&(0,T.default)(t,"readonly",!0)}));var r=(0,f.default)(t,"readonly_if_not",!1);r&&(0,d.default)(r,(function(n,r){(0,m.default)(n,e._getEditedModule(r.replace(":",".props.attrs.")))||(0,T.default)(t,"readonly",!0)})),(0,f.default)(t,"readonly",!1)||("center_map"===t.type?((0,T.default)(t,"_onChange",this._onChangeMap),(0,T.default)(t,"hideUpdateButton",this._onChangeMap),(0,q.isJson)(this.state.replace)&&(0,d.default)(JSON.parse(this.state.replace),(function(e,n){(0,T.default)(t,n,(0,m.default)(["zoom_level"],n)?parseInt(e,10):e)}))):(0,T.default)(t,"_onChange",this._onChangeField)),"codemirror"===t.type&&(0,f.default)(t,"is_fb_content")&&(0,T.default)(t,"content",this.state.replace);var o=ge.replaceWith.label,a=ge.replaceWith.description;return this._renderField(t,o,a)}},{key:"_renderFieldReplaceAll",value:function(){var e=this;if("replace_global_color"!==this.props.element.intent&&"global"!==this.state.colorPaletteMode){var t=(0,k.default)(ETBuilderBackend.findReplace.all,(function(t){return t.replace("%s",e._getSelectedFieldLabel())})),n={name:"all",type:"multiple_checkboxes",value:this.state.all,options:t,findReplaceModalReplaceAll:!0,_onChange:this._onChangeField},r=ge.replaceAll.label.replace("%s",this._getSelectedFieldLabel()),o=ge.replaceAll.description;return this._renderField(n,r,o)}this.setState({all:"on"})}},{key:"render",value:function(){var e=this.state.buttonState?i.default.createElement(A.default,{icon:this.state.buttonState,color:"#FFFFFF"}):ge.tooltip,t=[i.default.createElement(N.default,{block:!0,info:!0,ink:!1,disable:!1!==this.state.buttonState,tooltip:ge.tooltip,__onClick:this.state.buttonState?S.default:this._onFindReplace},e)],n=(0,X.getModalPreferredSnapSettings)().snapLocation,r=le(le({},this.props),{},{measurement:(0,X.getModalPreferredDimensions)(),disableFullscreenButton:!0,disableSnapButton:!0,disableResizeButton:!0}),o=(0,l.default)({"et-fb-modal__module-settings":!0,"et-fb-modal__find-replace":!0}),a="font_icon"===this._getHoveredElement("elementId");return i.default.createElement(F.default,ae({className:o,footerButtons:t,fullscreen:(0,X.getModalPreferredFullscreen)(),label:(0,u.decode)(ge.title),position:(0,X.getModalPreferredCoordinates)(),snapLocation:n,_closeFunction:this.state.buttonState?S.default:this._onClose,globalUpdate:!0},r),i.default.createElement(B.default,null,i.default.createElement(W.default,{selectedIndex:0},i.default.createElement(W.ETBuilderTabPanel,{className:"et-fb-tabs__panel--".concat(this.tabSlug),slug:this.tabSlug,selected:!0},i.default.createElement("div",{className:"et-fb-form"},this._renderSubHeader(),this._renderFieldFind(),this._renderFieldWithin(),this._renderFieldThroughout(),this._renderFieldReplace(),a?"":this._renderFieldReplaceAll())))))}}],n&&ue(t.prototype,n),r&&ue(t,r),Object.defineProperty(t,"prototype",{writable:!1}),ne}(i.default.PureComponent),ve=be;t.default=ve},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=ee(n(164)),a=Z(n(0)),i=ee(n(13)),l=n(93),u=ee(n(10)),s=ee(n(58)),c=ee(n(9)),d=ee(n(1)),f=ee(n(34)),p=ee(n(147)),h=ee(n(7)),m=ee(n(4)),y=ee(n(12)),g=ee(n(5)),b=ee(n(11)),v=ee(n(17)),_=ee(n(107)),w=ee(n(135)),O=ee(n(40)),k=ee(n(129)),S=ee(n(124)),C=ee(n(304)),E=ee(n(28)),P=ee(n(56)),T=ee(n(72)),M=ee(n(844)),j=ee(n(37)),x=ee(n(214)),D=ee(n(69)),N=ee(n(42)),L=ee(n(63)),R=ee(n(43)),A=ee(n(1484)),I=ee(n(281)),B=ee(n(781)),F=Z(n(782)),W=n(506),V=ee(n(22)),U=ee(n(6)),G=ee(n(14)),H=ee(n(800)),z=n(2),q=ee(n(18)),K=ee(n(39)),$=ee(n(1498)),Y=n(60),X=n(396),J=n(464);function Q(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(Q=function(e){return e?n:t})(e)}function Z(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=Q(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function ee(e){return e&&e.__esModule?e:{default:e}}function te(){return te=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:"";return"css"===t&&"custom_css"===n&&(0,T.default)(e,"custom_css_")?(0,x.default)(e,"custom_css_",""):e}},{key:"prependCustomCSSFieldName",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"css"!==t||"custom_css"!==n||(0,T.default)(e,"custom_css_")?e:"custom_css_".concat(e)}},{key:"getExtendTargetModules",value:function(){var e=this,t=U.default.getSectionsFlattened(),n=this.getSelectedModule("props.address"),r=(0,z.getModuleAddressSequence)(n),o=(0,s.default)(t,(function(t){return e.getModuleStructure(t.type)===e.state.throughout&&(0,h.default)(r,t.address)}));return t.filter((function(t){var n=(0,d.default)(t,"type",""),r=n.replace("_inner","");return"module"===e.state.to?e.getModuleStructure(r)===e.state.to:e.getModuleStructure(e.state.to)===e.getModuleStructure(r)&&("et_pb_column"!==n||"et_pb_specialty_section"!==(0,d.default)(t,"parent_slug")||!(0,s.default)((0,d.default)(t,"content",[]),(function(e){return"et_pb_row_inner"===e.type})))&&(r===e.state.to||t.is_module_child&&r===(0,d.default)(G.default.getModuleChildSlugs(),e.state.to))})).filter((function(t){return"page"===e.state.throughout||("post_content"===e.state.throughout?!t.attrs.theme_builder_area||t.attrs.theme_builder_area===e.state.throughout:["et_header_layout","et_footer_layout","et_body_layout"].includes(e.state.throughout)?t.attrs.theme_builder_area===e.state.throughout:(0,h.default)((0,z.getModuleAddressSequence)(t.address),(0,d.default)(o,"address")))})).filter((function(e){return!(0,z.isModuleLocked)(e,t)})).filter((function(n){return!(e.getSelectedModule("props.is_module_child",!1)&&!(0,g.default)(n.child_slug)&&!(0,g.default)((0,s.default)(t,{parent_address:n.address}))||!(0,g.default)(e.getSelectedModule("props.child_slug",""))&&n.is_module_child&&!(0,g.default)((0,s.default)(t,{address:n.parent_address})))})).filter((function(e){return e.address!==n}))}},{key:"getExtendTargetModulesFields",value:function(e,t){var n=this,r=this.getSelectedModule("props"),a=this.getSelectedModuleType(),i=o.default.getGlobalColorsInfo(r),l={},p=[];return(0,c.default)(t,(function(t){var o={},h=(0,d.default)(t,"type","");if(h===a)(0,c.default)(e,(function(e){if((0,f.default)(e,"name")){var a=n.prependCustomCSSFieldName(e.name,e.tab_slug,e.toggle_slug);o[a]=n.getExtendStylesValue(e,r,e,t);var u=n.getGlobalColorsData(a,o,i);(0,b.default)(u)||(l=u)}}));else{var m=n.getModuleFields({props:t});m=ae(ae(ae({},m),q.default.getHoverFieldsDefinition(m)),K.default.getStickyFieldsDefinition(m)),(0,c.default)(e,(function(e){var c={};if((0,f.default)(e,"name")){var p=n.convertCustomCSSFieldName(e.name,e.tab_slug,e.toggle_slug);if(pe.has("targetField",p,a,h))c=pe.get("targetField",p,a,h);else{if((0,f.default)(m,p))c=(0,d.default)(m,p);else{var y={moduleType:a,field:e};c=(0,s.default)(m,(function(e){var t=(0,u.default)({},{moduleType:h,field:e});return U.default.getModuleFieldsMapping(y,t)}))}pe.set(c,"targetField",e.name,a,h)}}if(!(0,g.default)(c)&&(0,f.default)(c,"name")){var v=n.prependCustomCSSFieldName(e.name,e.tab_slug,e.toggle_slug);o[v]=n.getExtendStylesValue(e,r,c,t);var _=n.getGlobalColorsData(v,o,i);(0,b.default)(_)||(l=_)}}))}(0,g.default)(o)||(o.global_colors_info=l,p.push((0,u.default)({},{targetModule:t,extendStylesData:o})))})),p}},{key:"getExtendStylesValue",value:function(e,t,n,r){var o=this.prependCustomCSSFieldName(e.name,e.tab_slug,e.toggle_slug),a=(0,d.default)(t,"attrs.".concat(o));if("font"!==(0,d.default)(e,"type")||"option"!==this.getSelectedSource())return a;var i=a.split("|"),l=(0,d.default)(n,"name"),u=(0,d.default)(r,"attrs.".concat(l),"||||||||").split("|"),s=(0,z.getFontFieldIndexes)(this.getSelectedField("subField","font"));return(0,c.default)(s,(function(e){u[e]=i[e]})),u.join("|")}},{key:"getSelectedSource",value:function(){return(0,d.default)(this.props,"source")}},{key:"getSelectedFamily",value:function(){var e=(0,d.default)(this.props,"element");return(0,d.default)(e,"payload.option_family","")}},{key:"getSelectedElement",value:function(e,t){var n=(0,d.default)(this.props,"element"),r=(0,d.default)(n,"payload.toggleGroupId",""),o=(0,d.default)(n,"payload.toggleId","");if("css"===r&&"custom_css"!==o){var a=(0,T.default)(n.elementId,"custom_css_")?(0,x.default)(n.elementId,"custom_css_",""):n.elementId;n.elementId=a}return(0,b.default)(e)?n:(0,d.default)(n,e,t)}},{key:"getSelectedModule",value:function(e,t){var n=(0,d.default)(this.props,"module");return(0,b.default)(e)?n:(0,d.default)(n,e,t)}},{key:"getSelectedModuleType",value:function(){return this.getSelectedModule("props.type")}},{key:"getSelectedModuleTitle",value:function(){var e=this.getSelectedModuleType();return pe.has("getSelectedModuleTitle",e)?pe.get("getSelectedModuleTitle",e):pe.set(U.default.getModuleTitle(e),"getSelectedModuleTitle",e)}},{key:"getSelectedModuleTitlePlural",value:function(){var e=this.getSelectedModuleType();return pe.has("getSelectedModuleTitlePlural",e)?pe.get("getSelectedModuleTitlePlural",e):pe.set(U.default.getModuleTitlePlural(e),"getSelectedModuleTitlePlural",e)}},{key:"getSelectedModuleStructure",value:function(){var e=this.getSelectedModuleType();return pe.has("getSelectedModuleStructure",e)?pe.get("getSelectedModuleStructure",e):pe.set(this.getModuleStructure(e),"getSelectedModuleStructure",e)}},{key:"getSelectedField",value:function(e,t){var n=this.getSelectedElement("elementId"),r=(0,z.getProcessedTabSlug)(this.getSelectedElement("payload.tabSlug")),o=this.getSelectedElement("payload.toggleId"),a=this.getSelectedModule(),i=(0,s.default)(this.getModuleFields(a),{name:n,tab_slug:r,toggle_slug:o}),l=(0,u.default)({},{name:n,type:this.getSelectedElement("payload.option_family"),label:this.getSelectedElement("payload.optionTitle"),subField:this.getSelectedElement("subElementId")},i);if(l.default_on_child&&(0,m.default)(l.default)&&2===l.default.length){var c=this.getSelectedModule("props.attrs.".concat(l.default[0]));l.default=c?(0,d.default)(l.default[1],c,""):""}return(0,b.default)(e)?l:(0,d.default)(l,e,t)}},{key:"getSelectedFieldValue",value:function(){return this.getFieldValue((0,d.default)(this.getSelectedField(),"name"),this.getSelectedField(),this.getSelectedModule("props"))}},{key:"getFieldValue",value:function(e,t,n){var r,o=n||this.getSelectedModule("props"),a=o.attrs||{};if(("content"===e||(0,d.default)(t,"is_fb_content",!1))&&(r=(0,d.default)(o,"content")),"custom_padding"===t.type&&"custom_padding"!==e){var i=(0,h.default)(["et_pb_row","et_pb_row_inner"],o.type),l=(0,z.isOn)((0,d.default)(o,"attrs.specialty")&&"et_pb_section"===(0,d.default)(o,"type"));if(i||l){var u=e.replace("padding_",""),s=(0,z.hasValue)(a["padding_".concat(u,"_last_edited")])?a["padding_".concat(u,"_last_edited")].split("|"):[],c=((0,d.default)(a,"padding_top_".concat(u),"")||"").trim(),f=((0,d.default)(a,"padding_right_".concat(u),"")||"").trim(),p=((0,d.default)(a,"padding_bottom_".concat(u),"")||"").trim(),m=((0,d.default)(a,"padding_left_".concat(u),"")||"").trim(),y=((0,d.default)(a,"padding_top_bottom_link_".concat(u),"")||"").trim(),g=((0,d.default)(a,"padding_left_right_link_".concat(u),"")||"").trim(),v="".concat(c,"|").concat(f,"|").concat(p,"|").concat(m,"|").concat(y,"|").concat(g);switch((0,b.default)(s[1])?"desktop":s[1]){case"phone":r=(0,d.default)(a,"padding_".concat(u,"_phone"),"");break;case"tablet":r=(0,d.default)(a,"padding_".concat(u,"_tablet"),"");break;default:r=v}}}if("center_map"===t.type&&(r="et_pb_map_pin"===o.type?JSON.stringify((0,k.default)(a,["pin_address","pin_address_lat","pin_address_lng","zoom_level"])):JSON.stringify((0,k.default)(a,["address_lat","address_lng","zoom_level"]))),"select_with_option_groups"===t.type&&(r=(0,d.default)((0,E.default)((0,d.default)(a,e,(0,d.default)(t,"default"))).split("|"),1,"none")),(0,d.default)(t,"mobile_options",!1)){var _=(0,d.default)(a,"".concat(e,"_last_edited"),"off|desktop").split("|");(0,z.isOn)((0,d.default)(_,0,"off"))&&"desktop"!==(0,d.default)(_,1,"desktop")&&(r=(0,d.default)(a,"".concat(e,"_").concat((0,d.default)(_,1))))}return(0,b.default)(r)&&(r=(0,d.default)(a,e,(0,d.default)(t,"default"))),r}},{key:"getGlobalColorsData",value:function(e,t,n){if(e.includes("_color")&&!(0,b.default)(t[e])){var r={};return(0,c.default)(n,(function(t,n){t.includes(e)&&(r[n]=(0,d.default)(r,n,[]),r[n].push(e))})),r}}},{key:"renderField",value:function(e,t,n){var r,o=this.getSelectedModule(),l=o.isModuleItem&&!(0,b.default)(o.parentModule.props.type)&&o.parentModule.props.type?"".concat(e.name,"_child"):e.name,s={slug:e.type,type:"field"},c=(0,u.default)({},e,{resetValue:!1,mobile_options:!1,disableReset:!0,uniqueKey:l,processedKey:l,animate:(0,d.default)(this.props,"options.animate",!1),fieldDefinition:e,matching:s}),f=(0,d.default)(c,"type","text"),p=f.replace("_","-"),m=(0,Y.isDynamicContent)(c.value),y=(0,g.default)(n),v=(0,i.default)((fe(r={},"et-fb-form__group--".concat(this.slug),!0),fe(r,"et-fb-form__group--".concat(p),!0),fe(r,"et-fb-form__group--readonly",c.readonly),r)),_=(0,i.default)(fe({"et-fb-settings-options":!0,"et-fb-option--depends-on":!(0,b.default)(e.depends_default)||!(0,b.default)(e.depends_show_if)||!(0,b.default)(e.depends_show_if_not),"et-fb-option--select-with-option-groups":"select_with_option_groups"===f&&e.groups},"et-fb-option--".concat(p),!0)),w=(0,i.default)(fe({"et-fb-option-container":!0},"et-fb-option-container--".concat(p),!0)),k=(0,a.createElement)(A.default.getControl(f),c);return a.default.createElement(W.ETBuilderFormGroup,{className:v,name:l,key:"".concat(this.slug,"-form-group-").concat(l),onMouseEnterGroup:y?O.default:this.onMouseEnterGroup,onMouseLeaveGroup:y?O.default:this.onMouseLeaveGroup,hovered:this.isOptionHovered(c.name)},a.default.createElement(W.ETBuilderFormLabel,{name:l,hoveredGroup:this.state.hoveredGroup===l,activeHelp:this.state.activeDescription===l,onClickHelp:this._onClickHelp},t),a.default.createElement(W.ETBuilderFormDescription,{active:this.state.activeDescription===l},n),a.default.createElement("div",{className:_},a.default.createElement("div",{className:w},a.default.createElement(I.default,{componentName:l},m&&(0,h.default)($.default.supportedFieldTypes,f)?a.default.createElement($.default,{type:c.dynamic_content||f,fieldName:c.name,fieldType:f,value:c.value,dynamicAttributes:[c.name],previewMode:"background",showSettingsButton:!1,showDisableButton:!1,onChange:c._onChange},k):k))))}},{key:"renderFieldSource",value:function(){var e=this;if("module"===this.getSelectedSource()){var t=this.getSelectedModuleTitle(),n=this.getSelectedModuleTitlePlural(),r=(0,z.sprintf)(he.labels.extend_module,t,n);return a.default.createElement(W.ETBuilderFormGroup,null,a.default.createElement(W.ETBuilderFormLabel,null,(0,l.decode)(r)))}if("options_group"===this.getSelectedSource()){var o=this.getSelectedElement("payload.toggleTitle"),i=he.labels.extend_options_group.replace(/%s/g,o);return a.default.createElement(W.ETBuilderFormGroup,null,a.default.createElement(W.ETBuilderFormLabel,null,(0,l.decode)(i)))}if("background-gradient"===this.getSelectedFamily()){var s=this.getSelectedElement("payload.optionTitle"),f=he.labels.extend_options_group.replace(/%s/g,s);return a.default.createElement(W.ETBuilderFormGroup,null,a.default.createElement(W.ETBuilderFormLabel,null,(0,l.decode)(f)))}var _=this.getSelectedModule(),w=this.getSelectedElement("payload.option"),k=this.getSelectedField(),S=(0,h.default)(["composite"],(0,d.default)(k,"type"));if(!(0,g.default)(k)&&!S){var C=(0,u.default)({},k,{value:this.getSelectedFieldValue()}),E=this.getSelectedElement("payload.optionTitle"),M=function t(n){(0,P.default)(n,"module",e),(0,P.default)(n,"readonly",!0),(0,P.default)(n,"visible",!0),(0,P.default)(n,"_onChange",O.default);var r=(0,d.default)(n,"name"),o=(0,d.default)(n,"type");if("transform"===o&&(n.transform_type="".concat(n.name).replace("transform_","")),(0,T.default)(o,"background-")){(0,P.default)(n,"type","background"),(0,P.default)(n,"activeTab",o.replace("background-","")),(0,P.default)(n,"isDescriptionVisible",(function(){return!1})),(0,P.default)(n,"isHoveredGroup",(function(){return!1})),(0,P.default)(n,"onMouseEnterGroup",O.default),(0,P.default)(n,"onMouseLeaveGroup",O.default);var a={};(0,c.default)(e.getModuleFields(_),(function(e){(0,h.default)(w,e.name)&&(a[e.name]=(0,u.default)({},t(e)))})),(0,P.default)(n,"backgroundFields",a)}if("font"===o){var i=(0,d.default)(n,"group_label",""),l=(0,d.default)(n,"value","||||||||").split("|"),s={font:(0,d.default)(l,0,""),weight:(0,d.default)(l,1,""),italic:(0,d.default)(l,2,""),uppercase:(0,d.default)(l,3,""),underline:(0,d.default)(l,4,""),capitalize:(0,d.default)(l,5,""),strikethrough:(0,d.default)(l,6,""),line_style:(0,d.default)(l,7,""),line_color:(0,d.default)(l,8,"")},f=(0,z.isOn)((0,d.default)(s,"underline"));switch(n.subField){case"weight":(0,P.default)(n,"label",me.fontWeight);break;case"style":(0,P.default)(n,"label",me.fontStyle);break;case"line_color":var k=f?me.underline:me.strikethrough,S=me.color;(0,P.default)(n,"label","".concat(k," ").concat(S));break;case"line_style":var C=f?me.underline:me.strikethrough,E=me.style;(0,P.default)(n,"label","".concat(C," ").concat(E));break;default:(0,P.default)(n,"label",(0,d.default)(me,n.subField,""))}(0,g.default)(i)||(0,P.default)(n,"label","".concat(i," ").concat(n.label)),(0,P.default)(n,"subFieldLabel",!1)}if((0,T.default)(o,"color")&&((0,P.default)(n,"hideColorManagerLinks",!0),(0,P.default)(n,"hideHarmoniousPalette",!0),(0,P.default)(n,"hideCurrentColorWrapper",!0),(0,P.default)(n,"hideColorResetButton",!0),(0,P.default)(n,"showCustomInput",!0),(0,P.default)(n,"hasPreview",!1)),"select_with_option_groups"===o&&((0,P.default)(n,"hideAddButton",!0),(0,P.default)(n,"hideRemoveButton",!0),(0,P.default)(n,"hideFetchButton",!0)),"center_map"===o&&((0,P.default)(n,"disableAction",!0),(0,P.default)(n,"hideUpdateButton",!0)),"conditional_logic"===o&&((0,P.default)(n,"hideAddButton",!0),(0,P.default)(n,"hideDeleteButton",!0)),"categories"===o&&((0,P.default)(n,"categories_list",{}),(0,g.default)(n.taxonomy_name)&&(0,P.default)(n,"taxonomy_name","category")),"select-pattern"!==o&&"select-mask"!==o||(0,P.default)(n,"isExtendStylesModal",!0),"select"===o&&(0,b.default)(n.default)&&!(0,g.default)(n.options)){var M=(0,m.default)(n.options)?[]:{};(0,c.default)(n.options,(function(e,t){(0,y.default)(e)||(0,m.default)(e)?(0,c.default)(e,(function(e,t){M[t]=e})):M[t]=e})),(0,g.default)(M)||(0,P.default)(n,"default",(0,m.default)(M)?(0,p.default)(M):(0,p.default)((0,v.default)(M)))}return"custom_css_free_form"===r&&(0,P.default)(n,"inline",!1),n}(C),j=(0,l.decode)(he.labels.extend_option.replace(/%s/g,(0,d.default)(M,"label",E)));return this.renderField(M,j)}var x=this.getSelectedElement("payload.optionTitle"),D=he.labels.extend_option.replace(/%s/g,x);return a.default.createElement(W.ETBuilderFormGroup,null,a.default.createElement(W.ETBuilderFormLabel,null,(0,l.decode)(D)))}},{key:"renderFieldTo",value:function(){if("module"===this.getSelectedSource())return!1;var e,t,n,r=(e=this.getSelectedModuleStructure(),t=(0,_.default)((0,S.default)((0,u.default)({},U.default.getModules()),(function(e){return e.is_official_module&&((0,z.isOn)(e.is_parent)||(0,h.default)(["et_pb_column","et_pb_column_inner"],e.label))})),(function(e,t){var n=U.default.getModuleTitlePlural(t);return he.labels.all.replace("%s",(0,g.default)(n)?e.title:n)})),n=(0,_.default)((0,u.default)({},he.options.to),(function(e,n){return"containers"===n?(0,k.default)(t,["et_pb_section","et_pb_row","et_pb_column","et_pb_column_inner"]):(0,u.default)({},e,(0,w.default)(t,["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"]))})),(0,S.default)(n,(function(t,n){return("module"!==e||"containers"!==n)&&t})));return this.renderField({options:r,type:"select",name:"to",default:this.state.to,value:this.state.to,optionGroups:he.groups.to,searchable:!0,_onChange:this.onChangeField},he.labels.to)}},{key:"renderFieldThroughout",value:function(){var e=this.getAvailableThroughoutOptions(),t=(0,v.default)(e),n=this.getSelectedModule("props.parent_slug"),r=this.getSelectedModuleType(),o=this.getModuleStructure(r),a=this.getModuleStructure(this.state.to),i="module"===o?t:(0,M.default)(t,t.indexOf(o)),l=("module"===a?t:(0,C.default)(t,t.indexOf(a))).filter((function(e){return"module"===o?"et_pb_section"===n||-1!==n.indexOf("fullwidth")?!(0,h.default)(["row","column"],e):"et_pb_specialty_column"!==n||!(0,h.default)(["row"],e):!(0,h.default)(i,e)||e===o})),u={options:(0,k.default)(e,l),type:"select",name:"throughout",default:this.state.throughout,value:this.state.throughout,_onChange:this.onChangeField};return this.renderField(u,he.labels.throughout)}},{key:"render",value:function(){var e,t,n=this.state.buttonState?a.default.createElement(R.default,{icon:this.state.buttonState,color:"#FFFFFF"}):he.button,r=[a.default.createElement(L.default,{block:!0,info:!0,ink:!1,tooltip:he.button,disable:!1!==this.state.buttonState,__onClick:this.state.buttonState?O.default:this.onExtendStyles},n)],o=(0,X.getModalPreferredSnapSettings)().snapLocation,u=ae(ae({},this.props),{},{measurement:(0,X.getModalPreferredDimensions)(),disableFullscreenButton:!0,disableSnapButton:!0,disableResizeButton:!0}),s=(0,i.default)((fe(e={"et-fb-modal__module-settings":!0},"et-fb-modal__".concat(this.slug),!0),fe(e,"et-fb-modal__".concat(this.slug,"--").concat(this.getSelectedSource()),!0),e)),c=(0,i.default)((fe(t={"et-fb-tabs__panel":!0},"et-fb-tabs__panel--".concat(this.slug),!0),fe(t,"et-fb-tabs__panel--".concat(this.slug,"--").concat(this.getSelectedSource()),!0),t)),d=(0,i.default)(fe({"et-fb-form":!0},"et-fb-form--".concat(this.getSelectedSource()),!0));return a.default.createElement(B.default,te({className:s,footerButtons:r,fullscreen:(0,X.getModalPreferredFullscreen)(),label:(0,l.decode)(he.title),position:(0,X.getModalPreferredCoordinates)(),snapLocation:o,_closeFunction:this.state.buttonState?O.default:this.onClose,globalUpdate:!0},u),a.default.createElement(I.default,null,a.default.createElement(F.default,{selectedIndex:0},a.default.createElement(F.ETBuilderTabPanel,{className:c,slug:this.slug,selected:!0},a.default.createElement("div",{className:d},a.default.createElement("div",{className:"et-fb-form--inner"},this.renderFieldSource(),this.renderFieldTo(),this.renderFieldThroughout()))))))}}],n&&ie(t.prototype,n),r&&ie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),Q}(a.default.PureComponent),ge=ye;t.default=ge},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=W(n(0)),a=B(n(3)),i=B(n(13)),l=B(n(10)),u=B(n(41)),s=B(n(9)),c=B(n(1)),d=B(n(34)),f=B(n(5)),p=B(n(42)),h=B(n(11)),m=B(n(31)),y=B(n(129)),g=B(n(84)),b=B(n(22)),v=B(n(63)),_=B(n(198)),w=B(n(59)),O=B(n(457)),k=B(n(616)),S=B(n(218)),C=B(n(281)),E=B(n(43)),P=B(n(1878)),T=B(n(1879)),M=B(n(619)),j=B(n(781)),x=B(n(6)),D=W(n(782)),N=B(n(401)),L=W(n(2)),R=B(n(1563)),A=n(94),I=n(509);function B(e){return e&&e.__esModule?e:{default:e}}function F(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(F=function(e){return e?n:t})(e)}function W(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=F(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;t .et-fb-layers-view",connectWith:!1,child:".et_pb_section",childSlug:"section",handle:"> .et_fb_move_module_handler",update:n.dragUpdate,root:!o,placeholderHeight:"4px",wireframeMode:!1,layersView:!0,startingAddress:n.getStartingAddress()};setTimeout((function(){(0,N.default)(t,a)}),150)})),X($(n),"dragUpdate",(function(t,r){var o=e($(n)),a=ETBuilderBackend.i18n.sortable;x.default.abIsMode("on",n.state.activeThemeBuilderArea)||x.default.isAllowedAction("ab_testing")||(alert(a.has_no_ab_permission),o.sortable("cancel"),r.sender&&e(r.sender).sortable("cancel"),b.default.cancelDraggingModule())})),X($(n),"filterInput",(0,u.default)((function(e,t){n.isComponentMounted&&n.setState({filterValue:t},(function(){setTimeout((function(){b.default.setLayersViewFilterSearch(n.state.filterSelected,t)}),0)}))}),300)),X($(n),"renderABTestingStyle",(function(){if(!x.default.abIsMode("selecting",n.state.activeThemeBuilderArea))return null;var e=[],t=x.default.abGetMode(n.state.activeThemeBuilderArea).replace("_","-"),r=[".et-fb-modal__layers-view .et-fb-editable-element",".et-fb-modal__layers-view .et_pb_section > .et_fb_move_module_handler > .et-fb-layers-view--content",".et-fb-modal__layers-view .et_pb_row > .et_fb_move_module_handler > .et-fb-layers-view--content",".et-fb-modal__layers-view .et_pb_module > .et_fb_move_module_handler > .et-fb-layers-view--content"];e.push([{selector:r.join(", "),declaration:"cursor: url(".concat(ETBuilderBackend.images_uri,"/cursor-").concat(t,".png), default !important;")}]),e.push([{selector:(0,m.default)(r,(function(e){return".ie ".concat(e,", .edge ").concat(e)})).join(", "),declaration:"cursor: url(".concat(ETBuilderBackend.images_uri,"/cursor-").concat(t,".cur), default !important;")}]),e.push([{selector:(0,m.default)(r,(function(e){return".chrome ".concat(e,", .gecko ").concat(e)})).join(", "),declaration:"cursor: url(".concat(ETBuilderBackend.images_uri,"/cursor-").concat(t,".png) 16 16, default !important; /* Chrome/Firefox cursor hotspot fix, Ignored by IE */;")}]);return e.push([{selector:[".et-fb-modal__layers-view .et-fb-editable-element",".et-fb-modal__layers-view .et-fb-layers-view--actions-group",".et-fb-modal__layers-view .et-fb-layers-view--add",".et-fb-modal__layers-view .et_pb_column > .et_fb_move_module_handler > .et-fb-layers-view--content"].join(", "),declaration:"pointer-events: none;"}]),o.default.createElement(S.default,{key:"css-lv-ab-testing",additional_css:e,module_class:"body"})}));return n.containerRef=o.default.createRef(),n.slug="layers-view",n.searchFilters=n.getSearchFilters(),n.state={index:null,filterDropdownActive:!1,filterSelected:void 0,filterValue:"",activeThemeBuilderArea:x.default.getActiveThemeBuilderArea()},n.defaultModalHeight=444,n.defaultModalWidth=300,n.isComponentMounted=!1,n.scrollTimeout=100,setTimeout((function(){return b.default.setLayersViewContextMenuCallback(t.contextMenuCallback)}),0),n.forceUpdateLayers=n.forceUpdateLayers.bind($(n)),n.filterSelect=n.filterSelect.bind($(n)),n.filterDropdownToggle=n.filterDropdownToggle.bind($(n)),n.filterReset=n.filterReset.bind($(n)),n.filterResetAll=n.filterResetAll.bind($(n)),n.maybeCloseDropdown=n.maybeCloseDropdown.bind($(n)),n.maybeShowFilterNotice=n.maybeShowFilterNotice.bind($(n)),n.maybeRenderFilterNotice=n.maybeRenderFilterNotice.bind($(n)),n.setSearchFocus=n.setSearchFocus.bind($(n)),n.activeLayerChange=n.activeLayerChange.bind($(n)),n.sectionsContentChange=n.sectionsContentChange.bind($(n)),n.renderLayers=n.renderLayers.bind($(n)),n.renderToggleAll=n.renderToggleAll.bind($(n)),n.handleShortcuts=n.handleShortcuts.bind($(n)),n.handleToggleAll=n.handleToggleAll.bind($(n)),n.updateModalState=n.updateModalState.bind($(n)),n}return n=F,r=[{key:"componentDidMount",value:function(){this.isComponentMounted=!0,this.debouncedSectionsContentChangee=(0,u.default)(this.sectionsContentChange,100),x.default.addSectionsContentChangeListener(this.debouncedSectionsContentChangee),x.default.addThemeBuilderAreaChangeEventListener(this.forceUpdateLayers),M.default.addActiveLayerChangeListener(this.activeLayerChange),M.default.addLayerDataChangeListener(this.forceUpdateLayers),x.default.isProductTourActive()||this.initSortable();var e=M.default.getActiveLayer();(0,A.isOn)((0,c.default)(e,"props.scrollToLayerOnModal"))&&setTimeout((function(){return(0,I.scrollToLayerOnModal)(e)}),this.scrollTimeout),e||this.setSearchFocus(),x.default.getActiveModule()?(L.default.appWindow().removeEventListener("keydown",this.handleShortcuts),L.default.topWindow().removeEventListener("keydown",this.handleShortcuts)):(L.default.appWindow().addEventListener("keydown",this.handleShortcuts),L.default.topWindow().addEventListener("keydown",this.handleShortcuts,{useCapture:!0})),L.default.topDocument().addEventListener("keydown",this.handleShortcuts),L.default.topWindow().addEventListener("mousedown",this.maybeCloseDropdown)}},{key:"shouldComponentUpdate",value:function(e,t){var n=(0,y.default)(e,Q),r=(0,y.default)(this.props,Q),o=(0,y.default)(t,Z),a=(0,y.default)(this.state,Z);return!(0,p.default)(n,r)||!(0,p.default)(o,a)}},{key:"componentDidUpdate",value:function(e,t){var n=this.props.editEnabled,r=M.default.getActiveLayer(),o=M.default.isFilterActive();x.default.isProductTourActive()||this.initSortable();var a=!(o||(0,p.default)(t.filterValue,this.state.filterValue)&&(0,p.default)(t.filterSelected,this.state.filterSelected));!r&&a&&this.setSearchFocus();var i=x.default.isSettingsModalOpen("settings_modal"),l=!(0,f.default)(n)&&!(0,p.default)(e.editEnabled,n),u=(0,c.default)(n,"props.address")!==(0,c.default)(r,"props.address");i&&l&&u&&(setTimeout((function(){return b.default.setActiveLayer(n)}),0),setTimeout((function(){return(0,I.scrollToLayerOnModal)(n)}),this.scrollTimeout)),this.maybeShowFilterNotice(),(0,p.default)(e.multiSelectLastSelection,this.props.multiSelectLastSelection)||this.debouncedSectionsContentChangee()}},{key:"componentWillUnmount",value:function(){this.isComponentMounted=!1,x.default.removeSectionsContentChangeListener(this.debouncedSectionsContentChangee),M.default.removeActiveLayerChangeListener(this.activeLayerChange),M.default.removeLayerDataChangeListener(this.forceUpdateLayers),L.default.appWindow().removeEventListener("keydown",this.handleShortcuts),L.default.topDocument().removeEventListener("keydown",this.handleShortcuts),L.default.topWindow().removeEventListener("keydown",this.handleShortcuts),L.default.topWindow().removeEventListener("mousedown",this.maybeCloseDropdown),setTimeout((function(){return b.default.clearLayerData()}),0)}},{key:"getSearchFilters",value:function(){var e=ETBuilderBackend.i18n.modals.layersView.searchFilterItems,t={};return(0,s.default)(e,(function(e,n){(0,h.default)(t[n])&&(t[n]={}),(0,s.default)(e,(function(e,r){t[n][r]=e}))})),(0,s.default)(ETBuilderBackend.modules,(function(e){var n=(0,L.getComponentType)({type:(0,c.default)(e,"label")});if((0,A.isOn)(e.is_parent)&&(0,A.isOn)(e.vb_support)&&(0,d.default)(e,"title")&&(0,d.default)(e,"label")&&"module"===n){var r=e.label.replace("et_pb_","");t.show_only[r.replace(/_/g,"-")]=e.plural?e.plural:e.title}})),t}},{key:"setSearchFocus",value:function(){var e=this;setTimeout((function(){var t=L.default.$topWindow(".et-fb-modal__".concat(e.slug)).find(".et-fb-options-filter input");t.length&&t.trigger("focus")}),100)}},{key:"sectionsContentChange",value:function(){this.isComponentMounted&&(b.default.resetLayerData(),M.default.isFilterActive()&&b.default.setLayersViewFilterSearch(this.state.filterSelected,this.state.filterValue),this.forceUpdate())}},{key:"activeLayerChange",value:function(e,t){if(this.isComponentMounted){var n=M.default.isFilterActive(),r=!(0,f.default)(e)&&(0,A.isOn)((0,c.default)(e,"props.scrollToLayerOnModal"));n&&r&&!(0,p.default)(t,e)&&this.filterResetAll(),r&&setTimeout((function(){return(0,I.scrollToLayerOnModal)(e)}),this.scrollTimeout)}}},{key:"forceUpdateLayers",value:function(){this.isComponentMounted&&this.forceUpdate()}},{key:"filterSelect",value:function(e){var t=this;this.setState({filterDropdownActive:!1,filterSelected:e},(function(){setTimeout((function(){b.default.setLayersViewFilterSearch(e,t.state.filterValue)}),0)}))}},{key:"filterDropdownToggle",value:function(){this.setState({filterDropdownActive:!this.state.filterDropdownActive})}},{key:"filterReset",value:function(){this.setState({filterDropdownActive:!1,filterSelected:void 0}),b.default.setLayersViewFilterSearch(void 0,this.state.filterValue)}},{key:"filterResetAll",value:function(){this.setState({filterDropdownActive:!1,filterSelected:void 0,filterValue:""}),b.default.setLayersViewFilterSearch(void 0,"")}},{key:"maybeCloseDropdown",value:function(t){this.state.filterDropdownActive&&e(t.target).closest(".et-fb-options-filter-dropdown-wrap, .et-fb-options-filter-button-group").length<1&&this.filterDropdownToggle()}},{key:"maybeShowFilterNotice",value:function(){var e=M.default.isFilterActive();M.default.isEmptyFilterResults()||(e=!1),e!==this.state.filterNotice&&this.setState({filterNotice:e})}},{key:"maybeRenderFilterNotice",value:function(){if(!this.state.filterNotice||this.state.filterDropdownActive)return!1;var e=J.filterNoticeClickable,t=J.filterNotice.split(e);return 2===t.length?o.default.createElement("div",{className:"et-fb-options-filter-notice"},o.default.createElement("span",null,t[0]),o.default.createElement(v.default,{className:"et-fb-filter-notice-button",ink:!1,onMouseDown:this.filterResetAll,onMouseUp:this.filterResetAll},e),o.default.createElement("span",null,t[1])):o.default.createElement("div",{className:"et-fb-options-filter-notice"},o.default.createElement(v.default,{className:"et-fb-filter-notice-button",ink:!1,onMouseDown:this.filterResetAll,onMouseUp:this.filterResetAll},J.filterNotice))}},{key:"handleShortcuts",value:function(e){var t=e.metaKey,n=e.altKey,r=e.ctrlKey,o=27===e.keyCode,a=e.shiftKey,i=32===e.keyCode,l=M.default.isFilterActive(),u=L.default.$topWindow(".et-fb-modal__".concat(this.slug)).find(".et-fb-options-filter input"),s=u.length>0&&u.is(":focus");return s&&a&&i?(e.preventDefault(),!1):o&&s&&l?(e.stopImmediatePropagation(),this.filterResetAll(),!1):(!s||t||n||r||o||e.stopPropagation(),o&&l&&!x.default.isSettingsModalOpen("settings_modal")?(e.stopImmediatePropagation(),this.filterResetAll(),!1):void 0)}},{key:"handleToggleAll",value:function(){var e=!M.default.isAllExpanded(),t=L.default.$topWindow(".et-fb-layers-view--toggle-all"),n=L.default.$topWindow(".et-fb-layers-view");b.default.toggleAllLayers(e),t.toggleClass("et-fb-layers-view--toggle-all-expanded",e),n.find(".et_pb_section").toggleClass("et-fb-layers-view--expanded",e),n.find(".et_pb_section").find(".et-fb-layers-view--layer:not(.et_pb_row_inner)").toggleClass("et-fb-layers-view--hidden",!e)}},{key:"updateModalState",value:function(e){b.default.updateLayersViewModalState({measurement:{height:e.height,width:e.width},position:{x:e.x,y:e.y}})}},{key:"renderToggleAll",value:function(){var e=M.default.isFilterActive(),t=x.default.isEditingLibraryItem("section"),n=x.default.isEditingLibraryItem("row"),r=x.default.isEditingLibraryItem("module");if(e||t||n||r)return!1;var a=(0,i.default)({"et-fb-button-group":!0,"et-fb-layers-view--toggle-all":!0,"et-fb-layers-view--toggle-all-expanded":M.default.isAllExpanded()}),l=L.default.condition("is_rtl")&&!L.default.condition("is_no_rtl")?"caret-left":"caret-right",u={margin:"-5px -4px",opacity:.5};return o.default.createElement("div",{className:a},o.default.createElement(R.default,{singleClick:this.handleToggleAll},o.default.createElement("button",{className:"et-fb-button"},o.default.createElement(E.default,{color:g.default.inactiveGrey,icon:"caret-down",size:"14",style:u}),o.default.createElement(E.default,{color:g.default.inactiveGrey,icon:l,size:"14",style:u}),o.default.createElement("div",{className:"et-fb-layers-view--toggle-all-label"},J.toggleAll))))}},{key:"renderChildLayers",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=(0,I.hasChildLayers)(e)?e.content:[];if((0,f.default)(a)&&((0,L.is)("section",e)||(0,L.is)("column",e))){var i=M.default.getLayerProps(e.address);if((0,c.default)(e.attrs,"_deleted")||(0,f.default)(i))return null;var l=i.isLayerVisible&&i.isLayerExpanded||i.isLayerVisible&&i.isColumnSpecialty;return l?o.default.createElement(P.default,G({key:"lv-layer-add-button-".concat(i.address)},i)):null}return a.map((function(a,i){var l=M.default.getLayerProps(a.address);if((0,c.default)(e.attrs,"_deleted")||(0,f.default)(l))return null;var u=(0,I.isLayerGlobal)(U(U({},e),{},{globalParent:n})),s=(0,I.isLayerLocked)(U(U({},e),{},{lockedParent:r})),d=t.renderCounter>t.renderBreakpoint;return t.renderCounter++,o.default.createElement(T.default,G({key:"lv-layer-".concat(l.address),index:i,globalParent:u,lockedParent:s,isDelayRender:d},l),t.renderChildLayers(a,u,s))}))}},{key:"renderLayers",value:function(){var e=this,t=M.default.isFilterActive();if(t&&M.default.isEmptyFilterResults())return null;this.renderCounter=0;var n=this.getLayersData(),r=(0,i.default)({"et-fb-layers-view":!0,"et-fb-layers-view--results":t});return o.default.createElement("div",{id:"et-fb-layers-view-container",ref:this.containerRef},o.default.createElement("div",{className:r},n.map((function(t,n){var r=M.default.getLayerProps(t.address);if((0,c.default)(t.attrs,"_deleted")||(0,f.default)(r))return null;var a=e.renderCounter>e.renderBreakpoint;return e.renderCounter++,o.default.createElement(T.default,G({key:"lv-layer-".concat(r.address),index:n,globalParent:!1,lockedParent:!1,isDelayRender:a},r),e.renderChildLayers(t,!1,!1))}))))}},{key:"render",value:function(){var e,t=this.state,n=t.filterValue,r=t.filterSelected,a=t.filterDropdownActive,u=t.filterNotice,s=M.default.isFilterActive(),p=this.searchFilters,h=(0,d.default)(p.show_only,r)?p.show_only[r]:r,m=(0,f.default)(r)?o.default.createElement(_.default,{className:"et-fb-options-filter-button-group"},o.default.createElement(v.default,{_onClick:this.filterDropdownToggle},o.default.createElement(E.default,{icon:"add",color:s?g.default.white:g.default.shuttleGrey,size:"14"})),o.default.createElement(v.default,{_onClick:this.filterDropdownToggle},ETBuilderBackend.i18n.modals.filter)):o.default.createElement(_.default,{className:"et-fb-options-filter-button-group"},o.default.createElement(v.default,{_onClick:this.filterDropdownToggle},h),o.default.createElement(v.default,{_onClick:this.filterReset},o.default.createElement(E.default,{icon:"exit",color:s?g.default.white:g.default.shuttleGrey,size:"10"}))),y=!!a&&o.default.createElement("div",{className:"et-fb-options-filter-dropdown-wrap"},o.default.createElement(k.default,{value:r,name:"layers-filter",options:p,optionGroups:{show_only:ETBuilderBackend.i18n.modals.show_only},_onClick:this.filterDropdownToggle,__onChange:this.filterSelect,activeOnLoad:!0,focusOnSearchOnLoad:!0,searchable:!0})),b=o.default.createElement("div",{className:(0,i.default)({"et-fb-options-filter":!0,"et-fb-options-filter--has-dropdown":!(0,f.default)(p)})},o.default.createElement("div",{className:"et-fb-options-filter-input-wrap"},o.default.createElement(O.default,{type:"text",value:n,name:"filterValue",_onChange:this.filterInput,additional_attrs:{placeholder:J.searchLayers,"data-shortcuts-allowed":""}})),!(0,f.default)(p)&&o.default.createElement("div",{className:"et-fb-options-filter-button-wrap"},m),y,this.maybeRenderFilterNotice()),S=(0,i.default)((X(e={"et-fb-modal__module-settings":!0},"et-fb-modal__".concat(this.slug),!0),X(e,"et-fb-modal__filter-active",!0),X(e,"et-fb-modal__filter-none",!s),e)),P=(0,i.default)({"et-fb-tabs__panel--filter-active":!0,"et-fb-tabs__panel--filter-none":!s,"et-fb-tabs__panel--filter-dropdown":!(0,f.default)(p),"et-fb-tabs__panel--filter-selected":!(0,f.default)(r),"et-fb-tabs__panel--filter-notice":u}),T=M.default.getModalState(),x=(0,l.default)({},this.props,{adjustHeightOffset:!0,className:S,forceUpdateSpecificModal:!0,headerButtons:[o.default.createElement(v.default,{key:"modal-close-button",buttonName:w.default.LAYERS_VIEW_MODAL_CLOSE,tooltip:ETBuilderBackend.i18n.tooltip.modal.close,primary:!0},o.default.createElement(E.default,{icon:"close",color:"#FFFFFF"}))],label:J.title,measurement:{height:(0,c.default)(T,"measurement.height",this.defaultModalHeight),width:(0,c.default)(T,"measurement.width",this.defaultModalWidth)},modalMinimalWidth:300,position:{x:(0,c.default)(T,"position.x",this.props.position.x),y:(0,c.default)(T,"position.y",this.props.position.y)},updateSpecificModal:this.updateModalState});return o.default.createElement(j.default,x,o.default.createElement(C.default,null,o.default.createElement(D.default,{selectedIndex:0},o.default.createElement(D.ETBuilderTabList,null,o.default.createElement(D.ETBuilderTabItem,null,J.title)),o.default.createElement(D.ETBuilderTabPanel,{slug:this.slug,className:P,selected:!0},b,this.renderToggleAll(),this.renderLayers())),this.renderABTestingStyle()))}}],r&&H(n.prototype,r),a&&H(n,a),Object.defineProperty(n,"prototype",{writable:!1}),F}(o.Component);X(ee,"propTypes",{contextMenuCallback:a.default.func}),X(ee,"defaultProps",{});var te=ee;t.default=te}).call(this,n(8))},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=Y(n(0)),a=n(67),i=K(n(13)),l=K(n(10)),u=K(n(40)),s=K(n(1)),c=K(n(5)),d=K(n(37)),f=K(n(9)),p=K(n(28)),h=K(n(42)),m=K(n(58)),y=K(n(12)),g=K(n(4)),b=K(n(462)),v=K(n(215)),_=K(n(184)),w=K(n(35)),O=K(n(65)),k=K(n(7)),S=K(n(304)),C=K(n(126)),E=K(n(17)),P=K(n(129)),T=K(n(11)),M=K(n(146)),j=K(n(34)),x=K(n(124)),D=K(n(359)),N=K(n(56)),L=K(n(72)),R=(K(n(88)),K(n(63))),A=K(n(43)),I=K(n(303)),B=K(n(1484)),F=n(506),W=K(n(281)),V=K(n(781)),U=Y(n(782)),G=K(n(22)),H=K(n(6)),z=K(n(824)),q=Y(n(2));function K(e){return e&&e.__esModule?e:{default:e}}function $(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return($=function(e){return e?n:t})(e)}function Y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=$(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function X(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&"module"===(0,s.default)(this,"state.pointerItem.group","")&&!(0,L.default)(o,"et_pb_fullwidth_"))return void this.setState({placeholder:{parentRow:r.data("row-address"),columnIndex:r.data("zone-index")}})}var a=this.getPlaceholderData();this.isPlaceholderDataChanged(a)&&e.when(this.removePlaceholder()).then((function(){(0,c.default)(a)?n.setState({placeholder:a}):e.when(n.addPlaceholder(a)).then((function(){var t=e("#".concat(n.placeholderId));n.setState({placeholder:(0,l.default)({},a,{buttonPosition:Z(Z({},t.offset()),{},{element:t})})})}))}))}}},{key:"addPlaceholder",value:function(t){var n,r=t.target||!1,o=t.isNoChild||!1,a=t.isAddBefore||!1;if(r&&r.length){var l=this.state.pointerItem,u=l.group,c=l.slug,d=(0,s.default)(this.props,"previewMode","desktop"),f=(0,i.default)((ee(n={"et-fb-quick-actions-placeholder":!0,"et-fb-quick-actions-placeholder--no-child":o,"et-fb-quick-actions-placeholder--first-child":a},"et-fb-quick-actions-placeholder--".concat(u),!0),ee(n,"et-fb-quick-actions-placeholder--".concat(u,"-fullwidth"),"fullwidth"===c.replace("et_fb_","")),ee(n,"et-fb-quick-actions-placeholder--".concat(u,"-specialty"),"specialty"===c.replace("et_fb_","")),ee(n,"et-fb-quick-actions-placeholder--".concat(u,"-regular"),"regular"===c.replace("et_fb_","")||"section"===c.replace("et_pb_","")),n)),p={opacity:"wireframe"===d?1:0,height:"wireframe"===d?"40px":"0px"},h={opacity:1,height:"20px"},m=e('
')).css(p);e.when(void(o?r.find(".et-fb-add-wrap").first().append(m):"wireframe"===d?a?r.prepend(m):r.append(m):a?r.before(m):r.after(m))).then((function(){"wireframe"!==d&&m.animate(h,500,"easeOutCubic")}))}}},{key:"removePlaceholder",value:function(){e("#".concat(this.placeholderId)).remove()}},{key:"handleDataUpdated",value:function(){this.data=q.default.intentionallyClone(z.default.getData());var e={reRender:!this.state.reRender};(0,c.default)(this.state.parentSelected)||(e.parentSelected=this.getItem({key:(0,s.default)(this.state,"parentSelected.key"),parent:(0,s.default)(this.state,"parentSelected.parent"),depth:(0,s.default)(this.state,"parentSelected.depth")})),this.setState(e)}},{key:"handleMouseDown",value:function(e){var t=this;if("pointer"===this.state.context&&!(0,c.default)(this.state.placeholder))return this.removePlaceholder(),this.setState({context:!1}),void setTimeout((function(){var e=t.state.placeholder,n=(0,l.default)({},Z({},t.state.pointerItem),{placeholder:e});G.default.quickActionProcess(n)}),200);"modal"===this.state.context&&this.modalWrapRef&&!this.modalWrapRef.contains(e.target)&&this.closeModal()}},{key:"handleMouseDownTopDocument",value:function(t){this.state.settingPanelActive&&this.settingPanelRef&&!this.settingPanelRef.contains(t.target)?this.closeSettingsPanel():"modal"!==this.state.context||e(t.target).closest(".et-fb-modal__quick-actions").length||this.closeModal()}},{key:"handleMouseMove",value:function(e){this.setState({mousePointer:e}),this.throttledMouseMove.cancel(),this.throttledMouseMove(e)}},{key:"handleKeyDown",value:function(t){var n=this,r=t.keyCode||t.which,o=27===r,a=8===r,i=38===r,l=40===r,u=13===r,d=this.state,f=d.parentSelected,p=d.keyword,h=d.inputFocused,m=d.context;if(o){if(this.state.settingPanelActive)return void this.closeSettingsPanel();if("pointer"===m)return this.setState({context:"modal",placeholder:!1}),this.removePlaceholder(),void G.default.quickActionsSetContext("modal");this.closeModal()}if(a&&!(0,c.default)(f)&&(0,c.default)(p)&&h){var y=(0,s.default)(f,"depth",1),g=(0,s.default)(f,"parent",""),b=y>1?this.getItem({depth:y-1,key:g}):{};this.setState({keyword:"",parentSelected:b,itemHovered:{}})}if(!this.isScrollingList&&(i||l)){var v=this.getResults();if(!(0,c.default)(v)){var _=function(){var e=v.length-1,t=n.getItemHoveredIndex(),r=!1;if(l)for(;!1===r&&t<=e;){t+=1;var o=(0,s.default)(v,t);(0,c.default)(o)||o.isGroup||(r=t)}if(i)for(;!1===r&&t>=0;){t-=1;var a=(0,s.default)(v,t);(0,c.default)(a)||a.isGroup||(r=t)}return r}();if(!1!==_){var w=(0,s.default)(v,_);if(!(0,c.default)(w)){var O=e(this.resultsWrapRef),k=O.outerHeight(),S=parseInt(O.css("padding-top"),10),C=parseInt(O.css("padding-bottom"),10),E=O.closest(".et-fb-tabs__panel"),P=E.height(),T=E.scrollTop(),M=O.find("li").eq(_),j=M.outerHeight()||0,x=M.offset().top-E.offset().top,D=k>P,N=0===_,L=_===v.length-1,R=function(t){n.isScrollingList=!0,e.when(E.scrollTop(t)).then((function(){n.setState({itemHovered:w})}))};if(l&&D&&x+j>=P){var A=T+x+j-P;L&&(A+=C),R(A)}else if(i&&D&&x-j<=0){var I=T+x;N&&(I-=S),R(I)}else this.setState({itemHovered:w})}}}}if(u){var B=this.getResults();if(!(0,c.default)(B)){var F=(0,s.default)(B,this.getItemHoveredIndex());(0,c.default)(F)||F.isGroup||this.handleItemClick(F)}}}},{key:"handleSearchInput",value:function(e){var t=(0,b.default)(e.target.value),n=this.state.parentSelected,r={};(0,c.default)(n)?r=this.getItem({label:t}):(r=this.getItem({label:t,parent:(0,s.default)(n,"key")}),(0,c.default)(r)&&(r=this.getItem({tabLabel:t,parent:(0,s.default)(n,"key")})));var o=(0,c.default)(r)||(0,c.default)(r.actions)?n:r,a=(0,c.default)(r)||(0,c.default)(r.actions)?t:"";1===(0,s.default)(o,"depth")&&this.updateSetting("recent_category",o.key),"help"===(0,s.default)(o,"key")&&G.default.quickActionsLoad("articles"),this.setState({parentSelected:o,keyword:a,itemHovered:{}})}},{key:"handleSearchInputFocus",value:function(){this.state.settingPanelActive||this.state.settingPanelActive||this.setState({inputFocused:!0})}},{key:"handleSearchInputBlur",value:function(){this.state.settingPanelActive||this.state.settingPanelActive||this.setState({inputFocused:!1})}},{key:"handleItemClick",value:function(e){if(!this.state.settingPanelActive&&!this.state.settingPanelActive){if((0,s.default)(e,"recentQuery"))return this.setState({keyword:e.label}),void this.setSearchInputFocus();var t=X((0,s.default)(e,"key","").split("__"),2),n=t[0],r=t[1];switch(n){case"insert_saved":G.default.quickActionsLoad("library",r);break;case"help":G.default.quickActionsLoad("articles");break;case"open":r&&!(0,k.default)(r,"_")&&G.default.quickActionsLoad("posts",r)}if(1===(0,s.default)(e,"depth")&&this.updateSetting("recent_category",e.key),(0,c.default)(this.state.keyword)||this.updateSetting("recent_queries",this.state.keyword),!(0,T.default)(e.actions))return this.setState({parentSelected:e,keyword:"",itemHovered:{}}),void this.setSearchInputFocus();if((0,k.default)(["insert_module","insert_saved"],n)&&"pointer"!==this.state.context){this.setState({context:"pointer",pointerItem:e}),this.togglePlaceholder();var o={pointerItemSlug:(0,s.default)(e,"slug",""),pointerItemGroup:(0,s.default)(e,"group","")};G.default.quickActionsSetContext("pointer",o)}else G.default.quickActionProcess(e)}}},{key:"handleItemMouseOver",value:function(e){this.isScrollingList||this.setState({itemHovered:e})}},{key:"handleItemMouseDown",value:function(e){e.persist(),this.setState({mousePointer:e})}},{key:"openSettingsPanel",value:function(){this.state.settingPanelActive||this.setState({settingPanelActive:!0})}},{key:"closeSettingsPanel",value:function(){this.setState({settingPanelActive:!1})}},{key:"resetResultsList",value:function(){var e={keyword:""};(0,c.default)(this.state.keyword)&&!(0,c.default)(this.state.parentSelected)&&(e.parentSelected=this.getItem({depth:(0,s.default)(this.state.parentSelected,"depth")-1,key:(0,s.default)(this.state.parentSelected,"parent")})),this.setState(e)}},{key:"renderSettingPanel",value:function(){var e=this;if(!this.state.settingPanelActive)return!1;var t={nothing:se("Nothing"),recent_category:se("Last Used Search Category")},n=(0,O.default)(this.data,(function(e){return 1===e.depth}));(0,f.default)(n,(function(e){t[e.key]=e.label}));var r=[{label:se("Always Start Search With"),fieldData:{name:"always_start_with",type:"select",default:"nothing",options:t,value:this.getSetting("always_start_with"),_onChange:this.updateSetting}},{label:se("Show Recent Queries"),fieldData:{name:"show_recent_queries",type:"yes_no_button",default:"off",options:{on:se("Yes"),off:se("No")},value:this.getSetting("show_recent_queries"),_onChange:this.updateSetting}}].map((function(t){var n=(0,o.createElement)(B.default.getControl(t.fieldData.type),t.fieldData);return o.default.createElement(F.ETBuilderFormGroup,{name:t.fieldData.name,key:"".concat(e.slug,"-form-group-").concat(t.fieldData.name)},o.default.createElement(F.ETBuilderFormLabel,null,t.label),o.default.createElement(W.default,{componentName:t.fieldData.name},n))})),l=(0,i.default)({"et-fb-quick-actions-setting-panel":!0,"et-fb-modal":!0}),u=H.default.getAppPreference("builder_animation");return o.default.createElement(a.Motion,{defaultStyle:{size:.8,opacity:0},style:{size:u?(0,a.spring)(1,{stiffness:300,damping:20}):1,opacity:u?(0,a.spring)(1,{stiffness:300,damping:20}):1}},(function(t){return o.default.createElement("div",{className:"et-fb-quick-actions-setting-panel--wrap",style:{opacity:t.opacity,transform:"scale( ".concat(t.size," )")}},o.default.createElement("div",{className:"et-fb-quick-actions-setting-panel--button-mask"}),o.default.createElement("div",{className:l,ref:e.setSettingPanelRef},r))}))}},{key:"renderSearchInput",value:function(){var e=this.state.parentSelected,t=!(0,c.default)(e)&&o.default.createElement("div",{className:"et-fb-modal__header--selected"},o.default.createElement("span",null,(0,s.default)(e,"tagLabel",(0,s.default)(e,"label"))));return o.default.createElement("div",{className:"et-fb-modal__header--input-wrap"},t,o.default.createElement("div",{className:"et-fb-modal__header--input"},o.default.createElement("input",{type:"hidden",value:"fakeInputValueDisableBrowserAutoSuggestions",style:{display:"none"}}),o.default.createElement("input",{type:"text",id:"keyword",name:"keyword",className:"et-fb-settings-option-input et-fb-settings-option-input--block",placeholder:(0,c.default)(e)?"".concat(se("Search"),"..."):"",value:this.state.keyword,onChange:this.handleSearchInput,onFocus:this.handleSearchInputFocus,onBlur:this.handleSearchInputBlur,ref:this.searchInputRef})),this.renderSettingPanel())}},{key:"renderResultsList",value:function(){var e=this,t=this.state.parentSelected,n=this.state.keyword;if(!(0,c.default)(t)&&(0,c.default)(t.actions)&&t.isLoading)return o.default.createElement(I.default,{useWrapper:!1,isLoading:!0});var r=this.getResults();if((0,c.default)(r))return o.default.createElement("div",{className:(0,i.default)({"et-fb-quick-actions":!0,"et-fb-quick-actions--no-results":!0})},o.default.createElement("p",{onClick:this.resetResultsList,dangerouslySetInnerHTML:{__html:se("No options exist for this search query. Click here to clear your search.")}}));var a=r.filter((function(e){return e.recentQuery})),l=r.map((function(r,l){var u,s=function(t,n){return!e.state.settingPanelActive&&((0,c.default)(e.state.itemHovered)?0===t:(0,h.default)(n,e.state.itemHovered))},d=(0,i.default)(ee({"et-fb-quick-actions--item--label":!0,"et-fb-quick-actions--item--label--hovered":s(l,r)},"et-fb-quick-actions--item--label--depth-".concat(r.depth),!0)),f=(0,i.default)(ee({"et-fb-quick-actions--item--description":!0,"et-fb-quick-actions--item--description--hovered":s(l,r)},"et-fb-quick-actions--item--description--depth-".concat(r.depth),!0)),m=(0,i.default)((ee(u={"et-fb-quick-actions--item":!0},"et-fb-quick-actions--item--depth-".concat(r.depth),!0),ee(u,"et-fb-quick-actions--item--hovered",s(l,r)&&!r.isGroup),ee(u,"et-fb-quick-actions--item--separator",!(0,c.default)(a)&&a.length-1===l),u)),y=o.default.createElement("span",{className:d},function(e){return e.injected||(0,c.default)(n)||(0,c.default)(e.keywordLabel)||!(0,c.default)(t)?e.label:e.keywordLabel}(r)),b=o.default.createElement("span",{className:f},function(e){return!(0,c.default)(e.description)&&(0,g.default)(e.description)?e.description.map((function(e){return o.default.createElement("span",{key:e,"data-content":e,className:"kbd-key key-".concat(e)})})):(0,p.default)(e.description)}(r)),v={key:"".concat(r.depth,"_-_").concat(r.key),className:m,onClick:function(){return e.handleItemClick(r)},onMouseOver:function(){return e.handleItemMouseOver(r)},onMouseDown:e.handleItemMouseDown},_=r.element||"div",w=r.attrs||{};return o.default.createElement("li",v,(0,o.createElement)(_,w,y,b))})),u=(0,i.default)({"et-fb-quick-actions":!0,"et-fb-quick-actions--results":!0});return o.default.createElement("ul",{className:u,ref:this.setResultsWrapRef},l)}},{key:"renderPointer",value:function(){var e;if("pointer"!==this.state.context)return!1;var t=H.default.getHoveredModule();if((0,c.default)(t))return!1;var n=this.state.pointerItem,r=n.group,a=n.slug,l=this.getMousePosition(),d={className:(0,i.default)((e={"et-fb-quick-actions-pointer":!0},ee(e,"et-fb-quick-actions-pointer--".concat(r),!0),ee(e,"et-fb-quick-actions-pointer--".concat(r,"--").concat(a.replace("et_pb_","")),"section"!==r),ee(e,"et-fb-quick-actions-pointer--".concat(r,"--fullwidth"),"fullwidth"===a.replace("et_fb_","")),ee(e,"et-fb-quick-actions-pointer--".concat(r,"--specialty"),"specialty"===a.replace("et_fb_","")),ee(e,"et-fb-quick-actions-pointer--".concat(r,"--regular"),"regular"===a.replace("et_fb_","")||"section"===a.replace("et_pb_","")),e)),tooltip:(0,s.default)(ETBuilderBackend.i18n.tooltip,"".concat(r,".addButton")),round:!0,info:"regular"===a.replace("et_fb_","")||"section"===a.replace("et_pb_",""),primary:"fullwidth"===a.replace("et_fb_",""),warning:"specialty"===a.replace("et_fb_",""),success:"row"===r,inverse:"module"===r,disabled:!0,onClick:u.default,style:{left:(0,s.default)(l,"x",0),top:(0,s.default)(l,"y",0)}};return o.default.createElement("div",{className:"et-fb-quick-actions-wrap--pointer"},o.default.createElement(R.default,d,o.default.createElement(A.default,{size:"14",icon:"add",color:"#FFFFFF"})))}},{key:"renderModal",value:function(){var e;if("modal"!==this.state.context)return!1;var t=(0,i.default)((ee(e={"et-fb-modal__module-settings":!0},"et-fb-modal__".concat(this.slug),!0),ee(e,"et-fb-modal__".concat(this.slug,"__").concat((0,q.getOS)().toLowerCase()),!0),e)),n=(0,i.default)(ee({"et-fb-tabs__panel":!0},"et-fb-tabs__panel--".concat(this.slug),!0)),r=(0,i.default)(ee({"et-fb-form":!0},"et-fb-form--".concat(this.slug),!0)),a=[o.default.createElement(R.default,{tooltip:se("Settings"),ink:!1,_onClick:this.openSettingsPanel},o.default.createElement(A.default,{icon:"setting"})),o.default.createElement(R.default,{tooltip:se("Close"),ink:!1,_onClick:this.closeModal},o.default.createElement(A.default,{icon:"close"}))],u=(0,l.default)({},this.props,{className:t,label:this.renderSearchInput(),measurement:{width:this.modalWidth,height:this.modalHeight},alwaysCentered:!0,headerButtons:a});return o.default.createElement("div",{className:"et-fb-quick-actions-wrap--modal",ref:this.setModalWrapRef},o.default.createElement(V.default,u,o.default.createElement(W.default,null,o.default.createElement(U.default,{selectedIndex:0},o.default.createElement(U.ETBuilderTabPanel,{className:n,slug:this.slug,selected:!0},o.default.createElement("div",{className:r},this.renderResultsList()))))))}},{key:"render",value:function(){return o.default.createElement(o.default.Fragment,null,this.renderPointer(),this.renderModal())}}])&&te(n.prototype,r),K&&te(n,K),Object.defineProperty(n,"prototype",{writable:!1}),Y}(o.default.Component);t.default=ce}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=d(n(27)),i=d(n(3)),l=d(n(13)),u=d(n(6)),s=d(n(842)),c=d(n(2));function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n0&&!n.hasClass("et-core-modal-close")||(t.preventDefault(),t.stopPropagation(),e._closeModal())})),T(E(e),"_closeModal",(function(){s.default.$topWindow(a.default.findDOMNode(e.refs.reportModalOverlay)).addClass("et-core-closing").delay(600).queue((function(){y.default.setErrorReportModalActive(!1,null,null)}))})),T(E(e),"_onSubmitReport",(function(t){y.default.sendErrorReport(c.default.getSections(),c.default.getPageSettings(),e.state.notes)})),T(E(e),"_isSubmissionReady",(function(){return s.default.isOn(e.state.consent)})),e}return t=_,(n=[{key:"componentDidMount",value:function(){this._adjustModalPositionOnMount(),c.default.addErrorReportModalChange(this._onModalChange)}},{key:"componentWillUnmount",value:function(){c.default.removeErrorReportModalChange(this._onModalChange)}},{key:"_getI18n",value:function(e){return d.default.getI18n("errorBoundaries.modal.".concat(e))}},{key:"_getModalInitialHeight",value:function(){var e=s.default.$topWindow(a.default.findDOMNode(this.refs.reportModal));return e.find(".et-core-modal-header").outerHeight()+parseInt(e.find(".et-core-modal-content").css("paddingTop"))+parseInt(e.find(".et-core-modal-content").css("paddingBottom"))+e.find(".et-fb-form__group").outerHeight()}},{key:"_adjustModalPositionOnMount",value:function(){var e=s.default.$topWindow(a.default.findDOMNode(this.refs.reportModal));if(this._getModalInitialHeight()<=parseInt(.6*s.default.$topWindow().innerHeight())){s.default.$topWindow(a.default.findDOMNode(this.refs.reportModalOverlay)).addClass("et-core-modal-disabled-scrollbar");var t=this._getModalInitialHeight();e.css({marginTop:"-".concat(t/2,"px")})}}},{key:"_isStatus",value:function(e){return e===this.state.status}},{key:"_isEtAccountActive",value:function(){var e=d.default.getEtAccount("et_username"),t=d.default.getEtAccount("et_api_key"),n=d.default.getEtAccount("status");return s.default.hasValue(e)&&s.default.hasValue(t)&&"active"===n}},{key:"_renderModalHeader",value:function(){return o.default.createElement("div",{className:"et-core-modal-header"},o.default.createElement("h3",{className:"et-core-modal-title"},this._getI18n("title")),o.default.createElement("a",{href:"#close",className:"et-core-modal-close",onClick:this._onCloseModal,style:{pointerEvents:this._isStatus("sending")?"none":"auto",opacity:this._isStatus("sending")?0:1}}))}},{key:"_renderPreloader",value:function(){return this._isStatus("sending")?o.default.createElement(g.default,{isLoading:!0}):null}},{key:"_renderErrorMessage",value:function(){return this._isStatus("sending_error")?o.default.createElement("div",{className:"et-fb-error-report-notification et-fb-error-report-notification--error"},(0,l.default)(this.state,"requestResponse.message",this._getI18n("errorMessage"))):null}},{key:"_renderDebugInfo",value:function(){var e=(0,u.default)(this._getI18n("debugInfo"),(function(e,t){return o.default.createElement("div",{className:"et-fb-error-report-debug-items",key:"debug-info-".concat(t)},o.default.createElement("p",{className:"et-fb-error-report-debug-items-title"},t),o.default.createElement("ul",{className:"et-fb-error-report-debug-items-list"},(0,u.default)(e,(function(e){return o.default.createElement("li",{key:"debug-info-".concat(t,"-").concat(e)},e.replace(/_/g," "))}))))}));return o.default.createElement("div",{className:"et-fb-error-report-debug-items-wrap"},e)}},{key:"_renderReportForm",value:function(){var e=this._isEtAccountActive()?o.default.createElement(p.ETBuilderFormGroup,null,o.default.createElement(p.ETBuilderFormLabel,null,this._getI18n("consentTitle")),o.default.createElement("p",{className:"et-fb-error-report-consent-description"},this._getI18n("consentDescription")),this._renderDebugInfo(),o.default.createElement(p.ETBuilderFormLabel,null,this._getI18n("consentNotes")),o.default.createElement("p",{className:"et-fb-error-report-consent-description"},this._getI18n("consentNotesDescription")),o.default.createElement(h.default,{name:"notes",_onChange:this._onChange}),o.default.createElement(m.default,{name:"consent",_onChange:this._onChange,options:[s.default.decodeHtmlEntities(this._getI18n("consentLabel"))],value:this.state.consent})):o.default.createElement("div",{className:"et-fb-error-report-notification et-fb-error-report-notification--error"},o.default.createElement("p",null,this._getI18n("noAccountMessage")),o.default.createElement("p",null,this._getI18n("noAccountGuide"))),t={opacity:this._isStatus("sending")?0:1,pointerEvents:this._isStatus("sending")?"none":"auto"};return o.default.createElement("form",null,this._renderPreloader(),o.default.createElement("div",{className:"et-core-modal-content",style:t},this._renderErrorMessage(),e),this._renderModalProceedButton())}},{key:"_renderBugReportSentMessage",value:function(){return o.default.createElement("div",{className:"et-core-modal-content"},o.default.createElement("p",null,this._getI18n("successMessage")),o.default.createElement("p",null,this._getI18n("successAutoclose")))}},{key:"_renderModalProceedButton",value:function(){return this._isEtAccountActive()?o.default.createElement("div",{className:"et_pb_prompt_buttons"},o.default.createElement(f.default,{buttonName:"error-boundaries-report-submit",className:"et-core-modal-action",_onClick:this._onSubmitReport,style:{backgroundColor:b.default.coreModalButtonBlue,pointerEvents:this._isStatus("sending")?"none":"auto",opacity:this._isStatus("sending")?0:1},disabled:!this._isSubmissionReady()},this._getI18n("buttonLabel"))):o.default.createElement("a",{href:d.default.getUrl("themeOptionsUrl"),className:"et-core-modal-action"},this._getI18n("noAccountButtonLabel"))}},{key:"render",value:function(){var e=o.default.createElement("div",{className:(0,i.default)(["et-core-modal-overlay","et-core-active","et-fb-modal-report"]),onClick:this._onCloseModal,ref:"reportModalOverlay"},o.default.createElement("div",{className:"et-core-modal",ref:"reportModal"},o.default.createElement("div",{className:"et-fb-modal-overlay-mousetrap"}),this._renderModalHeader(),this._isStatus("sending_success")?this._renderBugReportSentMessage():this._renderReportForm()));return a.default.createPortal(e,s.default.$topWindow("#et-fb-app")[0])}}])&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),_}(o.Component),j=M;t.default=j},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=S(n(0)),a=O(n(3)),i=O(n(9)),l=O(n(4)),u=O(n(37)),s=O(n(11)),c=O(n(332)),d=(O(n(40)),O(n(6))),f=O(n(59)),p=O(n(22)),h=O(n(1885)),m=O(n(63)),y=O(n(43)),g=O(n(781)),b=S(n(782)),v=O(n(281)),_=O(n(2));n(1887);var w=["currentVideo","currentVideoList","helpModalState","onModalChange","videoOverlayStatus"];function O(e){return e&&e.__esModule?e:{default:e}}function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){for(var n=0;n<%=label%><%}%>"}));var l=this.getLineChartData(),u=t.find("#et-fb-ab-testing-report-chart-".concat(n));(0,h.default)((0,c.default)(this,["renderedLineChart",n,"destroy"]))&&this.renderedLineChart[n].destroy(),(0,d.default)(l,"datasets")&&(0,p.default)(l.datasets)&&(l.datasets=[{}]),(0,y.default)(u.get(0))||(this.renderedLineChart[n]=new Chart(u.get(0).getContext("2d")).Line(l,{scaleFontSize:13,scaleFontColor:"#a1a9b1",scaleLabel:"<%=value%>%",scaleGridLineWidth:2,scaleLineWidth:2,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>%",multiTooltipTemplate:"<%= value %>%",datasetStrokeWidth:4,pointDotStrokeWidth:2,pointDotRadius:7}))}},{key:"_handleTabSwitch",value:function(e){var t=this,n=(0,u.default)((0,g.default)(this.tabList,(function(e){return!("conversions"===e&&!t.hasConversion)&&!("shortcode_conversions"===e&&!t.hasShortcodeConversions)&&e})));(0,d.default)(n,e)&&this.setState({tab:(0,c.default)(n,e)})}},{key:"_handleFilterSubjectChange",value:function(e){e.preventDefault();var t=(0,c.default)(this,"state.excludedSubjects",{}),n=e.target.getAttribute("data-tab-name"),r=e.target.getAttribute("data-subject-id");(0,d.default)(t,[n,r])?delete t[n][r]:(0,m.default)((0,c.default)(t,[n]))?t[n][r]=r:t[n]=L({},r,r),this.setState({excludedSubjects:t})}},{key:"_handleFilterTimeChange",value:function(e){e.preventDefault();var t=(0,c.default)(this,["state","tab"]),n=(0,c.default)(this,["state","durations"]),r=e.target.getAttribute("data-time");n[t]=r,this.setState({durations:n})}},{key:"_onRefreshReport",value:function(){var e=(0,c.default)(this,["state","durations",name]);S.default.abRefreshReport(e)}},{key:"_onCloseReport",value:function(){S.default.abCloseReport()}},{key:"_onABTestingChange",value:function(){var e=this.getCurrentDuration(),t=(0,c.default)(this,"state.reportData");t[e]=O.default.abGetReportData(e),this.unmounted||this.setState({reportData:t})}},{key:"_onMotionRest",value:function(){this.onMountInit||(this.initUI(),this.onMountInit=!0)}},{key:"isSubjectDisabled",value:function(e,t){var n=(0,_.default)((0,c.default)(this.state,["excludedSubjects",e],[]));return(0,d.default)(t,"attrs.ab_subject_id")&&(0,f.default)(n,(0,c.default)(t,"attrs.ab_subject_id"))}},{key:"getCurrentTab",value:function(){return(0,c.default)(this,"state.tab")}},{key:"getCurrentDuration",value:function(){return(0,c.default)(this,["state","durations",this.getCurrentTab()])}},{key:"getCurrentData",value:function(){return(0,c.default)(this,["state","reportData",(0,c.default)(this,["state","durations",this.getCurrentTab()])])}},{key:"getReportData",value:function(e){if((0,d.default)(this,["state","reportData",e]))return(0,c.default)(this,["state","reportData",e]);var t=(0,c.default)(this,"state.reportData");return t[e]=O.default.abGetReportData(e),this.setState({reportData:t}),O.default.abGetReportData(e)}},{key:"getRenderedSubjects",value:function(){var e=this,t=(0,c.default)(e,"state.tab");return(0,s.default)(this.subjects,(function(n){return!e.isSubjectDisabled(t,n)}))}},{key:"getLineChartData",value:function(){var e=this,t=e.getCurrentTab(),n=e.getReportData(e.getCurrentDuration()),r=(0,c.default)(n,"dates");return!(0,y.default)(r)&&{labels:r,datasets:(0,g.default)(this.getRenderedSubjects(),(function(e){var r=(0,c.default)(e,"attrs.ab_subject_id"),o=(0,c.default)(n,["subjects_totals","subject_".concat(r),"color"]),a=O.default.abGetSubjectLabel(e);return{data:(0,_.default)((0,c.default)(n,["subjects_analysis","subject_".concat(r),t])),fillColor:"transparent",label:a,pointColor:o,pointStrokeColor:"#fff",strokeColor:o,subject_id:r}}))}}},{key:"getPieChartData",value:function(){var e=(0,c.default)(this,["state","reportData",this.getCurrentDuration(),"subjects_totals"]),t=(0,c.default)(this,"state.tab");return(0,y.default)(e)?[]:(0,u.default)((0,g.default)(this.getRenderedSubjects(),(function(n){var r=(0,c.default)(n,"attrs.ab_subject_id"),o="subject_".concat(r);return{value:(0,c.default)(e,[o,t]),color:(0,c.default)(e,[o,"color"]),label:O.default.abGetSubjectLabel(n)}})))}},{key:"headerButtons",value:function(){return[o.default.createElement(C.default,{block:!0,buttonName:E.default.AB_CLOSE_REPORT,_onClick:this._onCloseReport},o.default.createElement(P.default,{icon:"close",color:"#FFFFFF"}))]}},{key:"renderSubjectFilter",value:function(e){var t=this;return(0,g.default)(this.subjects,(function(n,r){var a="tab-".concat(e,"-filter-subject-").concat(r),i=t.isSubjectDisabled(e,n),u=i?x.default.disabledSubject:O.default.abGetSubjectRank(n,"color");return o.default.createElement("li",{key:a},o.default.createElement("button",{"data-subject-id":(0,c.default)(n,"attrs.ab_subject_id"),"data-tab-name":e,style:{backgroundColor:u},className:(0,l.default)({"et-fb-ab-testing-filter-item-subject":!0,"et-fb-ab-testing-filter-item-subject--disabled":i}),onClick:t._handleFilterSubjectChange},O.default.abGetSubjectLabel(n)))}))}},{key:"renderTimeFilter",value:function(e){var t=this;return(0,g.default)(t.timeFilterList,(function(n,r){var a="tab-".concat(e,"-filter-time-").concat(r),i=n===(0,c.default)(t,["state","durations",e]);return o.default.createElement("li",{key:a},o.default.createElement("button",{className:(0,l.default)({"et-fb-ab-testing-filter-item-time":!0,"et-fb-ab-testing-filter-item-time--active":i}),"data-time":n,onClick:t._handleFilterTimeChange},(0,c.default)(V,["abTesting","reportFilterTime",n])))}))}},{key:"renderTabPanel",value:function(e){var t=this.getCurrentData(),n="isFetchingData"===t,r=!t||(0,p.default)((0,c.default)(t,"subjects_totals")),a=((0,c.default)(this,["state","durations",e]),o.default.createElement("canvas",{id:"et-fb-ab-testing-report-chart-".concat(e),className:"et-fb-ab-testing-report-chart"}));return o.default.createElement(j.ETBuilderTabPanel,{key:"abTesting-report-panel-".concat(e)},o.default.createElement("div",{className:"et-fb-form"},o.default.createElement(M.default,{isLoading:n},r?o.default.createElement("div",{className:"et-fb-ab-testing-no-report"},o.default.createElement("object",{type:"image/svg+xml",data:"".concat(ETBuilderBackend.images_uri,"/stats-no-data.svg")}),o.default.createElement("h2",null,(0,c.default)(V,"abTesting.no_report.title")),o.default.createElement("p",null,(0,c.default)(V,"abTesting.no_report.desc"))):o.default.createElement("div",null,o.default.createElement("ul",{className:"et-fb-ab-testing-filter--time"},this.renderTimeFilter(e),o.default.createElement("li",null,o.default.createElement(C.default,{className:"et-fb-ab-testing-report-refresh",buttonName:E.default.AB_REFRESH_REPORT,_onClick:this._onRefreshReport,tooltip:(0,c.default)(V,"abTesting.reportRefreshTooltip")},o.default.createElement(P.default,{icon:"undo",color:x.default.abTestingTimeFilter})))),o.default.createElement("ul",{className:"et-fb-ab-testing-filter--subjects"},this.renderSubjectFilter(e)),a,this.renderTable(e),this.renderPieChart(e)))))}},{key:"renderTable",value:function(e){var t=this,n=(0,c.default)(this,["state","durations",e]),r=O.default.abGetAnalysisFormula(e),a=(0,c.default)(r,"denominator"),i=(0,c.default)(r,"numerator"),l=(0,c.default)(V,["abTesting","view_stats_thead_titles",e]),u=0,s=0,d=0,f=(0,g.default)(this.getRenderedSubjects(),(function(r){var l=(0,c.default)(r,"attrs.ab_subject_id");if((0,y.default)(l))return!1;var f="subject_".concat(l),p=O.default.abGetSubjectLabel(r),h=(0,c.default)(t,["state","reportData",n,"subjects_totals",f,a],0),m=(0,c.default)(t,["state","reportData",n,"subjects_totals",f,i],0),g=(0,c.default)(t,["state","reportData",n,"subjects_totals",f,e],0);return u+=parseFloat(h),s+=parseFloat(m),d+=parseFloat(g),o.default.createElement("tr",{key:"abTesting-row-".concat(e,"-").concat(n,"-").concat(l)},o.default.createElement("td",null,l),o.default.createElement("td",null,p),o.default.createElement("td",null,h),o.default.createElement("td",null,m),o.default.createElement("td",null,"".concat(g,"%")))})),h=d/f.length,m="".concat(h).split(".").length>1?2:0,b=!(0,p.default)(this.getRenderedSubjects())&&o.default.createElement("tr",null,o.default.createElement("td",{colSpan:"2"},(0,c.default)(V,["abTesting","reportTotal"])),o.default.createElement("td",null,u),o.default.createElement("td",null,s),o.default.createElement("td",null,"".concat(h.toFixed(m),"%")));return o.default.createElement("div",{className:"et-fb-ab-testing-report-table--wrapper"},o.default.createElement("table",{id:"et-fb-ab-testing-report-table-".concat(e),className:"et-fb-ab-testing-report-table"},o.default.createElement("thead",null,o.default.createElement("tr",null,o.default.createElement("th",null,l[0]),o.default.createElement("th",null,l[1]),o.default.createElement("th",null,l[2]),o.default.createElement("th",null,l[3]),o.default.createElement("th",null,l[4]))),o.default.createElement("tbody",null,f),o.default.createElement("tfoot",null,b)))}},{key:"renderPieChart",value:function(e){var t=this,n=(0,g.default)(this.subjects,(function(n,r){var a=t.isSubjectDisabled(t.state.tab,n),i=a?"#E1E4E9":O.default.abGetSubjectRank(n,"color"),l=a?{color:"#E1E4E9"}:{};return o.default.createElement("li",{key:"".concat(e,"-legend-").concat(r)},o.default.createElement("span",{style:{backgroundColor:i}}),o.default.createElement("a",{href:"#subject",style:l,"data-subject-id":(0,c.default)(n,"attrs.ab_subject_id"),"data-tab-name":e,onClick:t._handleFilterSubjectChange},O.default.abGetSubjectLabel(n)))})),r=(0,p.default)((0,c.default)(this.getLineChartData(),"datasets"))?o.default.createElement("div",{className:"et-fb-ab-testing-report-chart"}):o.default.createElement("canvas",{id:"et-fb-ab-testing-report-pie-".concat(e),className:"et-fb-ab-testing-report-pie",width:"200",height:"200"});return o.default.createElement("div",{className:"et-fb-ab-testing-report-pie--wrapper"},r,o.default.createElement("ul",{className:"et-fb-ab-testing-report-pie--legend"},n))}},{key:"render",value:function(){var e=this,t=this,n=(0,g.default)(this.tabList,(function(e){return!("conversions"===e&&!t.hasConversion)&&!("shortcode_conversions"===e&&!t.hasShortcodeConversions)&&o.default.createElement(j.ETBuilderTabItem,{key:"abTesting-report-nav-".concat(e)},(0,c.default)(V,["abTesting","reportTabNavs",e]))})),r=(0,g.default)(this.tabList,(function(n){return!("conversions"===n&&!t.hasConversion)&&!("shortcode_conversions"===n&&!t.hasShortcodeConversions)&&e.renderTabPanel(n)}));return o.default.createElement(T.default,{fullscreen:!0,headerButtons:this.headerButtons(),footerButtons:[o.default.createElement(C.default,{block:!0,info:!0,buttonName:E.default.BUTTON_AB_DISABLE},(0,v.default)((0,c.default)(V,"abTesting.reportEndTestButton")))],label:(0,c.default)(V,"abTesting.reportTitle"),onRest:this._onMotionRest,animate:this.props.animate},o.default.createElement(j.default,{selectedIndex:0,onSelect:this._handleTabSwitch},o.default.createElement(j.ETBuilderTabList,{disableScroll:!1},n),r))}}])&&R(n.prototype,r),i&&R(n,i),Object.defineProperty(n,"prototype",{writable:!1}),N}(o.default.Component);G.propTypes=U,G.defaultProps={animate:!0};var H=G;t.default=H}).call(this,n(8))},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=S(n(0));n(1926);var a=S(n(11)),i=S(n(1)),l=S(n(34)),u=S(n(197)),s=S(n(42)),c=S(n(5)),d=S(n(850)),f=S(n(137)),p=S(n(305)),h=S(n(17)),m=S(n(65)),y=S(n(58)),g=S(n(7)),b=S(n(184)),v=S(n(146)),_=S(n(1465)),w=S(n(6)),O=S(n(22)),k=S(n(2));function S(e){return e&&e.__esModule?e:{default:e}}function C(e,t){for(var n=0;n'),e(".et_search_form_container").length>0&&e(".et_search_form_container").addClass("et_pb_is_animating"),e(".et_header_style_slide .et_slide_in_menu_container").length>0&&(e(".et_header_style_slide .et_slide_in_menu_container").addClass("et_pb_slide_menu_opened"),e("#main-header").on("click",".et_toggle_slide_menu",n.disableSlideMenu)),e(".et_header_style_fullscreen .et_slide_in_menu_container").length>0&&e("#page-container").on("click",".et_toggle_fullscreen_menu",n.disableFullscreenMenu),w.default.addProductTourMoveFinishedListener(this.setAfterMoveStep),N.on("click",".et-fb-tour-video-overlay",(function(){var t=e(this),n=t.data("video");t.replaceWith(''))})),N.on("mousedown, click, mouseup","#publishing-action.et-fb-product-tour-element",(function(e){return e.preventDefault(),!1})),this.shortThrottleReset=(0,b.default)(this.maybeAddScrollbar,100),k.default.appWindow().addEventListener("resize",this.shortThrottleReset),this.maybeAddScrollbar()}},{key:"componentWillUnmount",value:function(){w.default.removeProductTourMoveFinishedListener(this.setAfterMoveStep),k.default.appWindow().removeEventListener("resize",this.shortThrottleReset),D.off("click mouseup mousedown","*",this.isTourButtonClicked),D.off("et_fb_product_tour_element_clicked")}},{key:"onClose",value:function(){O.default.endProductTour();var t=this;k.default.$topWindow("".concat(ETBuilderBackend.css.layoutPrefix," #et-fb-app")).find(".et-fb-product-tour-overlay").remove(),e(".et_search_form_container").length>0&&e(".et_search_form_container").removeClass("et_pb_is_animating"),e(".et_header_style_slide .et_slide_in_menu_container").length>0&&(e(".et_header_style_slide .et_slide_in_menu_container").removeClass("et_pb_slide_menu_opened"),D.removeClass("et_pb_slide_menu_active"),e("#main-header").off("click",".et_toggle_slide_menu",t.disableSlideMenu)),e(".et_header_style_fullscreen .et_slide_in_menu_container").length>0&&e("#page-container").off("click",".et_toggle_fullscreen_menu",t.disableFullscreenMenu),this.setState({isActive:!1}),D.off("click mouseup mousedown ondragstart","*",t.isTourButtonClicked)}},{key:"getActiveElementPosition",value:function(e){var t=this.state.modalPosition,n=0===k.default.$appWindow(".et-fb-product-tour-element").length,r=n?k.default.$topWindow(".et-fb-product-tour-element"):k.default.$appWindow(".et-fb-product-tour-element"),o=t,l=this.getElementOffset(e),u=L?k.default.$topWindow("#et-bfb-app-frame").offset():0,s=n&&!L?k.default.$appWindow().scrollTop():0;if(!l.usePrevElementPosition&&r.length>0&&(o=r.offset(),r.closest(".et-fb-page-settings-bar").length>0))if(L)r.closest(".et-fb-page-settings-bar__column--left").length>0&&(o.top-=u.top,o.left-=200);else{var c=r.closest(".et-fb-page-settings-bar");o.top=c.position().top-100}(0,a.default)(o)?this.setState({isActive:!0}):(o.top+=s,(0,i.default)(this.appliedModalOffsets,e)?o=this.appliedModalOffsets[e]:(o.element=!1,o.top+=(0,d.default)((0,i.default)(l,"top",0)),o.left+=(0,d.default)((0,i.default)(l,"left",0)),this.appliedModalOffsets[e]=o),L&&n&&(r.closest(".et-fb-modal__module-settings").length>0||r.closest(".et-fb-tooltip-modal").length>0||r.closest(".et-fb-right-click-menu").length>0)&&(o.top-=(0,d.default)(u.top)+200),this.setState({modalPosition:o,isActive:!0}))}},{key:"getAvailableTourItems",value:function(){var e=!1,t=!1,n=!1,r="et_pb_blurb",o=w.default.isAllowedAction("divi_library")&&w.default.isAllowedAction("load_layout"),a=w.default.isAllowedAction("add_module"),i=w.default.isAllowedAction("edit_module"),l=w.default.isAllowedAction("move_module"),u=w.default.isAllowedAction("general_settings"),s=w.default.isAllowedAction("advanced_settings"),d=w.default.isAllowedAction("custom_css_settings");if(w.default.isAllowedAction(r))e=!0,w.default.setProductTourModuleName(r);else{var f,b=(0,m.default)(ETBuilderBackend.modules,{is_parent:"on"});f=(0,y.default)(b,(function(e){return!(0,g.default)(["et_pb_section","et_pb_row","et_pb_row_inner","et_pb_column","et_pb_column_inner"],e.label)&&w.default.isAllowedAction(e.label)})),(0,c.default)(f)||(w.default.setProductTourModuleName(f.label),e=!0)}(u||s||d)&&(t=!(!w.default.isAllowedAction("general_settings")&&!w.default.isAllowedAction("custom_css_settings")),n=!0);var v={start:!0,loadLayout:o,selectLayoutPack:o,loadLayoutItem:o,addSection:e&&a,selectSectionType:e&&a,selectRow:e&&a,selectModule:e&&a,configureModule:e&&a&&t,saveModule:e&&a,duplicateModule:e&&a,moveModule:l,rightClickCopy:a,rightClickPaste:a,rowOptions:i&&n,editRow:i&&n,saveRow:i&&n,pageSettings:!k.default.condition("is_bfb"),tabletPreview:!0,desktopPreview:!0,openHistory:!0,editHistory:!0,savePage:!0,finish:!0};return(0,h.default)((0,p.default)(v,this.isFalse))}},{key:"setAfterMoveStep",value:function(){var e=(0,i.default)(this.stepsSequence,(0,f.default)(this.stepsSequence,"moveModule")+1,"");w.default.setProductTourElementReady(e)}},{key:"autoloadLayout",value:function(e){if((this.state.autoLoadDemo||e)&&!(0,c.default)(results)){var t=results.pop();this.setState({autoLoadDemo:!1}),t[0].savedShortcode=t[0].shortcode,w.default.loadSavedLayoutFromComponent(t[0],!0),setTimeout((function(){w.default.replacePageContent(),w.default.setProductTourElementReady("predefined_layouts"),k.default.$topWindow("".concat(ETBuilderBackend.css.layoutPrefix," #et-fb-app")).find(".et-fb-product-tour-overlay").remove()}),1e3)}}},{key:"isTourButtonClicked",value:function(t){var n=this.state.tourElement;if("mouseup"===t.type&&"moveModule"===n)return!0;var r=e(t.target);return r.closest(".et-builder-bfb-welcome-modal, .et-theme-builder-no-post-content").length>0||!(0===r.closest(".et-fb-product-tour-element, .et-fb-product-tour-secondary-element, .et-fb-tooltip--product-tour, .et-fb-modal__module-settings, .et-fb-modal-history, .et-fb-tour-video-overlay, #wpadminbar, .et-fb-product-tour-secondary-element-hidden").length||r.closest(".et-fb-modal__footer, .et-fb-modal__badge").length>0&&0===r.closest(".et-fb-product-tour-element, .et-fb-product-tour-secondary-element, .et-fb-product-tour-secondary-element-hidden").length)||(t.preventDefault(),t.stopPropagation(),!1)}},{key:"maybeAddScrollbar",value:function(){var t=this.state.tourElement,n=e(".et-fb-tooltip--product-tour--centered"),r=k.default.$appWindow().height();this.getActiveElementPosition(t),800>r?n.addClass("et-core-modal-enabled-scrollbar"):n.removeClass("et-core-modal-enabled-scrollbar")}},{key:"maybeScroll",value:function(){var e=this.state.tourElement,t=L?"top":"app";if("selectModule"===e&&k.default.$topWindow(".et-fb-settings-options-wrap").animate({scrollTop:150},400),"editRow"===e&&k.default.$topWindow(".et-fb-tabs__panel--general").animate({scrollTop:452},400),(0,g.default)(this.absolutelyPositionedElements,e)){var n=k.default.$topWindow(".et-fb-tooltip--product-tour").length>0?k.default.$topWindow(".et-fb-tooltip--product-tour"):k.default.$appWindow(".et-fb-tooltip--product-tour");if(n.length>0){var r=k.default.$topWindow().height(),o=("top"===t?k.default.$topWindow().scrollTop():k.default.$appWindow().scrollTop())+r,a=n.innerHeight(),i=n.offset().top,l=L?90:0,u=0===k.default.$appWindow(".et-fb-product-tour-element").length?k.default.$topWindow(".et-fb-product-tour-element"):k.default.$appWindow(".et-fb-product-tour-element"),s=L&&u.closest(".et-fb-page-settings-bar").length>0;if(o')}if((0,g.default)(["moveModule","loadLayoutItem"],n)&&(a=!0,u=!0,"loadLayoutItem"===n&&s.push("addSection")),"start"===n&&"loadLayout"!==r&&(s.push("predefined_layouts"),a=!0,"pageSettings"===r&&(u=!0),this.setState({autoLoadDemo:!0}),w.default.activateGlobalPreloader(),w.default.emitPreloaderInProcess(),this.autoloadLayout(!0)),this.setState({isActive:!1}),u||setTimeout((function(){O.default.setActiveTourElement(r)}),0),a)this.waitProductTourElement(s,r,u);else{var c=(0,g.default)(["rightClickCopy","rightClickPaste"],n)?800:500;setTimeout((function(){t.nextTourContent(r)}),c)}}},{key:"nextTourContent",value:function(e){var t=this,n=(0,i.default)(this.productTourLocalization,[e,"endButtonText"],this.productTourLocalization.endButtonTextDefault),r=(0,i.default)(this.productTourLocalization,[e,"skipButtonText"],this.productTourLocalization.skipButtonTextDefault),a=(0,i.default)(this.productTourLocalization,[e,"title"],""),l=(0,i.default)(this.productTourLocalization,[e,"description"],!1);setTimeout((function(){t.getActiveElementPosition(e)}),200);var u={__html:l};l=o.default.createElement("div",{className:"et-fb-product-tour-text",dangerouslySetInnerHTML:u}),this.setState({tourElement:e,modalContent:l,modalTitle:a,endButtonText:n,skipButtonText:r}),setTimeout(this.maybeScroll,1e3)}},{key:"skipTip",value:function(){this.nextTip(!0)}},{key:"waitProductTourElement",value:function(e,t,n){var r=this,o=w.default.getProductTourElementReady();if((0,s.default)(e,(0,u.default)(o,e)))return n&&O.default.setActiveTourElement(t),void this.nextTourContent(t);setTimeout((function(){r.waitProductTourElement(e,t,n)}),1e3)}},{key:"render",value:function(){var e=this.state,t=e.endButtonText,n=e.isActive,r=e.modalContent,a=e.modalTitle,i=e.modalPosition,l=e.skipButtonText,u=e.tourElement;if(!n)return!1;var s="finish"===u?"":o.default.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore et-core-modal-action-secondary",onMouseUp:this.skipTip},l),c=o.default.createElement("div",{className:"et-fb-tour-buttons"},o.default.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore",onClick:this.onClose},t),s),d=!(0,g.default)(this.absolutelyPositionedElements,u),f={"et-fb-tooltip--no-arrow":!0,"et-fb-tooltip--product-tour":!0,"et-fb-tooltip--product-tour--centered":"start"===u||"finish"===u,"et-fb-tooltip--product-tour--finish":"finish"===u},p="start"===u||"finish"===u,h=0===k.default.$appWindow(".et-fb-product-tour-element").length;return o.default.createElement(_.default,{active:n,actionType:"custom_content",tooltipTitle:a,_closeFunction:this.onClose,classNames:f,modalPosition:i,forceFixedPosition:d,modalWidth:340,enableContextMenu:!0,ignorePosition:p,movable:!p,buttons:c,renderInsideApp:!h&&!L},o.default.createElement("div",null,r))}}])&&C(n.prototype,r),S&&C(n,S),Object.defineProperty(n,"prototype",{writable:!1}),j}(o.default.Component);t.default=R}).call(this,n(8))},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=j(n(0)),a=j(n(3));j(n(13));n(1927);var i=j(n(5)),l=j(n(1)),u=j(n(31)),s=j(n(11)),c=j(n(7)),d=j(n(162)),f=j(n(199)),p=j(n(9)),h=j(n(184)),m=j(n(360)),y=j(n(394)),g=(j(n(85)),j(n(395))),b=j(n(125)),v=j(n(84)),_=j(n(303)),w=j(n(43)),O=j(n(1488)),k=j(n(457)),S=j(n(1465)),C=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=M(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(506)),E=j(n(6)),P=(j(n(14)),j(n(22))),T=j(n(2));function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(M=function(e){return e?n:t})(e)}function j(e){return e&&e.__esModule?e:{default:e}}function x(e,t){for(var n=0;nT.default.$topWindow().height()?e.addClass("et-core-modal-enabled-scrollbar"):e.removeClass("et-core-modal-enabled-scrollbar")}},{key:"fontDataValid",value:function(e){var t=[],n="";return"add"!==e||(""===this.state.fontName&&t.push("fontName"),(0,i.default)(this.state.fontFilesData)&&(n=F.noFilesError,t.push("fontFile")),"on"!==this.state.selectedFontWeightsAll&&-1===this.state.selectedFontWeights.indexOf("on")&&t.push("fontWeight"),(0,i.default)(t)?(this.setState({errorElements:[],fontError:""}),!0):(this.setState({errorElements:t,fontProcessing:!1,fontError:n}),!1))}},{key:"_onFontNameInput",value:function(e,t){var n=(0,y.default)(this.state.errorElements,(function(e){return"fontName"===e}));this.setState({fontName:t,errorElements:n})}},{key:"onUpload",value:function(e){e.preventDefault(),this.state.fontProcessing||this.processFont("add")}},{key:"onDelete",value:function(){this.state.fontProcessing||this.processFont("remove",this.props.fontID)}},{key:"getFontWeights",value:function(){if("on"===this.state.selectedFontWeightsAll)return"all";var e=this.state.selectedFontWeights.split("|"),t=0;return(0,d.default)((0,u.default)(W,(function(n,r){return t++,"on"===e[t-1]&&r}))).join(",")}},{key:"processFont",value:function(t,n){var r=this,o=(0,s.default)(n)?r.state.fontName:n,a={};if(r.fontDataValid(t)){r.setState({fontError:"",errorElements:[],fontProcessing:!0}),"add"===t&&(a=JSON.stringify({font_weights:r.getFontWeights(),generic_family:"sans-serif"}));var u=new FormData,c={action:"et_pb_process_custom_font",et_pb_font_action:t,et_fb_upload_font_nonce:ETBuilderBackend.nonces.uploadFontNonce,et_pb_font_name:o,et_pb_font_settings:a};(0,p.default)(r.state.fontFilesData,(function(e,t){c["et_pb_font_file_".concat(t)]=e.file})),e.each(c,(function(e,t){u.append(e,t)})),e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,contentType:!1,processData:!1,data:u,success:function(e){var n=JSON.parse(e);if((0,i.default)(n.error)){if(ETBuilderBackend.customFonts=(0,l.default)(n,"updated_fonts",ETBuilderBackend.customFonts),r.setState({fontError:"",fontProcessing:!1}),"add"===t&&""!==r.props.callback){var o=(0,l.default)(n,"uploaded_font","");r.props.callback(o)}r.onClose()}else r.setState({fontError:n.error,fontProcessing:!1})}})}}},{key:"getFontName",value:function(e){return(0,l.default)(ETBuilderBackend.customFonts,[e,"font_name"],e)}},{key:"onClose",value:function(){P.default.setFontUploaderStatus("disabled"),T.default.$topWindow(".et-fb-font-upload-overlay").remove()}},{key:"_onFileUpload",value:function(e){var t=e.target.files,n=this.state.fontFilesData;if(!((0,b.default)(t)<1))if((0,p.default)(t,(function(e){var t=(0,g.default)((0,l.default)(e,"name",""));(0,p.default)(V,(function(r){".".concat(r),(0,f.default)(t,r)&&(n[r]={fileName:t,file:e})}))})),(0,i.default)(n)){var r="".concat(F.fileError,". ").concat(F.supportedFiles,": ").concat(V.join(", "));this.setState({fontError:r})}else this.setState({fontFilesData:n,fontError:""})}},{key:"updateFontSettings",value:function(e,t){switch(e){case"et-font-uploader-weights-all":this.setState({selectedFontWeightsAll:t});break;case"et-font-uploader-weights-select":this.setState({selectedFontWeights:t})}}},{key:"removeFontFile",value:function(t){var n=e(t.target).closest(".et-fb-font-files-list-item");if(!(n.length<1)){var r=n.data("file_ext"),o=this.state.fontFilesData;(0,m.default)(o,r),this.setState({fontFilesData:o})}}},{key:"generateFilesListPreview",value:function(){var e=this;if((0,i.default)(this.state.fontFilesData))return!1;var t=(0,u.default)(this.state.fontFilesData,(function(t,n){return o.default.createElement("div",{className:"et-fb-font-files-list-item","data-file_ext":n,key:n},o.default.createElement("span",{className:"et-fb-font-files-list-item-remove",onClick:e.removeFontFile},o.default.createElement(w.default,{icon:"delete",color:v.default.danger})),t.fileName)}));return o.default.createElement("div",{className:"et-fb-font-files-list"},o.default.createElement("label",{className:"et-fb-form__label"},o.default.createElement("span",{className:"et-fb-form__label-text"},F.selectedFiles,":")),t)}},{key:"getWeightCheckboxValues",value:function(){var e=[];return(0,p.default)(W,(function(t,n){var r="".concat(t," ").concat(n);e.push({value:t,label:r})})),e}},{key:"render",value:function(){var e={"et-fb-font-upload-modal":!0,"et-fb-font-upload-modal--delete":"delete"===this.props.action,"et-fb-modal-allow-scroll":!0},t=""!==this.state.fontError?o.default.createElement("div",{className:"et-fb-font-upload-error"},this.state.fontError):"",n="";if(this.state.fontProcessing)n=o.default.createElement(_.default,{isLoading:!0});else if("delete"===this.props.action){var r=o.default.createElement("div",{className:"et_pb_prompt_buttons et-fb-font-delete-confirmation"},o.default.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore et-core-modal-action-secondary",onClick:this.onClose},F.cancel),o.default.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-restore",onClick:this.onDelete},F.delete));n=o.default.createElement("div",null,o.default.createElement("div",{className:"et-core-modal-content"},"".concat(F.deleteConfirm,' "').concat(this.getFontName(this.props.fontID),'"'),"?"),r)}else{var a="on"!==this.state.selectedFontWeightsAll?o.default.createElement(O.default,{options:this.getWeightCheckboxValues(),name:"et-font-uploader-weights-select",_onChange:this.updateFontSettings,value:this.state.selectedFontWeights}):"",i=o.default.createElement("a",{href:"#",className:"et-core-modal-action et-core-modal-action-dont-restore",onClick:this.onUpload},F.upload);n=o.default.createElement("div",null,o.default.createElement("div",{className:"et-core-modal-content et-fb-allow-mouse-wheel"},o.default.createElement("div",{className:"et-core-modal-content-inner et-fb-allow-mouse-wheel-form"},t,o.default.createElement("label",{className:"et-fb-form__label"},o.default.createElement("span",{className:"et-fb-form__label-text"},F.fontNameLabel)),o.default.createElement(k.default,{type:"text",value:this.state.fontName,name:"userFontName",_onChange:this._onFontNameInput,className:!!(0,c.default)(this.state.errorElements,"fontName")&&"et-fb-font-error-element",additional_attrs:{placeholder:F.fontName}}),o.default.createElement("div",{className:"et-fb-upload-file-container"},o.default.createElement("span",{className:"et-core-portability-import-placeholder"},F.noFile),o.default.createElement("button",{className:"et-fb-button et-fb-button--upload-font et-fb-button--inverse et-fb-settings-button--additional-button"},F.chooseFile),o.default.createElement("input",{type:"file",className:"et-fb-import-file",onChange:this._onFileUpload,accept:".ttf, .otf, .eot, .woff2, .woff",multiple:!0}),o.default.createElement("p",{className:"et-font-uploader-hint"},F.supportedFiles,":"," ",V.join(", "))),this.generateFilesListPreview(),o.default.createElement(C.ETBuilderFormLabel,{name:"et-font-uploader-weight",activeHelp:this._isDescriptionVisible("et-font-uploader-weight"),hoveredGroup:!0,key:"et-font-uploader-weight-label",onClickHelp:this._onClickHelp},F.weightsSupport),o.default.createElement(C.ETBuilderFormDescription,{active:this._isDescriptionVisible("et-font-uploader-weight"),key:"et-font-uploader-weight-desc"},F.weightsHelp),o.default.createElement("div",{className:(0,c.default)(this.state.errorElements,"fontWeight")?"et-fb-font-error-element":""},o.default.createElement(O.default,{options:[F.all],_onChange:this.updateFontSettings,name:"et-font-uploader-weights-all",value:this.state.selectedFontWeightsAll}),a))),i)}var l="delete"===this.props.action?F.delete:F.upload,u=!!T.default.condition("is_bfb")&&T.default.$topWindow("".concat(ETBuilderBackend.css.layoutPrefix," #et-fb-app"));return o.default.createElement(S.default,{active:!0,actionType:"custom_content",tooltipTitle:"".concat(l," ").concat(F.font),_closeFunction:this.onClose,classNames:e,ignorePosition:!0,enableContextMenu:!0,movable:!1,tooltipModalContainer:u},n)}}])&&x(n.prototype,r),a&&x(n,a),Object.defineProperty(n,"prototype",{writable:!1}),j}(o.default.Component);U.propTypes=I,U.defaultProps={active:!1};var G=U;t.default=G}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(0)),a=s(n(3)),i=s(n(1465)),l=s(n(812)),u=s(n(2));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var n=0;n')}},{key:"componentWillUnmount",value:function(){y.find(".et-cloud-save-progress-overlay").remove()}},{key:"render",value:function(){var e=this.props,t=e.progress,n=e.total,r=02),b=/Android/.test(t),v=g||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),_=g||/Mac/.test(n),w=/\bCrOS\b/.test(t),O=/win/i.test(n),k=p&&t.match(/Version\/(\d*\.\d*)/);k&&(k=Number(k[1])),k&&k>=15&&(p=!1,s=!0);var S=_&&(c||p&&(null==k||k<12.11)),C=r||l&&u>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var P,T=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return M(e).appendChild(t)}function x(t,n,r,o){var a=e.createElement(t);if(r&&(a.className=r),o&&(a.style.cssText=o),"string"==typeof n)a.appendChild(e.createTextNode(n));else if(n)for(var i=0;i=t)return i+(t-a);i+=l-a,i+=n-i%n,a=l+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(I=function(e){try{e.select()}catch(e){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function U(e,t){for(var n=0;n=t)return r+Math.min(i,t-o);if(o+=a-r,r=a+1,(o+=n-o%n)>=t)return r}}var Y=[""];function X(e){for(;Y.length<=e;)Y.push(J(Y)+" ");return Y[e]}function J(e){return e[e.length-1]}function Q(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ne.test(e))}function oe(e,t){return t?!!(t.source.indexOf("\\w")>-1&&re(e))||t.test(e):re(e)}function ae(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function le(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ue(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var o=(t+n)/2,a=r<0?Math.ceil(o):Math.floor(o);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function ce(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,a=0;at||t==n&&i.to==t)&&(r(Math.max(i.from,t),Math.min(i.to,n),1==i.level?"rtl":"ltr",a),o=!0)}o||r(t,n,"ltr")}var de=null;function fe(e,t,n){var r;de=null;for(var o=0;ot)return o;a.to==t&&(a.from!=a.to&&"before"==n?r=o:de=o),a.from==t&&(a.from!=a.to&&"before"!=n?r=o:de=o)}return null!=r?r:de}var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,i=/[Lb1n]/,l=/[1n]/;function u(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var s="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,d=[],f=0;f-1&&(r[t]=o.slice(0,a).concat(o.slice(a+1)))}}}function ve(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function ke(e){e.prototype.on=function(e,t){ye(this,e,t)},e.prototype.off=function(e,t){be(this,e,t)}}function Se(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Pe(e){Se(e),Ce(e)}function Te(e){return e.target||e.srcElement}function Me(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),_&&e.ctrlKey&&1==t&&(t=3),t}var je,xe,De=function(){if(l&&u<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}();function Ne(t){if(null==je){var n=x("span","\u200b");j(t,x("span",[n,e.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(je=n.offsetWidth<=1&&n.offsetHeight>2&&!(l&&u<8))}var r=je?x("span","\u200b"):x("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Le(t){if(null!=xe)return xe;var n=j(t,e.createTextNode("A\u062eA")),r=P(n,0,1).getBoundingClientRect(),o=P(n,1,2).getBoundingClientRect();return M(t),!(!r||r.left==r.right)&&(xe=o.right-r.right<3)}var Re,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var a=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),i=a.indexOf("\r");-1!=i?(n.push(a.slice(0,i)),t+=i+1):(n.push(a),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Be="oncopy"in(Re=x("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Fe=null;function We(e){if(null!=Fe)return Fe;var t=j(e,x("span","x")),n=t.getBoundingClientRect(),r=P(t,0,1).getBoundingClientRect();return Fe=Math.abs(n.left-r.left)>1}var Ve={},Ue={};function Ge(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ve[e]=t}function He(e,t){Ue[e]=t}function ze(e){if("string"==typeof e&&Ue.hasOwnProperty(e))e=Ue[e];else if(e&&"string"==typeof e.name&&Ue.hasOwnProperty(e.name)){var t=Ue[e.name];"string"==typeof t&&(t={name:t}),(e=te(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ze("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ze("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function qe(e,t){t=ze(t);var n=Ve[t.name];if(!n)return qe(e,"text/plain");var r=n(e,t);if(Ke.hasOwnProperty(t.name)){var o=Ke[t.name];for(var a in o)o.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=o[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var i in t.modeProps)r[i]=t.modeProps[i];return r}var Ke={};function $e(e,t){F(t,Ke.hasOwnProperty(e)?Ke[e]:Ke[e]={})}function Ye(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function Xe(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Je(e,t,n){return!e.startState||e.startState(t,n)}var Qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ze(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],a=o.chunkSize();if(t=e.first&&tn?lt(n,Ze(e,n).text.length):mt(t,Ze(e,t.line).text.length)}function mt(e,t){var n=e.ch;return null==n||n>t?lt(e.line,t):n<0?lt(e.line,0):e}function yt(e,t){for(var n=[],r=0;r=this.string.length},Qe.prototype.sol=function(){return this.pos==this.lineStart},Qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qe.prototype.next=function(){if(this.post},Qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qe.prototype.skipToEnd=function(){this.pos=this.string.length},Qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Qe.prototype.backUp=function(e){this.pos-=e},Qe.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},Qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var gt=function(e,t){this.state=e,this.lookAhead=t},bt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,n,r){var o=[e.state.modeGen],a={};Tt(e,t.text,e.doc.mode,n,(function(e,t){return o.push(e,t)}),a,r);for(var i=n.state,l=function(r){n.baseTokens=o;var l=e.state.overlays[r],u=1,s=0;n.state=!0,Tt(e,t.text,l.mode,n,(function(e,t){for(var n=u;se&&o.splice(u,1,e,o[u+1],r),u+=2,s=Math.min(e,r)}if(t)if(l.opaque)o.splice(n,u-n,e,"overlay "+t),u=n+2;else for(;ne.options.maxHighlightLength&&Ye(e.doc.mode,r.state),a=vt(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function wt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new bt(r,!0,t);var a=Mt(e,t,n),i=a>r.first&&Ze(r,a-1).stateAfter,l=i?bt.fromSaved(r,i,a):new bt(r,Je(r.mode),a);return r.iter(a,t,(function(n){Ot(e,n.text,l);var r=l.line;n.stateAfter=r==t-1||r%5==0||r>=o.viewFrom&&rt.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}bt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},bt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},bt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bt.fromSaved=function(e,t,n){return t instanceof gt?new bt(e,Ye(e.mode,t.state),n,t.lookAhead):new bt(e,Ye(e.mode,t),n)},bt.prototype.save=function(e){var t=!1!==e?Ye(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};var Ct=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Et(e,t,n,r){var o,a,i=e.doc,l=i.mode,u=Ze(i,(t=ht(i,t)).line),s=wt(e,t.line,n),c=new Qe(u.text,e.options.tabSize,s);for(r&&(a=[]);(r||c.pose.options.maxHighlightLength?(l=!1,i&&Ot(e,t,r,d.pos),d.pos=t.length,u=null):u=Pt(St(n,d,r.state,f),a),f){var p=f[0].name;p&&(u="m-"+(u?p+" "+u:p))}if(!l||c!=u){for(;si;--l){if(l<=a.first)return a.first;var u=Ze(a,l-1),s=u.stateAfter;if(s&&(!n||l+(s instanceof gt?s.lookAhead:0)<=a.modeFrontier))return l;var c=W(u.text,null,e.options.tabSize);(null==o||r>c)&&(o=l-1,r=c)}return o}function jt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var o=Ze(e,r).stateAfter;if(o&&(!(o instanceof gt)||r+o.lookAhead=t:a.to>t);(r||(r=[])).push(new Rt(i,a.from,l?null:a.to))}}return r}function Wt(e,t,n){var r;if(e)for(var o=0;o=t:a.to>t)||a.from==t&&"bookmark"==i.type&&(!n||a.marker.insertLeft)){var l=null==a.from||(i.inclusiveLeft?a.from<=t:a.from0&&l)for(var v=0;v0)){var c=[u,1],d=ut(s.from,l.from),f=ut(s.to,l.to);(d<0||!i.inclusiveLeft&&!d)&&c.push({from:s.from,to:l.from}),(f>0||!i.inclusiveRight&&!f)&&c.push({from:l.to,to:s.to}),o.splice.apply(o,c),u+=c.length-3}}return o}function Ht(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||$t(n,a.marker)<0)&&(n=a.marker)}return n}function Zt(e,t,n,r,o){var a=Ze(e,t),i=Dt&&a.markedSpans;if(i)for(var l=0;l=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(u.marker.inclusiveRight&&o.inclusiveLeft?ut(s.to,n)>=0:ut(s.to,n)>0)||c>=0&&(u.marker.inclusiveRight&&o.inclusiveLeft?ut(s.from,r)<=0:ut(s.from,r)<0)))return!0}}}function en(e){for(var t;t=Xt(e);)e=t.find(-1,!0).line;return e}function tn(e){for(var t;t=Jt(e);)e=t.find(1,!0).line;return e}function nn(e){for(var t,n;t=Jt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function rn(e,t){var n=Ze(e,t),r=en(n);return n==r?t:rt(r)}function on(e,t){if(t>e.lastLine())return t;var n,r=Ze(e,t);if(!an(e,r))return t;for(;n=Jt(r);)r=n.find(1,!0).line;return rt(r)+1}function an(e,t){var n=Dt&&t.markedSpans;if(n)for(var r=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var dn=function(e,t,n){this.text=e,zt(this,t),this.height=n?n(this):1};function fn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ht(e),zt(e,n);var o=r?r(e):1;o!=e.height&&nt(e,o)}function pn(e){e.parent=null,Ht(e)}dn.prototype.lineNo=function(){return rt(this)},ke(dn);var hn={},mn={};function yn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?mn:hn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=D("span",null,null,s?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,i=void 0;r.pos=0,r.addToken=vn,Le(e.display.measure)&&(i=he(a,e.doc.direction))&&(r.addToken=wn(r.addToken,i)),r.map=[],kn(a,r,_t(e,a,t!=e.display.externalMeasured&&rt(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=A(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=A(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ne(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function bn(e){var t=x("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vn(t,n,r,o,a,i,s){if(n){var c,d=t.splitSpaces?_n(n,t.trailingSpace):n,f=t.cm.state.specialChars,p=!1;if(f.test(n)){c=e.createDocumentFragment();for(var h=0;;){f.lastIndex=h;var m=f.exec(n),y=m?m.index-h:n.length-h;if(y){var g=e.createTextNode(d.slice(h,h+y));l&&u<9?c.appendChild(x("span",[g])):c.appendChild(g),t.map.push(t.pos,t.pos+y,g),t.col+=y,t.pos+=y}if(!m)break;h+=y+1;var b=void 0;if("\t"==m[0]){var v=t.cm.options.tabSize,_=v-t.col%v;(b=c.appendChild(x("span",X(_),"cm-tab"))).setAttribute("role","presentation"),b.setAttribute("cm-text","\t"),t.col+=_}else"\r"==m[0]||"\n"==m[0]?((b=c.appendChild(x("span","\r"==m[0]?"\u240d":"\u2424","cm-invalidchar"))).setAttribute("cm-text",m[0]),t.col+=1):((b=t.cm.options.specialCharPlaceholder(m[0])).setAttribute("cm-text",m[0]),l&&u<9?c.appendChild(x("span",[b])):c.appendChild(b),t.col+=1);t.map.push(t.pos,t.pos+1,b),t.pos++}}else t.col+=n.length,c=e.createTextNode(d),t.map.push(t.pos,t.pos+n.length,c),l&&u<9&&(p=!0),t.pos+=n.length;if(t.trailingSpace=32==d.charCodeAt(n.length-1),r||o||a||p||i||s){var w=r||"";o&&(w+=o),a&&(w+=a);var O=x("span",[c],w,i);if(s)for(var k in s)s.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&O.setAttribute(k,s[k]);return t.content.appendChild(O)}t.content.appendChild(c)}}function _n(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;os&&d.from<=s);f++);if(d.to>=c)return e(n,r,o,a,i,l,u);e(n,r.slice(0,d.to-s),o,a,null,l,u),a=null,r=r.slice(d.to-s),s=d.to}}}function On(t,n,r,o){var a=!o&&r.widgetNode;a&&t.map.push(t.pos,t.pos+n,a),!o&&t.cm.display.input.needsContentAttribute&&(a||(a=t.content.appendChild(e.createElement("span"))),a.setAttribute("cm-marker",r.id)),a&&(t.cm.display.input.setUneditable(a),t.content.appendChild(a)),t.pos+=n,t.trailingSpace=!1}function kn(e,t,n){var r=e.markedSpans,o=e.text,a=0;if(r)for(var i,l,u,s,c,d,f,p=o.length,h=0,m=1,y="",g=0;;){if(g==h){u=s=c=l="",f=null,d=null,g=1/0;for(var b=[],v=void 0,_=0;_h||O.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&g>w.to&&(g=w.to,s=""),O.className&&(u+=" "+O.className),O.css&&(l=(l?l+";":"")+O.css),O.startStyle&&w.from==h&&(c+=" "+O.startStyle),O.endStyle&&w.to==g&&(v||(v=[])).push(O.endStyle,w.to),O.title&&((f||(f={})).title=O.title),O.attributes)for(var k in O.attributes)(f||(f={}))[k]=O.attributes[k];O.collapsed&&(!d||$t(d.marker,O)<0)&&(d=w)}else w.from>h&&g>w.from&&(g=w.from)}if(v)for(var S=0;S=p)break;for(var E=Math.min(p,g);;){if(y){var P=h+y.length;if(!d){var T=P>E?y.slice(0,E-h):y;t.addToken(t,T,i?i+u:u,c,h+T.length==g?s:"",l,f)}if(P>=E){y=y.slice(E-h),h=E;break}h=P,c=""}y=o.slice(a,a=n[m++]),i=yn(n[m++],t.cm.options)}}else for(var M=1;M2&&a.push((u.bottom+s.top)/2-n.top)}}a.push(n.bottom-n.top)}}function er(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}}function tr(e,t){var n=rt(t=en(t)),r=e.display.externalMeasured=new Sn(e.doc,t,n);r.lineN=n;var o=r.built=gn(e,r);return r.text=o.pre,j(e.display.lineMeasure,o.pre),r}function nr(e,t,n,r){return ar(e,or(e,t),n,r)}function rr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=(a=u-l)-1,t>=u&&(i="right")),null!=o){if(r=e[s+2],l==u&&n==(r.insertLeft?"left":"right")&&(i=n),"left"==n&&0==o)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[2+(s-=3)],i="left";if("right"==n&&o==u-l)for(;s=0&&(n=e[o]).left==n.right;o--);return n}function cr(e,t,n,r){var o,a=ur(t.map,n,r),i=a.node,s=a.start,c=a.end,d=a.collapse;if(3==i.nodeType){for(var f=0;f<4;f++){for(;s&&le(t.line.text.charAt(a.coverStart+s));)--s;for(;a.coverStart+c0&&(d=r="right"),o=e.options.lineWrapping&&(p=i.getClientRects()).length>1?p["right"==r?p.length-1:0]:i.getBoundingClientRect()}if(l&&u<9&&!s&&(!o||!o.left&&!o.right)){var h=i.parentNode.getClientRects()[0];o=h?{left:h.left,right:h.left+Dr(e.display),top:h.top,bottom:h.bottom}:lr}for(var m=o.top-t.rect.top,y=o.bottom-t.rect.top,g=(m+y)/2,b=t.view.measure.heights,v=0;v=r.text.length?(u=r.text.length,s="before"):u<=0&&(u=0,s="after"),!l)return i("before"==s?u-1:u,"before"==s);function c(e,t,n){return i(n?e-1:e,1==l[t].level!=n)}var d=fe(l,u,s),f=de,p=c(u,d,"before"==s);return null!=f&&(p.other=c(u,f,"before"!=s)),p}function Or(e,t){var n=0;t=ht(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=Ze(e.doc,t.line),o=un(r)+Kn(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function kr(e,t,n,r,o){var a=lt(e,t,n);return a.xRel=o,r&&(a.outside=r),a}function Sr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return kr(r.first,0,null,-1,-1);var o=ot(r,n),a=r.first+r.size-1;if(o>a)return kr(r.first+r.size-1,Ze(r,a).text.length,null,1,1);t<0&&(t=0);for(var i=Ze(r,o);;){var l=Tr(e,i,o,t,n),u=Qt(i,l.ch+(l.xRel>0||l.outside>0?1:0));if(!u)return l;var s=u.find(1);if(s.line==o)return s;i=Ze(r,o=s.line)}}function Cr(e,t,n,r){r-=gr(t);var o=t.text.length,a=se((function(t){return ar(e,n,t-1).bottom<=r}),o,0);return{begin:a,end:o=se((function(t){return ar(e,n,t).top>r}),a,o)}}function Er(e,t,n,r){return n||(n=or(e,t)),Cr(e,t,n,br(e,t,ar(e,n,r),"line").top)}function Pr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Tr(e,t,n,r,o){o-=un(t);var a=or(e,t),i=gr(t),l=0,u=t.text.length,s=!0,c=he(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?jr:Mr)(e,t,n,a,c,r,o);l=(s=1!=d.level)?d.from:d.to-1,u=s?d.to:d.from-1}var f,p,h=null,m=null,y=se((function(t){var n=ar(e,a,t);return n.top+=i,n.bottom+=i,!!Pr(n,r,o,!1)&&(n.top<=o&&n.left<=r&&(h=t,m=n),!0)}),l,u),g=!1;if(m){var b=r-m.left=_.bottom?1:0}return kr(n,y=ue(t.text,y,1),p,g,r-f)}function Mr(e,t,n,r,o,a,i){var l=se((function(l){var u=o[l],s=1!=u.level;return Pr(wr(e,lt(n,s?u.to:u.from,s?"before":"after"),"line",t,r),a,i,!0)}),0,o.length-1),u=o[l];if(l>0){var s=1!=u.level,c=wr(e,lt(n,s?u.from:u.to,s?"after":"before"),"line",t,r);Pr(c,a,i,!0)&&c.top>i&&(u=o[l-1])}return u}function jr(e,t,n,r,o,a,i){var l=Cr(e,t,r,i),u=l.begin,s=l.end;/\s/.test(t.text.charAt(s-1))&&s--;for(var c=null,d=null,f=0;f=s||p.to<=u)){var h=ar(e,r,1!=p.level?Math.min(s,p.to)-1:Math.max(u,p.from)).right,m=hm)&&(c=p,d=m)}}return c||(c=o[o.length-1]),c.froms&&(c={from:c.from,to:s,level:c.level}),c}function xr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ir){ir=x("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)ir.appendChild(e.createTextNode("x")),ir.appendChild(x("br"));ir.appendChild(e.createTextNode("x"))}j(t.measure,ir);var r=ir.offsetHeight/50;return r>3&&(t.cachedTextHeight=r),M(t.measure),r||1}function Dr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=x("span","xxxxxxxxxx"),n=x("pre",[t],"CodeMirror-line-like");j(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function Nr(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,a=t.gutters.firstChild,i=0;a;a=a.nextSibling,++i){var l=e.display.gutterSpecs[i].className;n[l]=a.offsetLeft+a.clientLeft+o,r[l]=a.clientWidth}return{fixedPos:Lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Rr(e){var t=xr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(o){if(an(e.doc,o))return 0;var a=0;if(o.widgets)for(var i=0;i0&&(u=Ze(e.doc,s.line).text).length==s.ch){var c=W(u,u.length,e.options.tabSize)-u.length;s=lt(s.line,Math.max(0,Math.round((a-Yn(e.display).left)/Dr(e.display))-c))}return s}function Br(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)Dt&&rn(e.doc,t)o.viewFrom?Vr(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)Vr(e);else if(t<=o.viewFrom){var a=Ur(e,n,n+r,1);a?(o.view=o.view.slice(a.index),o.viewFrom=a.lineN,o.viewTo+=r):Vr(e)}else if(n>=o.viewTo){var i=Ur(e,t,t,-1);i?(o.view=o.view.slice(0,i.index),o.viewTo=i.lineN):Vr(e)}else{var l=Ur(e,t,t,-1),u=Ur(e,n,n+r,1);l&&u?(o.view=o.view.slice(0,l.index).concat(Cn(e,l.lineN,u.lineN)).concat(o.view.slice(u.index)),o.viewTo+=r):Vr(e)}var s=o.externalMeasured;s&&(n=o.lineN&&t=r.viewTo)){var a=r.view[Br(e,t)];if(null!=a.node){var i=a.changes||(a.changes=[]);-1==U(i,n)&&i.push(n)}}}function Vr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ur(e,t,n,r){var o,a=Br(e,t),i=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(var l=e.display.viewFrom,u=0;u0){if(a==i.length-1)return null;o=l+i[a].size-t,a++}else o=l-t;t+=o,n+=o}for(;rn(e.doc,n)!=n;){if(a==(r<0?0:i.length-1))return null;n+=r*i[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function Gr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Cn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Cn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Br(e,n)))),r.viewTo=n}function Hr(e){for(var t=e.display.view,n=0,r=0;r=t.display.viewTo||s.to().line0?i:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(x("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function $r(e,t){return e.top-t.top||e.left-t.left}function Yr(t,n,r){var o=t.display,a=t.doc,i=e.createDocumentFragment(),l=Yn(t.display),u=l.left,s=Math.max(o.sizerWidth,Jn(t)-o.sizer.offsetLeft)-l.right,c="ltr"==a.direction;function d(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),i.appendChild(x("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(r-t)+"px"))}function f(e,n,r){var o,i,l=Ze(a,e),f=l.text.length;function p(n,r){return _r(t,lt(e,n),"div",l,r)}function h(e,n,r){var o=Er(t,l,null,e),a="ltr"==n==("after"==r)?"left":"right";return p("after"==r?o.begin:o.end-(/\s/.test(l.text.charAt(o.end-1))?2:1),a)[a]}var m=he(l,a.direction);return ce(m,n||0,null==r?f:r,(function(e,t,a,l){var y="ltr"==a,g=p(e,y?"left":"right"),b=p(t-1,y?"right":"left"),v=null==n&&0==e,_=null==r&&t==f,w=0==l,O=!m||l==m.length-1;if(b.top-g.top<=3){var k=(c?_:v)&&O,S=(c?v:_)&&w?u:(y?g:b).left,C=k?s:(y?b:g).right;d(S,g.top,C-S,g.bottom)}else{var E,P,T,M;y?(E=c&&v&&w?u:g.left,P=c?s:h(e,a,"before"),T=c?u:h(t,a,"after"),M=c&&_&&O?s:b.right):(E=c?h(e,a,"before"):u,P=!c&&v&&w?s:g.right,T=!c&&_&&O?u:b.left,M=c?h(t,a,"after"):s),d(E,g.top,P-E,g.bottom),g.bottom0?t.blinker=setInterval((function(){e.hasFocus()||eo(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Jr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Zr(e))}function Qr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&eo(e))}),100)}function Zr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,R(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Xr(e))}function eo(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function to(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),o=t.lineDiv.getBoundingClientRect().top,a=0,i=0;i.005||m<-.005)&&(oe.display.sizerWidth){var g=Math.ceil(f/Dr(e.display));g>e.display.maxLineLength&&(e.display.maxLineLength=g,e.display.maxLine=s.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function no(e){if(e.widgets)for(var t=0;t=i&&(a=ot(t,un(Ze(t,u))-e.wrapper.clientHeight),i=u)}return{from:a,to:Math.max(i,a+1)}}function oo(t,n){if(!_e(t,"scrollCursorIntoView")){var r=ET_Builder.Frames.top,o=t.display,a=o.sizer.getBoundingClientRect(),i=null;if(n.top+a.top<0?i=!0:n.bottom+a.top>(r.innerHeight||e.documentElement.clientHeight)&&(i=!1),null!=i&&!y){var l=x("div","\u200b",null,"position: absolute;\n top: "+(n.top-o.viewOffset-Kn(t.display))+"px;\n height: "+(n.bottom-n.top+Xn(t)+o.barHeight)+"px;\n left: "+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");t.display.lineSpace.appendChild(l),l.scrollIntoView(i),t.display.lineSpace.removeChild(l)}}}function ao(e,t,n,r){var o;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?lt(t.line,t.ch+1,"before"):t,t=t.ch?lt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var i=!1,l=wr(e,t),u=n&&n!=t?wr(e,n):l,s=lo(e,o={left:Math.min(l.left,u.left),top:Math.min(l.top,u.top)-r,right:Math.max(l.left,u.left),bottom:Math.max(l.bottom,u.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=s.scrollTop&&(mo(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(i=!0)),null!=s.scrollLeft&&(go(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(i=!0)),!i)break}return o}function io(e,t){var n=lo(e,t);null!=n.scrollTop&&mo(e,n.scrollTop),null!=n.scrollLeft&&go(e,n.scrollLeft)}function lo(e,t){var n=e.display,r=xr(e.display);t.top<0&&(t.top=0);var o=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,a=Qn(e),i={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+$n(n),u=t.topl-r;if(t.topo+a){var c=Math.min(t.top,(s?l:t.bottom)-a);c!=o&&(i.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Jn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?i.scrollLeft=0:t.leftp+f-3&&(i.scrollLeft=t.right+(h?0:10)-p),i}function uo(e,t){null!=t&&(po(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function so(e){po(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function co(e,t,n){null==t&&null==n||po(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function fo(e,t){po(e),e.curOp.scrollToPos=t}function po(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,ho(e,Or(e,t.from),Or(e,t.to),t.margin))}function ho(e,t,n,r){var o=lo(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});co(e,o.scrollLeft,o.scrollTop)}function mo(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||qo(e,{top:t}),yo(e,t,!0),r&&qo(e),Bo(e,100))}function yo(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function go(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bo(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+$n(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Xn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var vo=function(e,t,n){this.cm=n;var r=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),ye(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),ye(o,"scroll",(function(){o.clientWidth&&t(o.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&u<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vo.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vo.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vo.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vo.prototype.zeroWidthHack=function(){var e=_&&!m?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new V,this.disableVert=new V},vo.prototype.enableZeroWidthBar=function(t,n,r){function o(){var a=t.getBoundingClientRect();("vert"==r?e.elementFromPoint(a.right-1,(a.top+a.bottom)/2):e.elementFromPoint((a.right+a.left)/2,a.bottom-1))!=t?t.style.pointerEvents="none":n.set(1e3,o)}t.style.pointerEvents="auto",n.set(1e3,o)},vo.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var _o=function(){};function wo(e,t){t||(t=bo(e));var n=e.display.barWidth,r=e.display.barHeight;Oo(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&to(e),Oo(e,bo(e)),n=e.display.barWidth,r=e.display.barHeight}function Oo(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}_o.prototype.update=function(){return{bottom:0,right:0}},_o.prototype.setScrollLeft=function(){},_o.prototype.setScrollTop=function(){},_o.prototype.clear=function(){};var ko={native:vo,null:_o};function So(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ko[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ye(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?go(e,t):mo(e,t)}),e),e.display.scrollbars.addClass&&R(e.display.wrapper,e.display.scrollbars.addClass)}var Co=0;function Eo(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Co,markArrays:null},Pn(e.curOp)}function Po(e){var t=e.curOp;t&&Mn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function jo(e){e.updatedDisplay=e.mustUpdate&&Ho(e.cm,e.update)}function xo(e){var t=e.cm,n=t.display;e.updatedDisplay&&to(t),e.barMeasure=bo(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=nr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Xn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Jn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Do(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=wt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(a){if(r.line>=e.display.viewFrom){var i=a.styles,l=a.text.length>e.options.maxHighlightLength?Ye(t.mode,r.state):null,u=vt(e,a,r,!0);l&&(r.state=l),a.styles=u.styles;var s=a.styleClasses,c=u.classes;c?a.styleClasses=c:s&&(a.styleClasses=null);for(var d=!i||i.length!=a.styles.length||s!=c&&(!s||!c||s.bgClass!=c.bgClass||s.textClass!=c.textClass),f=0;!d&&fn)return Bo(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Lo(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hr(e))return!1;Jo(e)&&(Vr(e),t.dims=Nr(e));var o=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),i=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFromi&&n.viewTo-i<20&&(i=Math.min(o,n.viewTo)),Dt&&(a=rn(e.doc,a),i=on(e.doc,i));var l=a!=n.viewFrom||i!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gr(e,a,i),n.viewOffset=un(Ze(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=Hr(e);if(!l&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var s=Uo(e);return u>4&&(n.lineDiv.style.display="none"),Ko(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Go(s),M(n.cursorDiv),M(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Bo(e,400)),n.updateLineNumbers=null,!0}function zo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Jn(e))r&&(t.visible=ro(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+$n(e.display)-Qn(e),n.top)}),t.visible=ro(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ho(e,t))break;to(e);var o=bo(e);zr(e),wo(e,o),Yo(e,o),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qo(e,t){var n=new Wo(e,t);if(Ho(e,n)){to(e),zo(e,n);var r=bo(e);zr(e),wo(e,r),Yo(e,r),n.finish()}}function Ko(t,n,r){var o=t.display,a=t.options.lineNumbers,i=o.lineDiv,l=i.firstChild;function u(e){var n=e.nextSibling;return s&&_&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=o.view,d=o.viewFrom,f=0;f-1&&(h=!1),Nn(t,p,d,r)),h&&(M(p.lineNumber),p.lineNumber.appendChild(e.createTextNode(it(t.options,d)))),l=p.node.nextSibling}else{var m=Vn(t,p,d,r);i.insertBefore(m,l)}d+=p.size}for(;l;)l=u(l)}function $o(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",xn(e,"gutterChanged",e)}function Yo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Xn(e)+"px"}function Xo(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,a=r+"px",i=0;i=102&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var n=oa(t),o=n.x,a=n.y,i=ra;0===t.deltaMode&&(o=t.deltaX,a=t.deltaY,i=1);var l=e.display,u=l.scroller,c=u.scrollWidth>u.clientWidth,h=u.scrollHeight>u.clientHeight;if(o&&c||a&&h){if(a&&_&&s)e:for(var m=t.target,y=l.view;m!=u;m=m.parentNode)for(var g=0;g=0&&ut(e,r.to())<=0)return n}return-1};var ua=function(e,t){this.anchor=e,this.head=t};function sa(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort((function(e,t){return ut(e.from(),t.from())})),n=U(t,o);for(var a=1;a0:u>=0){var s=ft(l.from(),i.from()),c=dt(l.to(),i.to()),d=l.empty()?i.from()==i.head:l.from()==l.head;a<=n&&--n,t.splice(--a,2,new ua(d?c:s,d?s:c))}}return new la(t,n)}function ca(e,t){return new la([new ua(e,t||e)],0)}function da(e){return e.text?lt(e.from.line+e.text.length-1,J(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function fa(e,t){if(ut(e,t.from)<0)return e;if(ut(e,t.to)<=0)return da(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=da(t).ch-t.to.ch),lt(n,r)}function pa(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,h-1),e.insert(l.line+1,g)}xn(e,"change",e,t)}function _a(e,t,n){function r(e,o,a){if(e.linked)for(var i=0;i1&&!e.done[e.done.length-2].ranges?(e.done.pop(),J(e.done)):void 0}function Ta(e,t,n,r){var o=e.history;o.undone.length=0;var a,i,l=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=Pa(o,o.lastOp==r)))i=J(a.changes),0==ut(t.from,t.to)&&0==ut(t.from,i.to)?i.to=da(t):a.changes.push(Ca(e,t));else{var u=J(o.done);for(u&&u.ranges||xa(e.sel,o.done),a={changes:[Ca(e,t)],generation:o.generation},o.done.push(a);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=l,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,i||ve(e,"historyAdded")}function Ma(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ja(e,t,n,r){var o=e.history,a=r&&r.origin;n==o.lastSelOp||a&&o.lastSelOrigin==a&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==a||Ma(e,a,J(o.done),t))?o.done[o.done.length-1]=t:xa(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=a,o.lastSelOp=n,r&&!1!==r.clearRedo&&Ea(o.undone)}function xa(e,t){var n=J(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Da(e,t,n,r){var o=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[a]=n.markedSpans),++a}))}function Na(e){if(!e)return null;for(var t,n=0;n-1&&(J(l)[d]=s[d],delete s[d])}}}return r}function Ia(e,t,n,r){if(r){var o=e.anchor;if(n){var a=ut(t,o)<0;a!=ut(n,o)<0?(o=t,t=n):a!=ut(t,n)<0&&(t=n)}return new ua(o,t)}return new ua(n||t,t)}function Ba(e,t,n,r,o){null==o&&(o=e.cm&&(e.cm.display.shift||e.extend)),Ha(e,new la([Ia(e.sel.primary(),t,n,o)],0),r)}function Fa(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),a=0;a=t.ch:l.to>t.ch))){if(o&&(ve(u,"beforeCursorEnter"),u.explicitlyCleared)){if(a.markedSpans){--i;continue}break}if(!u.atomic)continue;if(n){var d=u.find(r<0?1:-1),f=void 0;if((r<0?c:s)&&(d=Ja(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=ut(d,n))&&(r<0?f<0:f>0))return Ya(e,d,t,r,o)}var p=u.find(r<0?-1:1);return(r<0?s:c)&&(p=Ja(e,p,r,p.line==t.line?a:null)),p?Ya(e,p,t,r,o):null}}return t}function Xa(e,t,n,r,o){var a=r||1,i=Ya(e,t,n,a,o)||!o&&Ya(e,t,n,a,!0)||Ya(e,t,n,-a,o)||!o&&Ya(e,t,n,-a,!0);return i||(e.cantEdit=!0,lt(e.first,0))}function Ja(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ht(e,lt(t.line-1)):null:n>0&&t.ch==(r||Ze(e,t.line)).text.length?t.line=0;--o)ti(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else ti(e,t)}}function ti(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ut(t.from,t.to)){var n=pa(e,t);Ta(e,t,n,e.cm?e.cm.curOp.id:NaN),oi(e,t,n,Vt(e,t));var r=[];_a(e,(function(e,n){n||-1!=U(r,e.history)||(si(e.history,t),r.push(e.history)),oi(e,t,null,Vt(e,t))}))}}function ni(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var o,a=e.history,i=e.sel,l="undo"==t?a.done:a.undone,u="undo"==t?a.undone:a.done,s=0;s=0;--p){var h=f(p);if(h)return h.v}}}}function ri(e,t){if(0!=t&&(e.first+=t,e.sel=new la(Q(e.sel.ranges,(function(e){return new ua(lt(e.anchor.line+t,e.anchor.ch),lt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Fr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linea&&(t={from:t.from,to:lt(a,Ze(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=et(e,t.from,t.to),n||(n=pa(e,t)),e.cm?ai(e.cm,t,r):va(e,t,r),za(e,n,z),e.cantEdit&&Xa(e,lt(e.firstLine(),0))&&(e.cantEdit=!1)}}function ai(e,t,n){var r=e.doc,o=e.display,a=t.from,i=t.to,l=!1,u=a.line;e.options.lineWrapping||(u=rt(en(Ze(r,a.line))),r.iter(u,i.line+1,(function(e){if(e==o.maxLine)return l=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&we(e),va(r,t,n,Rr(e)),e.options.lineWrapping||(r.iter(u,a.line+t.text.length,(function(e){var t=sn(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),jt(r,a.line),Bo(e,400);var s=t.text.length-(i.line-a.line)-1;t.full?Fr(e):a.line!=i.line||1!=t.text.length||ba(e.doc,t)?Fr(e,a.line,i.line+1,s):Wr(e,a.line,"text");var c=Oe(e,"changes"),d=Oe(e,"change");if(d||c){var f={from:a,to:i,text:t.text,removed:t.removed,origin:t.origin};d&&xn(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ii(e,t,n,r,o){var a;r||(r=n),ut(r,n)<0&&(n=(a=[r,n])[0],r=a[1]),"string"==typeof t&&(t=e.splitLines(t)),ei(e,{from:n,to:r,text:t,origin:o})}function li(e,t,n,r){n1||!(this.children[0]instanceof di))){var l=[];this.collapse(l),this.children=[new di(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var i=o.lines.length%25+25,l=i;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==i&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=D("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Zt(e,t.line,t,n,a)||t.line!=n.line&&Zt(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt()}a.addToHistory&&Ta(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,u=t.line,s=e.cm;if(e.iter(u,n.line+1,(function(r){s&&a.collapsed&&!s.options.lineWrapping&&en(r)==s.display.maxLine&&(l=!0),a.collapsed&&u!=t.line&&nt(r,0),Bt(r,new Rt(a,u==t.line?t.ch:null,u==n.line?n.ch:null),e.cm&&e.cm.curOp),++u})),a.collapsed&&e.iter(t.line,n.line+1,(function(t){an(e,t)&&nt(t,0)})),a.clearOnEnter&&ye(a,"beforeCursorEnter",(function(){return a.clear()})),a.readOnly&&(Nt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++yi,a.atomic=!0),s){if(l&&(s.curOp.updateMaxLine=!0),a.collapsed)Fr(s,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var c=t.line;c<=n.line;c++)Wr(s,c,"text");a.atomic&&Ka(s.doc),xn(s,"markerAdded",s,a)}return a}gi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Eo(e),Oe(this,"clear")){var n=this.find();n&&xn(this,"clear",n.from,n.to)}for(var r=null,o=null,a=0;ae.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Fr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&xn(e,"markerCleared",e,this,r,o),t&&Po(e),this.parent&&this.parent.clear()}},gi.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var o=0;o=0;u--)ei(this,r[u]);l?Ga(this,l):this.cm&&so(this.cm)})),undo:Io((function(){ni(this,"undo")})),redo:Io((function(){ni(this,"redo")})),undoSelection:Io((function(){ni(this,"undo",!0)})),redoSelection:Io((function(){ni(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=ht(this,e),t=ht(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,(function(a){var i=a.markedSpans;if(i)for(var l=0;l=u.to||null==u.from&&o!=e.line||null!=u.from&&o==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++o})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=a,++n})),ht(this,lt(n,t))},indexFromPos:function(e){var t=(e=ht(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),za(t.doc,ca(n,n)),f)for(var p=0;p=0;t--)ii(e.doc,"",r[t].from,r[t].to,"+delete");so(e)}))}function Yi(e,t,n){var r=ue(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Xi(e,t,n){var r=Yi(e,t.ch,n);return null==r?null:new lt(t.line,r,n<0?"after":"before")}function Ji(e,t,n,r,o){if(e){"rtl"==t.doc.direction&&(o=-o);var a=he(n,t.doc.direction);if(a){var i,l=o<0?J(a):a[0],u=o<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var s=or(t,n);i=o<0?n.text.length-1:0;var c=ar(t,s,i).top;i=se((function(e){return ar(t,s,e).top==c}),o<0==(1==l.level)?l.from:l.to-1,i),"before"==u&&(i=Yi(n,i,1))}else i=o<0?l.to:l.from;return new lt(r,i,u)}}return new lt(r,o<0?n.text.length:0,o<0?"before":"after")}function Qi(e,t,n,r){var o=he(t,e.doc.direction);if(!o)return Xi(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=fe(o,n.ch,n.sticky),i=o[a];if("ltr"==e.doc.direction&&i.level%2==0&&(r>0?i.to>n.ch:i.from=i.from&&f>=c.begin)){var p=d?"before":"after";return new lt(n.line,f,p)}}var h=function(e,t,r){for(var a=function(e,t){return t?new lt(n.line,u(e,1),"before"):new lt(n.line,e,"after")};e>=0&&e0==(1!=i.level),s=l?r.begin:u(r.end,-1);if(i.from<=s&&s0?c.end:u(c.begin,-1);return null==y||r>0&&y==t.text.length||!(m=h(r>0?0:o.length-1,r,s(y)))?null:m}Wi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wi.default=_?Wi.macDefault:Wi.pcDefault;var Zi={selectAll:Qa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return $i(e,(function(t){if(t.empty()){var n=Ze(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new lt(o.line,o.ch+1),e.replaceRange(a.charAt(o.ch-1)+a.charAt(o.ch-2),lt(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var i=Ze(e.doc,o.line-1).text;i&&(o=new lt(o.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),lt(o.line-1,i.length-1),o,"+transpose"))}n.push(new ua(o,o))}e.setSelections(n)}))},newlineAndIndent:function(e){return Lo(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(ut((o=i.ranges[o]).from(),t)<0||t.xRel>0)&&(ut(o.to(),t)>0||t.xRel<0)?Sl(e,r,t,a):El(e,r,t,a)}function Sl(e,t,n,r){var o=e.display,a=!1,i=Ro(e,(function(t){s&&(o.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Qr(e)),be(o.wrapper.ownerDocument,"mouseup",i),be(o.wrapper.ownerDocument,"mousemove",c),be(o.scroller,"dragstart",d),be(o.scroller,"drop",i),a||(Se(t),r.addNew||Ba(e.doc,n,null,null,r.extend),s&&!h||l&&9==u?setTimeout((function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()}),20):o.input.focus())})),c=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};s&&(o.scroller.draggable=!0),e.state.draggingText=i,i.copy=!r.moveOnDrag,ye(o.wrapper.ownerDocument,"mouseup",i),ye(o.wrapper.ownerDocument,"mousemove",c),ye(o.scroller,"dragstart",d),ye(o.scroller,"drop",i),e.state.delayingBlurEvent=!0,setTimeout((function(){return o.input.focus()}),20),o.scroller.dragDrop&&o.scroller.dragDrop()}function Cl(e,t,n){if("char"==n)return new ua(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ua(lt(t.line,0),ht(e.doc,lt(t.line+1,0)));var r=n(e,t);return new ua(r.from,r.to)}function El(e,t,n,r){l&&Qr(e);var o=e.display,a=e.doc;Se(t);var i,u,s=a.sel,c=s.ranges;if(r.addNew&&!r.extend?(u=a.sel.contains(n),i=u>-1?c[u]:new ua(n,n)):(i=a.sel.primary(),u=a.sel.primIndex),"rectangle"==r.unit)r.addNew||(i=new ua(n,n)),n=Ir(e,t,!0,!0),u=-1;else{var d=Cl(e,n,r.unit);i=r.extend?Ia(i,d.anchor,d.head,r.extend):d}r.addNew?-1==u?(u=c.length,Ha(a,sa(e,c.concat([i]),u),{scroll:!1,origin:"*mouse"})):c.length>1&&c[u].empty()&&"char"==r.unit&&!r.extend?(Ha(a,sa(e,c.slice(0,u).concat(c.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),s=a.sel):Wa(a,u,i,q):(u=0,Ha(a,new la([i],0),q),s=a.sel);var f=n;function p(t){if(0!=ut(f,t))if(f=t,"rectangle"==r.unit){for(var o=[],l=e.options.tabSize,c=W(Ze(a,n.line).text,n.ch,l),d=W(Ze(a,t.line).text,t.ch,l),p=Math.min(c,d),h=Math.max(c,d),m=Math.min(n.line,t.line),y=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=y;m++){var g=Ze(a,m).text,b=$(g,p,l);p==h?o.push(new ua(lt(m,b),lt(m,b))):g.length>b&&o.push(new ua(lt(m,b),lt(m,$(g,h,l))))}o.length||o.push(new ua(n,n)),Ha(a,sa(e,s.ranges.slice(0,u).concat(o),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var v,_=i,w=Cl(e,t,r.unit),O=_.anchor;ut(w.anchor,O)>0?(v=w.head,O=ft(_.from(),w.anchor)):(v=w.anchor,O=dt(_.to(),w.head));var k=s.ranges.slice(0);k[u]=Pl(e,new ua(ht(a,O),v)),Ha(a,sa(e,k,u),q)}}var h=o.wrapper.getBoundingClientRect(),m=0;function y(t){var n=++m,i=Ir(e,t,!0,"rectangle"==r.unit);if(i)if(0!=ut(i,f)){e.curOp.focus=L(),p(i);var l=ro(o,a);(i.line>=l.to||i.lineh.bottom?20:0;u&&setTimeout(Ro(e,(function(){m==n&&(o.scroller.scrollTop+=u,y(t))})),50)}}function g(t){e.state.selectingText=!1,m=1/0,t&&(Se(t),o.input.focus()),be(o.wrapper.ownerDocument,"mousemove",b),be(o.wrapper.ownerDocument,"mouseup",v),a.history.lastSelOrigin=null}var b=Ro(e,(function(e){0!==e.buttons&&Me(e)?y(e):g(e)})),v=Ro(e,g);e.state.selectingText=v,ye(o.wrapper.ownerDocument,"mousemove",b),ye(o.wrapper.ownerDocument,"mouseup",v)}function Pl(e,t){var n=t.anchor,r=t.head,o=Ze(e.doc,n.line);if(0==ut(n,r)&&n.sticky==r.sticky)return t;var a=he(o);if(!a)return t;var i=fe(a,n.ch,n.sticky),l=a[i];if(l.from!=n.ch&&l.to!=n.ch)return t;var u,s=i+(l.from==n.ch==(1!=l.level)?0:1);if(0==s||s==a.length)return t;if(r.line!=n.line)u=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=fe(a,r.ch,r.sticky),d=c-i||(r.ch-n.ch)*(1==l.level?-1:1);u=c==s-1||c==s?d<0:d>0}var f=a[s+(u?-1:0)],p=u==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new ua(new lt(n.line,h,m),r)}function Tl(e,t,n,r){var o,a;if(t.touches)o=t.touches[0].clientX,a=t.touches[0].clientY;else try{o=t.clientX,a=t.clientY}catch(e){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Se(t);var i=e.display,l=i.lineDiv.getBoundingClientRect();if(a>l.bottom||!Oe(e,n))return Ee(t);a-=l.top-i.viewOffset;for(var u=0;u=o)return ve(e,n,e,ot(e.doc,a),e.display.gutterSpecs[u].className,t),Ee(t)}}function Ml(e,t){return Tl(e,t,"gutterClick",!0)}function jl(e,t){qn(e.display,t)||xl(e,t)||_e(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function xl(e,t){return!!Oe(e,"gutterContextMenu")&&Tl(e,t,"gutterContextMenu",!1)}function Dl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(e)}bl.prototype.compare=function(e,t,n){return this.time+gl>e&&0==ut(t,this.pos)&&n==this.button};var Nl={toString:function(){return"CodeMirror.Init"}},Ll={},Rl={};function Al(e){var t=e.optionHandlers;function n(n,r,o,a){e.defaults[n]=r,o&&(t[n]=a?function(e,t,n){n!=Nl&&o(e,t,n)}:o)}e.defineOption=n,e.Init=Nl,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,ya(e)}),!0),n("indentUnit",2,ya,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){ga(e),hr(e),Fr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var o=0;;){var a=e.text.indexOf(t,o);if(-1==a)break;o=a+t.length,n.push(lt(r,a))}r++}));for(var o=n.length-1;o>=0;o--)ii(e.doc,t,n[o],lt(n[o].line,n[o].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Nl&&e.refresh()})),n("specialCharPlaceholder",bn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!O),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Dl(e),ea(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Ki(t),o=n!=Nl&&Ki(n);o&&o.detach&&o.detach(e,r),r.attach&&r.attach(e,o||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Bl,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Qo(t,e.options.lineNumbers),ea(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return wo(e)}),!0),n("scrollbarStyle","native",(function(e){So(e),wo(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Qo(e.options.gutters,t),ea(e)}),!0),n("firstLineNumber",1,ea,!0),n("lineNumberFormatter",(function(e){return e}),ea,!0),n("showCursorWhenSelecting",!1,zr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(eo(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Il),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,zr,!0),n("singleCursorHeightPerLine",!0,zr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ga,!0),n("addModeClass",!1,ga,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,ga,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Il(e,t,n){if(!t!=!(n&&n!=Nl)){var r=e.display.dragFunctions,o=t?ye:be;o(e.display.scroller,"dragstart",r.start),o(e.display.scroller,"dragenter",r.enter),o(e.display.scroller,"dragover",r.over),o(e.display.scroller,"dragleave",r.leave),o(e.display.scroller,"drop",r.drop)}}function Bl(e){e.options.lineWrapping?(R(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),cn(e)),Ar(e),Fr(e),hr(e),setTimeout((function(){return wo(e)}),100)}function Fl(e,t){var n=this;if(!(this instanceof Fl))return new Fl(e,t);this.options=t=t?F(t):{},F(Ll,t,!1);var r=t.value;"string"==typeof r?r=new Ci(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new Fl.inputStyles[t.inputStyle](this),a=this.display=new ta(e,r,o,t);for(var i in a.wrapper.CodeMirror=this,Dl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),So(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new V,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),l&&u<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Wl(this),Ni(),Eo(this),this.curOp.forceUpdate=!0,wa(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Zr(n)}),20):eo(this),Rl)Rl.hasOwnProperty(i)&&Rl[i](this,t[i],Nl);Jo(this),t.finishInit&&t.finishInit(this);for(var c=0;c400}ye(t.scroller,"touchstart",(function(o){if(!_e(e,o)&&!a(o)&&!Ml(e,o)){t.input.ensurePolled(),clearTimeout(n);var i=+new Date;t.activeTouch={start:i,moved:!1,prev:i-r.end<=300?r:null},1==o.touches.length&&(t.activeTouch.left=o.touches[0].pageX,t.activeTouch.top=o.touches[0].pageY)}})),ye(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),ye(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!qn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,l=e.coordsChar(t.activeTouch,"page");a=!r.prev||i(r,r.prev)?new ua(l,l):!r.prev.prev||i(r,r.prev.prev)?e.findWordAt(l):new ua(lt(l.line,0),ht(e.doc,lt(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Se(n)}o()})),ye(t.scroller,"touchcancel",o),ye(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(mo(e,t.scroller.scrollTop),go(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),ye(t.scroller,"mousewheel",(function(t){return ia(e,t)})),ye(t.scroller,"DOMMouseScroll",(function(t){return ia(e,t)})),ye(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){_e(e,t)||Pe(t)},over:function(t){_e(e,t)||(Mi(e,t),Pe(t))},start:function(t){return Ti(e,t)},drop:Ro(e,Pi),leave:function(t){_e(e,t)||ji(e)}};var s=t.input.getField();ye(s,"keyup",(function(t){return pl.call(e,t)})),ye(s,"keydown",Ro(e,dl)),ye(s,"keypress",Ro(e,hl)),ye(s,"focus",(function(t){return Zr(e,t)})),ye(s,"blur",(function(t){return eo(e,t)}))}Fl.defaults=Ll,Fl.optionHandlers=Rl;var Vl=[];function Ul(e,t,n,r){var o,a=e.doc;null==n&&(n="add"),"smart"==n&&(a.mode.indent?o=wt(e,t).state:n="prev");var i=e.options.tabSize,l=Ze(a,t),u=W(l.text,null,i);l.stateAfter&&(l.stateAfter=null);var s,c=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&((s=a.mode.indent(o,l.text.slice(c.length),l.text))==H||s>150)){if(!r)return;n="prev"}}else s=0,n="not";"prev"==n?s=t>a.first?W(Ze(a,t-1).text,null,i):0:"add"==n?s=u+e.options.indentUnit:"subtract"==n?s=u-e.options.indentUnit:"number"==typeof n&&(s=u+n),s=Math.max(0,s);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(s/i);p;--p)f+=i,d+="\t";if(fi,u=Ae(t),s=null;if(l&&r.ranges.length>1)if(Gl&&Gl.text.join("\n")==t){if(r.ranges.length%Gl.text.length==0){s=[];for(var c=0;c=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=lt(h.line,h.ch-n):e.state.overwrite&&!l?m=lt(m.line,Math.min(Ze(a,m.line).text.length,m.ch+J(u).length)):l&&Gl&&Gl.lineWise&&Gl.text.join("\n")==u.join("\n")&&(h=m=lt(h.line,0)));var y={from:h,to:m,text:s?s[f%s.length]:u,origin:o||(l?"paste":e.state.cutIncoming>i?"cut":"+input")};ei(e.doc,y),xn(e,"inputRead",e,y)}t&&!l&&Kl(e,t),so(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ql(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Lo(t,(function(){return zl(t,n,0,null,"paste")})),!0}function Kl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var a=e.getModeAt(o.head),i=!1;if(a.electricChars){for(var l=0;l-1){i=Ul(e,o.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ze(e.doc,o.head.line).text.slice(0,o.head.ch))&&(i=Ul(e,o.head.line,"smart"));i&&xn(e,"electricInput",e,o.head.line)}}}function $l(e){for(var t=[],n=[],r=0;rn&&(Ul(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&so(this));else{var a=o.from(),i=o.to(),l=Math.max(n,a.line);n=Math.min(this.lastLine(),i.line-(i.ch?0:1))+1;for(var u=l;u0&&Wa(this.doc,r,new ua(a,s[r].to()),z)}}})),getTokenAt:function(e,t){return Et(this,e,t)},getLineTokens:function(e,t){return Et(this,lt(e),t,!0)},getTokenTypeAt:function(e){e=ht(this.doc,e);var t,n=_t(this,Ze(this.doc,e.line)),r=0,o=(n.length-1)/2,a=e.ch;if(0==a)t=n[2];else for(;;){var i=r+o>>1;if((i?n[2*i-1]:0)>=a)o=i;else{if(!(n[2*i+1]a&&(e=a,o=!0),r=Ze(this.doc,e)}else r=e;return br(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-un(r):0)},defaultTextHeight:function(){return xr(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var a=this.display,i=(e=wr(this,ht(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==r)i=e.top;else if("above"==r||"near"==r){var u=Math.max(a.wrapper.clientHeight,this.doc.height),s=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?i=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(i=e.bottom),l+t.offsetWidth>s&&(l=s-t.offsetWidth)}t.style.top=i+"px",t.style.left=t.style.right="","right"==o?(l=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?l=0:"middle"==o&&(l=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&io(this,{left:l,top:i,right:l+t.offsetWidth,bottom:i+t.offsetHeight})},triggerOnKeyDown:Ao(dl),triggerOnKeyPress:Ao(hl),triggerOnKeyUp:pl,triggerOnMouseDown:Ao(_l),execCommand:function(e){if(Zi.hasOwnProperty(e))return Zi[e].call(null,this)},triggerElectric:Ao((function(e){Kl(this,e)})),findPosH:function(e,t,n,r){var o=1;t<0&&(o=-1,t=-t);for(var a=ht(this.doc,e),i=0;i0&&i(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Ar(this),ve(this,"refresh",this)})),swapDoc:Ao((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),wa(this,e),hr(this),this.display.input.reset(),co(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,xn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ke(e),e.registerHelper=function(t,r,o){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=o},e.registerGlobalHelper=function(t,r,o,a){e.registerHelper(t,r,a),n[t]._global.push({pred:o,val:a})}}function Ql(e,t,n,r,o){var a=t,i=n,l=Ze(e,t.line),u=o&&"rtl"==e.direction?-n:n;function s(){var n=t.line+u;return!(n=e.first+e.size)&&(t=new lt(n,t.ch,t.sticky),l=Ze(e,n))}function c(a){var i;if("codepoint"==r){var c=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))i=null;else{var d=n>0?c>=55296&&c<56320:c>=56320&&c<57343;i=new lt(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(d?2:1))),-n)}}else i=o?Qi(e.cm,l,t,n):Xi(l,t,n);if(null==i){if(a||!s())return!1;t=Ji(o,e.cm,l,t.line,u)}else t=i;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=l.text.charAt(t.ch)||"\n",y=oe(m,p)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||h||y||(y="s"),d&&d!=y){n<0&&(n=1,c(),t.sticky="after");break}if(y&&(d=y),n>0&&!c(!h))break}var g=Xa(e,t,a,i,!0);return st(a,g)&&(g.hitSide=!0),g}function Zl(t,n,r,o){var a,i,l=t.doc,u=n.left;if("page"==o){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||e.documentElement.clientHeight),c=Math.max(s-.5*xr(t.display),3);a=(r>0?n.bottom:n.top)+r*c}else"line"==o&&(a=r>0?n.bottom+3:n.top-3);for(;(i=Sr(t,u,a)).outside;){if(r<0?a<=0:a>=l.height){i.hitSide=!0;break}a+=5*r}return i}var eu=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function tu(e,t){var n=rr(e,t.line);if(!n||n.hidden)return null;var r=Ze(e.doc,t.line),o=er(n,r,t.line),a=he(r,e.doc.direction),i="left";a&&(i=fe(a,t.ch)%2?"right":"left");var l=ur(o.map,t.ch,i);return l.offset="right"==l.collapse?l.end:l.start,l}function nu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ru(e,t){return t&&(e.bad=!0),e}function ou(e,t,n,r,o){var a="",i=!1,l=e.doc.lineSeparator(),u=!1;function s(e){return function(t){return t.id==e}}function c(){i&&(a+=l,u&&(a+=l),i=u=!1)}function d(e){e&&(c(),a+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var a,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(lt(r,0),lt(o+1,0),s(+p));return void(h.length&&(a=h[0].find(0))&&d(et(e.doc,a.from,a.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var y=0;y=t.display.viewTo||a.line=t.display.viewFrom&&tu(t,o)||{node:u[0].measure.map[2],offset:0},c=a.liner.firstLine()&&(i=lt(i.line-1,Ze(r.doc,i.line-1).length)),l.ch==Ze(r.doc,l.line).text.length&&l.lineo.viewTo-1)return!1;i.line==o.viewFrom||0==(e=Br(r,i.line))?(t=rt(o.view[0].line),n=o.view[0].node):(t=rt(o.view[e].line),n=o.view[e-1].node.nextSibling);var u,s,c=Br(r,l.line);if(c==o.view.length-1?(u=o.viewTo-1,s=o.lineDiv.lastChild):(u=rt(o.view[c+1].line)-1,s=o.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(ou(r,n,s,t,u)),f=et(r.doc,lt(t,0),lt(u,Ze(r.doc,u).text.length));d.length>1&&f.length>1;)if(J(d)==J(f))d.pop(),f.pop(),u--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],y=f[0],g=Math.min(m.length,y.length);pi.ch&&b.charCodeAt(b.length-h-1)==v.charCodeAt(v.length-h-1);)p--,h++;d[d.length-1]=b.slice(0,b.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var w=lt(t,p),O=lt(u,f.length?J(f).length-h:0);return d.length>1||d[0]||ut(w,O)?(ii(r.doc,d,w,O,"+input"),!0):void 0},eu.prototype.ensurePolled=function(){this.forceCompositionEnd()},eu.prototype.reset=function(){this.forceCompositionEnd()},eu.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},eu.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},eu.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Lo(this.cm,(function(){return Fr(e.cm)}))},eu.prototype.setUneditable=function(e){e.contentEditable="false"},eu.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ro(this.cm,zl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},eu.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},eu.prototype.onContextMenu=function(){},eu.prototype.resetPosition=function(){},eu.prototype.needsContentAttribute=!0;var lu=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};function uu(t,n){if((n=n?F(n):{}).value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var r=L();n.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==e.body}function o(){t.value=u.getValue()}var a;if(t.form&&(ye(t.form,"submit",o),!n.leaveSubmitMethodAlone)){var i=t.form;a=i.submit;try{var l=i.submit=function(){o(),i.submit=a,i.submit(),i.submit=l}}catch(e){}}n.finishInit=function(e){e.save=o,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,o(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(be(t.form,"submit",o),n.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=a))}},t.style.display="none";var u=Fl((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),n);return u}function su(e){e.off=be,e.on=ye,e.wheelEventPixels=aa,e.Doc=Ci,e.splitLines=Ae,e.countColumn=W,e.findColumn=$,e.isWordChar=re,e.Pass=H,e.signal=ve,e.Line=dn,e.changeEnd=da,e.scrollbarModel=ko,e.Pos=lt,e.cmpPos=ut,e.modes=Ve,e.mimeModes=Ue,e.resolveMode=ze,e.getMode=qe,e.modeExtensions=Ke,e.extendMode=$e,e.copyState=Ye,e.startState=Je,e.innerMode=Xe,e.commands=Zi,e.keyMap=Wi,e.keyName=qi,e.isModifierKey=Hi,e.lookupKey=Gi,e.normalizeKeyMap=Ui,e.StringStream=Qe,e.SharedTextMarker=vi,e.TextMarker=gi,e.LineWidget=pi,e.e_preventDefault=Se,e.e_stopPropagation=Ce,e.e_stop=Pe,e.addClass=R,e.contains=N,e.rmClass=T,e.keyNames=Ai}lu.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var o=this.textarea;function a(e){if(!_e(r,e)){if(r.somethingSelected())Hl({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=$l(r);Hl({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,z):(n.prevInput="",o.value=t.text.join("\n"),I(o))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(o.style.width="0px"),ye(o,"input",(function(){l&&u>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),ye(o,"paste",(function(e){_e(r,e)||ql(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),ye(o,"cut",a),ye(o,"copy",a),ye(e.scroller,"paste",(function(t){if(!qn(e,t)&&!_e(r,t)){if(!o.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var a=new Event("paste");a.clipboardData=t.clipboardData,o.dispatchEvent(a)}})),ye(e.lineSpace,"selectstart",(function(t){qn(e,t)||Se(t)})),ye(o,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),ye(o,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},lu.prototype.createField=function(e){this.wrapper=Xl(),this.textarea=this.wrapper.firstChild},lu.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},lu.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=qr(e);if(e.options.moveInputWithCursor){var o=wr(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),i=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+i.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+i.left-a.left))}return r},lu.prototype.showSelection=function(e){var t=this.cm.display;j(t.cursorDiv,e.cursors),j(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},lu.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),l&&u>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&u>=9&&(this.hasSelection=null))}},lu.prototype.getField=function(){return this.textarea},lu.prototype.supportsTouch=function(){return!1},lu.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},lu.prototype.blur=function(){this.textarea.blur()},lu.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},lu.prototype.receivedFocus=function(){this.slowPoll()},lu.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},lu.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},lu.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(l&&u>=9&&this.hasSelection===o||_&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=o.charCodeAt(0);if(8203!=a||r||(r="\u200b"),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var i=0,s=Math.min(r.length,o.length);i1e3||o.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},lu.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},lu.prototype.onKeyPress=function(){l&&u>=9&&(this.hasSelection=null),this.fastPoll()},lu.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Ir(n,e),i=r.scroller.scrollTop;if(a&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(a)&&Ro(n,Ha)(n.doc,ca(a),z);var c,d=o.style.cssText,f=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(c=window.scrollY),r.input.focus(),s&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&u>=9&&y(),C){Pe(e);var m=function(){be(window,"mouseup",m),setTimeout(g,20)};ye(window,"mouseup",m)}else setTimeout(g,50)}function y(){if(null!=o.selectionStart){var e=n.somethingSelected(),a="\u200b"+(e?o.value:"");o.value="\u21da",o.value=a,t.prevInput=e?"":"\u200b",o.selectionStart=1,o.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,o.style.cssText=d,l&&u<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=i),null!=o.selectionStart)){(!l||l&&u<9)&&y();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"\u200b"==t.prevInput?Ro(n,Qa)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}},lu.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},lu.prototype.setUneditable=function(){},lu.prototype.needsContentAttribute=!1,Al(Fl),Jl(Fl);var cu="iter insert remove copy getEditor constructor".split(" ");for(var du in Ci.prototype)Ci.prototype.hasOwnProperty(du)&&U(cu,du)<0&&(Fl.prototype[du]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ci.prototype[du]));return ke(Ci),Fl.inputStyles={textarea:lu,contenteditable:eu},Fl.defineMode=function(e){Fl.defaults.mode||"null"==e||(Fl.defaults.mode=e),Ge.apply(this,arguments)},Fl.defineMIME=He,Fl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Fl.defineMIME("text/plain","null"),Fl.defineExtension=function(e,t){Fl.prototype[e]=t},Fl.defineDocExtension=function(e,t){Ci.prototype[e]=t},Fl.fromTextArea=uu,su(Fl),Fl.version="5.65.5",Fl}()},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,l){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,o,a,i,l],c=0;(u=new Error(t.replace(/%s/g,(function(){return s[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=pe(n(1)),o=pe(n(34)),a=pe(n(11)),i=pe(n(5)),l=pe(n(7)),u=n(1504),s=pe(n(839)),c=pe(n(632)),d=pe(n(1505)),f=pe(n(792)),p=pe(n(1531)),h=pe(n(1633)),m=pe(n(1640)),y=pe(n(1642)),g=pe(n(1507)),b=pe(n(1532)),v=pe(n(1533)),_=pe(n(1646)),w=pe(n(1488)),O=pe(n(1538)),k=pe(n(1539)),S=pe(n(616)),C=pe(n(1673)),E=pe(n(1676)),P=pe(n(1677)),T=pe(n(1678)),M=pe(n(1679)),j=pe(n(1684)),x=pe(n(1686)),D=pe(n(457)),N=pe(n(1688)),L=pe(n(1489)),R=pe(n(1691)),A=pe(n(1693)),I=pe(n(1695)),B=pe(n(1540)),F=pe(n(1697)),W=pe(n(1542)),V=pe(n(1704)),U=pe(n(1716)),G=pe(n(1718)),H=pe(n(1720)),z=pe(n(1740)),q=pe(n(1550)),K=pe(n(1746)),$=pe(n(1748)),Y=pe(n(1750)),X=pe(n(1555)),J=pe(n(1752)),Q=n(1557),Z=n(1755),ee=pe(n(1756)),te=pe(n(1758)),ne=pe(n(1773)),re=pe(n(1836)),oe=pe(n(1487)),ae=pe(n(1839)),ie=pe(n(1840)),le=pe(n(1841)),ue=pe(n(1842)),se=pe(n(1844)),ce=pe(n(1845)),de=pe(n(1846)),fe=pe(n(1847));function pe(e){return e&&e.__esModule?e:{default:e}}function he(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n10&&r(!0)}),[e.items]);var y=(0,o.default)((function(t){t.scrollHeight-t.scrollTop-100<=t.clientHeight&&!e.isLoading&&e.currentPage0&&a.default.createElement(u.default,{name:"multiselect-selected-checkboxes",className:"et-fb-multiselect-selected-items",options:h,_onChange:function(t,n){var r=n.split("|").filter((function(e){return e}));c(d(r));var o=h.filter((function(e){return r.includes(e.value)}));m(o),e.onDeselect()},value:s.join("|")}),v.length>0||e.isLoading?a.default.createElement(u.default,{name:"multiselect-deselected-checkboxes",className:"et-fb-multiselect-deselected-items",options:v,_onChange:function(t,n){var r=n.split("|").filter((function(e){return e}));c((function(e){return[].concat(d(e),d(r))}));var o=b.filter((function(e){return r.includes(e.value)}));m((function(e){return[].concat(d(e),d(o))})),e.onSelect()},loading:e.isLoading,"data-testid":"deselected-checkboxes"}):a.default.createElement("div",{className:"et-fb-multiselect-not-found"},"No results found."))))};m.propTypes={onSelect:i.default.func,onDeselect:i.default.func,onSearch:i.default.func,onScrollLoad:i.default.func,onUpdate:i.default.func,isLoading:i.default.bool,isSearchable:i.default.bool,currentPage:i.default.number,totalPages:i.default.number,items:i.default.array.isRequired,value:i.default.array,className:i.default.string},m.defaultProps={onSelect:function(){},onDeselect:function(){},onSearch:function(){},onScrollLoad:function(){},onUpdate:function(){},isLoading:!1,isSearchable:!0,currentPage:1,totalPages:1,items:[],value:[],className:""},m.displayName="ETBuilderMultiselect";var y=m;t.default=y},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=b(n(3)),i=b(n(5)),l=b(n(10)),u=b(n(332)),s=b(n(31)),c=b(n(335)),d=b(n(125)),f=b(n(11)),p=b(n(37)),h=b(n(849)),m=b(n(7)),y=b(n(16)),g=b(n(2));function b(e){return e&&e.__esModule?e:{default:e}}function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"",n=(0,u.default)(e),r=this.props;if(!(0,s.default)(r.order)){var f=(0,c.default)(r.order,String);n=(0,i.default)((0,o.default)(f,n),(0,a.default)(n,f))}return(0,c.default)(n,(function(n){var r=(0,l.default)(e,n),o=n;return""!==t&&(o="".concat(t,"-").concat(n)),d.default.createElement(p.default,{key:o,value:n,name:r})}))}}],n&&y(t.prototype,n),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),h}(f.default),O=w;t.default=O},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),i=c(n(3)),l=n(1518),u=c(n(1522)),s=n(286);function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0,clientOffset:null},n=t.publishSource,r=t.clientOffset,l=t.getSourceClientOffset;(0,o.default)((0,a.default)(e),"Expected sourceIds to be an array.");var u=this.getMonitor(),c=this.getRegistry();(0,o.default)(!u.isDragging(),"Cannot call beginDrag while dragging.");for(var d=0;d=0;p--)if(u.canDragSource(e[p])){f=e[p];break}if(null===f)return;var h=null;r&&((0,o.default)("function"==typeof l,"When clientOffset is provided, getSourceClientOffset must be a function."),h=l(f));var m=c.getSource(f),y=m.beginDrag(u,f);(0,o.default)((0,i.default)(y),"Item must be an object."),c.pinSource(f);var g=c.getSourceType(f);return{type:s,itemType:g,item:y,sourceId:f,clientOffset:r,sourceClientOffset:h,isSourcePublic:n}},t.publishDragSource=function(){if(!this.getMonitor().isDragging())return;return{type:c}},t.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clientOffset,r=void 0===n?null:n;(0,o.default)((0,a.default)(e),"Expected targetIds to be an array.");var i=e.slice(0),u=this.getMonitor(),s=this.getRegistry();(0,o.default)(u.isDragging(),"Cannot call hover while not dragging."),(0,o.default)(!u.didDrop(),"Cannot call hover after drop.");for(var c=0;c=0;m--){var y=i[m],g=s.getTargetType(y);(0,l.default)(g,h)||i.splice(m,1)}for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:{},n=this.getMonitor(),a=this.getRegistry();(0,o.default)(n.isDragging(),"Cannot call drop while not dragging."),(0,o.default)(!n.didDrop(),"Cannot call drop twice during one drag operation.");var l=n.getTargetIds().filter(n.canDropOnTarget,n);l.reverse(),l.forEach((function(l,u){var s=a.getTarget(l).drop(n,l);(0,o.default)(void 0===s||(0,i.default)(s),"Drop result must either be an object or undefined."),void 0===s&&(s=0===u?{}:n.getDropResult()),e.store.dispatch({type:f,dropResult:r({},t,s)})}))},t.endDrag=function(){var e=this.getMonitor(),t=this.getRegistry();(0,o.default)(e.isDragging(),"Cannot call endDrag while not dragging.");var n=e.getSourceId();return t.getSource(n,true).endDrag(e,n),t.unpinSource(),{type:p}};var o=u(n(1483)),a=u(n(4)),i=u(n(12)),l=u(n(1520));function u(e){return e&&e.__esModule?e:{default:e}}var s=t.BEGIN_DRAG="dnd-core/BEGIN_DRAG",c=t.PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",d=t.HOVER="dnd-core/HOVER",f=t.DROP="dnd-core/DROP",p=t.END_DRAG="dnd-core/END_DRAG"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addSource=function(e){return{type:r,sourceId:e}},t.addTarget=function(e){return{type:o,targetId:e}},t.removeSource=function(e){return{type:a,sourceId:e}},t.removeTarget=function(e){return{type:i,targetId:e}};var r=t.ADD_SOURCE="dnd-core/ADD_SOURCE",o=t.ADD_TARGET="dnd-core/ADD_TARGET",a=t.REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",i=t.REMOVE_TARGET="dnd-core/REMOVE_TARGET"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){0}},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(0)),o=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}var i=function(e){return r.default.createElement("iframe",e)};i.propTypes={src:o.default.string.isRequired};var l=i;t.default=l},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=j(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=M(n(27)),i=M(n(3)),l=M(n(13)),u=M(n(10)),s=M(n(65)),c=M(n(9)),d=M(n(5)),f=M(n(11)),p=M(n(7)),h=M(n(17)),m=M(n(107)),y=M(n(40)),g=M(n(305)),b=M(n(1)),v=M(n(851)),_=n(60),w=M(n(1547)),O=M(n(616)),k=M(n(1732)),S=M(n(1548));n(1739);var C=M(n(2)),E=M(n(807)),P=n(400),T=n(511);function M(e){return e&&e.__esModule?e:{default:e}}function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(j=function(e){return e?n:t})(e)}function x(e,t){for(var n=0;n0&&n.length>0?i:0)+l;n.css({top:"".concat(u,"px")}),o.css({top:"".concat(u,"px")})}})),I(R(t),"isEnabledDynamicContent",(function(e){var t=e.dynamicAttributes,n=e.fieldName,r=e.value;return(0,p.default)(t,n)&&(0,_.isDynamicContent)(r)})),I(R(t),"getDynamicContentSettingsFields",(function(e,n){var r=t.getDynamicContentField(e).fields||{};return(0,g.default)(r,(function(e){return!(0,f.default)(e.show_on)&&e.show_on!==n}))})),I(R(t),"renderSelectionPlaceholderInput",(function(){var e="",n="";if(t.isTinyMCE()||t.state.fullText.length=u&&this.openSettings()}n&&!o&&((0,f.default)(this.controlRef.focus)||this.controlRef.focus()),this.isSelectionEnabled()&&this.isTinyMCE()&&(null===(t=this.selectionPlaceholderRef.current)||void 0===t||t.scrollIntoView({block:"center"})),this.updateButtonPositionForTinyMCE()}},{key:"render",value:function(){var e,t=this,n=(0,p.default)(["upload","background"],this.props.fieldType),r=this.isEnabledDynamicContent(this.props),a=(0,_.getDynamicContent)(this.props.value),i=this.getDynamicContentFieldOptions(this.props.type),u=!n||(0,d.default)(this.props.value),s=this.props,c=s.fieldName,f=(s.fieldType,s.children,o.default.cloneElement(this.props.children,{ref:function(e){return t.controlRef=e}}));if((0,d.default)(i))return o.default.createElement(o.Fragment,null,this.props.children);var h="";return"ETBuilderControlTinyMCE"===f.type.displayName&&(f=o.default.cloneElement(f,{onModeSwitch:this.updateButtonPositionForTinyMCE}),B||(0,d.default)(this.state.classModifier)||(this.props.modalWidth>=538&&this.props.modalWidth<998?h="".concat(this.state.classModifier,"-medium"):this.props.modalWidth>=998&&this.props.modalWidth<1202&&(h="".concat(this.state.classModifier,"-wide")))),o.default.createElement("div",{className:(0,l.default)((e={"et-fb-settings-option-dynamic":!0,"et-fb-settings-option-ai":!0},I(e,"et-fb-settings-option-dynamic--".concat(this.props.fieldType),!0),I(e,"et-fb-settings-option-dynamic--".concat(this.state.classModifier),this.state.classModifier),I(e,"et-fb-settings-option-dynamic--".concat(h),!!h),e))},r&&this.state.settingsOpen&&o.default.createElement(w.default,{title:this.getDynamicContentFieldLabel(a.content),fields:this.getDynamicContentSettingsFields(a.content,this.props.type),values:a.settings,onChange:this.handleSettingsChange,onSave:this.handleSettingsSave,onClose:this.closeSettings}),r&&o.default.createElement(k.default,{fieldType:this.props.fieldType,value:this.props.value,label:this.getDynamicContentFieldLabel(a.content),mode:this.props.previewMode,attributes:this.props.previewAttributes,settingsFields:this.props.showSettingsButton?this.getDynamicContentSettingsFields(a.content,this.props.type):{},showDisableButton:this.props.showDisableButton,showInheritButton:this.props.showInheritButton,dynamicEnabled:-1!==this.props.dynamicAttributes.indexOf(this.props.fieldName),onSettings:this.openSettings,onDisable:this.handleDisable,onInherit:this.handleInherit}),!r&&o.default.createElement(o.Fragment,null,o.default.createElement("div",{className:"et-fb-settings-option-select-discrete"},o.default.createElement(O.default,{ref:function(e){return t.selectRef=e},name:"".concat(this.props.fieldName,"_dynamic_content"),value:r?a.content:"",options:this.getDynamicContentFieldOptions(this.props.type),__onChange:this.handleDynamicContentChange,selectFirst:!1})),!this.isSelectionEnabled()&&f,this.isSelectionEnabled()&&this.renderSelectionPlaceholderInput(),u&&o.default.createElement(o.Fragment,null,o.default.createElement(S.default,{key:"dynamic-options",ref:function(e){return t.buttonRef=e},type:this.props.fieldType,icon:"dynamic",tooltip:ETBuilderBackend.i18n.dynamicContent.tooltips.enable,className:(0,l.default)("et-fb-settings-option-dynamic__enable","et-fb-settings-option-dynamic__enable--".concat(this.props.fieldType)),onClick:this.handleEnable}),!(0,P.shouldAvoidFieldForAI)(c)&&o.default.createElement(E.default,{ref:this.AIButtonRef,type:this.props.fieldType,className:(0,l.default)("et-fb-settings-option-ai__enable","et-fb-settings-option-ai__enable--".concat(this.props.fieldType)),selectedText:this.state.selectedText,onOpen:this.updateSelectionRage,onClose:function(){return t.setState({selectedText:""})},name:this.props.fieldName,value:r?a.content:this.getFieldValue(),label:this.props.children.props.label,tooltip:ETBuilderBackend.i18n.ai.tooltips.divi_ai_options}))))}}])&&x(t.prototype,n),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),y}(o.PureComponent);F.supportedFieldTypes=["text","tiny_mce","upload"],F.propTypes={children:i.default.element.isRequired,type:i.default.string.isRequired,fieldName:i.default.string.isRequired,fieldType:i.default.oneOf(F.supportedFieldTypes).isRequired,previewMode:i.default.oneOf(["image","background"]),previewAttributes:i.default.object,isContentField:i.default.bool,dynamicAttributes:i.default.arrayOf(i.default.string).isRequired,value:i.default.string.isRequired,showSettingsButton:i.default.bool,showDisableButton:i.default.bool,showInheritButton:i.default.bool,onChange:i.default.func,onReset:i.default.func,onInherit:i.default.func,modalWidth:i.default.number,defaultValue:i.default.oneOfType([i.default.string,i.default.number,i.default.bool])},F.defaultProps={previewMode:"image",previewAttributes:{},isContentField:!1,showSettingsButton:!0,showDisableButton:!0,showInheritButton:!1,defaultValue:"",onChange:y.default,onReset:y.default,onInherit:y.default};var W=F;t.default=W},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(var n=0,r=e.length;n1?1:this.getStep())}},{key:"onChange",value:function(e){this.props.readonly||(this.setUpdateSource(1),this.props.onChange((0,b.default)(this.getDefaultUnit(),e,this.sanitize,this.props.allowedUnits)))}},{key:"onIncrease",value:function(){this.props.readonly||(this.setUpdateSource(2),this.props.onChange((0,b.default)(this.getDefaultUnit(),this.getValue(),this.sanitizeIncrease,this.props.allowedUnits)))}},{key:"onDecrease",value:function(){this.props.readonly||(this.setUpdateSource(2),this.props.onChange((0,b.default)(this.getDefaultUnit(),this.getValue(),this.sanitizeDecrease,this.props.allowedUnits)))}},{key:"handleSpinnerChange",value:function(e,t){var n=t.shiftKey;this.setUpdateSource(3);var r=this.normalize((0,h.maybeInt)(e,0))*(n?10:1);0!==r&&this.props.onChange((0,b.default)(this.getDefaultUnit(),this.getValue(),(0,i.default)(this.sanitize,(0,c.default)(r)),this.props.allowedUnits))}},{key:"renderLabel",value:function(){return!(0,l.default)(this.props.label)&&o.default.createElement("span",{className:"et-fb-settings-option-input-label"},this.props.label)}},{key:"getValue",value:function(){var e=this.props.value||this.props.defaultValue||0;return(0,f.default)((0,h.maybeFloat)(e))?0:e}},{key:"getSpeed",value:function(){return Math.abs(this.props.speed)*(this.getStep()>=1?1:.1)}},{key:"getStep",value:function(){return this._step||this.props.step}},{key:"getDefaultUnit",value:function(){return(0,y.getUnit)(this.props.defaultValue,this.props.defaultUnit)}},{key:"makeActive",value:function(){this.setState({active:!0})}},{key:"makeInactive",value:function(){this.setState({active:!1})}},{key:"sanitize",value:function(e){return(0,h.range)(this.props.min,this.props.max,(0,h.toFixed)((0,h.getPrecision)(this.props.precision),e))}},{key:"setUpdateSource",value:function(e){this._updateSource=[e,(0,u.default)(this._updateSource||[void 0])];var t=this.getStep(),n=this.props.step,r=(0,h.getPrecision)(this.getNumericValue()),o=r>(0,h.getPrecision)(n)?(0,h.toPrecision)(r,n):this.isSameSource()?t:n;this._step=o}},{key:"isSameSource",value:function(){var e=this._updateSource||[void 0,void 0];return(0,u.default)(e)===(0,s.default)(e)}},{key:"render",value:function(){var e=this.state.active?"active":"";return o.default.createElement("div",{className:"et-fb-settings-option--numeric-spinner-control ".concat(e)},o.default.createElement(g.default,{id:this.props.id,onChange:this.onChange,onIncrease:this.onIncrease,onDecrease:this.onDecrease,value:this.props.value,step:this.getStep(),onFocus:this.makeActive,onBlur:this.makeInactive,placeholder:this.props.defaultValue,readonly:(0,d.default)(this.props,"readonly",!1)}),o.default.createElement("div",{className:"numeric-spinner-control-label-wrapper"},!this.props.readonly&&o.default.createElement(p.default,{onChange:this.handleSpinnerChange}),this.renderLabel()))}}])&&w(t.prototype,n),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(o.Component);E.propTypes={onChange:a.default.func.isRequired,step:a.default.number,precision:a.default.number,min:a.default.number,max:a.default.number,value:a.default.string,placeholder:a.default.string,defaultValue:a.default.string,defaultUnit:a.default.string,speed:a.default.number},E.defaultProps={step:1,min:-9999999999,max:9999999999,defaultValue:"",speed:.5,precision:.01};var P=E;t.default=P},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=g(n(332)),a=g(n(394)),i=g(n(40)),l=g(n(31)),u=g(n(37)),s=g(n(5)),c=g(n(7)),d=g(n(1)),f=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),p=g(n(16)),h=g(n(3)),m=n(2);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function g(e){return e&&e.__esModule?e:{default:e}}function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;tc);d++){var f=e.getLine(s++);o=null==o?f:o+"\n"+f}u*=2,t.lastIndex=n.ch;var p=t.exec(o);if(p){var h=o.slice(0,p.index).split("\n"),m=p[0].split("\n"),y=n.line+h.length-1,g=h[h.length-1].length;return{from:r(y,g),to:r(y+m.length-1,1==m.length?g+m[0].length:m[m.length-1].length),match:p}}}}function s(e,t,n){for(var r,o=0;o<=e.length;){t.lastIndex=o;var a=t.exec(e);if(!a)break;var i=a.index+a[0].length;if(i>e.length-n)break;(!r||i>r.index+r[0].length)&&(r=a),o=a.index+1}return r}function c(e,t,n){t=a(t,"g");for(var o=n.line,i=n.ch,l=e.firstLine();o>=l;o--,i=-1){var u=e.getLine(o),c=s(u,t,i<0?0:u.length-i);if(c)return{from:r(o,c.index),to:r(o,c.index+c[0].length),match:c}}}function d(e,t,n){if(!i(t))return c(e,t,n);t=a(t,"gm");for(var o,l=1,u=e.getLine(n.line).length-n.ch,d=n.line,f=e.firstLine();d>=f;){for(var p=0;p=f;p++){var h=e.getLine(d--);o=null==o?h:h+"\n"+o}l*=2;var m=s(o,t,u);if(m){var y=o.slice(0,m.index).split("\n"),g=m[0].split("\n"),b=d+y.length,v=y[y.length-1].length;return{from:r(b,v),to:r(b+g.length-1,1==g.length?v+g[0].length:g[g.length-1].length),match:m}}}}function f(e,t,n,r){if(e.length==t.length)return n;for(var o=0,a=n+Math.max(0,e.length-t.length);;){if(o==a)return o;var i=o+a>>1,l=r(e.slice(0,i)).length;if(l==n)return i;l>n?a=i:o=i+1}}function p(e,o,a,i){if(!o.length)return null;var l=i?t:n,u=l(o).split(/\r|\n\r?/);e:for(var s=a.line,c=a.ch,d=e.lastLine()+1-u.length;s<=d;s++,c=0){var p=e.getLine(s).slice(c),h=l(p);if(1==u.length){var m=h.indexOf(u[0]);if(-1==m)continue e;return a=f(p,h,m,l)+c,{from:r(s,f(p,h,m,l)+c),to:r(s,f(p,h,m+u[0].length,l)+c)}}var y=h.length-u[0].length;if(h.slice(y)==u[0]){for(var g=1;g=d;s--,c=-1){var p=e.getLine(s);c>-1&&(p=p.slice(0,c));var h=l(p);if(1==u.length){var m=h.lastIndexOf(u[0]);if(-1==m)continue e;return{from:r(s,f(p,h,m,l)),to:r(s,f(p,h,m+u[0].length,l))}}var y=u[u.length-1];if(h.slice(0,y.length)==y){var g=1;for(a=s-u.length+1;g(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var o=this.matches(t,n);if(this.afterEmptyMatch=o&&0==e.cmpPos(o.from,o.to),o)return this.pos=o,this.atOccurrence=!0,this.pos.match||!0;var a=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:a,to:a},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var o=e.splitLines(t);this.doc.replaceRange(o,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+o.length-1,o[o.length-1].length+(1==o.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new m(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new m(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],o=this.getSearchCursor(t,this.getCursor("from"),n);o.findNext()&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)r.push({anchor:o.from(),head:o.to()});r.length&&this.setSelections(r,0)}))}(n(1482))},function(e,t,n){!function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?O(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?O("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?O(null,n):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=C),O("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),O("property","word")):O(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),O("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?O("variable-2","variable-definition"):O("variable-2","variable")):e.match(/^\w+-/)?O("meta","meta"):void 0}function S(e){return function(t,n){for(var r,o=!1;null!=(r=t.next());){if(r==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==r}return(r==e||!o&&")"!=e)&&(n.tokenize=null),O("string","string")}}function C(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=S(")"),O(null,"(")}function E(e,t,n){this.type=e,this.indent=t,this.prev=n}function P(e,t,n,r){return e.context=new E(n,t.indentation()+(!1===r?0:i),e.context),n}function T(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function M(e,t,n){return D[n.context.type](e,t,n)}function j(e,t,n,r){for(var o=r||1;o>0;o--)n.context=n.context.prev;return M(e,t,n)}function x(e){var t=e.current().toLowerCase();a=g.hasOwnProperty(t)?"atom":y.hasOwnProperty(t)?"keyword":"variable"}var D={top:function(e,t,n){if("{"==e)return P(n,t,"block");if("}"==e&&n.context.prev)return T(n);if(_&&/@component/i.test(e))return P(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return P(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return P(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return P(n,t,"at");if("hash"==e)a="builtin";else if("word"==e)a="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return P(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return P(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return f.hasOwnProperty(r)?(a="property","maybeprop"):p.hasOwnProperty(r)?(a=w?"string-2":"property","maybeprop"):b?(a=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(a+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?D.top(e,t,n):(a="error","block")},maybeprop:function(e,t,n){return":"==e?P(n,t,"prop"):M(e,t,n)},prop:function(e,t,n){if(";"==e)return T(n);if("{"==e&&b)return P(n,t,"propBlock");if("}"==e||"{"==e)return j(e,t,n);if("("==e)return P(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)x(t);else if("interpolation"==e)return P(n,t,"interpolation")}else a+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?T(n):"word"==e?(a="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?j(e,t,n):")"==e?T(n):"("==e?P(n,t,"parens"):"interpolation"==e?P(n,t,"interpolation"):("word"==e&&x(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(a="variable-3",n.context.type):M(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&u.hasOwnProperty(t.current())?(a="tag",n.context.type):D.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return P(n,t,"atBlock_parens");if("}"==e||";"==e)return j(e,t,n);if("{"==e)return T(n)&&P(n,t,b?"block":"top");if("interpolation"==e)return P(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();a="only"==r||"not"==r||"and"==r||"or"==r?"keyword":s.hasOwnProperty(r)?"attribute":c.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":f.hasOwnProperty(r)?"property":p.hasOwnProperty(r)?w?"string-2":"property":g.hasOwnProperty(r)?"atom":y.hasOwnProperty(r)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?j(e,t,n):"{"==e?T(n)&&P(n,t,b?"block":"top",!1):("word"==e&&(a="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?T(n):"{"==e||"}"==e?j(e,t,n,2):D.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?P(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(a="variable","restricted_atBlock_before"):M(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,T(n)):"word"==e?(a="@font-face"==n.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(a="variable","keyframes"):"{"==e?P(n,t,"top"):M(e,t,n)},at:function(e,t,n){return";"==e?T(n):"{"==e||"}"==e?j(e,t,n):("word"==e?a="tag":"hash"==e&&(a="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?T(n):"{"==e||";"==e?j(e,t,n):("word"==e?a="variable":"variable"!=e&&"("!=e&&")"!=e&&(a="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new E(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||k)(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),a=n,"comment"!=o&&(t.state=D[t.state](o,e,t)),a},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),o=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(o=Math.max(0,n.indent-i)):o=(n=n.prev).indent),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:v,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],r=t(n),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),i=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],l=t(i),u=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],s=t(u),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(c),f=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(f),h=t(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=t(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),y=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],g=t(y),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],v=t(b),_=n.concat(o).concat(i).concat(u).concat(c).concat(f).concat(y).concat(b);function w(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:r,mediaTypes:a,mediaFeatures:l,mediaValueKeywords:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:g,valueKeywords:v,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w,w(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:s,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:g,valueKeywords:v,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w,w(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:s,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:g,valueKeywords:v,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w,w(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:a,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:h,counterDescriptors:m,colorKeywords:g,valueKeywords:v,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w,w(e,t))}},name:"css",helperType:"gss"})}(n(1482))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addEventListener=function(e,t,n){e.addEventListener&&e.addEventListener(t,n);return{remove:function(){e.removeEventListener&&e.removeEventListener(t,n)}}},t.compareAsc=function(e,t){var n=e-t;0===n&&(n=(e[i]||0)-(t[i]||0));return n},t.findNearestIndex=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return e.reduce((function(e,r,o){if(o===n)return e;var a=Math.abs(r-t);return a<=e.distance?{index:o,distance:a}:e}),{index:-1,distance:1/0})},t.getElementOwner=function(e){return e.ownerDocument||document},t.isPrimaryClick=function(e){return"contextmenu"!==(null==e?void 0:e.type)&&0===(null==e?void 0:e.button)},t.limitValueRange=function(e,t,n){return Math.min(Math.max(e,n),t)},t.percentToValue=function(e,t,n){return n/100*(t-e)+e},t.prepareNewValue=function(e,t){if((0,o.default)(e)){var n=(0,r.default)(e);return n.value=+t,n[i]=Date.now(),n}return t},t.roundValueToStep=function(e,t,n){return Math.round((e-n)/t)*t+n},t.valueToPercent=function(e,t,n){return 100*(n-e)/(t-e)};var r=a(n(116)),o=a(n(12));function a(e){return e&&e.__esModule?e:{default:e}}var i=Symbol("ETCoreSliderLastModified")},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=D(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=x(n(13)),i=x(n(7)),l=x(n(11)),u=x(n(31)),s=x(n(10)),c=x(n(1)),d=x(n(9)),f=x(n(42)),p=x(n(17)),h=x(n(34)),m=x(n(88)),y=n(618),g=x(n(5)),b=x(n(6)),v=x(n(2)),_=x(n(18)),w=x(n(39)),O=x(n(15)),k=x(n(789)),S=x(n(790)),C=x(n(804)),E=x(n(803)),P=x(n(1551)),T=x(n(1553)),M=x(n(1484)),j=x(n(281));function x(e){return e&&e.__esModule?e:{default:e}}function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(D=function(e){return e?n:t})(e)}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],r=(0,c.default)(t.getTabs(),"".concat(e,".controls"),{});if(!n)return r;var o={};return(0,d.default)(r,(function(e,t){(0,l.default)(e.main_tab_setting)||"on"!==e.main_tab_setting||(o[t]=e)})),(0,g.default)(o)?r:o})),V(F(t),"getSettings",(function(){return(0,p.default)(t.getTabs()).reduce((function(e,n){return L(L({},e),t.getTabSettings(n))}),{})})),V(F(t),"getSetting",(function(e){return(0,c.default)(t.getSettings(),e)})),V(F(t),"isTabModified",(function(e){return(0,p.default)(t.getTabSettings(e,!0)).reduce((function(e,n){return e||t.isSettingModified(n)}),!1)})),V(F(t),"isModified",(function(){return(0,p.default)(t.getTabs()).reduce((function(e,n){return e||t.isTabModified(n)}),!1)})),V(F(t),"handleTabHover",(function(e,n,r,o){var a={fieldName:(0,p.default)((0,c.default)(t.props.composite_structure,[n,"controls"],[])).join(" "),fieldLabel:r||o,fieldType:"composite_tab",toggleId:t.props.toggle_slug,toggleGroupId:t.props.tab_slug};if("enter"===e){var i=_.default.getFieldBaseName(t.props.name),l=L(L({},a),{fieldName:i,fieldLabel:t.props.label,fieldType:t.props.type});t.props.onMouseLeaveGroup(l),setTimeout((function(){t.props.onMouseEnterGroup(a)}))}else t.props.onMouseLeaveGroup(a)})),t.state={activeTabIndex:0},t._onChange=t._onChange.bind(F(t)),t._onClickReset=t._onClickReset.bind(F(t)),t._onTabChange=t._onTabChange.bind(F(t)),t}return t=x,n=[{key:"getModule",value:function(){return(0,c.default)(this,"props.module.props.module")}},{key:"getAttrs",value:function(){return(0,c.default)(this,"props.moduleAttrs",{})}},{key:"getFieldDefault",value:function(e){var t=this.getSetting(e),n=(0,h.default)(t,"default"),r=(0,h.default)(t,"default_from")&&!n?G((0,c.default)(this.getSettings(),U((0,c.default)(t,"default_from")))):void 0;return v.default.get(r,G(t))}},{key:"getDefault",value:function(e){var t=O.default.getFieldBaseName(e);_.default.isHoverMode()?t=_.default.getFieldBaseName(this.props.name):w.default.isStickyMode()&&(t=w.default.getFieldBaseName(this.props.name));var n=this.getSetting(t),r=this.getFieldDefault(t),o=(0,h.default)(n,"default"),a=(0,h.default)(n,"default_from")&&!o?U((0,c.default)(n,"default_from")):void 0,i=a?(0,c.default)(this.getAttrs(),a):void 0,l=_.default.isHoverMode()&&_.default.isEnabled(t,this.getAttrs()),u=w.default.isStickyMode()&&w.default.isEnabled(t,this.getAttrs()),s=v.default.get(i,v.default.get(r,""));if(O.default.isMobile(this.props,!1)&&!l&&!u){var d=O.default.isResponsiveEnabled(this.getAttrs(),O.default.getFieldBaseName(e)),f=n["default_".concat(this.props.activeTabMode)]||O.default.getDefaultValue(this.getAttrs(),"".concat(e,"_").concat(this.props.activeTabMode));return s=(0,c.default)(this.getAttrs(),"".concat(a,"_").concat(this.props.activeTabMode),s),d?f:(0,c.default)(this.getAttrs(),e,s)}return l?v.default.get((0,c.default)(n,"default__hover"),(0,c.default)(this.getAttrs(),t,s)):u?v.default.get((0,c.default)(n,"default__sticky"),(0,c.default)(this.getAttrs(),t,s)):s}},{key:"getValue",value:function(e){var t=this.getAttrs(),n=_.default.isHoverMode()&&_.default.isEnabled(e,t),r=w.default.isStickyMode()&&w.default.isEnabled(e,t),o=(0,c.default)(t,e,"");if(O.default.isMobile(this.props,!1)&&!n&&!r){var a=O.default.isResponsiveEnabled(t,e),i=O.default.getAnyValue(t,"".concat(e,"_").concat(this.props.activeTabMode));return a?i:""}return n?_.default.getHoverOrNormalOnHover(e,t):r?(0,c.default)(t,w.default.getStickyField(e),o):o}},{key:"isSettingModified",value:function(e){return""!==v.default.get(this.getValue(e),"")}},{key:"_onChange",value:function(e,t,n,r){var o=v.default.get(t,this.getDefault(e))===this.getDefault(e);this.props._onChange(e,t,n,r,o)}},{key:"_onClickReset",value:function(){var e=this;(0,p.default)(this.getSettings()).map((function(t){e._onChange(_.default.getHoverFieldOnHover(t,e.getAttrs()),"")})),this.setState({activeTabIndex:0})}},{key:"_onTabChange",value:function(e){this.setState({activeTabIndex:e})}},{key:"_renderTabPreviewArea",value:function(e){return!1}},{key:"_renderOutsidePreviewArea",value:function(){return!1}},{key:"_renderTabs",value:function(){var e=this,t=this.getModule(),n=this.getAttrs(),r=this.props.module._getOptionsFields("advanced"),d=[],p=this.props,m=p.name,g=p.label;return o.default.createElement(P.default,{_onTabChange:this._onTabChange,activeTab:this.state.activeTabIndex},(0,u.default)(this.props.composite_structure,(function(p,P){return o.default.createElement(T.default,{icon:p.icon,key:P,isModified:e.isTabModified(P),label:p.label,tooltip:p.tooltip,tabName:P,handleTabHover:e.handleTabHover},e._renderTabPreviewArea(p),(0,u.default)(p.controls,(function(u,p){var P=w.default.isStickyMode()&&w.default.isEnabled(p,n)?w.default.getStickyField(p,n):_.default.getHoverFieldOnHover(p,n),T=u;u.name=P;var x={};if((0,l.default)(u.type)||!M.default.getControl(u.type))return!1;if("top_divider_style"===P&&(x.dividerFlip=n.top_divider_flip),"bottom_divider_style"===P&&(x.dividerFlip=n.bottom_divider_flip),!(0,l.default)(u.depends_on)&&!e.props.module._isVisible(P,r))return d.push(P),!1;if(!((0,l.default)(u.show_if)&&(0,l.default)(u.show_if_not)||(0,y.canShowField)(u,e.props.setting_resolver)))return d.push(P),!1;if(!(0,l.default)(u.depends_on)&&(0,f.default)(u.depends_on,intersection(u.depends_on,d)))return!1;if(!e.props.module._isOptionMatchesFilter(u.label,u.description,e.props.label))return!1;var D,N=_.default.getFieldBaseName(p),R=!(0,l.default)(u.description)&&""!==u.description,A=(0,c.default)(u,"context_menu",!0),I=O.default.isResponsiveEnabled(n,N),B=w.default.doesSupport(u)&&w.default.hasStickyOptions((0,c.default)(t,"props",{})),F=(0,l.default)(u.label)||""===u.label?"":o.default.createElement(k.default,{name:P,key:"general-form-label-".concat(e.props.uniqueKey,"-").concat(_.default.getFieldBaseName(P)),onClickHelp:!!R&&e.props.onClickHelp,activeHelp:e.props.isDescriptionVisible(P),hoveredGroup:e.props.isHoveredGroup(P),hasHoverOptions:_.default.doesSupport(u),hasStickyOptions:B,onClickResponsive:e.props.onClickResponsive,hasResponsiveOptions:u.mobile_options,activeHover:_.default.isEnabled(P,n),activeSticky:w.default.isEnabled(P,n),onClickHover:!!_.default.hasTabs(u)&&e.props.onClickHover,onClickSticky:!!B&&e.props.onClickSticky,onClickReset:e.props.onClickReset,isResetActive:e.props.isResetActive(u),isResponsiveEnabled:I,onToggleRightMenu:!!A&&e.props.onToggleRightMenu},u.label),W=R?o.default.createElement(S.default,{active:e.props.isDescriptionVisible(P),key:"general-form-description-".concat(e.props.uniqueKey,"-").concat(P)},u.description):"",V=(0,a.default)("et-fb-settings-options","et-fb-option--".concat(u.type.replace("_","-"))),U="",G={};if(u.mobile_options&&(0,i.default)(["custom_margin","custom_padding"],u.type)){var H=(0,c.default)(n,"".concat(P,"_last_edited"),""),z=(0,l.default)(H)?["off","desktop"]:H.split("|"),q=v.default.hasValue(n[P])?n[P]:"",K=(0,c.default)(n,"".concat(P,"_tablet"),""),$=(0,c.default)(n,"".concat(P,"_phone"),"");if(K&&!(0,h.default)(u,"default_phone")&&(u.default_phone=K),K||!(0,h.default)(u,"default_tablet")||(0,h.default)(u,"default_phone")||(u.default_phone=u.default_tablet),q&&((0,h.default)(u,"default_tablet")||(u.default_tablet=q),(0,h.default)(u,"default_phone")||(u.default_phone=q)),!(0,l.default)(u.default_from)){var Y=u.default_from.split(".").pop(),X=(0,c.default)(n,"".concat(Y),"");""!==X&&(0,l.default)(u.default)&&(u.default=X);var J=(0,c.default)(n,"".concat(Y,"_tablet"),"");""!==J&&(u.default_tablet=J);var Q=(0,c.default)(n,"".concat(Y,"_phone"),"");""!==Q&&(u.default_phone=Q)}D={desktop:q,tablet:K,phone:$,isResponsive:I,activeTab:z[1]},U=b.default.getPreviewMode()}else if(u.mobile_options){var Z=e.props.activeTabMode,ee=I,te=(0,i.default)(["tablet","phone"],Z)&&ee,ne=te?"_".concat(Z):"";U=b.default.getPreviewMode();var re=(0,c.default)(n,P,""),oe=(0,c.default)(n,"".concat(P,"_tablet"),"");(0,c.default)(n,"".concat(P,"_phone"),""),""===re&&!(0,l.default)(u.default_from)&&te&&(re=(0,c.default)(n,u.default_from.split(".").pop(),"")),oe&&!(0,h.default)(u,"default_phone")&&(u.default_phone=oe),oe||!(0,h.default)(u,"default_tablet")||(0,h.default)(u,"default_phone")||(u.default_phone=u.default_tablet),re&&((0,h.default)(u,"default_tablet")||(u.default_tablet=re),(0,h.default)(u,"default_phone")||(u.default_phone=re)),D=te?(0,c.default)(n,"".concat(u.name).concat(ne),""):re,te&&(G.default=(0,c.default)(u,"default".concat(ne),(0,c.default)(u,"default","")),G.name="".concat(u.name).concat(ne),G.baseName=u.name,"yes_no_button"===u.type?G.defaultValue=G.default:"background-field"===u.type?G.name=void 0:"multiple_buttons"===u.type&&u.toggleable&&u.multi_selection&&(G.emptyMobileNone=!0))}else D=(0,c.default)(n,P,e.getDefault(p));var ae={slug:u.type,type:"field"},ie=u.mobile_options&&I||_.default.hasTabs(u)&&_.default.isEnabled(N,n)||B&&w.default.isEnabled(N,n)?o.default.createElement(j.default,null,o.default.createElement(C.default,{module:e.getModule(),moduleAttrs:n,fieldName:N,activeTabMode:e.props.activeTabMode,isGlobalPresetsMode:e.props.isGlobalPresetsMode,isResponsiveEnabled:I,isHoverEnabled:_.default.isEnabled(N,n),isStickyEnabled:B&&w.default.isEnabled(N,n),isItemSelected:e.props.isItemSelected})):"",le={fieldName:P,fieldLabel:u.label,fieldType:u.type,toggleId:e.props.toggle_slug,toggleGroupId:e.props.tab_slug,fieldContextMenu:A},ue=L(L({},le),{fieldName:m,fieldLabel:g});return o.default.createElement(E.default,{name:P,key:"advanced-form-group-".concat(e.props.uniqueKey,"-").concat(_.default.getFieldBaseName(P)),onMouseEnterGroup:function(){e.props.onMouseEnterGroup(le)},onMouseLeaveGroup:function(){e.props.onMouseLeaveGroup(le),e.props.onMouseEnterGroup(ue)},isSelectiveSyncAvailable:e.props.isSelectiveSyncAvailable(),isGlobalOptionSynced:e.props.isGlobalOptionSynced(P),_unsyncGlobalSetting:e.props._unsyncGlobalSetting,className:e.props.productTourClass},F,ie,W,o.default.createElement("div",{className:V,key:"et-fb-option-advanced_".concat(e.props.uniqueKey,"-").concat(P)},o.default.createElement("div",{className:"et-fb-option-container",key:"et-fb-option-container-".concat(e.props.uniqueKey,"-").concat(P)},(0,o.createElement)(M.default.getControl(u.type),(0,s.default)({key:"".concat(e.props.uniqueKey,"-").concat(P),value:D,module:e.props.module,name:P,resetValue:!1,_onChange:e._onChange,visible:!0,previewMode:U,animate:e.props.animate,additionalProps:x,isResponsive:I,activeTabMode:e.props.activeTabMode,fieldDefinition:T,matching:ae},u,{default:e.getDefault(p)},G)))))})))})))}},{key:"render",value:function(){var e=this,t=this.props,n=t.name,r=t.label,a=!1;if((0,d.default)(this.props.composite_structure,(function(t){(0,d.default)(t.controls,(function(t){if(!(0,l.default)(t.type)&&M.default.getControl(t.type))return e.props.module._isOptionMatchesFilter(t.label,t.description,e.props.label)?(a=!0,!1):void 0}))})),!a)return!1;var i=_.default.getFieldBaseName(n),u=this.props.isHoveredGroup(i),s=!(0,l.default)(this.props.description)&&""!==this.props.description,f=(0,c.default)(this.props,"context_menu",!0),p=(0,l.default)(r)||""===r?"":o.default.createElement(k.default,{name:n,onClickHelp:!!s&&this.props.onClickHelp,key:"advanced-form-label-".concat(this.props.uniqueKey),isResetActive:this.isModified(),onClickReset:this._onClickReset,onClickHover:this.props.onClickHover,activeHover:this.props.activeHover,hoveredGroup:u,onToggleRightMenu:!!f&&this.props.onToggleRightMenu},r),h=!1===this.props.activeHover?"":o.default.createElement(j.default,null,o.default.createElement(C.default,{module:this.getModule(),moduleAttrs:this.getAttrs(),fieldName:this.props.name,activeTabMode:this.props.activeTabMode,isGlobalPresetsMode:this.props.isGlobalPresetsMode,isHoverEnabled:this.props.activeHover,isItemSelected:this.props.isItemSelected})),m=s?o.default.createElement(S.default,{active:this.props.isDescriptionVisible(n),key:"general-form-description-".concat(n)},this.props.description):"",y=this.props.name,g={fieldName:i,fieldLabel:r,fieldType:this.props.type,toggleId:this.props.toggleId,toggleGroupId:this.props.toggleGroupId,fieldContextMenu:f};return o.default.createElement(E.default,{name:y,key:"advanced-form-group-".concat(this.props.uniqueKey,"-").concat(y),onMouseEnterGroup:function(){return e.props.onMouseEnterGroup(g)},onMouseLeaveGroup:function(){return e.props.onMouseLeaveGroup(g)}},p,h,m,this._renderOutsidePreviewArea(),this._renderTabs())}}],n&&R(t.prototype,n),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),x}(o.default.Component),z=H;t.default=z},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isSingle=t.isMinBound=t.isMaxBound=t.hasTrack=t.getTrackWidth=t.getStartLimitTitle=t.getMinBoundClass=t.getMaxBoundClass=t.getInputs=t.getEndLimitTitle=t.getCounters=t.emptyOnDefault=void 0;var o=n(365),a=n(1768),i=n(115),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(1485)),u=n(1558);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}var c=function(e){return(0,o.getStartMiddle)(e)===(0,o.getEndMiddle)(e)};t.isSingle=c;var d=function(e){return(0,o.getStartLimit)(e)===(0,o.getEndMiddle)(e)};t.isMinBound=d;var f=function(e){return(0,o.getEndLimit)(e)===(0,o.getStartMiddle)(e)};t.isMaxBound=f;t.getMinBoundClass=function(e){return d(e)?l.atMinBound:""};t.getMaxBoundClass=function(e){return f(e)?l.atMaxBound:""};t.getStartLimitTitle=function(e){return(0,o.getStartLimit)(e)>(0,o.getStartLimit)((0,o.getDefaultValue)())?"".concat((0,o.getStartLimit)(e),"%"):""};t.getEndLimitTitle=function(e){return(0,o.getEndLimit)(e)<(0,o.getEndLimit)((0,o.getDefaultValue)())?"".concat((0,o.getEndLimit)(e),"%"):""};t.hasTrack=function(e){return!c(e)};t.getTrackWidth=function(e){return(0,o.getEndMiddle)(e)-(0,o.getStartMiddle)(e)};t.getCounters=function(e,t){var n=Math.round((0,i.getAmount)(1,t)),r=function(e){return n*e},l=(0,o.getStartLimit)(e),s=(0,o.getEndLimit)(e),d=c(e)?[l,(0,o.getStartMiddle)(e),s]:[l,(0,o.getStartMiddle)(e),(0,o.getEndMiddle)(e),s];return(0,o.getStartLimit)((0,o.getDefaultValue)())===l&&d.shift(),(0,o.getEndLimit)((0,o.getDefaultValue)())===s&&d.pop(),(0,a.groupBy)((function(e,t){return r(t)-r(e)<=u.counterWidth}),d)};t.getInputs=function(e,t){var n=Math.round((0,i.getAmount)(1,t)),r=function(e){return n*e},l=[(0,o.getStartLimit)(e),(0,i.average)([(0,o.getEndMiddle)(e),(0,o.getStartMiddle)(e)]),(0,o.getEndLimit)(e)];return(0,a.groupBy)((function(e,t){return r(t)-r(e)<=56}),l)};t.emptyOnDefault=function(e,t,n){if(""===n)return"";var r=e(n);return e(t)===r?"":r}},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=p,t.addEvent=function(e,t,n,r){if(!e)return;var o=u({capture:!0},r);e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return;var t=e.getElementById("react-draggable-style-el");t||((t=e.createElement("style")).type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&p(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){var n=f(e,t,"px");return s({},(0,a.browserPrefixToKey)("transform",a.default),n)},t.createSVGTransform=function(e,t){return f(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,o.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,o.findInArray)(e.changedTouches,(function(e){return t===e.identifier}))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.getTranslation=f,t.innerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,o.int)(n.paddingTop),t-=(0,o.int)(n.paddingBottom)},t.innerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,o.int)(n.paddingLeft),t-=(0,o.int)(n.paddingRight)},t.matchesSelector=d,t.matchesSelectorAndParentsTo=function(e,t,n){var r=e;do{if(d(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},t.offsetXYFromParent=function(e,t,n){var r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,a=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:a}},t.outerHeight=function(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,o.int)(n.borderTopWidth),t+=(0,o.int)(n.borderBottomWidth)},t.outerWidth=function(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,o.int)(n.borderLeftWidth),t+=(0,o.int)(n.borderRightWidth)},t.removeClassName=h,t.removeEvent=function(e,t,n,r){if(!e)return;var o=u({capture:!0},r);e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&h(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{var t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var o=n(1499),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=a?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(o,l,u):o[l]=e[l]}o.default=e,n&&n.set(e,o);return o}(n(1898));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"";return(0,l.default)(e,(function(e,n){var r=(0,h.default)(e,"name"),a=(0,h.default)(e,"id"),i=n;return""!==t&&(i="".concat(t,"-").concat(n)),o.default.createElement(m.default,{key:i,value:a,name:r})}))}},{key:"render",value:function(){var e,t=this,n=(0,u.default)(this.props.value)?this.props.value:this.props.default;!(0,f.default)((0,p.default)(this.props.options),n)&&(0,f.default)((0,p.default)(this.props.options),(0,u.default)(n))&&(n=(0,u.default)(n));var r={"et-core-control-select":!0,"et-fb-settings-option-select":!0};this.props.className&&(r[this.props.className]=!0),e=this.props.groups?(0,l.default)(this.props.options,(function(e,n){return"0"===n?t._render_options(e,n):o.default.createElement(y.default,{label:n,key:"option-group-".concat(n)},t._render_options(e,n))})):this._render_options(this.props.options);var a={};this.props.readonly&&(a.disabled=!0);var s=this.props.id;return s||(s="et-fb-".concat(this.props.name)),o.default.createElement("select",v({ref:function(e){return t.node=e},className:(0,i.default)(r),value:n,name:this.props.name,id:s,onChange:this._onChange},a),e)}}],r&&w(n.prototype,r),a&&w(n,a),Object.defineProperty(n,"prototype",{writable:!1}),b}(o.PureComponent);P(T,"propTypes",{name:a.default.string.isRequired});var M=T;t.default=M}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&Object.prototype.hasOwnProperty.call(e,l)){var u=i?Object.getOwnPropertyDescriptor(e,l):null;u&&(u.get||u.set)?Object.defineProperty(o,l,u):o[l]=e[l]}o.default=e,n&&n.set(e,o);return o}(n(0));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1];switch(t.type){case o.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case o.HOVER:return i(e.clientOffset,t.clientOffset)?e:r({},e,{clientOffset:t.clientOffset});case o.END_DRAG:case o.DROP:return a;default:return e}},t.getSourceClientOffset=function(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;if(!t||!n||!r)return null;return{x:t.x+r.x-n.x,y:t.y+r.y-n.y}},t.getDifferenceFromInitialOffset=function(e){var t=e.clientOffset,n=e.initialClientOffset;if(!t||!n)return null;return{x:t.x-n.x,y:t.y-n.y}};var o=n(1493),a={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function i(e,t){return e===t||e&&t&&e.x===t.x&&e.y===t.y}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,a.default)(e)?e.some((function(e){return e===t})):e===t};var r,o=n(4),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments[1],t=arguments[2];switch(e.type){case a.HOVER:break;case i.ADD_SOURCE:case i.ADD_TARGET:case i.REMOVE_TARGET:case i.REMOVE_SOURCE:return u;case a.BEGIN_DRAG:case a.PUBLISH_DRAG_SOURCE:case a.END_DRAG:case a.DROP:default:return s}var n=e.targetIds,o=t.targetIds,l=(0,r.default)(n,o),c=!1;if(0===l.length){for(var d=0;d0};var r=l(n(847)),o=l(n(197)),a=n(1493),i=n(1494);function l(e){return e&&e.__esModule?e:{default:e}}var u=[],s=[]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyImage=t.NativeTypes=void 0,t.default=function(e){return new r.default(e)};var r=i(n(1592)),o=i(n(1598)),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1501));function i(e){return e&&e.__esModule?e:{default:e}}t.NativeTypes=a,t.getEmptyImage=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSafari=t.isFirefox=void 0;var r,o=n(149),a=(r=o)&&r.__esModule?r:{default:r};t.isFirefox=(0,a.default)((function(){return/firefox/i.test(navigator.userAgent)})),t.isSafari=(0,a.default)((function(){return Boolean(window.safari)}))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(0)),a=s(n(3)),i=n(1490),l=s(n(1617)),u=s(n(22));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if((0,o.isValidElement)(t)){var r=t;l(r);var a=n?function(t){return e(t,n)}:e;return(0,i.default)(r,a)}e(t,n)}}(e[n]);t[n]=function(){return r}})),t};var r,o=n(0),a=n(1611),i=(r=a)&&r.__esModule?r:{default:r};function l(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors.You can either wrap "+t+" into a
, or turn it into a drag source or a drop target itself.")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t===e)return!0;return null!==t&&null!==e&&(0,a.default)(t,e)};var r,o=n(1502),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function e(t,n){return"string"==typeof t||"symbol"===(void 0===t?"undefined":r(t))||n&&(0,i.default)(t)&&t.every((function(t){return e(t,!1)}))};var o,a=n(4),i=(o=a)&&o.__esModule?o:{default:o}},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=x(n(0)),a=M(n(3)),i=M(n(13)),l=M(n(58)),u=M(n(9)),s=M(n(1)),c=M(n(7)),d=M(n(5)),f=M(n(42)),p=M(n(35)),h=M(n(163)),m=M(n(12)),y=M(n(31)),g=M(n(40)),b=M(n(135)),v=M(n(69)),_=M(n(72)),w=M(n(41)),O=M(n(14)),k=M(n(164)),S=x(n(2)),C=M(n(398)),E=M(n(829)),P=n(783);n(1632);var T=M(n(10));function M(e){return e&&e.__esModule?e:{default:e}}function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(j=function(e){return e?n:t})(e)}function x(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=j(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,r=n.props,o=r.name,a=r._onChange,i=t||o;(0,p.default)(a)&&a(i,e)})),W(B(n),"_setColorPickerState",(function(e){n.setState({colorPicker:e})})),n.state={colorPicker:!1,parsedGradientStops:null!==(t=e.parsedGradient)&&void 0!==t?t:[]},n.colorPickerLastActive=!1,n._classNameBase="et-fb-settings-option-color-gradient",n._wrapperRef=o.default.createRef(),n.throttledUpdate=(0,w.default)((function(e){return n._emitChange(e,"gradientStopSingleColor")}),100,{leading:!1}),n}return t=g,n=[{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.activeGradientStop,o=n.parsedGradient,a=this.state.colorPicker;e.activeGradientStop===r&&a===r||this._setColorPickerState(r),(0,f.default)(t.parsedGradientStops,o)||this.setState({parsedGradientStops:o})}},{key:"_normalizeColor",value:function(e){return(0,_.default)(e,"gcid-")?e:C.default.normalize(e)}},{key:"_getGradientStopValue",value:function(e){var t=this.state.parsedGradientStops,n=(0,l.default)(t,(function(t,n){return t.uuid===e}))||{};return!!n.hasOwnProperty("color")&&n.color}},{key:"_getValue",value:function(e){var t=this.props.value;return e?this._getGradientStopValue(e):t}},{key:"_getDefaultValue",value:function(e){var t=this.props.defaultValue;return e?(0,s.default)(t,e):t}},{key:"_getRealColorValue",value:function(e){return k.default.getColorValue(e)||e}},{key:"_getClassName",value:function(e){return e?"".concat(this._classNameBase,"-").concat(e):this._classNameBase}},{key:"_getPreviewStyle",value:function(){var e=this,t=this._getValue();if((0,h.default)(t)||(0,d.default)(t)||!(0,m.default)(t))return{};var n={},r=k.default.getColors();return(0,u.default)(t,(function(t,r){var o=e._getGradientStopIDs();(0,d.default)(t)&&(0,c.default)(o,r)?n[r]=C.default.transparent:n[r]=k.default.getColorValue(t)||t})),{backgroundImage:S.default.getGradient(n,r)}}},{key:"isStopValueChanged",value:function(e,t){var n=this,r=this._getParsedGradientStops();return(0,v.default)(r,(function(r){var o=n._normalizeColor((0,s.default)(e,r)),a=n._normalizeColor((0,s.default)(t,r)),i=n._normalizeColor((0,s.default)(S.default.gradientDefault(),r)),l=(0,S.hasValue)(a);return!(!l||o===a)||!l&&o!==i}))}},{key:"_renderColorGradientShared",value:function(){var e=this.state.colorPicker,t=this.props,n=t.readonly,r=t.showPalettes,a=t.hideAddButton,i=t.disableCurrent,l=t.hideSwapButton,u=t.hideResetButton,s=t.hasColorManager,c=t.hideRemoveButton,f=(0,b.default)(function(e){for(var t=1;t.1&&parseFloat(e)%1>0&&this.setState({rangeStep:"0.1"}),this.checkRangeBoundaries(this.state.value)},componentDidUpdate:function(e){(this.props.previewMode&&this.props.previewMode!==e.previewMode||this.state.value!==e.value)&&this.setState({value:this.emptyIfDefault(this.getCurrentInputValue())})},componentWillUnmount:function(){this.deferredUpdate.cancel()},_calculatePreviewMode:function(){var e=w.default.getPreviewMode();return"zoom"===e?"desktop":"wireframe"===e?"wireframe":M},getCurrentInputValue:function(){var e=this.props.value;if((0,f.default)(this.props.isTransformOrigin)){if("50%"===this.props.value)return"center";if("x"===this.props.isTransformOrigin){if("0%"===this.props.value)return"left";if("100%"===this.props.value)return"right"}else if("y"===this.props.isTransformOrigin){if("0%"===this.props.value)return"top";if("100%"===this.props.value)return"bottom"}}return(0,s.default)(e)||(0,g.default)(e)||(0,y.default)(e)?"":e},getDefaultValue:function(){var e=(0,m.default)(this,"props.allow_empty",!1)?void 0:0,t=(0,m.default)(this,"props.additionalAttrs.getDefaultFrom",!1),n=(0,m.default)(this,"props.default_values_mapping",!1),r=S.default.isMobile(this.props),o=this.props.default,a=this.props.allowed_values;return t&&n&&!r&&(o=(0,m.default)(n,t,o)),(0,p.default)(a,o)||v.default.hasValue(o)?o:e},getDefaultUnit:function(){var e=this.getDefaultValue();return(0,O.getUnit)(e,this.props.default_unit)},emptyIfDefault:function(e){return e===this.getDefaultValue()?"":e},isFixedUnit:function(){return v.default.hasValue(this.props.fixed_unit)},isAllowedUnit:function(){return v.default.hasValue(this.props.allowed_units)&&(0,d.default)(this.props.allowed_units)},isValidateUnit:function(){return!1!==this.props.validate_unit},validateValue:function(e){if((0,p.default)(this.props.allowed_values,e))return e;var t=this.props.value||this.props.default,n=O.default.getUnit(this.isChangingRange?t:e,this.props.default_unit);this.isAllowedUnit()&&!(0,p.default)(this.props.allowed_units,n)&&(n=this.props.default_unit||"px");var r=this.isFixedUnit()?this.props.fixed_unit:n,o=this.isValidateUnit()&&!0!==this.props.unitless?r:"";return O.default.sanitizeInputUnit((0,h.default)(parseFloat(e)),!1,o)},reset:function(e){e.preventDefault(),this.updateOptionAndState("")},onRangeFocus:function(){this.setState({rangeFocus:!0})},onRangeBlur:function(){this.setState({rangeFocus:!1})},inputsWrap:function(){var e="et-fb-".concat(this.props.name),t=this.props.name,n=(0,s.default)(this.getDefaultValue())?"0":this.validateValue(this.getDefaultValue()),r=this.validateValue(this.getCurrentInputValue())===n?"":this.validateValue(this.getCurrentInputValue()),a=""===r?n:r;if((0,f.default)(this.props.isTransformOrigin))switch(r){case"center":a=50;break;case"top":case"left":a=0;break;case"right":case"bottom":a=100}var i=(0,p.default)(["image_width","image_height","pattern_width","pattern_height","mask_width","mask_height"],this.props.field_template);i&&(0,p.default)(this.props.allowed_values,r)&&(a=0);var l={};v.default.hasValue(this.getRangeSettings().min_limit)&&(l.min=parseFloat(this.getRangeSettings().min_limit)),v.default.hasValue(this.getRangeSettings().max_limit)&&(l.max=parseFloat(this.getRangeSettings().max_limit)),isNaN(parseFloat(a))&&(a=this.state.rangeMax);var c={};return c.onInput=this._updateFromRange,c.onChange=u.default,o.default.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},o.default.createElement("input",P({id:e,name:t,type:"range",min:this.state.rangeMin,max:this.state.rangeMax,step:this.getRangeStep(),className:"et-fb-range",value:parseFloat(a),"data-shortcuts-allowed":!0},c,{onFocus:this.onRangeFocus,onBlur:this.onRangeBlur})),o.default.createElement("div",{className:"et-fb-range-number et-fb-settings-option-input"},o.default.createElement(k.default,P({id:"".concat(e,"-number")},l,{value:r,onChange:this._onChange,defaultValue:n,defaultUnit:this.getDefaultUnit(),step:parseFloat(this.getRangeSettings().step),precision:this.props.precision,isTransformOrigin:this.props.isTransformOrigin,convertStringToZero:i,allowed_values:this.props.allowed_values}))))},render:function(){var e=this.getDefaultValue(),t=this.props.value,n=this.inputsWrap();return!t||t===e||this.props.readonly||this.props.disableReset||o.default.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset}),o.default.createElement("div",{className:(0,l.default)({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-range":!0})},n)},updateOptionAndState:function(e){e=(0,s.default)(e)?this.state.value:e;var t=this.validateValue(e);this.setState({value:this.emptyIfDefault(t)}),this.props._onChange(this.props.name,t,this.props.type)},_updateFromRange:function(e){this.props.readonly||(this.isChangingRange=!0,this.updateOptionAndState(e.target.value),this.isChangingRange=!1)},_onChange:function(e){this.props.readonly||(this.updateOptionAndState(e),this.checkRangeBoundaries(e))},checkRangeBoundaries:function(e){if(v.default.hasValue(e)){var t=parseFloat(e);!v.default.hasValue(this.getRangeSettings().max_limit)&&t>this.state.rangeMax&&this.setState({rangeMax:t}),!v.default.hasValue(this.getRangeSettings().min_limit)&&t.1&&t%1>0?this.setState({rangeStep:"0.1"}):parseFloat(this.state.rangeStep)<1&&0==t%1&&this.setState({rangeStep:this.getRangeSettings().step})}},getRangeStep:function(){return parseFloat(this.state.rangeStep)*(this.state.rangeFocus&&_.default.isPressedShift({strict:!1})?10:1)}});j.propTypes={default_unit:a.default.string,precision:a.default.number,name:a.default.string,value:a.default.oneOfType([a.default.string,a.default.object,a.default.array]),range_settings:a.default.object,mobile_options:a.default.bool,reset_animation:a.default.bool,previewMode:a.default.string,default:a.default.oneOfType([a.default.string,a.default.number]),default_tablet:a.default.string,default_phone:a.default.string,type:a.default.string,fixed_unit:a.default.string,validate_unit:a.default.bool,readonly:a.default.bool,_onChange:a.default.func,unitless:a.default.bool,isTransformOrigin:a.default.oneOfType([a.default.string,a.default.bool])},j.defaultProps={default_unit:"",allowed_values:[],isTransformOrigin:!1};var x=j;t.default=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(0)),o=d(n(270)),a=d(n(13)),i=d(n(16)),l=d(n(40)),u=d(n(11)),s=d(n(184)),c=d(n(1));d(n(22));function d(e){return e&&e.__esModule?e:{default:e}}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function o(e){return e&&e.bracketRegex||/[(){}[\]]/}function a(e,t,a){var l=e.getLineHandle(t.line),u=t.ch-1,s=a&&a.afterCursor;null==s&&(s=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=o(a),d=!s&&u>=0&&c.test(l.text.charAt(u))&&r[l.text.charAt(u)]||c.test(l.text.charAt(u+1))&&r[l.text.charAt(++u)];if(!d)return null;var f=">"==d.charAt(1)?1:-1;if(a&&a.strict&&f>0!=(u==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,u+1)),h=i(e,n(t.line,u+(f>0?1:0)),f,p,a);return null==h?null:{from:n(t.line,u),to:h&&h.pos,match:h&&h.ch==d.charAt(0),forward:f>0}}function i(e,t,a,i,l){for(var u=l&&l.maxScanLineLength||1e4,s=l&&l.maxScanLines||1e3,c=[],d=o(l),f=a>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),p=t.line;p!=f;p+=a){var h=e.getLine(p);if(h){var m=a>0?0:h.length-1,y=a>0?h.length:-1;if(!(h.length>u))for(p==t.line&&(m=t.ch-(a<0?1:0));m!=y;m+=a){var g=h.charAt(m);if(d.test(g)&&(void 0===i||(e.getTokenTypeAt(n(p,m+1))||"")==(i||""))){var b=r[g];if(b&&">"==b.charAt(1)==a>0)c.push(g);else{if(!c.length)return{pos:n(p,m),ch:g};c.pop()}}}}}return p-a!=(a>0?e.lastLine():e.firstLine())&&null}function l(e,r,o){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,l=o&&o.highlightNonMatching,u=[],s=e.listSelections(),c=0;c=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function u(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function s(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(l(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(u(e))continue;return}if(i(e,t+1)){o.lastIndex=t,e.ch=t;var n=o.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function d(e){for(;;){o.lastIndex=e.ch;var t=o.exec(e.text);if(!t){if(l(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(u(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var r=[];;){var o,a=d(e),i=e.line,l=e.ch-(a?a[0].length:0);if(!a||!(o=s(e)))return;if("selfClose"!=o)if(a[1]){for(var u=r.length-1;u>=0;--u)if(r[u]==a[2]){r.length=u;break}if(u<0&&(!n||n==a[2]))return{tag:a[2],from:t(i,l),to:t(e.line,e.ch)}}else r.push(a[2])}}function h(e,n){for(var r=[];;){var o=f(e);if(!o)return;if("selfClose"!=o){var a=e.line,i=e.ch,l=c(e);if(!l)return;if(l[1])r.push(l[2]);else{for(var u=r.length-1;u>=0;--u)if(r[u]==l[2]){r.length=u;break}if(u<0&&(!n||n==l[2]))return{tag:l[2],from:t(e.line,e.ch),to:t(a,i)}}}else c(e)}}e.registerHelper("fold","xml",(function(e,r){for(var o=new a(e,r.line,0);;){var i=d(o);if(!i||o.line!=r.line)return;var l=s(o);if(!l)return;if(!i[1]&&"selfClose"!=l){var u=t(o.line,o.ch),c=p(o,i[2]);return c&&n(c.from,u)>0?{from:u,to:c.from}:null}}})),e.findMatchingTag=function(e,r,o){var i=new a(e,r.line,r.ch,o);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var l=s(i),u=l&&t(i.line,i.ch),d=l&&c(i);if(l&&d&&!(n(i,r)>0)){var f={from:t(i.line,i.ch),to:u,tag:d[2]};return"selfClose"==l?{open:f,close:null,at:"open"}:d[1]?{open:h(i,d[2]),close:f,at:"close"}:{open:f,close:p(i=new a(e,u.line,u.ch,o),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,r){for(var o=new a(e,t.line,t.ch,n);;){var i=h(o,r);if(!i)break;var l=p(new a(e,t.line,t.ch,n),i.tag);if(l)return{open:i,close:l}}},e.scanForClosingTag=function(e,t,n,r){return p(new a(e,t.line,t.ch,r?{from:0,to:r}:null),n)}}(n(1482))},function(e,t,n){!function(e){function t(t,n,r){var o,a=t.getWrapperElement();return(o=a.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?o.innerHTML=n:o.appendChild(n),e.addClass(a,"dialog-opened"),o}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(r,o,a){a||(a={}),n(this,null);var i=t(this,r,a.bottom),l=!1,u=this;function s(t){if("string"==typeof t)d.value=t;else{if(l)return;l=!0,e.rmClass(i.parentNode,"dialog-opened"),i.parentNode.removeChild(i),u.focus(),a.onClose&&a.onClose(i)}}var c,d=i.getElementsByTagName("input")[0];return d?(d.focus(),a.value&&(d.value=a.value,!1!==a.selectValueOnOpen&&d.select()),a.onInput&&e.on(d,"input",(function(e){a.onInput(e,d.value,s)})),a.onKeyUp&&e.on(d,"keyup",(function(e){a.onKeyUp(e,d.value,s)})),e.on(d,"keydown",(function(t){a&&a.onKeyDown&&a.onKeyDown(t,d.value,s)||((27==t.keyCode||!1!==a.closeOnEnter&&13==t.keyCode)&&(d.blur(),e.e_stop(t),s()),13==t.keyCode&&o(d.value,t))})),!1!==a.closeOnBlur&&e.on(i,"focusout",(function(e){null!==e.relatedTarget&&s()}))):(c=i.getElementsByTagName("button")[0])&&(e.on(c,"click",(function(){s(),u.focus()})),!1!==a.closeOnBlur&&e.on(c,"blur",s),c.focus()),s})),e.defineExtension("openConfirm",(function(r,o,a){n(this,null);var i=t(this,r,a&&a.bottom),l=i.getElementsByTagName("button"),u=!1,s=this,c=1;function d(){u||(u=!0,e.rmClass(i.parentNode,"dialog-opened"),i.parentNode.removeChild(i),s.focus())}l[0].focus();for(var f=0;f
'),e(window).trigger("et_code_snippets_container_ready",[t,n])})),_(b(n),"openSaveLibraryModal",(function(){if(!n.saveButtonRef.current.classList.contains("et-code-snippets-btn--disabled")){var e=n.props.editor,t="",r="";if((0,o.default)(e)){if(t=s.default.topDocument().getElementById(e).value,s.default.topWindow().getSelection)try{var a=s.default.topDocument().getElementById(e);r=a.value.substring(a.selectionStart,a.selectionEnd)}catch(e){console.log("Something went wrong")}}else e&&(t=e.getValue(),r=e.getSelection());var i=p(p({},n.getCodeSnippetsAppPreferences()),{},{modalType:"save",content:t,selectedContent:r});n.loadCodeSnippetsApp(i)}})),_(b(n),"openPortabilityModal",(function(){var e=n.props,t=e.editor,r=e.activateEditor;r&&r();var a="";(0,o.default)(t)?a=s.default.topDocument().getElementById(t).value:t&&(a=t.getValue());var i=p(p({},n.getCodeSnippetsAppPreferences()),{},{modalType:"portability",content:a});n.loadCodeSnippetsApp(i)})),_(b(n),"getEditorContent",(function(){var e=n.props,t=e.editor,r=e.activateEditor;r&&r();var a="";return(0,o.default)(t)?a=s.default.topDocument().getElementById(t).value:t&&(a=t.getValue()),a})),_(b(n),"handleSaveButtonMouseOver",(function(){""===n.getEditorContent()?n.saveButtonRef.current.classList.add("et-code-snippets-btn--disabled"):n.saveButtonRef.current.classList.remove("et-code-snippets-btn--disabled")})),n.openLibraryModal=n.openLibraryModal.bind(b(n)),n.closeLibraryModal=n.closeLibraryModal.bind(b(n)),n.insertCodeIntoField=n.insertCodeIntoField.bind(b(n)),n.saveButtonRef=a.default.createRef(),n}return n=d,r=[{key:"componentDidMount",value:function(){i.default.rebuild()}},{key:"insertCodeIntoField",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.props,r=n.getEditor,a=n.updateContent,i=n.editor;if(i&&(0,o.default)(i)){var l=s.default.topDocument().getElementById(i),u=e;if(t){var c=l.value;u="".concat(c," ").concat(e)}a(u)}else{var d=r(),f=d.getDoc();t?(e=f.getValue()?"\n"+e:e,f.replaceRange(e,{line:f.lastLine()})):f.setValue(e)}}},{key:"openLibraryModal",value:function(e){var t=this.props.activateEditor,n=p(p({},this.getCodeSnippetsAppPreferences()),{},{modalType:"add"});t&&t(),this.loadCodeSnippetsApp(n)}},{key:"closeLibraryModal",value:function(){this.setState({showLibraryModal:!1})}},{key:"isLibraryAllowed",value:function(){return u.default.isAllowedAction("divi_library")}},{key:"isLibraryAddAllowed",value:function(){return this.isLibraryAllowed()&&u.default.isAllowedAction("add_library")}},{key:"isLibrarySaveAllowed",value:function(){return this.isLibraryAllowed()&&u.default.isAllowedAction("save_library")}},{key:"isPortabilityAllowed",value:function(){return!!u.default.isAllowedAction("portability")&&u.default.isAllowedAction("et_code_snippets_portability")}},{key:"render",value:function(){return this.isLibraryAddAllowed()||this.isPortabilityAllowed()?a.default.createElement(a.default.Fragment,null,this.isLibraryAddAllowed()&&a.default.createElement("li",{className:"et-code-snippets-btn snippet-add","data-tip":w["Add From Library"],onClick:this.openLibraryModal},a.default.createElement("span",{className:"add"})),this.isLibrarySaveAllowed()&&a.default.createElement("li",{ref:this.saveButtonRef,className:"et-code-snippets-btn snippet-save","data-tip":w["Save To Library"],onClick:this.openSaveLibraryModal,onMouseOver:this.handleSaveButtonMouseOver},a.default.createElement("span",{className:"save"})),this.isPortabilityAllowed()&&a.default.createElement("li",{className:"et-code-snippets-btn snippet-portability","data-tip":w.Portability,onClick:this.openPortabilityModal},a.default.createElement("span",{className:"portability"}))):null}}],r&&h(n.prototype,r),l&&h(n,l),Object.defineProperty(n,"prototype",{writable:!1}),d}(a.PureComponent);_(O,"propTypes",{context:l.default.string.isRequired});var k=O;t.default=k}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=k(n(3)),i=k(n(16)),l=k(n(13)),u=k(n(363)),s=k(n(1)),c=k(n(7)),d=k(n(5)),f=k(n(11)),p=n(808),h=n(621),m=n(94),y=k(n(84)),g=k(n(805)),b=k(n(616)),v=n(2),_=n(60),w=n(49);n(1671);var O=["className"];function k(e){return e&&e.__esModule?e:{default:e}}function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(S=function(e){return e?n:t})(e)}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function P(e,t){for(var n=0;n4&&void 0!==arguments[4]&&arguments[4],i=t?y.default.inverse:y.default.inactiveGrey,l=(0,h.getTransformState)(r,"horizontal"),u=(0,h.getTransformState)(r,"vertical"),s=(0,h.getTransformState)(r,"rotate"),c=(0,h.getTransformState)(r,"invert"),d=(0,h.getTransformCSS)(l,u),f=a?"100%":"",m={transform:d,width:f};return o="select-mask"===n?(0,p.getSvgMask)(e,i,"thumbnail",s,c,"stretch"):(0,p.getSvgPattern)(e,i,"thumbnail",s,c),A(e,o,m)},B=function(e){return"et-fb-settings-option-preview--".concat(e)},F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&T(e,t)}(u,e);var t,n,r,a=M(u);function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=a.call(this,e))._selectRef=o.default.createRef(),t.shouldComponentUpdate=i.default.shouldComponentUpdate.bind(x(t)),t._onChange=t._onChange.bind(x(t)),t._onClick=t._onClick.bind(x(t)),t._onClickRemove=t._onClickRemove.bind(x(t)),t._onClickReset=t._onClickReset.bind(x(t)),t._onClickSelect=t._onClickSelect.bind(x(t)),t._getAddTitle=t._getAddTitle.bind(x(t)),t._getBackgroundStyle=t._getBackgroundStyle.bind(x(t)),t._getPreviewContent=t._getPreviewContent.bind(x(t)),t._getSvgType=t._getSvgType.bind(x(t)),t._renderPreview=t._renderPreview.bind(x(t)),t}return t=u,(n=[{key:"_onChange",value:function(e){var t=this.props,n=t._onChange;n(t.name,e.target.value)}},{key:"_onClick",value:function(){var e=this.props;(0,e._onChange)(e.name,"default")}},{key:"_onClickRemove",value:function(){var e=this.props;(0,e._onChange)(e.name,"")}},{key:"_onClickReset",value:function(){var e=this.props;(0,e._onChange)(e.name,"default")}},{key:"_onClickSelect",value:function(){var e=(0,v.$appWindow)(ReactDOM.findDOMNode(this._selectRef.current)).find("li.select-option-item.et-fb-selected-item").first();e.length&&e.trigger("click",[e.data("value")])}},{key:"_getAddTitle",value:function(){var e=ETBuilderBackend.i18n.controls.background,t="mask"===this._getSvgType()?e.addMask:e.addPattern;return(0,s.default)(this,"props.addTitle",t)}},{key:"_getBackgroundStyle",value:function(e){if(!(0,m.hasValue)(e))return{};var t=this.props.imageField,n=(0,s.default)(this,"props.imagePreviewAttrs",{}),r=(0,s.default)(this,"props.module.props.module.props"),o=(0,c.default)(ETBuilderBackend.modulesFeaturedImageBackground,(0,s.default)(r,"type"))&&(0,m.isOn)((0,s.default)(r,"attrs.featured_image"))&&"background"===(0,s.default)(r,"attrs.featured_placement"),a=(0,s.default)(t,"value","");o?o&&(a=ETBuilderBackend.currentPage.thumbnailUrl):(0,s.default)(this,"props.dynamic.image.dynamic",!1)&&(a=(0,s.default)(this,"props.dynamic.image.value",""));var i={};if((0,m.hasValue)(a)){if(i.backgroundImage="url(".concat(encodeURI(a),")"),n.parallax)i.backgroundRepeat="no-repeat",i.backgroundSize="cover",i.backgroundPosition="center",n.gradient&&(0,m.isOn)(n.gradientOverlaysImage)&&(i.backgroundBlendMode=n.blend);else{i.backgroundColor=n.color,i.backgroundBlendMode=n.blend;var l=n.size;if(!(0,f.default)(l)){var u=n.image_width,d=n.image_height,p=(0,h.getBackgroundSizeCss)(l,u,d);p.size&&(i.backgroundSize=p.size)}if((0,m.hasValue)(l)&&"stretch"!==l&&(i.backgroundRepeat=n.repeat,(0,m.hasValue)(n.repeat)&&"space"!==n.repeat)){var y=n.position;if((0,m.hasValue)(y)){var g=n.horizontal_offset,b=n.vertical_offset,v=(0,h.getBackgroundPositionCss)(y,g,b);i.backgroundPosition=v.position}}}n.gradient&&(a&&(i.backgroundColor="initial"),(0,m.isOn)(n.gradientOverlaysImage)?i.backgroundImage="".concat(n.gradient,", url(").concat(a,")"):i.backgroundImage="url(".concat(a,"), ").concat(n.gradient))}else(0,m.hasValue)(n.gradient)?i.backgroundImage=n.gradient:i.backgroundColor=n.color;return i}},{key:"_getPreviewContent",value:function(e){if(!(0,m.hasValue)(e))return null;var t,n,r,a,i=this.props,u=i.isExtendStylesModal,c=i.maskPreviewStyle,f=i.patternPreviewStyle,p=i.videoNode,h=i.type;if(u){var y=(0,s.default)(this.props,"transformValues","");return I(e,!1,h,y,!0)}return o.default.createElement(o.Fragment,null,(0,d.default)(p)?null:(r=p,o.default.createElement("div",{className:(0,l.default)((a={},R(a,"".concat(B("background-content")),!0),R(a,"".concat(B("background-video")),!0),a))},r)),(0,d.default)(f)?null:(t=f,o.default.createElement("div",{className:(0,l.default)((n={},R(n,"".concat(B("background-content")),!0),R(n,"".concat(B("background-pattern")),!0),n)),style:t})),(0,d.default)(c)?null:function(e){var t;return o.default.createElement("div",{className:(0,l.default)((t={},R(t,"".concat(B("background-content")),!0),R(t,"".concat(B("background-mask")),!0),t)),style:e})}(c))}},{key:"_getSvgType",value:function(){return"select-mask"===this.props.type?"mask":"pattern"}},{key:"_renderPreview",value:function(e,t){var n=this.props,r=n.hideAddButton,a=n.hideEditButton,i=n.hideRemoveButton,u=n.hideResetButton,c=n.readonly,d=n.name,f=(0,m.hasValue)(e),p=!c&&!r&&!f,h=!c&&!a&&f,y=!c&&!i&&f,b=!c&&!u&&f&&e!==t,v=["background_mask_style","background_pattern_style"].includes(d);if(f&&(0,s.default)(this,"props.dynamic.image.loading",!1))return o.default.createElement("div",{className:"et-fb-control-image-preview__preview et-fb-control-image-preview__preview--background"},(0,_.renderLoading)("image"));var w=R({"et-fb-settings-option-preview--svg":!0},"et-fb-settings-option-preview--svg-".concat(this._getSvgType()),!0);return o.default.createElement(g.default,{className:(0,l.default)(w),addTitle:this._getAddTitle(),previewStyle:this._getBackgroundStyle(e),showAddButton:p,showEditButton:h,showRemoveButton:y,showResetButton:b,onClickCanvas:p?this._onClick:this._onClickSelect,onClickAddButton:this._onClick,onClickEditButton:this._onClick,onClickRemoveButton:this._onClickRemove,onClickResetButton:this._onClickReset,hideAIButton:v},this._getPreviewContent(e))}},{key:"render",value:function(){var e=(0,s.default)(this.props,"default",""),t=(0,s.default)(this.props,"value",e),n=this.props,r=n.className,a=E(n,O),i=["et-fb-settings-option-select--svg",["et-fb-settings-option-select--".concat(this._getSvgType())],r].join(" "),u=o.default.createElement(b.default,C({ref:this._selectRef,className:i,getSvgContent:I,isControlSelectSVG:!0},a));return o.default.createElement("div",{className:(0,l.default)({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-svg":!0,"et-fb-settings-option-inner-svg--previewable":!0})},this._renderPreview(t,e),(0,m.hasValue)(t)?u:null)}}])&&P(t.prototype,n),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(o.Component),W=a.default.objectOf(a.default.oneOfType([a.default.bool,a.default.number,a.default.string]));F.propTypes={_onChange:a.default.func.isRequired,className:a.default.string,default:a.default.string.isRequired,hideAddButton:a.default.bool,hideEditButton:a.default.bool,hideRemoveButton:a.default.bool,hideResetButton:a.default.bool,imageField:W,imagePreviewAttrs:W,maskPreviewStyle:W,moduleAttrs:W,name:a.default.string.isRequired,patternPreviewStyle:W,readonly:a.default.bool,type:a.default.string.isRequired,value:a.default.string.isRequired,videoNode:a.default.node},F.defaultProps={className:"",hideAddButton:!1,hideEditButton:!0,hideRemoveButton:!1,hideResetButton:!1,imagePreviewAttrs:{},maskPreviewStyle:{},moduleAttrs:{},patternPreviewStyle:{},readonly:!1,videoNode:null};var V=(0,w.withDynamicContent)((function(e){return{image:{attribute:(0,s.default)(e,"imageField.name","background_image"),type:"image",value:(0,s.default)(e,"imageField.value","")}}}),(function(e){return{_dynamic_attributes:(0,s.default)(e,"imageField.dynamic",!1)?(0,s.default)(e,"imageField.name",""):""}}))(F);t.default=V},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=m(n(0)),a=(m(n(3)),m(n(13))),i=m(n(1)),l=m(n(31)),u=m(n(125)),s=m(n(42)),c=m(n(7)),d=m(n(794)),f=(m(n(116)),m(n(11))),p=m(n(84)),h=m(n(43));function m(e){return e&&e.__esModule?e:{default:e}}function y(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;nt.iconsBufferStepSize;t.setState({iconsBufferSize:n?t.iconsBufferStepSize:e.length,hasMoreIcons:n})})),D(j(t),"_onFilterDropdownToggle",(function(){t.setState({filterDropdownActive:!t.state.filterDropdownActive})})),D(j(t),"maybeCloseDropdown",(function(n){t.state.filterDropdownActive&&e(n.target).closest(".et-fb-options-filter-dropdown-wrap, .et-fb-options-filter-button-group").length<1&&t._onFilterDropdownToggle()})),D(j(t),"orderIconlist",(function(e,t){return(0,a.default)(e,[function(e){return 1e3*e.search_terms.toLowerCase().indexOf(t)+e.search_terms.length}])})),D(j(t),"increaseBufferSize",(function(){var e=t.state.iconsBufferSize+t.iconsBufferStepSize;e>t.state.fontIcons.length?t.setState({hasMoreIcons:!1,iconsBufferSize:t.state.fontIcons.length}):t.setState({iconsBufferSize:e})})),D(j(t),"_renderFilterOutput",(function(){var e=ETBuilderBackend.searchFilterIconItems,n={show_only:ETBuilderBackend.i18n.modals.show_only},r=t.state.filterSelected?t.state.filterSelected:void 0,o=(0,u.default)(e.show_only,r)?e.show_only[r]:r,a=!(0,i.default)(r),l=(0,i.default)(t.state.filterSelected)?d.default.createElement(b.default,{className:"et-fb-options-filter-button-group"},d.default.createElement(g.default,{_onClick:t._onFilterDropdownToggle},d.default.createElement(_.default,{icon:"add",color:a?w.default.white:w.default.shuttleGrey,size:"14"})),d.default.createElement(g.default,{_onClick:t._onFilterDropdownToggle},ETBuilderBackend.i18n.modals.filter)):d.default.createElement(b.default,{className:"et-fb-options-filter-button-group"},d.default.createElement(g.default,{_onClick:t._onFilterDropdownToggle},o),d.default.createElement(g.default,{_onClick:t._onFilterReset},d.default.createElement(_.default,{icon:"exit",color:a?w.default.white:w.default.shuttleGrey,size:"10"}))),s=t.props.dropDownClassName?t.props.dropDownClassName:"",c=!!t.state.filterDropdownActive&&d.default.createElement("div",{className:"et-fb-options-filter-dropdown-wrap et-fb-icons-filter-dropdown-wrap"},d.default.createElement(v.default,{value:r,name:s,options:e,optionGroups:n,__onChange:t._onFilterSelect,iconPickerMenuCustomStyling:t.props.iconPickerMenuCustomStyling,activeOnLoad:!0}));return d.default.createElement("div",{className:(0,f.default)({"et-fb-font-icon-filter":!0,"et-fb-options-filter--has-dropdown":!0})},d.default.createElement("div",{className:"et-fb-options-filter-input-wrap et-fb-icons-filter-input-wrap"},d.default.createElement(y.default,{type:"text",value:t.state.iconSearchString,name:"icons_filter",_onChange:t._onSearchInput,additional_attrs:{placeholder:ETBuilderBackend.i18n.modals.searchIcons}})),!!e&&d.default.createElement("div",{className:"et-fb-options-filter-button-wrap"},l),c)})),t}return n=M,(r=[{key:"componentWillUnmount",value:function(){m.default.topWindow().removeEventListener("mousedown",this.maybeCloseDropdown)}},{key:"processIconSearchTerm",value:function(e){return"undefined"==typeof search_word&&(0,o.default)(e.replace(/-/g," ")).toLowerCase()}},{key:"getFilteredSearchIcons",value:function(e,t){var n=this,r=ETBuilderBackend.fontIconsExtended;if(e=this.processIconSearchTerm(e),void 0!==t&&00;r("imgsize","full");var i,c=a?y.default.appWindow().wp.media:y.default.topWindow().wp.media,p=this.props,h=p.name,m=p.hide_metadata,g=p.attachment_id,b=p.embed,v=p.choose_text,_=p.upload_button_text,w=p._onChange,O=p._onEnableBackgroundSetting;if(!0===m&&e("body").addClass("et-bp-settings-option-upload-hide-metadata"),a&&y.default.$topWindow("body").addClass("et-bp-settings-hide-settings-modal"),void 0!==i)return i.open(),void o();(i=c.frames.file_frame=new c.view.MediaFrame.ETSelect({title:(0,l.decode)(v),library:{type:this._getDataType()},button:{text:(0,l.decode)(_)},multiple:!1,embed:b})).on("select",(function(){var e=i.state().props.get("url");w(h,e)})),i.on("close",(function(){e("body").removeClass("et-bp-settings-option-upload-hide-metadata"),y.default.$topWindow("body").removeClass("et-bp-settings-hide-settings-modal")})),i.on("insert",(function(){var e=i.state().get("selection").first();if(e){var t=e.get("alt");t&&(0,d.default)(O)&&w("alt",t);var n=e.get("title");n&&(0,d.default)(O)&&w("title_text",n);var r=e.get("url"),o=i.state().display(e).get("size");o&&(0,s.default)(e,"attributes.sizes.".concat(o))&&(r=(0,u.default)(e,"attributes.sizes.".concat(o)).url);var a=r;if(g){var l=e.get("id");j[l]=r,a=l}w(h,a)}})),i.open(),o()}}},{key:"_onClickRemove",value:function(){this.props._onChange(this.props.name,""),(0,d.default)(this.props._onEnableBackgroundSetting)||this.props._onEnableBackgroundSetting(this.props.name,"delete",this.props.type)}},{key:"_onClickReset",value:function(){this.props._onChange(this.props.name,"",void 0,void 0,!0),(0,d.default)(this.props._onEnableBackgroundSetting)||this.props._onEnableBackgroundSetting(this.props.name,"reset",this.props.type)}},{key:"_hasPreview",value:function(){return"image"===this._getDataType()||"video"===this._getDataType()}},{key:"getAddTitle",value:function(){var e=ETBuilderBackend.i18n.controls.upload,t="video"===this._getDataType()?e.addVideo:e.addImage;return(0,u.default)(this,"props.addTitle",t)}},{key:"_getDataType",value:function(){return(0,d.default)(this.props.data_type)?"image":this.props.data_type}},{key:"_getPreviewStyle",value:function(e){if(y.default.hasValue(e)&&this._hasPreview()&&"video"!==this._getDataType()){var t={};if((0,u.default)(this,"props.isBackgroundType")){var n=(0,u.default)(this,"props.imagePreviewAttrs",{});if(t.backgroundImage="url(".concat(e,")"),n.parallax)t.backgroundRepeat="no-repeat",t.backgroundSize="cover",t.backgroundPosition="center",n.gradient&&y.default.isOn(n.gradientOverlaysImage)&&(t.backgroundBlendMode=n.blend);else{t.backgroundColor=n.color,t.backgroundBlendMode=n.blend;var r=n.size;if(!(0,d.default)(r)){var o=n.image_width,a=n.image_height,i=(0,p.getBackgroundSizeCss)(r,o,a);i.size&&(t.backgroundSize=i.size)}if((0,b.hasValue)(r)&&"stretch"!==r&&(t.backgroundRepeat=n.repeat,(0,b.hasValue)(n.repeat)&&"space"!==n.repeat)){var l=n.position;if((0,b.hasValue)(l)){var s=n.horizontal_offset,c=n.vertical_offset,f=(0,p.getBackgroundPositionCss)(l,s,c);t.backgroundPosition=f.position}}}n.gradient&&(e&&(t.backgroundColor="initial"),y.default.isOn(n.gradientOverlaysImage)?t.backgroundImage="".concat(n.gradient,", url(").concat(e,")"):t.backgroundImage="url(".concat(e,"), ").concat(n.gradient))}else t.backgroundColor=h.default.uploadImagePreview;return t}}},{key:"_getPreviewContent",value:function(e){if(y.default.hasValue(e)&&this._hasPreview())return"image"!==this._getDataType()||(0,u.default)(this,"props.isBackgroundType")?"video"===this._getDataType()?o.default.createElement(g.default,{className:"et-fb-settings-option-preview-content",loop:"loop",muted:"muted",autoPlay:"autoplay",height:190,style:{width:"100%",background:"rgb(51, 59, 68)"},src:(0,v.setArgs)({width:500,controls:0,fs:0,iv_load_policy:3,modestbranding:1,showinfo:0},e)}):void 0:o.default.createElement("img",{src:e})}},{key:"_renderPreview",value:function(e,t){if(!this._hasPreview())return!1;var n=this.props,r=n.name,a=n.type,i=n.readonly,l=n.hideAddButton,u=n.hideEditButton,s=n.hideRemoveButton,c=n.hideResetButton,d=y.default.hasValue(e),f=!i&&!l&&!d,p=!i&&!u&&d,h=!i&&!s&&d,g=!i&&!c&&d&&e!==t,b=!_.default.isAllowedAction("divi_ai");return o.default.createElement(m.default,{name:r,type:a,className:"et-fb-settings-option-upload-type-".concat(this._getDataType()),addTitle:this.getAddTitle(),previewStyle:this._getPreviewStyle(e),showAddButton:f,showEditButton:p,showRemoveButton:h,showResetButton:g,onClickCanvas:this._onClick,onClickAddButton:this._onClick,onClickEditButton:this._onClick,onClickRemoveButton:this._onClickRemove,onClickResetButton:this._onClickReset,value:this.props.value,dataType:this._getDataType(),hideAIButton:b},this._getPreviewContent(e))}},{key:"render",value:function(){var e=this._hasPreview(),t=(0,u.default)(this.props,"default",""),n=(0,u.default)(this.props,"value",t),r=(0,u.default)(this.props,"additional_attrs",{}),a={"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-upload":!0,"et-fb-settings-option-inner-upload--previewable":e},l={"et-fb-settings-option-input":!0,"et-fb-settings-option-upload":!0},s=(0,u.default)(this,"props.module.props.module.props"),d="background_image"===(0,u.default)(this,"props.name")&&(0,c.default)(ETBuilderBackend.modulesFeaturedImageBackground,(0,u.default)(s,"type"))&&y.default.isOn((0,u.default)(s,"attrs.featured_image"))&&"background"===(0,u.default)(s,"attrs.featured_placement");this.props.className?l[this.props.className]=!0:(l["et-fb-main-setting"]=!0,l["regular-text"]=!0);var f=this.props,p=f.aiImageID,h=f.aiImageURL;return h&&(j[p]=h,n=p),(0,u.default)(this,"props.attachment_id")&&y.default.hasValue(n)&&(t=(0,u.default)(j,t,ETBuilderBackend.currentPage.thumbnailUrl),n=(0,u.default)(j,n,t)),d&&(n=ETBuilderBackend.currentPage.thumbnailUrl),o.default.createElement("div",{className:(0,i.default)(a)},this._renderPreview(n,t),o.default.createElement("input",k({className:(0,i.default)(l),type:"text",value:n,name:this.props.name,id:"et-fb-".concat(this.props.name),onChange:this._onChange},r)),o.default.createElement("button",{className:"et-fb-settings-option-upload-button",onClick:this._onClick},ETBuilderBackend.i18n.controls.upload.buttonText))}}])&&S(n.prototype,r),a&&S(n,a),Object.defineProperty(n,"prototype",{writable:!1}),O}(o.PureComponent);x.propTypes={choose_text:a.default.string,upload_button_text:a.default.string,embed:a.default.bool,attachment_id:a.default.bool,isBackgroundType:a.default.bool,hideAddButton:a.default.bool,hideEditButton:a.default.bool,hideRemoveButton:a.default.bool,hideResetButton:a.default.bool},x.defaultProps={choose_text:"",upload_button_text:"",embed:!0,attachment_id:!1,isBackgroundType:!1,hideAddButton:!1,hideEditButton:!1,hideRemoveButton:!1,hideResetButton:!1};var D=x;t.default=D}).call(this,n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=d(n(0)),o=d(n(3)),a=d(n(1699)),i=d(n(1700)),l=d(n(1701)),u=d(n(1497)),s=d(n(1702)),c=["src"];function d(e){return e&&e.__esModule?e:{default:e}}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var h=function(e){var t,n=e.src,o=p(e,c),d=function(e){return null!==e.match(/[^\/]+(\/[^\/]+)+\.[a-z|0-9]{2,5}(\?.+)?$/i)}(t=n)?a.default:function(e){return null!==e.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/i)}(t)?i.default:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?vimeo\.com/i)}(t)?l.default:function(e){return null!==e.match(/(https?:\/\/)?(www\.)?dailymotion\.com/i)}(t)?s.default:u.default;return r.default.createElement(d,f({},o,{src:n}))};h.propTypes={src:o.default.string.isRequired};var m=h;t.default=m},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.preLoad=t.getMany=t.default=void 0;var r=f(n(17)),o=f(n(306)),a=f(n(1711)),i=f(n(361)),l=f(n(196)),u=f(n(1712)),s=f(n(786)),c=f(n(397)),d=f(n(787));function f(e){return e&&e.__esModule?e:{default:e}}var p={},h=(0,l.default)((function(t){var n=(0,o.default)(t,(0,r.default)(p));if(!(0,d.default)(n)){var i=function(t){return new Promise((function(n){return e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,dataType:"json",data:{action:"et_fb_fetch_attachments",et_fb_fetch_attachments:ETBuilderBackend.nonces.fetchAttachments,ids:t},success:n})}))}(n);n.map((function(e){return p[e]=i.then((0,a.default)((function(t){var n=t.ID;return e===(0,c.default)(n)})))}))}return t.map((function(e){return p[e]}))}),(0,s.default)(c.default));t.getMany=h;var m=(0,l.default)(u.default,h);t.preLoad=m;var y=(0,l.default)(i.default,h,(function(e){return[e]}));t.default=y}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SLIDER_VALUE_PROP_TYPES=void 0;var o=s(n(13)),a=s(n(40)),i=s(n(3)),l=s(n(0)),u=n(1510);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1){var S=r?m:(0,u.findNearestIndex)(v,w).index,C=c(v),E=C[S];w=(0,u.prepareNewValue)(E,w),C[S]=w,C.sort(u.compareAsc);var P=C.indexOf(w);this.setNewValue(C,P)}else w=(0,u.prepareNewValue)(v[0],w),this.setNewValue([w],-1)}},{key:"render",value:function(){var e=this,t=this.props,n=t.railComponent,r=t.thumbComponent,a=t.legacy,i=t.max,s=t.min,c=t.value,d=t.onStopClick,f=t.locked,p=t.step,h=t.snap,m=t.snapDistance,y=t.activeGradientStop,g=this.state,b=g.value,v=g.lastIndex,_=this.getValue(c,b);return l.default.createElement("div",{className:(0,o.default)({"et-core-control-slider__wrapper--legacy":a},"et-core-control-slider__wrapper"),onMouseDown:this.handleMouseDown,ref:this.wrapperRef},l.default.createElement(n,{value:_,className:"et-core-control-slider__rail",disabled:this.disabled,onStopClick:d,locked:f,min:s,max:i,step:p,snap:h,snapDistance:m}),_.map((function(t,n){var a=(0,u.valueToPercent)(s,i,t),c={left:"".concat(a,"%")};return t.index=n,l.default.createElement(r,{key:t.uuid,value:t,className:(0,o.default)({"et-core-control-slider__thumb--active":e.isMoving&&n===v,editing:t.uuid===y},"et-core-control-slider__thumb"),style:c,locked:f,onStopClick:d,onStartMoving:e.handleStartMovingCallback})})))}}])&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(l.default.Component),w=[i.default.number,i.default.shape({valueOf:i.default.func}),i.default.shape({color:i.default.string,percent:i.default.number,index:i.default.number})],O=i.default.oneOfType([i.default.oneOfType(w),i.default.arrayOf(i.default.oneOfType(w))]);_.propTypes={legacy:i.default.bool,max:i.default.number,min:i.default.number,onChange:i.default.func,onMouseDown:i.default.func,railComponent:i.default.elementType,snap:i.default.bool,snapDistance:i.default.number,step:i.default.number,thumbComponent:i.default.elementType,value:O,onStopClick:i.default.func,locked:i.default.bool,activeGradientStop:i.default.oneOfType([i.default.bool,i.default.string])},_.defaultProps={legacy:!1,max:100,min:0,step:1,onChange:a.default,onMouseDown:a.default,railComponent:"div",snap:!1,snapDistance:3,thumbComponent:"span",value:{},onStopClick:a.default,locked:!1};var k=O;t.SLIDER_VALUE_PROP_TYPES=k;var S=_;t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=h(n(0)),o=h(n(3)),a=h(n(13)),i=h(n(40)),l=h(n(22)),u=n(783),s=h(n(1724)),c=h(n(1725)),d=n(1510);n(1726);var f=h(n(43)),p=h(n(164));function h(e){return e&&e.__esModule?e:{default:e}}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=e.value,n=e.className,o=e.style,h=e.newThumb,g=e.onStopClick,b=p.default.getColorValue(t.color)||t.color,v=(0,u.getContrastColor)(b),_=t.color!==b,w=(0,a.default)(n,{"et-builder-control-gradient__thumb":!0,"is-global-color":_});return r.default.createElement("span",{role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t.position,onClick:function(e){e.preventDefault(),(0,d.isPrimaryClick)(e)&&g(t)},onContextMenu:i.default,onMouseEnter:function(e){e.preventDefault(),l.default.setHoveredSubElement(function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:this.props,t="".concat(e.default).split("|"),n=t;return(0,f.hasValue)(e.value)&&(n="".concat(e.value).split("|")),t.forEach((function(e,t){(0,f.hasValue)(n[t])||(n[t]=e)})),n}},{key:"_getOption",value:function(e){return this.state.values[A(e).index]}},{key:"_getOptionDefault",value:function(e){return"".concat(this.props.default).split("|")[A(e).index]}},{key:"_sanitization",value:function(e,t){var n=this._getOptionDefault(t),r={value:parseFloat(n),unit:this.props.default_unit};if(!(0,f.hasValue)(e))return r;var o=isNaN(parseFloat(e))?parseFloat(n):parseFloat(e);switch(r.value=o,t){case"skew_x":case"skew_y":var a=this._getOption(t),i=isNaN(parseFloat(a))?o:parseFloat(a),u=0===Math.sign(i)?1:Math.sign(i),s=Math.abs(o);if(90===s){var c=Math.abs(i);c<90?r.value=91*u:c>=90&&(r.value=89*u)}s>180&&(r.value=180*u);break;case"rotate_x":case"rotate_y":case"rotate_z":r.value=o%360;break;default:r.unit=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px",n=["em","rem","px","%","vw","vh"],r=(0,m.getUnit)(e,t);return(0,l.default)(n,r)?r:t}(e,this.props.default_unit)}return r}},{key:"_renderField",value:function(e){var t=A(e),n=!1;"origin"===t.type&&(n=t.axis);var r={name:e,type:"range",value:this._getOption(e),default:this._getOptionDefault(e),default_unit:this.props.default_unit,range_settings:this.props.range_settings,key:"".concat(this.props.name,"-").concat(e),_onChange:this._setOption,visible:!0,previewMode:"desktop",readonly:this.props.readonly,isTransformOrigin:n,allowed_values:!1!==n?["top","left","right","bottom","center"]:[]};return(0,o.createElement)(h.default.getControl("range"),r)}},{key:"render",value:function(){var e=this,t=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{minWidth:"25px",width:"25px",height:"25px",margin:"0",fill:e?y.default.info:y.default.default}},n=(0,f.hasValue)(this.props.transform_type)?this.props.transform_type:"".concat(e.props.name).replace(/(transform_|__hover|_tablet|_phone)/g,""),r={onMouseEnter:this._handleWrapperEnter,onMouseLeave:this._handleWrapperLeave};switch(n){case"scale":var a=this._getOption("scale_x"),i=this._getOption("scale_y"),l=this.props.scaleLinked?{display:"none"}:{},u={};return u=a?w(w({},u),{},{width:"".concat(D*parseFloat(a)/100,"px")}):u,u=i?w(w({},u),{},{height:"".concat(D*parseFloat(i)/100,"px")}):u,o.default.createElement("div",v({className:"et-fb-settings-transform-wrapper"},r),o.default.createElement(R,{onMouseLeave:this._handleMouseUp},o.default.createElement("div",{className:"et-fb-settings-transform-square",style:u},o.default.createElement("div",{className:"et-fb-settings-transform-square-half"},o.default.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"scale_xy",onMouseDown:this._handleOnMouseDown,style:{margin:"-8px",cursor:"nesw-resize"}},N("nesw")),o.default.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"scale_y",onMouseDown:this._handleOnMouseDown,style:w(w({},l),{},{marginTop:"-9px",marginLeft:"-2px",cursor:"ns-resize"})},N("ns")),o.default.createElement("div",null)),o.default.createElement("div",{className:"et-fb-settings-transform-square-half"},o.default.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"scale_x",onMouseDown:this._handleOnMouseDown,style:w(w({},l),{},{marginTop:"-7px",marginRight:"-9px",cursor:"ew-resize"})},N("ew"))))),o.default.createElement("div",{className:"et-fb-settings-transform-vertical-range"},this._renderField("scale_y")),o.default.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("scale_x")),o.default.createElement("button",{disabled:(0,f.hasValue)(this.props.readonly),"data-linked_type":"scale",onClick:this._handleLinkedClick,className:"et-fb-settings-transform-linked"},o.default.createElement(p.default,{icon:this.props.scaleLinked?"linked":"unlinked",style:t(this.props.scaleLinked)})));case"skew":var s=this._getOption("skew_x"),c=this._getOption("skew_y"),d="";d+=s?"skewX(".concat(s,")"):d;var h={transform:d+=c?" skewY(".concat(c,")"):d},g=(parseFloat(s)+180)*this.state.containerDimensions.width/360,b=(parseFloat(c)+180)*this.state.containerDimensions.height/360,_=g-this.state.containerDimensions.width/2,O=b-this.state.containerDimensions.height/2;return o.default.createElement("div",v({className:"et-fb-settings-transform-wrapper"},r),o.default.createElement(R,{onMouseLeave:this._handleMouseUp},o.default.createElement("div",{className:"et-fb-settings-transform-square",style:h}),o.default.createElement("div",{className:"et-fb-settings-transform-square-transparent"},o.default.createElement("div",{className:"et-fb-settings-transform-square-half-skew"},o.default.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"skew_y",onMouseDown:this._handleOnMouseDown,style:{marginLeft:"-20px",marginBottom:"-6px",cursor:"ns-resize",transform:"translateY(".concat(-1*O,"px)")}},N("ns")),o.default.createElement("div",null)),o.default.createElement("div",{className:"et-fb-settings-transform-square-half-skew",style:{justifyContent:"center",alignItems:"flex-end"}},o.default.createElement("div",{className:"et-fb-settings-transform-controller","data-transform_type":"skew_x",onMouseDown:this._handleOnMouseDown,style:{marginBottom:"-20px",cursor:"ew-resize",transform:"translateX(".concat(_,"px)")}},N("ew"))))),o.default.createElement("div",{className:"et-fb-settings-transform-vertical-range"},this._renderField("skew_y")),o.default.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("skew_x")),o.default.createElement("button",{disabled:(0,f.hasValue)(this.props.readonly),"data-linked_type":"skew",onClick:this._handleLinkedClick,className:"et-fb-settings-transform-linked"},o.default.createElement(p.default,{icon:this.props.skewLinked?"linked":"unlinked",style:t(this.props.skewLinked)})));case"translate":var k=300,S=180,C=parseFloat(this._getOption("translate_x")),E=parseFloat(this._getOption("translate_y")),P=(E+k)*S/600-90,T="";T+=C?"translateX(".concat((C+k)*S/600-90,"px)"):"";var M={transform:T+=E?" translateY(".concat(P,"px)"):""};return o.default.createElement("div",v({className:"et-fb-settings-transform-wrapper"},r),o.default.createElement(R,{onMouseLeave:this._handleMouseUp},o.default.createElement("option",{className:"et-fb-settings-transform-square-translate",style:M,"data-transform_type":"translate",onMouseDown:this._handleOnMouseDown})),o.default.createElement("div",{className:"et-fb-settings-transform-vertical-range et-fb-settings-transform-vertical-range-inverted"},this._renderField("translate_y")),o.default.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("translate_x")),o.default.createElement("button",{disabled:(0,f.hasValue)(this.props.readonly),"data-linked_type":"translate",onClick:this._handleLinkedClick,className:"et-fb-settings-transform-linked"},o.default.createElement(p.default,{icon:this.props.translateLinked?"linked":"unlinked",style:t(this.props.translateLinked)})));case"origin":var j=this._getOption("origin_x"),x=this._getOption("origin_y"),A="";"%"===(0,m.getUnit)(j,"%")&&(j="".concat(D/100*parseFloat(j)-25,"px")),"%"===(0,m.getUnit)(x,"%")&&(x="".concat(D/100*parseFloat(x)-25,"px")),A+=j?"translateX(".concat(j,")"):A;var I={transform:A+=x?" translateY(".concat(x,")"):A};return o.default.createElement("div",v({className:"et-fb-settings-transform-wrapper"},r),o.default.createElement(R,{hideDotSquare:!0,onMouseLeave:this._handleMouseUp},o.default.createElement("div",{className:"et-fb-settings-transform-square-origin"}),o.default.createElement("div",{className:"et-fb-settings-transform-square-transparent-origin",style:{width:"52.5px",height:"52.5px"}},o.default.createElement("div",{className:"et-fb-settings-transform-square-half",style:{flexDirection:"row",alignItems:"flex-start"}},o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"1",onMouseDown:this._handleOriginClick}),o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"2",onMouseDown:this._handleOriginClick}),o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"3",onMouseDown:this._handleOriginClick})),o.default.createElement("div",{className:"et-fb-settings-transform-square-half",style:{flexDirection:"row",alignItems:"center"}},o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"4",onMouseDown:this._handleOriginClick}),o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"5",onMouseDown:this._handleOriginClick}),o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"6",onMouseDown:this._handleOriginClick})),o.default.createElement("div",{className:"et-fb-settings-transform-square-half",style:{flexDirection:"row",alignItems:"flex-end"}},o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"7",onMouseDown:this._handleOriginClick}),o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"8",onMouseDown:this._handleOriginClick}),o.default.createElement("div",{className:"et-fb-settings-transform-origin-controller","data-origin_type":"9",onMouseDown:this._handleOriginClick}))),o.default.createElement("div",{className:"et-fb-settings-transform-origin-dot",style:I,"data-transform_type":"origin",onMouseDown:this._handleOnMouseDown})),o.default.createElement("div",{className:"et-fb-settings-transform-vertical-range et-fb-settings-transform-vertical-range-inverted"},this._renderField("origin_y")),o.default.createElement("div",{className:"et-fb-settings-transform-horizontal-range"},this._renderField("origin_x")));case"rotate":var B=this._getOption("rotate_x"),F=this._getOption("rotate_y"),W=this._getOption("rotate_z");return o.default.createElement("div",r,o.default.createElement(R,{style:{justifyContent:"space-around",width:"100%"},hideDotSquare:!0,hideRuler:!0,onMouseLeave:this._handleMouseUp},o.default.createElement(L,{type:"rotate_z",angle:W,handleOnMouseDown:this._handleOnMouseDown}),o.default.createElement(L,{type:"rotate_x",angle:B,handleOnMouseDown:this._handleOnMouseDown}),o.default.createElement(L,{type:"rotate_y",angle:F,handleOnMouseDown:this._handleOnMouseDown})),o.default.createElement("div",{className:"et-fb-settings-transform-rotate"},o.default.createElement("div",{className:"et-fb-settings-transform-rotate-range"},this._renderField("rotate_z")),o.default.createElement("div",{className:"et-fb-settings-transform-rotate-range"},this._renderField("rotate_x")),o.default.createElement("div",{className:"et-fb-settings-transform-rotate-range"},this._renderField("rotate_y"))));default:return o.default.createElement("div",null,"".concat(n," is not a registered Transform type"))}}}],r&&O(n.prototype,r),a&&O(n,a),Object.defineProperty(n,"prototype",{writable:!1}),s}(o.default.Component);I.propTypes={name:a.default.string,default:a.default.string,default_unit:a.default.string,transform_type:a.default.string,range_settings:a.default.object,value:a.default.string,uniqueKey:a.default.string,_onChange:a.default.func,onClickLink:a.default.func,scaleLinked:a.default.bool,skewLinked:a.default.bool,translateLinked:a.default.bool,readonly:a.default.bool},I.defaultProps={name:"transform_scale",default:"100%|100%",default_unit:"%",transform_type:"scale",range_settings:{min:-100,max:300,step:1},value:"100%|100%",uniqueKey:"",_onChange:s.default,onClickLink:s.default,scaleLinked:!0,skewLinked:!0,translateLinked:!0,readonly:!1};var B=I;t.default=B}).call(this,n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTextAlignIconName=t.getModule=t.getAlignIconName=void 0;var r,o=(r=n(1))&&r.__esModule?r:{default:r};t.getAlignIconName=function(e){switch(e){case"force_left":case"left":return"align-left";case"center":return"align-center";case"right":return"align-right";default:return e}};t.getTextAlignIconName=function(e){switch(e){case"justified":return"text-justify";case"force_left":case"left":return"text-left";case"center":return"text-center";case"right":return"text-right";default:return e}};t.getModule=function(e){return(0,o.default)(e,"props.module.props.module",!1)}},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ETBuilderControlIconPicker=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=c(n(3)),i=c(n(31)),l=c(n(42)),u=c(n(43)),s=c(n(84));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;nn)return!1;var o={width:(0,a.spring)(n,{stiffness:300,damping:30})},l=(0,i.default)(this.props,"name",""),u=(0,i.default)(e.appWindow(),"etCore.portability.text.".concat(l,"ing"),"");return this.state.isCompleted?React.createElement("span",{className:"et-fb-tooltip-modal--loader et-core-loader et-core-loader-success"}):React.createElement("div",{className:"et-fb-tooltip-modal--progress"},React.createElement("div",{className:"et-fb-tooltip-modal--progress-bar"},React.createElement(a.Motion,{defaultStyle:{width:0,opacity:100},style:o},(function(e){return React.createElement("div",{className:"et-fb-tooltip-modal--progress-chart",style:{width:"".concat(e.width,"%")}},React.createElement("div",{className:"et-fb-tooltip-modal--progress-label"},parseInt(e.width),"%"))}))),React.createElement("div",{className:"et-fb-tooltip-modal--time-estimation"},r>0&&u.replace("1",r)))}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),f}(o.Component);y={name:"",progress:0,time_remaining:1,renderStart:1},(m="defaultProps")in(h=g)?Object.defineProperty(h,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):h[m]=y;var b=g;t.default=b}).call(this,n(2))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=P(n(845)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),i=P(n(13)),l=P(n(1)),u=P(n(5)),s=(P(n(96)),P(n(11))),c=P(n(31)),d=P(n(124)),f=P(n(85)),p=P(n(40)),h=n(93),m=P(n(22)),y=P(n(6)),g=P(n(303)),b=P(n(1565)),v=P(n(457)),_=P(n(784)),w=P(n(43)),O=P(n(1488)),k=P(n(2)),S=n(1564);n(1894);var C=["addToLibrary"];function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}function P(e){return e&&e.__esModule?e:{default:e}}function T(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||x(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||x(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?{maxHeight:this.props.maxHeight}:"",n=this.props.hasProgressBar||this.state.hasImportCompletedCheckmark?{height:(0,l.default)(t,"maxHeight",200),position:"relative"}:{};return a.default.createElement("div",{className:"et-fb-main-settings et-fb-main-settings--portability"},(e=this.props)._renderTabs.apply(e,T(this.tabs)),a.default.createElement("div",{className:"et-fb-settings-options-wrap et_fb_save_module_modal",style:t},a.default.createElement("div",{className:"et-fb-settings-options",style:n},this._renderModalContent())))}}])&&N(t.prototype,n),r&&N(t,r),Object.defineProperty(t,"prototype",{writable:!1}),S}(a.default.Component);F(U,"displayName","ETBuilderPortabilityModal"),F(U,"defaultProps",{hasProgressBar:!1,importProgress:0,importEstimation:1,exportProgress:0,exportEstimation:1,layoutId:0,disableCheckmark:!1,bulkImport:!1});var G=(0,S.withPortability)(U);t.default=G},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=m(n(35)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),i=m(n(3)),l=m(n(5)),u=m(n(13)),s=m(n(1895));n(1900);var c=m(n(795)),d=m(n(507)),f=m(n(620)),p=m(n(814));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function m(e){return e&&e.__esModule?e:{default:e}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.innerWidth&&(n=e.innerWidth-t.width),t.bottom>e.innerHeight&&(r=e.innerHeight-t.height),t.left<0&&(n=0),t.top<0&&(r=0),n!==t.left||r!==t.top){var o=n-t.left,a=r-t.top,i=m.current.style.transform.replace(/translate\((.*)px, (.*)px\)/,(function(e,t,n){var r=parseInt(t,10)+o,i=parseInt(n,10)+a;return h({x:r,y:i}),"translate(".concat(r,"px, ").concat(i,"px)")}));m.current.style.transform=i}}};(0,a.useEffect)((function(){var e=localStorage.getItem("".concat(r,"_position"));e&&h(JSON.parse(e));var t=m.current,n=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting||v()}))}),{root:null,rootMargin:"0px",threshold:0});t&&n.observe(t);var o=new ResizeObserver((function(){v()}));return t&&o.observe(t),function(){t&&(n.unobserve(t),o.unobserve(t))}}),[]);var _=function(e,t){var n={x:t.lastX,y:t.lastY};localStorage.setItem("".concat(r,"_position"),JSON.stringify(n)),h(n)},w=function(){return a.default.createElement("div",{className:"et-common-prompt__container",ref:m},o)},O=(0,u.default)({"et-common-prompt":!0,"et-common-prompt-draggable":i});return a.default.createElement("div",{className:O,ref:t},!i&&a.default.createElement("div",{className:"et-common-prompt__overlay"}),a.default.createElement(c.default,y({},b,{onRest:v}),(function(e){return a.default.createElement("div",{className:"et-common-prompt__modal",style:e},i&&a.default.createElement(s.default,{handle:".react-draggable > .et-common-prompt__header",bounds:"parent",position:f,onStop:_},w()),!i&&w())})),a.default.createElement(p.default,{lockId:"common-prompt"}))}));v.propTypes={animation:i.default.bool,modalKey:i.default.oneOfType([i.default.string,i.default.number]),draggable:i.default.bool},v.defaultProps={animation:!0,modalKey:"",draggable:!1},v.Header=a.default.memo((function(e){var t=e.children,n=e.render,r=e.onBack,i=e.onClose,l=e.className,s=void 0===l?"":l,c=(0,u.default)({"et-common-prompt__header":!0,"et-common-prompt__header-back":r})+" ".concat(s);return a.default.createElement("div",{className:c},(0,o.default)(r)&&a.default.createElement(d.default,{className:"et-common-button--round",onClick:r},a.default.createElement(f.default,{icon:"back",color:"#ffffff"})),a.default.createElement("span",null,t),(0,o.default)(n)&&n(),(0,o.default)(i)&&a.default.createElement("div",{className:"et-common-prompt__header-actions"},a.default.createElement(d.default,{className:"et-common-button--round",onClick:i,"data-testid":"ClosePrompt"},a.default.createElement(f.default,{icon:"close",color:"#ffffff"}))))})),v.Content=a.default.memo((function(e){var t=e.style,n=e.children;return a.default.createElement("div",{className:"et-common-prompt__body"},a.default.createElement("div",{className:"et-common-prompt__content",style:t},n))})),v.Content.propTypes={style:i.default.object},v.Content.defaultProps={style:{}},v.Actions=a.default.memo((function(e){var t=e.children;return a.default.createElement("div",{className:"et-common-prompt__footer"},t)}));var _=v;t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,n){var o=e.state,i=!(0,r.isNum)(o.lastX),l=a(e);return i?{node:l,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:l,deltaX:t-o.lastX,deltaY:n-o.lastY,lastX:o.lastX,lastY:o.lastY,x:t,y:n}},t.createDraggableData=function(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];var i=e.props.bounds;i="string"==typeof i?i:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(i);var l=a(e);if("string"==typeof i){var u,s=l.ownerDocument,c=s.defaultView;if(!((u="parent"===i?l.parentNode:s.querySelector(i))instanceof c.HTMLElement))throw new Error('Bounds selector "'+i+'" could not find an element.');var d=u,f=c.getComputedStyle(l),p=c.getComputedStyle(d);i={left:-l.offsetLeft+(0,r.int)(p.paddingLeft)+(0,r.int)(f.marginLeft),top:-l.offsetTop+(0,r.int)(p.paddingTop)+(0,r.int)(f.marginTop),right:(0,o.innerWidth)(d)-(0,o.outerWidth)(l)-l.offsetLeft+(0,r.int)(p.paddingRight)-(0,r.int)(f.marginRight),bottom:(0,o.innerHeight)(d)-(0,o.outerHeight)(l)-l.offsetTop+(0,r.int)(p.paddingBottom)-(0,r.int)(f.marginBottom)}}(0,r.isNum)(i.right)&&(t=Math.min(t,i.right));(0,r.isNum)(i.bottom)&&(n=Math.min(n,i.bottom));(0,r.isNum)(i.left)&&(t=Math.max(t,i.left));(0,r.isNum)(i.top)&&(n=Math.max(n,i.top));return[t,n]},t.getControlPosition=function(e,t,n){var r="number"==typeof t?(0,o.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;var i=a(n),l=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,o.offsetXYFromParent)(r||e,l,n.props.scale)},t.snapToGrid=function(e,t,n){var r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var r=n(1499),o=n(1513);function a(e){var t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){void 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSaveModalTitle=t.getSaveModalItemLabel=t.getSaveModalDescription=void 0;var r=i(n(163)),o=i(n(1)),a=n(57);function i(e){return e&&e.__esModule?e:{default:e}}t.getSaveModalTitle=function(e){var t=ETBuilderBackend.i18n.tooltips,n=(0,a.getType)(e),r=t.addToLayoutLibrary;return""===n?r:r=(0,a.isSection)(e)?t.addToSectionLibrary:(0,a.isRow)(e)||(0,a.isInnerRow)(e)?t.addToRowLibrary:(n.indexOf("et_pb_")>-1&&(0,a.isInnerColumn)(e),t.addToModuleLibrary)};t.getSaveModalDescription=function(e){var t=ETBuilderBackend.i18n.saveModuleLibraryAttrs,n=(0,a.getType)(e),r=t.descriptionTextLayout;return""===n?r:r=(0,a.isSection)(e)?t.descriptionSectionText:(0,a.isRow)(e)||(0,a.isInnerRow)(e)?t.descriptionRowText:(n.indexOf("et_pb_")>-1&&(0,a.isInnerColumn)(e),t.descriptionModuleText)};t.getSaveModalItemLabel=function(e,t){var n=ETBuilderBackend.i18n.saveModuleLibraryAttrs,i=(0,a.getType)(e),l=(0,o.default)(n,t);return(0,r.default)(l)?"":""===i?l:l=(0,a.isSection)(e)?(0,o.default)(n,"sectionLabel"):(0,a.isRow)(e)||(0,a.isInnerRow)(e)?(0,o.default)(n,"rowLabel"):(i.indexOf("et_pb_")>-1&&(0,a.isInnerColumn)(e),(0,o.default)(n,"moduleLabel"))}},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),i=E(n(3)),l=E(n(11)),u=E(n(31)),s=E(n(364)),c=E(n(162)),d=E(n(1)),f=E(n(35)),p=E(n(34)),h=E(n(9)),m=E(n(1492)),y=E(n(1599)),g=E(n(1524)),b=E(n(22)),v=E(n(14)),_=E(n(6)),w=E(n(19)),O=E(n(285)),k=E(n(1618)),S=E(n(281)),C=E(n(2));function E(e){return e&&e.__esModule?e:{default:e}}function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};s(this,e);var r=(0,o.default)(a.default);this.context=n,this.store=r,this.monitor=new l.default(r),this.registry=this.monitor.registry,this.backend=t(this),r.subscribe(this.handleRefCountChange.bind(this))}return r(e,[{key:"handleRefCountChange",value:function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)}},{key:"getContext",value:function(){return this.context}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch;return Object.keys(i).filter((function(e){return"function"==typeof i[e]})).reduce((function(n,r){var o,a=i[r];return n[r]=(o=a,function(){for(var n=arguments.length,r=Array(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];return{dirtyHandlerIds:(0,i.default)(e.dirtyHandlerIds,t,e.dragOperation),dragOffset:(0,r.default)(e.dragOffset,t),refCount:(0,a.default)(e.refCount,t),dragOperation:(0,o.default)(e.dragOperation,t),stateId:(0,l.default)(e.stateId)}};var r=u(n(1519)),o=u(n(1581)),a=u(n(1582)),i=u(n(1521)),l=u(n(1583));function u(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments[1];switch(t.type){case l.BEGIN_DRAG:return r({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case l.PUBLISH_DRAG_SOURCE:return r({},e,{isSourcePublic:!0});case l.HOVER:return r({},e,{targetIds:t.targetIds});case u.REMOVE_TARGET:return-1===e.targetIds.indexOf(t.targetId)?e:r({},e,{targetIds:(0,i.default)(e.targetIds,t.targetId)});case l.DROP:return r({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case l.END_DRAG:return r({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}};var o,a=n(794),i=(o=a)&&o.__esModule?o:{default:o},l=n(1493),u=n(1494);var s={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments[1];switch(t.type){case r.ADD_SOURCE:case r.ADD_TARGET:return e+1;case r.REMOVE_SOURCE:case r.REMOVE_TARGET:return e-1;default:return e}};var r=n(1494)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=n.handlerIds;(0,o.default)("function"==typeof e,"listener must be a function."),(0,o.default)(void 0===r||(0,a.default)(r),"handlerIds, when specified, must be an array of strings.");var i=this.store.getState().stateId,l=function(){var n=t.store.getState(),o=n.stateId;try{o===i||o===i+1&&!(0,s.areDirty)(n.dirtyHandlerIds,r)||e()}finally{i=o}};return this.store.subscribe(l)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;(0,o.default)("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe((function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())}))}},{key:"canDragSource",value:function(e){var t=this.registry.getSource(e);return(0,o.default)(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){var t=this.registry.getTarget(e);if((0,o.default)(t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return(0,i.default)(n,r)&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){var t=this.registry.getSource(e,!0);return(0,o.default)(t,"Expected to find a valid source."),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1},n=t.shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),o=this.getItemType();if(!(0,i.default)(r,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var l=a.indexOf(e);return n?l===a.length-1:l>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return(0,u.getSourceClientOffset)(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return(0,u.getDifferenceFromInitialOffset)(this.store.getState().dragOffset)}}]),e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1024){for(var t=0,n=o.length-a;t0}},{key:"leave",value:function(e){var t=this.entered.length;return this.entered=(0,a.default)(this.entered.filter((function(e){return document.documentElement.contains(e)})),e),t>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}();t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeClientOffset=l,t.getEventClientOffset=function(e){return{x:e.clientX,y:e.clientY}},t.getDragPreviewOffset=function(e,t,n,r,a){var u=(w=t,"IMG"===w.nodeName&&((0,o.isFirefox)()||!document.documentElement.contains(w))),s=l(u?e:t),c={x:n.x-s.x,y:n.y-s.y},d=e.offsetWidth,f=e.offsetHeight,p=r.anchorX,h=r.anchorY,m=function(e,t,n,r){var a=e?t.width:n,i=e?t.height:r;(0,o.isSafari)()&&e&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio);return{dragPreviewWidth:a,dragPreviewHeight:i}}(u,t,d,f),y=m.dragPreviewWidth,g=m.dragPreviewHeight,b=a.offsetX,v=a.offsetY,_=0===v||v;var w;return{x:0===b||b?b:new i.default([0,.5,1],[c.x,c.x/d*y,c.x+y-d]).interpolate(p),y:_?v:(O=new i.default([0,.5,1],[c.y,c.y/f*g,c.y+g-f]).interpolate(h),(0,o.isSafari)()&&u&&(O+=(window.devicePixelRatio-1)*g),O)};var O};var r,o=n(1523),a=n(1596),i=(r=a)&&r.__esModule?r:{default:r};function l(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;ne))return n[s];u=s-1}}var d=e-t[i=Math.max(0,u)],f=d*d;return n[i]+r[i]*d+o[i]*f+a[i]*d*f}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n-1}))}))[0]||null};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1501));function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t,n){var r=t.reduce((function(t,n){return t||e.getData(n)}),null);return null!=r?r:n}var u=(i(r={},a.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),i(r,a.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return l(e,t,"").split("\n")}}),i(r,a.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return l(e,t,"")}}),r)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){r||((r=new Image).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==");return r};var r=void 0},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=f(n(0)),a=f(n(3)),i=f(n(1)),l=f(n(59)),u=f(n(63)),s=f(n(43)),c=f(n(22)),d=f(n(84));function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return h.default.apply(void 0,["DragLayer","collect[, options]"].concat(Array.prototype.slice.call(arguments))),(0,d.default)("function"==typeof e,'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ',"Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html",e),(0,d.default)((0,c.default)(t),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-layer.html',t),function(n){var c,h,m=t.arePropsEqual,v=void 0===m?p.default:m,_=n.displayName||n.name||"Component",w=(h=c=function(t){function i(e,t){y(this,i);var n=g(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,e));return n.handleChange=n.handleChange.bind(n),n.manager=t.dragDropManager,(0,d.default)("object"===o(n.manager),"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://react-dnd.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",_,_),n.state=n.getCurrentState(),n}return b(i,t),a(i,[{key:"getDecoratedComponentInstance",value:function(){return(0,d.default)(this.child,"In order to access an instance of the decorated component it can not be a stateless component."),this.child}},{key:"shouldComponentUpdate",value:function(e,t){return!v(e,this.props)||!(0,f.default)(t,this.state)}}]),a(i,[{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0;var e=this.manager.getMonitor();this.unsubscribeFromOffsetChange=e.subscribeToOffsetChange(this.handleChange),this.unsubscribeFromStateChange=e.subscribeToStateChange(this.handleChange),this.handleChange()}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,this.unsubscribeFromOffsetChange(),this.unsubscribeFromStateChange()}},{key:"handleChange",value:function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();(0,f.default)(e,this.state)||this.setState(e)}}},{key:"getCurrentState",value:function(){var t=this.manager.getMonitor();return e(t,this.props)}},{key:"render",value:function(){var e=this;return l.default.createElement(n,r({},this.props,this.state,{ref:function(t){e.child=t}}))}}]),i}(i.Component),c.DecoratedComponent=n,c.displayName="DragLayer("+_+")",c.contextTypes={dragDropManager:u.default.object.isRequired},h);return(0,s.default)(w,n)}};var i=n(0),l=m(i),u=m(n(3)),s=m(n(622)),c=m(n(134)),d=m(n(1483)),f=m(n(1502)),p=m(n(1526)),h=m(n(1495));function m(e){return e&&e.__esModule?e:{default:e}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};a.default.apply(void 0,["DragSource","type, spec, collect[, options]"].concat(Array.prototype.slice.call(arguments)));var p=e;"function"!=typeof e&&((0,r.default)((0,d.default)(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',e),p=function(){return e});(0,r.default)((0,o.default)(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',t);var h=(0,u.default)(t);return(0,r.default)("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',n),(0,r.default)((0,o.default)(f),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',n),function(e){return(0,i.default)({connectBackend:function(e,t){return e.connectDragSource(t)},containerDisplayName:"DragSource",createHandler:h,registerHandler:l.default,createMonitor:s.default,createConnector:c.default,DecoratedComponent:e,getType:p,collect:n,options:f})}};var r=f(n(1483)),o=f(n(134)),a=f(n(1495)),i=f(n(1527)),l=f(n(1607)),u=f(n(1608)),s=f(n(1609)),c=f(n(1610)),d=f(n(1530));function f(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=r(n(1503));t.isDisposable=o.default;var a=r(n(1604));t.Disposable=a.default;var i=r(n(1605));t.CompositeDisposable=i.default;var l=r(n(1606));t.SerialDisposable=l.default},function(e,t,n){"use strict";t.__esModule=!0;var r=function(){function e(e,t){for(var n=0;n-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html',i.join(", "),t),(0,o.default)("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",t,t,e[t])})),l.forEach((function(t){(0,o.default)("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}));var t=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.monitor=e,this.props=null,this.component=null}return r(t,[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveComponent",value:function(e){this.component=e}},{key:"canDrag",value:function(){return!e.canDrag||e.canDrag(this.props,this.monitor)}},{key:"isDragging",value:function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()}},{key:"beginDrag",value:function(){return e.beginDrag(this.props,this.monitor,this.component)}},{key:"endDrag",value:function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)}}]),t}();return function(e){return new t(e)}};var o=a(n(1483));a(n(134));function a(e){return e&&e.__esModule?e:{default:e}}var i=["canDrag","beginDrag","isDragging","endDrag"],l=["beginDrag"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),!n)return(0,i.cloneElement)(e,{ref:t});return(0,i.cloneElement)(e,{ref:function(e){t(e),n&&n(e)}})};var r,o=n(1483),a=(r=o)&&r.__esModule?r:{default:r},i=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};a.default.apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(Array.prototype.slice.call(arguments)));var p=e;"function"!=typeof e&&((0,r.default)((0,d.default)(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',e),p=function(){return e});(0,r.default)((0,o.default)(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',t);var h=(0,u.default)(t);return(0,r.default)("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',n),(0,r.default)((0,o.default)(f),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',n),function(e){return(0,i.default)({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:h,registerHandler:l.default,createMonitor:s.default,createConnector:c.default,DecoratedComponent:e,getType:p,collect:n,options:f})}};var r=f(n(1483)),o=f(n(134)),a=f(n(1495)),i=f(n(1527)),l=f(n(1613)),u=f(n(1614)),s=f(n(1615)),c=f(n(1616)),d=f(n(1530));function f(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=n.getRegistry(),o=r.addTarget(e,t);return{handlerId:o,unregister:function(){r.removeTarget(o)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html',i.join(", "),t),(0,o.default)("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs-drop-target.html",t,t,e[t])}));var t=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.monitor=e,this.props=null,this.component=null}return r(t,[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"receiveComponent",value:function(e){this.component=e}},{key:"canDrop",value:function(){return!e.canDrop||e.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){e.hover&&e.hover(this.props,this.monitor,this.component)}},{key:"drop",value:function(){if(e.drop)return e.drop(this.props,this.monitor,this.component)}}]),t}();return function(e){return new t(e)}};var o=a(n(1483));a(n(134));function a(e){return e&&e.__esModule?e:{default:e}}var i=["canDrop","hover","drop"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nt.props.valueMax&&(n=t.props.valueMax),t.props._onChange(t.props.name,n),t.setState({value:n})}));var n=(0,d.default)(t.props.value),r=(0,d.default)(t.props.default);return t.state={value:n===r?"":n},t}return t=h,(n=[{key:"componentDidUpdate",value:function(e){var t=this.props.value;e.value===t||this.userUpdate||this.setState({value:t}),this.userUpdate=!1}},{key:"getDefaultValue",value:function(){return(0,d.default)(this.props.default)}},{key:"_emitChange",value:function(){this.userUpdate=!0,this.props._onChange(this.props.name,this.state.value)}},{key:"render",value:function(){var e=(0,c.default)(this.props,"additional_attrs",{}),t={"et-core-control-input":!0};this.props.className&&(t[this.props.className]=!0),this.props.readonly&&(e.readOnly=!0);var n=this.props,r=n.id,a=n.type;return r||(r="et-fb-".concat(this.props.name)),a||(a="text"),o.default.createElement("input",y({className:(0,i.default)(t),type:a,value:this.state.value,name:this.props.name,id:r,onChange:s.default,onInput:this._onInput,onBlur:this._onBlur,placeholder:this.getDefaultValue()},e))}}])&&g(t.prototype,n),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),h}(o.PureComponent);k(S,"propTypes",{name:a.default.string.isRequired});var C=S;t.default=C},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=E(n(13)),i=n(67),l=E(n(31)),u=E(n(9)),s=E(n(10)),c=E(n(11)),d=E(n(96)),f=E(n(5)),p=(E(n(8)),E(n(56))),h=E(n(1)),m=E(n(34)),y=E(n(40)),g=E(n(458)),b=E(n(116)),v=E(n(123)),_=n(1504),w=E(n(43)),O=E(n(1624)),k=E(n(1492)),S=E(n(1626)),C=n(358);function E(e){return e&&e.__esModule?e:{default:e}}function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;to&&u>l||(e.moveItem(r,o),t.getItem().index=o)}}},E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(l,e);var t,n,r,a=_(l);function l(){var e;g(this,l);for(var t=arguments.length,n=new Array(t),r=0;r.1&&parseFloat(e)%1>0&&this.setState({rangeStep:"0.1"}),this.checkRangeBoundaries(this.state.value)}},{key:"componentDidUpdate",value:function(e){var t=this.emptyIfDefault(this.props.value);e.value===t||this.userUpdate||this.setState({value:t}),this.userUpdate=!1}},{key:"componentWillUnmount",value:function(){this.deferredUpdate.cancel()}},{key:"getDefaultValue",value:function(){return(0,s.default)(this.props.default)}},{key:"emptyIfDefault",value:function(e){return e===this.getDefaultValue()?"":e}},{key:"checkRangeBoundaries",value:function(e){if((0,s.default)(e)){var t=parseFloat(e);t>this.state.rangeMax&&this.setState({rangeMax:t}),t.1&&t%1>0&&this.setState({rangeStep:"0.1"})}}},{key:"_renderInput",value:function(){var e=this.props.id||"et-fb-".concat(this.props.name),t=this.props.name,n=this.emptyIfDefault(this.state.value),r=this.getDefaultValue(),a=""===n?r:n;return o.default.createElement("div",{className:"et-fb-settings-option-inputs-wrap"},o.default.createElement("input",{id:e,name:t,type:"range",min:this.state.rangeMin,max:this.state.rangeMax,step:this.state.rangeStep,className:"et-fb-range",value:parseFloat(a),"data-shortcuts-allowed":!0,onChange:this._updateFromRange}),o.default.createElement("div",{className:"et-fb-range-number et-fb-settings-option-input"},o.default.createElement("input",{type:"number",value:n,placeholder:r,onChange:this._onChange})))}},{key:"render",value:function(){var e=this.getDefaultValue(),t=this.props.value,n="";return t&&t!==e&&(n=o.default.createElement("button",{className:"et-fb-settings-option-button--reset",onClick:this.reset})),o.default.createElement("div",{className:(0,i.default)({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner-range":!0})},this._renderInput(),n)}}])&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(o.PureComponent);v(_,"defaultProps",{default_unit:""}),v(_,"propTypes",{name:a.default.string.isRequired,default_unit:a.default.string,precision:a.default.number});var w=_;t.default=w},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=i(n(3));function i(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n=0)},getLastVerticalUpdated:function(){return this._lastVUpdated},getLastHorizontalUpdated:function(){return this._lastHUpdated},updatePadding:function(e){this.removePaddingMobile(),this.setState({value:e}),this.saveValue.cancel(),this.saveValue()},updateOptionValue:function(){this.props._onChange(this.props.name+this.getPropsNameSuffix(),this.getStateValue())}});A.defaultProps={default:"|||||"};var I=A;t.default=I},function(e,t,n){"use strict";n.r(t)},function(e,t,n){var r=n(54)("add",n(633));r.placeholder=n(48),e.exports=r},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=d(n(3)),i=d(n(1637)),l=d(n(626));n(1638);var u=d(n(40)),s=d(n(196)),c=n(115);function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}t.default=function(e){var t=e.pos,n=e.style,i=e.className,s=u(e,a);return r.default.createElement("div",l({},s,{style:n,className:"et-fb-spinner-control__spinner ".concat((0,o.default)(i))}),r.default.createElement("div",{className:"et-fb-spinner-control__spinner-item",style:{transform:"translateX(".concat(t,"px)")}}))}},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=(u(n(3)),u(n(27))),i=u(n(16)),l=u(n(2));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function c(e,t){for(var n=0;n/},html:{mode:{name:"htmlmixed"},colorpicker:{mode:"edit"},matchTags:{bothTags:!0},lineBreakPlaceholder://}}},G={line:0,ch:0},H={ignoreKeys:[13,37,39],prefix:{css:/[A-z-]/,default:/[A-z]/},tokens:{xml:["attribute","tag"]}},z=function(e){var t=(0,p.default)(e,e.is_fb_content?"content":"value");return t===e.default?"":t},q=function(e){e.hideCompletion(),e.hideColorPicker()},K=new(function(){function e(){A(this,e),this.instances=[],this.listener=!1,this.$window=w.default.$appWindow(),this.onScroll=this.onScroll.bind(this)}return B(e,[{key:"add",value:function(e){this.instances.push(e),this.check()}},{key:"remove",value:function(e){(0,a.default)(this.instances,e),this.check()}},{key:"onScroll",value:function(){(0,h.default)(this.instances,q)}},{key:"check",value:function(){this.instances.length>0?this.listener||(this.$window.on("wheel scroll",this.onScroll),this.listener=!0):this.listener&&(this.$window.off("wheel scroll",this.onScroll),this.listener=!1)}}]),e}()),$=(0,w.isIEOrEdge)()?e("body")[0]:{scrollTop:0};function Y(t){var n=this,r=t.lineNo,o=t.ch,a=t.nameColor,i=t.color;if(this.colorpicker){var l=i,u=this.cm.charCoords({line:r,ch:o},"window");this.colorpicker.show({left:u.left,top:u.bottom+$.scrollTop,isShortCut:t.isShortCut||!1,hideDelay:this.opt.hideDelay||2e3},a||i,(function(e){n.cm.replaceRange(e,{line:r,ch:o},{line:r,ch:o+l.length},"*colorpicker"),l=e})),e(this.colorpicker.$root.el).css({top:"".concat(u.bottom+$.scrollTop,"px"),left:(0,s.default)(u.left)?"".concat(u.left,"px"):u.left})}}var X=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(n,e);var t=D(n);function n(e){var r;A(this,n),(r=t.call(this,e)).editor=!1,r.dirty=!1,r.markers=[],r.mode=(0,p.default)(e,"mode","css"),r.options=M(M(M({},U.common),(0,p.default)(U.modes,r.mode,{})),{},{readOnly:(0,p.default)(e,"readonly",!1)}),(0,f.default)(r.options,"mode.inline")&&(0,f.default)(e,"inline")&&(r.options.mode.inline=e.inline),r.completion=(0,p.default)(H.prefix,r.mode,H.prefix.default),r.onChange=r.onChange.bind(L(r)),r.onClick=r.onClick.bind(L(r)),r.onKeyUp=r.onKeyUp.bind(L(r)),r.onKeyDown=r.onKeyDown.bind(L(r)),r._onFocus=r._onFocus.bind(L(r)),r._onBlur=r._onBlur.bind(L(r)),r.onBeforeChange=r.onBeforeChange.bind(L(r)),r.editorDidMount=r.editorDidMount.bind(L(r)),r.activateEditor=r.activateEditor.bind(L(r)),r.getEditor=r.getEditor.bind(L(r)),r.debouncedShowCompletion=(0,m.default)(r.showCompletion,W),r.debouncedUpdateSettings=(0,m.default)(r.updateSettings,F),r.incrementalKey=0;var o=r.addLineBreaks(z(e)),a=r.addLineBreaks(r.props.default);return r.state={value:o,default:a,enabled:!(0,c.default)(o)||!(0,c.default)(a),focused:!1},r}return B(n,[{key:"componentDidMount",value:function(){K.add(this)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.addLineBreaks(z(e));if(this.state.enabled||(0,c.default)(t)&&(0,c.default)(this.state.default)||this.enableEditor(),this.state.value!==t||e.activeTabMode!==this.props.activeTabMode){var n=this.addLineBreaks(e.default);this.setState({default:n}),this.dirty||(this.incrementalKey++,this.setValue(t))}}},{key:"componentDidUpdate",value:function(){if(this.editor){var e=this.editor;if((0,h.default)(this.markers,(function(e){e.clear()})),this.markers=[],(0,c.default)((0,p.default)(this,"props.search")))return;for(var t=e.getSearchCursor(this.props.search);t.findNext();)this.markers.push(e.doc.markText(t.from(),t.to(),{className:"cm-searching",clearOnEnter:!0}))}}},{key:"componentWillUnmount",value:function(){this.hideCompletion(),this.hideColorPicker(),K.remove(this),this.debouncedShowCompletion.cancel(),this.debouncedUpdateSettings.flush(),this.editor=!1,this.linter&&this.linter.destroy()}},{key:"onBeforeChange",value:function(e,t,n){this.dirty=!0,this.setValue(n)}},{key:"onChange",value:function(){F>0?this.debouncedUpdateSettings():this.updateSettings(),this.lint()}},{key:"onKeyUp",value:function(e,t){this.checkCompletion(e,t)}},{key:"onKeyDown",value:function(e,t){"Enter"!==t.key&&13!==t.keyCode||t.stopPropagation()}},{key:"onClick",value:function(){this.options.autofocus=!0,this.enableEditor()}},{key:"setValue",value:function(e){this.setState({value:e})}},{key:"addLineBreaks",value:function(e){if((0,l.default)(e)||!(0,u.default)(e))return e;var t=this.options.lineBreakPlaceholder;return e.match(t)?e.split(t).join("\n"):e}},{key:"enableEditor",value:function(){this.setState({enabled:!0})}},{key:"lint",value:function(e){this.linter&&this.linter.lint(e)}},{key:"editorDidMount",value:function(e){this.editor=e;var t=e.state.colorpicker;t&&(0,o.default)(t,"open_color_picker",Y.bind(t)),this.linter=new _.default(this.options.mode,e,V),this.lint(0)}},{key:"updateSettings",value:function(){var e=this.props;e._onChange(e.name,this.state.value,e.type),this.dirty=!1}},{key:"hideCompletion",value:function(){this.debouncedShowCompletion.cancel(),this.editor&&this.editor.state.completionActive&&this.editor.state.completionActive.close()}},{key:"hideColorPicker",value:function(){this.editor&&this.editor.state.colorpicker&&this.editor.state.colorpicker.close_color_picker()}},{key:"checkCompletion",value:function(e,t){if((0,d.default)(H.ignoreKeys,t.keyCode))this.hideCompletion();else{var n=e.doc,r=n.getCursor(),o=r.line,a=r.ch,i=(0,p.default)(e.getModeAt(r),"name"),l=n.getLine(o),u=l.substr(Math.max(a-1,0),1),s=l.substr(a,1);if(this.completion.test(u)&&!this.completion.test(s)){var c=(0,p.default)(H,"tokens.".concat(i));if(c){var f=e.getTokenTypeAt(r);if(!(0,d.default)(c,f))return void this.hideCompletion()}this.debouncedShowCompletion()}else this.hideCompletion()}}},{key:"showCompletion",value:function(){if(!this.editor.state.completionActive){var e=w.default.$topWindow("".concat(ETBuilderBackend.css.layoutPrefix," #et-fb-app"))[0];this.editor.showHint({completeSingle:!1,container:e})}}},{key:"activateEditor",value:function(){this.enableEditor()}},{key:"getEditor",value:function(){return this.editor}},{key:"render",value:function(){var e,t,n,r=this.props.name;if(this.state.enabled){var o=M(M({},this.options),{},{lineNumbers:this.state.focused||!(0,c.default)(this.state.value)||(0,c.default)(this.state.default),placeholder:this.state.default,scrollbarStyle:null});t=g.default.createElement(y.Controlled,{key:this.incrementalKey,value:this.state.value,options:o,cursor:this.options.autofocus?G:null,autoFocus:this.options.autofocus,name:r,id:"et-fb-".concat(r),onChange:this.onChange,onBeforeChange:this.onBeforeChange,onKeyUp:this.onKeyUp,onKeyDown:this.onKeyDown,editorDidMount:this.editorDidMount,onFocus:this._onFocus,onBlur:this._onBlur})}else t=g.default.createElement("textarea",{className:"et-fb-settings-option-textarea",value:this.state.value,name:r,onChange:i.default,onClick:this.onClick,onFocus:this._onFocus,onBlur:this._onBlur,placeholder:this.state.default});switch(r){case"et_pb_custom_css":n="code_css";break;case"raw_content":n="code_html";break;case"custom_css_free_form":n="code_css_free_form";break;default:n="code_css_no_selector"}var a="code_css_free_form"===n?"code_css":n,l=Boolean(O.default.getExtendStylesModal()),u=(null===(e=this.props)||void 0===e?void 0:e.uniqueKey)||"",s=Boolean(O.default.getFindReplaceModal())&&u.endsWith("__find"),d=l||s;return g.default.createElement(v.default,{componentName:r},g.default.createElement("div",{className:"et-fb-codemirror"},t,!d&&g.default.createElement(k.default,null,g.default.createElement(S.default,{context:n,activateEditor:this.activateEditor,getEditor:this.getEditor,value:this.state.value,editorName:r,processedKey:this.props.processedKey}),g.default.createElement(C.default,{context:a,editor:this.editor,activateEditor:this.activateEditor,getEditor:this.getEditor}))))}},{key:"_onFocus",value:function(){this.setState({focused:!0})}},{key:"_onBlur",value:function(){this.setState({focused:!1})}}]),n}(g.default.Component);X.propTypes={value:b.default.string,name:b.default.string.isRequired,search:b.default.string,inline:b.default.bool},X.defaultProps={value:"",search:"",inline:!0};var J=X;t.default=J}).call(this,n(8))},function(e,t,n){"use strict";(function(e){function r(){return r=Object.assign||function(e){for(var t=1;t0&&r.ch>=a.length)return t.clipPos(n(r.line+1,0));for(var i,l="start",u=r.ch,s=u,c=o<0?0:a.length,d=0;s!=c;s+=o,d++){var f=a.charAt(o<0?s-1:s),p="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==p&&f.toUpperCase()==f&&(p="W"),"start"==l)"o"!=p?(l="in",i=p):u=s+o;else if("in"==l&&i!=p){if("w"==i&&"W"==p&&o<0&&s--,"W"==i&&"w"==p&&o>0){if(s==u+1){i="w";continue}s--}break}}return n(r.line,s)}function o(e,t){e.extendSelectionsBy((function(n){return e.display.shift||e.doc.extend||n.empty()?r(e.doc,n.head,t):t<0?n.from():n.to()}))}function a(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,o=[],a=-1,i=0;i=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],o=0;oa.line&&l==i.line&&0==i.ch||r.push({anchor:l==a.line?a:n(l,0),head:l==i.line?i:n(l)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],o=0;o=0;l--){var s=r[o[l]];if(!(u&&e.cmpPos(s.head,u)>0)){var c=i(t,s.head);u=c.from,t.replaceRange(n(c.word),c.from,c.to)}}}))}function h(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function m(e,t){var r=h(e);if(r){var o=r.query,a=e.getSearchCursor(o,t?r.to:r.from);(t?a.findNext():a.findPrevious())?e.setSelection(a.from(),a.to()):(a=e.getSearchCursor(o,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?a.findNext():a.findPrevious())?e.setSelection(a.from(),a.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){c(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!c(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var o=t.scanForBracket(r.head,1,d(t.getTokenTypeAt(r.head)));if(o&&0!=e.cmpPos(o.pos,r.head))return o.pos;var a=t.scanForBracket(r.head,-1,d(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return a&&n(a.pos.line,a.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],a=t.firstLine()-1,i=[],l=0;la?o.push(s,c):o.length&&(o[o.length-1]=c),a=c}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+l,n(t.lastLine()),null,"+swapLine"):t.replaceRange(l+"\n",n(a,0),null,"+swapLine")}t.setSelections(i),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),o=[],a=t.lastLine()+1,i=r.length-1;i>=0;i--){var l=r[i],u=l.to().line+1,s=l.from().line;0!=l.to().ch||l.empty()||u--,u=0;e-=2){var r=o[e],a=o[e+1],i=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(i+"\n",n(a,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],o=0;o=0;a--){var i=r[a].head,l=t.getRange({line:i.line,ch:0},i),u=e.countColumn(l,null,t.getOption("tabSize")),s=t.findPosH(i,-1,"char",!1);if(l&&!/\S/.test(l)&&u%o==0){var c=new n(i.line,e.findColumn(l,u-o,o));c.ch!=i.ch&&(s=c)}t.replaceRange("",s,i,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){p(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){p(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),o=n;if(e.cmpPos(r,o)>0){var a=o;o=r,r=a}t.state.sublimeKilled=t.getRange(r,o),t.replaceRange("",r,o)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){m(e,!0)},t.findUnderPrevious=function(e){m(e,!1)},t.findAllUnder=function(e){var t=h(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],o=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&o++;e.setSelections(r,o)}};var y=e.keyMap;y.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(y.macSublime),y.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(y.pcSublime);var g=y.default==y.macDefault;y.sublime=g?y.macSublime:y.pcSublime}(n(1482),n(1508),n(1534))},function(e,t,n){!function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(e,t,n){var r=e.current(),o=r.search(t);return o>-1?e.backUp(r.length-o):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}var r={};function o(e){var t=r[e];return t||(r[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function a(e,t){var n=e.match(o(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function l(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),o=e[n],a=o.length-1;a>=0;a--)r.unshift(o[a])}function u(e,t){for(var n=0;n=0;f--)s.script.unshift(["type",d[f].matches,d[f].mode]);function p(t,o){var l,c=a.token(t,o.htmlState),d=/\btag\b/.test(c);if(d&&!/[<>\s\/]/.test(t.current())&&(l=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(l))o.inTag=l+" ";else if(o.inTag&&d&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==t.current()&&u(s[f[1]],f[2]),m=e.getMode(r,h),y=i(f[1],!0),g=i(f[1],!1);o.token=function(e,t){return e.match(y,!1)?(t.token=p,t.localState=t.localMode=null,null):n(e,g,t.localMode.token(e,t.localState))},o.localMode=m,o.localState=e.startState(m,a.indent(o.htmlState,"",""))}else o.inTag&&(o.inTag+=t.current(),t.eol()&&(o.inTag+=" "));return c}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:e.startState(a)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(a,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?a.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||a}}}}),"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(n(1482),n(1650),n(1651),n(1509))},function(e,t,n){!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,o){var a,i,l=r.indentUnit,u={},s=o.htmlMode?t:n;for(var c in s)u[c]=s[c];for(var c in o)u[c]=o[c];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(a=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,a=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return a="equals",null;if("<"==n){t.tokenize=d,t.state=_,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return"string"};return t.isInAttribute=!0,t}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function m(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function y(e){return e&&e.toLowerCase()}function g(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(u.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function b(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!u.contextGrabbers.hasOwnProperty(y(n))||!u.contextGrabbers[y(n)].hasOwnProperty(y(t)))return;b(e)}}function _(e,t,n){return"openTag"==e?(n.tagStart=t.column(),w):"closeTag"==e?O:_}function w(e,t,n){return"word"==e?(n.tagName=t.current(),i="tag",C):u.allowMissingTagName&&"endTag"==e?(i="tag bracket",C(e,t,n)):(i="error",w)}function O(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&u.implicitlyClosed.hasOwnProperty(y(n.context.tagName))&&b(n),n.context&&n.context.tagName==r||!1===u.matchClosing?(i="tag",k):(i="tag error",S)}return u.allowMissingTagName&&"endTag"==e?(i="tag bracket",k(e,t,n)):(i="error",S)}function k(e,t,n){return"endTag"!=e?(i="error",k):(b(n),_)}function S(e,t,n){return i="error",k(e,t,n)}function C(e,t,n){if("word"==e)return i="attribute",E;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||u.autoSelfClosers.hasOwnProperty(y(r))?v(n,r):(v(n,r),n.context=new g(n,r,o==n.indented)),_}return i="error",C}function E(e,t,n){return"equals"==e?P:(u.allowMissing||(i="error"),C(e,t,n))}function P(e,t,n){return"string"==e?T:"word"==e&&u.allowUnquoted?(i="string",C):(i="error",C(e,t,n))}function T(e,t,n){return"string"==e?T:C(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:_,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;a=null;var n=t.tokenize(e,t);return(n||a)&&"comment"!=n&&(i=null,t.state=t.state(a||n,e,t),i&&(n="error"==i?n+" error":i)),n},indent:function(t,n,r){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==u.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(u.multilineTagIndentFactor||1);if(u.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:u.htmlMode?"html":"xml",helperType:u.htmlMode?"html":"xml",skipAttribute:function(e){e.state==P&&(e.state=C)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(1482))},function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,o,a=t.indentUnit,i=n.statementIndent,l=n.jsonld,u=n.json||l,s=!1!==n.trackScope,c=n.typescript,d=n.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),o=e("keyword d"),a=e("operator"),i={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:o,break:o,continue:o,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),p=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function y(e,t,n){return r=e,o=n,t}function g(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=b(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return y("number","number");if("."==n&&e.match(".."))return y("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return y(n);if("="==n&&e.eat(">"))return y("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return y("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),y("number","number");if("/"==n)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),y("comment","comment")):ot(e,t,1)?(m(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),y("regexp","string-2")):(e.eat("="),y("operator","operator",e.current()));if("`"==n)return t.tokenize=_,_(e,t);if("#"==n&&"!"==e.peek())return e.skipToEnd(),y("meta","meta");if("#"==n&&e.eatWhile(d))return y("variable","property");if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),y("comment","comment");if(p.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat(".")?y("."):y("operator","operator",e.current());if(d.test(n)){e.eatWhile(d);var r=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(r)){var o=f[r];return y(o.type,o.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return y("async","keyword",r)}return y("variable","variable",r)}}function b(e){return function(t,n){var r,o=!1;if(l&&"@"==t.peek()&&t.match(h))return n.tokenize=g,y("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||o);)o=!o&&"\\"==r;return o||(n.tokenize=g),y("string","string")}}function v(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=g;break}r="*"==n}return y("comment","comment")}function _(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=g;break}r=!r&&"\\"==n}return y("quasi","string-2",e.current())}var w="([{}])";function O(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var o=0,a=!1,i=n-1;i>=0;--i){var l=e.string.charAt(i),u=w.indexOf(l);if(u>=0&&u<3){if(!o){++i;break}if(0==--o){"("==l&&(a=!0);break}}else if(u>=3&&u<6)++o;else if(d.test(l))a=!0;else if(/["'\/`]/.test(l))for(;;--i){if(0==i)return;if(e.string.charAt(i-1)==l&&"\\"!=e.string.charAt(i-2)){i--;break}}else if(a&&!o){++i;break}}a&&!o&&(t.fatArrowAt=i)}}var k={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function S(e,t,n,r,o,a){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=a,null!=r&&(this.align=r)}function C(e,t){if(!s)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function E(e,t,n,r,o){var a=e.cc;for(P.state=e,P.stream=o,P.marked=null,P.cc=a,P.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((a.length?a.pop():u?z:G)(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return P.marked?P.marked:"variable"==n&&C(e,r)?"variable-2":t}}var P={state:null,column:null,marked:null,cc:null};function T(){for(var e=arguments.length-1;e>=0;e--)P.cc.push(arguments[e])}function M(){return T.apply(null,arguments),!0}function j(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function x(e){var t=P.state;if(P.marked="def",s){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=D(e,t.context);if(null!=r)return void(t.context=r)}else if(!j(e,t.localVars))return void(t.localVars=new R(e,t.localVars));n.globalVars&&!j(e,t.globalVars)&&(t.globalVars=new R(e,t.globalVars))}}function D(e,t){if(t){if(t.block){var n=D(e,t.prev);return n?n==t.prev?t:new L(n,t.vars,!0):null}return j(e,t.vars)?t:new L(t.prev,new R(e,t.vars),!1)}return null}function N(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function L(e,t,n){this.prev=e,this.vars=t,this.block=n}function R(e,t){this.name=e,this.next=t}var A=new R("this",new R("arguments",null));function I(){P.state.context=new L(P.state.context,P.state.localVars,!1),P.state.localVars=A}function B(){P.state.context=new L(P.state.context,P.state.localVars,!0),P.state.localVars=null}function F(){P.state.localVars=P.state.context.vars,P.state.context=P.state.context.prev}function W(e,t){var n=function(){var n=P.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new S(r,P.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function V(){var e=P.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function U(e){function t(n){return n==e?M():";"==e||"}"==n||")"==n||"]"==n?T():M(t)}return t}function G(e,t){return"var"==e?M(W("vardef",t),Te,U(";"),V):"keyword a"==e?M(W("form"),K,G,V):"keyword b"==e?M(W("form"),G,V):"keyword d"==e?P.stream.match(/^\s*$/,!1)?M():M(W("stat"),Y,U(";"),V):"debugger"==e?M(U(";")):"{"==e?M(W("}"),B,fe,V,F):";"==e?M():"if"==e?("else"==P.state.lexical.info&&P.state.cc[P.state.cc.length-1]==V&&P.state.cc.pop()(),M(W("form"),K,G,V,Le)):"function"==e?M(Be):"for"==e?M(W("form"),B,Re,G,F,V):"class"==e||c&&"interface"==t?(P.marked="keyword",M(W("form","class"==e?e:t),Ge,V)):"variable"==e?c&&"declare"==t?(P.marked="keyword",M(G)):c&&("module"==t||"enum"==t||"type"==t)&&P.stream.match(/^\s*\w/,!1)?(P.marked="keyword","enum"==t?M(tt):"type"==t?M(We,U("operator"),ge,U(";")):M(W("form"),Me,U("{"),W("}"),fe,V,V)):c&&"namespace"==t?(P.marked="keyword",M(W("form"),z,G,V)):c&&"abstract"==t?(P.marked="keyword",M(G)):M(W("stat"),ae):"switch"==e?M(W("form"),K,U("{"),W("}","switch"),B,fe,V,V,F):"case"==e?M(z,U(":")):"default"==e?M(U(":")):"catch"==e?M(W("form"),I,H,G,V,F):"export"==e?M(W("stat"),Ke,V):"import"==e?M(W("stat"),Ye,V):"async"==e?M(G):"@"==t?M(z,G):T(W("stat"),z,U(";"),V)}function H(e){if("("==e)return M(Ve,U(")"))}function z(e,t){return $(e,t,!1)}function q(e,t){return $(e,t,!0)}function K(e){return"("!=e?T():M(W(")"),Y,U(")"),V)}function $(e,t,n){if(P.state.fatArrowAt==P.stream.start){var r=n?te:ee;if("("==e)return M(I,W(")"),ce(Ve,")"),V,U("=>"),r,F);if("variable"==e)return T(I,Me,U("=>"),r,F)}var o=n?J:X;return k.hasOwnProperty(e)?M(o):"function"==e?M(Be,o):"class"==e||c&&"interface"==t?(P.marked="keyword",M(W("form"),Ue,V)):"keyword c"==e||"async"==e?M(n?q:z):"("==e?M(W(")"),Y,U(")"),V,o):"operator"==e||"spread"==e?M(n?q:z):"["==e?M(W("]"),et,V,o):"{"==e?de(le,"}",null,o):"quasi"==e?T(Q,o):"new"==e?M(ne(n)):M()}function Y(e){return e.match(/[;\}\)\],]/)?T():T(z)}function X(e,t){return","==e?M(Y):J(e,t,!1)}function J(e,t,n){var r=0==n?X:J,o=0==n?z:q;return"=>"==e?M(I,n?te:ee,F):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?M(r):c&&"<"==t&&P.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?M(W(">"),ce(ge,">"),V,r):"?"==t?M(z,U(":"),o):M(o):"quasi"==e?T(Q,r):";"!=e?"("==e?de(q,")","call",r):"."==e?M(ie,r):"["==e?M(W("]"),Y,U("]"),V,r):c&&"as"==t?(P.marked="keyword",M(ge,r)):"regexp"==e?(P.state.lastType=P.marked="operator",P.stream.backUp(P.stream.pos-P.stream.start-1),M(o)):void 0:void 0}function Q(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?M(Q):M(Y,Z)}function Z(e){if("}"==e)return P.marked="string-2",P.state.tokenize=_,M(Q)}function ee(e){return O(P.stream,P.state),T("{"==e?G:z)}function te(e){return O(P.stream,P.state),T("{"==e?G:q)}function ne(e){return function(t){return"."==t?M(e?oe:re):"variable"==t&&c?M(Ce,e?J:X):T(e?q:z)}}function re(e,t){if("target"==t)return P.marked="keyword",M(X)}function oe(e,t){if("target"==t)return P.marked="keyword",M(J)}function ae(e){return":"==e?M(V,G):T(X,U(";"),V)}function ie(e){if("variable"==e)return P.marked="property",M()}function le(e,t){return"async"==e?(P.marked="property",M(le)):"variable"==e||"keyword"==P.style?(P.marked="property","get"==t||"set"==t?M(ue):(c&&P.state.fatArrowAt==P.stream.start&&(n=P.stream.match(/^\s*:\s*/,!1))&&(P.state.fatArrowAt=P.stream.pos+n[0].length),M(se))):"number"==e||"string"==e?(P.marked=l?"property":P.style+" property",M(se)):"jsonld-keyword"==e?M(se):c&&N(t)?(P.marked="keyword",M(le)):"["==e?M(z,pe,U("]"),se):"spread"==e?M(q,se):"*"==t?(P.marked="keyword",M(le)):":"==e?T(se):void 0;var n}function ue(e){return"variable"!=e?T(se):(P.marked="property",M(Be))}function se(e){return":"==e?M(q):"("==e?T(Be):void 0}function ce(e,t,n){function r(o,a){if(n?n.indexOf(o)>-1:","==o){var i=P.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),M((function(n,r){return n==t||r==t?T():T(e)}),r)}return o==t||a==t?M():n&&n.indexOf(";")>-1?T(e):M(U(t))}return function(n,o){return n==t||o==t?M():T(e,r)}}function de(e,t,n){for(var r=3;r"),ge):"quasi"==e?T(we,Se):void 0}function be(e){if("=>"==e)return M(ge)}function ve(e){return e.match(/[\}\)\]]/)?M():","==e||";"==e?M(ve):T(_e,ve)}function _e(e,t){return"variable"==e||"keyword"==P.style?(P.marked="property",M(_e)):"?"==t||"number"==e||"string"==e?M(_e):":"==e?M(ge):"["==e?M(U("variable"),he,U("]"),_e):"("==e?T(Fe,_e):e.match(/[;\}\)\],]/)?void 0:M()}function we(e,t){return"quasi"!=e?T():"${"!=t.slice(t.length-2)?M(we):M(ge,Oe)}function Oe(e){if("}"==e)return P.marked="string-2",P.state.tokenize=_,M(we)}function ke(e,t){return"variable"==e&&P.stream.match(/^\s*[?:]/,!1)||"?"==t?M(ke):":"==e?M(ge):"spread"==e?M(ke):T(ge)}function Se(e,t){return"<"==t?M(W(">"),ce(ge,">"),V,Se):"|"==t||"."==e||"&"==t?M(ge):"["==e?M(ge,U("]"),Se):"extends"==t||"implements"==t?(P.marked="keyword",M(ge)):"?"==t?M(ge,U(":"),ge):void 0}function Ce(e,t){if("<"==t)return M(W(">"),ce(ge,">"),V,Se)}function Ee(){return T(ge,Pe)}function Pe(e,t){if("="==t)return M(ge)}function Te(e,t){return"enum"==t?(P.marked="keyword",M(tt)):T(Me,pe,De,Ne)}function Me(e,t){return c&&N(t)?(P.marked="keyword",M(Me)):"variable"==e?(x(t),M()):"spread"==e?M(Me):"["==e?de(xe,"]"):"{"==e?de(je,"}"):void 0}function je(e,t){return"variable"!=e||P.stream.match(/^\s*:/,!1)?("variable"==e&&(P.marked="property"),"spread"==e?M(Me):"}"==e?T():"["==e?M(z,U("]"),U(":"),je):M(U(":"),Me,De)):(x(t),M(De))}function xe(){return T(Me,De)}function De(e,t){if("="==t)return M(q)}function Ne(e){if(","==e)return M(Te)}function Le(e,t){if("keyword b"==e&&"else"==t)return M(W("form","else"),G,V)}function Re(e,t){return"await"==t?M(Re):"("==e?M(W(")"),Ae,V):void 0}function Ae(e){return"var"==e?M(Te,Ie):"variable"==e?M(Ie):T(Ie)}function Ie(e,t){return")"==e?M():";"==e?M(Ie):"in"==t||"of"==t?(P.marked="keyword",M(z,Ie)):T(z,Ie)}function Be(e,t){return"*"==t?(P.marked="keyword",M(Be)):"variable"==e?(x(t),M(Be)):"("==e?M(I,W(")"),ce(Ve,")"),V,me,G,F):c&&"<"==t?M(W(">"),ce(Ee,">"),V,Be):void 0}function Fe(e,t){return"*"==t?(P.marked="keyword",M(Fe)):"variable"==e?(x(t),M(Fe)):"("==e?M(I,W(")"),ce(Ve,")"),V,me,F):c&&"<"==t?M(W(">"),ce(Ee,">"),V,Fe):void 0}function We(e,t){return"keyword"==e||"variable"==e?(P.marked="type",M(We)):"<"==t?M(W(">"),ce(Ee,">"),V):void 0}function Ve(e,t){return"@"==t&&M(z,Ve),"spread"==e?M(Ve):c&&N(t)?(P.marked="keyword",M(Ve)):c&&"this"==e?M(pe,De):T(Me,pe,De)}function Ue(e,t){return"variable"==e?Ge(e,t):He(e,t)}function Ge(e,t){if("variable"==e)return x(t),M(He)}function He(e,t){return"<"==t?M(W(">"),ce(Ee,">"),V,He):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(P.marked="keyword"),M(c?ge:z,He)):"{"==e?M(W("}"),ze,V):void 0}function ze(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&N(t))&&P.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(P.marked="keyword",M(ze)):"variable"==e||"keyword"==P.style?(P.marked="property",M(qe,ze)):"number"==e||"string"==e?M(qe,ze):"["==e?M(z,pe,U("]"),qe,ze):"*"==t?(P.marked="keyword",M(ze)):c&&"("==e?T(Fe,ze):";"==e||","==e?M(ze):"}"==e?M():"@"==t?M(z,ze):void 0}function qe(e,t){if("!"==t)return M(qe);if("?"==t)return M(qe);if(":"==e)return M(ge,De);if("="==t)return M(q);var n=P.state.lexical.prev;return T(n&&"interface"==n.info?Fe:Be)}function Ke(e,t){return"*"==t?(P.marked="keyword",M(Ze,U(";"))):"default"==t?(P.marked="keyword",M(z,U(";"))):"{"==e?M(ce($e,"}"),Ze,U(";")):T(G)}function $e(e,t){return"as"==t?(P.marked="keyword",M(U("variable"))):"variable"==e?T(q,$e):void 0}function Ye(e){return"string"==e?M():"("==e?T(z):"."==e?T(X):T(Xe,Je,Ze)}function Xe(e,t){return"{"==e?de(Xe,"}"):("variable"==e&&x(t),"*"==t&&(P.marked="keyword"),M(Qe))}function Je(e){if(","==e)return M(Xe,Je)}function Qe(e,t){if("as"==t)return P.marked="keyword",M(Xe)}function Ze(e,t){if("from"==t)return P.marked="keyword",M(z)}function et(e){return"]"==e?M():T(ce(q,"]"))}function tt(){return T(W("form"),Me,U("{"),W("}"),ce(nt,"}"),V,V)}function nt(){return T(Me,De)}function rt(e,t){return"operator"==e.lastType||","==e.lastType||p.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function ot(e,t,n){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return I.lex=B.lex=!0,F.lex=!0,V.lex=!0,{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new S((e||0)-a,0,"block",!1),localVars:n.localVars,context:n.localVars&&new L(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),O(e,t)),t.tokenize!=v&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=o&&"--"!=o?r:"incdec",E(t,n,r,o,e))},indent:function(t,r){if(t.tokenize==v||t.tokenize==_)return e.Pass;if(t.tokenize!=g)return 0;var o,l=r&&r.charAt(0),u=t.lexical;if(!/^\s*else\b/.test(r))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==V)u=u.prev;else if(c!=Le&&c!=F)break}for(;("stat"==u.type||"form"==u.type)&&("}"==l||(o=t.cc[t.cc.length-1])&&(o==X||o==J)&&!/^[,\.=+\-*:?[\(]/.test(r));)u=u.prev;i&&")"==u.type&&"stat"==u.prev.type&&(u=u.prev);var d=u.type,f=l==d;return"vardef"==d?u.indented+("operator"==t.lastType||","==t.lastType?u.info.length+1:0):"form"==d&&"{"==l?u.indented:"form"==d?u.indented+a:"stat"==d?u.indented+(rt(t,r)?i||a:0):"switch"!=u.info||f||0==n.doubleIndentSwitch?u.align?u.column+(f?0:1):u.indented+(f?0:a):u.indented+(/^(?:case|default)\b/.test(r)?a:2*a)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:l,jsonMode:u,expressionAllowed:ot,skipExpression:function(t){E(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(1482))},function(e,t,n){!function(e){"use strict";var t="CodeMirror-hint",n="CodeMirror-hint-active";function r(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var o in n)r[o]=n[o];return e.showHint(r)},e.defineExtension("showHint",(function(t){t=i(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var o=0;of.clientHeight+1;if(setTimeout((function(){x=i.getScrollInfo()})),D.bottom-j>0){var L=D.bottom-D.top;if(_.top-(_.bottom-D.top)-L>0)f.style.top=(O=_.top-L-C)+"px",k=!1;else if(L>j){f.style.height=j-5+"px",f.style.top=(O=_.bottom-D.top-C)+"px";var R=i.getCursor();o.from.ch!=R.ch&&(_=i.cursorCoords(R),f.style.left=(w=_.left-S)+"px",D=f.getBoundingClientRect())}}var A,I=D.right-M;if(N&&(I+=i.display.nativeBarWidth),I>0&&(D.right-D.left>M&&(f.style.width=M-5+"px",I-=D.right-D.left-M),f.style.left=(w=_.left-I-S)+"px"),N)for(var B=f.firstChild;B;B=B.nextSibling)B.style.paddingRight=i.display.nativeBarWidth+"px";i.addKeyMap(this.keyMap=u(r,{moveFocus:function(e,t){a.changeActive(a.selectedHint+e,t)},setFocus:function(e){a.changeActive(e)},menuSize:function(){return a.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){a.pick()},data:o})),r.options.closeOnUnfocus&&(i.on("blur",this.onBlur=function(){A=setTimeout((function(){r.close()}),100)}),i.on("focus",this.onFocus=function(){clearTimeout(A)})),i.on("scroll",this.onScroll=function(){var e=i.getScrollInfo(),t=i.getWrapperElement().getBoundingClientRect();x||(x=i.getScrollInfo());var n=O+x.top-e.top,o=n-(d.pageYOffset||(c.documentElement||c.body).scrollTop);if(k||(o+=f.offsetHeight),o<=t.top||o>=t.bottom)return r.close();f.style.top=n+"px",f.style.left=w+x.left-e.left+"px"}),e.on(f,"dblclick",(function(e){var t=s(f,e.target||e.srcElement);t&&null!=t.hintId&&(a.changeActive(t.hintId),a.pick())})),e.on(f,"click",(function(e){var t=s(f,e.target||e.srcElement);t&&null!=t.hintId&&(a.changeActive(t.hintId),r.options.completeOnSingleClick&&a.pick())})),e.on(f,"mousedown",(function(){setTimeout((function(){i.focus()}),20)}));var F=this.getSelectedHintRange();return 0===F.from&&0===F.to||this.scrollToActive(),e.signal(o,"select",h[this.selectedHint],f.childNodes[this.selectedHint]),!0}function d(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):a(o+1)}))}a(0)};return a.async=!0,a.supportsSelection=!0,a}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}r.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],o=this;this.cm.operation((function(){r.hint?r.hint(o.cm,t,r):o.cm.replaceRange(l(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),o.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(a(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),n=this.cm.getLine(t.line);if(t.line!=this.startPos.line||n.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1),this.selectedHint!=t){var o=this.hints.childNodes[this.selectedHint];o&&(o.className=o.className.replace(" "+n,""),o.removeAttribute("aria-selected")),(o=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,o.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",o.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],o)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:p}),e.registerHelper("hint","fromList",(function(t,n){var r,o=t.getCursor(),a=t.getTokenAt(o),i=e.Pos(o.line,a.start),l=o;a.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(n(1482))},function(e,t,n){!function(e){"use strict";var t={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,"first-child":1,"first-letter":1,"first-line":1,"first-of-type":1,focus:1,hover:1,"in-range":1,indeterminate:1,invalid:1,lang:1,"last-child":1,"last-of-type":1,link:1,not:1,"nth-child":1,"nth-last-child":1,"nth-last-of-type":1,"nth-of-type":1,"only-of-type":1,"only-child":1,optional:1,"out-of-range":1,placeholder:1,"read-only":1,"read-write":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};e.registerHelper("hint","css",(function(n){var r=n.getCursor(),o=n.getTokenAt(r),a=e.innerMode(n.getMode(),o.state);if("css"==a.mode.name){if("keyword"==o.type&&0=="!important".indexOf(o.string))return{list:["!important"],from:e.Pos(r.line,o.start),to:e.Pos(r.line,o.end)};var i=o.start,l=r.ch,u=o.string.slice(0,l-i);/[^\w$_-]/.test(u)&&(u="",i=l=r.ch);var s=e.resolveMode("text/css"),c=[],d=a.state.state;return"pseudo"==d||"variable-3"==o.type?f(t):"block"==d||"maybeprop"==d?f(s.propertyKeywords):"prop"==d||"parens"==d||"at"==d||"params"==d?(f(s.valueKeywords),f(s.colorKeywords)):"media"!=d&&"media_parens"!=d||(f(s.mediaTypes),f(s.mediaFeatures)),c.length?{list:c,from:e.Pos(r.line,i),to:e.Pos(r.line,l)}:void 0}function f(e){for(var t in e)u&&0!=t.lastIndexOf(u,0)||c.push(t)}}))}(n(1482),n(1509))},function(e,t,n){!function(e){"use strict";var t="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),n=["_blank","_self","_top","_parent"],r=["ascii","utf-8","utf-16","latin1","latin1"],o=["get","post","put","delete"],a=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],i=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],l={attrs:{}},u={a:{attrs:{href:null,ping:null,type:null,media:i,target:n,hreflang:t}},abbr:l,acronym:l,address:l,applet:l,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:i,hreflang:t,type:null,shape:["default","rect","circle","poly"]}},article:l,aside:l,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:l,base:{attrs:{href:null,target:n}},basefont:l,bdi:l,bdo:l,big:l,blockquote:{attrs:{cite:null}},body:l,br:l,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:a,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:l,center:l,cite:l,code:l,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:l,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:l,dir:l,div:l,dialog:{attrs:{open:null}},dl:l,dt:l,em:l,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:l,figure:l,font:l,footer:l,form:{attrs:{action:null,name:null,"accept-charset":r,autocomplete:["on","off"],enctype:a,method:o,novalidate:["","novalidate"],target:n}},frame:l,frameset:l,h1:l,h2:l,h3:l,h4:l,h5:l,h6:l,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:l,hgroup:l,hr:l,html:{attrs:{manifest:null},children:["head","body"]},i:l,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:a,formmethod:o,formnovalidate:["","novalidate"],formtarget:n,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:l,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:l,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:t,media:i,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:l,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:r,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:l,noframes:l,noscript:l,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:l,param:{attrs:{name:null,value:null}},pre:l,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:l,rt:l,ruby:l,s:l,samp:l,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:r}},section:l,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:l,source:{attrs:{src:null,type:null,media:null}},span:l,strike:l,strong:l,style:{attrs:{type:["text/css"],media:i,scoped:null}},sub:l,summary:l,sup:l,table:l,tbody:l,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:l,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:l,time:{attrs:{datetime:null}},title:l,tr:l,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:t}},tt:l,u:l,ul:l,var:l,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:l},s={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],autocorrect:["true","false"],autocapitalize:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};function c(e){for(var t in s)s.hasOwnProperty(t)&&(e.attrs[t]=s[t])}for(var d in c(l),u)u.hasOwnProperty(d)&&u[d]!=l&&c(u[d]);function f(t,n){var r={schemaInfo:u};if(n)for(var o in n)r[o]=n[o];return e.hint.xml(t,r)}e.htmlSchema=u,e.registerHelper("hint","html",f)}(n(1482),n(1655))},function(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t,n){return n?e.indexOf(t)>=0:0==e.lastIndexOf(t,0)}function r(r,o){var a=o&&o.schemaInfo,i=o&&o.quoteChar||'"',l=o&&o.matchInMiddle;if(a){var u=r.getCursor(),s=r.getTokenAt(u);if(s.end>u.ch&&(s.end=u.ch,s.string=s.string.slice(0,u.ch-s.start)),(v=e.innerMode(r.getMode(),s.state)).mode.xmlCurrentTag){var c,d,f=[],p=!1,h=/\btag\b/.test(s.type)&&!/>$/.test(s.string),m=h&&/^\w/.test(s.string);if(m){var y=r.getLine(u.line).slice(Math.max(0,s.start-2),s.start),g=/<\/$/.test(y)?"close":/<$/.test(y)?"open":null;g&&(d=s.start-("close"==g?2:1))}else h&&"<"==s.string?g="open":h&&"")}else{var C=(w=b&&a[b.name])&&w.attrs,E=a["!attrs"];if(!C&&!E)return;if(C){if(E){var P={};for(var T in E)E.hasOwnProperty(T)&&(P[T]=E[T]);for(var T in C)C.hasOwnProperty(T)&&(P[T]=C[T]);C=P}}else C=E;if("string"==s.type||"="==s.string){var M,j=(y=r.getRange(t(u.line,Math.max(0,u.ch-60)),t(u.line,"string"==s.type?s.start:s.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!j||!C.hasOwnProperty(j[1])||!(M=C[j[1]]))return;if("function"==typeof M&&(M=M.call(this,r)),"string"==s.type){c=s.string;var x=0;/['"]/.test(s.string.charAt(0))&&(i=s.string.charAt(0),c=s.string.slice(1),x++);var D=s.string.length;if(/['"]/.test(s.string.charAt(D-1))&&(i=s.string.charAt(D-1),c=s.string.substr(x,D-2)),x){var N=r.getLine(u.line);N.length>s.end&&N.charAt(s.end)==i&&s.end++}p=!0}var L=function(e){if(e)for(var t=0;t",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,i){i&&i!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),n&&(a(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(o))}));var o={Backspace:u,Enter:s};function a(e){for(var t=0;t=0;u--){var c=i[u].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function s(t){var n=l(t),o=n&&r(n,"explode");if(!o||t.getOption("disableInput"))return e.Pass;for(var a=t.listSelections(),i=0;i0?{line:i.head.line,ch:i.head.ch+t}:{line:i.head.line-1};n.push({anchor:l,head:l})}e.setSelections(n,o)}function d(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function f(t,o){var a=l(t);if(!a||t.getOption("disableInput"))return e.Pass;var i=r(a,"pairs"),u=i.indexOf(o);if(-1==u)return e.Pass;for(var s,f=r(a,"closeBefore"),p=r(a,"triples"),m=i.charAt(u+1)==o,y=t.listSelections(),g=u%2==0,b=0;b1&&p.indexOf(o)>=0&&t.getRange(n(w.line,w.ch-2),w)==o+o){if(w.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(w.line,w.ch-2))))return e.Pass;v="addFour"}else if(m){var k=0==w.ch?" ":t.getRange(n(w.line,w.ch-1),w);if(e.isWordChar(O)||k==o||e.isWordChar(k))return e.Pass;v="both"}else{if(!g||!(0===O.length||/\s/.test(O)||f.indexOf(O)>-1))return e.Pass;v="both"}else v=m&&h(t,w)?"both":p.indexOf(o)>=0&&t.getRange(w,n(w.line,w.ch+3))==o+o+o?"skipThree":"skip";if(s){if(s!=v)return e.Pass}else s=v}var S=u%2?i.charAt(u-1):o,C=u%2?o:i.charAt(u+1);t.operation((function(){if("skip"==s)c(t,1);else if("skipThree"==s)c(t,3);else if("surround"==s){for(var e=t.getSelections(),n=0;n'"]=function(e){return r(e)}),t.addKeyMap(i)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function r(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),a=[],u=r.getOption("autoCloseTags"),s=0;sc.ch&&(m=m.slice(0,m.length-d.end+c.ch));var v=m.toLowerCase();if(!m||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&h.close||d.string.indexOf("/")==c.ch-d.start-1||g&&i(g,v)>-1||l(r,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(p)||[],m,c,!0))return e.Pass;var _="object"==typeof u&&u.emptyTags;if(_&&i(_,m)>-1)a[s]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var w=b&&i(b,v)>-1;a[s]={indent:w,text:">"+(w?"\n\n":"")+"",newPos:w?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}var O="object"==typeof u&&u.dontIndentOnAutoClose;for(s=o.length-1;s>=0;s--){var k=a[s];r.replaceRange(k.text,o[s].head,o[s].anchor,"+insert");var S=r.listSelections().slice(0);S[s]={head:k.newPos,anchor:k.newPos},r.setSelections(S),!O&&k.indent&&(r.indentLine(k.newPos.line,null,!0),r.indentLine(k.newPos.line+1,null,!0))}}function o(t,n){for(var r=t.listSelections(),o=[],a=n?"/":""!=t.getLine(c.line).charAt(d.end)&&(h+=">"),o[s]=h}if(t.replaceSelections(o),r=t.listSelections(),!u)for(s=0;s=0&&n[s]==r;s--)++u;for(o=l.to,s=1;st.cursorCoords(n,"window").top&&((c=r).style.opacity=.4)})))};i(t,y(t),s,f,(function(n,o){var a=e.keyName(n),i=t.getOption("extraKeys"),l=i&&i[a]||e.keyMap[t.getOption("keyMap")][a];"findNext"==l||"findPrev"==l||"findPersistentNext"==l||"findPersistentPrev"==l?(e.e_stop(n),d(t,r(t),o),t.execCommand(l)):"find"!=l&&"findPersistent"!=l||(e.e_stop(n),f(o,n))})),a&&s&&(d(t,u,s),p(t,n))}else l(t,y(t),"Search for:",s,(function(e){e&&!u.query&&t.operation((function(){d(t,u,e),u.posFrom=u.posTo=t.getCursor(),p(t,n)}))}))}function p(t,n,o){t.operation((function(){var i=r(t),l=a(t,i.query,n?i.posFrom:i.posTo);(l.find(n)||(l=a(t,i.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(n))&&(t.setSelection(l.from(),l.to()),t.scrollIntoView({from:l.from(),to:l.to()},20),i.posFrom=l.from(),i.posTo=l.to(),o&&o(l.from(),l.to()))}))}function h(e){e.operation((function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function m(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var o=2;o-1){for(var t=0,n=(a=e.replace("rgb(","").replace(")","").split(",")).length;t-1){for(t=0,n=(a=e.replace("rgba(","").replace(")","").split(",")).length;t-1){for(t=0,n=(a=e.replace("hsl(","").replace(")","").split(",")).length;t-1){for(t=0,n=(a=e.replace("hsla(","").replace(")","").split(",")).length;t.5?u/(2-a-i):u/(a+i),a){case e:r=(t-n)/u+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},HSLtoRGB:function(e,t,n){var r,o,a;if(e/=360,n/=100,0==(t/=100))r=o=a=n;else{var i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=this.HUEtoRGB(l,i,e+1/3),o=this.HUEtoRGB(l,i,e),a=this.HUEtoRGB(l,i,e-1/3)}return{r:255*r,g:255*o,b:255*a}}},V=[{rgb:"#ff0000",start:0},{rgb:"#ffff00",start:.17},{rgb:"#00ff00",start:.33},{rgb:"#00ffff",start:.5},{rgb:"#0000ff",start:.67},{rgb:"#ff00ff",start:.83},{rgb:"#ff0000",start:1}],U=(fe(),function(){}),G=0,H={},z=!1,q=!1,K=2e3,$={},Y=[{name:"Material",edit:!0,colors:["#fff","#f00","#0ff","#f0f","#fff","#f00","#0ff","#f0f","#fff","#f00","#0ff","#f0f"]},{name:"Custom",edit:!0,colors:[]},{name:"Pages",edit:!0,colors:["#fff","#f00","#0ff","#f0f"]}];function X(e,t,n){if("string"!=typeof e)this.el=e;else{var r=F().document.createElement(e);for(var o in this.uniqId=G++,r.className=t,n=n||{})r.setAttribute(o,n[o]);this.el=r}}function J(e,t,n){j.val(e),x.val(t),D.val(n),N.val(C)}function Q(e,t,n){L.val(e),R.val(t+"%"),A.val(n+"%"),I.val(C)}function Z(){return W.format({r:j.int(),g:x.int(),b:D.int()},"hex")}function ee(){return W.HSVtoRGB(E,P,T)}function te(){return W.format(ee(),"hex")}function ne(){var e=W.HSVtoRGB(E,P,T);return W.RGBtoHSL(e.r,e.g,e.b)}function re(e){if("rgb"==(e=e||"hex"))return(n=ee()).a=1==C?void 0:C,W.format(n,"rgb");if("hsl"==e){var t=ne();return t.a=1==C?void 0:C,W.format(t,"hsl")}var n=ee();return W.format(n,"hex")}function oe(e){c.css("background-color",e)}function ae(){var e=g.data("format")||"hex",t=null;if("hex"==e)M.val(te());else if("rgb"==e)J((t=ee()).r,t.g,t.b);else if("hsl"==e){var n=ne();Q(n.h,n.s,n.l)}oe(re("rgb")),t=ee(),pe(W.format(t,"rgb")),"function"==typeof U&&(isNaN(C)||U(re(e)))}function ie(e){e.preventDefault();var n=t.position(),o=r.width(),a=r.height(),l=e.clientX-n.left,u=e.clientY-n.top;l<0?l=0:l>o&&(l=o),u<0?u=0:u>a&&(u=a),i.css({left:l-5+"px",top:u-5+"px"}),i.data("pos",{x:l,y:u}),ye(),ae()}function le(e,t,n){var r={r:parseInt(e.r+(t.r-e.r)*n,10),g:parseInt(e.g+(t.g-e.g)*n,10),b:parseInt(e.b+(t.b-e.b)*n,10)};return W.format(r,"hex")}function ue(e){for(var t,n,r=0;r=e){t=V[r-1],n=V[r];break}return t&&n?le(t,n,(e-t.start)/(n.start-t.start)):V[0].rgb}function se(e){r.css("background-color",e)}function ce(e){E=e}function de(e){var t,n=d.offset().left,r=n+d.width(),o=e?ge(e).clientX:n+E/360*(r-n);t=or?100:(o-n)/(r-n)*100;var a=d.width()*(t/100);l.css({left:a-Math.ceil(l.width()/2)+"px"}),l.data("pos",{x:a}),se(ue(t/100)),ce(t/100*360),ae()}function fe(){for(var e="",t=["","-o-","-ms-","-moz-","-webkit-"],n=F().document.createElement("div"),r=0;rr?100:(o-n)/(r-n)*100;var a=p.width()*(t/100);y.css({left:a-Math.ceil(y.width()/2)+"px"}),y.data("pos",{x:a}),me(),Ve(),ae()}function me(){var e=y.data("pos")||{x:0},t=Math.round(e.x/p.width()*100)/100;C=isNaN(t)?1:t}function ye(){var e=i.data("pos")||{x:0,y:0},t=l.data("pos")||{x:0},n=r.width(),o=r.height(),a=t.x/d.width()*360,u=e.x/n,s=(o-e.y)/o;0==n&&(a=0,u=0,s=0),E=a,P=u,T=s}function ge(e){return e.touches&&e.touches[0]?e.touches[0]:e}function be(e){var t=e.which,n=!1;return 37!=t&&39!=t&&8!=t&&46!=t&&9!=t||(n=!0),!(!n&&(t<48||t>57))}function ve(e){var t=j.val(),n=x.val(),r=D.val();""!=t&&""!=n&&""!=r&&(parseInt(t)>255?j.val(255):j.val(parseInt(t)),parseInt(n)>255?x.val(255):x.val(parseInt(n)),parseInt(r)>255?D.val(255):D.val(parseInt(r)),ke(Z()))}function _e(){var e=r.width()*P,t=r.height()*(1-T);i.css({left:e-5+"px",top:t-5+"px"}),i.data("pos",{x:e,y:t});var n=d.width()*(E/360);l.css({left:n-7.5+"px"}),l.data("pos",{x:n});var o=p.width()*(C||0);y.css({left:o-7.5+"px"}),y.data("pos",{x:o})}function we(e,t,n,r){C=r,E=e,P=t,T=n}function Oe(e){g.data("format",e),Ue()}function ke(e){var t=e||"#FF0000",n=W.parse(t);Oe(n.type),se(t);var r=W.RGBtoHSV(n.r,n.g,n.b);we(r.h,r.s,r.v,n.a),_e(),de(),ae()}function Se(e,t,n){e.addEventListener(t,n)}function Ce(e,t,n){e.removeEventListener(t,n)}function Ee(e){r.data("isDown",!0),ie(e)}function Pe(e){r.data("isDown",!1)}function Te(e){e.preventDefault(),n.data("isDown",!0)}function Me(e){e.preventDefault(),f.data("isDown",!0)}function je(e){n.data("isDown",!0),de(e)}function xe(e){f.data("isDown",!0),he(e)}function De(e){if(e.which<65||e.which>70)return be(e)}function Ne(e){var t=M.val();"#"==t.charAt(0)&&7==t.length&&ke(t)}function Le(e){Ge()}function Re(){Se(r.el,"mousedown",Ee),Se(r.el,"mouseup",Pe),Se(l.el,"mousedown",Te),Se(y.el,"mousedown",Me),Se(d.el,"mousedown",je),Se(p.el,"mousedown",xe),Se(M.el,"keydown",De),Se(M.el,"keyup",Ne),Se(j.el,"keydown",be),Se(j.el,"keyup",ve),Se(x.el,"keydown",be),Se(x.el,"keyup",ve),Se(D.el,"keydown",be),Se(D.el,"keyup",ve),Se(F().document,"mouseup",Be),Se(F().document,"mousemove",Fe),Se(m.el,"click",Le)}function Ae(e){var t=new X(e).closest("codemirror-colorview"),n=new X(e).closest("codemirror-colorpicker"),r=new X(e).closest("CodeMirror");return e.nodeName,!!(n||t||r)}function Ie(e){return"HTML"==e.nodeName}function Be(e){r.data("isDown",!1),n.data("isDown",!1),f.data("isDown",!1),Ie(e.target)?Ze(K):0==Ae(e.target)&&et()}function Fe(e){r.data("isDown")&&ie(e),n.data("isDown")&&de(e),f.data("isDown")&&he(e)}function We(){Ce(r.el,"mousedown",Ee),Ce(r.el,"mouseup",Pe),Ce(l.el,"mousedown",Te),Ce(y.el,"mousedown",Me),Ce(d.el,"mousedown",je),Ce(p.el,"mousedown",xe),Ce(M.el,"keydown",De),Ce(M.el,"keyup",Ne),Ce(j.el,"keydown",be),Ce(j.el,"keyup",ve),Ce(x.el,"keydown",be),Ce(x.el,"keyup",ve),Ce(D.el,"keydown",be),Ce(D.el,"keyup",ve),Ce(document,"mousemove",Fe),Ce(F().document,"mousemove",Fe),Ce(m.el,"click",Le),U=void 0}function Ve(){var e=g.data("format")||"hex";if(C<1&&"hex"==e){var t="rgb";g.removeClass(e),g.addClass(t),g.data("format",t),ae()}}function Ue(){var e=g.data("format")||"hex";g.removeClass("hex"),g.removeClass("rgb"),g.removeClass("hsl"),g.addClass(e)}function Ge(){var e=g.data("format")||"hex",t="hex";"hex"==e?t="rgb":"rgb"==e?t="hsl":"hsl"==e&&(t=1==C?"hex":"rgb"),g.removeClass(e),g.addClass(t),g.data("format",t),ae()}function He(e){var t=new X("div","information-item "+e);if("hex"==e){var n=new X("div","input-field hex");M=new X("input","input",{type:"text"}),n.append(M),n.append(new X("div","title").html("HEX")),t.append(n)}else"rgb"==e?(n=new X("div","input-field rgb-r"),j=new X("input","input",{type:"text"}),n.append(j),n.append(new X("div","title").html("R")),t.append(n),n=new X("div","input-field rgb-g"),x=new X("input","input",{type:"text"}),n.append(x),n.append(new X("div","title").html("G")),t.append(n),n=new X("div","input-field rgb-b"),D=new X("input","input",{type:"text"}),n.append(D),n.append(new X("div","title").html("B")),t.append(n),n=new X("div","input-field rgb-a"),N=new X("input","input",{type:"text"}),n.append(N),n.append(new X("div","title").html("A")),t.append(n)):"hsl"==e&&(n=new X("div","input-field hsl-h"),L=new X("input","input",{type:"text"}),n.append(L),n.append(new X("div","title").html("H")),t.append(n),n=new X("div","input-field hsl-s"),R=new X("input","input",{type:"text"}),n.append(R),n.append(new X("div","title").html("S")),t.append(n),n=new X("div","input-field hsl-l"),A=new X("input","input",{type:"text"}),n.append(A),n.append(new X("div","title").html("L")),t.append(n),n=new X("div","input-field hsl-a"),I=new X("input","input",{type:"text"}),n.append(I),n.append(new X("div","title").html("A")),t.append(n));return t}function ze(e){$=e?Y.filter((function(t){return t.name==e}))[0]:Y[0]}function qe(){for(var e=new X("div","current-color-sets"),t=0,n=$.colors.length;twindow.innerWidth&&(a-=r+a-window.innerWidth),a<0&&(a=0);var i=n.top-e.el.scrollTop;o+i>window.innerHeight&&(i-=o+i-window.innerHeight),i<0&&(i=0),t.css({left:a+"px",top:i+"px"})}function Qe(e,n,r){We(),Re(),t.appendTo(F().document.body),t.css({position:"fixed",left:"-10000px",top:"-10000px"}),t.show(),Je(e),z=!0,q=e.isShortCut||!1,ke(n),U=function(e){r(e)},(K=e.hideDelay||2e3)>0&&Ze(K)}function Ze(e){e=e||0,Ce(t.el,"mouseenter"),Ce(t.el,"mouseleave"),Se(t.el,"mouseenter",(function(){clearTimeout(B)})),Se(t.el,"mouseleave",(function(){clearTimeout(B),B=setTimeout(et,e)})),clearTimeout(B),B=setTimeout(et,e)}function et(){z&&(We(),t.hide(),t.remove(),z=!1)}return X.prototype.closest=function(e){for(var t=this,n=!1;!(n=t.hasClass(e));){if(!t.el.parentNode)return null;t=new X(t.el.parentNode)}return n?t:null},X.prototype.removeClass=function(e){this.el.className=W.trim((" "+this.el.className+" ").replace(" "+e+" "," "))},X.prototype.hasClass=function(e){return!!this.el.className&&(" "+this.el.className+" ").indexOf(" "+e+" ")>-1},X.prototype.addClass=function(e){this.hasClass(e)||(this.el.className=this.el.className+" "+e)},X.prototype.html=function(e){return this.el.innerHTML=e,this},X.prototype.empty=function(){return this.html("")},X.prototype.append=function(e){return"string"==typeof e?this.el.appendChild(F().document.createTextNode(e)):this.el.appendChild(e.el||e),this},X.prototype.appendTo=function(e){return(e.el?e.el:e).appendChild(this.el),this},X.prototype.remove=function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this},X.prototype.text=function(){return this.el.textContent},X.prototype.css=function(e,t){if(2==arguments.length)this.el.style[e]=t;else if(1==arguments.length){if("string"==typeof e)return getComputedStyle(this.el)[e];var n=e||{};for(var r in n)this.el.style[r]=n[r]}return this},X.prototype.offset=function(){var e=this.el.getBoundingClientRect();return{top:e.top+F().document.body.scrollTop,left:e.left+F().document.body.scrollLeft}},X.prototype.position=function(){return{top:parseFloat(this.el.style.top),left:parseFloat(this.el.style.left)}},X.prototype.width=function(){return this.el.offsetWidth},X.prototype.height=function(){return this.el.offsetHeight},X.prototype.dataKey=function(e){return this.uniqId+"."+e},X.prototype.data=function(e,t){if(2!=arguments.length){if(1==arguments.length)return H[this.dataKey(e)];var n=Object.keys(H),r=this.uniqId+".";return n.filter((function(e){return 0==e.indexOf(r)})).map((function(e){return H[e]}))}return H[this.dataKey(e)]=t,this},X.prototype.val=function(e){return 0==arguments.length?this.el.value:(1==arguments.length&&(this.el.value=e),this)},X.prototype.int=function(){return parseInt(this.val(),10)},X.prototype.show=function(){return this.css("display","block")},X.prototype.hide=function(){return this.css("display","none")},Ke(),{isShortCut:function(){return q},$root:t,show:Qe,hide:et,setColor:Ye,getColor:Xe}}))},function(e,t,n){!function(e){"use strict";var t=function(){return ET_Builder.Frames.top},n={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb(0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb(95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(237, 20, 61)",cyan:"rgb(0, 255, 255)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgrey:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb(0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb(75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgreen:"rgb(144, 238, 144)",lightgray:"rgb(211, 211, 211)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb(0, 255, 0)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",rebeccapurple:"rgb(102, 51, 153)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb(65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb(0, 255, 127)",steelblue:"rgb(70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb(0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb(64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)",transparent:"rgba(0, 0, 0, 0)"},r="codemirror-colorview",o="codemirror-colorview-background",a=["comment","builtin"];function i(e,t){"setValue"==t.origin?(e.state.colorpicker.close_color_picker(),e.state.colorpicker.init_color_update(),e.state.colorpicker.style_color_update()):e.state.colorpicker.style_color_update(e.getCursor().line)}function l(e,t){e.state.colorpicker.isUpdate||(e.state.colorpicker.isUpdate=!0,e.state.colorpicker.close_color_picker(),e.state.colorpicker.init_color_update(),e.state.colorpicker.style_color_update())}function u(e,t){i(e,{origin:"setValue"})}function s(e,t){e.state.colorpicker.keyup(t)}function c(e,t){e.state.colorpicker.is_edit_mode()&&e.state.colorpicker.check_mousedown(t)}function d(e,t){i(e,{origin:"setValue"})}function f(e){e.state.colorpicker.close_color_picker()}function p(e,t){var n=void 0;return function(r,o){n&&clearTimeout(n),n=setTimeout((function(){e(r,o)}),t||300)}}function h(e,t){return!(!e||!e.className)&&(" "+e.className+" ").indexOf(" "+t+" ")>-1}function m(e,t){t="boolean"==typeof t?{mode:"view"}:Object.assign({mode:"view"},t||{}),this.opt=t,this.cm=e,this.markers={},a=this.opt.excluded_token||a,this.cm.colorpicker?this.colorpicker=this.cm.colorpicker():this.opt.colorpicker&&(this.colorpicker=this.opt.colorpicker),this.init_event()}e.defineOption("colorpicker",!1,(function(t,n,r){r&&r!=e.Init&&t.state.colorpicker&&(t.state.colorpicker.destroy(),t.state.colorpicker=null),n&&(t.state.colorpicker=new m(t,n))})),m.prototype.init_event=function(){var e,t;this.cm.on("mousedown",c),this.cm.on("keyup",s),this.cm.on("change",i),this.cm.on("update",l),this.cm.on("refresh",u),this.onPasteCallback=(e=this.cm,t=d,function(n){t.call(this,e,n)}),this.cm.getWrapperElement().addEventListener("paste",this.onPasteCallback),this.is_edit_mode()&&this.cm.on("scroll",p(f,50))},m.prototype.is_edit_mode=function(){return"edit"==this.opt.mode},m.prototype.is_view_mode=function(){return"view"==this.opt.mode},m.prototype.destroy=function(){this.cm.off("mousedown",c),this.cm.off("keyup",s),this.cm.off("change",i),this.cm.getWrapperElement().removeEventListener("paste",this.onPasteCallback),this.is_edit_mode()&&this.cm.off("scroll")},m.prototype.hasClass=function(e,t){return!!e.className&&(" "+e.className+" ").indexOf(" "+t+" ")>-1},m.prototype.check_mousedown=function(e){this.hasClass(e.target,o)?this.open_color_picker(e.target.parentNode):this.close_color_picker()},m.prototype.popup_color_picker=function(e){var t=this.cm.getCursor(),n=this,r={lineNo:t.line,ch:t.ch,color:e||"#FFFFFF",isShortCut:!0};Object.keys(this.markers).forEach((function(e){if(("#"+e).indexOf("#"+r.lineNo+":")>-1){var t=n.markers[e];t.ch<=r.ch&&r.ch<=t.ch+t.color.length&&(r.ch=t.ch,r.color=t.color,r.nameColor=t.nameColor)}})),this.open_color_picker(r)},m.prototype.open_color_picker=function(e){var t=e.lineNo,n=e.ch,r=e.nameColor,o=e.color;if(this.colorpicker){var a=this,i=o,l=this.cm.charCoords({line:t,ch:n});this.colorpicker.show({left:l.left,top:l.bottom,isShortCut:e.isShortCut||!1,hideDelay:a.opt.hideDelay||2e3},r||o,(function(e){a.cm.replaceRange(e,{line:t,ch:n},{line:t,ch:n+i.length},"*colorpicker"),i=e}))}},m.prototype.close_color_picker=function(e){this.colorpicker&&this.colorpicker.hide()},m.prototype.key=function(e,t){return[e,t].join(":")},m.prototype.keyup=function(e){this.colorpicker&&("Escape"==e.key||0==this.colorpicker.isShortCut())&&this.colorpicker.hide()},m.prototype.init_color_update=function(){this.markers={}},m.prototype.style_color_update=function(e){if(e)this.match(e);else for(var t=this.cm.lineCount(),n=0;n-1||r[a].indexOf("rgb")>-1||r[a].indexOf("hsl")>-1)this.render(o,e,t,r[a]);else{var l=n[r[a]];l&&this.render(o,e,t,r[a],l)}},m.prototype.match=function(e){var t=this.cm.getLineHandle(e),n=this;this.cm.operation((function(){n.submatch(e,t)}))},m.prototype.make_element=function(){var e=t().document.createElement("div");return e.className=r,this.is_edit_mode()?e.title="open color picker":e.title="",e.back_element=this.make_background_element(),e.appendChild(e.back_element),e},m.prototype.make_background_element=function(){var e=t().document.createElement("div");return e.className=o,e},m.prototype.set_state=function(e,t,n,r){var o=this.create_marker(e,t);return o.lineNo=e,o.ch=t,o.color=n,o.nameColor=r,o},m.prototype.create_marker=function(e,t){var n=this.key(e,t);return this.markers[n]||(this.markers[n]=this.make_element()),this.markers[n]},m.prototype.has_marker=function(e,t){var n=this.key(e,t);return!!this.markers[n]},m.prototype.update_element=function(e,t){e.back_element.style.backgroundColor=t},m.prototype.set_mark=function(e,t,n){this.cm.setBookmark({line:e,ch:t},{widget:n,handleMouseEvents:!0})},m.prototype.is_excluded_token=function(e,t){var n=this.cm.getTokenAt({line:e,ch:t},!0),r=n.type,o=n.state.state;if(null==r&&"block"==o)return!0;if(null==r&&"top"==o)return!0;for(var i=0,l=0,u=a.length;l0},m.prototype.render=function(e,t,n,r,o){var a=n.text.indexOf(r,e.next);if(!0!==this.is_excluded_token(t,a)){if(e.next=a+r.length,this.has_marker(t,a))return this.update_element(this.create_marker(t,a),o||r),void this.set_state(t,a,r,o);var i=this.create_marker(t,a);this.update_element(i,o||r),this.set_state(t,a,r,o||r),this.set_mark(t,a,i)}}}(n(1482))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(11)),o=s(n(5)),a=s(n(9)),i=s(n(846)),l=s(n(42)),u=n(828);function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"",r=e;return t.showSearchField&&(r=getFilteredOptionsList("main",e)),Object.entries(r).map((function(e){var r=g(e,2),o=r[0],a=r[1];return a.hasOwnProperty("items")?F(o,a):React.createElement(i.MenuItem,{type:"radio",value:o,key:o,onClick:function(e){return A(o,n)}},React.createElement("span",{className:"szh-menu__item__name"},(null==a?void 0:a.name)||a),o===t.value&&React.createElement(c.default,{icon:"check"}))}))},V=function(e){return React.createElement(i.MenuItem,{type:"radio",value:e,key:e,onClick:function(){return B(e)}},React.createElement("span",{className:"szh-menu__item__name"},(0,l.decode)(ETBuilderBackend.aiCodeOptions[e])))},U=function(e){if(b(""),E(!0),m.default.condition("is_bfb")&&e.target){var t=e.target.getBoundingClientRect().top,n=window.top.innerHeight;M(n-t<400?t>=400?"top":"left":null)}},G=function(){return React.createElement("li",{onMouseEnter:function(){return b("-hover")},onMouseLeave:function(){return b("")},className:"et-code-ai-btn","data-tip":"-hover"===y?(0,d.default)("ai","Code With AI"):"",onClick:U},React.createElement(c.default,{icon:"divi-ai-code".concat(y),svgId:R}))};return(0,a.useEffect)((function(){return window.addEventListener("ai_prompt_use_code",I),function(){window.removeEventListener("ai_prompt_use_code",I)}})),(0,a.useEffect)((function(){j&&(0,p.getDataOptionsByContext)(j).then((function(e){null!=e&&e.refine&&k(e.refine)}))}),[j]),(0,a.useEffect)((function(){C&&(E(!1),!x&&B("code_with_ai"))}),[y]),x?React.createElement(i.Menu,{menuButton:G(),portal:{target:window.top.document.body},menuClassName:"et-fb-select-menu",containerProps:{style:{zIndex:2000001,position:"fixed"}},transition:{open:!0,close:!1,item:!1},submenuCloseDelay:0,submenuOpenDelay:0,initialOpen:!1,initialMounted:!1,position:"anchor",viewScroll:"auto",direction:T},React.createElement(React.Fragment,null,V("code_with_ai"),V("improve_code_with_ai"),React.createElement(React.Fragment,null,React.createElement(i.MenuDivider,null),React.createElement(i.MenuItem,{className:"szh-menu__item__quick-action"},React.createElement("span",{className:"szh-menu__item__name "},(0,d.default)("ai","Quick Actions")))),W(O))):G()};t.default=v}).call(this,n(8))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(0)),o=i(n(1540)),a=i(n(14));function i(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&n.length<3||(t.state.loading||t.setState({loading:!0}),t.getOptions(e,n,r))})),I(R(t),"getOptions",(function(e,n,r){var o=t.props.arguments(e,n,r),a=(0,i.default)(E.default.getAjaxifiedCache(o.action,o.post_type));if(""===n&&!(0,h.default)((0,u.default)(a,["results",r],[]))){var l=(0,h.default)(t.state.selected)||""===e?t.getSelectedOption(e,a):t.state.selected,c=(0,u.default)(a,"meta",{}),d=(0,u.default)(a,["results",r]);return(0,_.default)(c,"pagination.pages.current",r),l&&(0,s.default)((0,u.default)(d,"[1].value"))!==e&&d.splice(1,0,l),void t.updateCurrentOptions(d,c)}t._requestOptions(e,n,r)})),I(R(t),"getSelectedOption",(function(e,n){var r;if(!(0,h.default)(n)){if((0,f.default)(n.results,(function(t){r||(r=(0,p.default)(t,(function(t){return(0,s.default)(t.value)===(0,s.default)(e)})))})),!(0,h.default)(r))return(0,_.default)(r,"meta.post_type",""),t.setState({selected:r}),r;t._requestOptions(e,"",1)}})),I(R(t),"updateCurrentOptions",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n||t.state.meta;t.setState({options:e,meta:o,loading:r},(function(){(0,h.default)(t.props.value)&&t.handleOnChange(t.valuePrefix+(0,u.default)(e,"0.value","").toString())}))})),I(R(t),"renderLoading",(function(){return o.default.createElement("div",{className:"et-fb-select-ajaxified__spinner"})})),I(R(t),"renderNoResults",(function(){return o.default.createElement("li",{className:"et-fb-select-options-filter select-option-item et-fb-select-ajaxified__element"},ETBuilderBackend.i18n.selectControl.noResults)})),I(R(t),"renderBeforeList",(function(){return o.default.createElement("li",{className:"et-fb-select-options-filter select-option-item et-fb-select-ajaxified__element et-fb-select-ajaxified__search"},o.default.createElement(S.default,{ref:function(e){return t.inputRef=e},type:"text",name:"search",value:t.state.search,_onChange:t.handleSearch,additional_attrs:{placeholder:ETBuilderBackend.i18n.selectControl.typeToSearch}}),t.state.loading&&t.renderLoading())})),I(R(t),"renderAfterList",(function(e){return(0,h.default)(t.state.options)&&!t.state.loading?o.default.createElement(o.Fragment,null,t.renderNoResults(),e):o.default.createElement(o.Fragment,null,e,t.renderPagination())})),t.state={search:"",options:{},meta:{pagination:{results:{per_page:20,total:0},pages:{current:1,total:0}}},request:null,loading:!1,open:!1,selected:!1},t.valuePrefix="_",t.onClickPaginationPrev=t.onClickPaginationPrev.bind(R(t)),t.onClickPaginationNext=t.onClickPaginationNext.bind(R(t)),t}return t=b,(n=[{key:"onClickPaginationPrev",value:function(){this.handleOnPagination(this.state.meta.pagination.pages.current-1)}},{key:"onClickPaginationNext",value:function(){this.handleOnPagination(this.state.meta.pagination.pages.current+1)}},{key:"renderPagination",value:function(){var e=this.state.meta.pagination;if(e.pages.current>e.pages.total||e.pages.total<2)return null;var t=ETBuilderBackend.i18n.selectControl.pagination.replace("%1$s",e.pages.current).replace("%2$s",e.pages.total);return o.default.createElement("li",{className:"et-fb-select-options-filter select-option-item et-fb-select-ajaxified__element et-fb-select-ajaxified__pagination"},o.default.createElement("div",{className:"et-fb-select-ajaxified__pagination-container"},o.default.createElement("button",{type:"button",className:"et-fb-select-ajaxified__pagination-button et-fb-select-ajaxified__pagination-button--previous",onClick:this.onClickPaginationPrev},o.default.createElement(C.default,{icon:"previous",color:P.default.white})),o.default.createElement("span",{className:"et-fb-select-ajaxified__pagination-label"},t),o.default.createElement("button",{type:"button",className:"et-fb-select-ajaxified__pagination-button et-fb-select-ajaxified__pagination-button--next",onClick:this.onClickPaginationNext},o.default.createElement(C.default,{icon:"next",color:P.default.white}))))}},{key:"componentDidMount",value:function(){this.requestOptions(this.props.value,this.state.search,this.state.meta.pagination.pages.current)}},{key:"render",value:function(){var e=j({},this.props),t=(0,u.default)(this,"state.selected.value",this.props.value);return e=(0,v.default)(e,"searchable"),o.default.createElement("div",{className:"et-fb-select-ajaxified"},o.default.createElement(k.default,j({},e,{options:this.getSelectOptions(),value:this.valuePrefix+t,selectFirst:!1,emptyLabel:ETBuilderBackend.i18n.selectControl.noTitle,labelFilter:this.filterOptionLabel,preserveHeight:this.state.meta.pagination.pages.total>1?"on":"auto",beforeList:this.renderBeforeList,afterList:this.renderAfterList,__onChange:this.handleOnChange,onOpen:this.handleOpenDropdown,onClose:this.handleCloseDropdown})),this.state.loading&&!this.state.open&&this.renderLoading())}}])&&x(t.prototype,n),r&&x(t,r),Object.defineProperty(t,"prototype",{writable:!1}),b}(o.PureComponent);F.propTypes={name:a.default.string,value:a.default.any.isRequired,src:a.default.string,arguments:a.default.func.isRequired,labelFilter:a.default.func,_onChange:a.default.func,defaultOption:a.default.any},F.defaultProps={name:"",src:ETBuilderBackend.ajaxUrl,labelFilter:void 0,_onChange:b.default,defaultOption:!1};var W=F;t.default=W},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(0)),o=i(n(616)),a=i(n(281));function i(e){return e&&e.__esModule?e:{default:e}}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));s.ref=function(t){e.scrollComponent=t,u&&u(t)};var c=[n];return o&&(l?i?c.unshift(l):c.push(l):this.defaultLoader&&(i?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),a.default.createElement(r,s,c)}}]),t}(o.Component);u.propTypes={children:i.default.node.isRequired,element:i.default.node,hasMore:i.default.bool,initialLoad:i.default.bool,isReverse:i.default.bool,loader:i.default.node,loadMore:i.default.func.isRequired,pageStart:i.default.number,ref:i.default.func,getScrollParent:i.default.func,threshold:i.default.number,useCapture:i.default.bool,useWindow:i.default.bool},u.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=u,e.exports=t.default},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=D(n(0)),a=D(n(3)),i=n(93),l=D(n(13)),u=D(n(16)),s=D(n(11)),c=D(n(12)),d=D(n(10)),f=D(n(4)),p=D(n(5)),h=D(n(37)),m=D(n(28)),y=D(n(1)),g=D(n(7)),b=D(n(9)),v=D(n(197)),_=D(n(146)),w=D(n(17)),O=D(n(31)),k=D(n(84)),S=D(n(789)),C=D(n(22)),E=D(n(6)),P=D(n(15)),T=D(n(2)),M=D(n(616)),j=D(n(792)),x=D(n(43));function D(e){return e&&e.__esModule?e:{default:e}}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&n.find("style#".concat(r)).remove(),o='');else{if(n.find("style#et-fb-font-".concat(r)).length>0)return;o='')}n.append(o)}else"font-weight"===t&&n.find("style#".concat(r)).length>0&&n.find("style#".concat(r)).remove()}},{key:"getUploadedFonts",value:function(){var e=ETBuilderBackend.customFonts;return(0,p.default)(e)?[]:(0,w.default)(e)}},{key:"getFontWeightOptions",value:function(){var e=ETBuilderBackend.googleFonts,t=ETBuilderBackend.customFonts,n=this.getValue("font"),r=(0,y.default)(t,n,!1),o=(0,w.default)(ETBuilderBackend.allFontWeights),a={},i=[];if(""===n)i=["300","400","600","700","800"];else{if(r||(r=(0,y.default)(e,n,!1)),!r||(0,s.default)(r.styles))return ETBuilderBackend.allFontWeights;i=r.styles.split(",")}var l=(0,v.default)((0,_.default)(["400","700"],i),o);return(0,b.default)(l,(function(e){a[e]=ETBuilderBackend.allFontWeights[e]})),a}},{key:"getFontWeight",value:function(){var e=this.getValue("weight");return!0===e?"700":(0,g.default)((0,w.default)(this.getFontWeightOptions()),e)?e:"400"}},{key:"updateOptionValue",value:function(e,t){var n=this.getValues();n[e]=T.default.get(t,""),(0,b.default)([["uppercase","capitalize"],["underline","line_through"]],(function(t){(0,g.default)(t,e)&&(0,b.default)(t,(function(t){t!==e&&(n[t]=!1)}))})),this.updateFontStyle(n)}},{key:"fontStyleButtonClassNames",value:function(e){var t;return(0,l.default)((U(t={"et-fb-select-fontstyle-button":!0},"et-fb-select-fontstyle-button--".concat(e),!0),U(t,"et-fb-select-fontstyle-option--".concat(this.props.name),!0),t))}},{key:"fieldClassNames",value:function(e,t){var n;return(0,l.default)((0,d.default)({},(U(n={"et-fb-font-option-container":!0,"et-fb-font-option-container-with-label":!0},"et-fb-font-option-container--".concat(this.props.name),!0),U(n,"et-fb-font-option-container--sub",!0),U(n,"et-fb-font-option-container--sub-".concat(e),!0),n),t))}},{key:"_onMouseEnter",value:function(e){if(!this.props.rightClickOpened&&this.props.isSettingsModal){var t=e.currentTarget.getAttribute("data-subfield");this.setState({hoveredElement:t}),C.default.setHoveredSubElement(t)}}},{key:"_onMouseLeave",value:function(){!this.props.rightClickOpened&&this.props.isSettingsModal&&C.default.setHoveredSubElement(!1)}},{key:"_extraProps",value:function(){var e={readonly:this.props.readonly,disableReset:this.props.disableReset};return(0,d.default)({},e)}},{key:"_isFilterActive",value:function(){return(0,g.default)(["styles_modified","active_content"],this.props.filterSelected)}},{key:"_isRenderSubFieldLabel",value:function(e){return!!(0,s.default)(this.props.subFieldLabel)||((0,h.default)(this.props.subFieldLabel)?e===this.props.subFieldLabel:(0,f.default)(this.props.subFieldLabel)?(0,g.default)(this.props.subFieldLabel,e):this.props.subFieldLabel)}},{key:"_isRenderSubField",value:function(e){return!!(0,s.default)(this.props.subField)||((0,h.default)(this.props.subField)?e===this.props.subField:(0,f.default)(this.props.subField)?(0,g.default)(this.props.subField,e):this.props.subField)}},{key:"_renderSubFieldFontFamily",value:function(){if(!this._isRenderSubField("font"))return!1;var e=this.getValue("font");if(this._isFilterActive()&&(!e||"Default"===e))return!1;var t=this.fieldClassNames("font");return o.default.createElement("div",{className:t,"data-subfield":"font",onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave},this._isRenderSubFieldLabel("font")&&this.props.formLabel,this._isRenderSubFieldLabel("font")&&this.props.formDescription,o.default.createElement(M.default,N({default:"Default",recentCategory:"font_family",value:e,name:this.props.name,options:ETBuilderBackend.googleFontsList,additionalOptions:{uploaded:this.state.uploadedFonts},searchPlaceholder:G.searchFonts,searchable:!0,displayRecent:!0,_hoverAction:this._previewFontOnHover,__onChange:this.updateFontFamily},this._extraProps())))}},{key:"_renderSubFieldFontWeight",value:function(){if(!this._isRenderSubField("weight"))return!1;var e=this.getFontWeight();if(this._isFilterActive()&&(!e||(0,g.default)(["400","normal"],e)))return!1;var t=(0,s.default)(this.props.group_label)?G.fontWeight:"".concat(this.props.group_label," ").concat(G.fontWeight),n=!!this._isRenderSubFieldLabel("weight")&&this.getLabel("weight",t),r=this.fieldClassNames("weight");return o.default.createElement("div",{className:r,"data-subfield":"weight",onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave},n,o.default.createElement(M.default,N({className:"et-fb-font-weight-option",name:"".concat(this.props.name,"_weight"),default:"normal",value:e,options:this.getFontWeightOptions(),__onChange:this.updateFontWeight},this._extraProps())))}},{key:"_renderSubFieldFontStyle",value:function(){var e=this;if(!this._isRenderSubField("style"))return!1;var t=q.filter((function(t){return!e._isFilterActive()||e._isFilterActive()&&e.getValue(t.slug)}));if((0,p.default)(t))return!1;var n=t.map((function(t){var n=e.getValue(t.slug)?k.default.activeTabIcon:k.default.optionTabIcon;return o.default.createElement("button",{key:t.slug,className:e.fontStyleButtonClassNames(t.slug),onClick:function(n){return e.toggleButton(t.slug)||n.preventDefault()},"data-button":t.slug,type:t},o.default.createElement(x.default,{icon:t.icon,color:n}))})),r=(0,s.default)(this.props.group_label)?G.fontStyle:"".concat(this.props.group_label," ").concat(G.fontStyle),a=!!this._isRenderSubFieldLabel("style")&&this.getLabel("style",r),i=this.fieldClassNames("style");return o.default.createElement("div",{className:i,"data-subfield":"style",onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave},a,n)}},{key:"_renderSubFieldFontLineColor",value:function(){if(!this._isRenderSubField("line_color"))return!1;var e=this.getValue("underline"),t=this.getValue("line_through");if(!e&&!t)return!1;var n=this.getValue("line_color");if(this._isFilterActive()&&!n)return!1;var r=e?G.underline:G.strikethrough,a=(0,s.default)(this.props.group_label)?"".concat(r," ").concat(G.color):"".concat(this.props.group_label," ").concat(r," ").concat(G.color),i=!!this._isRenderSubFieldLabel("line_color")&&this.getLabel("line_color",a),l=this.fieldClassNames("line_color",{"et-fb-option--color-alpha":!0});return o.default.createElement("div",{className:l,onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave,"data-subfield":"line_color"},i,o.default.createElement(j.default,N({name:"".concat(this.props.name,"_line_color"),type:"color-alpha",value:n,animate:!0,_onChange:this.updateLineColor},this._extraProps())))}},{key:"_renderSubFieldFontLineStyle",value:function(){if(!this._isRenderSubField("line_style"))return!1;var e=this.getValue("underline"),t=this.getValue("line_through");if(!e&&!t)return!1;var n=(0,p.default)(this.getValue("line_style"))?"solid":this.getValue("line_style");if(this._isFilterActive()&&"solid"===n)return!1;var r=e?G.underline:G.strikethrough,a=(0,s.default)(this.props.group_label)?"".concat(r," ").concat(G.style):"".concat(this.props.group_label," ").concat(r," ").concat(G.style),i=!!this._isRenderSubFieldLabel("line_style")&&this.getLabel("line_style",a),l=this.fieldClassNames("line_style");return o.default.createElement("div",{className:l,"data-subfield":"line_style",onMouseEnter:this._onMouseEnter,onMouseLeave:this._onMouseLeave},i,o.default.createElement(M.default,N({name:"".concat(this.props.name,"_line_style"),className:"et-fb-font-line-style-option",default:"solid",value:n,options:["solid","double","dotted","dashed","wavy"],__onChange:this.updateLineStyle},this._extraProps())))}},{key:"render",value:function(){var e=(0,l.default)(U({"et-fb-settings-option-inner":!0,"et-fb-settings-option-inner--select-fontstyle":!0},"et-fb-settings-option-inner--".concat(this.props.name),!0));return o.default.createElement("div",{className:e},this._renderSubFieldFontFamily(),this._renderSubFieldFontWeight(),this._renderSubFieldFontStyle(),this._renderSubFieldFontLineColor(),this._renderSubFieldFontLineStyle())}}])&&A(t.prototype,n),r&&A(t,r),Object.defineProperty(t,"prototype",{writable:!1}),D}(o.default.Component);K.propTypes=H;var $=K;t.default=$},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=p(n(0)),a=p(n(13)),i=p(n(16)),l=p(n(31)),u=(p(n(125)),p(n(1))),s=p(n(7)),c=p(n(11)),d=p(n(43));p(n(2));n(1687);var f=p(n(18));function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){for(var n=0;n'),""!==h)l='').concat(l,"");""!==p&&(l='[caption align="'.concat(f,'" width="').concat(s,'" ]').concat(l," ").concat(p,"[/caption]"))}else l="[embed]".concat(i,"[/embed]");r.insertMedia(l)}})),n.on("update",(function(e){var t=(0,c.default)(e.gallery)?"playlist":"gallery",n="playlist"===t?M.wp.media.playlist.shortcode(e).attrs.named:M.wp.media.gallery.shortcode(e).attrs.named,o=(0,c.default)(n.ids)?"":n.ids.join(",");if(""!==o){var a="";(0,d.default)(n,(function(e,t){"ids"!==t&&(a+=" ".concat(t,'="').concat(e,'"'))}));var i="[".concat(t,' ids="').concat(o,'"').concat(a,"]");r.insertMedia(i)}})),n.open()}else n.open()},insertMedia:function(e){if(S.default.appWindow().wpActiveEditor=!1,"html"===getUserSetting("editor")){var t=S.default.$topWindow(".et-fb-tinymce-html-input:visible"),n=t.val()+e;t.val(n),this.setTextareaContent(n)}else M.wp.media.editor.insert(e)},switchToVisual:function(e){e.preventDefault(),this.switchEditorMode("tinymce")},switchToHtml:function(e){e.preventDefault(),this.switchEditorMode("html"),this.processedContent=!0,this.setState({content:this.processContent(this.state.content)})},setActiveModeClass:function(e){var t,n,r,o=(t={"et-fb-switch-editor-mode__tab":!0},n="et-fb-switch-editor-mode__tab--".concat(e),r=!0,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t);return e===this.state.editorMode&&(o["et-fb-switch-editor-mode__tab--active"]=!0),(0,i.default)(o)},processContent:function(e){return e=e.replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"),this.isRemoveP&&(e=C.default.removep(e)),e},_onDoubleClick:function(e){e.stopPropagation()},_tinyMCESetup:function(e){e.settings.convert_urls=0,e.settings.remove_script_host=0},getStateContent:function(){return"html"===this.state.editorMode?"
\n"===this.state.content?"":this.state.content:C.default.wpautop(this.processContent(this.state.content))},getPropsContent:function(e){var t=e||this.props;return"content"===t.name?(0,g.default)(t,"content",""):(0,g.default)(t,"value","")},render:function(){var e=this.props.additional_attrs?this.props.additional_attrs:{},t=ETBuilderBackend.i18n.controls.tinymce,n=(this.props.className&&this.props.className,this.getStateContent()),o=(0,g.default)(ETBuilderBackend,"tinymcePlugins",["autolink","link","image","lists","print","preview","autoresize","textcolor","table","paste","fullscreen","charmap","emoticons","wpview"]),a={entity_encoding:"raw",skin_url:ETBuilderBackend.tinymceSkinUrl,plugins:o.join(" "),menubar:!1,valid_elements:"*[*]",toolbar:"formatselect,bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,alignjustify,table,strikethrough,underline,hr,forecolor,pastetext,removeformat,outdent,indent,fullscreen,charmap,emoticons,undo,redo",content_css:ETBuilderBackend.tinymceCSSFiles,autoresize_bottom_margin:0,setup:this._tinyMCESetup};if(S.default.condition("is_bfb")&&(a=(0,g.default)(S.default.topWindow(),"tinyMCEPreInit.mceInit.content",{}),(0,c.default)(a.toolbar1)||(a.toolbar1=a.toolbar1.replace("dfw","table,fullscreen"),a.toolbar1=a.toolbar1.replace("wp_more",""))),S.default.condition("is_layout_block")){var i=(0,w.default)((0,g.default)(S.default.topWindow(),"tinymce.AddOnManager.PluginManager.lookup",{})),u=(0,O.default)(o,(function(e){return!(0,v.default)(i,e)}));(0,p.default)((0,g.default)(S.default.topWindow(),"tinymce.AddOnManager.PluginManager.load"))&&(0,d.default)(u,(function(e){S.default.topWindow().tinymce.AddOnManager.PluginManager.load(e,"".concat((0,g.default)(S.default.appWindow(),"et_pb_custom.tinymce_uri"),"/plugins/").concat(e,"/plugin.min.js"))}))}var s=S.default.hasValue(ETBuilderBackend.mediaButtons)?{}:{display:"none"},f="html"===this.state.editorMode?r.default.createElement(r.default.Fragment,null,r.default.createElement("textarea",{id:this.ETBuilderControlTinyMCE,ref:"textarea",className:"et-fb-tinymce-html-input",value:n,onChange:y.default,onInput:this._onInputHTML,onScroll:this._onTextareaScroll,onFocus:this._onFocus,onBlur:this._onBlur}),r.default.createElement(E.default,{context:"code_html",updateContent:this.setTextareaContent,editor:this.uuid})):r.default.createElement(l.default,T({id:this.uuid,ref:"tinymce",content:n,config:a,onInit:this._onInit,onChange:this._onChange,onDoubleClick:this._onDoubleClick,onKeyup:this._onChange,onKeydown:this._onKeyDown,onLoadContent:this._loadtinyMCEContent,onSetContent:this._onChange,onFocus:this._onFocus,onBlur:this._onBlur},e)),h="no"!==x&&r.default.createElement("a",{href:"#",onClick:this.switchToVisual,className:this.setActiveModeClass("tinymce")},t.visual);return r.default.createElement("div",{id:"et-fb-".concat(this.props.name),className:"et-fb-tinymce-buttons"},r.default.createElement("button",{className:"et-fb-settings-option-upload-button et-fb-tinymce-add-media-button et-fb-tinymce-add-media-button--absolute",onClick:this.addMedia},ETBuilderBackend.i18n.controls.insertMedia.buttonText),r.default.createElement("span",{className:"et-fb-tinymce-media-buttons",id:"et-fb-tinymce-".concat(this.props.name,"-media-buttons"),style:s,dangerouslySetInnerHTML:{__html:ETBuilderBackend.mediaButtons}}),r.default.createElement("div",{className:"et-fb-switch-editor-mode"},h,r.default.createElement("a",{href:"#",onClick:this.switchToHtml,className:this.setActiveModeClass("html")},t.text)),f)},_loadtinyMCEContent:function(e,t){(0,f.default)((0,h.default)(this.state.content))||t.setContent(C.default.wpautop(this.processContent(this.state.content)),{format:"raw"})},_onKeyDown:function(e){var t=e.keyCode,n=e.metaKey,r=e.ctrlKey,o=e.altKey;(0,p.default)(KeyboardEvent)&&(83!==t||!n&&!r||o||(S.default.appDocument().dispatchEvent(new KeyboardEvent("keydown",{keyCode:t,metaKey:n,ctrlKey:r,bubbles:!0,cancelable:!0})),e.preventDefault()))},_onChange:function(e,t){if(!this.isUnmounting){var n=(0,c.default)(e.type)?"":e.type;if(!this.props.isItemSelected||!(0,v.default)(["loadcontent","setcontent"],n)){var r=t.getContent({format:"html"}).replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"),o=(0,f.default)(r)?r:C.default.wpautop(r);o="\n"===o.slice(-1)?o.slice(0,-1):o,this.setTextareaContent(o)}}},_onInit:function(e,t){this.editor=t,j&&(t.on("ExecCommand",(function(e){if("mceInsertLink"===e.command){var n=t.$('a[href="_wp_link_placeholder"]')[0];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})}})),t.on("wp-toolbar-toggle",(function(){S.default.$topWindow().trigger("wp-toolbar-toggle")})))},componentWillUnmount:function(){this.isUnmounting=!0,j&&S.default.$topWindow("html, body").removeClass("mce-fullscreen")},_onInputHTML:function(e){e.persist();var t=e.target.value;this.setTextareaContent(t)},_onTextareaScroll:function(t){var n=e(t.currentTarget).closest(".et-fb-tabs__panel");n.scrollTop()||n.scrollTop(1)},setTextareaContent:function(e){if(e!==this.getStateContent()&&e!==this.getPropsContent()){this.isEditing=!0;var t="content"===this.props.name;this.updateProps&&this.props._onChange(this.props.name,e,"",t),this.processedContent=!1,this.setState({content:e})}},getFrameTargetElement:function(e){if((0,s.default)(e))return!1;var t=e.contentWindow;return(0,c.default)(S.default.appWindow().pageYOffset)&&(t=t.document.documentElement?t.document.documentElement:t=document.body),t},_onFocus:function(e){(this.props.module||this.props.isPageSetting)&&k.default.quickAccessHide(!1,e)},_onBlur:function(e){if("html"===this.state.editorMode){if(e.target.value===this.getStateContent())return;this._onInputHTML(e)}},focus:function(){var e=this;if("html"===this.state.editorMode)S.default.$topWindow(this.refs.textarea).trigger("focus");else try{window.tinymce.EditorManager.get(this.uuid).focus()}catch(t){setTimeout((function(){return e.focus()}),100)}},activateEditor:function(){"tinymce"===this.state.editorMode&&S.default.appWindow().tinyMCE.setActive(this.editor),S.default.appWindow().wpActiveEditor=this.uuid,this.focus()},componentDidUpdate:function(){var e=this;setTimeout((function(){var t=S.default.$topWindow(a.default.findDOMNode(e.refs.tinymce)).parent().find("iframe");if(0!==t.length){var n=t.height(),r=t.contents().find("html");if(r.length>0){var o=r.innerHeight();n .wpview iframe { max-width: 100% !important; } .wpview { width: auto !important; }"),o.onwheel=function(e){var t,r=n.closest(".et-fb-tabs__panel--active"),o=!1,a=!1;if(t=r.find(".et-fb-form").outerHeight()||0,r.length>0&&(o=r.scrollTop()<1&&e.deltaY<1,a=r.scrollTop()>=t-r.height()&&e.deltaY>=0,o||a))return!1},S.default.$topWindow("#et-fb-".concat(this.props.name,", #et-fb-").concat(this.props.name," *, .et-fb-tinymce-media-buttons a")).on("click",(function(){t.activateEditor()}))):S.default.$topWindow(".et-fb-tinymce-media-buttons a").on("click",(function(){t.activateEditor()}))}});D.defaultProps={onModeSwitch:y.default,isReactClassApproved:{},name:""};var N=D;t.default=N}).call(this,n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={wpautop:function(e){var t="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary",n=!1,r=!1;return-1!==e.indexOf("/g,(function(e){return e.replace(/[\r\n]+/g,"")}))),-1===(e=e.replace(/<[^<>]+>/g,(function(e){return e.replace(/[\r\n]+/g," ")}))).indexOf("]*>[\s\S]+?<\/\1>/g,(function(e){return e.replace(/(\r\n|\n)/g,"")}))),-1!==e.indexOf("[caption")&&(r=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,(function(e){return(e=(e=e.replace(/]*)>/g,"")).replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,(function(e){return e.replace(/[\r\n\t]+/," ")}))).replace(/\s*\n\s*/g,"")}))),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e="".concat(e,"\n\n")).replace(/
\s*
/gi,"\n\n")).replace(new RegExp("(<(?:".concat(t,")(?: [^>]*)?>)"),"gi"),"\n$1")).replace(new RegExp("()"),"gi"),"$1\n\n")).replace(/]*)?>/gi,"\n\n")).replace(/\s*")).replace(/\r\n|\r/g,"\n")).replace(/\n\s*\n+/g,"\n\n")).replace(/([\s\S]+?)\n\n/g,"

$1

\n")).replace(/

\s*?<\/p>/gi,"")).replace(new RegExp("

\\s*(]*)?>)\\s*

"),"gi"),"$1")).replace(/

(/gi,"$1")).replace(/

\s*]*)>/gi,"

")).replace(/<\/blockquote>\s*<\/p>/gi,"

")).replace(new RegExp("

\\s*(]*)?>)"),"gi"),"$1")).replace(new RegExp("(]*)?>)\\s*

"),"gi"),"$1")).replace(/\s*\n/gi,"
\n")).replace(new RegExp("(]*>)\\s*
"),"gi"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1")).replace(/(?:

|
)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|
)*/gi,"[caption$1[/caption]")).replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,(function(e,t,n){return n.match(/]*)?>/)?e:"".concat(t,"

").concat(n,"

")})),n&&(e=e.replace(//g,"\n")),r&&(e=e.replace(/]*)>/g,"")),e},removep:function(e){var t="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset",n="".concat(t,"|div|p"),r="".concat(t,"|pre"),o=!1,a=!1;return e?(-1===e.indexOf("]*>[\s\S]+?<\/\1>/g,(function(e){return(e=(e=e.replace(/
(\r\n|\n)?/g,"")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"")).replace(/\r?\n/g,"")}))),-1!==e.indexOf("[caption")&&(a=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,(function(e){return e.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")}))),-1!==(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*\\s*"),"g"),"\n")).replace(new RegExp("\\s*<((?:".concat(n,")(?: [^>]*)?)>"),"g"),"\n<$1>")).replace(/(

]+>.*?)<\/p>/g,"$1")).replace(/]*)?>\s*

/gi,"\n\n")).replace(/\s*

/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/\s*
\s*/gi,"\n")).replace(/\s*

\s*/g,"
\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:".concat(r,")(?: [^>]*)?)\\s*>"),"g"),"\n<$1>")).replace(new RegExp("\\s*\\s*"),"g"),"\n")).replace(/]*)>/g,"\t")).indexOf("/g,"\n")),-1!==e.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==e.indexOf("/g,(function(e){return e.replace(/[\r\n]+/g,"")}))),e=(e=(e=(e=e.replace(/<\/p#>/g,"

\n")).replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(//g,"\n")),a&&(e=e.replace(/]*)>/g,"")),e):""}};t.default=r},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=h(n(0)),o=h(n(270)),a=h(n(16)),i=h(n(1)),l=h(n(40)),u=h(n(7)),s=h(n(11)),c=n(67),d=h(n(43)),f=h(n(63)),p=n(2);function h(e){return e&&e.__esModule?e:{default:e}}function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?r.length-1:0;n.updateOptions(t,o)}n._updateFrontEnd()}),0)},removeRow:function(e,t){t.preventDefault();var n=this,r=(0,p.isJson)(this.state.options)?JSON.parse(this.state.options):[];if(r.splice(e,1),0===r.length){var o="";for(var a in this.state.fieldValues)if(this.state.fieldValues.hasOwnProperty(a)){o=a;break}r=[{field:o,condition:"is",value:(0,i.default)(this,["state","fieldValues",o,0])}]}this.setState({options:JSON.stringify(r)}),setTimeout((function(){n._updateFrontEnd()}),0)},_fieldSelect:function(e,t){var n=this,o=this,a=this.props.module.props.module,l=a.parentModule.props.content,u="field".concat(e),s="condition".concat(e),c="value".concat(e),d=t.field,f=this.updateOptions.bind(this,e,d);return r.default.createElement("div",{className:"et-fb-settings-conditional-logic",key:e},r.default.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:this.updateSelected.bind(this,e),ref:function(e){return n[u]=e},value:t.field,disabled:this.props.readonly||!1},l.map((function(e,t){if(e.address!==a.props.address){var n=(0,i.default)(e,"attrs.field_id","");if(""!==n.trim()){n="et_pb_signup_custom_field"===o.state.moduleType?n:n.toLowerCase();var l=(0,i.default)(ETBuilderBackend,"componentDefinitions.fieldsDefaults.et_pb_contact_field.field_title[0]",""),u=(0,i.default)(e,"attrs.field_title",""),s=""!==l&&u===l?n:u;if(""!==s.trim())return r.default.createElement("option",{value:n,key:t},s)}}}))),r.default.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:f,ref:function(e){return n[s]=e},value:t.condition,disabled:this.props.readonly||!1},r.default.createElement("option",{value:"is"},ETBuilderBackend.i18n.controls.conditionalLogic.is),r.default.createElement("option",{value:"is not"},ETBuilderBackend.i18n.controls.conditionalLogic.isNot),r.default.createElement("option",{value:"is greater"},ETBuilderBackend.i18n.controls.conditionalLogic.isGreater),r.default.createElement("option",{value:"is less"},ETBuilderBackend.i18n.controls.conditionalLogic.isLess),r.default.createElement("option",{value:"contains"},ETBuilderBackend.i18n.controls.conditionalLogic.contains),r.default.createElement("option",{value:"does not contain"},ETBuilderBackend.i18n.controls.conditionalLogic.doesNotContain),r.default.createElement("option",{value:"is empty"},ETBuilderBackend.i18n.controls.conditionalLogic.isEmpty),r.default.createElement("option",{value:"is not empty"},ETBuilderBackend.i18n.controls.conditionalLogic.isNotEmpty)),this._fieldSelectValues(e,d,t.value,c,t.condition))},_fieldSelectValues:function(e,t,n,o,a){var i=this,l=(this.props.module.props.module.parentModule.props.content,this.state.fieldValues[t]);(0,s.default)(l)&&(l=[],(0,s.default)(this.state.fieldValues[0])||(l=this.state.fieldValues[0])),(0,s.default)(n)&&(n="");var c=!!(0,u.default)(["is empty","is not empty"],a);return 0===l.length?r.default.createElement("input",{className:"et-fb-settings-option-input et-fb-main-setting",type:"text",onChange:this.updateOptions.bind(this,e,t,!1,!1,!0),ref:function(e){return i[o]=e},disabled:c,value:n,readOnly:this.props.readonly||!1}):r.default.createElement("select",{className:"et-fb-settings-option-select et-fb-main-setting",onChange:this.updateOptions.bind(this,e,t),ref:function(e){return i[o]=e},disabled:c,value:n},l.map((function(e,t){return r.default.createElement("option",{value:e,key:t},e)})))},_optionsControls:function(){var e=this;return((0,p.isJson)(this.state.options)?JSON.parse(this.state.options):[]).map((function(t,n){var o=!e.props.readonly&&!e.props.hideDeleteButton&&r.default.createElement("a",{href:"#",className:"et_options_list_remove",onClick:e.removeRow.bind(e,n)},r.default.createElement(d.default,{icon:"delete",color:"rgb(163, 176, 194)"}));return r.default.createElement("div",{className:"et_options_list_row et_condition_row",key:n},e._fieldSelect(n,t),o)}))},render:function(){var e=this.props.additional_attrs?this.props.additional_attrs:{},t=this.addRow.bind(this,!1,!1),n=!this.props.readonly&&!this.props.hideAddButton&&r.default.createElement("span",{className:"et-fb-item-button-wrap--add"},r.default.createElement(c.Motion,{defaultStyle:{size:.5,opacity:0},style:{size:(0,c.spring)(1,{stiffness:300,damping:20}),opacity:(0,c.spring)(1,{stiffness:300,damping:20})}},(function(e){return r.default.createElement(f.default,{round:!0,style:{opacity:e.opacity,transform:"scale( ".concat(e.size," )")},tooltip:ETBuilderBackend.i18n.controls.moduleItem.addNew,_onClick:t},r.default.createElement(d.default,{size:"14",icon:"add",color:"#FFFFFF"}))})));return r.default.createElement("div",{className:"et_options_list"},this._optionsControls(),r.default.createElement("textarea",m({value:this.state.options,name:this.props.name,id:"et-fb-".concat(this.props.name),onChange:l.default},e)),n)},_updateFrontEnd:function(){var e=this;setTimeout((function(){e.props._onChange(e.props.name,e.state.options,e.props.type)}),0)}});t.default=y}).call(this,n(2))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(0)),o=u(n(270)),a=u(n(16)),i=u(n(1)),l=u(n(43));function u(e){return e&&e.__esModule?e:{default:e}}n(1694);var s=(0,o.default)({displayName:"ETBuilderSelectAnimation",mixins:[a.default],render:function(){var e={none:ETBuilderBackend.i18n.controls.selectAnimation.none,fade:ETBuilderBackend.i18n.controls.selectAnimation.fade,slide:ETBuilderBackend.i18n.controls.selectAnimation.slide,bounce:ETBuilderBackend.i18n.controls.selectAnimation.bounce,zoom:ETBuilderBackend.i18n.controls.selectAnimation.zoom,flip:ETBuilderBackend.i18n.controls.selectAnimation.flip,fold:ETBuilderBackend.i18n.controls.selectAnimation.fold,roll:ETBuilderBackend.i18n.controls.selectAnimation.roll},t=Object.keys(e),n=this;return r.default.createElement("div",{className:"et_select_animation"},t.map((function(t,o){var a="";t===n.props.value&&(a="et_active_animation");var u="animation-".concat(t),s=(0,i.default)(e,t,e.none);return r.default.createElement("div",{className:"et_animation_button",key:o},r.default.createElement("a",{href:"#",className:a,onClick:n._onClick.bind(n,t)},r.default.createElement("span",{className:"et_animation_button_title","data-value":t,key:o},s),r.default.createElement("span",{className:"et_animation_button_icon"},r.default.createElement(l.default,{icon:u}))))})))},_onClick:function(e,t){t.preventDefault(),this.props._onChange(this.props.name,e)}});t.default=s},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(0)),o=a(n(1505));function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}t.default=function(e){var t=e.src,n=l(e,a);return o.default.createElement("video",i({},n,{src:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(0)),o=u(n(797)),a=u(n(1497)),i=n(785),l=["src"];function u(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}t.default=function(e){var t,n,u=e.src,d=c(e,l);return r.default.createElement(a.default,s({},d,{src:(t=u,(0,i.setArgs)((0,o.default)("v",(0,i.getArgs)(t)),(n=function(e){var t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&11===t[2].length?t[2]:void 0}(t),"https://www.youtube.com/embed/".concat(n))))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(0)),o=c(n(196)),a=c(n(793)),i=c(n(393)),l=c(n(1497)),u=n(785),s=["src"];function c(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=(0,o.default)(a.default,(0,i.default)("/"),u.clearArgs);t.default=function(e){var t,n,o=e.src,a=f(e,s);return r.default.createElement(l.default,d({},a,{src:(t=o,(0,u.setArgs)((0,u.getArgs)(t),(n=p(t),"https://player.vimeo.com/video/".concat(n)))),frameBorder:"0"}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=c(n(0)),o=c(n(196)),a=c(n(793)),i=c(n(393)),l=c(n(1497)),u=n(785),s=["src"];function c(e){return e&&e.__esModule?e:{default:e}}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=(0,o.default)(a.default,(0,i.default)("/"),u.clearArgs);t.default=function(e){var t,n,o=e.src,a=f(e,s);return r.default.createElement(l.default,d({},a,{src:(t=o,(0,u.setArgs)((0,u.getArgs)(t),(n=p(t),"https://www.dailymotion.com/embed/video/".concat(n)))),frameBorder:"0"}))}},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=O(n(3));n(1705);var i=O(n(28)),l=O(n(196)),u=O(n(798)),s=O(n(508)),c=O(n(47)),d=O(n(215)),f=O(n(393)),p=O(n(786)),h=O(n(799)),m=O(n(822)),y=O(n(796)),g=O(n(1706)),b=O(n(1710)),v=n(1544),_=O(n(1713)),w=O(n(1714));function O(e){return e&&e.__esModule?e:{default:e}}function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function S(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function h(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:i,t=o.default.$topWindow(".et-cloud-item-editor").length>0;t&&o.default.$topWindow("body").addClass("et-bp-settings-hide-settings-modal");var n=t?o.default.appWindow():o.default.topWindow(),a=n.wp.media({library:{type:e.mediaTypes},multiple:!!e.multiple&&"add"}),l=function(e){return e(a.state().get("selection").map((0,r.default)("attributes")))};return a.on("open",(function(){var t=a.state().get("selection");e.selected.map((function(e){return t.add(o.default.topWindow().wp.media.attachment(e))}))})),a.on("close",(function(){o.default.$topWindow("body").removeClass("et-bp-settings-hide-settings-modal")})),a.open(),new Promise((function(e){return a.on("select",(function(t){return l(e)}))}))}},function(e,t,n){var r=n(54)("find",n(58));r.placeholder=n(48),e.exports=r},function(e,t,n){var r=n(54)("noop",n(40),n(130));r.placeholder=n(48),e.exports=r},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=p(n(3)),i=n(67),l=p(n(5)),u=p(n(34)),s=p(n(1)),c=p(n(43)),d=p(n(1544)),f=p(n(303));function p(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function m(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"thumbnail";return(0,d.default)(e).then((function(e){var n=(0,s.default)(e,"guid","");return t&&(0,u.default)(e,"metadata.".concat(t,".0"))?(0,s.default)(e,"metadata.".concat(t,".0"),n):n}))},O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(u,e);var t,n,r,a=g(u);function u(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(e=a.call(this)).state={url:null,active:!1},e.setUrl=e.setUrl.bind(v(e)),e.onMouseOver=e.onMouseOver.bind(v(e)),e.onMouseLeave=e.onMouseLeave.bind(v(e)),e.onRemove=e.onRemove.bind(v(e)),e}return t=u,(n=[{key:"onMouseOver",value:function(){this.setState({active:!0})}},{key:"onMouseLeave",value:function(){this.setState({active:!1})}},{key:"onRemove",value:function(e){e.preventDefault(),this.props.onRemove&&this.props.onRemove(this.props.id)}},{key:"componentDidMount",value:function(){w(this.props.id).then(this.setUrl)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=e.id;this.props.id!==t&&w(t).then(this.setUrl)}},{key:"setUrl",value:function(e){this.setState({url:e})}},{key:"renderDelete",value:function(){var e=this,t={opacity:this.state.active?(0,i.spring)(1,{stiffness:300,damping:20}):(0,i.spring)(0,{stiffness:300,damping:20}),scale:this.state.active?(0,i.spring)(1,{stiffness:300,damping:20}):(0,i.spring)(0,{stiffness:300,damping:20}),top:this.state.active?(0,i.spring)(5,{stiffness:300,damping:20}):(0,i.spring)(-10,{stiffness:300,damping:20}),right:this.state.active?(0,i.spring)(5,{stiffness:300,damping:20}):(0,i.spring)(-10,{stiffness:300,damping:20})};return o.default.createElement(i.Motion,{style:t},(function(t){return o.default.createElement("button",{className:"et-fb-control-images-upload--item-delete",onClick:e.onRemove,style:{opacity:t.opacity,transform:"scale( ".concat(t.scale," )"),top:t.top}},o.default.createElement(c.default,{icon:"delete",color:"#fff"}))}))}},{key:"renderLoading",value:function(){return o.default.createElement("div",{className:"et-fb-control-images-upload--item-wrapper loading"},o.default.createElement("div",{className:"et-fb-control-images-upload--item",onMouseOver:this.onMouseOver,onMouseOut:this.onMouseLeave},o.default.createElement(f.default,{isLoading:!0})),!this.props.readonly&&this.renderDelete())}},{key:"renderAttachment",value:function(){return o.default.createElement("div",{className:"et-fb-control-images-upload--item-wrapper"},o.default.createElement("div",{className:"et-fb-control-images-upload--item",style:{backgroundImage:"url(".concat(this.state.url,")")},onMouseOver:this.onMouseOver,onMouseOut:this.onMouseLeave},!this.props.readonly&&this.renderDelete()))}},{key:"render",value:function(){return(0,l.default)(this.state.url)?this.renderLoading():this.renderAttachment()}}])&&m(t.prototype,n),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(o.Component);O.propTypes={id:a.default.number,onRemove:a.default.func};var k=O;t.default=k},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(0)),o=a(n(43));function a(e){return e&&e.__esModule?e:{default:e}}n(1715);t.default=function(e){var t=e.onClick,n=e.title;return!e.readonly&&r.default.createElement("div",{className:"et-fb-add-media",onClick:t},r.default.createElement("div",{className:"et-fb-add-media--container"},r.default.createElement("div",{className:"et-fb-add-media--button"},r.default.createElement(o.default,{icon:"add",color:"#fff"})),r.default.createElement("label",{className:"et-fb-add-media--title et-fb-form__label"},n)))}},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=_(n(0)),a=_(n(13)),i=_(n(11)),l=_(n(5)),u=_(n(35)),s=_(n(12)),c=_(n(4)),d=_(n(148)),f=(_(n(34)),_(n(1))),p=_(n(31)),h=_(n(40)),m=_(n(41)),y=_(n(63)),g=_(n(22)),b=_(n(6)),v=n(2);function _(e){return e&&e.__esModule?e:{default:e}}function w(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=this._getFieldByTemplate(e);return n?this._getAttrs(n.name,t):null}},{key:"_getAttrs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this._getModuleAttrs(),r=this._getFieldEnablePair(e);if(r){var o=this._getAttrs(r.name,t);if("off"===o)return""}return t?(0,c.default)(n,this._getFieldNameByMode(e),this._getDefault(e)):(0,c.default)(n,this._getFieldNameByMode(e))}},{key:"_getDefault",value:function(e){var t=J.default.getBaseName(e),n=this._getField(t),r=(0,c.default)(n,"default"),o=this._getModuleAttrs(),a=J.default.getDesktopValue(t,o);if(n.mobile_options&&J.default.isResponsiveMode()&&J.default.isResponsiveEnabled(this._getBackgroundBase(),o)){var i=J.default.getTabletValue(t,o,a);return J.default.isPhoneMode()?Q.default.get(i,r):Q.default.get(a,r)}return"tabs"===n.hover&&J.default.isHoverMode()&&J.default.isHoverEnabled(this._getBackgroundBase(),o)||n.sticky&&J.default.isStickyMode()&&J.default.isStickyEnabled(this._getBackgroundBase(),o)?Q.default.get(a,r):r}},{key:"_getBackgroundBase",value:function(){return J.default.getBaseName(this.props.name)||"background"}},{key:"_getFieldNameByMode",value:function(e){var t=this._getModuleAttrs(),n=J.default.getBaseName(e),r=this._getField(n);return r?r.mobile_options&&J.default.isResponsiveMode()&&J.default.isResponsiveEnabled(this._getBackgroundBase(),t)?J.default.isPhoneMode()?J.default.getPhoneName(n):J.default.getTabletName(n):"tabs"===r.hover&&J.default.isHoverMode()&&J.default.isHoverEnabled(this._getBackgroundBase(),t)?J.default.getHoverName(n):r.sticky&&J.default.isStickyMode()&&J.default.isStickyEnabled(this._getBackgroundBase(),t)?J.default.getStickyName(n):n:e}},{key:"_getFieldEnablePair",value:function(e){var t=this._getFieldTemplate(e);return!!(0,f.default)(["color","image","mask_style","pattern_style","video_mp4","video_webm"],t)&&this._getFieldByTemplate("enable_".concat(t))}},{key:"_getFieldByTemplate",value:function(e){return e&&(0,u.default)(this._getFields(),(function(t){return t.field_template===e}))}},{key:"_getFieldTemplate",value:function(e){return(0,c.default)(this._getField(J.default.getBaseName(e)),"field_template","")}},{key:"_getField",value:function(e){return(0,c.default)(this._getFields(),J.default.getBaseName(e))}},{key:"_getFields",value:function(){var e=this;if(!(0,h.default)(this._backgroundFields))return this._backgroundFields;var t=[],n=this.props.backgroundFields||this.props.background_fields||{};if((0,s.default)(n,(function(e,r){var o=ie({name:r},e),a=(0,k.default)(n,(function(t){var n=t.affects_template;return(0,f.default)(n,e.field_template)}));if(!(0,h.default)(a)){var i=(0,_.default)(a);(0,d.default)(o,"depends_on")?o.depends_on=(0,E.default)([].concat(re(o.depends_on),re(i))):o.depends_on=i}t.push(o)})),this._backgroundFields={},!(0,h.default)(t)){var r=(0,O.default)(t,["priority"]);(0,s.default)(r,(function(t){e._backgroundFields[t.name]=t}))}return this._backgroundFields}},{key:"_getActiveTab",value:function(){var e=this,t=(0,u.default)((0,_.default)(this._getTabsNotEmpty()),(function(t){return!e._isTabDisabled(t)&&t===e.state.activeTab}));return t||this.defaultTab}},{key:"_getTabs",value:function(){var e=this;return(0,h.default)(this._tabs)?(this._tabs={},(0,s.default)(ETBuilderBackend.backgroundTabs,(function(t){e._tabs[t]=(0,k.default)(e._getFields(),(function(e){return e.background_tab===t}))})),this._tabs):this._tabs}},{key:"_getTabsNotEmpty",value:function(){return(0,k.default)(this._getTabs(),(function(e){return!(0,h.default)(e)}))}},{key:"_getGradientPreviewStyle",value:function(e){var t=this,n=this.state,r=n.parsedGradient,o=(n.unit,{});return(0,s.default)(Q.default.gradientFieldsMapping(),(function(n,a){var i=t._getAttrsByTemplate(n,e);(0,g.default)(i)||((0,f.default)(["colorStart","colorEnd"],a)?o[a]=K.default.getColorValue(i)||i:o[a]="stops"===a?(0,x.toGradientString)(r,!0):i)})),o}},{key:"_getImagePreviewStyle",value:function(e){var t=this,n={};(0,s.default)(["color","size","image_width","image_height","position","horizontal_offset","vertical_offset","repeat","blend","parallax"],(function(r){var o=t._getAttrsByTemplate(r,e);(0,g.default)(o)||(n[r]="parallax"===r?(0,N.isOn)(o):o)}));var r=this._getAttrsByTemplate("use_color_gradient",e),o=this._getAttrsByTemplate("color_gradient_overlays_image",e);if((0,N.isOn)(r)){var a=this._getGradientPreviewStyle(e),i=K.default.getColors();a&&(n.gradient=Q.default.getGradient(a,i),n.gradientOverlaysImage=o)}return n}},{key:"_getImageField",value:function(){var e=this._getFieldByTemplate("image");if(e){var t=this._getAttrs(e.name,!0)||"";return{name:e.name,dynamic:(0,D.isDynamicContent)(t),value:t}}return{name:"background_image",value:"",dynamic:!1}}},{key:"_getVideoNode",value:function(){var e=this._getAttrsByTemplate("video_mp4",!0),t=this._getAttrsByTemplate("video_webm",!0),n=e||t;return(0,N.hasValue)(n)?o.default.createElement(Z.default,{className:"et-fb-settings-option-preview-content",loop:"loop",muted:"muted",autoPlay:"autoplay",height:190,style:{width:"100%",background:"rgb(51, 59, 68)"},src:(0,L.setArgs)({width:500,controls:0,fs:0,iv_load_policy:3,modestbranding:1,showinfo:0},n)}):null}},{key:"_getPatternPreviewStyle",value:function(){var e=!0,t=(0,N.isOn)(this._getAttrsByTemplate("enable_pattern_style",e)),n=this._getAttrsByTemplate("pattern_style",e),r={};if(t&&(0,N.hasValue)(n)){var o=this._getAttrsByTemplate("pattern_color",e),a=this._getAttrsByTemplate("pattern_repeat",e),i=this._getAttrsByTemplate("pattern_blend_mode",e),l=this._getAttrsByTemplate("pattern_transform",e),u=(0,j.getTransformState)(l,"horizontal"),s=(0,j.getTransformState)(l,"vertical"),c=(0,j.getTransformState)(l,"rotate"),d=(0,j.getTransformState)(l,"invert"),f=(0,M.getSvgPattern)(n,o,"default",c,d);r={backgroundImage:'url("data:image/svg+xml;utf8,'.concat(f,'")'),mixBlendMode:i,transform:(0,j.getTransformCSS)(u,s)};var p=this._getAttrsByTemplate("pattern_size",e),h=this._getAttrsByTemplate("pattern_width",e),m=this._getAttrsByTemplate("pattern_height",e),y=(0,j.getBackgroundSizeCss)(p,h,m);if(y.size&&(r.backgroundSize=y.size),(0,N.hasValue)(p)&&"stretch"!==p&&(r.backgroundRepeat=a,(0,N.hasValue)(a)&&"space"!==a)){var g=this._getAttrsByTemplate("pattern_horizontal_offset",e),b=this._getAttrsByTemplate("pattern_vertical_offset",e),v=this._getAttrsByTemplate("pattern_repeat_origin",e),_=(0,j.getBackgroundPositionCss)(v,g,b);r.backgroundPosition=_.position}}return r}},{key:"_getMaskPreviewStyle",value:function(){var e=!0,t=(0,N.isOn)(this._getAttrsByTemplate("enable_mask_style",e)),n=this._getAttrsByTemplate("mask_style",e),r={};if(t&&(0,N.hasValue)(n)){var o=this._getAttrsByTemplate("mask_color",e),a=this._getAttrsByTemplate("mask_aspect_ratio",e),i=this._getAttrsByTemplate("mask_blend_mode",e),l=this._getAttrsByTemplate("mask_transform",e),u=(0,j.getTransformState)(l,"horizontal"),s=(0,j.getTransformState)(l,"vertical"),c=(0,j.getTransformState)(l,"rotate"),d=(0,j.getTransformState)(l,"invert"),f=this._getAttrsByTemplate("mask_size",e),p=this._getAttrsByTemplate("mask_width",e),h=this._getAttrsByTemplate("mask_height",e),m=(0,j.getBackgroundSizeCss)(f,p,h,"mask"),y=(0,M.getSvgMask)(n,o,a,c,d,f);if(r={backgroundImage:'url("data:image/svg+xml;utf8,'.concat(y,'")'),backgroundRepeat:"no-repeat",backgroundSize:m.size?m.size:"100% 100%",mixBlendMode:i,transform:(0,j.getTransformCSS)(u,s)},(0,N.hasValue)(f)&&"stretch"!==f){var g=this._getAttrsByTemplate("mask_horizontal_offset",e),b=this._getAttrsByTemplate("mask_vertical_offset",e),v=this._getAttrsByTemplate("mask_position",e),_=(0,j.getBackgroundPositionCss)(v,g,b);r.backgroundPosition=_.position}}return r}},{key:"_isTabDisabled",value:function(e){var t=this.props.isColumnBackground&&"color"!==e,n=this._getBackgroundBase(),r=this._getModuleAttrs();return!!(t&&J.default.isHoverMode()&&J.default.isHoverEnabled(n,r))||!!(t&&J.default.isStickyMode()&&J.default.isStickyEnabled(n,r))}},{key:"_isTabFilled",value:function(e){var t=this;if(this._isTabDisabled(e))return!1;var n=(0,k.default)(this._getFields(),(function(t){return t.background_tab===e&&t.tab_filler}));return!(0,h.default)(n)&&(0,S.default)(n,(function(e){var n=e.field_template,r=t._getAttrs(e.name,!0);return"use_color_gradient"===n?(0,N.isOn)(r):(!(0,f.default)(["pattern_style","mask_style"],n)||""!==r)&&(0,N.hasValue)(r)}))}},{key:"_isFieldHidden",value:function(e){var t=this;if(this.props.moduleAttrs,(0,f.default)(["color_gradient_start","color_gradient_end"],(0,c.default)(e,"field_template")))return!0;if(!(0,d.default)(e,"show_if")&&!(0,d.default)(e,"show_if_not")&&!(0,d.default)(e,"depends_on"))return!1;var n=function(){if((0,d.default)(e,"show_if"))return(0,S.default)(e.show_if,(function(e,n){var r=t._getField(n);if(!r||!e)return!1;if(t._isFieldHidden(r))return!1;var o=(0,p.default)(e)?e:[e],a=t._getAttrs(r.name,!0);return!!(0,f.default)(o,a)}))},r=function(){if((0,d.default)(e,"show_if_not"))return(0,S.default)(e.show_if_not,(function(e,n){var r=t._getField(n);if(!r||!e)return!1;if(t._isFieldHidden(r))return!0;var o=(0,p.default)(e)?e:[e],a=t._getAttrs(r.name,!0);return!(0,f.default)(o,a)}))};return(0,d.default)(e,"show_if")&&(0,d.default)(e,"show_if_not")?!(n()&&r()):(0,d.default)(e,"show_if")?!n():(0,d.default)(e,"show_if_not")?!r():(0,S.default)(e.depends_on,(function(n){var r=t._getField(n);if(!r)return!1;if((0,d.default)(r,"depends_on")&&t._isFieldHidden(r))return!0;var o=t._getAttrs(r.name,!0);return!(!(0,d.default)(e,"depends_show_if")||(0,f.default)(e.depends_show_if,o))||!(!(0,d.default)(e,"depends_show_if_not")||!(0,f.default)(e.depends_show_if_not,o))}))}},{key:"_normalizeField",value:function(e){var t=this,n=this.props,r=n.animate,o=n.module,a=n.moduleAttrs,i=ie(ie({},e),{},{controlType:e.type,value:this._getAttrs(e.name,!0),default:this._getDefault(e.name),animate:r,module:o,moduleAttrs:a,_onChange:this._onChange});if("color"===i.field_template&&(i.disableCurrent=!1,i.hasPreview=!0,i.hasColorManager=!0,i.showPickerPalettes=!1,i.hidePickerOnPaletteSelect=!0,i.hidePaletteOnPickerActive=!1,i.addTitle=A.default.getI18n("controls.background.addColor"),X.default.isHoverMode()&&(i.name="".concat(i.name,"__hover"))),"use_color_gradient"===i.field_template){var l=this._getGradientPreviewStyle(!0),u=this._getFieldByTemplate(Q.default.gradientFieldsMapping("stops"));i.controlType="gradient",i.stopsField=null==u?void 0:u.name,i.hasPreview=!0,i.addTitle=A.default.getI18n("controls.background.addGradient"),i._onChange=this._onChangeGradient,i._onMouseEnter=this._onMouseEnterFormGroupGradient,i._onMouseLeave=this._onMouseLeaveFormGroupGradient;var s=this._getAttrsByTemplate("use_color_gradient",!0);(0,N.isOn)(s)?(i.value=l,i.hideResetButton=!u||t._getDefault(u.name)===l.stops,i.activeGradientStop=this._getGradientActiveStop(),i.parsedGradient=this._getParsedGradient(),i._onGradientStopClick=this._onGradientStopClick):i.value=""}else if("color_gradient_stops"===i.field_template){var c=this._getGradientPreviewStyle(!0),d=this._getFieldByTemplate(Q.default.gradientFieldsMapping("stops")),p=this._getAttrsByTemplate("use_color_gradient",!0);(0,N.isOn)(p)&&(i.stopsField=null==d?void 0:d.name,i.getParsedGradient=this._getParsedGradient,i.stringValue=c.stops,i.activeGradientStop=this._getGradientActiveStop(),i.parsedGradient=this._getParsedGradient(),i.unit=this._getGradientUnit(),i._onGradientStopClick=this._onGradientStopClick)}if("image"===i.field_template&&(i.addTitle=A.default.getI18n("controls.background.addImage"),i.isBackgroundType=!0,i.imagePreviewAttrs=this._getImagePreviewStyle(!0)),(0,f.default)(["video_mp4","video_webm"],i.field_template)&&(i.addTitle=A.default.getI18n("controls.background.addVideo")),(0,f.default)(["pattern_style","mask_style"],i.field_template)){var h="select-pattern"===i.controlType?"addPattern":"addMask",m="select-pattern"===i.controlType?"pattern":"mask";i.addTitle=A.default.getI18n("controls.background.".concat(h)),i.transformValues=this._getAttrsByTemplate("".concat(m,"_transform"),!0),i.imageField=this._getImageField(),i.imagePreviewAttrs=this._getImagePreviewStyle(!0),i.videoNode=this._getVideoNode(),i.patternPreviewStyle=this._getPatternPreviewStyle(),i.maskPreviewStyle=this._getMaskPreviewStyle(),i._onChange=this._onChangeSvg}return i}},{key:"_renderTabNavs",value:function(e){var t=this,n=this._getActiveTab(),r=(0,l.default)(["et-fb-settings-background-tab-navs","et-fb-settings-background-tab-navs-items--".concat((0,_.default)(e).length)]),a="et-fb-settings-background-tab-nav",u=ETBuilderBackend.i18n.controls.background;return o.default.createElement("ul",{className:r},(0,_.default)(e).map((function(e){var r=["".concat(a,"--").concat(e),a];t._isTabDisabled(e)&&r.push("".concat(a,"--disabled"));var s=n===e,c=t._isTabFilled(e);s&&r.push("".concat(a,"--active"));var d=s||c?R.default.info:R.default.inactiveGrey;return o.default.createElement("li",{key:e},o.default.createElement("button",{className:(0,l.default)(r),name:e,"data-tab":e,"data-tip":u[e],"data-index":e,"data-for":"styles-background-tab-tooltip-".concat(e),onClick:t._onClickTabNav,onMouseEnter:t._onMouseEnterTabNav,onMouseLeave:t._onMouseLeaveTabNav},o.default.createElement(U.default,{icon:"background-".concat(e),color:d}),o.default.createElement(i.default,{id:"styles-background-tab-tooltip-".concat(e)})))})))}},{key:"_renderTabs",value:function(e){var t=this,n=this._getActiveTab(),r="et-fb-settings-background-tab";return(0,w.default)(e,(function(e,a){if(n!==a)return!1;var i=[r,"".concat(r,"--").concat(a),"".concat(r,"--active")];return o.default.createElement("div",{key:a,className:(0,l.default)(i)},t._renderFields(e,a))}))}},{key:"_renderFields",value:function(e){var t=this;return(0,w.default)(e,(function(e){var n=e.name||"";if(!n)return!1;var r=t._normalizeField(e);if(!r)return!1;var a=r.controlType||"";if(!a||!(0,d.default)(he,a))return!1;if(t._isFieldHidden(r))return!1;var i=["et-fb-settings-options","et-fb-option--".concat(r.type.replace("_","-"))];return(0,v.default)(r.depends_default)&&(0,v.default)(r.depends_show_if)&&(0,v.default)(r.depends_show_if_not)||i.push("et-fb-option--depends-on"),o.default.createElement(T.ETBuilderFormGroup,{key:"general-form-group-".concat(n),className:(0,l.default)(pe({},"et-fb-form__group--".concat(n),!0)),name:n,onMouseEnterGroup:t._onMouseEnterFormGroup,onMouseLeaveGroup:t._onMouseLeaveFormGroup,isGlobalOptionSynced:r.isGlobalOptionSynced,isSelectiveSyncAvailable:r.isSelectiveSyncAvailable,_unsyncGlobalSetting:r._unsyncGlobalSetting},t._renderFieldLabel(r,n),t._renderFieldDescription(r,n),o.default.createElement("div",{key:"et-fb-option-advanced_".concat(n),className:(0,l.default)(i)},o.default.createElement("div",{key:"et-fb-option-container-".concat(n),className:"et-fb-option-container"},t._renderControl(r,n))))}))}},{key:"_renderFieldLabel",value:function(e,t){if(!e.label||(0,f.default)(["color","use_color_gradient","image","pattern_style","mask_style"],e.field_template))return!1;var n=(0,N.hasValue)(e.description),r=this.props.isResetActive(e),a=this.props.isHoveredGroup(e.name),i=n&&this.props.isDescriptionVisible(e.name),l=!!n&&this.props.onClickHelp;return o.default.createElement(T.ETBuilderFormLabel,{key:"general-form-label-".concat(t),name:e.name,hoveredGroup:a,isResetActive:r,activeHelp:i,onClickHelp:l,onClickReset:this.props.onClickReset,onToggleRightMenu:this.props.onToggleRightMenu},e.label)}},{key:"_renderFieldDescription",value:function(e,t){return!(!e.description||(0,f.default)(["color","use_color_gradient","image"],e.field_template))&&o.default.createElement(T.ETBuilderFormDescription,{key:"general-form-description-".concat(t),active:this.props.isDescriptionVisible(e.name)},e.description)}},{key:"_renderControl",value:function(e,t){var n=e.controlType||"";return!(!n||!(0,d.default)(he,n))&&("image"===e.field_template?this._renderControlDynamic(e,t):o.default.createElement(he[n],ie({key:t},e)))}},{key:"_renderControlDynamic",value:function(e,t){var n=e.controlType||"";if(!n||!(0,d.default)(he,n))return!1;var r=e.value||"",a=this._getFieldNameByMode(e.name),i=(0,D.getEnabledDynamicAttributes)(this._getModuleAttrs()),l=!J.default.isDesktopMode()&&!(0,m.default)(e.value,e.default);return(0,D.isDynamicContent)(r)&&!(0,f.default)(i,a)&&i.push(a),o.default.createElement(G.default,{key:t,type:"image",previewMode:"background",fieldName:a,fieldType:e.type,value:r,previewAttributes:e.imagePreviewAttrs,dynamicAttributes:i,showInheritButton:l,onChange:this._onChange,onReset:this._onResetDynamic,onInherit:this._onInheritDynamic},o.default.createElement(he[n],ie({key:t},e)))}},{key:"render",value:function(){var e=this._getTabsNotEmpty();return!(0,h.default)(e)&&o.default.createElement("div",null,this._renderTabNavs(e),o.default.createElement("div",{className:"et-fb-settings-background-tabs"},this._renderTabs(e)))}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.moduleAttrs,r=t.activeGradientStop,o=(t.parsedGradient,t.stops),a=(t.unit,t.fieldNameGradientStops);if(t.fieldNameGradientUnit,"on"===n[t.fieldNameUseGradient]){var i=n[a]!==o;if(!r&&i)return{stops:n[a]}}return null}}],n&&le(t.prototype,n),r&&le(t,r),Object.defineProperty(t,"prototype",{writable:!1}),I}(o.Component);me.propTypes={name:a.default.string,activeTab:a.default.string,toggle_slug:a.default.string,tab_slug:a.default.string,isColumnBackground:a.default.bool,readonly:a.default.bool,animate:a.default.bool,moduleAttrs:a.default.object,backgroundFields:a.default.object,background_fields:a.default.object,_onChange:a.default.func,onMouseEnterGroup:a.default.func,onMouseLeaveGroup:a.default.func,isResetActive:a.default.func,isHoveredGroup:a.default.func,isDescriptionVisible:a.default.func,onClickReset:a.default.func,onClickHelp:a.default.func,onToggleRightMenu:a.default.func};var ye=me;t.default=ye},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=m(n(3)),i=m(n(215)),l=m(n(42)),u=m(n(40)),s=n(282),c=m(n(1722)),d=m(n(1546)),f=m(n(1727)),p=m(n(403)),h=n(783);function m(e){return e&&e.__esModule?e:{default:e}}function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t||n<0||d&&e-s>=a}function y(){var e=V();if(m(e))return g(e);l=setTimeout(y,function(e){var n=t-(e-u);return d?H(n,a-(e-s)):n}(e))}function g(e){return l=void 0,f&&r?p(e):(r=o=void 0,i)}function b(){var e=V(),n=m(e);if(r=arguments,o=this,u=e,n){if(void 0===l)return h(u);if(d)return clearTimeout(l),l=setTimeout(y,t),p(u)}return void 0===l&&(l=setTimeout(y,t)),i}return t=U(t)||0,W(n)&&(c=!!n.leading,a=(d="maxWait"in n)?G(U(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),b.cancel=function(){void 0!==l&&clearTimeout(l),s=0,r=u=o=l=void 0},b.flush=function(){return void 0===l?i:g(V())},b},q=z,K=c;var $=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return K(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),q(e,t,{leading:r,maxWait:t,trailing:o})},Y=function(e,t,n,r){switch(t){case"debounce":return z(e,n,r);case"throttle":return $(e,n,r);default:return e}},X=function(e){return"function"==typeof e},J=function(){return"undefined"==typeof window},Q=function(e){return e instanceof Element||e instanceof HTMLDocument},Z=function(e,t,n,r){return function(o){var a=o.width,i=o.height;t((function(t){return t.width===a&&t.height===i||t.width===a&&!r||t.height===i&&!n?t:(e&&X(e)&&e(a,i),{width:a,height:i})}))}},ee=function(e){function t(t){var n=e.call(this,t)||this;n.cancelHandler=function(){n.resizeHandler&&n.resizeHandler.cancel&&(n.resizeHandler.cancel(),n.resizeHandler=null)},n.attachObserver=function(){var e=n.props,t=e.targetRef,r=e.observerOptions;if(!J()){t&&t.current&&(n.targetRef.current=t.current);var o=n.getElement();o&&(n.observableElement&&n.observableElement===o||(n.observableElement=o,n.resizeObserver.observe(o,r)))}},n.getElement=function(){var e=n.props,t=e.querySelector,r=e.targetDomEl;if(J())return null;if(t)return document.querySelector(t);if(r&&Q(r))return r;if(n.targetRef&&Q(n.targetRef.current))return n.targetRef.current;var a=Object(o.findDOMNode)(n);if(!a)return null;switch(n.getRenderType()){case"renderProp":case"childFunction":case"child":case"childArray":return a;default:return a.parentElement}},n.createResizeHandler=function(e){var t=n.props,r=t.handleWidth,o=void 0===r||r,a=t.handleHeight,i=void 0===a||a,l=t.onResize;if(o||i){var u=Z(l,n.setState.bind(n),o,i);e.forEach((function(e){var t=e&&e.contentRect||{},r=t.width,o=t.height;!n.skipOnMount&&!J()&&u({width:r,height:o}),n.skipOnMount=!1}))}},n.getRenderType=function(){var e=n.props,t=e.render,o=e.children;return X(t)?"renderProp":X(o)?"childFunction":Object(r.isValidElement)(o)?"child":Array.isArray(o)?"childArray":"parent"};var a=t.skipOnMount,i=t.refreshMode,l=t.refreshRate,u=void 0===l?1e3:l,s=t.refreshOptions;return n.state={width:void 0,height:void 0},n.skipOnMount=a,n.targetRef=Object(r.createRef)(),n.observableElement=null,J()||(n.resizeHandler=Y(n.createResizeHandler,i,u,s),n.resizeObserver=new window.ResizeObserver(n.resizeHandler)),n}return i(t,e),t.prototype.componentDidMount=function(){this.attachObserver()},t.prototype.componentDidUpdate=function(){this.attachObserver()},t.prototype.componentWillUnmount=function(){J()||(this.observableElement=null,this.resizeObserver.disconnect(),this.cancelHandler())},t.prototype.render=function(){var e,t=this.props,n=t.render,o=t.children,a=t.nodeType,i=void 0===a?"div":a,l=this.state,s={width:l.width,height:l.height,targetRef:this.targetRef};switch(this.getRenderType()){case"renderProp":return n&&n(s);case"childFunction":return(e=o)(s);case"child":if((e=o).type&&"string"==typeof e.type){var c=u(s,["targetRef"]);return Object(r.cloneElement)(e,c)}return Object(r.cloneElement)(e,s);case"childArray":return(e=o).map((function(e){return!!e&&Object(r.cloneElement)(e,s)}));default:return r.createElement(i,null)}},t}(r.PureComponent);function te(e,t){void 0===t&&(t={});var n=function(n){function o(){var e=null!==n&&n.apply(this,arguments)||this;return e.ref=Object(r.createRef)(),e}return i(o,n),o.prototype.render=function(){var n=this.props,o=n.forwardedRef,a=u(n,["forwardedRef"]),i=null!=o?o:this.ref;return r.createElement(ee,l({},t,{targetRef:i}),r.createElement(e,l({targetRef:i},a)))},o}(r.Component);function o(e,t){return r.createElement(n,l({},e,{forwardedRef:t}))}var a=e.displayName||e.name;return o.displayName="withResizeDetector(".concat(a,")"),Object(r.forwardRef)(o)}var ne=J()?r.useEffect:r.useLayoutEffect;function re(e){void 0===e&&(e={});var t=e.skipOnMount,n=void 0!==t&&t,o=e.refreshMode,a=e.refreshRate,i=void 0===a?1e3:a,u=e.refreshOptions,s=e.handleWidth,c=void 0===s||s,d=e.handleHeight,f=void 0===d||d,p=e.targetRef,h=e.observerOptions,m=e.onResize,y=Object(r.useRef)(n),g=Object(r.useRef)(null),b=null!=p?p:g,v=Object(r.useRef)(),_=Object(r.useState)({width:void 0,height:void 0}),w=_[0],O=_[1];return ne((function(){if(!J()){var e=Z(m,O,c,f);v.current=Y((function(t){(c||f)&&t.forEach((function(t){var n=t&&t.contentRect||{},r=n.width,o=n.height;!y.current&&!J()&&e({width:r,height:o}),y.current=!1}))}),o,i,u);var t=new window.ResizeObserver(v.current);return b.current&&t.observe(b.current,h),function(){t.disconnect();var e=v.current;e&&e.cancel&&e.cancel()}}}),[o,i,u,c,f,m,h,b.current]),l({ref:b},w)}}.call(this,n(89))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=p(n(0)),a=p(n(3)),i=p(n(1)),l=p(n(56)),u=p(n(9)),s=p(n(362));n(1744);var c=p(n(1511)),d=p(n(2)),f=(p(n(18)),p(n(15)));function p(e){return e&&e.__esModule?e:{default:e}}function h(e,t){for(var n=0;n50&&(t=50),d.default.processRangeValue(t)}},{key:"_renderTabPreviewArea",value:function(e){var t=this,n=["width","style","color"],r={};return(0,u.default)(["top","right","bottom","left"],(function(e){var o="";(0,u.default)(n,(function(n){var r="border_".concat(n,"_").concat(e).concat(t.suffix),a="border_".concat(n,"_all").concat(t.suffix),i=t.getDefault(a),l=d.default.get(t.getDefault(r),i),u=t._processProperty(n,t.getValue(a)),s=t._processProperty(n,d.default.get(t.getValue(r),d.default.get(u,l)));if(f.default.isMobile(t.props,!1)){var c=d.default.get(t.getValue(r),t.getDefault(r)),p=d.default.get(t.getValue(a),d.default.get(t.getDefault(a),t.getFieldDefault(a)));s=t._processProperty(n,d.default.get(c,p))}o+="".concat(s," ")})),(0,l.default)(r,"border".concat((0,s.default)(e)),o)})),o.default.createElement("div",{className:"et-fb-settings-border-styles-wrap"},o.default.createElement("div",{className:"et-fb-settings-border-styles-wrap-column"},o.default.createElement("div",{className:"et-fb-settings-border-styles-preview",style:r})))}}])&&h(t.prototype,n),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(c.default);_.propTypes=v;var w=_;t.default=w},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=T(n(0)),a=T(n(13)),i=T(n(123)),l=T(n(1)),u=T(n(31)),s=T(n(7)),c=T(n(11)),d=T(n(17));n(1554),n(1552);var f=T(n(1555)),p=T(n(1511)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(18)),m=T(n(43)),y=T(n(803)),g=T(n(789)),b=T(n(281)),v=T(n(6)),_=(T(n(216)),T(n(22))),w=T(n(790)),O=T(n(2)),k=T(n(15)),S=T(n(39)),C=T(n(84)),E=T(n(804));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function T(e){return e&&e.__esModule?e:{default:e}}function M(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.state.transformTab,t="transform_".concat(e),n="".concat(t).concat(this.getViewTabSuffix()),r=this.getSettingDefault(t),o=(0,l.default)(this.getAttrs(),n,r),a="",i="";return(0,s.default)(["scale","translate","skew"],e)&&(a=this.getSettingDefault("".concat(t,"_linked")),i=(0,l.default)(this.getAttrs(),"".concat(t,"_linked").concat(this.getViewTabSuffix()),a)),O.default.hasValue(i)&&i!==a||o!==r&&O.default.hasValue(o)}},{key:"onClickReset",value:function(){var e="transform_".concat(this.state.transformTab);this.props._onChange("".concat(e).concat(this.getViewTabSuffix()),"","range",null,!0),(0,s.default)(["scale","translate","skew"],this.state.transformTab)&&this.setLinked(this.state.transformTab,this.getSettingDefault("".concat(e,"_linked")))}},{key:"onClickHover",value:function(){this.props.onClickHover(this.props.name,(0,d.default)(this.getTabs()).map((function(e){return"transform_".concat(e)})))}},{key:"onClickSticky",value:function(){this.props.onClickSticky(this.props.name,(0,d.default)(this.getTabs()).map((function(e){return"transform_".concat(e)})))}},{key:"buttonsVisible",value:function(){var e=this,t=!1;return(0,d.default)(this.getTabs()).forEach((function(n){t||(t=e.props.isHoveredGroup("transform_".concat(n)))})),t}},{key:"onEnterGroup",value:function(e){var t=this.getSetting(e),n={fieldName:e,fieldLabel:(0,l.default)(t,"label"),fieldType:(0,l.default)(t,"type"),toggleId:this.props.toggle_slug,toggleGroupId:this.props.tab_slug,fieldContextMenu:this.state.transformTabContextMenu};this.props.onMouseEnterGroup(n)}},{key:"onLeaveGroup",value:function(){var e={fieldName:this.props.name,fieldLabel:this.props.label,fieldType:this.props.type,toggleId:this.props.toggle_slug,toggleGroupId:this.props.tab_slug,fieldContextMenu:this.state.transformTabContextMenu};this.props.onMouseEnterGroup(e)}},{key:"render",value:function(){if(!this.props._isOptionMatchesFilter(this.props.label,"".concat(this.props.description," scale rotate translate skew origin"),this.props.label))return!1;var e=this.props,t=e.name,n=e.label,r=e.description,a=e.hasHoverOptions,i=e.hasStickyOptions,l=e.mobile_options,u=!(0,c.default)(r)&&""!==r,s=o.default.createElement(g.default,{name:t,key:"general-form-label-".concat(this.props.uniqueKey),onClickHelp:this.props.onClickHelp,activeHelp:this.props.isDescriptionVisible(t),hasHoverOptions:O.default.hasValue(a),activeHover:this.props.activeHover,onClickHover:this.onClickHover,hasStickyOptions:O.default.hasValue(i),activeSticky:this.props.activeSticky,onClickSticky:this.onClickSticky,hasResponsiveOptions:O.default.hasValue(l),isResponsiveEnabled:this.isResponsiveEnabled(),onClickResponsive:this.onClickResponsive,onClickReset:this.onClickReset,isResetActive:this.isResetActive(),hoveredGroup:this.buttonsVisible(),onToggleRightMenu:!!this.state.transformTabContextMenu&&this.props.onToggleRightMenu},n),d=u?o.default.createElement(w.default,{active:this.props.isDescriptionVisible(t),key:"general-form-description-".concat(this.props.uniqueKey)},r):"",f="transform_".concat(this.state.transformTab),p=this.isResponsiveEnabled()||this.isHoverEnabled()||this.isStickyEnabled()?o.default.createElement(b.default,null,o.default.createElement(E.default,{module:this.getModule(),moduleAttrs:this.getAttrs(),fieldName:t,subFields:[f],activeTabMode:this.props.activeTabMode,isGlobalPresetsMode:this.props.isGlobalPresetsMode,isResponsiveEnabled:this.isResponsiveEnabled(),isHoverEnabled:this.isHoverEnabled(),isStickyEnabled:this.isStickyEnabled(),isItemSelected:this.props.isItemSelected})):"";return o.default.createElement(y.default,{name:f,key:"advanced-form-group-".concat(this.props.uniqueKey),onMouseEnterGroup:this.onEnterGroup,onMouseLeaveGroup:this.onLeaveGroup,className:this.props.productTourClass,isSelectiveSyncAvailable:this.props.isSelectiveSyncAvailable(),isGlobalOptionSynced:this.props.isGlobalOptionSynced(f),_unsyncGlobalSetting:this.props._unsyncGlobalSetting},s,d,p,this.transformTabs(),this.renderTransformField())}}],n&&M(t.prototype,n),r&&M(t,r),Object.defineProperty(t,"prototype",{writable:!1}),P}(p.default),I=A;t.default=I},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=D(n(0)),a=D(n(27)),i=D(n(16)),l=D(n(13)),u=D(n(1)),s=D(n(5)),c=D(n(69)),d=D(n(7)),f=D(n(10)),p=D(n(9)),h=D(n(124)),m=D(n(72)),y=D(n(199)),g=D(n(521)),b=D(n(17)),v=D(n(147)),_=D(n(88)),w=D(n(364)),O=D(n(459)),k=D(n(399)),S=D(n(107)),C=D(n(1491)),E=D(n(2)),P=D(n(63)),T=D(n(303)),M=D(n(14)),j=D(n(6)),x=D(n(22));function D(e){return e&&e.__esModule?e:{default:e}}function N(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"ajax_in_progress",o="et_builder_email_add_account"===t.action;this.setState(F({},r,!0)),e.ajax({type:"POST",url:ETBuilderBackend.ajaxUrl,dataType:"json",data:t}).done((function(e,t,r){o&&E.default.hasValue(e.redirect_url)?n._openPopupAuth(e):n._ajaxComplete(e)})).fail((function(){return n._ajaxComplete()}))}},{key:"_ajaxComplete",value:function(e){var t=this;if(e){var n=["et_pb_signup"];"spam"===(0,u.default)(this,"props.toggle_slug")&&n.push("et_pb_contact_form"),(0,p.default)(n,(function(n){var r=M.default.getComponentFieldsByType(n)[t.props.name];r.options=(0,f.default)({},e.accounts_list),x.default.updateComponentFieldDefinition(n,t.props.name,r),"et_pb_signup"!==n||(0,s.default)(e.predefined_custom_fields)||(ETBuilderBackend.emailPredefinedCustomFields=e.predefined_custom_fields),"et_pb_signup"!==n||(0,s.default)(e.custom_fields)||x.default.updateComponentFieldDefinitions("et_pb_signup_custom_field",e.custom_fields)}))}if(this.addNewAccountInProgress()&&this.state.ajax_in_progress){j.default.emitModuleSettingsAddAccountAjaxCompleteEvent();var r=(0,_.default)((0,w.default)((0,O.default)(e.accounts_list)));"spam"===(0,u.default)(this,"props.toggle_slug")?(r=(0,v.default)(r),r+="-0"):r=(0,v.default)((0,_.default)((0,O.default)((0,_.default)(r)))),this.previous_selection=r}else this.removeAccountInProgress()&&(this.previous_selection="");this.force_clear_fields=this.removeAccountInProgress(),this.cancelAllActions()}},{key:"_fetchLists",value:function(){var e=this.getProviderName(),t=this.getSelectedAccount(),n={action:"et_builder_email_get_lists",et_builder_email_fetch_lists_nonce:ETBuilderBackend.nonces.moduleEmailOptinFetchLists,et_provider:e,et_account:t};this._ajaxSendRequest(n)}},{key:"actionInProgress",value:function(){return this.addNewAccountInProgress()||this.fetchListsInProgress()||this.removeAccountInProgress()}},{key:"cancelAllActions",value:function(){(""===this.previous_selection||(0,d.default)(["add_new_account","fetch_lists","remove_account"],this.previous_selection))&&(this.previous_selection="none"),this.setState({ajax_in_progress:!1,remove_account_ajax:!1}),this.props._onChange(this.props.name,this.previous_selection)}},{key:"getSelectedAccount",value:function(){return e(a.default.findDOMNode(this)).find(":selected").parent().attr("label")}},{key:"setPreviousSelection",value:function(){this.previous_selection="".concat(this.getSelectedAccount(),"|").concat(this.props.value)}},{key:"_onChange",value:function(e,t,n){var r=(0,d.default)(["add_new_account","fetch_lists","remove_account"],t),o=this.actionInProgress()&&!r;this.props._onChange(e,t),o&&this.cancelAllActions(),!this.actionInProgress()&&r&&("add_new_account"===t?"aweber"===this.getProviderName()&&setTimeout((function(){E.default.topWindow().open("https://auth.aweber.com/1.0/oauth/authorize_app/b17f3351")}),500):"fetch_lists"===t&&this._fetchLists())}},{key:"_onClickAddNewAccountButton",value:function(){this.addNewAccountInProgress()||(this.setPreviousSelection(),this._onChange(this.props.name,"add_new_account"))}},{key:"_onClickFetchListsButton",value:function(){this.removeAccountInProgress()?this.cancelAllActions():this.actionInProgress()||(this.setPreviousSelection(),this._onChange(this.props.name,"fetch_lists"))}},{key:"_onClickRemoveAccountButton",value:function(){this.removeAccountInProgress()&&!this.state.remove_account_ajax?this._removeAccount():this.removeAccountInProgress()||(this.selected_account=this.getSelectedAccount(),this.setPreviousSelection(),this._onChange(this.props.name,"remove_account"))}},{key:"UNSAFE_componentWillUpdate",value:function(e,t){var n=t.ajax_in_progress;V(e.value)||U(e.value)?G.addClass("et-fb--email-action-in-progress"):G.removeClass("et-fb--email-action-in-progress"),n?G.addClass("et-fb--email-ajax-in-progress"):G.removeClass("et-fb--email-ajax-in-progress")}},{key:"_renderAddNewAccountButton",value:function(e){var t=(0,u.default)(this.props,"after[0].text","");return this.addNewAccountInProgress()||this.removeAccountInProgress()||!this.canAddNewAccount()?"":o.default.createElement(T.default,{useWrapper:!1,isLoading:this.state.ajax_in_progress},o.default.createElement(P.default,{className:e,_onClick:this._onClickAddNewAccountButton,inverse:!0},t))}},{key:"_renderRemoveAccountButton",value:function(e){var t=this.removeAccountInProgress(),n=(0,u.default)(this.props,"after[1].attributes.data-confirm_text",""),r=(0,u.default)(this.props,"after[1].text","");return this.addNewAccountInProgress()||this.fetchListsInProgress()||!W(this.props.value)||"0"===this.props.value?"":o.default.createElement(T.default,{useWrapper:!1,isLoading:this.state.remove_account_ajax},o.default.createElement(P.default,{className:e,_onClick:this._onClickRemoveAccountButton,inverse:!0},t?n:r))}},{key:"_renderFetchListsButton",value:function(e){var t=(0,u.default)(this.props,"after[2].attributes['data-cancel_text']","");t||(t=(0,u.default)(this.props,"after[1].attributes['data-cancel_text']",""));var n=this.addNewAccountInProgress(),r=(0,u.default)(this.props,"after[2].text","");return n||!r&&!this.removeAccountInProgress()||this.state.ajax_in_progress||this.state.remove_account_ajax||!W(this.props.value)?"":o.default.createElement(T.default,{useWrapper:!1,isLoading:this.fetchListsInProgress()},o.default.createElement(P.default,{className:e,_onClick:this._onClickFetchListsButton,inverse:!0},this.removeAccountInProgress()?t:r))}},{key:"render",value:function(){var e,t=this.props.type.replace(/_/g,"-"),n=(0,l.default)({"et-fb-settings-button--additional-button":!0}),r=this.addNewAccountInProgress()&&this.state.ajax_in_progress,a=this.addNewAccountInProgress()||this.removeAccountInProgress(),i="spam"===(0,u.default)(this,"props.toggle_slug"),s="";a&&this.addNewAccountInProgress()?s=this.props.attributes["data-adding_new_account_text"]:a&&this.removeAccountInProgress()&&(s="".concat(this.props.attributes["data-confirm_remove_text"]," ").concat(this.selected_account));var c=(0,l.default)((F(e={},"et-fb-option--".concat(t),!0),F(e,"et-fb--email-add-new-in-progress-ajax",r),F(e,"et-fb--email-add-new-in-progress",this.addNewAccountInProgress()),F(e,"et-fb--email-fetch-lists-in-progress",this.fetchListsInProgress()),F(e,"et-fb--email-remove-in-progress",this.removeAccountInProgress()),F(e,"et-fb--spam",i),e)),d=this.props.value||this.props.default,f=!this.props.readonly,p=W(d),h=f&&!this.props.hideAddButton,m=p&&f&&!this.props.hideRemoveButton,y=p&&f&&!this.props.hideFetchButton,g=(0,S.default)(this.props.options,(function(e,t){return(0,k.default)(e,(function(e,n){return"manage"===t?n:"".concat(t,"|").concat(n)}))}));return o.default.createElement("div",{className:c},a?o.default.createElement("span",{className:"et-fb-form__description"},s):o.default.createElement(C.default,{name:this.props.name,value:this.props.value||this.props.default,className:(0,l.default)("et-fb-settings-option--with-after-element"),groups:!0,parseGroupValue:!1,options:g,module:this.props.module,readonly:this.props.readonly||!1,_onChange:this._onChange}),h&&this._renderAddNewAccountButton(n),m&&this._renderRemoveAccountButton(n),y&&this._renderFetchListsButton(n))}}],r&&N(n.prototype,r),D&&N(n,D),Object.defineProperty(n,"prototype",{writable:!1}),B}(o.default.Component),z=H;t.default=z}).call(this,n(8))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=_(n(0)),a=_(n(16)),i=_(n(13)),l=_(n(1)),u=_(n(11)),s=_(n(72)),c=_(n(199)),d=_(n(65)),f=_(n(17)),p=_(n(9)),h=(_(n(334)),_(n(8))),m=_(n(457)),y=_(n(63)),g=_(n(303)),b=_(n(6)),v=n(1556);function _(e){return e&&e.__esModule?e:{default:e}}function w(e,t){for(var n=0;n0)return t.css("border","1px solid #EF5555"),void t.on("input",(function(){(0,h.default)(this).val()&&(0,h.default)(this).css("border","")||(0,h.default)(this).css("border","1px solid #EF5555")}));b.default.emitModuleSettingsAddAccountSubmitEvent.call(b.default),this.setState({ajax_in_progress:!0})}},{key:"render",value:function(){var e,t=this,n=this.props.type.replace(/_/g,"-"),r=(0,i.default)({"et-fb-settings-button--additional-button":!0}),a=(0,i.default)({"et-fb-settings-option--with-after-element":!0,"et-fb-settings-option--not-required":this.props.not_required}),s=(0,i.default)((P(e={},"et-fb-option--".concat(n),!0),P(e,"et-fb-option-group--last-field",!0),e));return o.default.createElement("div",{ref:function(e){return t.node=e},className:s},o.default.createElement(m.default,{name:this.props.name,value:(0,u.default)(this.props.value)?"":this.props.value,className:a,groups:!0,options:this.props.options,module:this.props.module,_onChange:this.props._onChange}),o.default.createElement(y.default,{className:(0,i.default)(r,"et-fb-button--cancel"),_onClick:this._onClickCancelButton,inverse:!0},(0,l.default)(this.props,"after[0].text","")),o.default.createElement(g.default,{useWrapper:!1,isLoading:this.state.ajax_in_progress},o.default.createElement(y.default,{className:r,_onClick:this._onClickSubmitButton,inverse:!0},(0,l.default)(this.props,"after[1].text",""))))}}])&&w(t.prototype,n),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),S}(o.default.Component);t.default=T},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=u(n(392)),i=u(n(1));n(1751);var l=u(n(457));function u(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return""!==e?o.default.createElement("div",{className:"".concat(this.getButtonClass(e)," ").concat(_,"-").concat(this.position),"data-origin_type":e,onMouseDown:this.handleButtonOnClick,onMouseEnter:this.handleButtonOnMouseEnter,onMouseLeave:this.handleButtonOnMouseLeave}):o.default.createElement("div",{className:"".concat(_,"-button-guide ").concat(_,"-").concat(this.position)})}},{key:"renderNineController",value:function(){var e=this.state.value.split("_"),t="transparent",n="transparent";return"center"===e[0]&&(t=d.default.selectPositionGray),"center"===e[1]&&(n=d.default.selectPositionGray),o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:"".concat(_,"-hr"),ref:this.hRuler,style:{backgroundColor:t}}),o.default.createElement("div",{className:"".concat(_,"-vr"),ref:this.vRuler,style:{backgroundColor:n}}),o.default.createElement("div",{className:"".concat(_,"-control-guide ").concat(_,"-").concat(this.position)},o.default.createElement("div",{className:"".concat(_,"-control-inner-top")},this.renderButton(),this.renderButton(),this.renderButton()),o.default.createElement("div",{className:"".concat(_,"-control-inner-mid")},this.renderButton(),this.renderButton(),this.renderButton()),o.default.createElement("div",{className:"".concat(_,"-control-inner-bottom")},this.renderButton(),this.renderButton(),this.renderButton())),o.default.createElement("div",{className:"".concat(_,"-control-frame ").concat(_,"-").concat(this.position)}),o.default.createElement("div",{className:"".concat(_,"-control-guide ").concat(_,"-").concat(this.position)},o.default.createElement("div",{className:"".concat(_,"-control-inner-top")},this.renderButton("top_left"),this.renderButton("top_center"),this.renderButton("top_right")),o.default.createElement("div",{className:"".concat(_,"-control-inner-mid")},this.renderButton("center_left"),this.renderButton("center_center"),this.renderButton("center_right")),o.default.createElement("div",{className:"".concat(_,"-control-inner-bottom")},this.renderButton("bottom_left"),this.renderButton("bottom_center"),this.renderButton("bottom_right"))))}},{key:"renderFourController",value:function(){return o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:"".concat(_,"-control-guide ").concat(_,"-").concat(this.position)},o.default.createElement("div",{className:"".concat(_,"-control-inner-top")},this.renderButton(),o.default.createElement("div",{className:"".concat(_,"-button-space")}),this.renderButton()),o.default.createElement("div",{className:"".concat(_,"-control-inner-bottom")},this.renderButton(),o.default.createElement("div",{className:"".concat(_,"-button-space")}),this.renderButton())),o.default.createElement("div",{className:"".concat(_,"-control-frame ").concat(_,"-").concat(this.position)}),o.default.createElement("div",{className:"".concat(_,"-control-guide ").concat(_,"-").concat(this.position)},o.default.createElement("div",{className:"".concat(_,"-control-inner-top")},this.renderButton("top_left"),o.default.createElement("div",{className:"".concat(_,"-button-space")}),this.renderButton("top_right")),o.default.createElement("div",{className:"".concat(_,"-control-inner-bottom")},this.renderButton("bottom_left"),o.default.createElement("div",{className:"".concat(_,"-button-space")}),this.renderButton("bottom_right"))))}},{key:"render",value:function(){return o.default.createElement("div",{id:"".concat(_,"-container"),className:"".concat(_,"-container")},"relative"===this.position?this.renderFourController():this.renderNineController())}}],r=[{key:"getDerivedStateFromProps",value:function(e,t){return t.value!==e.value?{value:e.value||e.default}:null}}],n&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.default.Component);v(O,"propTypes",{default:a.default.string,name:a.default.string.isRequired,value:a.default.string,_onChange:u.default,readonly:a.default.bool}),v(O,"defaultProps",{default:"top_left",name:"position_origin_r",value:"top_left",_onChange:u.default,readonly:!1});var k=O;t.default=k},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ETBuilderControlAlign=void 0;var r=l(n(0)),o=l(n(127)),a=n(1557),i=n(1556);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function b(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var f=function(e){var t=e.onChange,n=e.className,o=d(e,u);return r.default.createElement(i.default,c({className:(0,a.default)(l.handler,n),onDragX:t},o))};f.propTypes={onChange:o.default.func.isRequired,className:o.default.string},f.defaultProps={className:""};var p=f;t.default=p},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(0)),o=l(n(3)),a=l(n(13)),i=n(1485);function l(e){return e&&e.__esModule?e:{default:e}}n(1764);var u=function(e){var t=e.offset,n=e.width,o=e.className;return r.default.createElement("div",{className:(0,a.default)(i.track,o),style:{left:"".concat(t,"%"),width:"".concat(n,"%")}})};u.propTypes={className:o.default.string,offset:o.default.number,width:o.default.number},u.defaultProps={className:"",offset:0,width:100};var s=u;t.default=s},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(0)),o=u(n(3)),a=u(n(1766)),i=n(1485),l=n(1512);function u(e){return e&&e.__esModule?e:{default:e}}n(1769);var s=function(e){var t=e.value,n=e.width;return r.default.createElement("ul",{className:i.counters},(0,l.getCounters)(t,n).map((function(e,t){return r.default.createElement(a.default,{key:t,values:e})})))};s.propTypes={value:o.default.string.isRequired,width:o.default.number.isRequired};var c=s;t.default=c},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=f(n(3)),i=f(n(13)),l=f(n(147)),u=f(n(88)),s=n(94),c=n(115),d=n(1485);function f(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}n(1767);var h=function(e){var t=e.values,n=t.filter(s.hasValue),r=n.map((function(e){return"".concat(e,"%")})).join(" "),a=n.length>1?d.counterMulti:"",f=Math.round((0,c.average)([(0,l.default)(t),(0,u.default)(t)]));return o.default.createElement("span",{className:(0,i.default)(d.counter,a),style:{left:"".concat(f,"%")}},r)};h.propTypes={values:a.default.arrayOf(a.default.number)},h.defaultProps={values:[]};var m=h;t.default=m},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intersperse=t.groupBy=void 0;var r=i(n(367)),o=i(n(88)),a=i(n(460));function i(e){return e&&e.__esModule?e:{default:e}}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1),n));return o.default.createElement("div",{key:t,className:r,style:{left:"".concat((0,l.average)(e),"%")}},e.map((function(){return m[y++]})))}));return o.default.createElement("div",{className:s.inputsList},g)};h.propTypes={onChange:a.default.func.isRequired,value:a.default.string,defaultValue:a.default.string,width:a.default.number.isRequired,resolver:a.default.shape({getStartValue:a.default.func.isRequired,setStartValue:a.default.func.isRequired,getMiddleValue:a.default.func.isRequired,setMiddleValue:a.default.func.isRequired,getEndValue:a.default.func.isRequired,setEndValue:a.default.func.isRequired}).isRequired,i10n:a.default.shape({startValueTitle:a.default.string,middleValueTitle:a.default.string,endValueTitle:a.default.string})},h.defaultProps={value:"",defaultValue:"",i10n:{startValueTitle:"",middleValueTitle:"",endValueTitle:""}};var m=h;t.default=m},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=T(n(1559)),a=T(n(56)),i=T(n(11)),l=T(n(1)),u=T(n(627)),s=T(n(10));n(1774);var c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),d=T(n(3)),f=n(282),p=n(1775),h=n(1560),m=T(n(1797)),y=T(n(1798)),g=T(n(616)),b=T(n(1547)),v=T(n(1824)),_=T(n(1825)),w=n(1827),O=n(1828),k=n(1486),S=T(n(123)),C=T(n(6)),E=n(1481);function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function T(e){return e&&e.__esModule?e:{default:e}}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?arguments[1]:void 0;T((function(t){return t.conditions=t.conditions.map((function(t){return t.operator=e,t})),t.currentSelected.operator=e,D({},t)})),$()},te=function(e){V||se()||P.isSettingsModalOpen||(T((function(t){return t.conditions=j(t.conditions.filter((function(t){return t.id!==e}))),D({},t)})),$())},ne=function(e){if(!V&&!se()){var t=P.conditions.find((function(t){return t.id===e}));T((function(n){return n.currentSelected.condition=t.condition,n.settingsModalValues=n.conditions.find((function(t){return t.id===e})).conditionSettings,D({},n)})),function(e){T((function(t){return t.editingConditionId=e,D({},t)}))}(e),Y()}},re=function(e){V||se()||(T((function(t){return t.conditions=t.conditions.flatMap((function(t){return t.id===e?[t,(0,s.default)({},t,{id:(0,f.v4)()})]:t})),D({},t)})),$())},oe=function(e,t){V||se()||(T((function(n){var r="",o="";n.conditions.forEach((function(n,a){n.id===e?r=a:n.id===t&&(o=a)}));var a=[n.conditions[o],n.conditions[r]];return n.conditions[r]=a[0],n.conditions[o]=a[1],D({},n)})),$())},ae=function(){var e=["loggedInStatus","userRole","dateTime","productPurchase","cartContents","operatingSystem","browser","pageVisit","postVisit","cookie","numberOfViews"],t=P.conditions.filter((function(t){var n=t.condition;return e.includes(n)})).length>0;R(t)},ie=function(){q.forEach((function(e){var t=e.value.toString(),n=e.label,r=e.singular_label;(0,a.default)(p.conditionNames,"location."+t,n);var i=(0,u.default)((0,o.default)("displayRule.label","".concat(O.dynamicPostsFields.displayRule.label," ").concat(r)),(0,o.default)("adminLabel.default","".concat(n)),(0,o.default)("dynamicPosts.options.postType","".concat(t)),(0,o.default)("postTypeLabel.default","".concat(n)))(O.dynamicPostsFields);p.conditionFields[t]=i}))},le=function(){S.default.hide(),B(!1)},ue=function(){B(!0)},se=function(){return!(!C.default.getFindReplaceModal()||!W.current)&&!!W.current.closest(".et-fb-form__group--find-replace__find")};return parseFloat(window.etCore.wp_version.toString().substr(0,3))>=5.3?c.default.createElement("div",{ref:W},c.default.createElement(_.default,null,P.conditions.length>1&&c.default.createElement("div",{className:"et-fb-display-conditions-operator-container"},c.default.createElement(g.default,{className:"et-fb-display-conditions-operator",name:"display-conditions-operator",value:P.currentSelected.operator,options:{OR:(0,E.i18nDisplayConditions)("Display if any condition is true"),AND:(0,E.i18nDisplayConditions)("Display if all conditions are true")},_onChange:ee,selectFirst:!1})),P.conditions.map((function(e){return c.default.createElement(v.default,{key:e.id,id:e.id,onSort:oe,onEndDrag:ue},c.default.createElement(y.default,M({},e,{conditionId:e.id,conditions:P.conditions,conditionsStatus:G,onDelete:te,onEdit:ne,onDuplicate:re,onMouseDown:le,onMouseUp:ue,tooltipVisibility:I})))})),c.default.createElement("div",{className:"et-fb-display-conditions-container"},c.default.createElement(g.default,{role:"display-conditions-list",className:"et-fb-display-condition-list",name:"display-conditions",ref:F,value:"",options:p.conditionNames,_onChange:function(e,t){T((function(e){return e.currentSelected.condition=t,D({},e)})),Y()},selectFirst:!1,optionGroups:p.conditionGroups})),P.isSettingsModalOpen&&c.default.createElement(b.default,{title:p.conditionNames[P.currentSelected.condition],fields:p.conditionFields[P.currentSelected.condition],values:P.settingsModalValues,onChange:function(e){Z(e),Q(e)},onSave:function(){!function(){if(P.editingConditionId){var e={id:P.editingConditionId,condition:P.currentSelected.condition,conditionSettings:P.currentSelected.conditionSettings,operator:P.currentSelected.operator};T((function(t){return t.conditions=t.conditions.map((function(n){return n.id===t.editingConditionId?e:n})),D({},t)}))}else T((function(e){var t={id:(0,f.v4)(),condition:e.currentSelected.condition,conditionSettings:e.currentSelected.conditionSettings,operator:e.currentSelected.operator};return e.conditions=[].concat(j(e.conditions),[t]),D({},e)}))}(),$(),T((function(e){return e.editingConditionId=null,D({},e)})),J(),X()},onClose:function(){J(),X()}}),c.default.createElement(m.default,{onClick:function(){return F.current.toggleMenu({target:null})}})),N&&c.default.createElement("div",{className:"display-conditions-cache-notice"},(0,E.i18nDisplayConditions)("Translatable Cache Notice"))):c.default.createElement("div",{className:"display-conditions-cache-notice"},(0,E.i18nDisplayConditions)("Display Conditions Min Requirements"))};I.propTypes={_onChange:d.default.func,name:d.default.string,type:d.default.string,value:d.default.string},I.defaultProps={_onChange:function(){},name:"",type:"",value:[]},I.displayName="ETBuilderConditionalDisplay";var B=I;t.default=B},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conditionNames=t.conditionGroups=t.conditionFields=void 0;var r=P(n(11)),o=P(n(1)),a=n(1560),i=n(1776),l=n(1777),u=n(1778),s=n(1779),c=n(1780),d=n(1781),f=n(1782),p=n(1783),h=n(1784),m=n(1785),y=n(1786),g=n(1787),b=n(1788),v=n(1789),_=n(1790),w=n(1791),O=n(1792),k=n(1793),S=n(1794),C=n(1795),E=n(1796);function P(e){return e&&e.__esModule?e:{default:e}}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t0})),o=r.length?r.reduce((function(e,t){return e+", "+t})):"";return{is:(0,a.i18nDisplayConditions)("Only display on")+" ".concat(o),isNot:(0,a.i18nDisplayConditions)("Don't display on")+" ".concat(o)}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderBrowserTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.displayRule,r=t.products.map((function(e){return e.label})).join(", ");return{hasProducts:(0,a.i18nDisplayConditions)("Cart Contents Has Products"),isEmpty:(0,a.i18nDisplayConditions)("Cart Contents Is Empty"),hasSpecificProduct:(0,a.i18nDisplayConditions)("Only display to users with")+" ".concat(r," ")+(0,a.i18nDisplayConditions)("in their cart"),doesNotHaveSpecificProduct:(0,a.i18nDisplayConditions)("Only display to users without")+" ".concat(r," ")+(0,a.i18nDisplayConditions)("in their cart")}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderCartContentsTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(31)),o=l(n(11)),a=l(n(3)),i=n(1481);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0})),v=b.length?b.reduce((function(e,t){return e+", "+t})):"";return{isAfter:(0,a.i18nDisplayConditions)("Only display after")+" ".concat(r," at ").concat(o),isBefore:(0,a.i18nDisplayConditions)("Only display before")+" ".concat(r," at ").concat(o),isOnSpecificDate:(0,a.i18nDisplayConditions)("Only display on")+" ".concat(r," ").concat(h).concat(m," ").concat(y).concat(g),isNotOnSpecificDate:(0,a.i18nDisplayConditions)("Don't display on")+" ".concat(r," ").concat(h),isOnSpecificDays:(0,a.i18nDisplayConditions)("Only display on")+" ".concat(v," ").concat(h).concat(m," ").concat(y).concat(g),isFirstDayOfMonth:(0,a.i18nDisplayConditions)("Only display on first day of month")+" ".concat(h),isLastDayOfMonth:(0,a.i18nDisplayConditions)("Only display on last day of month")+" ".concat(h)}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderDateTimeTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.displayRule,r=t.dynamicPosts,o=t.postTypeLabel,i=r.map((function(e){return e.label})).join(", ");return{is:(0,a.i18nDisplayConditions)("Only display on")+" ".concat(i," ").concat(o),isNot:(0,a.i18nDisplayConditions)("Don't display on")+" ".concat(i," ").concat(o)}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderDynamicPostsTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings.displayRule;return{loggedIn:(0,a.i18nDisplayConditions)("Only display to logged in visitors"),loggedOut:(0,a.i18nDisplayConditions)("Only display to logged out visitors")}[t]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderLoggedInStatusTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.numberOfViews,r=t.resetAfterDuration,o=t.displayAgainAfter,i=t.displayAgainAfterUnit,l="on"===r?(0,a.i18nDisplayConditions)(", Reset after")+" ".concat(o," ").concat(i):"";return(0,a.i18nDisplayConditions)("Only display")+" ".concat(n," ")+(0,a.i18nDisplayConditions)("times")+l};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderNumberOfViewsTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.displayRule,r=t.operatingSystems.split("|").filter((function(e){return e.length>0}));return r.length&&(r=r.reduce((function(e,t){return e+", "+t}))),{is:(0,a.i18nDisplayConditions)("Only display on")+" ".concat(r),isNot:(0,a.i18nDisplayConditions)("Don't display on")+" ".concat(r)}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderOperatingSystemTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.displayRule,r=t.pages.map((function(e){return e.label})).join(", ");return{hasVisitedSpecificPage:(0,a.i18nDisplayConditions)("Only display to users visited")+" ".concat(r," ")+(0,a.i18nDisplayConditions)("Pages"),hasNotVisitedSpecificPage:(0,a.i18nDisplayConditions)("Don't display to users visited")+" ".concat(r," ")+(0,a.i18nDisplayConditions)("Pages")}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderPageVisitTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.displayRule,r=t.pages.map((function(e){return e.label})).join(", ");return{hasVisitedSpecificPage:(0,a.i18nDisplayConditions)("Only display to users visited")+" ".concat(r," ")+(0,a.i18nDisplayConditions)("Posts"),hasNotVisitedSpecificPage:(0,a.i18nDisplayConditions)("Don't display to users visited")+" ".concat(r," ")+(0,a.i18nDisplayConditions)("Posts")}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderPostVisitTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(3))&&r.__esModule?r:{default:r},a=n(1481);var i=function(e){var t=e.conditionSettings,n=t.displayRule,r=t.postTypes.map((function(e){return e.label})).join(", ");return{is:(0,a.i18nDisplayConditions)("Only display on")+" ".concat(r),isNot:(0,a.i18nDisplayConditions)("Don't display on")+" ".concat(r)}[n]};i.propTypes={conditionSettings:o.default.object.isRequired},i.displayName="ETBuilderPostTypeTooltip";var l=i;t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=l(n(31)),o=l(n(11)),a=l(n(3)),i=n(1481);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n').concat(n,""),d=(0,l.default)(o.author_uri)?i:'').concat(i,"");return a.default.createElement("div",{className:"et-fb-settings-modal-module-credits",dangerouslySetInnerHTML:{__html:(0,c.default)("".concat(u," by ").concat(d))},ref:function(t){return e.creditsContainer=t}})}}])&&h(n.prototype,o),i&&h(n,i),Object.defineProperty(n,"prototype",{writable:!1}),f}(a.PureComponent),_={moduleTitle:i.default.string,moduleType:i.default.string};d.default.propTypes=_;var w=v;t.default=w}).call(this,n(2),n(8))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=v(n(0)),a=v(n(123)),i=v(n(3)),l=v(n(40)),u=v(n(13));n(1853);var s=v(n(6)),c=v(n(14)),d=v(n(1854)),f=n(1561),p=v(n(22)),h=v(n(1872)),m=v(n(623)),y=v(n(1874)),g=v(n(43)),b=v(n(84));function v(e){return e&&e.__esModule?e:{default:e}}function _(e,t){for(var n=0;n1&&this.renderDefaultPreset(),e.length>1&&this.renderPresetsList())}},{key:"render",value:function(){var e=this.props,t=e.module,n=e.onMouseEnter,r=e.onMouseLeave,a=c.default.getModulePreset(this.module,this.currentPreset).name,i=s.default.getGlobalPresetsState().presetsDropdownVisible,l=1===c.default.getModulePresetsCount(this.module)?P.default:a||P.default,u="".concat(P.preset,": ").concat(l);return o.default.createElement(o.default.Fragment,null,o.default.createElement(d.default,{anchor:this.dropdownAnchorRef,menu:this.renderMenu(),module:t,open:i,onMouseEnter:n,onMouseLeave:r,onSelect:this.onPresetSelect,ref:this.dropdownRef},u),o.default.createElement(y.default,{anchor:this.dropdownAnchorRef,onMouseEnter:n,onMouseLeave:r}))}}],n&&_(t.prototype,n),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(o.default.PureComponent);E(M,"propTypes",{module:i.default.shape({props:i.default.shape({type:i.default.string.isRequired}).isRequired}).isRequired,onMouseEnter:i.default.func,onMouseLeave:i.default.func}),E(M,"defaultProps",{onMouseEnter:l.default,onMouseLeave:l.default});var j=M;t.default=j},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=m(n(0)),a=m(n(3)),i=m(n(123)),l=m(n(40));n(1855);var u=m(n(22)),s=n(1561),c=n(788),d=m(n(1868)),f=m(n(1870)),p=n(358),h=m(n(802));function m(e){return e&&e.__esModule?e:{default:e}}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function q(e){var t,n,r;if(V.isWindow(e)||9===e.nodeType){var o=V.getWindow(e);t={left:V.getWindowScrollLeft(o),top:V.getWindowScrollTop(o)},n=V.viewportWidth(o),r=V.viewportHeight(o)}else t=V.offset(e),n=V.outerWidth(e),r=V.outerHeight(e);return t.width=n,t.height=r,t}function K(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,a=e.height,i=e.left,l=e.top;return"c"===n?l+=a/2:"b"===n&&(l+=a),"c"===r?i+=o/2:"r"===r&&(i+=o),{left:i,top:l}}function $(e,t,n,r,o){var a=K(t,n[1]),i=K(e,n[0]),l=[i.left-a.left,i.top-a.top];return{left:Math.round(e.left-l[0]+r[0]-o[0]),top:Math.round(e.top-l[1]+r[1]-o[1])}}function Y(e,t,n){return e.leftn.right}function X(e,t,n){return e.topn.bottom}function J(e,t,n){var r=[];return V.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Q(e,t){return e[t]=-e[t],e}function Z(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function ee(e,t){e[0]=Z(e[0],t.width),e[1]=Z(e[1],t.height)}function te(e,t,n,r){var o=n.points,a=n.offset||[0,0],i=n.targetOffset||[0,0],l=n.overflow,u=n.source||e;a=[].concat(a),i=[].concat(i);var s={},c=0,d=z(u,!(!(l=l||{})||!l.alwaysByViewport)),f=q(u);ee(a,f),ee(i,t);var p=$(f,t,o,a,i),h=V.merge(f,p);if(d&&(l.adjustX||l.adjustY)&&r){if(l.adjustX&&Y(p,f,d)){var m=J(o,/[lr]/gi,{l:"r",r:"l"}),y=Q(a,0),g=Q(i,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&o.left+a.width>n.right&&(a.width-=o.left+a.width-n.right),r.adjustX&&o.left+a.width>n.right&&(o.left=Math.max(n.right-a.width,n.left)),r.adjustY&&o.top=n.top&&o.top+a.height>n.bottom&&(a.height-=o.top+a.height-n.bottom),r.adjustY&&o.top+a.height>n.bottom&&(o.top=Math.max(n.bottom-a.height,n.top)),V.mix(o,a)}(p,f,d,s))}return h.width!==f.width&&V.css(u,"width",V.width(u)+h.width-f.width),h.height!==f.height&&V.css(u,"height",V.height(u)+h.height-f.height),V.offset(u,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:a,targetOffset:i,overflow:s}}function ne(e,t,n){var r=n.target||t,o=q(r),a=!function(e,t){var n=z(e,t),r=q(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return te(e,o,n,a)}function re(e,t,n){var r,a,i=V.getDocument(e),l=i.defaultView||i.parentWindow,u=V.getWindowScrollLeft(l),s=V.getWindowScrollTop(l),c=V.viewportWidth(l),d=V.viewportHeight(l),f={left:r="pageX"in t?t.pageX:u+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=u+c&&a>=0&&a<=s+d,h=[n.points[0],"cc"];return te(e,f,o(o({},n),{},{points:h}),p)}ne.__getOffsetParent=G,ne.__getVisibleRectForElement=z,t.default=ne},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=l(n(0)),a=l(n(3)),i=n(67);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];n!==this.state.isLabelEditable&&(this.setState({isLabelEditable:n}),e(t.target).closest(".et-fb-layers-view--label").toggleClass("et-fb-editable-label",n))}},{key:"isAllowedAction",value:function(e){var t=(0,h.default)(this,"props"),n=(0,h.default)(t,"attrs.global_module"),r=(0,h.default)(t,"globalParent",!1),o=(0,W.isOn)((0,h.default)(t,"attrs.locked")),a=(0,h.default)(t,"lockedParent",!1),i=(0,h.default)(t,"type"),l=(0,B.getComponentType)(t),u=function(){return!(!D.default.isAllowedAction("add_module")||!(0,V.isInteractable)(o,a,r)||!(0,V.canAddSiblings)(a,r,l))},s=D.default.isEditingLibraryItem("row");switch(e){case"add_module":if(!u())return!1;break;case"edit_module":if(!D.default.isAllowedAction("edit_module")||!(0,V.isEditable)(o,a,n,r,i))return!1;break;case"new_column":if(!(0,B.is)("column",this)||!u()||s||(0,h.default)(this,"props.isColumnSingle",!1)||(0,h.default)(this,"props.columnCount",0)>=(0,h.default)(this,"props.columnLimit",3))return!1;break;case"delete_column":if(!(0,B.is)("column",this)||!u()||s||(0,h.default)(this,"props.columnCount",0)<2)return!1;break;default:return!1}return!0}},{key:"isLayerExpanded",value:function(){var e=this.props;return e.isLayerExpanded||(0,h.default)(e,"isColumnSpecialty")||(0,U.isLibraryParent)(e)}},{key:"isFilterResult",value:function(){var e=this.props,t=e.isFilterActive,n=e.isFilterResult;return t&&n}},{key:"isFilterResultParent",value:function(){var e=this.props,t=e.isFilterActive,n=e.isFilterResult;return t&&!n}},{key:"isHovered",value:function(){return this.state.hovered}},{key:"isLayerSelected",value:function(){return this.props.isLayerSelected&&!this.isFilterResultParent()}},{key:"getWooModuleInactiveNotice",value:function(){var e=this.module.props;return!!L.default.isInactiveWooModule(e)&&E.default.getCurrentPage(["woocommerce","inactive_module_notice"],"")}},{key:"handleAddButton",value:function(e){(0,U.handleAddLayerButton)(e,this,this.handleAddButton,{scrollTimeout:this.scrollTimeout})}},{key:"handleLayerClick",value:function(e){if("pointer"!==D.default.getQuickActionsContext()){if(D.default.abIsMode("selecting",this.props.themeBuilderArea))return e.stopPropagation(),!(0,B.is)("removed",this.module)&&void((0,B.is)("column",this)||this.isFilterResultParent()||(0,U.isLayerLocked)(this)||this._ABTestingSet(this.module));var t={props:(0,U.prepareProps)(this.module.props,{skipLayer:(0,B.is)("column",this)})};x.default.shouldItemSelected(e,this.props.address,t)?e.stopPropagation():(this.isFilterResultParent()||(0,U.isLayerLocked)(this)||k.default.setActiveLayer(this.module),(0,U.scrollToLayerOnBuilder)(this))}}},{key:"handleLayerDoubleClick",value:function(e){var t=this;"pointer"!==D.default.getQuickActionsContext()&&(this.isFilterResultParent()||(0,h.default)(this,"props.isColumnSingle")||D.default.abIsMode("selecting",this.props.themeBuilderArea)||(e.preventDefault(),x.default.isItemSelection(e)||this.isAllowedAction("edit_module")&&!(0,B.is)("removed",this.module)&&(clearTimeout(o),o=setTimeout((function(){return k.default.openModuleSettings(t.module)}),850))))}},{key:"handleLayerRightClick",value:function(t){D.default.abIsMode("selecting",this.props.themeBuilderArea)||this.isFilterResultParent()||(0,h.default)(this,"props.isColumnSingle")||((0,U.forceSettingsClose)(this),D.default.setIsContextMenuActive(!0),D.default.setContextMenuModule(this.module),k.default.setActiveLayer(this.module),k.default.setHoveredModuleElement(this.module),e(t.target).closest(".lv-context-button").length>0&&j.default.getContextMenuCallback()(t))}},{key:"handleLayerSettingsClick",value:function(e){var t=(0,h.default)(e,"props.editingModule"),n=(0,h.default)(e,"props.additionalAttrs");D.default.isSettingsModalOpen()?((0,U.scrollToLayerOnBuilder)(t),k.default.buttonClick(e,t,void 0,n)):(0,U.scrollToLayerOnBuilder)(t,(function(){k.default.buttonClick(e,t,void 0,n)})),k.default.setActiveLayer(t)}},{key:"handleLayerToggle",value:function(e){k.default.toggleLayers(this.props.address,!this.isLayerExpanded())}},{key:"handleLayerToggleAll",value:function(e){var t=j.default.getLayerChildren(this);k.default.toggleLayers(t,this.isLayerExpanded())}},{key:"renderActionButtons",value:function(){if(this.isFilterResultParent()||(0,h.default)(this,"props.isColumnSingle"))return!1;var e,t=this.module.props,n=B.default.condition("is_rtl")&&!B.default.condition("is_no_rtl"),r=(0,B.is)("column",t)?(0,h.default)(ETBuilderBackend,"i18n.modals.layersView.column"):(0,h.default)(ETBuilderBackend,"i18n.tooltip.".concat((0,B.getComponentType)(t),".tab")),o=!D.default.abIsMode("off",t.themeBuilderArea),a=o&&D.default.abIsSubject(t),i=o&&D.default.abIsGoal(t),l=D.default.isMultiItemSelected(t.address),d=D.default.isMultiSelectSingleItem(),y=!l||l&&d,_=[],E={buttonName:P.default.LAYERS_VIEW_CONTEXT_MENU_BUTTON,className:"lv-context-button et-fb-button--right-menu",needEvent:!0,icon:"overflow",iconStyles:{height:28,width:15,minWidth:15,margin:n?"0 0 0 6px":"0 6px 0 0"},viewBox:"0 0 15 28",__onClick:this.handleLayerRightClick};if((0,U.isLayerLocked)(t))(0,U.isLockedParent)(t)?(_.push({buttonName:P.default.TAB_BUTTON_MODULE_UNLOCK,editingModule:this.module,className:"lv-button-place-holder",needEvent:!1,icon:"lock",tagName:"div"}),(0,B.is)("removed",t)||_.push(E)):(_.push({buttonName:!1,className:"lv-button-place-holder",needEvent:!1,icon:"lock",tagName:"div"}),_.push((0,g.default)({},E,{buttonName:!1,className:"lv-button-place-holder",icon:"blank",tagName:"div"})));else if(y){if(this.isAllowedAction("edit_module")&&!L.default.isInactiveWooModule(t)&&!(0,B.is)("removed",t)){var T=(0,B.is)("column",t)?P.default.MODULE_ITEM_EDIT:P.default.TAB_BUTTON_MODULE_EDIT;_.push({buttonName:T,editingModule:this.module,icon:"setting",tooltip:r.settings,additionalAttrs:{isColumnLayer:(0,B.is)("column",t)},_onClick:this.handleLayerSettingsClick})}!this.isAllowedAction("add_module")||L.default.isInactiveWooModule(t)||(0,B.is)("column",t)||(0,B.is)("removed",t)||i&&!a||_.push({buttonName:P.default.TAB_BUTTON_MODULE_COPY,className:"et_fb_duplicate_module_handler",editingModule:this.module,icon:"copy",tooltip:r.duplicate}),(a||i)&&_.push({buttonName:P.default.AB_VIEW_REPORT,iconUrl:"".concat(ETBuilderBackend.images_uri,"/stats.svg"),_onClick:k.default.abViewReport}),!this.isAllowedAction("add_module")||i||a&&!D.default.abHasAdditionalSubject()||(0,B.is)("column",t)||_.push({buttonName:P.default.TAB_BUTTON_MODULE_DELETE,editingModule:this.module,icon:"delete",tooltip:r.delete}),this.isAllowedAction("new_column")&&_.push({buttonName:P.default.MODULE_ITEM_COPY,className:"et_fb_duplicate_module_handler",editingModule:this.module,icon:"copy",tooltip:r.duplicate,additionalAttrs:{isColumnLayer:!0}}),this.isAllowedAction("delete_column")&&_.push({buttonName:P.default.MODULE_ITEM_DELETE,editingModule:this.module,icon:"delete",tooltip:r.delete,additionalAttrs:{isColumnLayer:!0}}),(0,B.is)("removed",t)||_.push(E)}else this.isAllowedAction("edit_module")&&_.push({buttonName:P.default.TAB_BUTTON_MODULE_EDIT,editingModule:this.module,icon:"setting",tooltip:r.settings}),this.isAllowedAction("add_module")&&!(i||a&&!D.default.abHasAdditionalSubject())&&_.push({buttonName:P.default.TAB_BUTTON_ITEMS_DELETE,editingModule:this.module,icon:"delete",tooltip:r.delete}),_.push(E);switch(!0){case(0,U.isLayerLocked)(t):case this.isLayerSelected():e={color:O.default.white,opacity:1};break;case this.isHovered()&&!this.isLayerSelected():e={color:O.default.shuttleGrey,opacity:1};break;default:e={color:O.default.shuttleGrey,opacity:.6}}var j=D.default.getAppPreference("builder_animation"),x=300,N=(0,w.default)({"et-fb-layers-view--actions":!0});return b.default.createElement("div",{className:"et-fb-layers-view--actions-group"},!!a&&b.default.createElement("div",{className:"et-fb-layers-view__subject-wrapper"},b.default.createElement("div",{className:"et-fb-layers-view__subject-id"},(0,h.default)(t,"attrs.ab_subject_id"))),b.default.createElement(v.Motion,{defaultStyle:{opacity:0,size:.8},style:{opacity:j?(0,v.spring)(e.opacity,{stiffness:x,damping:20}):e.opacity,size:j?(0,v.spring)(1,{stiffness:x,damping:20}):1}},(function(n){return b.default.createElement(C.default,{className:N,style:{opacity:n.opacity,transform:"scale( ".concat(n.size," )")}},b.default.createElement(v.StaggeredMotion,{defaultStyles:(0,u.default)(_,(function(){return{opacity:e.opacity}})),styles:function(t){return t.map((function(n,r){return 0===r?{opacity:j?(0,v.spring)(e.opacity,{stiffness:x,damping:20}):e.opacity}:{opacity:j?(0,v.spring)(t[r-1].opacity,{stiffness:x,damping:20}):e.opacity}}))}},(function(n){return b.default.createElement(C.default,null,_.map((function(r,o){var a={};(0,m.default)(["_onClick","__onClick","tagName","className","additionalAttrs"],(function(e){(0,f.default)(r[e])&&!(0,c.default)(r[e])||(a[e]=r[e])}));var i=(0,f.default)(r.iconStyles)?{margin:0}:r.iconStyles;return b.default.createElement(S.default,K({key:"lv-action-button-".concat(t.address,"-").concat(o),buttonName:r.buttonName,editingModule:r.editingModule,needEvent:r.needEvent,tooltip:r.tooltip,ink:(0,p.default)(r,"iconUrl"),stopPropagation:!0},a),(0,p.default)(r,"iconUrl")?b.default.createElement("object",{type:"image/svg+xml",className:"fitvidsignore",data:"".concat(ETBuilderBackend.images_uri,"/stats.svg"),width:"28",height:"16"}):b.default.createElement(M.default,{color:e.color,icon:r.icon,size:"14",style:(0,g.default)({opacity:(0,s.default)(n[o])?e.opacity:n[o].opacity,transform:"scale(".concat((0,s.default)(n[o])?e.top:n[o].top,")")},i),viewBox:r.viewBox}))})))})))})))}},{key:"renderAddButton",value:function(){var e=this,t=this.props.isFilterActive,n=(0,B.getComponentType)(this),r=(0,w.default)({"et-fb-layers-view--add":!0});if(t||!this.isAllowedAction("add_module")||"column"===n&&!this.isAllowedAction("new_column")||D.default.abIsMode("selecting",this.props.themeBuilderArea))return b.default.createElement("div",{className:r});var o="column"===n?"row":n,a=(0,h.default)(ETBuilderBackend,"i18n.tooltip.".concat(o)),i=D.default.getAppPreference("builder_animation"),l=this.isHovered()?1:0,u=this.isHovered()?1:.5,s={buttonName:P.default.TAB_BUTTON_MODULE_ADD,editingModule:this.module,tooltip:a.addButton,ink:!1,block:!0,stopPropagation:!0,_onClick:this.handleAddButton};return"column"===n&&(s=(0,g.default)(s,{buttonName:P.default.MODULE_ITEM_ADD_COLUMN,tooltip:a.addColumnButton,additionalAttrs:{isColumnLayer:!0,columnIndex:this.props.index+1}})),b.default.createElement("div",{className:r,onMouseEnter:this.handleLayerMouseEnter,onMouseLeave:this.handleLayerMouseLeave},b.default.createElement(v.Motion,{defaultStyle:{opacity:0,size:.5},style:{opacity:i?(0,v.spring)(l,{stiffness:300,damping:20}):l,size:i?(0,v.spring)(u,{stiffness:300,damping:20}):u}},(function(t){return b.default.createElement(S.default,K({},s,{style:{opacity:t.opacity,transform:"scale( ".concat(t.size," )")}}),b.default.createElement(M.default,{color:(0,U.getColorCode)(e),icon:"add",size:"14",style:{margin:0}}))})))}},{key:"renderToggle",value:function(){var e=this.props.isFilterActive,t=(0,w.default)({"et-fb-button-group":!0,"et-fb-layers-view--toggle":!0,"et-fb-layers-view--toggle-expanded":this.isLayerExpanded()});if((0,B.is)("module",this.props)||e)return b.default.createElement("div",{className:t});var n=B.default.condition("is_rtl")&&!B.default.condition("is_no_rtl")?"caret-left":"caret-right",r={margin:0,opacity:.5};return b.default.createElement("div",{className:t},b.default.createElement(I.default,{singleClick:this.handleLayerToggle,doubleClick:this.handleLayerToggleAll},b.default.createElement("button",{className:"et-fb-button et-fb-button--block"},b.default.createElement(M.default,{color:O.default.inactiveGrey,icon:"caret-down",size:"14",style:r}),b.default.createElement(M.default,{color:O.default.inactiveGrey,icon:n,size:"14",style:r}))))}},{key:"startRender",value:function(){this.props.isDelayRender&&this.setState({isRenderItem:!0})}},{key:"renderLabel",value:function(){var e=this.module.props,t=e.attrs,n=(0,h.default)(e,"label")?(0,h.default)(e,"label"):(0,U.getLayerName)(e),r=(0,h.default)(t,"admin_label")?(0,h.default)(t,"admin_label"):n,o=!D.default.abIsMode("off",e.themeBuilderArea)&&D.default.abIsSubject(e),a=!1,i=this.getWooModuleInactiveNotice();if(o){var l=D.default.abGetSubjectRank(e,"percentage");a=!!(0,W.hasValue)(l)&&" (".concat(D.default.abGetSubjectRank(e,"percentage"),")")}return!this.isAllowedAction("edit_module")||this.isFilterResultParent()||(0,U.isLayerLocked)(e)||(0,B.is)("removed",e)?b.default.createElement(I.default,{singleClick:this.handleLayerClick,doubleClick:this.handleLayerDoubleClick},b.default.createElement("div",{className:"et-fb-layers-view--label"},b.default.createElement("span",{className:"lv-placeholder"},r),!!a&&b.default.createElement("span",{className:"et-fb-layers-view--percentage"},a))):b.default.createElement(I.default,{singleClick:this.handleLayerClick,doubleClick:this.handleLayerDoubleClick},b.default.createElement("div",{className:"et-fb-layers-view--label"},b.default.createElement(N.default,{defaultText:n,text:r,tagName:"span",module:this.module,allModuleProps:e,name:"admin_label",callbackEditingStatusChange:this.callbackLabelEditing}),!!i&&b.default.createElement("span",{className:"et-fb-layers-view--inactive-notice"},i),!!a&&b.default.createElement("span",{className:"et-fb-layers-view--percentage"},a)))}},{key:"render",value:function(){var e;if((0,h.default)(this.props.attrs,"_deleted")||!this.props.isLayerVisible)return null;this.module={props:(0,U.prepareProps)(this.props,D.default.getComponentAtAddress(this.props.address))};var t=this.module.props,n=t.attrs;if(D.default.getAppPreference("hide_disabled_modules")&&(0,B.is)("disabled",t))return null;var r,o=D.default.getActiveProductTourElement(),a=!D.default.abIsMode("off",t.themeBuilderArea),i=a&&D.default.abIsSubject(t),l=a&&D.default.abIsGoal(t),u=D.default.isAllowedAction("move_module")&&!((0,U.isLayerLocked)(t)||t.isColumnSingle),s=x.default.shouldMultiItemMixed(t.address,t.type).isItemsMixed;switch(!0){case this.isLayerSelected()||(0,U.isLayerLocked)(t):r={color:O.default.white,backgroundColor:(0,U.getColorCode)(t)};break;case!this.isLayerSelected()&&this.isHovered():r={color:(0,U.getColorCode)(t),backgroundColor:O.default.layerBackground};break;default:r={color:(0,U.getColorCode)(t),backgroundColor:(0,R.default)(O.default.layerBackground,.6)}}var c=(ee(e={"et-fb-layers-view--layer":!0,"et-fb-layers-view--has-no-child":!this.props.hasChildren,"et-fb-layers-view--expanded":this.isLayerExpanded(),"et-fb-layers-view--hidden":!t.isLayerVisible,"et-fb-layers-view--disabled":(0,B.is)("disabled",t),"et-fb-layers-view--filter-parent":this.isFilterResultParent(),"et-fb-layers-view--filter-result":this.isFilterResult(),"et-fb-layers-view--library-parent":(0,U.isLibraryParent)(t),"et-fb-layers-view--library-item":(0,U.isLibraryItem)(t),"et-fb-layers-view--ab":i,"et-fb-layers-view--ab-goal":l,"et-fb-locked":(0,U.isLayerLocked)(t),et_pb_section:(0,B.is)("section",t),et_pb_fullwidth_section:(0,B.is)("fullwidth",t),et_section_regular:(0,B.is)("regular",t),et_section_specialty:(0,B.is)("specialty",t),et_pb_row:(0,B.is)("row",t),et_pb_row_inner:(0,B.is)("row-inner",t),et_pb_column:(0,B.is)("column",t),et_pb_column_inner:(0,B.is)("column-inner",t)},"et_pb_column_".concat(n.type),(0,h.default)(t,"isColumnSpecialty",!1)),ee(e,"et_pb_specialty_column",(0,h.default)(t,"isColumnSpecialty",!1)),ee(e,"et_pb_column_single",(0,h.default)(t,"isColumnSingle",!1)),ee(e,"et_pb_module",(0,B.is)("module",t)),ee(e,"et_pb_parent_locked",(0,U.isLayerLocked)(t)&&!(0,U.isLockedParent)(t)),ee(e,"et_fb_global_module",(0,U.isLayerGlobal)(t)),ee(e,"et_fb_locked_module",(0,U.isLayerLocked)(t)),ee(e,"et_fb_item_selected",(0,h.default)(t,"isItemMulti",!1)),ee(e,"et_fb_uneditable_module",!this.isAllowedAction("edit_module")),ee(e,"et_fb_container_mixed",!(0,W.hasValue)(o)&&s),ee(e,"et_fb_nonexistent_module",(0,B.is)("removed",t)),e);D.default.abIsMode("off",t.themeBuilderArea)||(D.default.abIsSubject(t)&&(c=(0,g.default)(c,ee({et_pb_ab_subject:!0},"et_pb_ab_subject_id-".concat((0,h.default)(ETBuilderBackend,"currentPage.id",""),"_").concat((0,h.default)(n,"ab_subject_id","")),!0))),D.default.abIsGoal(t)&&(c=(0,g.default)(c,ee({et_pb_ab_goal:!0},"et_pb_ab_goal-".concat((0,h.default)(ETBuilderBackend,"currentPage.id","")),!0)))),i&&(c=(0,g.default)(c,ee({},"et-fb-layers-view--ab-rank-".concat(D.default.abGetSubjectRank(t,"rank")),!0)));var d={className:(0,w.default)(c),"data-address":t.address,ref:this.layerRef};(0,h.default)(n,"global_module")&&(d["data-global-module"]=n.global_module),(0,B.is)("row",t)&&(d["data-column-count"]=(0,h.default)(t,"columnCount"),d["data-column-limit"]=(0,h.default)(t,"columnLimit"));var f={className:(0,w.default)({"et-fb-layers-view--content":!0,"et-fb-layers-view--column-content-locked":(0,h.default)(t,"isColumnSingle",!1),"et-fb-layers-view--filter-parent-content":this.isFilterResultParent(),"et-fb-layers-view--hover":this.isHovered(),"et-fb-layers-view--selected":this.isLayerSelected()}),onContextMenu:this.handleLayerRightClick,onMouseEnter:this.handleLayerMouseEnter,onMouseLeave:this.handleLayerMouseLeave,style:r};return D.default.abIsMode("selecting",t.themeBuilderArea)&&(f.onClick=this.handleLayerClick),b.default.createElement(T.default,{componentName:t.type},b.default.createElement("div",d,!(0,W.hasValue)(n.specialty_columns)&&!(0,U.isLibraryParent)(t)&&b.default.createElement("div",{className:(0,w.default)({"et-fb-layers-view--header":!0,et_fb_move_module_handler:u,"ui-sortable-handle":u})},this.renderToggle(),b.default.createElement("div",K({role:"presentation"},f),this.renderLabel(),this.renderActionButtons()),this.renderAddButton()),this.props.children))}}],r&&$(n.prototype,r),l&&$(n,l),Object.defineProperty(n,"prototype",{writable:!1}),H}(b.Component);ee(ne,"propTypes",{hasChildren:_.default.bool,isFilterActive:_.default.bool,isFilterResult:_.default.bool,isFilteredLayer:_.default.bool,isLayerExpanded:_.default.bool,isLayerSelected:_.default.bool,isLayerVisible:_.default.bool,isDelayRender:_.default.bool}),ee(ne,"defaultProps",{hasChildren:!1,isFilterActive:!1,isFilterResult:!1,isFilteredLayer:!1,isLayerExpanded:!1,isLayerSelected:!1,isLayerVisible:!1,isDelayRender:!1});var re=ne;t.default=re}).call(this,n(8))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.layerPreSortableInit=t.layerDragUpdate=void 0;var r=s(n(1)),o=s(n(5)),a=s(n(11)),i=s(n(22)),l=s(n(6)),u=n(94);function s(e){return e&&e.__esModule?e:{default:e}}t.layerDragUpdate=function(t,n){var a=e(this),s=e(n.item),c=ETBuilderBackend.i18n.sortable,d=l.default.getActiveThemeBuilderArea(),f=function(){a.sortable("cancel"),n.sender&&e(n.sender).sortable("cancel");var t=a.data("dragOptions");(0,r.default)(t,"isColumn")?i.default.cancelDraggingModule(!1,!0):i.default.cancelDraggingModule()};if(!l.default.abIsMode("off",d)){if(!l.default.isAllowedAction("ab_testing"))return i.default.setAlertModal(!0,"has_no_ab_permission"),void f();var p=(0,o.default)(e(n.sender))?e(t.target):e(n.sender),h=(0,o.default)(e(n.sender))?e(t.toElement):e(t.target),m=s.hasClass("et_pb_ab_subject"),y=s.hasClass("et_pb_ab_goal"),g=s.find(".et_pb_ab_subject").length,b=s.find(".et_pb_ab_goal").length,v=p.closest(".et_pb_ab_subject").length,_=h.closest(".et_pb_ab_subject").length,w=h.closest(".et_pb_ab_goal").length;if(y&&!m&&_)return i.default.setAlertModal(!0,"cannot_move_goal_into_subject"),void f();if(b&&_)return i.default.setAlertModal(!0,"cannot_move_goal_into_subject"),void f();if(m&&!y&&w)return i.default.setAlertModal(!0,"cannot_move_subject_into_goal"),void f();if(g&&w)return i.default.setAlertModal(!0,"cannot_move_subject_into_goal"),void f();if(y&&v)return i.default.setAlertModal(!0,"cannot_move_row_goal_out_from_subject"),void f()}if(!(0,o.default)(e(n.sender))&&a.hasClass("et_pb_row")){var O=e(t.target);if(O.attr("data-column-count")>=O.attr("data-column-limit"))return alert(c.stop_dropping_3_col_row),void f()}if((0,o.default)(e(n.sender))&&a.hasClass("et_pb_row")&&!a.find(".et_pb_column, .et_pb_column_inner").length&&s.hasClass("et_pb_column"))return alert(c.onlyColumnDraggedAway),void f();if(a.hasClass("et_pb_specialty_column")){var k=s.find(".et_pb_column").length,S=s.closest(".et_pb_specialty_column").hasClass("et_pb_column_2_3");if(!S&&k>=4||S&&k>4)return alert(c.stop_dropping_3_col_row),void f()}if(s.closest(".et_pb_row.et_fb_global_module").length&&s.hasClass("et_fb_global_module"))return alert(c.global_module_alert),void f();if((s.closest(".et_pb_section.et_fb_global_module").length||s.closest(".et_pb_row.et_fb_global_module").length)&&s.hasClass("et_fb_global_module"))return alert(c.global_module_alert),void f();var C=e(n.item[0]),E=e(t.target),P=C.is(".et_fb_global_module")||C.closest(".et_fb_global_module").length>0,T=E.is(".et_fb_global_module")||E.closest(".et_fb_global_module").length>0,M=C.is(".et_fb_global_module")?C:C.closest(".et_fb_global_module"),j=E.is(".et_fb_global_module")?E:E.closest(".et_fb_global_module"),x=M.attr("data-address"),D=j.attr("data-address"),N=M.attr("data-global-module"),L=j.attr("data-global-module"),R=x!==D,A=(0,u.hasValue)(L)&&N===L;P&&T&&R&&A&&f()};t.layerPreSortableInit=function(e,t,n){if(t.isRow?(t.address=n.attr("data-address"),t.connectWith=".et-fb-layers-view--expanded.et_pb_row:not(.et_pb_parent_locked)",t.child=".et_pb_column",t.childSlug="column",t.handle="> .et_fb_move_module_handler"):t.isColumn?e.hasClass("et_pb_specialty_column")?(t.connectWith=".et-fb-layers-view--expanded.et_pb_specialty_column:not(.et_pb_parent_locked), .et-fb-layers-view--expanded.et_section_regular",t.child=".et_pb_row_inner, > .et_pb_row",t.childSlug="row-inner",t.handle="> .et_fb_move_module_handler"):(t.connectWith=".et-fb-layers-view--expanded.et_pb_column:not(.et_pb_specialty_column, .et_pb_parent_locked)",t.child=".et_pb_module",t.childSlug="module",t.handle="> .et_fb_move_module_handler"):(t.address=n.attr("data-address"),e.hasClass("et_pb_fullwidth_section")?(t.connectWith=".et-fb-layers-view--expanded.et_pb_fullwidth_section",t.child=".et_pb_module",t.childSlug="fullwidth-module",t.handle="> .et_fb_move_module_handler"):(t.connectWith=".et-fb-layers-view--expanded.et_pb_specialty_column:not(.et_pb_parent_locked), .et-fb-layers-view--expanded.et_section_regular",t.child=".et_pb_row, > .et_pb_row_inner",t.childSlug="row-inner",t.handle="> .et_fb_move_module_handler")),(0,a.default)(e.data("uiSortable"))||(e.sortable("destroy"),e.removeClass("et_fb_container_mixed")),t.isItemsMixed&&(e.addClass("et_fb_container_mixed"),t.connectWith=(0,o.default)(t.newConnectWith)?t.connectWith:t.newConnectWith,t.childSlug=(0,o.default)(t.newChildSlug)?t.childSlug:t.newChildSlug,t.isColumn?e.hasClass("et_pb_specialty_column")?(t.child=".et_pb_row_inner.et_fb_item_selected",t.handle="> .et_fb_move_module_handler"):t.child=".et_pb_module.et_fb_item_selected":e.hasClass("et_pb_fullwidth_section")?t.child=".et_pb_module.et_fb_item_selected":(t.child=".et_pb_row.et_fb_item_selected",t.handle="> .et_fb_move_module_handler")),e.is(".et_fb_global_module"))if(t.isColumn){var r=n.closest(".et_fb_global_module"),i=r.attr("data-global-module"),l=r.attr("data-address"),u=r.is(".et_pb_section")?".et_pb_section":".et_pb_row",s=t.connectWith;t.connectWith=["".concat(u,":not(.et_fb_global_module) ").concat(s),"".concat(u,'.et_fb_global_module[data-address="').concat(l,'"] ').concat(s),"".concat(u,".et_fb_global_module:not(").concat(u,'[data-global-module="').concat(i,'"][data-address!="').concat(l,'"]) ').concat(s)].join(", ")}else{var c=e.attr("data-global-module"),d=e.attr("data-address"),f=t.connectWith;t.connectWith=["".concat(f,":not(.et_fb_global_module)"),"".concat(f,'.et_fb_global_module[data-address="').concat(d,'"]'),"".concat(f,".et_fb_global_module:not(").concat(f,'[data-global-module="').concat(c,'"][data-address!="').concat(d,'"])')].join(", ")}return t}}).call(this,n(8))},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";(function(e){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),a=n(67),i=h(n(13)),l=h(n(3)),u=h(n(5));n(1886);var s=h(n(22)),c=(h(n(6)),h(n(63))),d=h(n(43)),f=h(n(833)),p=h(n(281));function h(e){return e&&e.__esModule?e:{default:e}}function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function y(e,t){for(var n=0;n=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function Y(e,t,n,r,o,a,i){try{var l=e[a](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,o)}function X(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}(e,t)||J(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(e,t){if(e){if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},o=t.props,a=o.type,i=o.moduleWidth;L.default.getLayout(e,"exported",a,i,r).then((function(r){if(r.page&&r.total_pages){var o={page:parseInt(r.page)+1,timestamp:r.timestamp,file:null};t.exportLocalItem(e,n,o)}else{var a=(0,v.default)(r,"exported",""),i=(0,O.default)(n,{content:a,updatedItem:e});window.ETCloudApp.emitSignal({signal:"receiveItemUpdate",data:{data:i}})}}))})),ae(re(t),"exportExistingPage",(function(e){var n=(0,v.default)(e,"clickedItem.id",""),r=(0,v.default)(e,"clickedItem.name",""),o=(0,v.default)(e,"clickedItem.type",""),a=(0,v.default)(e,"itemPayload",[]),i=(0,v.default)(a,"cloud","off");L.default.getLayout(n,"exported",o).then((function(o){var l=(0,v.default)(o,"exported",{});if("off"===i)return(0,s.default)(e,"itemPayload.itemName",r),(0,s.default)(e,"itemPayload.content",l),void t.duplicateItem(e);var u=(0,O.default)(a,{title:r,content:l,updatedItem:n});window.ETCloudApp.emitSignal({signal:"receiveItemUpdate",data:{data:u}})}))})),ae(re(t),"onItemUpdate",(function(e,n){var r=t.props,o=r.type,a=r.moduleWidth,i=(0,v.default)(n,"clickedItem.id",""),l={item_id:i,update_details:(0,v.default)(n,"itemPayload",[])},u=(0,v.default)(l,"update_details",{}),c=(0,v.default)(u,"updateType","");t.setState({hideProgressBar:!0});if((0,g.default)(["duplicate","duplicate_and_delete","split_layout","split_section","split_row"],c)&&""!==(0,v.default)(l,"update_details.content",""))t.duplicateItem(n);else{if("duplicate_premade_item"===c)return t.setState({hideProgressBar:!1}),void t.duplicateItem(n);if("save_existing_page"===c)return t.setState({hideProgressBar:!1}),void t.exportExistingPage(n);if("toggle_cloud"===c||"duplicate"===c&&"on"===(0,v.default)(l,"update_details.cloud","")||(0,g.default)(["move_to","copy_to"],c))t.exportLocalItem(i,u);else{if("toggle_fav"===c){var d=(0,v.default)(n,"clickedItem.is_favorite")?"off":"on";(0,s.default)(l,"update_details.favoriteStatus",d)}"layout"!==o&&R.default.removeLibraryModule(o,a,i),L.default.updateLibraryItem(l).then((function(e){window.ETCloudApp.emitSignal({signal:"receiveItemUpdate",data:e})}))}}})),ae(re(t),"toggleCloudStatus",(function(e,n){var r=n.id;r&&L.default.toggleLibraryItemLocation({id:r}).then((function(e){var n=(0,v.default)(e,"data.localLibraryTerms",[]);if(!(0,m.default)(n)){var r={data:{filterType:"categories",localLibraryTerms:n,newFilters:n.layout_category}};t.updateFiltersLists(r);var o={data:{filterType:"tags",localLibraryTerms:n,newFilters:n.layout_tag}};t.updateFiltersLists(o)}}))})),ae(re(t),"onCloudItemAction",(function(e,n){var r=(0,v.default)(n,"content");switch(n.action){case"edit":t.onEditLayout(n.item,r,n.userCloudId);break;case"preview":t.onPreviewLayout(n.item,r);break;case"export":t.onExportLayout(n.item,r);break;case"split_layout":case"split_section":case"split_row":t.onSplitItem(n);break;case"convert_row_to_section":case"convert_module_to_row":case"convert_module_to_section":t.onConvertRowToSection(n);break;default:console.log("Action called!"),console.log(n)}})),ae(re(t),"onAccountStatusError",(function(e,n){var r=n,o="";(0,p.default)(n)&&(r=(0,v.default)(n,"status","not_found"),o=(0,v.default)(n,"sequence","")),t.setState({account_status_error:r,hideProgressBar:!0,onAuthenticationCompleteTriggerSequence:o}),t.props.pageChanged(!0),t.account={et_username:t.state.et_username,et_api_key:t.state.et_api_key,status:r},t.state.et_username&&t.state.et_api_key&&N.default.updateETAccount(t.account)})),ae(re(t),"onAuthenticationComplete",(function(){if(t.state.account_status_error)if(t.setState({ajax_in_progress:!1}),t.state.et_username&&t.state.et_api_key){t.account={et_username:t.state.et_username,et_api_key:t.state.et_api_key,status:"active"};var e=(0,v.default)(t.state,"onAuthenticationCompleteTriggerSequence","");if(t.setState({account_status_error:""}),t.setState({onAuthenticationCompleteTriggerSequence:""}),N.default.updateETAccount(t.account),""!==e){var n={apiKey:t.state.et_username,username:t.state.et_api_key};window.ETCloudApp.emitSignal({signal:e,data:{data:n}})}else window.ETCloudApp.retryUseLayout(t.account)}else t.setState({account_auth_failed:!0})})),ae(re(t),"onChangeAccountFields",(function(e,n){n!==t.state[e]&&t.setState(ae({},e,n))})),ae(re(t),"onClickAccountSubmit",(function(){t.setState({ajax_in_progress:!0}),t.onAuthenticationComplete()})),ae(re(t),"onClickHelpButton",(function(){N.default.setVideoList("et_pb_default_layouts",1,"library")})),ae(re(t),"onDismissedAccountStatusError",(function(){return t.setState({account_status_error:""})})),ae(re(t),"onDownloadProgress",(function(e,n){t.setState({hideProgressBar:!1}),(n=Math.floor(n/2))<1&&(n=1),t.props._onChange("importProgress",n)})),ae(re(t),"onLayoutsDataFetched",(function(e,n,r){t.props.type===r&&(t.setState({local_layouts:e,custom_layouts:n},(function(){t.props.doneLoading(),t.setState({localLayoutsLoading:!1})})),("layout"!==r||t.state.waitingForNewItem)&&("modules_all"!==t.props.active_tab&&window.ETCloudApp.toggleTab({items:e,tab:t.props.active_tab,forceUpdateLocal:!0}),t.state.waitingForNewItem&&(t.onClosePortability(),t.setState({waitingForNewItem:!1}))),t.setLayoutsFilter())})),ae(re(t),"onPageChanged",(function(e,n,r){t.props.pageChanged(!n,r)})),ae(re(t),"onUseLayout",(function(e,n){var r=t.props,o=(r._onChange,r.type),a=(r.importLayout,r.moduleWidth);if(t.setState({hideProgressBar:!1}),R.default.isProductTourActive()&&(0,S.default)("body").trigger("et_fb_product_tour_element_clicked"),(0,p.default)(n))var i=n.item,l=n.replace_content;else i=n;if((0,f.default)(i)){var u=JSON.parse(i),s=!(0,m.default)(u.presets);if(t.setState({presetImportObj:{item:i,replaceLayout:l}}),s)return void t.setState({presetImportActive:!0});t.importLayoutForUse()}else N.default.reImportGlobalColors(),l="on"===l,L.default.getLayout(i,"processed",o,a).then((function(e){var n="layout"===o,r=n?e:(0,v.default)(e,["savedShortcode",0],{});if(!n&&"global"===(0,v.default)(e,"is_global")){var a=(0,v.default)(e,"ID");r=t.prepareGlobalModule(r,a)}N.default.insertSavedModule(r,n,l),N.default.cancelTooltip()}))})),ae(re(t),"prepareGlobalModule",(function(e,n,r){return n?(r?(0,s.default)(e,"attrs.global_parent",n):(0,s.default)(e,"attrs.global_module",n),!(0,m.default)(e.content)&&(0,y.default)(e.content)&&(0,_.default)(e.content,(function(e){t.prepareGlobalModule(e,n,!0)})),e):e})),ae(re(t),"onExportLayout",(function(e,n){var r=(0,l.default)((0,v.default)(e,"id",0));if(0!==r||n){var o=t.props,a=o.type,i=o.moduleWidth,u=o.importLayout,s=o._onChange,c=function(r){R.default.addTogglePortabilityProgressBarListener(t.closeExportModalAfterExport),t.setState({portabilityActive:!0,portabilityId:r,portabilityTitle:e.name,portabilityProgressBar:!1,exportFromCloud:!!n})};if(n){var d=new x.default([JSON.stringify(n)],"layout.json",{type:"application/json"});s({importFile:d,importOptions:{replaceLayout:!1},cloudOptions:{moduleType:a,returnUnprocessedData:!0,useTempPresets:!0,callback:function(t){return L.default.saveTempDraft(e.name,t,a,i,"publish",e.row_layout,e.subtype).then((function(e){s({importProgress:100}),window.ETCloudApp.emitSignal({signal:"finishDownload",data:{}}),c(e)}))}}}),u()}else c(r)}})),ae(re(t),"onEditLayout",(function(e,n,r){var o=(0,l.default)((0,v.default)(e,"id",0));if(0!==o||n){var a=t.props,i=a.type,u=a.moduleWidth,s=a.importLayout,c=a._onChange;if(n){var d=new x.default([JSON.stringify(n)],"layout.json",{type:"application/json"}),f=window.open("about:blank","_blank");f.document.body.innerHTML='

',c({importFile:d,importOptions:{replaceLayout:!1},cloudOptions:{moduleType:i,returnUnprocessedData:!0,useTempPresets:!0,callback:function(t){return L.default.saveTempDraft(e.name,t,i,u).then((function(e){c({importProgress:100}),window.ETCloudApp.emitSignal({signal:"finishDownload",data:{}}),f.closed?L.default.clearTempDrafts(e):f.location.href="".concat(ETBuilderBackend.site_url,"/?post_type=et_pb_layout&p=").concat(e,"&et_fb=1&PageSpeed=off&cloudItem=").concat(o,"&userCloudId=").concat(r)}))}}}),s()}else"layout"!==i&&R.default.removeLibraryModule(i,u,o),window.open("".concat(ETBuilderBackend.site_url,"/?post_type=et_pb_layout&p=").concat(o,"&et_fb=1&PageSpeed=off"))}})),ae(re(t),"onPreviewLayout",(function(e,n){var r=(0,v.default)(e,"id"),o=t.props,a=o.type,i=o.moduleWidth,l=o.importLayout,u=o._onChange;if(r){var s=(0,v.default)(e,"name",r);t.setState({previewContentReady:!1,previewTitle:s});var c=function(e){switch(a){case"module":e="fullwidth"===i?'[et_pb_section fullwidth="on"]'.concat(e,"[/et_pb_section]"):'[et_pb_section][et_pb_row][et_pb_column type="4_4"]'.concat(e,"[/et_pb_column][/et_pb_row][/et_pb_section]");break;case"row":e="[et_pb_section]".concat(e,"[/et_pb_section]")}u({importProgress:100}),window.ETCloudApp.emitSignal({signal:"finishDownload",data:{}}),t.setState({previewActive:!0,previewContentReady:!0}),P.default.$topWindow("body").addClass("et-cloud-preview-active"),P.default.parseShortcode(e,(function(e){}),99999,P.default.$topWindow(".et_pb_library_preview .et-fb-main-settings"))};if(n){var d=new x.default([JSON.stringify(n)],"layout.json",{type:"application/json"});u({importFile:d,importOptions:{replaceLayout:!1,moduleType:a},cloudOptions:{returnUnprocessedData:!0,useTempPresets:!0,callback:c}}),l()}else L.default.getLayout(r,"raw",a).then((function(e){var t=(0,v.default)(e,"shortcode","");c(t)}))}})),ae(re(t),"onSplitItem",(function(e){var n=e.action,r=e.content,o=e.isCloudItem,a={clickedItem:e.item,isCloudItem:o,itemPayload:{content:r,updateType:n}};setTimeout((function(){t.props._onChange({importProgress:100}),window.ETCloudApp.emitSignal({signal:"finishDownload",data:{}}),window.ETCloudApp.emitSignal({signal:"updateItem",data:a})}),999)})),ae(re(t),"onConvertRowToSection",(function(e){var n=e.action,r=e.content,o=e.item;t.setState({conversionModalActive:!0,currentConversion:n}),L.default.convertLibraryItem(e).then((function(e){if(e.success){var a,i;switch(n){case"convert_row_to_section":a="row",i="section";break;case"convert_module_to_row":a="module",i="row";break;case"convert_module_to_section":a="module",i="section"}if(!r)return t.refreshByType(a),t.refreshByType(i),void setTimeout((function(){return t.setState({conversionInProgress:!1})}),1e3);t.setState({hideProgressBar:!0}),window.ETCloudApp.emitSignal({signal:"finishDownload",data:{}});var l=R.default.getCloudToken();r.data[1]=e.data;var u={title:o.name,content:JSON.stringify(r),categories:o.category_ids,tags:o.tag_ids,width:o.width,status:"publish",meta:{}};o.subtype&&(u.meta={_et_pb_module_type:o.subtype}),o.row_layout&&(u.meta._et_pb_row_layout=o.row_layout),o.is_favorite&&(u.meta["et-api-cloud-favorite"]=o.is_favorite);(0,U.saveToCloudWithToken)(l,i,u,{},(function(e){e&&(0,U.doApiRequest)({type:"delete",resource:a,resourceId:o.id,accessToken:l},{force:!0}).then((function(){t.refreshByType(a),t.refreshByType(i),t.setState({conversionInProgress:!1})}))}))}else t.onCloseConversionModal()}))})),ae(re(t),"duplicateItem",(function(e){var n=t.props,r=n.type,o=n.moduleWidth,a=n.importLayout,i=n._onChange,l=n.active_tab,u=(0,v.default)(e,"clickedItem.name",""),c=(0,v.default)(e,"itemPayload.content"),d=(0,v.default)(e,"itemPayload.updateType",""),f=(0,v.default)(e,"itemPayload.layoutType","");if(c)if(t.state.duplicateInProgress)setTimeout((function(){t.duplicateItem(e)}),1e3);else{t.setState({duplicateInProgress:!0});i({importFile:new x.default([JSON.stringify(c)],"layout.json",{type:"application/json"}),importOptions:{replaceLayout:!1,moduleType:r},cloudOptions:{returnUnprocessedData:!0,callback:function(n){if(t.mounted){var a={item_id:(0,v.default)(e,"clickedItem.id",""),update_details:(0,v.default)(e,"itemPayload",[])};a.update_details.shortcode=n,a.update_details.moduleWidth=o,a.update_details.layoutType=f||r;var i=function(){t.setState({localLayoutsLoading:!0}),B.ETCloudCache.addData([r,"modules_library","localItemsCached"],!1,!0),N.default.fetchLayoutsData(r)};"save_existing_page"===d&&t.props._onChange("importProgress",90),L.default.updateLibraryItem(a).then((function(n){t.mounted&&(t.refreshByType(d),(0,s.default)(n,"data.title",u),""!==(0,v.default)(e,"clickedItem.thumbnail","")?L.default.uploadLibraryFeaturedImage(n.data.newItem,(0,v.default)(e,"clickedItem.thumbnail","")).then((function(){"modules_all"===l&&i()})):"modules_all"===l&&i(),t.setState({duplicateInProgress:!1}),window.ETCloudApp.emitSignal({signal:"receiveItemUpdate",data:n}))}))}}}}),a()}})),ae(re(t),"onClosePreview",(function(){t.setState({previewActive:!1}),P.default.$topWindow("body").removeClass("et-cloud-preview-active"),L.default.clearTempPresets()})),ae(re(t),"onCancelPromptImport",(function(){t.onClosePresetImport(),t.setState({hideProgressBar:!0}),window.ETCloudApp.emitSignal({signal:"finishDownload",data:{}})})),ae(re(t),"onClosePresetImport",(function(){t.setState({presetImportActive:!1})})),ae(re(t),"onCloseConversionModal",(function(){t.setState({conversionModalActive:!1,conversionInProgress:!1,currentConversion:""})})),ae(re(t),"onClosePortability",(function(){var e=t.props,n=e.importItemsOpened,r=e._onChange,o=e.closeLibraryPortability;if(!t.state.importingToCloud){if(t.setState({portabilityActive:!1,portabilityProgressBar:!1,cloudImportProgress:1,cloudImportError:[],bulkImportInProgress:!1}),n)return r({importError:"",importProgress:100}),void o();if(R.default.revertExportProgressStatus(),t.state.exportFromCloud){var a={update_details:{updateType:"delete_permanently"},item_id:t.state.portabilityId};L.default.updateLibraryItem(a)}R.default.removeTogglePortabilityProgressBarListener(t.closeExportModalAfterExport)}})),ae(re(t),"onPromptImport",(function(){t.onClosePresetImport(),t.importLayoutForUse(t.state.promptOptions.importPresets)})),ae(re(t),"importLayoutForUse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"off",n=t.props,r=n._onChange,o=n.type,a=n.importLayout,i=t.state.presetImportObj,l=i.item,u=i.replaceLayout;l=new x.default([l],"layout.json",{type:"application/json"});var s=function(){"layout"!==o&&(r({importProgress:99}),N.default.reImportGlobalColors(),setTimeout((function(){return N.default.cancelTooltip()}),1e3))};r({importFile:l,importOptions:{replaceLayout:u,includeGlobalPresets:e},cloudOptions:{moduleType:o,returnUnprocessedData:!1,callback:s}}),setTimeout(a,100)})),ae(re(t),"renderPreview",(function(){if(!t.state.previewActive)return!1;var e=P.default.$topWindow("body");return k.default.createElement(D.default,{active:!0,actionType:"custom_content",tooltipTitle:t.state.previewTitle,_closeFunction:t.onClosePreview,classNames:{et_pb_library_preview:!0},ignorePosition:!0,enableContextMenu:!0,movable:!1,tooltipModalContainer:e},k.default.createElement(T.default,{isLoading:!t.state.previewContentReady}))})),ae(re(t),"renderPortability",(function(){var e=t.state,n=e.portabilityActive,r=e.portabilityTitle,o=e.portabilityProgressBar,a=e.portabilityId,i=t.props,l=i.importItemsOpened,u=i.type;if(!n&&!l)return!1;var s="Import ".concat((0,w.default)(u)),d=l?s:"Export ".concat((0,w.default)(u)),f=P.default.$topWindow("body"),p={et_pb_library_portability:!0,"et-fb-use-native-scroll":!0,et_pb_library_portability_import:l},h=""===t.state.cloudImportError&&o,m=window.ETCloudApp.getActiveFolderName();m="My Library"===m||""===m?"My":"".concat(m,"'s");var y="Import To ".concat(m," Cloud"),g=l&&!t.state.bulkImportInProgress;return k.default.createElement(k.Fragment,null,k.default.createElement("div",{className:"et-common-prompt__overlay et-library-export-modal"}),k.default.createElement(D.default,{active:!0,actionType:"custom_content",tooltipTitle:d,_closeFunction:t.onClosePortability,classNames:p,ignorePosition:!0,enableContextMenu:!0,movable:!1,tooltipModalContainer:f},k.default.createElement(I.default,{exportOnly:!l,importOnly:l,_renderTabs:c.default,preloadingItems:!1,tabClassName:C.default,active_tab:"modules_all",maxHeight:l?300:150,exportFileName:r,hasProgressBar:h,layoutId:a,importButtonName:s,cloudImportSupport:l,cloudImoirtCheckboxLabel:y,cloudImportLock:!R.default.isLocalLibraryImportSupport(),disableCheckmark:g,cloudImportProgress:t.state.cloudImportProgress,importError:t.state.cloudImportError,importEstimation:0,bulkImport:!0,importPreferences:{importOptions:{replaceLayout:!1,moduleType:u},cloudOptions:{returnUnprocessedData:!0,importContext:"et_builder_layouts",callback:t.importItemCallback}}})))})),ae(re(t),"onPromptOptionChange",(function(e,n){var r=X(n.split("|"),1)[0];t.setState(ae({},e,{importPresets:r}))})),ae(re(t),"renderPresetImport",(function(){var e=t.state,n=e.promptOptions;if(!e.presetImportActive)return!1;var r=ie.prompts,a=(0,o.default)(n,(function(e,t){return{value:r[t],label:(0,G.decode)(r[t]),className:t}})),l=(0,i.default)(n).join("|");return k.default.createElement("div",{className:"et_pb_library_preset_import"},k.default.createElement(W.default,null,k.default.createElement(W.default.Header,{onClose:t.onCancelPromptImport},r.importWithLabel),k.default.createElement(W.default.Content,null,k.default.createElement("p",null,r.importWithContent),k.default.createElement("div",{className:"et-fb-settings-option-container"},k.default.createElement(j.default,{value:l,name:"promptOptions",options:a,_onChange:t.onPromptOptionChange}))),k.default.createElement(W.default.Actions,null,k.default.createElement(V.default,{className:"et-common-button--primary",onClick:t.onPromptImport},r.import))))})),ae(re(t),"renderConversionArea",(function(){var e=t.state,n=e.currentConversion,r=e.conversionInProgress,o=e.conversionModalActive,a=ie.prompts,i=a.close,l=a.convertRowtoSection,u=a.convertModuletoRow,s=a.convertModuletoSection,c=a.convertToRowMsg,d=a.convertToSectionMsg;if(!o||!n)return!1;var f={convert_row_to_section:{title:l,msg:d},convert_module_to_row:{title:u,msg:c},convert_module_to_section:{title:s,msg:d}};return k.default.createElement("div",{className:"et-pb-library-conversion"},k.default.createElement(W.default,null,k.default.createElement(W.default.Header,null,f[n].title),k.default.createElement(W.default.Content,null,r&&k.default.createElement(T.default,{isLoading:!0,isInline:!0,useWrapper:!0}),!r&&k.default.createElement("p",null,f[n].msg)),!r&&k.default.createElement(W.default.Actions,null,k.default.createElement(V.default,{className:"et-common-button--primary",onClick:t.onCloseConversionModal},i))))})),ae(re(t),"importItemCallback",(function(e,n,r){if((null==r||!r.isBulkImport)&&(t.setState({hideProgressBar:!0,waitingForNewItem:!0,localLayoutsLoading:!0}),N.default.fetchLayoutsData(t.props.type),"on"===(0,v.default)(r,"importToCloud","off"))){var o=(0,v.default)(n,"data.jsonFromFile",{});if("et_builder_layouts"!==o.context)return void t.setState({cloudImportError:ie.tooltips.importContextFail,hideProgressBar:!0,waitingForNewItem:!1,localLayoutsLoading:!1});((0,m.default)(o)||(0,m.default)(o.data))&&t.setState({hideProgressBar:!0,waitingForNewItem:!1,localLayoutsLoading:!1}),t.bulkCloudSave(o)}})),ae(re(t),"splitToCloud",(function(e,n){var r=n.response,o=n.updateType,a={context:"et_builder_layouts",data:r};t.bulkCloudSave(a,o)})),ae(re(t),"refreshLocalAfterSplit",(function(e,n){t.refreshAfterSplit(n.updateType)})),ae(re(t),"refreshByType",(function(e){var t;switch(e){case"split_layout":case"section":t="section";break;case"split_section":case"row":t="row";break;case"split_row":case"module":t="module"}t&&(B.ETCloudCache.addData([t,"modules_library"],{},!0),N.default.fetchLayoutsData(t))})),t.closeToolTip=t.closeToolTip.bind(re(t)),t._openPrompt=t._openPrompt.bind(re(t)),t.account=R.default.getETAccount(),L.default.addLayoutsDataFetchedListener(t.onLayoutsDataFetched),P.default.appWindow().onAccountStatusError=t.onAccountStatusError;var n=A.default.getLayoutsTabs();return(0,p.default)(n)&&!(0,m.default)(n)&&(0,_.default)(n,(function(e,n){return t.tabs.push({name:e,className:n})})),t}return t=J,n=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.active_tab,r=this.props.active_tab,o=n!==r||!this.state.libraryTabMounted&&t.libraryTabMounted,a=n===r&&"modules_all"===n,l=this.state.localLayoutsLoading&&!t.localLayoutsLoading&&"modules_all"!==r;if(!e.backToLayouts||this.state.account_status_error||o){if(o||!a||l){var u=(0,v.default)(this.state.custom_layouts,n,[]);switch(n){case"modules_all":u=[];break;case"modules_library":u=this.state.local_layouts||[]}if(u.layouts){var s=(0,p.default)(u.layouts)?(0,i.default)(u.layouts):u.layouts;u.items=s}var c="existing_pages"===n?"Page":"";(o||l)&&window.ETCloudApp&&window.ETCloudApp.toggleTab({items:u,tab:n,itemsLabel:c}),this.setLayoutsFilter()}}else window.ETCloudApp.goTo("back");return!(0,h.default)(this.props,e)||!(0,h.default)(this.state,t)}},{key:"componentDidMount",value:function(){var e=this;this.mounted=!0,"layout"===this.props.type&&P.default.enableScrollLock(),P.default.$appWindow().on("et-fb-product-tour-skip",(function(e,t){window.ETCloudApp.productTourSkipStep(t,P.default.$topDocument())})),this.loadLibrary(),"layout"!==this.props.type&&"modules_library"===this.props.active_tab&&this.setState({libraryTabMounted:!0}),(0,S.default)(window).on("et_cloud_page_changed",this.onPageChanged),(0,S.default)(window).on("et_cloud_use_item",this.onUseLayout),(0,S.default)(window).on("et_cloud_download_progress",this.onDownloadProgress),(0,S.default)(window).on("et_cloud_account_status_error",this.onAccountStatusError),(0,S.default)(window).on("et_cloud_help",this.onClickHelpButton),(0,S.default)(window).on("et_cloud_item_action",this.onCloudItemAction),(0,S.default)(window).on("et_cloud_filter_update",this.onFilterUpdate),(0,S.default)(window).on("et_cloud_update_item",this.onItemUpdate),(0,S.default)(window).on("et_cloud_item_toggle_location",this.toggleCloudStatus),(0,S.default)(window).on("et_cloud_token_ready",this.saveCloudToken),(0,S.default)(window).on("et_cloud_token_removed",this.removeCloudToken),(0,S.default)(window).on("et_cloud_app_ready",this.loadCloudToken),(0,S.default)(window).on("et_cloud_app_conclude",this.closeToolTip),(0,S.default)(window).on("et_cloud_item_in_progress",this._openPrompt),(0,S.default)(window).on("et_cloud_split_item_to_cloud",this.splitToCloud),(0,S.default)(window).on("et_cloud_library_refresh_after_split",this.refreshLocalAfterSplit),R.default.addTogglePortabilityProgressBarListener(this.onPortabilityProgressBarChange),R.default.addBulkImportFinishedListener(this.onBulkImportFinished),R.default.addBulkImportInProgressListener(this.onBulkImportInProgress),window.addEventListener("et_fb_layout_import_error",this.onPortabilityImportError),(0,m.default)(this.state.local_layouts)?(setTimeout((function(){return N.default.fetchLayoutsData(e.props.type)}),0),this.setState({localLayoutsLoading:!0})):(this.props.doneLoading(),this._setLayoutsData(),this.setLayoutsFilter())}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.type===e.type?(e.backToLayouts&&this.state.account_status_error&&(this.setState({account_status_error:""}),this.props.pageChanged(!0)),e.importItemsOpened&&!this.props.importItemsOpened&&this.setState({portabilityProgressBar:!1})):this.loadLibrary()}},{key:"componentWillUnmount",value:function(){this.mounted=!1,L.default.removeLayoutsDataFetchedListener(this.onLayoutsDataFetched),R.default.removeTogglePortabilityProgressBarListener(this.onPortabilityProgressBarChange),R.default.removeTogglePortabilityProgressBarListener(this.closeExportModalAfterExport),(0,S.default)(window).off("et_cloud_page_changed",this.onPageChanged),(0,S.default)(window).off("et_cloud_use_item",this.onUseLayout),(0,S.default)(window).off("et_cloud_download_progress",this.onDownloadProgress),(0,S.default)(window).off("et_cloud_account_status_error",this.onAccountStatusError),(0,S.default)(window).off("et_cloud_help",this.onClickHelpButton),(0,S.default)(window).off("et_cloud_item_action",this.onCloudItemAction),(0,S.default)(window).off("et_cloud_filter_update",this.onFilterUpdate),(0,S.default)(window).off("et_cloud_update_item",this.onItemUpdate),(0,S.default)(window).off("et_cloud_item_toggle_location",this.toggleCloudStatus),(0,S.default)(window).off("et_cloud_token_ready",this.saveCloudToken),(0,S.default)(window).off("et_cloud_token_removed",this.removeCloudToken),(0,S.default)(window).off("et_cloud_app_ready",this.loadCloudToken),(0,S.default)(window).off("et_cloud_app_conclude",this.closeToolTip),(0,S.default)(window).off("et_cloud_item_in_progress",this._openPrompt),(0,S.default)(window).off("et_cloud_split_item_to_cloud",this.splitToCloud),(0,S.default)(window).off("et_cloud_library_refresh_after_split",this.refreshLocalAfterSplit),window.removeEventListener("et_fb_layout_import_error",this.onPortabilityImportError),R.default.removePreloaderFinishedListener(this.onBulkImportFinished),R.default.removeBulkImportInProgressListener(this.onBulkImportInProgress),this.state.duplicateInProgress&&(B.ETCloudCache.addData([this.props.type,"modules_library"],{},!0),N.default.fetchLayoutsData(this.props.type)),P.default.disableScrollLock(),this.onClosePortability(),R.default.emitPreloaderFinished(),L.default.clearTempDrafts("")}},{key:"saveCloudToken",value:function(){L.default.getCloudToken().then((function(e){var t=(0,v.default)(e,"data.accessToken","");N.default.updateETCloudToken(t),et_cloud_data.initialCloudStatus="on"}))}},{key:"removeCloudToken",value:function(){N.default.updateETCloudToken(""),et_cloud_data.initialCloudStatus="off"}},{key:"loadLibrary",value:function(){var e=this.props,t=e.type,n=e.active_tab,r=e.moduleWidth,o=e.maxColumns,a=e.isProductTour,i="layout"===t&&!this.isCurrentLayoutEmpty(),l=P.default.condition("is_rtl"),u={context:t,initialTab:n,editableTabs:["modules_library","existing_pages"],cloudTab:"modules_library",predefinedTab:"modules_all",existingPagesTab:"existing_pages",globalSupport:"layout"!==t,animation:R.default.getAppPreference("builder_animation"),isRtl:!(0,d.default)(l)&&l,isProductTour:a,showLoadOptions:i};if("module"===t&&r&&(u.permanentFilter={property:"width",value:r}),"row"===t&&o){var s=4===o?["4_4","1_2,1_2","1_3,1_3,1_3","1_4,1_4,1_4,1_4"]:["4_4","1_2,1_2","1_3,1_3,1_3"];u.permanentFilter={property:"row_layout",value:s}}(0,S.default)(window).trigger("et_cloud_container_ready",[u,P.default.topDocument()])}},{key:"_setLayoutsData",value:function(){var e=this.props.type;if((0,m.default)((0,v.default)(L.default,["layouts_data",e,"local_layouts"],{})))setTimeout((function(){return N.default.fetchLayoutsData(e)}),0),this.setState({localLayoutsLoading:!0});else{var t=(0,v.default)(L.default,["layouts_data",e,"local_layouts"],{}),n=(0,v.default)(L.default,["layouts_data",e,"custom_layouts"],{});this.setState({local_layouts:t,custom_layouts:n,localLayoutsLoading:!1})}}},{key:"UNSAFE_componentWillMount",value:function(){this._setLayoutsData()}},{key:"isCurrentLayoutEmpty",value:function(){return 0===(0,S.default)("#et_pb_root").find(".et_pb_module, .et-fb-skeleton--collapsed").length||R.default.isProductTourActive()}},{key:"bulkCloudSave",value:(E=$().mark((function e(t){var n,r,o,i,s,c,f,p,h,y,g,w,O,k,S,C,E,P,T,M=this,j=arguments;return $().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=j.length>1&&void 0!==j[1]&&j[1],r=j.length>2?j[2]:void 0,o=R.default.getCloudToken(),i=null!=r?r:(0,u.default)(t.data),s=01){var s={};(0,m.default)(t.images)||(0,_.default)(t.images,(function(t,n){-1!==e.post_content.indexOf(n)&&(s[n]=t)})),l.images=s}var c={title:e.post_title,content:JSON.stringify(l),categories:i,tags:o,meta:{},status:"publish",width:r?"fullwidth":""};(0,b.default)(e,"post_meta._et_pb_module_type")&&(c.meta._et_pb_module_type=e.post_meta._et_pb_module_type[0]),(0,b.default)(e,"post_meta._et_pb_row_layout")&&(c.meta._et_pb_row_layout=e.post_meta._et_pb_row_layout[0]),(0,v.default)(C,E)?(0,u.default)(C[E])>5&&(E++,C[E]=[]):C[E]=[],C[E].push({itemType:n,newCloudItem:c})})),(0,m.default)(C)){e.next=32;break}return P=[],T=window.ETCloudApp.getActiveFolderEndpoint(),C.forEach((function(e){P.push((function(){var t=[];return e.forEach((function(e){var n=e.itemType,r=e.newCloudItem;t.push(new Promise((function(e){if(M.state.importError)return e();e((0,U.saveToCloudWithToken)(o,n,r,{},!1,0,T).then((function(e){w(e)})))})))})),Promise.all(t)}))})),e.abrupt("return",P.reduce((function(e,t){return e.then(t).catch((function(e){console.warn("err",e.message)}))}),Promise.resolve()));case 32:case"end":return e.stop()}}),e,this)})),H=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=E.apply(e,t);function a(e){Y(o,n,r,a,i,"next",e)}function i(e){Y(o,n,r,a,i,"throw",e)}a(void 0)}))},function(e){return H.apply(this,arguments)})},{key:"bulkTermsCloudSave",value:function(e){var t=this;return new Promise((function(n){var r={tags:[],categories:[]},o=[];(0,_.default)(e,(function(e){(0,m.default)(e.terms)&&n(r),(0,_.default)(e.terms,(function(e){var t;switch(e.taxonomy){case"layout_tag":t={taxonomy:"tags",name:e.name},(0,a.default)(o,t)||o.push(t);break;case"layout_category":t={taxonomy:"categories",name:e.name},(0,a.default)(o,t)||o.push(t)}}))})),(0,m.default)(o)&&n(r);var i=[],l=0;if((0,_.default)(o,(function(e){(0,v.default)(i,l)?(0,u.default)(i[l])>5&&(i[++l]=[]):i[l]=[],i[l].push(e)})),(0,m.default)(i))n(r);else{var s=[];(0,_.default)(i,(function(e){s.push((function(){var o=[];(0,_.default)(e,(function(e){var n=e.name,a=e.taxonomy;o.push(new Promise((function(e){if(t.state.importError)return e();e((0,U.createMissingTermPure)(n,a,R.default.getCloudToken()).then((function(e){(0,m.default)(e)||function(e){var t=e.id,n=e.name,o=e.taxonomy;r[o].push({id:t,name:n})}(function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"upload";return t=function(t){_(p,t);var r=O(p);function p(){var e;g(this,p);for(var t=arguments.length,a=new Array(t),u=0;u0&&void 0!==arguments[0]?arguments[0]:{};e._onChange("importError",""),c.default.importLayout(y(y({},e.state),t)),c.default.togglePortabilityProgressBar("import",!0)})),E(S(e),"onExportError",(function(t){return e._onChange({exportError:t})})),E(S(e),"onImportError",(function(t){return e._onChange({importError:t})})),E(S(e),"onExportProgress",(function(t,n){e._onChange({exportProgress:t,exportEstimation:n})})),E(S(e),"onImportProgress",(function(t,r){"download"===n&&(t=t/2+25),e._onChange({importProgress:t,importEstimation:r})})),E(S(e),"_renderProgressBar",(function(){return o.default.createElement(f.default,{progress:e.state.importProgress,time_remaining:e.state.importEstimation})})),e}return v(p,[{key:"componentDidMount",value:function(){d.default.addImportProgressListener(this.onImportProgress),d.default.addImportErrorListener(this.onImportError),d.default.addExportProgressListener(this.onExportProgress),d.default.addExportErrorListener(this.onExportError);var e=d.default.getDroploaderPayloadPortability();e&&this.setState({active_tab:"modules_library",importOptions:(0,a.default)(this.state.importOptions,e.details.importOptions),importFile:e.details.importFile})}},{key:"componentDidUpdate",value:function(){var e=d.default.getDroploaderPayloadPortability();e&&this.state.importFile!==e.details.importFile&&this.setState({active_tab:"modules_library",importOptions:(0,a.default)(this.state.importOptions,e.details.importOptions),importFile:e.details.importFile})}},{key:"componentWillUnmount",value:function(){d.default.removeImportProgressListener(this.onImportProgress),d.default.removeImportErrorListener(this.onImportError),d.default.removeExportProgressListener(this.onExportProgress),d.default.removeExportErrorListener(this.onExportError)}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,u.default)(this.props,e)||!(0,u.default)(this.state,t)}},{key:"render",value:function(){var t=this.state.importProgress>0&&this.state.importProgress<100;return o.default.createElement("div",{className:"et-fb-with-portability"},o.default.createElement(e,h({isLoadingLayout:t,_renderProgressBar:this._renderProgressBar,_onChange:this._onChange,exportLayout:this.exportLayout,importFileName:this.importFileName,importLayout:this.importLayout},this.state,this.props)))}}]),p}(o.default.Component),E(t,"displayName","withPortability(".concat(e.displayName,")")),t};t.default=T},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=c(n(0)),a=c(n(13)),i=c(n(43)),l=c(n(63)),u=c(n(457)),s=n(506);function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),t}return t=c,r=[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.position,r=t.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:v({},n)})}}],(n=[{key:"componentDidMount",value:function(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var e,t,n;return null!==(e=null===(t=this.props)||void 0===t||null===(n=t.nodeRef)||void 0===n?void 0:n.current)&&void 0!==e?e:i.default.findDOMNode(this)}},{key:"render",value:function(){var e,t=this.props,n=(t.axis,t.bounds,t.children),r=t.defaultPosition,a=t.defaultClassName,i=t.defaultClassNameDragging,c=t.defaultClassNameDragged,f=t.position,h=t.positionOffset,m=(t.scale,g(t,p)),b={},_=null,w=!Boolean(f)||this.state.dragging,O=f||r,k={x:(0,s.canDragX)(this)&&w?this.state.x:O.x,y:(0,s.canDragY)(this)&&w?this.state.y:O.y};this.state.isElementSVG?_=(0,u.createSVGTransform)(k,h):b=(0,u.createCSSTransform)(k,h);var S=(0,l.default)(n.props.className||"",a,(T(e={},i,this.state.dragging),T(e,c,this.state.dragged),e));return o.createElement(d.default,y({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.cloneElement(o.Children.only(n),{className:S,style:v(v({},n.props.style),b),transform:_}))}}])&&O(t.prototype,n),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(o.Component);t.default=M,T(M,"displayName","Draggable"),T(M,"propTypes",v(v({},d.default.propTypes),{},{axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe})),T(M,"defaultProps",v(v({},d.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))},function(e,t,n){"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";var o=null===(e=window.document)||void 0===e||null===(t=e.documentElement)||void 0===t?void 0:t.style;if(!o)return"";if(n in o)return"";for(var i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n not mounted on DragStart!");var r=n.ownerDocument;if(!(e.props.disabled||!(t.target instanceof r.defaultView.Node)||e.props.handle&&!(0,l.matchesSelectorAndParentsTo)(t.target,e.props.handle,n)||e.props.cancel&&(0,l.matchesSelectorAndParentsTo)(t.target,e.props.cancel,n))){"touchstart"===t.type&&t.preventDefault();var o=(0,l.getTouchIdentifier)(t);e.setState({touchIdentifier:o});var a=(0,u.getControlPosition)(t,o,_(e));if(null!=a){var i=a.x,s=a.y,d=(0,u.createCoreData)(_(e),i,s);(0,c.default)("DraggableCore: handleDragStart: %j",d),(0,c.default)("calling",e.props.onStart),!1!==e.props.onStart(t,d)&&!1!==e.mounted&&(e.props.enableUserSelectHack&&(0,l.addUserSelectStyles)(r),e.setState({dragging:!0,lastX:i,lastY:s}),(0,l.addEvent)(r,C.move,e.handleDrag),(0,l.addEvent)(r,C.stop,e.handleDragStop))}}})),O(_(e),"handleDrag",(function(t){var n=(0,u.getControlPosition)(t,e.state.touchIdentifier,_(e));if(null!=n){var r=n.x,o=n.y;if(Array.isArray(e.props.grid)){var a=r-e.state.lastX,i=o-e.state.lastY,l=p((0,u.snapToGrid)(e.props.grid,a,i),2);if(a=l[0],i=l[1],!a&&!i)return;r=e.state.lastX+a,o=e.state.lastY+i}var s=(0,u.createCoreData)(_(e),r,o);if((0,c.default)("DraggableCore: handleDrag: %j",s),!1!==e.props.onDrag(t,s)&&!1!==e.mounted)e.setState({lastX:r,lastY:o});else try{e.handleDragStop(new MouseEvent("mouseup"))}catch(t){var d=document.createEvent("MouseEvents");d.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.handleDragStop(d)}}})),O(_(e),"handleDragStop",(function(t){if(e.state.dragging){var n=(0,u.getControlPosition)(t,e.state.touchIdentifier,_(e));if(null!=n){var r=n.x,o=n.y;if(Array.isArray(e.props.grid)){var a=r-e.state.lastX||0,i=o-e.state.lastY||0,s=p((0,u.snapToGrid)(e.props.grid,a,i),2);a=s[0],i=s[1],r=e.state.lastX+a,o=e.state.lastY+i}var d=(0,u.createCoreData)(_(e),r,o);if(!1===e.props.onStop(t,d)||!1===e.mounted)return!1;var f=e.findDOMNode();f&&e.props.enableUserSelectHack&&(0,l.removeUserSelectStyles)(f.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",d),e.setState({dragging:!1,lastX:NaN,lastY:NaN}),f&&((0,c.default)("DraggableCore: Removing handlers"),(0,l.removeEvent)(f.ownerDocument,C.move,e.handleDrag),(0,l.removeEvent)(f.ownerDocument,C.stop,e.handleDragStop))}}})),O(_(e),"onMouseDown",(function(t){return C=S,e.handleDragStart(t)})),O(_(e),"onMouseUp",(function(t){return C=S,e.handleDragStop(t)})),O(_(e),"onTouchStart",(function(t){return C=k,e.handleDragStart(t)})),O(_(e),"onTouchEnd",(function(t){return C=k,e.handleDragStop(t)})),e}return t=s,(n=[{key:"componentDidMount",value:function(){this.mounted=!0;var e=this.findDOMNode();e&&(0,l.addEvent)(e,k.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.findDOMNode();if(e){var t=e.ownerDocument;(0,l.removeEvent)(t,S.move,this.handleDrag),(0,l.removeEvent)(t,k.move,this.handleDrag),(0,l.removeEvent)(t,S.stop,this.handleDragStop),(0,l.removeEvent)(t,k.stop,this.handleDragStop),(0,l.removeEvent)(e,k.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,l.removeUserSelectStyles)(t)}}},{key:"findDOMNode",value:function(){var e,t,n;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(n=t.nodeRef)||void 0===n?void 0:n.current:i.default.findDOMNode(this)}},{key:"render",value:function(){return o.cloneElement(o.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&y(t.prototype,n),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Component);t.default=E,O(E,"displayName","DraggableCore"),O(E,"propTypes",{allowAnyClick:a.default.bool,disabled:a.default.bool,enableUserSelectHack:a.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:a.default.arrayOf(a.default.number),handle:a.default.string,cancel:a.default.string,nodeRef:a.default.object,onStart:a.default.func,onDrag:a.default.func,onStop:a.default.func,onMouseDown:a.default.func,scale:a.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),O(E,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=v(n(214)),a=v(n(11)),i=v(n(35)),l=v(n(5)),u=v(n(7)),s=v(n(1)),c=v(n(10)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),f=v(n(13)),p=n(93),h=v(n(22)),m=v(n(6)),y=v(n(43)),g=v(n(2));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function v(e){return e&&e.__esModule?e:{default:e}}function _(e,t){for(var n=0;n0&&k.default.createElement("div",{className:"et-fb-settings-option-container"},k.default.createElement(x.default,{value:t.state.selected_cats,name:"selected_cats",options:e.categoriesList,shortcut_index:"library-categories",_onChange:t._onInput,markedCategories:e.cloudCategoryNames,categoryMark:n})),r&&t.renderInputField("new_category_name"));return t.state.updatingCloudCategories&&(o=k.default.createElement("div",{className:"et-fb-settings-option",style:{height:"50px"}},k.default.createElement(H.default,null))),k.default.createElement("div",{className:"et-fb-settings-option"},k.default.createElement("label",null,le.addToCatText),o)})),ae(re(t),"getTags",(function(){var e=M.default.getLibraryTerms("layout_tag"),n=[],r=[],o={},a=0;return(0,h.default)(e)||(0,b.default)(e,(function(e,t){var n=(0,i.default)(e.name);r.push(n),o[a=t]=n})),"on"!==t.state.cloud||(0,h.default)((0,g.default)(t.state,"cloudTerms.tags",{}))||(0,b.default)((0,g.default)(t.state,"cloudTerms.tags",{}),(function(e,t){var l=(0,i.default)(e.name);(0,m.default)(r,l)||(a++,o[a]=l),n.push(l)})),{tagsList:o,cloudTagNames:n}})),ae(re(t),"renderInputField",(function(e){var n=M.default.getModuleLibrarySave(),r=(0,q.getSaveModalItemLabel)(n,e),o=(0,g.default)(t.state,e,"off"),a="";return(0,m.default)(["new_category_name","new_tag_name"],e)&&(a="new_category_name"===e?le.createCatText:le.createTagText),k.default.createElement("div",{className:"et-fb-settings-option"},r&&k.default.createElement("label",null,r),k.default.createElement("div",{className:t.setFieldClass(e)},k.default.createElement(A.default,{value:o,onChange:function(n){return t._onInput(e,n.target.value)},className:"et-fb-settings-option-input",placeholder:a})))})),ae(re(t),"_renderTags",(function(){var e=t.getTags(),n=k.default.createElement(R.default,{icon:"cloud",color:"#ffffff",className:"et-cloud-tag-mark",elementType:"span"}),r=j.default.currentUserCan("manageCategories")||"on"===t.state.cloud,o=k.default.createElement("div",{className:"et-fb-settings-option-container"},!(0,h.default)(e.tagsList)&&k.default.createElement(L.default,{name:"selected_tags",allTags:e.tagsList,selectedTags:t.state.selected_tags,onTagsChange:t._onTagsChange,markedTags:e.cloudTagNames,tagMark:n}),r&&t.renderInputField("new_tag_name"));return t.state.updatingCloudTags&&(o=k.default.createElement("div",{className:"et-fb-settings-option",style:{height:"60px"}},k.default.createElement(H.default,null))),k.default.createElement("div",{className:"et-fb-settings-option"},k.default.createElement("label",null,le.addToTagText),o)})),ae(re(t),"_renderIndividualSave",(function(){var e,n,r=M.default.getModuleLibrarySave();if((0,o.default)(r)&&"et_pb_column"===r.props.parent_slug)return null;if("root"===r){n=M.default.getSections();var a=(0,K.getShortcodeChildrenCount)(n),i=a.sections,l=a.rows,u=a.modules;e=[le.saveSectionsIndividual.replace("%s",i),le.saveRowsIndividual.replace("%s",l),le.saveModulesIndividual.replace("%s",u)]}else{n=M.default.getComponentAtAddress(r.props.address);var s=(0,K.getShortcodeChildrenCount)(n.content),c=s.rows,d=s.modules;switch((0,K.getType)(r)){case"et_pb_section":e=[le.saveRowsIndividual.replace("%s",c),le.saveModulesIndividual.replace("%s",d)];break;case"et_pb_row":e=[le.saveModulesIndividual.replace("%s",d)]}}return k.default.createElement("div",{className:"et-fb-settings-option"},k.default.createElement("label",null,le.saveIndividual),k.default.createElement("div",{className:"et-fb-settings-option-container"},k.default.createElement(x.default,{value:t.state.selected_children,name:"selected_children",options:e,shortcut_index:"library-individual",_onChange:t._onInput})))})),ae(re(t),"renderToggle",(function(e){var n="make_global"===e?le.globalTitle:ie["Save To Divi Cloud"],r=(0,g.default)(t.state,e,"off");return k.default.createElement("div",{className:"et-fb-settings-option"},k.default.createElement("label",null,n),k.default.createElement("div",{className:"et-fb-settings-option-container"},k.default.createElement(I.default,{name:e,value:r,onChange:t._onInput})))})),ae(re(t),"renderCloudFolders",(function(){var e=t.state,n=e.selectedCloud,r=e.sharedClouds;if(e.updatingSharedClouds)return k.default.createElement("div",{className:"et-fb-settings-option",style:{height:"60px"}},k.default.createElement(H.default,null));var o=(0,v.default)(r,(function(e){return!0===(0,g.default)(e,"permissions.add")})),a=(0,u.default)(o,["name"]);if((0,h.default)(a))return null;var i=(0,d.default)(a,(function(e){var t="".concat((0,g.default)(e,"name",""),"'s Cloud");return J(J({},e),{},{name:t})}));return i.unshift({id:0,name:ue["My Cloud"]}),k.default.createElement("div",{className:"et-fb-settings-option-container"},k.default.createElement("div",{className:"et-fb-settings-option"},k.default.createElement("label",null,ue["Choose Library"]),k.default.createElement(F.default,{name:"Choose Library",options:i,_onChange:t.onCloudFolderChange,value:n})))})),ae(re(t),"openCloudCheckout",(function(){T.default.updateCloudStatus({error:999})})),ae(re(t),"getCheckoutUrl",(function(){var e=P.default.param({type:"divi-cloud",is_popup:1});return"https://www.elegantthemes.com/members-area/checkout/?".concat(e)})),ae(re(t),"onCheckoutComplete",(function(e){"true"===(0,g.default)(e,"product_purchased")&&(T.default.updateCloudStatus({}),T.default.performLibraryModuleSaving(t.state))})),ae(re(t),"renderModalContent",(function(){var e=(0,g.default)(t.state,"cloudStatus.error");if(e){if("max_free_items"===e){var n=(0,g.default)(t.state,"cloudStatus.data.max_free_items",20),r=ie.$cloudUpgradeMessage.replace("%s",n);return k.default.createElement("div",null,k.default.createElement("h3",null,ie["Free Divi Cloud Limit Reached"]),k.default.createElement("p",null,r),k.default.createElement(N.default,{className:"et-common-button--primary et-fb-cloud-checkout-button",onClick:t.openCloudCheckout},ie["Get Unlimited Divi Cloud Storage"]))}return 999===e?k.default.createElement("div",null,k.default.createElement("div",{className:"et-cloud-login-notification"},k.default.createElement("h3",null,ie["Upgrade Your Divi Cloud"]),k.default.createElement("p",null,ie.$cloudBuyNotification)),k.default.createElement(B.default,{api:ETBuilderBackend.ajaxUrl,setDomainTokenNonce:ETBuilderBackend.nonces.saveDomainToken,domain:ETBuilderBackend.site_domain,frameUrl:t.getCheckoutUrl(),domainToken:ETBuilderBackend.domainToken,frameWidth:400,frameHeight:600,sendMessage:t.onCheckoutComplete,onFrameClose:function(){return T.default.updateCloudStatus({})},isCloud:!0})):k.default.createElement("div",null,k.default.createElement("div",{className:"et-cloud-login-notification"},k.default.createElement("h3",null,ie["Log In To Divi Cloud"]),k.default.createElement("p",null,ie.$cloudLoginNotification)),k.default.createElement(B.default,{api:ETBuilderBackend.ajaxUrl,setDomainTokenNonce:ETBuilderBackend.nonces.saveDomainToken,domain:ETBuilderBackend.site_domain,frameWidth:400,frameHeight:600,sendMessage:t.onDomainTokenGenerated,queryParams:{cloud_id:t.state.cloudId},onFrameClose:function(){return T.default.updateCloudStatus({})},isCloud:!0}))}var o,a,i=M.default.getModuleLibrarySave(),l="root"!==i?i.props:i,u="",s="",c=t.state.cloud;if("root"===l)o=le.descriptionTextLayout;else{var d=M.default.getModuleLibrarySave();o=(0,q.getSaveModalDescription)(d)}return t.isGlobalOptionSupported()&&"off"===c&&(u=t.renderToggle("make_global")),"off"===t.state.make_global&&(s=t.renderToggle("cloud")),"on"===c&&(a=t.renderCloudFolders()),k.default.createElement(k.Fragment,null,k.default.createElement("p",{className:"et-fb-description-text"},o),t.renderInputField("template_name"),s,t._renderCloudUpsell(),t._renderIndividualSave(),a,u,t._renderCategories(),t._renderTags())})),ae(re(t),"renderModalButton",(function(){if((0,g.default)(t.state,"cloudStatus.error"))return k.default.createElement("a",{href:"#",className:"et-fb-save-library-button et-fb-save-library-button--cancel",onClick:t._cancelCloud},le.cancel);var e="on"===t.state.cloud&&"off"===t.state.make_global?ie["Save To Divi Cloud"]:le.saveText;return k.default.createElement("a",{href:"#",className:"et-fb-save-library-button",onClick:t._onSave},e)})),ae(re(t),"render",(function(){var e=!(0,p.default)(t.props.maxHeight)&&t.props.maxHeight>0?{maxHeight:t.props.maxHeight}:"",n=(0,g.default)(t.state,"cloudStatus.error");return k.default.createElement("div",{className:"et-fb-settings-options-wrap",style:e},k.default.createElement("div",{className:"et-fb-settings-options"},t.renderModalContent(),!n&&k.default.createElement("div",{className:"et-fb-settings-option"},k.default.createElement(D.default,{videoListId:"et_pb_save_to_library",trigger:"tooltip"})),t.renderModalButton()))})),ae(re(t),"onDomainTokenGenerated",(function(e){if((0,y.default)(e,"divi_cloud_token")){var n=(0,U.decryptToken)((0,g.default)(e,"divi_cloud_token"),t.state.cloudId),r=1===(0,g.default)(e,"save_session_on_this_website",0);T.default.updateCloudStatus({}),(0,V.activateCloudPure)(n,r).then((function(e){e.error?T.default.updateCloudStatus(e):t.maybeRetrieveCloudTerms()}))}})),ae(re(t),"_onTagsChange",(function(e,n,r){var o=t.getTags(),a=t.state.selected_tags;if("add"===n){if(!(0,m.default)((0,f.default)(o.tagsList),e.id))return;a.push((0,l.default)(e.id))}else(0,s.default)(a,(function(t,n){return n===e}));t.setState(ae({},r,a))})),ae(re(t),"onCloudFolderChange",(function(e,n){t.setState({cloudTerms:{},selectedCloud:n},(function(){t.maybeRetrieveCloudTerms()}))})),ae(re(t),"_onInput",(function(e,n){switch(e){case"template_name":t.setState({name_error:""===n?"on":""});break;case"cloud":if("on"===n)t.maybeRetrieveCloudTerms();else t.setState({updatingCloudCategories:!1,updatingCloudTags:!1,selected_tags:[],selected_cats:""}),j.default.currentUserCan("manageCategories")||t.setState({new_category_name:"",new_tag_name:""})}t.setState(ae({},e,n))})),ae(re(t),"maybeRetrieveCloudTerms",(function(){var e=t.state,n=e.sharedClouds,r=e.selectedCloud;(0,h.default)(t.state.cloudTerms)&&(t.setState({updatingCloudCategories:!0,updatingCloudTags:!0,updatingSharedClouds:(0,h.default)(n),cloud:"on"}),(0,V.updateTokens)().then((function(e){var o=(0,g.default)(e,"accessToken",""),a=(0,g.default)(e,"sharedFolders",[]),i=0===r?{}:(0,_.default)(a,{id:r});if(""===o)T.default.updateCloudStatus({error:"auth_error"}),t.setState({updatingCloudCategories:!1,updatingCloudTags:!1,updatingSharedClouds:!1,cloud:"off"});else{G.ETCloudCache.setOfflineCache("sharedFolders",a),T.default.updateETCloudToken(o);var l=(0,h.default)(i)?"":"".concat(i.endpoint,"/cloud/v1");(0,V.retrieveCloudData)({type:"categoriesList",perPage:100,pageNo:1,isUserItems:!0,token:o,providedBaseUrl:l}).then((function(e){e.error?T.default.updateCloudStatus(e):t.setState({cloudTerms:J(J({},t.state.cloudTerms),{},{categories:e.data})}),t.setState({updatingCloudCategories:!1})})),(0,V.retrieveCloudData)({type:"tagsList",perPage:100,pageNo:1,isUserItems:!0,token:o,providedBaseUrl:l}).then((function(e){e.error?T.default.updateCloudStatus(e):t.setState({cloudTerms:J(J({},t.state.cloudTerms),{},{tags:e.data})}),t.setState({updatingCloudTags:!1})})),(0,h.default)(n)&&t.setState({sharedClouds:a}),t.setState({updatingSharedClouds:!1})}})))})),ae(re(t),"_getSelectedChindrenToSave",(function(){var e,n,r,o=t.state.selected_children.split("|");switch(o.length){case 1:r=(0,z.isOn)((0,g.default)(o,0,"off"));break;case 2:n=(0,z.isOn)((0,g.default)(o,0,"off")),r=(0,z.isOn)((0,g.default)(o,1,"off"));break;case 3:e=(0,z.isOn)((0,g.default)(o,0,"off")),n=(0,z.isOn)((0,g.default)(o,1,"off")),r=(0,z.isOn)((0,g.default)(o,2,"off"))}return{isSaveSections:e,isSaveRows:n,isSaveModules:r}})),ae(re(t),"_onSave",(function(n){var r=t.state,o=r.sharedClouds,a=r.selectedCloud;if(n.preventDefault(),""===r.template_name){var i=e(S.default.findDOMNode(re(t)));t.setState({name_error:"on"}),i.animate({scrollTop:0},1e3,"swing"),i.find("#et-fb-template_name").trigger("focus")}else{var l={};if("on"===t.state.cloud){var u=0===a?{}:(0,_.default)(o,{id:a}),s=(0,h.default)(u)?"":"".concat(u.endpoint,"/cloud/v1");l={selected_cats:"",selected_tags:[],new_category_name:(0,w.default)(t.getSelectedTermNames("categories"),r.new_category_name.split(",")).join(","),new_tag_name:(0,w.default)(t.getSelectedTermNames("tags"),r.new_tag_name.split(",")).join(","),providedBaseUrl:s}}T.default.performLibraryModuleSaving((0,O.default)({},r,l,t._getSelectedChindrenToSave())),"on"!==t.state.cloud&&T.default.cancelTooltip()}})),ae(re(t),"getSelectedTermNames",(function(e){var n="tags"===e?t.getTags().tagsList:t.getCategoriesNamesArray().categoriesList,r="tags"===e?t.state.selected_tags:t.state.selected_cats.split("|"),o=[];return(0,b.default)(r,(function(t,r){if("categories"!==e||"on"===t){var a="tags"===e?n[t]:n[r],i=(0,g.default)(a,"name",a);o.push(i)}})),o})),ae(re(t),"_cancelCloud",(function(){t.setState({cloud:"off"}),T.default.updateCloudStatus({})})),t}return n=X,r&&Q(n.prototype,r),$&&Q(n,$),Object.defineProperty(n,"prototype",{writable:!1}),n}(k.default.Component),ce=se;t.default=ce}).call(this,n(8))},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=g(n(28)),a=g(n(395)),i=g(n(33)),l=g(n(31)),u=g(n(5)),s=g(n(7)),c=g(n(1)),d=g(n(65)),f=g(n(162)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),h=g(n(3)),m=n(1905);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}function g(e){return e&&e.__esModule?e:{default:e}}function b(e,t){for(var n=0;n0}));return r.concat(o)}},{key:"resetAndFocusInput",value:function(){this.setState({query:""}),this.textInput&&(this.textInput.value="",this.textInput.focus())}},{key:"handleDelete",value:function(e,t){this.props.handleDelete(e,t),this.props.resetInputOnDelete?this.resetAndFocusInput():this.textInput&&this.textInput.focus(),t.stopPropagation()}},{key:"handleTagClick",value:function(e,t){this.props.handleTagClick&&this.props.handleTagClick(e,t),this.props.resetInputOnDelete?this.resetAndFocusInput():this.textInput&&this.textInput.focus()}},{key:"handleChange",value:function(e){this.props.handleInputChange&&this.props.handleInputChange(e.target.value);var t=e.target.value.trim();this.setState({query:t},this.updateSuggestions)}},{key:"handleFocus",value:function(e){var t=e.target.value;this.props.handleInputFocus&&this.props.handleInputFocus(t),this.setState({isFocused:!0})}},{key:"handleBlur",value:function(e){var t=e.target.value;this.props.handleInputBlur&&(this.props.handleInputBlur(t),this.textInput&&(this.textInput.value="")),this.setState({isFocused:!1})}},{key:"handleKeyDown",value:function(e){var t=this.state,n=t.query,r=t.selectedIndex,o=t.suggestions,a=t.selectionMode;if(e.keyCode===g.KEYS.ESCAPE&&(e.preventDefault(),e.stopPropagation(),this.setState({selectedIndex:-1,selectionMode:!1,suggestions:[]})),-1!==this.props.delimiters.indexOf(e.keyCode)&&!e.shiftKey){e.keyCode===g.KEYS.TAB&&""===n||e.preventDefault();var i=a&&-1!==r?o[r]:v({id:n},this.props.labelField,n);""!==i&&this.addTag(i)}e.keyCode===g.KEYS.BACKSPACE&&""===n&&this.props.allowDeleteFromEmptyInput&&this.handleDelete(this.props.tags.length-1,e),e.keyCode===g.KEYS.UP_ARROW&&(e.preventDefault(),this.setState({selectedIndex:r<=0?o.length-1:r-1,selectionMode:!0})),e.keyCode===g.KEYS.DOWN_ARROW&&(e.preventDefault(),this.setState({selectedIndex:0===o.length?-1:(r+1)%o.length,selectionMode:!0}))}},{key:"handlePaste",value:function(e){var t=this;if(this.props.allowAdditionFromPaste){e.preventDefault();var n=e.clipboardData||window.clipboardData,r=n.getData("text"),o=this.props.maxLength,a=void 0===o?r.length:o,i=Math.min(a,r.length),l=n.getData("text").substr(0,i),u=(0,y.buildRegExpFromDelimiters)(this.props.delimiters),s=l.split(u);(0,d.default)(s).forEach((function(e){return t.addTag(v({id:e},t.props.labelField,e))}))}}},{key:"handleSuggestionClick",value:function(e){this.addTag(this.state.suggestions[e])}},{key:"handleSuggestionHover",value:function(e){this.setState({selectedIndex:e,selectionMode:!0})}},{key:"moveTag",value:function(e,t){var n=this.props.tags[e];this.props.handleDrag(n,e,t)}},{key:"render",value:function(){var e=this,t=this.getTagItems(),n=r({},g.DEFAULT_CLASSNAMES,this.props.classNames),o=this.state.query.trim(),a=this.state.selectedIndex,l=this.state.suggestions,u=this.props,s=u.placeholder,c=u.name,d=u.id,p=u.maxLength,m=u.inline,y=u.inputFieldPosition,b=m?y:g.INPUT_FIELD_POSITIONS.BOTTOM,v=this.props.readOnly?null:i.default.createElement("div",{className:n.tagInput},i.default.createElement("input",{ref:function(t){e.textInput=t},className:n.tagInputField,type:"text",placeholder:s,"aria-label":s,onFocus:this.handleFocus,onBlur:this.handleBlur,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onPaste:this.handlePaste,name:c,id:d,maxLength:p,value:this.props.inputValue}),i.default.createElement(f.default,{query:o,suggestions:l,labelField:this.props.labelField,selectedIndex:a,handleClick:this.handleSuggestionClick,handleHover:this.handleSuggestionHover,minQueryLength:this.props.minQueryLength,shouldRenderSuggestions:this.props.shouldRenderSuggestions,isFocused:this.state.isFocused,classNames:n,renderSuggestion:this.props.renderSuggestion}));return i.default.createElement("div",{className:(0,h.default)(n.tags,"react-tags-wrapper")},b===g.INPUT_FIELD_POSITIONS.TOP&&v,i.default.createElement("div",{className:n.selected},t,b===g.INPUT_FIELD_POSITIONS.INLINE&&v),b===g.INPUT_FIELD_POSITIONS.BOTTOM&&v)}}]),t}(a.Component);_.propTypes={placeholder:p.default.string,labelField:p.default.string,suggestions:p.default.arrayOf(p.default.shape({id:p.default.string.isRequired})),delimiters:p.default.arrayOf(p.default.number),autofocus:p.default.bool,inline:p.default.bool,inputFieldPosition:p.default.oneOf([g.INPUT_FIELD_POSITIONS.INLINE,g.INPUT_FIELD_POSITIONS.TOP,g.INPUT_FIELD_POSITIONS.BOTTOM]),handleDelete:p.default.func,handleAddition:p.default.func,handleDrag:p.default.func,handleFilterSuggestions:p.default.func,handleTagClick:p.default.func,allowDeleteFromEmptyInput:p.default.bool,allowAdditionFromPaste:p.default.bool,allowDragDrop:p.default.bool,resetInputOnDelete:p.default.bool,handleInputChange:p.default.func,handleInputFocus:p.default.func,handleInputBlur:p.default.func,minQueryLength:p.default.number,shouldRenderSuggestions:p.default.func,removeComponent:p.default.func,autocomplete:p.default.oneOfType([p.default.bool,p.default.number]),readOnly:p.default.bool,classNames:p.default.object,name:p.default.string,id:p.default.string,maxLength:p.default.number,inputValue:p.default.string,tags:p.default.arrayOf(p.default.shape({id:p.default.string.isRequired,className:p.default.string})),allowUnique:p.default.bool,renderSuggestion:p.default.func},_.defaultProps={placeholder:g.DEFAULT_PLACEHOLDER,labelField:g.DEFAULT_LABEL_FIELD,suggestions:[],delimiters:[g.KEYS.ENTER,g.KEYS.TAB],autofocus:!0,inline:!0,inputFieldPosition:g.INPUT_FIELD_POSITIONS.INLINE,handleDelete:c.default,handleAddition:c.default,allowDeleteFromEmptyInput:!0,allowAdditionFromPaste:!0,resetInputOnDelete:!0,autocomplete:!1,readOnly:!1,allowUnique:!0,allowDragDrop:!0,tags:[]};var w=function(){var e=this;this.getQueryIndex=function(t,n){return n[e.props.labelField].toLowerCase().indexOf(t.toLowerCase())},this.updateSuggestions=function(){var t=e.state,n=t.query,r=t.selectedIndex,o=e.filteredSuggestions(n,e.props.suggestions);e.setState({suggestions:o,selectedIndex:r>=o.length?o.length-1:r})},this.addTag=function(t){var n=e.props,r=n.tags,o=n.labelField,a=n.allowUnique;if(t.id&&t[o]){var i=r.map((function(e){return e.id.toLowerCase()}));if(!(a&&i.indexOf(t.id.toLowerCase())>=0)){if(e.props.autocomplete){var l=e.filteredSuggestions(t[o],e.props.suggestions);(1===e.props.autocomplete&&1===l.length||!0===e.props.autocomplete&&l.length)&&(t=l[0])}e.props.handleAddition(t),e.setState({query:"",selectionMode:!1,selectedIndex:-1}),e.resetAndFocusInput()}}},this.getTagItems=function(){var t=e.props,n=t.classNames,o=t.tags,a=t.labelField,l=t.removeComponent,u=t.readOnly,s=t.allowDragDrop,c=s?e.moveTag:null;return o.map((function(t,o){return i.default.createElement(m.default,{key:t.id+"-"+o,index:o,tag:t,labelField:a,onDelete:e.handleDelete.bind(e,o),moveTag:c,removeComponent:l,onTagClicked:e.handleTagClick.bind(e,o),readOnly:u,classNames:r({},g.DEFAULT_CLASSNAMES,n),allowDragDrop:s})}))}};e.exports={WithContext:(0,l.DragDropContext)(u.default)(_),WithOutContext:_,KEYS:g.KEYS}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n"+(0,u.default)(e)+""}))}},r.shouldRenderSuggestions=function(e){var t=r.props,n=t.minQueryLength,o=t.isFocused;return e.length>=n&&o},r.renderSuggestion=function(e,t){var n=r.props.renderSuggestion;return"function"==typeof n?n(e,t):a.default.createElement("span",{dangerouslySetInnerHTML:r.markIt(e,t)})},d(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){var t=this.props,n=t.shouldRenderSuggestions||this.shouldRenderSuggestions;return t.isFocused!==e.isFocused||!(0,l.default)(t.suggestions,e.suggestions)||n(e.query)||n(e.query)!==n(t.query)}},{key:"componentDidUpdate",value:function(e){var t,n,r,o,a,i=this.props,l=i.selectedIndex,u=i.classNames;if(this.suggestionsContainer&&e.selectedIndex!==l){var s=this.suggestionsContainer.querySelector(u.activeSuggestion);s&&(t=s,n=this.suggestionsContainer,r=n.offsetHeight,o=t.offsetHeight,(a=t.offsetTop-n.scrollTop)+o>=r?n.scrollTop+=a-r+o:a<0&&(n.scrollTop+=a))}}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions.map(function(e,n){return a.default.createElement("li",{key:n,onMouseDown:t.handleClick.bind(null,n),onTouchStart:t.handleClick.bind(null,n),onMouseOver:t.handleHover.bind(null,n),className:n===t.selectedIndex?t.classNames.activeSuggestion:""},this.renderSuggestion(e,t.query))}.bind(this)),r=t.shouldRenderSuggestions||this.shouldRenderSuggestions;return 0!==n.length&&r(t.query)?a.default.createElement("div",{ref:function(t){e.suggestionsContainer=t},className:this.props.classNames.suggestions},a.default.createElement("ul",null," ",n," ")):null}}]),t}(o.Component);f.propTypes={query:i.default.string.isRequired,selectedIndex:i.default.number.isRequired,suggestions:i.default.array.isRequired,handleClick:i.default.func.isRequired,handleHover:i.default.func.isRequired,minQueryLength:i.default.number,shouldRenderSuggestions:i.default.func,isFocused:i.default.bool.isRequired,classNames:i.default.object,labelField:i.default.string.isRequired,renderSuggestion:i.default.func},f.defaultProps={minQueryLength:2},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;na&&u>l||(e.moveTag(o,a),t.getItem().index=a)}},canDrop:function(e){return(0,o.canDrop)(e)}};t.tagSource=a,t.tagTarget=i,t.dragSource=function(e,t){return{connectDragSource:e.dragSource(),isDragging:t.isDragging()}},t.dropCollect=function(e){return{connectDropTarget:e.dropTarget()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),o=a(n(3));function a(e){return e&&e.__esModule?e:{default:e}}var i=String.fromCharCode(215),l=function(e){var t=e.readOnly,n=e.removeComponent,o=e.onClick,a=e.className;if(t)return r.default.createElement("span",null);if(n){var l=n;return r.default.createElement(l,e)}return r.default.createElement("a",{onClick:o,className:a,onKeyDown:o},i)};l.propTypes={className:o.default.string,onClick:o.default.func.isRequired,readOnly:o.default.bool,removeComponent:o.default.func},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.KEYS={ENTER:13,TAB:9,BACKSPACE:8,UP_ARROW:38,DOWN_ARROW:40,ESCAPE:27},t.DEFAULT_PLACEHOLDER="Add new tag",t.DEFAULT_LABEL_FIELD="text",t.DEFAULT_CLASSNAMES={tags:"ReactTags__tags",tagInput:"ReactTags__tagInput",tagInputField:"ReactTags__tagInputField",selected:"ReactTags__selected",tag:"ReactTags__tag",remove:"ReactTags__remove",suggestions:"ReactTags__suggestions",activeSuggestion:"ReactTags__activeSuggestion"},t.INPUT_FIELD_POSITIONS={INLINE:"inline",TOP:"top",BOTTOM:"bottom"}},function(e,t,n){"use strict";n.r(t)},function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var o={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=a?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}o.default=e,n&&n.set(e,o);return o}(n(0)),i=(o=n(3))&&o.__esModule?o:{default:o};n(1913);var l=["className","type"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n