Page Builder by SiteOrigin - Version 2.11.3

Version Description

  • 14 September 2020 =
  • Block Editor: Added SEO support for multiple Layout Block instances.
  • Yoast SEO Sitemap: Added images added using Page Builder.
  • Prevented potential Are you sure you want to navigate away? notice.
  • Post Loop: Resolved Undefined index notice when used outside of Page Builder.
  • Android Chrome: Improved edit widget touch detection.
  • Yoast SEO: Resolved version 14.6 integration issue.
  • Block Editor: Used new categories for the Layout Block for WP 5.5+.
  • Block Editor: Resolved potential Layout Block data validation issue by running wp_targeted_link_rel on the generated preview content.
  • Block Editor: Added preview support for the Layout Block.
  • Block Editor: Updated translation functions to avoid potential conflicts.
  • Block Editor: Added the page name and block number to Layout Block JSON export files.
  • Block Editor: Improved SEO plugin support.
  • Added a global Row Mobile Bottom Margin setting at Settings > Page Builder > Layout.
  • Ensured Yoast SEO is ready before running compatibility functionality.
  • Global Settings: Resolved a jQuery Migrate Helper warning.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 Page Builder by SiteOrigin
Version 2.11.3
Comparing to
See all releases

Code changes from version 2.11.2 to 2.11.3

Files changed (85) hide show
  1. compat/js/siteorigin-panels-layout-block.js +59 -12
  2. compat/js/siteorigin-panels-layout-block.min.js +1 -1
  3. compat/layout-block.php +7 -0
  4. compat/yoast-sitemap.php +40 -0
  5. css/admin.css +0 -0
  6. css/images/cell-selected.png +0 -0
  7. css/images/cell-width.png +0 -0
  8. css/images/dialog-separator.png +0 -0
  9. css/images/dialog-separator@2x.png +0 -0
  10. css/images/dropdown-pointer.png +0 -0
  11. css/images/tooltip-pointer.png +0 -0
  12. css/images/wpspin_light-2x.gif +0 -0
  13. css/images/wpspin_light.gif +0 -0
  14. inc/admin.php +11 -2
  15. inc/live-editor.php +0 -0
  16. inc/renderer.php +1 -1
  17. inc/revisions.php +0 -0
  18. inc/settings.php +18 -10
  19. inc/sidebars-emulator.php +0 -0
  20. inc/styles.php +0 -0
  21. inc/widgets/post-loop.php +24 -13
  22. js/seo-compat.js +40 -21
  23. js/seo-compat.min.js +1 -1
  24. js/siteorigin-panels.js +60 -29
  25. js/siteorigin-panels.min.js +2 -2
  26. js/styling.js +5 -5
  27. js/styling.min.js +1 -1
  28. lang/siteorigin-panels.pot +124 -116
  29. license.txt +0 -0
  30. readme.txt +20 -2
  31. settings/admin-settings.css +0 -0
  32. settings/admin-settings.js +2 -3
  33. settings/admin-settings.min.js +1 -1
  34. settings/images/icon-layer.png +0 -0
  35. settings/tpl/help.php +0 -0
  36. settings/tpl/settings.php +0 -0
  37. siteorigin-panels.php +47 -42
  38. tpl/admin-home-page.php +0 -0
  39. tpl/help.php +0 -0
  40. tpl/js-templates.php +0 -0
  41. tpl/metabox-panels.php +0 -0
  42. widgets/img/checks/black.png +0 -0
  43. widgets/img/checks/blue.png +0 -0
  44. widgets/img/checks/charcoal.png +0 -0
  45. widgets/img/checks/green.png +0 -0
  46. widgets/img/checks/light.png +0 -0
  47. widgets/img/checks/orange.png +0 -0
  48. widgets/img/checks/pink.png +0 -0
  49. widgets/img/checks/purple.png +0 -0
  50. widgets/img/checks/slate.png +0 -0
  51. widgets/img/checks/tirquoise.png +0 -0
  52. widgets/img/textures/dark-dashed.png +0 -0
  53. widgets/img/textures/light-dashed.png +0 -0
  54. widgets/js/admin.js +0 -0
  55. widgets/js/embedded-video.js +0 -0
  56. widgets/js/jquery.fitvids.min.js +0 -0
  57. widgets/less/functions.php +0 -0
  58. widgets/lib/color.php +0 -0
  59. widgets/lib/lessc.inc.php +0 -0
  60. widgets/migration.php +0 -0
  61. widgets/widgets.php +0 -0
  62. widgets/widgets/animated-image/animated-image.php +0 -0
  63. widgets/widgets/animated-image/js/main.js +0 -0
  64. widgets/widgets/animated-image/js/onscreen.js +0 -0
  65. widgets/widgets/animated-image/tpl/default.php +0 -0
  66. widgets/widgets/button/button.php +0 -0
  67. widgets/widgets/button/presets/simple.php +0 -0
  68. widgets/widgets/button/styles/simple.less +0 -0
  69. widgets/widgets/button/tpl/simple.php +0 -0
  70. widgets/widgets/call-to-action/call-to-action.php +0 -0
  71. widgets/widgets/call-to-action/presets/simple.php +0 -0
  72. widgets/widgets/call-to-action/styles/simple.less +0 -0
  73. widgets/widgets/call-to-action/tpl/simple.php +0 -0
  74. widgets/widgets/list/list.php +0 -0
  75. widgets/widgets/list/presets/simple.php +0 -0
  76. widgets/widgets/list/styles/simple.less +0 -0
  77. widgets/widgets/list/tpl/simple.php +0 -0
  78. widgets/widgets/price-box/presets/simple.php +0 -0
  79. widgets/widgets/price-box/price-box.php +0 -0
  80. widgets/widgets/price-box/styles/simple.less +0 -0
  81. widgets/widgets/price-box/tpl/simple.php +0 -0
  82. widgets/widgets/testimonial/presets/simple.php +0 -0
  83. widgets/widgets/testimonial/styles/simple.less +0 -0
  84. widgets/widgets/testimonial/testimonial.php +0 -0
  85. widgets/widgets/testimonial/tpl/simple.php +0 -0
compat/js/siteorigin-panels-layout-block.js CHANGED
@@ -8,16 +8,46 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
8
 
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
12
 
13
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
 
15
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
 
17
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
-
19
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
-
21
  var _lodash = lodash,
22
  isEqual = _lodash.isEqual,
23
  debounce = _lodash.debounce,
@@ -34,7 +64,6 @@ var _wp$components = wp.components,
34
  Toolbar = _wp$components.Toolbar,
35
  IconButton = _wp$components.IconButton,
36
  Spinner = _wp$components.Spinner;
37
- var __ = wp.i18n.__;
38
  var _window = window,
39
  soPanelsBlockEditorAdmin = _window.soPanelsBlockEditorAdmin;
40
 
@@ -43,12 +72,14 @@ var SiteOriginPanelsLayoutBlock =
43
  function (_Component) {
44
  _inherits(SiteOriginPanelsLayoutBlock, _Component);
45
 
 
 
46
  function SiteOriginPanelsLayoutBlock(props) {
47
  var _this;
48
 
49
  _classCallCheck(this, SiteOriginPanelsLayoutBlock);
50
 
51
- _this = _possibleConstructorReturn(this, _getPrototypeOf(SiteOriginPanelsLayoutBlock).call(this, props));
52
  var editMode = soPanelsBlockEditorAdmin.defaultMode === 'edit' || isEmpty(props.panelsData);
53
  _this.state = {
54
  editing: editMode,
@@ -167,6 +198,12 @@ function (_Component) {
167
  }
168
  });
169
  jQuery(document).trigger('panels_setup', this.builderView);
 
 
 
 
 
 
170
  this.panelsInitialized = true;
171
  }
172
  }, {
@@ -222,7 +259,7 @@ function (_Component) {
222
  return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
223
  icon: "visibility",
224
  className: "components-icon-button components-toolbar__control",
225
- label: __('Preview layout.', 'siteorigin-panels'),
226
  onClick: switchToPreview
227
  }))), React.createElement("div", {
228
  key: "layout-block",
@@ -234,7 +271,7 @@ function (_Component) {
234
  return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
235
  icon: "edit",
236
  className: "components-icon-button components-toolbar__control",
237
- label: __('Edit layout.', 'siteorigin-panels'),
238
  onClick: switchToEditing
239
  }))), React.createElement("div", {
240
  key: "preview",
@@ -252,15 +289,18 @@ function (_Component) {
252
  return SiteOriginPanelsLayoutBlock;
253
  }(Component);
254
 
 
 
 
255
  registerBlockType('siteorigin-panels/layout-block', {
256
- title: __('SiteOrigin Layout', 'siteorigin-panels'),
257
- description: __("Build a layout using SiteOrigin's Page Builder.", 'siteorigin-panels'),
258
  icon: function icon() {
259
  return React.createElement("span", {
260
  className: "siteorigin-panels-block-icon"
261
  });
262
  },
263
- category: 'layout',
264
  keywords: ['page builder', 'column,grid', 'panel'],
265
  supports: {
266
  html: false
@@ -364,4 +404,11 @@ registerBlockType('siteorigin-panels/layout-block', {
364
  }, 100);
365
  });
366
  }
367
- })(jQuery);
 
 
 
 
 
 
 
8
 
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
10
 
11
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
+
13
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
+
15
+ function _createSuper(Derived) {
16
+ function isNativeReflectConstruct() {
17
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
18
+ if (Reflect.construct.sham) return false;
19
+ if (typeof Proxy === "function") return true;
20
+
21
+ try {
22
+ Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
23
+ return true;
24
+ } catch (e) {
25
+ return false;
26
+ }
27
+ }
28
+
29
+ return function () {
30
+ var Super = _getPrototypeOf(Derived),
31
+ result;
32
+
33
+ if (isNativeReflectConstruct()) {
34
+ var NewTarget = _getPrototypeOf(this).constructor;
35
+
36
+ result = Reflect.construct(Super, arguments, NewTarget);
37
+ } else {
38
+ result = Super.apply(this, arguments);
39
+ }
40
+
41
+ return _possibleConstructorReturn(this, result);
42
+ };
43
+ }
44
+
45
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
46
 
47
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
48
 
49
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
50
 
 
 
 
 
51
  var _lodash = lodash,
52
  isEqual = _lodash.isEqual,
53
  debounce = _lodash.debounce,
64
  Toolbar = _wp$components.Toolbar,
65
  IconButton = _wp$components.IconButton,
66
  Spinner = _wp$components.Spinner;
 
67
  var _window = window,
68
  soPanelsBlockEditorAdmin = _window.soPanelsBlockEditorAdmin;
69
 
72
  function (_Component) {
73
  _inherits(SiteOriginPanelsLayoutBlock, _Component);
74
 
75
+ var _super = _createSuper(SiteOriginPanelsLayoutBlock);
76
+
77
  function SiteOriginPanelsLayoutBlock(props) {
78
  var _this;
79
 
80
  _classCallCheck(this, SiteOriginPanelsLayoutBlock);
81
 
82
+ _this = _super.call(this, props);
83
  var editMode = soPanelsBlockEditorAdmin.defaultMode === 'edit' || isEmpty(props.panelsData);
84
  _this.state = {
85
  editing: editMode,
198
  }
199
  });
200
  jQuery(document).trigger('panels_setup', this.builderView);
201
+
202
+ if ( typeof window.soPanelsBuilderView == 'undefined' ) {
203
+ window.soPanelsBuilderView = [];
204
+ }
205
+ window.soPanelsBuilderView.push( this.builderView );
206
+
207
  this.panelsInitialized = true;
208
  }
209
  }, {
259
  return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
260
  icon: "visibility",
261
  className: "components-icon-button components-toolbar__control",
262
+ label: wp.i18n.__('Preview layout.', 'siteorigin-panels'),
263
  onClick: switchToPreview
264
  }))), React.createElement("div", {
265
  key: "layout-block",
271
  return React.createElement(Fragment, null, React.createElement(BlockControls, null, React.createElement(Toolbar, null, React.createElement(IconButton, {
272
  icon: "edit",
273
  className: "components-icon-button components-toolbar__control",
274
+ label: wp.i18n.__('Edit layout.', 'siteorigin-panels'),
275
  onClick: switchToEditing
276
  }))), React.createElement("div", {
277
  key: "preview",
289
  return SiteOriginPanelsLayoutBlock;
290
  }(Component);
291
 
292
+ var hasLayoutCategory = wp.blocks.getCategories().some(function (category) {
293
+ return category.slug === 'layout';
294
+ });
295
  registerBlockType('siteorigin-panels/layout-block', {
296
+ title: wp.i18n.__('SiteOrigin Layout', 'siteorigin-panels'),
297
+ description: wp.i18n.__("Build a layout using SiteOrigin's Page Builder.", 'siteorigin-panels'),
298
  icon: function icon() {
299
  return React.createElement("span", {
300
  className: "siteorigin-panels-block-icon"
301
  });
302
  },
303
+ category: hasLayoutCategory ? 'layout' : 'design',
304
  keywords: ['page builder', 'column,grid', 'panel'],
305
  supports: {
306
  html: false
404
  }, 100);
405
  });
406
  }
407
+ })(jQuery);
408
+
409
+ // Detect preview mode changes, and trigger resize.
410
+ jQuery(document).on('click', '.block-editor-post-preview__button-resize', function (e) {
411
+ if (!jQuery(this).hasClass('has-icon')) {
412
+ jQuery(window).trigger('resize');
413
+ }
414
+ });
compat/js/siteorigin-panels-layout-block.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";function _typeof(e){return(_typeof="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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(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}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _lodash=lodash,isEqual=_lodash.isEqual,debounce=_lodash.debounce,isEmpty=_lodash.isEmpty,isFunction=_lodash.isFunction,registerBlockType=wp.blocks.registerBlockType,_wp$element=wp.element,Component=_wp$element.Component,Fragment=_wp$element.Fragment,RawHTML=_wp$element.RawHTML,createRef=_wp$element.createRef,BlockControls=wp.editor.BlockControls,_wp$components=wp.components,Toolbar=_wp$components.Toolbar,IconButton=_wp$components.IconButton,Spinner=_wp$components.Spinner,__=wp.i18n.__,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){function t(e){var n;_classCallCheck(this,t),n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e));var i="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return n.state={editing:i,loadingPreview:!i,previewHtml:""},n.panelsContainer=createRef(),n.previewContainer=createRef(),n.panelsInitialized=!1,n.previewInitialized=!1,n}return _inherits(t,Component),_createClass(t,[{key:"componentDidMount",value:function(){this.isStillMounted=!0,this.state.editing?this.setupPanels():this.state.editing||this.previewInitialized||(this.fetchPreview(this.props),this.fetchPreview=debounce(this.fetchPreview,500))}},{key:"componentWillUnmount",value:function(){this.isStillMounted=!1,this.builderView&&this.builderView.off("content_change")}},{key:"componentDidUpdate",value:function(e){this.state.editing&&!this.panelsInitialized?this.setupPanels():this.state.loadingPreview?this.fetchPreview(this.props):!this.previewInitialized&&this.previewContainer.current&&(jQuery(document).trigger("panels_setup_preview"),this.previewInitialized=!0)}},{key:"setupPanels",value:function(){var e=this,t=jQuery(this.panelsContainer.current),n={editorType:"standalone",loadLiveEditor:!1,postId:soPanelsBlockEditorAdmin.postId,liveEditorPreview:soPanelsBlockEditorAdmin.liveEditor},i=new panels.model.builder;this.builderView=new panels.view.builder({model:i,config:n});var o=JSON.parse(JSON.stringify(jQuery.extend({},this.props.panelsData))),r=function(){isFunction(e.props.onRowOrWidgetMouseDown)&&e.props.onRowOrWidgetMouseDown();jQuery(document).on("mouseup",(function t(){jQuery(document).off("mouseup",t),isFunction(e.props.onRowOrWidgetMouseUp)&&e.props.onRowOrWidgetMouseUp()}))};this.builderView.on("row_added",(function(){e.builderView.$(".so-row-move").off("mousedown",r),e.builderView.$(".so-row-move").on("mousedown",r),e.builderView.$(".so-widget").off("mousedown",r),e.builderView.$(".so-widget").on("mousedown",r)})),this.builderView.on("widget_added",(function(){e.builderView.$(".so-widget").off("mousedown",r),e.builderView.$(".so-widget").on("mousedown",r)})),this.builderView.render().attach({container:t}).setData(o),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",(function(){var t=e.builderView.getData();e.panelsDataChanged=!isEqual(o,t),e.panelsDataChanged&&(e.props.onContentChange&&isFunction(e.props.onContentChange)&&e.props.onContentChange(t),e.setState({loadingPreview:!0,previewHtml:""}))})),jQuery(document).trigger("panels_setup",this.builderView),this.panelsInitialized=!0}},{key:"fetchPreview",value:function(e){var t=this;if(this.isStillMounted){this.previewInitialized=!1;var n=this.currentFetchRequest=jQuery.post({url:soPanelsBlockEditorAdmin.previewUrl,data:{action:"so_panels_layout_block_preview",panelsData:JSON.stringify(e.panelsData)}}).then((function(e){t.isStillMounted&&n===t.currentFetchRequest&&e&&t.setState({previewHtml:e,loadingPreview:!1})}));return n}}},{key:"render",value:function(){var e=this,t=this.props.panelsData;if(this.state.editing)return React.createElement(Fragment,null,React.createElement(BlockControls,null,React.createElement(Toolbar,null,React.createElement(IconButton,{icon:"visibility",className:"components-icon-button components-toolbar__control",label:__("Preview layout.","siteorigin-panels"),onClick:function(){t&&e.setState({editing:!1})}}))),React.createElement("div",{key:"layout-block",className:"siteorigin-panels-layout-block-container",ref:this.panelsContainer}));var n=this.state.loadingPreview;return React.createElement(Fragment,null,React.createElement(BlockControls,null,React.createElement(Toolbar,null,React.createElement(IconButton,{icon:"edit",className:"components-icon-button components-toolbar__control",label:__("Edit layout.","siteorigin-panels"),onClick:function(){e.panelsInitialized=!1,e.setState({editing:!0})}}))),React.createElement("div",{key:"preview",className:"so-panels-block-layout-preview-container"},n?React.createElement("div",{className:"so-panels-spinner-container"},React.createElement("span",null,React.createElement(Spinner,null))):React.createElement("div",{className:"so-panels-raw-html-container",ref:this.previewContainer},React.createElement(RawHTML,null,this.state.previewHtml))))}}]),t}();registerBlockType("siteorigin-panels/layout-block",{title:__("SiteOrigin Layout","siteorigin-panels"),description:__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:"layout",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"},contentPreview:{type:"string"}},edit:function(e){var t=e.attributes,n=e.setAttributes,i=e.toggleSelection;return React.createElement(SiteOriginPanelsLayoutBlock,{panelsData:t.panelsData,onContentChange:function(e){_.isEmpty(e.widgets)||(wp.data.dispatch("core/editor").lockPostSaving(),jQuery.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:wp.data.select("core/editor").getCurrentPostId()},(function(e){var t={};""!==e.sanitized_panels_data&&(t.panelsData=e.sanitized_panels_data),""!==e.preview&&(t.contentPreview=e.preview),n(t),wp.data.dispatch("core/editor").unlockPostSaving()})))},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(e){var t=e.attributes;return t.hasOwnProperty("contentPreview")?React.createElement(RawHTML,null,t.contentPreview):null}}),function(e){soPanelsBlockEditorAdmin.showAddButton&&e((function(){setTimeout((function(){var t=wp.data.dispatch("core/editor"),n=wp.data.select("core/editor"),i=e("#siteorigin-panels-add-layout-block-button").html(),o=e(i).insertAfter(".editor-writing-flow > div:first, .block-editor-writing-flow > div:not([tabindex])");o.on("click",(function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(n.isEditedPostEmpty()){var i=n.getBlocks();i.length?t.replaceBlock(i[0].clientId,e):t.insertBlock(e)}else t.insertBlock(e)}));var r=function(){wp.data.select("core/editor").isEditedPostEmpty()?o.show():o.hide()};wp.data.subscribe(r),r()}),100)}))}(jQuery);
1
+ "use strict";function _typeof(e){return(_typeof="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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _inherits(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}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(e){function t(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}return function(){var n,i=_getPrototypeOf(e);if(t()){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _lodash=lodash,isEqual=_lodash.isEqual,debounce=_lodash.debounce,isEmpty=_lodash.isEmpty,isFunction=_lodash.isFunction,registerBlockType=wp.blocks.registerBlockType,_wp$element=wp.element,Component=_wp$element.Component,Fragment=_wp$element.Fragment,RawHTML=_wp$element.RawHTML,createRef=_wp$element.createRef,BlockControls=wp.editor.BlockControls,_wp$components=wp.components,Toolbar=_wp$components.Toolbar,IconButton=_wp$components.IconButton,Spinner=_wp$components.Spinner,_window=window,soPanelsBlockEditorAdmin=_window.soPanelsBlockEditorAdmin,SiteOriginPanelsLayoutBlock=function(e){_inherits(n,Component);var t=_createSuper(n);function n(e){var i;_classCallCheck(this,n),i=t.call(this,e);var o="edit"===soPanelsBlockEditorAdmin.defaultMode||isEmpty(e.panelsData);return i.state={editing:o,loadingPreview:!o,previewHtml:""},i.panelsContainer=createRef(),i.previewContainer=createRef(),i.panelsInitialized=!1,i.previewInitialized=!1,i}return _createClass(n,[{key:"componentDidMount",value:function(){this.isStillMounted=!0,this.state.editing?this.setupPanels():this.state.editing||this.previewInitialized||(this.fetchPreview(this.props),this.fetchPreview=debounce(this.fetchPreview,500))}},{key:"componentWillUnmount",value:function(){this.isStillMounted=!1,this.builderView&&this.builderView.off("content_change")}},{key:"componentDidUpdate",value:function(e){this.state.editing&&!this.panelsInitialized?this.setupPanels():this.state.loadingPreview?this.fetchPreview(this.props):!this.previewInitialized&&this.previewContainer.current&&(jQuery(document).trigger("panels_setup_preview"),this.previewInitialized=!0)}},{key:"setupPanels",value:function(){var e=this,t=jQuery(this.panelsContainer.current),n={editorType:"standalone",loadLiveEditor:!1,postId:soPanelsBlockEditorAdmin.postId,liveEditorPreview:soPanelsBlockEditorAdmin.liveEditor},i=new panels.model.builder;this.builderView=new panels.view.builder({model:i,config:n});var o=JSON.parse(JSON.stringify(jQuery.extend({},this.props.panelsData))),r=function(){isFunction(e.props.onRowOrWidgetMouseDown)&&e.props.onRowOrWidgetMouseDown();jQuery(document).on("mouseup",(function t(){jQuery(document).off("mouseup",t),isFunction(e.props.onRowOrWidgetMouseUp)&&e.props.onRowOrWidgetMouseUp()}))};this.builderView.on("row_added",(function(){e.builderView.$(".so-row-move").off("mousedown",r),e.builderView.$(".so-row-move").on("mousedown",r),e.builderView.$(".so-widget").off("mousedown",r),e.builderView.$(".so-widget").on("mousedown",r)})),this.builderView.on("widget_added",(function(){e.builderView.$(".so-widget").off("mousedown",r),e.builderView.$(".so-widget").on("mousedown",r)})),this.builderView.render().attach({container:t}).setData(o),this.builderView.trigger("builder_resize"),this.builderView.on("content_change",(function(){var t=e.builderView.getData();e.panelsDataChanged=!isEqual(o,t),e.panelsDataChanged&&(e.props.onContentChange&&isFunction(e.props.onContentChange)&&e.props.onContentChange(t),e.setState({loadingPreview:!0,previewHtml:""}))})),jQuery(document).trigger("panels_setup",this.builderView),void 0===window.soPanelsBuilderView&&(window.soPanelsBuilderView=[]),window.soPanelsBuilderView.push(this.builderView),this.panelsInitialized=!0}},{key:"fetchPreview",value:function(e){var t=this;if(this.isStillMounted){this.previewInitialized=!1;var n=this.currentFetchRequest=jQuery.post({url:soPanelsBlockEditorAdmin.previewUrl,data:{action:"so_panels_layout_block_preview",panelsData:JSON.stringify(e.panelsData)}}).then((function(e){t.isStillMounted&&n===t.currentFetchRequest&&e&&t.setState({previewHtml:e,loadingPreview:!1})}));return n}}},{key:"render",value:function(){var e=this,t=this.props.panelsData;if(this.state.editing)return React.createElement(Fragment,null,React.createElement(BlockControls,null,React.createElement(Toolbar,null,React.createElement(IconButton,{icon:"visibility",className:"components-icon-button components-toolbar__control",label:wp.i18n.__("Preview layout.","siteorigin-panels"),onClick:function(){t&&e.setState({editing:!1})}}))),React.createElement("div",{key:"layout-block",className:"siteorigin-panels-layout-block-container",ref:this.panelsContainer}));var n=this.state.loadingPreview;return React.createElement(Fragment,null,React.createElement(BlockControls,null,React.createElement(Toolbar,null,React.createElement(IconButton,{icon:"edit",className:"components-icon-button components-toolbar__control",label:wp.i18n.__("Edit layout.","siteorigin-panels"),onClick:function(){e.panelsInitialized=!1,e.setState({editing:!0})}}))),React.createElement("div",{key:"preview",className:"so-panels-block-layout-preview-container"},n?React.createElement("div",{className:"so-panels-spinner-container"},React.createElement("span",null,React.createElement(Spinner,null))):React.createElement("div",{className:"so-panels-raw-html-container",ref:this.previewContainer},React.createElement(RawHTML,null,this.state.previewHtml))))}}]),n}(),hasLayoutCategory=wp.blocks.getCategories().some((function(e){return"layout"===e.slug}));registerBlockType("siteorigin-panels/layout-block",{title:wp.i18n.__("SiteOrigin Layout","siteorigin-panels"),description:wp.i18n.__("Build a layout using SiteOrigin's Page Builder.","siteorigin-panels"),icon:function(){return React.createElement("span",{className:"siteorigin-panels-block-icon"})},category:hasLayoutCategory?"layout":"design",keywords:["page builder","column,grid","panel"],supports:{html:!1},attributes:{panelsData:{type:"object"},contentPreview:{type:"string"}},edit:function(e){var t=e.attributes,n=e.setAttributes,i=e.toggleSelection;return React.createElement(SiteOriginPanelsLayoutBlock,{panelsData:t.panelsData,onContentChange:function(e){_.isEmpty(e.widgets)||(wp.data.dispatch("core/editor").lockPostSaving(),jQuery.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:wp.data.select("core/editor").getCurrentPostId()},(function(e){var t={};""!==e.sanitized_panels_data&&(t.panelsData=e.sanitized_panels_data),""!==e.preview&&(t.contentPreview=e.preview),n(t),wp.data.dispatch("core/editor").unlockPostSaving()})))},onRowOrWidgetMouseDown:function(){i(!1)},onRowOrWidgetMouseUp:function(){i(!0)}})},save:function(e){var t=e.attributes;return t.hasOwnProperty("contentPreview")?React.createElement(RawHTML,null,t.contentPreview):null}}),function(e){soPanelsBlockEditorAdmin.showAddButton&&e((function(){setTimeout((function(){var t=wp.data.dispatch("core/editor"),n=wp.data.select("core/editor"),i=e("#siteorigin-panels-add-layout-block-button").html(),o=e(i).insertAfter(".editor-writing-flow > div:first, .block-editor-writing-flow > div:not([tabindex])");o.on("click",(function(){var e=wp.blocks.createBlock("siteorigin-panels/layout-block",{});if(n.isEditedPostEmpty()){var i=n.getBlocks();i.length?t.replaceBlock(i[0].clientId,e):t.insertBlock(e)}else t.insertBlock(e)}));var r=function(){wp.data.select("core/editor").isEditedPostEmpty()?o.show():o.hide()};wp.data.subscribe(r),r()}),100)}))}(jQuery),jQuery(document).on("click",".block-editor-post-preview__button-resize",(function(e){jQuery(this).hasClass("has-icon")||jQuery(window).trigger("resize")}));
compat/layout-block.php CHANGED
@@ -20,6 +20,9 @@ class SiteOrigin_Panels_Compat_Layout_Block {
20
  // This action is slightly later than `enqueue_block_editor_assets`,
21
  // which we need to use to ensure our templates are loaded at the right time.
22
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_layout_block_editor_assets' ) );
 
 
 
23
  }
24
 
25
  public function register_layout_block() {
@@ -113,4 +116,8 @@ class SiteOrigin_Panels_Compat_Layout_Block {
113
  $panels_data = SiteOrigin_Panels_Styles_Admin::single()->sanitize_all( $panels_data );
114
  return $panels_data;
115
  }
 
 
 
 
116
  }
20
  // This action is slightly later than `enqueue_block_editor_assets`,
21
  // which we need to use to ensure our templates are loaded at the right time.
22
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_layout_block_editor_assets' ) );
23
+
24
+ // We need to override the container when using the Block Editor to allow for resizing.
25
+ add_filter( 'siteorigin_panels_full_width_container', array( $this, 'override_container' ) );
26
  }
27
 
28
  public function register_layout_block() {
116
  $panels_data = SiteOrigin_Panels_Styles_Admin::single()->sanitize_all( $panels_data );
117
  return $panels_data;
118
  }
119
+
120
+ function override_container( $container ) {
121
+ return SiteOrigin_Panels_Admin::is_block_editor() ? '.editor-styles-wrapper' : $container;
122
+ }
123
  }
compat/yoast-sitemap.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Returns a list of all images added using Page Builder.
5
+ *
6
+ * @param $images an array of all detected images used in the current post.
7
+ * @param $post_id the current post id.
8
+ *
9
+ * @return array
10
+ */
11
+ function siteorigin_yoast_sitemap_images_compat( $images, $post_id ) {
12
+ if (
13
+ get_post_meta( $post_id, 'panels_data', true ) &&
14
+ extension_loaded( 'xml' ) &&
15
+ class_exists( 'DOMDocument' )
16
+ ) {
17
+ $content = SiteOrigin_Panels::renderer()->render(
18
+ $post_id,
19
+ false
20
+ );
21
+
22
+ libxml_use_internal_errors( true );
23
+ $dom = new DOMDocument();
24
+ $dom->loadHTML( '<?xml encoding="UTF-8">' . $content );
25
+ libxml_clear_errors();
26
+
27
+ foreach ( $dom->getElementsByTagName( 'img' ) as $img ) {
28
+ $src = $img->getAttribute( 'src' );
29
+
30
+ if ( ! empty( $src ) && $src == esc_url( $src ) ) {
31
+ $images[] = array(
32
+ 'src' => $src,
33
+ );
34
+ }
35
+ }
36
+ }
37
+
38
+ return $images;
39
+ }
40
+ add_filter( 'wpseo_sitemap_urlimages', 'siteorigin_yoast_sitemap_images_compat', 10, 2 );
css/admin.css CHANGED
File without changes
css/images/cell-selected.png CHANGED
File without changes
css/images/cell-width.png CHANGED
File without changes
css/images/dialog-separator.png CHANGED
File without changes
css/images/dialog-separator@2x.png CHANGED
File without changes
css/images/dropdown-pointer.png CHANGED
File without changes
css/images/tooltip-pointer.png CHANGED
File without changes
css/images/wpspin_light-2x.gif CHANGED
File without changes
css/images/wpspin_light.gif CHANGED
File without changes
inc/admin.php CHANGED
@@ -528,11 +528,17 @@ class SiteOrigin_Panels_Admin {
528
 
529
  public function enqueue_seo_compat(){
530
  if ( self::is_admin() ) {
531
- if ( defined( 'WPSEO_FILE' ) && wp_script_is( 'yoast-seo-metabox' ) ) {
 
 
 
 
 
 
532
  wp_enqueue_script(
533
  'so-panels-seo-compat',
534
  siteorigin_panels_url( 'js/seo-compat' . SITEORIGIN_PANELS_JS_SUFFIX . '.js' ),
535
- array('jquery', 'yoast-seo-metabox' ),
536
  SITEORIGIN_PANELS_VERSION,
537
  true
538
  );
@@ -1124,6 +1130,9 @@ class SiteOrigin_Panels_Admin {
1124
 
1125
  $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] = true;
1126
  $return['preview'] = SiteOrigin_Panels::renderer()->render( intval( $_POST['post_id'] ), false, $panels_data );
 
 
 
1127
  unset( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] );
1128
 
1129
  echo json_encode( $return );
528
 
529
  public function enqueue_seo_compat(){
530
  if ( self::is_admin() ) {
531
+ if (
532
+ defined( 'WPSEO_FILE' ) &&
533
+ (
534
+ wp_script_is( 'yoast-seo-admin-global-script' ) || // => 14.6
535
+ wp_script_is( 'yoast-seo-metabox' ) // <= 14.5
536
+ )
537
+ ) {
538
  wp_enqueue_script(
539
  'so-panels-seo-compat',
540
  siteorigin_panels_url( 'js/seo-compat' . SITEORIGIN_PANELS_JS_SUFFIX . '.js' ),
541
+ array( 'jquery' ),
542
  SITEORIGIN_PANELS_VERSION,
543
  true
544
  );
1130
 
1131
  $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] = true;
1132
  $return['preview'] = SiteOrigin_Panels::renderer()->render( intval( $_POST['post_id'] ), false, $panels_data );
1133
+ if ( function_exists( 'wp_targeted_link_rel' ) ) {
1134
+ $return['preview'] = wp_targeted_link_rel( $return['preview'] );
1135
+ }
1136
  unset( $GLOBALS[ 'SITEORIGIN_PANELS_PREVIEW_RENDER' ] );
1137
 
1138
  echo json_encode( $return );
inc/live-editor.php CHANGED
File without changes
inc/renderer.php CHANGED
@@ -73,7 +73,7 @@ class SiteOrigin_Panels_Renderer {
73
 
74
  // Filter the bottom margin for this row with the arguments
75
  $panels_margin_bottom = apply_filters( 'siteorigin_panels_css_row_margin_bottom', $settings['margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id );
76
- $panels_mobile_margin_bottom = apply_filters( 'siteorigin_panels_css_row_mobile_margin_bottom', '', $row, $ri, $panels_data, $post_id );
77
 
78
  if ( empty( $row['cells'] ) ) {
79
  continue;
73
 
74
  // Filter the bottom margin for this row with the arguments
75
  $panels_margin_bottom = apply_filters( 'siteorigin_panels_css_row_margin_bottom', $settings['margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id );
76
+ $panels_mobile_margin_bottom = apply_filters( 'siteorigin_panels_css_row_mobile_margin_bottom', $settings['row-mobile-margin-bottom'] . 'px', $row, $ri, $panels_data, $post_id );
77
 
78
  if ( empty( $row['cells'] ) ) {
79
  continue;
inc/revisions.php CHANGED
File without changes
inc/settings.php CHANGED
@@ -134,15 +134,16 @@ class SiteOrigin_Panels_Settings {
134
  $defaults['instant-open-widgets'] = false;
135
 
136
  // The layout fields
137
- $defaults['responsive'] = true;
138
- $defaults['tablet-layout'] = false;
139
- $defaults['legacy-layout'] = 'auto';
140
- $defaults['tablet-width'] = 1024;
141
- $defaults['mobile-width'] = 780;
142
- $defaults['margin-bottom'] = 30;
143
- $defaults['margin-bottom-last-row'] = false;
144
- $defaults['margin-sides'] = 30;
145
- $defaults['full-width-container'] = 'body';
 
146
 
147
  // Content fields
148
  $defaults['copy-content'] = true;
@@ -253,7 +254,7 @@ class SiteOrigin_Panels_Settings {
253
 
254
  $fields['general']['fields']['use-classic'] = array(
255
  'type' => 'checkbox',
256
- 'label' => __( 'Use Classic Editor for new posts', 'siteorigin-panels' ),
257
  'description' => __( 'New posts of the above Post Types will be created using the Classic Editor.', 'siteorigin-panels' )
258
  );
259
 
@@ -417,6 +418,13 @@ class SiteOrigin_Panels_Settings {
417
  'description' => __( 'Default margin below rows and widgets.', 'siteorigin-panels' ),
418
  );
419
 
 
 
 
 
 
 
 
420
  $fields['layout']['fields']['margin-bottom-last-row'] = array(
421
  'type' => 'checkbox',
422
  'label' => __( 'Last Row With Margin', 'siteorigin-panels' ),
134
  $defaults['instant-open-widgets'] = false;
135
 
136
  // The layout fields
137
+ $defaults['responsive'] = true;
138
+ $defaults['tablet-layout'] = false;
139
+ $defaults['legacy-layout'] = 'auto';
140
+ $defaults['tablet-width'] = 1024;
141
+ $defaults['mobile-width'] = 780;
142
+ $defaults['margin-bottom'] = 30;
143
+ $defaults['row-mobile-margin-bottom'] = '';
144
+ $defaults['margin-bottom-last-row'] = false;
145
+ $defaults['margin-sides'] = 30;
146
+ $defaults['full-width-container'] = 'body';
147
 
148
  // Content fields
149
  $defaults['copy-content'] = true;
254
 
255
  $fields['general']['fields']['use-classic'] = array(
256
  'type' => 'checkbox',
257
+ 'label' => __( 'Use Classic Editor for New Posts', 'siteorigin-panels' ),
258
  'description' => __( 'New posts of the above Post Types will be created using the Classic Editor.', 'siteorigin-panels' )
259
  );
260
 
418
  'description' => __( 'Default margin below rows and widgets.', 'siteorigin-panels' ),
419
  );
420
 
421
+ $fields['layout']['fields']['row-mobile-margin-bottom'] = array(
422
+ 'type' => 'number',
423
+ 'unit' => 'px',
424
+ 'label' => __( 'Row Mobile Bottom Margin', 'siteorigin-panels' ),
425
+ 'description' => __( 'The default margin below rows on mobile.', 'siteorigin-panels' ),
426
+ );
427
+
428
  $fields['layout']['fields']['margin-bottom-last-row'] = array(
429
  'type' => 'checkbox',
430
  'label' => __( 'Last Row With Margin', 'siteorigin-panels' ),
inc/sidebars-emulator.php CHANGED
File without changes
inc/styles.php CHANGED
File without changes
inc/widgets/post-loop.php CHANGED
@@ -75,6 +75,7 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget {
75
  * @return array
76
  */
77
  function update( $new, $old ){
 
78
  if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
79
  $helper = $this->get_helper_widget( $this->get_loop_templates() );
80
  return $helper->update( $new, $old );
@@ -141,22 +142,32 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget {
141
 
142
  if( $wp_rewrite->using_permalinks() ) {
143
 
144
- if( get_query_var('paged') ) {
145
- // When the widget appears on a sub page.
146
- $query_args['paged'] = get_query_var('paged');
147
- } else if ( strpos( $_SERVER['REQUEST_URI'], '/page/' ) !== false ) {
148
- // When the widget appears on the home page.
149
- preg_match('/\/page\/([0-9]+)\//', $_SERVER['REQUEST_URI'], $matches);
150
- if(!empty($matches[1])) $query_args['paged'] = intval($matches[1]);
151
- else $query_args['paged'] = 1;
 
 
 
152
  } else {
153
- self::$current_pagination_id = strstr( $instance['panels_info']['widget_id'], '-', true );
154
- if ( isset( $_GET[ 'page-' . self::$current_pagination_id ] ) && is_numeric( $_GET[ 'page-' . self::$current_pagination_id ] ) ) {
155
- $query_args['paged'] = $_GET[ 'page-' . self::$current_pagination_id ];
156
- } else {
157
- $query_args['paged'] = 1;
 
 
 
158
  }
159
  }
 
 
 
 
160
  } else {
161
  // Get current page number when we're not using permalinks
162
  $query_args['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 1;
75
  * @return array
76
  */
77
  function update( $new, $old ){
78
+ $new['pagination_id'] = rand();
79
  if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
80
  $helper = $this->get_helper_widget( $this->get_loop_templates() );
81
  return $helper->update( $new, $old );
142
 
143
  if( $wp_rewrite->using_permalinks() ) {
144
 
145
+ if ( apply_filters( 'siteorigin_panels_post_loop_custom_pagination', false ) ) {
146
+ if ( isset( $instance['pagination_id'] ) ) {
147
+ self::$current_pagination_id = $instance['pagination_id'];
148
+
149
+ if (
150
+ isset( $_GET[ 'page-' . self::$current_pagination_id ] ) &&
151
+ is_numeric( $_GET[ 'page-' . self::$current_pagination_id ] )
152
+ ) {
153
+ $query_args['paged'] = $_GET[ 'page-' . self::$current_pagination_id ];
154
+ }
155
+ }
156
  } else {
157
+ if ( get_query_var( 'paged' ) ) {
158
+ // When the widget appears on a sub page.
159
+ $query_args['paged'] = get_query_var('paged');
160
+ } else if ( strpos( $_SERVER['REQUEST_URI'], '/page/' ) !== false ) {
161
+ // When the widget appears on the home page.
162
+ preg_match('/\/page\/([0-9]+)\//', $_SERVER['REQUEST_URI'], $matches);
163
+ if(!empty($matches[1])) $query_args['paged'] = intval($matches[1]);
164
+ else $query_args['paged'] = 1;
165
  }
166
  }
167
+
168
+ if ( ! isset( $query_args['paged'] ) ) {
169
+ $query_args['paged'] = 1;
170
+ }
171
  } else {
172
  // Get current page number when we're not using permalinks
173
  $query_args['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 1;
js/seo-compat.js CHANGED
@@ -16,20 +16,8 @@ jQuery(function($){
16
 
17
  };
18
 
19
- SiteOriginSeoCompat.prototype.contentModification = function(data) {
20
- if(
21
- typeof window.soPanelsBuilderView !== 'undefined' &&
22
- window.soPanelsBuilderView.contentPreview
23
- ) {
24
- var $data = $( window.soPanelsBuilderView.contentPreview );
25
-
26
- if( $data.find('.so-panel.widget').length === 0 ) {
27
- // Skip this for empty pages
28
- return data;
29
- }
30
-
31
- // Remove style tags created by Widgets Bundle
32
- $data.find('style').remove();
33
 
34
  var whitelist = [
35
  'p', 'a', 'img', 'caption', 'br',
@@ -39,18 +27,49 @@ jQuery(function($){
39
  'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
40
  'ul', 'ol', 'li',
41
  'table', 'tr', 'th', 'td'
42
- ].join(',');
 
 
 
 
 
 
 
 
43
 
44
- $data.find("*").not(whitelist).each(function() {
45
- var content = $(this).contents();
46
- $(this).replaceWith(content);
47
- });
48
 
49
- data = $data.html();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
 
52
  return data;
53
  };
54
 
55
- new SiteOriginSeoCompat();
 
 
 
 
 
 
 
 
 
56
  });
16
 
17
  };
18
 
19
+ SiteOriginSeoCompat.prototype.contentModification = function( data ) {
20
+ if ( typeof window.soPanelsBuilderView !== 'undefined' ) {
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  var whitelist = [
23
  'p', 'a', 'img', 'caption', 'br',
27
  'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
28
  'ul', 'ol', 'li',
29
  'table', 'tr', 'th', 'td'
30
+ ].join( ',' );
31
+
32
+ var extractContent = function( data ) {
33
+ var $data = $( data );
34
+
35
+ if( $data.find( '.so-panel.widget' ).length === 0 ) {
36
+ // Skip this for empty pages
37
+ return data;
38
+ }
39
 
40
+ // Remove style tags created by Widgets Bundle
41
+ $data.find( 'style' ).remove();
 
 
42
 
43
+ $data.find( "*") .not( whitelist ).each( function() {
44
+ var content = $( this ).contents();
45
+ $( this ).replaceWith( content );
46
+ } );
47
+
48
+ return $data.html();
49
+ };
50
+
51
+ if ( ! Array.isArray( window.soPanelsBuilderView ) ) {
52
+ data = extractContent( window.soPanelsBuilderView.contentPreview );
53
+ } else {
54
+ var $this = this;
55
+ data = null;
56
+ window.soPanelsBuilderView.forEach( function( panel ) {
57
+ data += extractContent( panel.contentPreview );
58
+ } );
59
+ }
60
  }
61
 
62
  return data;
63
  };
64
 
65
+ if ( typeof rankMathEditor !== 'undefined' ) {
66
+ new SiteOriginSeoCompat();
67
+ } else {
68
+ $( window ).on(
69
+ 'YoastSEO:ready',
70
+ function () {
71
+ new SiteOriginSeoCompat();
72
+ }
73
+ );
74
+ }
75
  });
js/seo-compat.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function(t){var i=function(){"undefined"!=typeof YoastSEO&&(YoastSEO.app.registerPlugin("SiteOriginSeoCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"SiteOriginSeoCompat",5)),"undefined"!=typeof rankMathEditor&&wp.hooks.addFilter("rank_math_content","SiteOriginSeoCompat",this.contentModification)};i.prototype.contentModification=function(i){if(void 0!==window.soPanelsBuilderView&&window.soPanelsBuilderView.contentPreview){var e=t(window.soPanelsBuilderView.contentPreview);if(0===e.find(".so-panel.widget").length)return i;e.find("style").remove();var n=["p","a","img","caption","br","blockquote","cite","em","strong","i","b","q","h1","h2","h3","h4","h5","h6","ul","ol","li","table","tr","th","td"].join(",");e.find("*").not(n).each((function(){var i=t(this).contents();t(this).replaceWith(i)})),i=e.html()}return i},new i}));
1
+ jQuery((function(t){var i=function(){"undefined"!=typeof YoastSEO&&(YoastSEO.app.registerPlugin("SiteOriginSeoCompat",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"SiteOriginSeoCompat",5)),"undefined"!=typeof rankMathEditor&&wp.hooks.addFilter("rank_math_content","SiteOriginSeoCompat",this.contentModification)};i.prototype.contentModification=function(i){if(void 0!==window.soPanelsBuilderView){var n=["p","a","img","caption","br","blockquote","cite","em","strong","i","b","q","h1","h2","h3","h4","h5","h6","ul","ol","li","table","tr","th","td"].join(","),e=function(i){var e=t(i);return 0===e.find(".so-panel.widget").length?i:(e.find("style").remove(),e.find("*").not(n).each((function(){var i=t(this).contents();t(this).replaceWith(i)})),e.html())};if(Array.isArray(window.soPanelsBuilderView)){i=null,window.soPanelsBuilderView.forEach((function(t){i+=e(t.contentPreview)}))}else i=e(window.soPanelsBuilderView.contentPreview)}return i},"undefined"!=typeof rankMathEditor?new i:t(window).on("YoastSEO:ready",(function(){new i}))}));
js/siteorigin-panels.js CHANGED
@@ -554,9 +554,15 @@ module.exports = panels.view.dialog.extend( {
554
  c.find( '.so-export' ).submit( function ( e ) {
555
  var $$ = $( this );
556
  var panelsData = thisView.builder.model.getPanelsData();
557
- var postName = $('input[name="post_title"]').val();
558
  if ( ! postName ) {
559
  postName = $('input[name="post_ID"]').val();
 
 
 
 
 
 
560
  }
561
  panelsData.name = postName;
562
  $$.find( 'input[name="panels_export_data"]' ).val( JSON.stringify( panelsData ) );
@@ -564,6 +570,16 @@ module.exports = panels.view.dialog.extend( {
564
 
565
  },
566
 
 
 
 
 
 
 
 
 
 
 
567
  /**
568
  * Display the layout directory tab.
569
  *
@@ -1894,7 +1910,7 @@ module.exports = panels.view.dialog.extend( {
1894
 
1895
  } );
1896
 
1897
- },{"../view/widgets/js-widget":31}],10:[function(require,module,exports){
1898
  var panels = window.panels, $ = jQuery;
1899
 
1900
  module.exports = panels.view.dialog.extend( {
@@ -2203,6 +2219,17 @@ module.exports = {
2203
  };
2204
 
2205
  },{}],12:[function(require,module,exports){
 
 
 
 
 
 
 
 
 
 
 
2206
  module.exports = {
2207
  /**
2208
  * Lock window scrolling for the main overlay
@@ -2249,7 +2276,7 @@ module.exports = {
2249
  },
2250
  };
2251
 
2252
- },{}],13:[function(require,module,exports){
2253
  /*
2254
  This is a modified version of https://github.com/underdogio/backbone-serialize/
2255
  */
@@ -2360,7 +2387,7 @@ module.exports = {
2360
  }
2361
  };
2362
 
2363
- },{}],14:[function(require,module,exports){
2364
  module.exports = {
2365
 
2366
  generateUUID: function(){
@@ -2397,7 +2424,7 @@ module.exports = {
2397
 
2398
  }
2399
 
2400
- },{}],15:[function(require,module,exports){
2401
  /* global _, jQuery, panels */
2402
 
2403
  var panels = window.panels, $ = jQuery;
@@ -2486,7 +2513,7 @@ module.exports = function ( config, force ) {
2486
  } );
2487
  };
2488
 
2489
- },{}],16:[function(require,module,exports){
2490
  /**
2491
  * Everything we need for SiteOrigin Page Builder.
2492
  *
@@ -2506,6 +2533,7 @@ window.siteoriginPanels = panels;
2506
  panels.helpers = {};
2507
  panels.helpers.clipboard = require( './helpers/clipboard' );
2508
  panels.helpers.utils = require( './helpers/utils' );
 
2509
  panels.helpers.serialize = require( './helpers/serialize' );
2510
  panels.helpers.pageScroll = require( './helpers/page-scroll' );
2511
 
@@ -2660,7 +2688,7 @@ jQuery( function ( $ ) {
2660
  });
2661
  } );
2662
 
2663
- },{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/page-scroll":12,"./helpers/serialize":13,"./helpers/utils":14,"./jquery/setup-builder-widget":15,"./model/builder":17,"./model/cell":18,"./model/history-entry":19,"./model/row":20,"./model/widget":21,"./utils/menu":22,"./view/builder":23,"./view/cell":24,"./view/dialog":25,"./view/live-editor":26,"./view/row":27,"./view/styles":28,"./view/widget":29}],17:[function(require,module,exports){
2664
  module.exports = Backbone.Model.extend({
2665
  layoutPosition: {
2666
  BEFORE: 'before',
@@ -3202,7 +3230,7 @@ module.exports = Backbone.Model.extend({
3202
  }
3203
  } );
3204
 
3205
- },{}],18:[function(require,module,exports){
3206
  module.exports = Backbone.Model.extend( {
3207
  /* A collection of widgets */
3208
  widgets: {},
@@ -3259,7 +3287,7 @@ module.exports = Backbone.Model.extend( {
3259
 
3260
  } );
3261
 
3262
- },{}],19:[function(require,module,exports){
3263
  module.exports = Backbone.Model.extend( {
3264
  defaults: {
3265
  text: '',
@@ -3269,7 +3297,7 @@ module.exports = Backbone.Model.extend( {
3269
  }
3270
  } );
3271
 
3272
- },{}],20:[function(require,module,exports){
3273
  module.exports = Backbone.Model.extend( {
3274
  /* The builder model */
3275
  builder: null,
@@ -3393,7 +3421,7 @@ module.exports = Backbone.Model.extend( {
3393
  }
3394
  } );
3395
 
3396
- },{}],21:[function(require,module,exports){
3397
  /**
3398
  * Model for an instance of a widget
3399
  */
@@ -3597,7 +3625,7 @@ module.exports = Backbone.Model.extend( {
3597
 
3598
  } );
3599
 
3600
- },{}],22:[function(require,module,exports){
3601
  var panels = window.panels, $ = jQuery;
3602
 
3603
  module.exports = Backbone.View.extend( {
@@ -3918,7 +3946,7 @@ module.exports = Backbone.View.extend( {
3918
 
3919
  } );
3920
 
3921
- },{}],23:[function(require,module,exports){
3922
  var panels = window.panels, $ = jQuery;
3923
 
3924
  module.exports = Backbone.View.extend( {
@@ -4652,8 +4680,7 @@ module.exports = Backbone.View.extend( {
4652
  handleContentChange: function () {
4653
 
4654
  // Make sure we actually need to copy content.
4655
- if ( panelsOptions.copy_content && this.attachedToEditor && this.$el.is( ':visible' ) ) {
4656
-
4657
  var panelsData = this.model.getPanelsData();
4658
  if ( !_.isEmpty( panelsData.widgets ) ) {
4659
  // We're going to create a copy of page builder content into the post content
@@ -4665,12 +4692,14 @@ module.exports = Backbone.View.extend( {
4665
  post_id: this.config.postId
4666
  },
4667
  function ( content ) {
 
 
 
 
 
4668
  if ( content.preview !== '' ) {
4669
  this.contentPreview = content.preview;
4670
  }
4671
- if ( content.post_content !== '' ) {
4672
- this.updateEditorContent( content.post_content );
4673
- }
4674
  }.bind( this )
4675
  );
4676
  }
@@ -4891,7 +4920,7 @@ module.exports = Backbone.View.extend( {
4891
  },
4892
  } );
4893
 
4894
- },{}],24:[function(require,module,exports){
4895
  var panels = window.panels, $ = jQuery;
4896
 
4897
  module.exports = Backbone.View.extend( {
@@ -5279,7 +5308,7 @@ module.exports = Backbone.View.extend( {
5279
  }
5280
  } );
5281
 
5282
- },{}],25:[function(require,module,exports){
5283
  var panels = window.panels, $ = jQuery;
5284
 
5285
  module.exports = Backbone.View.extend( {
@@ -5886,7 +5915,7 @@ module.exports = Backbone.View.extend( {
5886
 
5887
  } );
5888
 
5889
- },{}],26:[function(require,module,exports){
5890
  var panels = window.panels, $ = jQuery;
5891
 
5892
  module.exports = Backbone.View.extend( {
@@ -6315,7 +6344,7 @@ module.exports = Backbone.View.extend( {
6315
  }
6316
  } );
6317
 
6318
- },{}],27:[function(require,module,exports){
6319
  var panels = window.panels, $ = jQuery;
6320
 
6321
  module.exports = Backbone.View.extend( {
@@ -6726,7 +6755,7 @@ module.exports = Backbone.View.extend( {
6726
  },
6727
  } );
6728
 
6729
- },{}],28:[function(require,module,exports){
6730
  var panels = window.panels, $ = jQuery;
6731
 
6732
  module.exports = Backbone.View.extend( {
@@ -7024,7 +7053,7 @@ module.exports = Backbone.View.extend( {
7024
 
7025
  } );
7026
 
7027
- },{}],29:[function(require,module,exports){
7028
  var panels = window.panels, $ = jQuery;
7029
 
7030
  module.exports = Backbone.View.extend( {
@@ -7038,7 +7067,9 @@ module.exports = Backbone.View.extend( {
7038
 
7039
  events: {
7040
  'click .widget-edit': 'editHandler',
 
7041
  'click .title h4': 'editHandler',
 
7042
  'click .actions .widget-duplicate': 'duplicateHandler',
7043
  'click .actions .widget-delete': 'deleteHandler'
7044
  },
@@ -7316,7 +7347,7 @@ module.exports = Backbone.View.extend( {
7316
 
7317
  } );
7318
 
7319
- },{}],30:[function(require,module,exports){
7320
  var $ = jQuery;
7321
 
7322
  var customHtmlWidget = {
@@ -7343,7 +7374,7 @@ var customHtmlWidget = {
7343
 
7344
  module.exports = customHtmlWidget;
7345
 
7346
- },{}],31:[function(require,module,exports){
7347
  var customHtmlWidget = require( './custom-html-widget' );
7348
  var mediaWidget = require( './media-widget' );
7349
  var textWidget = require( './text-widget' );
@@ -7381,7 +7412,7 @@ var jsWidget = {
7381
 
7382
  module.exports = jsWidget;
7383
 
7384
- },{"./custom-html-widget":30,"./media-widget":32,"./text-widget":33}],32:[function(require,module,exports){
7385
  var $ = jQuery;
7386
 
7387
  var mediaWidget = {
@@ -7421,7 +7452,7 @@ var mediaWidget = {
7421
 
7422
  module.exports = mediaWidget;
7423
 
7424
- },{}],33:[function(require,module,exports){
7425
  var $ = jQuery;
7426
 
7427
  var textWidget = {
@@ -7465,4 +7496,4 @@ var textWidget = {
7465
 
7466
  module.exports = textWidget;
7467
 
7468
- },{}]},{},[16]);
554
  c.find( '.so-export' ).submit( function ( e ) {
555
  var $$ = $( this );
556
  var panelsData = thisView.builder.model.getPanelsData();
557
+ var postName = $( 'input[name="post_title"], .editor-post-title__input' ).val();
558
  if ( ! postName ) {
559
  postName = $('input[name="post_ID"]').val();
560
+ } else if ( typeof wp.data != 'undefined' ) {
561
+ var currentBlockPosition = thisView.getCurrentBlockPosition();
562
+ if ( currentBlockPosition >= 0 ) {
563
+ postName += '-' + currentBlockPosition;
564
+ }
565
+
566
  }
567
  panelsData.name = postName;
568
  $$.find( 'input[name="panels_export_data"]' ).val( JSON.stringify( panelsData ) );
570
 
571
  },
572
 
573
+ /**
574
+ * Return current block index.
575
+ */
576
+ getCurrentBlockPosition: function() {
577
+ var selectedBlockClientId = wp.data.select( 'core/block-editor' ).getSelectedBlockClientId();
578
+ return wp.data.select( 'core/block-editor' ).getBlocks().findIndex( function ( block ) {
579
+ return block.clientId === selectedBlockClientId;
580
+ } );
581
+ },
582
+
583
  /**
584
  * Display the layout directory tab.
585
  *
1910
 
1911
  } );
1912
 
1913
+ },{"../view/widgets/js-widget":32}],10:[function(require,module,exports){
1914
  var panels = window.panels, $ = jQuery;
1915
 
1916
  module.exports = panels.view.dialog.extend( {
2219
  };
2220
 
2221
  },{}],12:[function(require,module,exports){
2222
+ module.exports = {
2223
+ isBlockEditor: function() {
2224
+ return typeof wp.blocks !== 'undefined';
2225
+ },
2226
+
2227
+ isClassicEditor: function( builder ) {
2228
+ return builder.attachedToEditor && builder.$el.is( ':visible' );
2229
+ },
2230
+ }
2231
+
2232
+ },{}],13:[function(require,module,exports){
2233
  module.exports = {
2234
  /**
2235
  * Lock window scrolling for the main overlay
2276
  },
2277
  };
2278
 
2279
+ },{}],14:[function(require,module,exports){
2280
  /*
2281
  This is a modified version of https://github.com/underdogio/backbone-serialize/
2282
  */
2387
  }
2388
  };
2389
 
2390
+ },{}],15:[function(require,module,exports){
2391
  module.exports = {
2392
 
2393
  generateUUID: function(){
2424
 
2425
  }
2426
 
2427
+ },{}],16:[function(require,module,exports){
2428
  /* global _, jQuery, panels */
2429
 
2430
  var panels = window.panels, $ = jQuery;
2513
  } );
2514
  };
2515
 
2516
+ },{}],17:[function(require,module,exports){
2517
  /**
2518
  * Everything we need for SiteOrigin Page Builder.
2519
  *
2533
  panels.helpers = {};
2534
  panels.helpers.clipboard = require( './helpers/clipboard' );
2535
  panels.helpers.utils = require( './helpers/utils' );
2536
+ panels.helpers.editor = require( './helpers/editor' );
2537
  panels.helpers.serialize = require( './helpers/serialize' );
2538
  panels.helpers.pageScroll = require( './helpers/page-scroll' );
2539
 
2688
  });
2689
  } );
2690
 
2691
+ },{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/editor":12,"./helpers/page-scroll":13,"./helpers/serialize":14,"./helpers/utils":15,"./jquery/setup-builder-widget":16,"./model/builder":18,"./model/cell":19,"./model/history-entry":20,"./model/row":21,"./model/widget":22,"./utils/menu":23,"./view/builder":24,"./view/cell":25,"./view/dialog":26,"./view/live-editor":27,"./view/row":28,"./view/styles":29,"./view/widget":30}],18:[function(require,module,exports){
2692
  module.exports = Backbone.Model.extend({
2693
  layoutPosition: {
2694
  BEFORE: 'before',
3230
  }
3231
  } );
3232
 
3233
+ },{}],19:[function(require,module,exports){
3234
  module.exports = Backbone.Model.extend( {
3235
  /* A collection of widgets */
3236
  widgets: {},
3287
 
3288
  } );
3289
 
3290
+ },{}],20:[function(require,module,exports){
3291
  module.exports = Backbone.Model.extend( {
3292
  defaults: {
3293
  text: '',
3297
  }
3298
  } );
3299
 
3300
+ },{}],21:[function(require,module,exports){
3301
  module.exports = Backbone.Model.extend( {
3302
  /* The builder model */
3303
  builder: null,
3421
  }
3422
  } );
3423
 
3424
+ },{}],22:[function(require,module,exports){
3425
  /**
3426
  * Model for an instance of a widget
3427
  */
3625
 
3626
  } );
3627
 
3628
+ },{}],23:[function(require,module,exports){
3629
  var panels = window.panels, $ = jQuery;
3630
 
3631
  module.exports = Backbone.View.extend( {
3946
 
3947
  } );
3948
 
3949
+ },{}],24:[function(require,module,exports){
3950
  var panels = window.panels, $ = jQuery;
3951
 
3952
  module.exports = Backbone.View.extend( {
4680
  handleContentChange: function () {
4681
 
4682
  // Make sure we actually need to copy content.
4683
+ if ( panelsOptions.copy_content && ( panels.helpers.editor.isBlockEditor() || panels.helpers.editor.isClassicEditor( this ) ) ) {
 
4684
  var panelsData = this.model.getPanelsData();
4685
  if ( !_.isEmpty( panelsData.widgets ) ) {
4686
  // We're going to create a copy of page builder content into the post content
4692
  post_id: this.config.postId
4693
  },
4694
  function ( content ) {
4695
+ // Post content doesn't need to be generated on load while contentPreview does.
4696
+ if ( this.contentPreview && content.post_content !== '' ) {
4697
+ this.updateEditorContent( content.post_content );
4698
+ }
4699
+
4700
  if ( content.preview !== '' ) {
4701
  this.contentPreview = content.preview;
4702
  }
 
 
 
4703
  }.bind( this )
4704
  );
4705
  }
4920
  },
4921
  } );
4922
 
4923
+ },{}],25:[function(require,module,exports){
4924
  var panels = window.panels, $ = jQuery;
4925
 
4926
  module.exports = Backbone.View.extend( {
5308
  }
5309
  } );
5310
 
5311
+ },{}],26:[function(require,module,exports){
5312
  var panels = window.panels, $ = jQuery;
5313
 
5314
  module.exports = Backbone.View.extend( {
5915
 
5916
  } );
5917
 
5918
+ },{}],27:[function(require,module,exports){
5919
  var panels = window.panels, $ = jQuery;
5920
 
5921
  module.exports = Backbone.View.extend( {
6344
  }
6345
  } );
6346
 
6347
+ },{}],28:[function(require,module,exports){
6348
  var panels = window.panels, $ = jQuery;
6349
 
6350
  module.exports = Backbone.View.extend( {
6755
  },
6756
  } );
6757
 
6758
+ },{}],29:[function(require,module,exports){
6759
  var panels = window.panels, $ = jQuery;
6760
 
6761
  module.exports = Backbone.View.extend( {
7053
 
7054
  } );
7055
 
7056
+ },{}],30:[function(require,module,exports){
7057
  var panels = window.panels, $ = jQuery;
7058
 
7059
  module.exports = Backbone.View.extend( {
7067
 
7068
  events: {
7069
  'click .widget-edit': 'editHandler',
7070
+ 'touchend .widget-edit': 'editHandler',
7071
  'click .title h4': 'editHandler',
7072
+ 'touchend .title h4': 'editHandler',
7073
  'click .actions .widget-duplicate': 'duplicateHandler',
7074
  'click .actions .widget-delete': 'deleteHandler'
7075
  },
7347
 
7348
  } );
7349
 
7350
+ },{}],31:[function(require,module,exports){
7351
  var $ = jQuery;
7352
 
7353
  var customHtmlWidget = {
7374
 
7375
  module.exports = customHtmlWidget;
7376
 
7377
+ },{}],32:[function(require,module,exports){
7378
  var customHtmlWidget = require( './custom-html-widget' );
7379
  var mediaWidget = require( './media-widget' );
7380
  var textWidget = require( './text-widget' );
7412
 
7413
  module.exports = jsWidget;
7414
 
7415
+ },{"./custom-html-widget":31,"./media-widget":33,"./text-widget":34}],33:[function(require,module,exports){
7416
  var $ = jQuery;
7417
 
7418
  var mediaWidget = {
7452
 
7453
  module.exports = mediaWidget;
7454
 
7455
+ },{}],34:[function(require,module,exports){
7456
  var $ = jQuery;
7457
 
7458
  var textWidget = {
7496
 
7497
  module.exports = textWidget;
7498
 
7499
+ },{}]},{},[17]);
js/siteorigin-panels.min.js CHANGED
@@ -1,8 +1,8 @@
1
- !function e(t,i,s){function l(n,a){if(!i[n]){if(!t[n]){var r="function"==typeof require&&require;if(!a&&r)return r(n,!0);if(o)return o(n,!0);var d=new Error("Cannot find module '"+n+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[n]={exports:{}};t[n][0].call(h.exports,(function(e){return l(t[n][1][e]||e)}),h,h.exports,e,t,i,s)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n<s.length;n++)l(s[n]);return l}({1:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.cell,initialize:function(){},totalWeight:function(){var e=0;return this.each((function(t){e+=t.get("weight")})),e}})},{}],2:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.historyEntry,builder:null,maxSize:12,initialize:function(){this.on("add",this.onAddEntry,this)},addEntry:function(e,t){_.isEmpty(t)&&(t=this.builder.getPanelsData());var i=new s.model.historyEntry({text:e,data:JSON.stringify(t),time:parseInt((new Date).getTime()/1e3),collection:this});this.add(i)},onAddEntry:function(e){if(this.models.length>1){var t=this.at(this.models.length-2);(e.get("text")===t.get("text")&&e.get("time")-t.get("time")<15||e.get("data")===t.get("data"))&&(this.remove(e),t.set("count",t.get("count")+1))}for(;this.models.length>this.maxSize;)this.shift()}})},{}],3:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.row,empty:function(){for(var e;;){if(!(e=this.collection.first()))break;e.destroy()}}})},{}],4:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.widget,initialize:function(){}})},{}],5:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({dialogClass:"so-panels-dialog-add-builder",render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-builder").html(),{})),this.$(".so-content .siteorigin-panels-builder").append(this.builder.$el)},initializeDialog:function(){var e=this;this.once("open_dialog_complete",(function(){e.builder.initSortable()})),this.on("open_dialog_complete",(function(){e.builder.trigger("builder_resize")}))}})},{}],6:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({historyEntryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-history-entry").html())),entries:{},currentEntry:null,revertEntry:null,selectedEntry:null,previewScrollTop:null,dialogClass:"so-panels-dialog-history",dialogIcon:"history",events:{"click .so-close":"closeDialog","click .so-restore":"restoreSelectedEntry"},initializeDialog:function(){this.entries=new s.collection.historyEntries,this.on("open_dialog",this.setCurrentEntry,this),this.on("open_dialog",this.renderHistoryEntries,this)},render:function(){var e=this;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-history").html(),{})),this.$("iframe.siteorigin-panels-history-iframe").load((function(){var t=l(this);t.show(),t.contents().scrollTop(e.previewScrollTop)}))},setRevertEntry:function(e){this.revertEntry=new s.model.historyEntry({data:JSON.stringify(e.getPanelsData()),time:parseInt((new Date).getTime()/1e3)})},setCurrentEntry:function(){this.currentEntry=new s.model.historyEntry({data:JSON.stringify(this.builder.model.getPanelsData()),time:parseInt((new Date).getTime()/1e3)}),this.selectedEntry=this.currentEntry,this.previewEntry(this.currentEntry),this.$(".so-buttons .so-restore").addClass("disabled")},renderHistoryEntries:function(){var e=this,t=this.$(".history-entries").empty();this.currentEntry.get("data")===this.revertEntry.get("data")&&_.isEmpty(this.entries.models)||l(this.historyEntryTemplate({title:panelsOptions.loc.history.revert,count:1})).data("historyEntry",this.revertEntry).prependTo(t),this.entries.each((function(i){var s=e.historyEntryTemplate({title:panelsOptions.loc.history[i.get("text")],count:i.get("count")});l(s).data("historyEntry",i).prependTo(t)})),l(this.historyEntryTemplate({title:panelsOptions.loc.history.current,count:1})).data("historyEntry",this.currentEntry).addClass("so-selected").prependTo(t),t.find(".history-entry").click((function(){var i=jQuery(this);t.find(".history-entry").not(i).removeClass("so-selected"),i.addClass("so-selected");var s=i.data("historyEntry");e.selectedEntry=s,e.selectedEntry.cid!==e.currentEntry.cid?e.$(".so-buttons .so-restore").removeClass("disabled"):e.$(".so-buttons .so-restore").addClass("disabled"),e.previewEntry(s)})),this.updateEntryTimes()},previewEntry:function(e){var t=this.$("iframe.siteorigin-panels-history-iframe");t.hide(),this.previewScrollTop=t.contents().scrollTop(),this.$('form.history-form input[name="live_editor_panels_data"]').val(e.get("data")),this.$('form.history-form input[name="live_editor_post_ID"]').val(this.builder.config.postId),this.$("form.history-form").submit()},restoreSelectedEntry:function(){return!this.$(".so-buttons .so-restore").hasClass("disabled")&&(this.currentEntry.get("data")===this.selectedEntry.get("data")?(this.closeDialog(),!1):("restore"!==this.selectedEntry.get("text")&&this.builder.addHistoryEntry("restore",this.builder.model.getPanelsData()),this.builder.model.loadPanelsData(JSON.parse(this.selectedEntry.get("data"))),this.closeDialog(),!1))},updateEntryTimes:function(){var e=this;this.$(".history-entries .history-entry").each((function(){var t=jQuery(this),i=t.find(".timesince"),s=t.data("historyEntry");i.html(e.timeSince(s.get("time")))}))},timeSince:function(e){var t,i=parseInt((new Date).getTime()/1e3)-e,s=[];return i>3600&&(1===(t=Math.floor(i/3600))?s.push(panelsOptions.loc.time.hour.replace("%d",t)):s.push(panelsOptions.loc.time.hours.replace("%d",t)),i-=3600*t),i>60&&(1===(t=Math.floor(i/60))?s.push(panelsOptions.loc.time.minute.replace("%d",t)):s.push(panelsOptions.loc.time.minutes.replace("%d",t)),i-=60*t),i>0&&(1===i?s.push(panelsOptions.loc.time.second.replace("%d",i)):s.push(panelsOptions.loc.time.seconds.replace("%d",i))),_.isEmpty(s)?panelsOptions.loc.time.now:panelsOptions.loc.time.ago.replace("%s",s.slice(0,2).join(", "))}})},{}],7:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({directoryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-directory-items").html())),builder:null,dialogClass:"so-panels-dialog-prebuilt-layouts",dialogIcon:"layouts",layoutCache:{},currentTab:!1,directoryPage:1,events:{"click .so-close":"closeDialog","click .so-sidebar-tabs li a":"tabClickHandler","click .so-content .layout":"layoutClickHandler","keyup .so-sidebar-search":"searchHandler","click .so-screenshot, .so-title":"directoryItemClickHandler"},initializeDialog:function(){var e=this;this.on("open_dialog",(function(){e.$(".so-sidebar-tabs li a").first().click(),e.$(".so-status").removeClass("so-panels-loading")})),this.on("button_click",this.toolbarButtonClick,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-prebuilt").html(),{})),this.initToolbar()},tabClickHandler:function(e){e.preventDefault(),this.selectedLayoutItem=null,this.uploadedLayout=null,this.updateButtonState(!1),this.$(".so-sidebar-tabs li").removeClass("tab-active");var t=l(e.target),i=t.attr("href").split("#")[1];t.parent().addClass("tab-active");this.$(".so-content").empty(),this.currentTab=i,"import"==i?this.displayImportExport():this.displayLayoutDirectory("",1,i),this.$(".so-sidebar-search").val("")},displayImportExport:function(){var e=this.$(".so-content").empty().removeClass("so-panels-loading");e.html(l("#siteorigin-panels-dialog-prebuilt-importexport").html());var t=this,i=t.$(".import-upload-ui"),s=new plupload.Uploader({runtimes:"html5,silverlight,flash,html4",browse_button:i.find(".file-browse-button").get(0),container:i.get(0),drop_element:i.find(".drag-upload-area").get(0),file_data_name:"panels_import_data",multiple_queues:!1,max_file_size:panelsOptions.plupload.max_file_size,url:panelsOptions.plupload.url,flash_swf_url:panelsOptions.plupload.flash_swf_url,silverlight_xap_url:panelsOptions.plupload.silverlight_xap_url,filters:[{title:panelsOptions.plupload.filter_title,extensions:"json"}],multipart_params:{action:"so_panels_import_layout"},init:{PostInit:function(e){e.features.dragdrop&&i.addClass("has-drag-drop"),i.find(".progress-precent").css("width","0%")},FilesAdded:function(e){i.find(".file-browse-button").blur(),i.find(".drag-upload-area").removeClass("file-dragover"),i.find(".progress-bar").fadeIn("fast"),t.$(".js-so-selected-file").text(panelsOptions.loc.prebuilt_loading),e.start()},UploadProgress:function(e,t){i.find(".progress-precent").css("width",t.percent+"%")},FileUploaded:function(e,s,l){var o=JSON.parse(l.response);_.isUndefined(o.widgets)?alert(panelsOptions.plupload.error_message):(t.uploadedLayout=o,i.find(".progress-bar").hide(),t.$(".js-so-selected-file").text(panelsOptions.loc.ready_to_insert.replace("%s",s.name)),t.updateButtonState(!0))},Error:function(){alert(panelsOptions.plupload.error_message)}}});s.init(),/Edge\/\d./i.test(navigator.userAgent)&&setTimeout((function(){s.refresh()}),250),i.find(".drag-upload-area").on("dragover",(function(){l(this).addClass("file-dragover")})).on("dragleave",(function(){l(this).removeClass("file-dragover")})),e.find(".so-export").submit((function(e){var i=l(this),s=t.builder.model.getPanelsData(),o=l('input[name="post_title"]').val();o||(o=l('input[name="post_ID"]').val()),s.name=o,i.find('input[name="panels_export_data"]').val(JSON.stringify(s))}))},displayLayoutDirectory:function(e,t,i){var s=this,o=this.$(".so-content").empty().addClass("so-panels-loading");if(void 0===e&&(e=""),void 0===t&&(t=1),void 0===i&&(i="directory-siteorigin"),i.match("^directory-")&&!panelsOptions.directory_enabled)return o.removeClass("so-panels-loading").html(l("#siteorigin-panels-directory-enable").html()),void o.find(".so-panels-enable-directory").click((function(n){n.preventDefault(),l.get(panelsOptions.ajaxurl,{action:"so_panels_directory_enable"},(function(){})),panelsOptions.directory_enabled=!0,o.addClass("so-panels-loading"),s.displayLayoutDirectory(e,t,i)}));l.get(panelsOptions.ajaxurl,{action:"so_panels_layouts_query",search:e,page:t,type:i,builderType:this.builder.config.builderType},(function(n){if(s.currentTab===i){o.removeClass("so-panels-loading").html(s.directoryTemplate(n));var a=o.find(".so-previous"),r=o.find(".so-next");t<=1?a.addClass("button-disabled"):a.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t-1,s.currentTab)})),t===n.max_num_pages||0===n.max_num_pages?r.addClass("button-disabled"):r.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t+1,s.currentTab)})),o.find(".so-screenshot").each((function(){var e=l(this),t=e.find(".so-screenshot-wrapper");if(t.css("height",t.width()/4*3+"px").addClass("so-loading"),""!==e.data("src"))var i=l("<img/>").attr("src",e.data("src")).load((function(){t.removeClass("so-loading").css("height","auto"),i.appendTo(t).hide().fadeIn("fast")}));else l("<img/>").attr("src",panelsOptions.prebuiltDefaultScreenshot).appendTo(t).hide().fadeIn("fast")})),o.find(".so-directory-browse").html(n.title)}}),"json")},directoryItemClickHandler:function(e){var t=this.$(e.target).closest(".so-directory-item");this.$(".so-directory-items").find(".selected").removeClass("selected"),t.addClass("selected"),this.selectedLayoutItem={lid:t.data("layout-id"),type:t.data("layout-type")},this.updateButtonState(!0)},toolbarButtonClick:function(e){if(!this.canAddLayout())return!1;var t=e.data("value");if(_.isUndefined(t))return!1;if(this.updateButtonState(!1),e.hasClass("so-needs-confirm")&&!e.hasClass("so-confirmed")){if(this.updateButtonState(!0),e.hasClass("so-confirming"))return;e.addClass("so-confirming");var i=e.html();return e.html('<span class="dashicons dashicons-yes"></span>'+e.data("confirm")),setTimeout((function(){e.removeClass("so-confirmed").html(i)}),2500),setTimeout((function(){e.removeClass("so-confirming"),e.addClass("so-confirmed")}),200),!1}this.addingLayout=!0,"import"===this.currentTab?this.addLayoutToBuilder(this.uploadedLayout,t):this.loadSelectedLayout().then(function(e){this.addLayoutToBuilder(e,t)}.bind(this))},canAddLayout:function(){return(this.selectedLayoutItem||this.uploadedLayout)&&!this.addingLayout},loadSelectedLayout:function(){this.setStatusMessage(panelsOptions.loc.prebuilt_loading,!0);var e=_.extend(this.selectedLayoutItem,{action:"so_panels_get_layout",builderType:this.builder.config.builderType}),t=new l.Deferred;return l.get(panelsOptions.ajaxurl,e,function(e){var i="";e.success?t.resolve(e.data):(i=e.data.message,t.reject(e.data)),this.setStatusMessage(i,!1,!e.success),this.updateButtonState(!0)}.bind(this)),t.promise()},searchHandler:function(e){13===e.keyCode&&this.displayLayoutDirectory(l(e.currentTarget).val(),1,this.currentTab)},updateButtonState:function(e){e=e&&(this.selectedLayoutItem||this.uploadedLayout);var t=this.$(".so-import-layout");t.prop("disabled",!e),e?t.removeClass("disabled"):t.addClass("disabled")},addLayoutToBuilder:function(e,t){this.builder.addHistoryEntry("prebuilt_loaded"),this.builder.model.loadPanelsData(e,t),this.addingLayout=!1,this.closeDialog()}})},{}],8:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({cellPreviewTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-row-cell-preview").html())),editableLabel:!0,events:{"click .so-close":"closeDialog","click .so-toolbar .so-save":"saveHandler","click .so-toolbar .so-insert":"insertHandler","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler","change .row-set-form > *":"setCellsFromForm","click .row-set-form button.set-row":"setCellsFromForm"},rowView:null,dialogIcon:"add-row",dialogClass:"so-panels-dialog-row-edit",styleType:"row",dialogType:"edit",row:{cells:null,style:{}},cellStylesCache:[],initializeDialog:function(){this.on("open_dialog",(function(){_.isUndefined(this.model)||_.isEmpty(this.model.get("cells"))?this.setRowModel(null):this.setRowModel(this.model),this.regenerateRowPreview(),this.renderStyles(),this.openSelectedCellStyles()}),this),this.row={cells:new s.collection.cells([{weight:.5},{weight:.5}]),style:{}},this.dialogFormsLoaded=0;var e=this;this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("close_dialog",this.closeHandler),this.on("edit_label",function(e){if(e!==panelsOptions.loc.row.add&&e!==panelsOptions.loc.row.edit||(e=""),this.model.set("label",e),_.isEmpty(e)){var t="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.$(".so-title").text(t)}}.bind(this))},setRowDialogType:function(e){this.dialogType=e},render:function(){var e="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-row").html(),{title:e,dialogType:this.dialogType}));var t=this.$(".so-title");return this.model.has("label")&&!_.isEmpty(this.model.get("label"))&&t.text(this.model.get("label")),this.$(".so-edit-title").val(t.text()),this.builder.supports("addRow")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteRow")||this.$(".so-buttons .so-delete").remove(),_.isUndefined(this.model)||(this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction"))),this.$("input.so-row-field").keyup((function(){l(this).trigger("change")})),this},renderStyles:function(){this.styles&&(this.styles.off("styles_loaded"),this.styles.remove()),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("row",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var e=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(e),this.styles.on("styles_loaded",(function(t){t||(this.styles.remove(),0===e.children().length&&(e.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),e.hide()))}),this)},setRowModel:function(e){return this.model=e,_.isEmpty(this.model)?this:(this.row={cells:this.model.get("cells").clone(),style:{},ratio:this.model.get("ratio"),ratio_direction:this.model.get("ratio_direction")},this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction")),this.clearCellStylesCache(),this)},regenerateRowPreview:function(){var e,t=this,i=this.$(".row-preview"),s=this.getSelectedCellIndex();i.empty(),this.row.cells.each((function(o,n){var a=l(this.cellPreviewTemplate({weight:o.get("weight")}));i.append(a),n==s&&a.find(".preview-cell-in").addClass("cell-selected");var r,d=a.prev();d.length&&((r=l('<div class="resize-handle"></div>')).appendTo(a).dblclick((function(){var e=t.row.cells.at(n-1),i=o.get("weight")+e.get("weight");o.set("weight",i/2),e.set("weight",i/2),t.scaleRowWidths()})),r.draggable({axis:"x",containment:i,start:function(e,t){var i=a.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:a.outerWidth(),left:6,height:a.outerHeight()});i.find(".resize-handle").remove();var s=d.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:d.outerWidth(),right:6,height:d.outerHeight()});s.find(".resize-handle").remove(),l(this).data({newCellClone:i,prevCellClone:s}),a.find("> .preview-cell-in").css("visibility","hidden"),d.find("> .preview-cell-in").css("visibility","hidden")},drag:function(e,s){var o=t.row.cells.at(n).get("weight"),a=t.row.cells.at(n-1).get("weight"),r=o-(s.position.left+6)/i.width(),d=a+(s.position.left+6)/i.width();s.helper.offset().left,i.offset().left;l(this).data("newCellClone").css("width",i.width()*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10),l(this).data("prevCellClone").css("width",i.width()*d).find(".preview-cell-weight").html(Math.round(1e3*d)/10)},stop:function(e,s){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove(),a.find(".preview-cell-in").css("visibility","visible"),d.find(".preview-cell-in").css("visibility","visible");var o=(s.position.left+6)/i.width(),r=t.row.cells.at(n),h=t.row.cells.at(n-1);r.get("weight")-o>.02&&h.get("weight")+o>.02&&(r.set("weight",r.get("weight")-o),h.set("weight",h.get("weight")+o)),t.scaleRowWidths(),s.helper.css("left",-6)}})),a.click(function(e){if(l(e.target).is(".preview-cell")||l(e.target).is(".preview-cell-in")){var t=l(e.target);t.closest(".row-preview").find(".preview-cell .preview-cell-in").removeClass("cell-selected"),t.addClass("cell-selected"),this.openSelectedCellStyles()}}.bind(this)),a.find(".preview-cell-weight").click((function(s){t.$(".resize-handle").css("pointer-event","none").draggable("disable"),i.find(".preview-cell-weight").each((function(){var s=jQuery(this).hide();l('<input type="text" class="preview-cell-weight-input no-user-interacted" />').val(parseFloat(s.html())).insertAfter(s).focus((function(){clearTimeout(e)})).keyup((function(e){9!==e.keyCode&&l(this).removeClass("no-user-interacted"),13===e.keyCode&&(e.preventDefault(),l(this).blur())})).keydown((function(e){if(9===e.keyCode){e.preventDefault();var t=i.find(".preview-cell-weight-input"),s=t.index(l(this));s===t.length-1?t.eq(0).focus().select():t.eq(s+1).focus().select()}})).blur((function(){i.find(".preview-cell-weight-input").each((function(e,i){isNaN(parseFloat(l(i).val()))&&l(i).val(Math.floor(1e3*t.row.cells.at(e).get("weight"))/10)})),e=setTimeout((function(){if(0===i.find(".preview-cell-weight-input").length)return!1;var e=[],s=[],o=0,n=0;if(i.find(".preview-cell-weight-input").each((function(i,a){var r=parseFloat(l(a).val());r=isNaN(r)?1/t.row.cells.length:Math.round(10*r)/1e3;var d=!l(a).hasClass("no-user-interacted");e.push(r),s.push(d),d?o+=r:n+=r})),o>0&&n>0&&1-o>0)for(var a=0;a<e.length;a++)s[a]||(e[a]=e[a]/n*(1-o));var r=_.reduce(e,(function(e,t){return e+t}));e=e.map((function(e){return e/r})),Math.min.apply(Math,e)>.01&&t.row.cells.each((function(t,i){t.set("weight",e[i])})),i.find(".preview-cell").each((function(e,i){var s=t.row.cells.at(e).get("weight");l(i).animate({width:Math.round(1e3*s)/10+"%"},250),l(i).find(".preview-cell-weight-input").val(Math.round(1e3*s)/10)})),i.find(".preview-cell").css("overflow","visible"),setTimeout(t.regenerateRowPreview.bind(t),260)}),100)})).click((function(){l(this).select()}))})),l(this).siblings(".preview-cell-weight-input").select()}))}),this),this.trigger("form_loaded",this)},getSelectedCellIndex:function(){var e=-1;return this.$(".preview-cell .preview-cell-in").each((function(t,i){l(i).is(".cell-selected")&&(e=t)})),e},openSelectedCellStyles:function(){if(!_.isUndefined(this.cellStyles)){if(this.cellStyles.stylesLoaded){var e={};try{e=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",e)}this.cellStyles.detach()}if(this.cellStyles=this.getSelectedCellStyles(),this.cellStyles){var t=this.$(".so-sidebar.so-right-sidebar");this.cellStyles.attach(t),this.cellStyles.on("styles_loaded",(function(e){e&&(t.closest(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"),t.show())}))}},getSelectedCellStyles:function(){var e=this.getSelectedCellIndex();if(e>-1){var t=this.cellStylesCache[e];t||((t=new s.view.styles).model=this.row.cells.at(e),t.render("cell",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this,index:e}),this.cellStylesCache[e]=t)}return t},clearCellStylesCache:function(){this.cellStylesCache.forEach((function(e){e.remove(),e.off("styles_loaded")})),this.cellStylesCache=[]},scaleRowWidths:function(){var e=this;this.$(".row-preview .preview-cell").each((function(t,i){var s=e.row.cells.at(t);l(i).css("width",100*s.get("weight")+"%").find(".preview-cell-weight").html(Math.round(1e3*s.get("weight"))/10)}))},setCellsFromForm:function(){try{var e={cells:parseInt(this.$('.row-set-form input[name="cells"]').val()),ratio:parseFloat(this.$('.row-set-form select[name="ratio"]').val()),direction:this.$('.row-set-form select[name="ratio_direction"]').val()};_.isNaN(e.cells)&&(e.cells=1),isNaN(e.ratio)&&(e.ratio=1),e.cells<1?(e.cells=1,this.$('.row-set-form input[name="cells"]').val(e.cells)):e.cells>12&&(e.cells=12,this.$('.row-set-form input[name="cells"]').val(e.cells)),this.$('.row-set-form select[name="ratio"]').val(e.ratio);for(var t=[],i=this.row.cells.length!==e.cells,o=1,n=0;n<e.cells;n++)t.push(o),o*=e.ratio;var a=_.reduce(t,(function(e,t){return e+t}));if(t=_.map(t,(function(e){return e/a})),t=_.filter(t,(function(e){return e>.01})),"left"===e.direction&&(t=t.reverse()),this.row.cells=new s.collection.cells(this.row.cells.first(t.length)),_.each(t,function(e,t){var i=this.row.cells.at(t);i?i.set("weight",e):(i=new s.model.cell({weight:e,row:this.model}),this.row.cells.add(i))}.bind(this)),this.row.ratio=e.ratio,this.row.ratio_direction=e.direction,i)this.regenerateRowPreview();else{var r=this;this.$(".preview-cell").each((function(e,t){var i=r.row.cells.at(e).get("weight");l(t).animate({width:Math.round(1e3*i)/10+"%"},250),l(t).find(".preview-cell-weight").html(Math.round(1e3*i)/10)})),this.$(".preview-cell").css("overflow","visible"),setTimeout(r.regenerateRowPreview.bind(r),260)}}catch(e){console.log("Error setting cells - "+e.message)}this.$(".row-set-form .so-button-row-set").removeClass("button-primary")},tabClickHandler:function(e){"#row-layout"===e.attr("href")?this.$(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"):this.$(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar")},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),_.isEmpty(this.model)||(this.model.setCells(this.row.cells),this.model.set("ratio",this.row.ratio),this.model.set("ratio_direction",this.row.ratio_direction)),!_.isUndefined(this.styles)&&this.styles.stylesLoaded){var t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-row-styles").style}catch(e){console.log("Error retrieving row styles - "+e.message)}this.model.set("style",t)}if(!_.isUndefined(this.cellStyles)&&this.cellStyles.stylesLoaded){t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",t)}e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},insertHandler:function(){this.builder.addHistoryEntry("row_added"),this.updateModel();var e=this.builder.getActiveCell({createCell:!1}),t={};return null!==e&&(t.at=this.builder.model.get("rows").indexOf(e.row)+1),this.model.collection=this.builder.model.get("rows"),this.builder.model.get("rows").add(this.model,t),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},saveHandler:function(){return this.builder.addHistoryEntry("row_edited"),this.updateModel(),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},deleteHandler:function(){return this.rowView.visualDestroyModel(),this.closeDialog({silent:!0}),!1},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);return this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.closeDialog({silent:!0}),!1},closeHandler:function(){this.clearCellStylesCache(),_.isUndefined(this.cellStyles)||(this.cellStyles=void 0)}})},{}],9:[function(e,t,i){var s=window.panels,l=jQuery,o=e("../view/widgets/js-widget");t.exports=s.view.dialog.extend({builder:null,sidebarWidgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widget-sidebar-widget").html())),dialogClass:"so-panels-dialog-edit-widget",dialogIcon:"add-widget",widgetView:!1,savingWidget:!1,editableLabel:!0,events:{"click .so-close":"saveHandler","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler"},initializeDialog:function(){var e=this;this.listenTo(this.model,"change:values",this.handleChangeValues),this.listenTo(this.model,"destroy",this.remove),this.dialogFormsLoaded=0,this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("edit_label",function(e){e===panelsOptions.widgets[this.model.get("class")].title&&(e=""),this.model.set("label",e),_.isEmpty(e)&&this.$(".so-title").text(this.model.getWidgetField("title"))}.bind(this))},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widget").html(),{})),this.loadForm();var e=this.model.getWidgetField("title");this.$(".so-title .widget-name").html(e),this.$(".so-edit-title").val(e),this.builder.supports("addWidget")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteWidget")||this.$(".so-buttons .so-delete").remove(),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("widget",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var t=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(t),this.styles.on("styles_loaded",(function(e){e||(t.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),t.remove())}),this)},getPrevDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(0===i)return!1;do{if(t=e.eq(--i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t)&&i>0);return!1},getNextDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(i===e.length-1)return!1;do{if(t=e.eq(++i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t));return!1},loadForm:function(){if(this.$("> *").length){this.$(".so-content").addClass("so-panels-loading");var e={action:"so_panels_widget_form",widget:this.model.get("class"),instance:JSON.stringify(this.model.get("values")),raw:this.model.get("raw")},t=this.$(".so-content");l.post(panelsOptions.ajaxurl,e,null,"html").done(function(e){var i=e.replace(/{\$id}/g,this.model.cid);t.removeClass("so-panels-loading").html(i),this.trigger("form_loaded",this),this.$(".panel-dialog").trigger("panelsopen"),this.on("close_dialog",this.updateModel,this),t.find("> .widget-content").length>0&&o.addWidget(t,this.model.widget_id)}.bind(this)).fail((function(e){var i;i=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,t.removeClass("so-panels-loading").html(i)}))}},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),this.savingWidget=!0,!this.model.get("missing")){var t=this.getFormValues();t=_.isUndefined(t.widgets)?{}:(t=t.widgets)[Object.keys(t)[0]],this.model.setValues(t),this.model.set("raw",!0)}if(this.styles.stylesLoaded){var i={};try{i=this.getFormValues(".so-sidebar .so-visual-styles").style}catch(e){}this.model.set("style",i)}this.savingWidget=!1,e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},handleChangeValues:function(){this.savingWidget||this.loadForm()},saveHandler:function(){this.builder.addHistoryEntry("widget_edited"),this.closeDialog()},deleteHandler:function(){return this.widgetView.visualDestroyModel(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1},duplicateHandler:function(){return this.widgetView.duplicateHandler(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1}})},{"../view/widgets/js-widget":31}],10:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({builder:null,widgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widgets-widget").html())),filter:{},dialogClass:"so-panels-dialog-add-widget",dialogIcon:"add-widget",events:{"click .so-close":"closeDialog","click .widget-type":"widgetClickHandler","keyup .so-sidebar-search":"searchHandler"},initializeDialog:function(){this.on("open_dialog",(function(){this.filter.search="",this.filterWidgets(this.filter)}),this),this.on("open_dialog_complete",(function(){this.$(".so-sidebar-search").val("").focus(),this.balanceWidgetHeights()})),this.on("tab_click",this.tabClickHandler,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widgets").html(),{})),_.each(panelsOptions.widgets,(function(e){var t=l(this.widgetTemplate({title:e.title,description:e.description}));_.isUndefined(e.icon)&&(e.icon="dashicons dashicons-admin-generic"),l('<span class="widget-icon" />').addClass(e.icon).prependTo(t.find(".widget-type-wrapper")),t.data("class",e.class).appendTo(this.$(".widget-type-list"))}),this);var e=this.$(".so-sidebar-tabs");_.each(panelsOptions.widget_dialog_tabs,(function(t,i){l(this.dialogTabTemplate({title:t.title,tab:i})).data({message:t.message,filter:t.filter}).appendTo(e)}),this),this.initTabs();var t=this;l(window).resize((function(){t.balanceWidgetHeights()}))},tabClickHandler:function(e){this.filter=e.parent().data("filter"),this.filter.search=this.$(".so-sidebar-search").val();var t=e.parent().data("message");return _.isEmpty(t)&&(t=""),this.$(".so-toolbar .so-status").html(t),this.filterWidgets(this.filter),!1},searchHandler:function(e){if(13===e.which){var t=this.$(".widget-type-list .widget-type:visible");1===t.length&&t.click()}else this.filter.search=l(e.target).val().trim(),this.filterWidgets(this.filter)},filterWidgets:function(e){_.isUndefined(e)&&(e={}),_.isUndefined(e.groups)&&(e.groups=""),this.$(".widget-type-list .widget-type").each((function(){var t,i=l(this),s=i.data("class"),o=_.isUndefined(panelsOptions.widgets[s])?null:panelsOptions.widgets[s];(t=!!_.isEmpty(e.groups)||null!==o&&!_.isEmpty(_.intersection(e.groups,panelsOptions.widgets[s].groups)))&&(_.isUndefined(e.search)||""===e.search||-1===o.title.toLowerCase().indexOf(e.search.toLowerCase())&&(t=!1)),t?i.show():i.hide()})),this.balanceWidgetHeights()},widgetClickHandler:function(e){this.builder.trigger("before_user_adds_widget"),this.builder.addHistoryEntry("widget_added");var t=l(e.currentTarget),i=new s.model.widget({class:t.data("class")});i.cell=this.builder.getActiveCell(),i.cell.get("widgets").add(i),this.closeDialog(),this.builder.model.refreshPanelsData(),this.builder.trigger("after_user_adds_widget",i)},balanceWidgetHeights:function(e){var t=[[]],i=null,s=Math.round(this.$(".widget-type").parent().width()/this.$(".widget-type").width());this.$(".widget-type").css("clear","none").filter(":visible").each((function(e,t){e%s==0&&0!==e&&l(t).css("clear","both")})),this.$(".widget-type-wrapper").css("height","auto").filter(":visible").each((function(e,s){var o=l(s);null!==i&&i.position().top!==o.position().top&&(t[t.length]=[]),i=o,t[t.length-1].push(o)})),_.each(t,(function(e,t){var i=_.max(e.map((function(e){return e.height()})));_.each(e,(function(e){e.height(i)}))}))}})},{}],11:[function(e,t,i){t.exports={canCopyPaste:function(){return"undefined"!=typeof Storage&&panelsOptions.user},setModel:function(e){if(!this.canCopyPaste())return!1;var t=panels.helpers.serialize.serialize(e);return e instanceof panels.model.row?t.thingType="row-model":e instanceof panels.model.widget&&(t.thingType="widget-model"),localStorage["panels_clipboard_"+panelsOptions.user]=JSON.stringify(t),!0},isModel:function(e){if(!this.canCopyPaste())return!1;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&((t=JSON.parse(t)).thingType&&t.thingType===e)},getModel:function(e){if(!this.canCopyPaste())return null;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&(t=JSON.parse(t)).thingType&&t.thingType===e?panels.helpers.serialize.unserialize(t,t.thingType,null):null}}},{}],12:[function(e,t,i){t.exports={lock:function(){if("hidden"!==jQuery("body").css("overflow")){var e=[self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop];jQuery("body").data({"scroll-position":e}).css("overflow","hidden"),_.isUndefined(e)||window.scrollTo(e[0],e[1])}},unlock:function(){if("hidden"===jQuery("body").css("overflow")&&!jQuery(".so-panels-dialog-wrapper").is(":visible")&&!jQuery(".so-panels-live-editor").is(":visible")){jQuery("body").css("overflow","visible");var e=jQuery("body").data("scroll-position");_.isUndefined(e)||window.scrollTo(e[0],e[1])}}}},{}],13:[function(e,t,i){t.exports={serialize:function(e){var t;if(e instanceof Backbone.Model){var i={};for(var s in e.attributes)if(e.attributes.hasOwnProperty(s)){if("builder"===s||"collection"===s)continue;(t=e.attributes[s])instanceof Backbone.Model||t instanceof Backbone.Collection?i[s]=this.serialize(t):i[s]=t}return i}if(e instanceof Backbone.Collection){for(var l=[],o=0;o<e.models.length;o++)(t=e.models[o])instanceof Backbone.Model||t instanceof Backbone.Collection?l.push(this.serialize(t)):l.push(t);return l}},unserialize:function(e,t,i){var s;switch(t){case"row-model":(s=new panels.model.row).builder=i;var l={style:e.style};e.hasOwnProperty("label")&&(l.label=e.label),e.hasOwnProperty("color_label")&&(l.color_label=e.color_label),s.set(l),s.setCells(this.unserialize(e.cells,"cell-collection",s));break;case"cell-model":(s=new panels.model.cell).row=i,s.set("weight",e.weight),s.set("style",e.style),s.set("widgets",this.unserialize(e.widgets,"widget-collection",s));break;case"widget-model":for(var o in(s=new panels.model.widget).cell=i,e)e.hasOwnProperty(o)&&s.set(o,e[o]);s.set("widget_id",panels.helpers.utils.generateUUID());break;case"cell-collection":s=new panels.collection.cells;for(var n=0;n<e.length;n++)s.push(this.unserialize(e[n],"cell-model",i));break;case"widget-collection":s=new panels.collection.widgets;for(n=0;n<e.length;n++)s.push(this.unserialize(e[n],"widget-model",i));break;default:console.log("Unknown Thing - "+t)}return s}}},{}],14:[function(e,t,i){t.exports={generateUUID:function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(16)}))},processTemplate:function(e){return _.isUndefined(e)||_.isNull(e)?"":e=(e=(e=e.replace(/{{%/g,"<%")).replace(/%}}/g,"%>")).trim()},selectElementContents:function(e){var t=document.createRange();t.selectNodeContents(e);var i=window.getSelection();i.removeAllRanges(),i.addRange(t)}}},{}],15:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=function(e,t){return this.each((function(){var i=jQuery(this);if(!i.data("soPanelsBuilderWidgetInitialized")||t){var o=i.closest("form").find(".widget-id").val(),n=l.extend(!0,{builderSupports:i.data("builder-supports")},e);if(_.isUndefined(o)||!(o.indexOf("__i__")>-1)){var a=new s.model.builder,r=new s.view.builder({model:a,config:n}),d=i.closest(".so-panels-dialog-wrapper").data("view");_.isUndefined(d)||(d.on("close_dialog",(function(){a.refreshPanelsData()})),d.on("open_dialog_complete",(function(){r.trigger("builder_resize")})),d.model.on("destroy",(function(){a.emptyRows().destroy()})),r.setDialogParents(panelsOptions.loc.layout_widget,d));var h=Boolean(i.closest(".widget-content").length);r.render().attach({container:i,dialog:h||"dialog"===i.data("mode"),type:i.data("type")}).setDataField(i.find("input.panels-data")),h||"dialog"===i.data("mode")?(r.setDialogParents(panelsOptions.loc.layout_widget,r.dialog),i.find(".siteorigin-panels-display-builder").click((function(e){e.preventDefault(),r.dialog.openDialog()}))):i.find(".siteorigin-panels-display-builder").parent().remove(),l(document).trigger("panels_setup",r),i.data("soPanelsBuilderWidgetInitialized",!0)}}}))}},{}],16:[function(e,t,i){
2
  /**
3
  * Everything we need for SiteOrigin Page Builder.
4
  *
5
  * @copyright Greg Priday 2013 - 2016 - <https://siteorigin.com/>
6
  * @license GPL 3.0 http://www.gnu.org/licenses/gpl.html
7
  */
8
- var s={};window.panels=s,window.siteoriginPanels=s,s.helpers={},s.helpers.clipboard=e("./helpers/clipboard"),s.helpers.utils=e("./helpers/utils"),s.helpers.serialize=e("./helpers/serialize"),s.helpers.pageScroll=e("./helpers/page-scroll"),s.model={},s.model.widget=e("./model/widget"),s.model.cell=e("./model/cell"),s.model.row=e("./model/row"),s.model.builder=e("./model/builder"),s.model.historyEntry=e("./model/history-entry"),s.collection={},s.collection.widgets=e("./collection/widgets"),s.collection.cells=e("./collection/cells"),s.collection.rows=e("./collection/rows"),s.collection.historyEntries=e("./collection/history-entries"),s.view={},s.view.widget=e("./view/widget"),s.view.cell=e("./view/cell"),s.view.row=e("./view/row"),s.view.builder=e("./view/builder"),s.view.dialog=e("./view/dialog"),s.view.styles=e("./view/styles"),s.view.liveEditor=e("./view/live-editor"),s.dialog={},s.dialog.builder=e("./dialog/builder"),s.dialog.widgets=e("./dialog/widgets"),s.dialog.widget=e("./dialog/widget"),s.dialog.prebuilt=e("./dialog/prebuilt"),s.dialog.row=e("./dialog/row"),s.dialog.history=e("./dialog/history"),s.utils={},s.utils.menu=e("./utils/menu"),jQuery.fn.soPanelsSetupBuilderWidget=e("./jquery/setup-builder-widget"),jQuery((function(e){var t,i,s,l,o=e("#siteorigin-panels-metabox");if(s=e("form#post"),o.length&&s.length)t=o,i=o.find(".siteorigin-panels-data-field"),l={editorType:"tinyMCE",postId:e("#post_ID").val(),editorId:"#content",builderType:o.data("builder-type"),builderSupports:o.data("builder-supports"),loadOnAttach:panelsOptions.loadOnAttach&&1==e("#auto_draft").val(),loadLiveEditor:1==o.data("live-editor"),liveEditorPreview:t.data("preview-url")};else if(e(".siteorigin-panels-builder-form").length){var n=e(".siteorigin-panels-builder-form");t=n.find(".siteorigin-panels-builder-container"),i=n.find('input[name="panels_data"]'),s=n,l={editorType:"standalone",postId:n.data("post-id"),editorId:"#post_content",builderType:n.data("type"),builderSupports:n.data("builder-supports"),loadLiveEditor:!1,liveEditorPreview:n.data("preview-url")}}if(!_.isUndefined(t)){var a=window.siteoriginPanels,r=new a.model.builder,d=new a.view.builder({model:r,config:l});e(document).trigger("before_panels_setup",d),d.render().attach({container:t}).setDataField(i).attachToEditor(),s.submit((function(){r.refreshPanelsData()})),t.removeClass("so-panels-loading"),e(document).trigger("panels_setup",d,window.panels),window.soPanelsBuilderView=d}e(document).on("widget-added",(function(t,i){e(i).find(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e("body").hasClass("wp-customizer")||e((function(){e(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e(window).on("keyup",(function(t){27===t.which&&e(".so-panels-dialog-wrapper, .so-panels-live-editor").filter(":visible").last().find(".so-title-bar .so-close, .live-editor-close").click()}))}))},{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/page-scroll":12,"./helpers/serialize":13,"./helpers/utils":14,"./jquery/setup-builder-widget":15,"./model/builder":17,"./model/cell":18,"./model/history-entry":19,"./model/row":20,"./model/widget":21,"./utils/menu":22,"./view/builder":23,"./view/cell":24,"./view/dialog":25,"./view/live-editor":26,"./view/row":27,"./view/styles":28,"./view/widget":29}],17:[function(e,t,i){t.exports=Backbone.Model.extend({layoutPosition:{BEFORE:"before",AFTER:"after",REPLACE:"replace"},rows:{},defaults:{data:{widgets:[],grids:[],grid_cells:[]}},initialize:function(){this.set("rows",new panels.collection.rows)},addRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var s=new panels.collection.cells(t);e=_.extend({collection:this.get("rows"),cells:s},e);var l=new panels.model.row(e);return l.builder=this,this.get("rows").add(l,i),l},loadPanelsData:function(e,t){try{t===this.layoutPosition.BEFORE?e=this.concatPanelsData(e,this.getPanelsData()):t===this.layoutPosition.AFTER&&(e=this.concatPanelsData(this.getPanelsData(),e)),this.emptyRows(),this.set("data",JSON.parse(JSON.stringify(e)),{silent:!0});var i,s=[];if(_.isUndefined(e.grid_cells))return void this.trigger("load_panels_data");for(var l=0;l<e.grid_cells.length;l++)i=parseInt(e.grid_cells[l].grid),_.isUndefined(s[i])&&(s[i]=[]),s[i].push(e.grid_cells[l]);var o=this;if(_.each(s,(function(t,i){var s={};_.isUndefined(e.grids[i].style)||(s.style=e.grids[i].style),_.isUndefined(e.grids[i].ratio)||(s.ratio=e.grids[i].ratio),_.isUndefined(e.grids[i].ratio_direction)||(s.ratio_direction=e.grids[i].ratio_direction),_.isUndefined(e.grids[i].color_label)||(s.color_label=e.grids[i].color_label),_.isUndefined(e.grids[i].label)||(s.label=e.grids[i].label),o.addRow(s,t,{noAnimate:!0})})),_.isUndefined(e.widgets))return;_.each(e.widgets,(function(e){var t=null;_.isUndefined(e.panels_info)?(t=e.info,delete e.info):(t=e.panels_info,delete e.panels_info);var i=o.get("rows").at(parseInt(t.grid)).get("cells").at(parseInt(t.cell)),s=new panels.model.widget({class:t.class,values:e});_.isUndefined(t.style)||s.set("style",t.style),_.isUndefined(t.read_only)||s.set("read_only",t.read_only),_.isUndefined(t.widget_id)?s.set("widget_id",panels.helpers.utils.generateUUID()):s.set("widget_id",t.widget_id),_.isUndefined(t.label)||s.set("label",t.label),s.cell=i,i.get("widgets").add(s,{noAnimate:!0})})),this.trigger("load_panels_data")}catch(e){console.log("Error loading data: "+e.message)}},concatPanelsData:function(e,t){if(_.isUndefined(t)||_.isUndefined(t.grids)||_.isEmpty(t.grids)||_.isUndefined(t.grid_cells)||_.isEmpty(t.grid_cells))return e;if(_.isUndefined(e)||_.isUndefined(e.grids)||_.isEmpty(e.grids))return t;var i,s=e.grids.length,l=_.isUndefined(e.widgets)?0:e.widgets.length,o={grids:[],grid_cells:[],widgets:[]};for(o.grids=e.grids.concat(t.grids),_.isUndefined(e.grid_cells)||(o.grid_cells=e.grid_cells.slice()),_.isUndefined(e.widgets)||(o.widgets=e.widgets.slice()),i=0;i<t.grid_cells.length;i++){var n=t.grid_cells[i];n.grid=parseInt(n.grid)+s,o.grid_cells.push(n)}if(!_.isUndefined(t.widgets))for(i=0;i<t.widgets.length;i++){var a=t.widgets[i];a.panels_info.grid=parseInt(a.panels_info.grid)+s,a.panels_info.id=parseInt(a.panels_info.id)+l,o.widgets.push(a)}return o},getPanelsData:function(){var e={widgets:[],grids:[],grid_cells:[]},t=0;return this.get("rows").each((function(i,s){i.get("cells").each((function(i,l){i.get("widgets").each((function(i,o){var n={class:i.get("class"),raw:i.get("raw"),grid:s,cell:l,id:t++,widget_id:i.get("widget_id"),style:i.get("style"),label:i.get("label")};_.isEmpty(n.widget_id)&&(n.widget_id=panels.helpers.utils.generateUUID());var a=_.extend(_.clone(i.get("values")),{panels_info:n});e.widgets.push(a)})),e.grid_cells.push({grid:s,index:l,weight:i.get("weight"),style:i.get("style")})})),e.grids.push({cells:i.get("cells").length,style:i.get("style"),ratio:i.get("ratio"),ratio_direction:i.get("ratio_direction"),color_label:i.get("color_label"),label:i.get("label")})})),e},refreshPanelsData:function(e){e=_.extend({silent:!1},e);var t=this.get("data"),i=this.getPanelsData();this.set("data",i,{silent:!0}),e.silent||JSON.stringify(i)===JSON.stringify(t)||(this.trigger("change"),this.trigger("change:data"),this.trigger("refresh_panels_data",i,e))},emptyRows:function(){return _.invoke(this.get("rows").toArray(),"destroy"),this.get("rows").reset(),this},isValidLayoutPosition:function(e){return e===this.layoutPosition.BEFORE||e===this.layoutPosition.AFTER||e===this.layoutPosition.REPLACE},getPanelsDataFromHtml:function(e,t){var i,s=this,l=jQuery('<div id="wrapper">'+e+"</div>");if(l.find(".panel-layout .panel-grid").length){var o={grids:[],grid_cells:[],widgets:[]},n=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),a=(i=document.createElement("div"),function(e){return e&&"string"==typeof e&&(e=(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),i.innerHTML=e,e=i.textContent,i.textContent=""),e}),r=function(e){var t,i=e.find("div");if(!i.length)return e.html();for(t=0;t<i.length-1&&jQuery.trim(i.eq(t).text())==jQuery.trim(i.eq(t+1).text());t++);var s=i.eq(t).find(".widget-title:header"),l="";return s.length&&(l=s.html(),s.remove()),{title:l,text:i.eq(t).html()}},d=l.find(".panel-layout").eq(0),h=function(e,t){return jQuery(t).closest(".panel-layout").is(d)};return l.find("> .panel-layout > .panel-grid").filter(h).each((function(e,i){var l=jQuery(i),d=l.find(".panel-grid-cell").filter(h);o.grids.push({cells:d.length,style:l.data("style"),ratio:l.data("ratio"),ratio_direction:l.data("ratio-direction"),color_label:l.data("color-label"),label:l.data("label")}),d.each((function(i,l){var d=jQuery(l),c=d.find(".so-panel").filter(h);o.grid_cells.push({grid:e,weight:_.isUndefined(d.data("weight"))?1:parseFloat(d.data("weight")),style:d.data("style")}),c.each((function(l,d){var h=jQuery(d),c=h.find(".panel-widget-style").length?h.find(".panel-widget-style").html():h.html(),u={grid:e,cell:i,style:h.data("style"),raw:!1,label:h.data("label")};c=c.trim();var p=n.exec(c);if(!_.isNull(p)&&""===c.replace(n,"").trim()){try{var g=/class="(.*?)"/.exec(p[3]),f=jQuery(p[5]),w=JSON.parse(a(f.val())).instance;u.class=g[1].replace(/\\\\+/g,"\\"),u.raw=!1,w.panels_info=u,o.widgets.push(w)}catch(e){u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u}))}return!0}return-1!==c.indexOf("panel-layout")&&jQuery("<div>"+c+"</div>").find(".panel-layout .panel-grid").length?(u.class="SiteOrigin_Panels_Widgets_Layout",o.widgets.push({panels_data:s.getPanelsDataFromHtml(c,t),panels_info:u}),!0):(u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u})),!0)}))}))})),l.find(".panel-layout").remove(),l.find("style[data-panels-style-for-post]").remove(),l.html().replace(/^\s+|\s+$/gm,"").length&&(o.grids.push({cells:1,style:{}}),o.grid_cells.push({grid:o.grids.length-1,weight:1}),o.widgets.push({filter:"1",text:l.html().replace(/^\s+|\s+$/gm,""),title:"",type:"visual",panels_info:{class:t,raw:!1,grid:o.grids.length-1,cell:0}})),o}return{grid_cells:[{grid:0,weight:1}],grids:[{cells:1}],widgets:[{filter:"1",text:e,title:"",type:"visual",panels_info:{class:t,raw:!1,grid:0,cell:0}}]}}})},{}],18:[function(e,t,i){t.exports=Backbone.Model.extend({widgets:{},row:null,defaults:{weight:0,style:{}},indexes:null,initialize:function(){this.set("widgets",new panels.collection.widgets),this.on("destroy",this.onDestroy,this)},onDestroy:function(){_.invoke(this.get("widgets").toArray(),"destroy"),this.get("widgets").reset()},clone:function(e,t){_.isUndefined(e)&&(e=this.row),t=_.extend({cloneWidgets:!0},t);var i=new this.constructor(this.attributes);return i.set("collection",e.get("cells"),{silent:!0}),i.row=e,t.cloneWidgets&&this.get("widgets").each((function(e){i.get("widgets").add(e.clone(i,t),{silent:!0})})),i}})},{}],19:[function(e,t,i){t.exports=Backbone.Model.extend({defaults:{text:"",data:"",time:null,count:1}})},{}],20:[function(e,t,i){t.exports=Backbone.Model.extend({builder:null,defaults:{style:{}},indexes:null,initialize:function(){_.isEmpty(this.get("cells"))?this.set("cells",new panels.collection.cells):this.get("cells").each(function(e){e.row=this}.bind(this)),this.on("destroy",this.onDestroy,this)},setCells:function(e){var t=this.get("cells")||new panels.collection.cells,i=[];t.each((function(s,l){var o=e.at(l);if(o)s.set("weight",o.get("weight"));else{for(var n=t.at(e.length-1),a=s.get("widgets").models.slice(),r=0;r<a.length;r++)a[r].moveToCell(n,{silent:!1});i.push(s)}})),_.each(i,(function(e){t.remove(e)})),e.length>t.length&&_.each(e.slice(t.length,e.length),function(e){e.set({collection:t}),e.row=this,t.add(e)}.bind(this)),this.reweightCells()},reweightCells:function(){var e=0,t=this.get("cells");t.each((function(t){e+=t.get("weight")})),t.each((function(t){t.set("weight",t.get("weight")/e)})),this.trigger("reweight_cells")},onDestroy:function(){_.invoke(this.get("cells").toArray(),"destroy"),this.get("cells").reset()},clone:function(e){_.isUndefined(e)&&(e=this.builder);var t=new this.constructor(this.attributes);t.set("collection",e.get("rows"),{silent:!0}),t.builder=e;var i=new panels.collection.cells;return this.get("cells").each((function(e){i.add(e.clone(t),{silent:!0})})),t.set("cells",i),t}})},{}],21:[function(e,t,i){t.exports=Backbone.Model.extend({cell:null,defaults:{class:null,missing:!1,values:{},raw:!1,style:{},read_only:!1,widget_id:""},indexes:null,initialize:function(){var e=this.get("class");!_.isUndefined(panelsOptions.widgets[e])&&panelsOptions.widgets[e].installed||this.set("missing",!0)},getWidgetField:function(e){return _.isUndefined(panelsOptions.widgets[this.get("class")])?"title"===e||"description"===e?panelsOptions.loc.missing_widget[e]:"":this.has("label")&&!_.isEmpty(this.get("label"))?this.get("label"):panelsOptions.widgets[this.get("class")][e]},moveToCell:function(e,t,i){return t=_.extend({silent:!0},t),this.cell=e,this.collection.remove(this,t),e.get("widgets").add(this,_.extend({at:i},t)),this.trigger("move_to_cell",e,i),this},setValues:function(e){var t=!1;JSON.stringify(e)!==JSON.stringify(this.get("values"))&&(t=!0),this.set("values",e,{silent:!0}),t&&(this.trigger("change",this),this.trigger("change:values"))},clone:function(e,t){_.isUndefined(e)&&(e=this.cell);var i=new this.constructor(this.attributes),s=JSON.parse(JSON.stringify(this.get("values"))),l=function(e){return _.each(e,(function(t,i){_.isString(i)&&"_"===i[0]?delete e[i]:_.isObject(e[i])&&l(e[i])})),e};return s=l(s),"SiteOrigin_Panels_Widgets_Layout"===this.get("class")&&(s.builder_id=Math.random().toString(36).substr(2)),i.set("widget_id",""),i.set("values",s,{silent:!0}),i.set("collection",e.get("widgets"),{silent:!0}),i.cell=e,i.isDuplicate=!0,i},getTitle:function(){var e=panelsOptions.widgets[this.get("class")];if(_.isUndefined(e))return this.get("class").replace(/_/g," ");if(!_.isUndefined(e.panels_title)&&!1===e.panels_title)return panelsOptions.widgets[this.get("class")].description;var t=this.get("values"),i=["title","text"];for(var s in t)"_"!==s.charAt(0)&&"so_sidebar_emulator_id"!==s&&"option_name"!==s&&t.hasOwnProperty(s)&&i.push(s);for(var l in i=_.uniq(i))if(!_.isUndefined(t[i[l]])&&_.isString(t[i[l]])&&""!==t[i[l]]&&"on"!==t[i[l]]&&"true"!==t[i[l]]&&"false"!==t[i[l]]&&"_"!==i[l][0]&&!jQuery.isNumeric(t[i[l]])){var o=t[i[l]],n=(o=o.replace(/<\/?[^>]+(>|$)/g,"")).split(" ");return(n=n.slice(0,20)).join(" ")}return this.getWidgetField("description")}})},{}],22:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({wrapperTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu").html())),sectionTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu-section").html())),contexts:[],active:!1,events:{"keyup .so-search-wrapper input":"searchKeyUp"},initialize:function(){this.listenContextMenu(),this.render(),this.attach()},listenContextMenu:function(){var e=this;l(window).on("contextmenu",(function(t){return e.active&&!e.isOverEl(e.$el,t)?(e.closeMenu(),e.active=!1,t.preventDefault(),!1):!!e.active||(e.active=!1,e.trigger("activate_context",t,e),void(e.active&&(t.preventDefault(),e.openMenu({left:t.pageX,top:t.pageY}))))}))},render:function(){this.setElement(this.wrapperTemplate())},attach:function(){this.$el.appendTo("body")},openMenu:function(e){this.trigger("open_menu"),l(window).on("keyup",{menu:this},this.keyboardListen),l(window).on("click",{menu:this},this.clickOutsideListen),this.$el.css("max-height",l(window).height()-20),e.left+this.$el.outerWidth()+10>=l(window).width()&&(e.left=l(window).width()-this.$el.outerWidth()-10),e.left<=0&&(e.left=10),e.top+this.$el.outerHeight()-l(window).scrollTop()+10>=l(window).height()&&(e.top=l(window).height()+l(window).scrollTop()-this.$el.outerHeight()-10),e.left<=0&&(e.left=10),this.$el.css({left:e.left+1,top:e.top+1}).show(),this.$(".so-search-wrapper input").focus()},closeMenu:function(){this.trigger("close_menu"),l(window).off("keyup",this.keyboardListen),l(window).off("click",this.clickOutsideListen),this.active=!1,this.$el.empty().hide()},keyboardListen:function(e){var t=e.data.menu;switch(e.which){case 27:t.closeMenu()}},clickOutsideListen:function(e){var t=e.data.menu;3!==e.which&&t.$el.is(":visible")&&!t.isOverEl(t.$el,e)&&t.closeMenu()},addSection:function(e,t,i,s){var o=this;t=_.extend({display:5,defaultDisplay:!1,search:!0,sectionTitle:"",searchPlaceholder:"",titleKey:"title"},t);var n=l(this.sectionTemplate({settings:t,items:i})).attr("id","panels-menu-section-"+e);this.$el.append(n),n.find(".so-item:not(.so-confirm)").click((function(){var e=l(this);s(e.data("key")),o.closeMenu()})),n.find(".so-item.so-confirm").click((function(){var e=l(this);if(e.hasClass("so-confirming"))return s(e.data("key")),void o.closeMenu();e.data("original-text",e.html()).addClass("so-confirming").html('<span class="dashicons dashicons-yes"></span> '+panelsOptions.loc.dropdown_confirm),setTimeout((function(){e.removeClass("so-confirming"),e.html(e.data("original-text"))}),2500)})),n.data("settings",t).find(".so-search-wrapper input").trigger("keyup"),this.active=!0},hasSection:function(e){return this.$el.find("#panels-menu-section-"+e).length>0},searchKeyUp:function(e){var t=l(e.currentTarget),i=t.closest(".so-section"),s=i.data("settings");if(38===e.which||40===e.which){var o=i.find("ul li:visible"),n=o.filter(".so-active").eq(0);if(n.length){o.removeClass("so-active");var a=o.index(n);38===e.which?n=a-1<0?o.last():o.eq(a-1):40===e.which&&(n=a+1>=o.length?o.first():o.eq(a+1))}else 38===e.which?n=o.last():40===e.which&&(n=o.first());return n.addClass("so-active"),!1}if(13===e.which)return 1===i.find("ul li:visible").length?(i.find("ul li:visible").trigger("click"),!1):(i.find("ul li.so-active:visible").trigger("click"),!1);if(""===t.val())if(s.defaultDisplay){i.find(".so-item").hide();for(var r=0;r<s.defaultDisplay.length;r++)i.find('.so-item[data-key="'+s.defaultDisplay[r]+'"]').show()}else i.find(".so-item").show();else i.find(".so-item").hide().each((function(){var e=l(this);-1!==e.html().toLowerCase().indexOf(t.val().toLowerCase())&&e.show()}));i.find(".so-item:visible:gt("+(s.display-1)+")").hide(),0===i.find(".so-item:visible").length&&""!==t.val()?i.find(".so-no-results").show():i.find(".so-no-results").hide()},isOverEl:function(e,t){var i=[[e.offset().left,e.offset().top],[e.offset().left+e.outerWidth(),e.offset().top+e.outerHeight()]];return t.pageX>=i[0][0]&&t.pageX<=i[1][0]&&t.pageY>=i[0][1]&&t.pageY<=i[1][1]}})},{}],23:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({config:{},template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder").html())),dialogs:{},rowsSortable:null,dataField:!1,currentData:"",contentPreview:"",attachedToEditor:!1,attachedVisible:!1,liveEditor:void 0,menu:!1,activeCell:null,events:{"click .so-tool-button.so-widget-add":"displayAddWidgetDialog","click .so-tool-button.so-row-add":"displayAddRowDialog","click .so-tool-button.so-prebuilt-add":"displayAddPrebuiltDialog","click .so-tool-button.so-history":"displayHistoryDialog","click .so-tool-button.so-live-editor":"displayLiveEditor"},rows:null,initialize:function(e){var t=this;return this.config=_.extend({loadLiveEditor:!1,builderSupports:{}},e.config),this.config.builderSupports=_.extend({addRow:!0,editRow:!0,deleteRow:!0,moveRow:!0,addWidget:!0,editWidget:!0,deleteWidget:!0,moveWidget:!0,prebuilt:!0,history:!0,liveEditor:!0,revertToEditor:!0},this.config.builderSupports),e.config.loadLiveEditor&&this.on("builder_live_editor_added",(function(){this.displayLiveEditor()})),this.dialogs={widgets:new s.dialog.widgets,row:new s.dialog.row,prebuilt:new s.dialog.prebuilt},_.each(this.dialogs,(function(e,i,s){s[i].setBuilder(t)})),this.dialogs.row.setRowDialogType("create"),this.listenTo(this.model.get("rows"),"add",this.onAddRow),l(window).resize((function(e){e.target===window&&t.trigger("builder_resize")})),this.listenTo(this.model,"change:data load_panels_data",this.storeModelData),this.listenTo(this.model,"change:data load_panels_data",this.toggleWelcomeDisplay),this.on("builder_attached_to_editor",this.handleContentChange,this),this.on("content_change",this.handleContentChange,this),this.on("display_builder",this.handleDisplayBuilder,this),this.on("hide_builder",this.handleHideBuilder,this),this.on("builder_rendered builder_resize",this.handleBuilderSizing,this),this.on("display_builder",this.wrapEditorExpandAdjust,this),this.menu=new s.utils.menu({}),this.listenTo(this.menu,"activate_context",this.activateContextMenu),this.config.loadOnAttach&&this.on("builder_attached_to_editor",(function(){this.displayAttachedBuilder({confirm:!1})}),this),this},render:function(){return this.setElement(this.template()),this.$el.attr("id","siteorigin-panels-builder-"+this.cid).addClass("so-builder-container"),this.trigger("builder_rendered"),this},attach:function(e){(e=_.extend({container:!1,dialog:!1},e)).dialog?(this.dialog=new s.dialog.builder,this.dialog.builder=this):(this.$el.appendTo(e.container),this.metabox=e.container.closest(".postbox"),this.initSortable(),this.trigger("attached_to_container",e.container)),this.trigger("builder_attached"),this.supports("liveEditor")&&this.addLiveEditor(),this.supports("history")&&this.addHistoryBrowser();var t=this.$(".so-builder-toolbar"),i=this.$(".so-panels-welcome-message"),l=panelsOptions.loc.welcomeMessage,o=[];this.supports("addWidget")?o.push(l.addWidgetButton):t.find(".so-widget-add").hide(),this.supports("addRow")?o.push(l.addRowButton):t.find(".so-row-add").hide(),this.supports("prebuilt")?o.push(l.addPrebuiltButton):t.find(".so-prebuilt-add").hide();var n="";3===o.length?n=l.threeEnabled:2===o.length?n=l.twoEnabled:1===o.length?n=l.oneEnabled:0===o.length&&(n=l.addingDisabled);var a=_.template(s.helpers.utils.processTemplate(n))({items:o})+" "+l.docsMessage;return i.find(".so-message-wrapper").html(a),this},attachToEditor:function(){if("tinyMCE"!==this.config.editorType)return this;this.attachedToEditor=!0;var e=this.metabox,t=this;l("#wp-content-wrap .wp-editor-tabs").find(".wp-switch-editor").click((function(e){e.preventDefault(),l("#wp-content-editor-container").show(),l("#wp-content-wrap").removeClass("panels-active"),l("#content-resize-handle").show(),t.trigger("hide_builder")})).end().append(l('<button type="button" id="content-panels" class="hide-if-no-js wp-switch-editor switch-panels">'+e.find("h2.hndle").html()+"</button>").click((function(e){t.displayAttachedBuilder({confirm:!0})&&e.preventDefault()}))),this.supports("revertToEditor")&&e.find(".so-switch-to-standard").click((function(i){i.preventDefault(),confirm(panelsOptions.loc.confirm_stop_builder)&&(t.addHistoryEntry("back_to_editor"),t.model.loadPanelsData(!1),l("#wp-content-wrap").show(),e.hide(),l(window).resize(),t.attachedVisible=!1,t.trigger("hide_builder"))})).show(),e.insertAfter("#wp-content-wrap").hide().addClass("attached-to-editor");var i=this.model.get("data");_.isEmpty(i.widgets)&&_.isEmpty(i.grids)&&this.supports("revertToEditor")||this.displayAttachedBuilder({confirm:!1});var s=function(){var e=t.$(".so-builder-toolbar");if(t.$el.hasClass("so-display-narrow"))return e.css({top:0,left:0,width:"100%",position:"absolute"}),void t.$el.css("padding-top",e.outerHeight());var i=l(window).scrollTop()-t.$el.offset().top;"fixed"===l("#wpadminbar").css("position")&&(i+=l("#wpadminbar").outerHeight());var s=0,o=t.$el.outerHeight()-e.outerHeight()+20;i>s&&i<o?"fixed"!==e.css("position")&&e.css({top:l("#wpadminbar").outerHeight(),left:t.$el.offset().left,width:t.$el.outerWidth(),position:"fixed"}):e.css({top:Math.min(Math.max(i,0),t.$el.outerHeight()-e.outerHeight()+20),left:0,width:"100%",position:"absolute"}),t.$el.css("padding-top",e.outerHeight())};return this.on("builder_resize",s,this),l(document).scroll(s),s(),this.trigger("builder_attached_to_editor"),this},displayAttachedBuilder:function(e){if((e=_.extend({confirm:!0},e)).confirm){var t="undefined"!=typeof tinyMCE&&tinyMCE.get("content");if(""!==(t&&_.isFunction(t.getContent)?t.getContent():l("textarea#content").val())&&!confirm(panelsOptions.loc.confirm_use_builder))return!1}return l("#wp-content-wrap").hide(),l("#editor-expand-toggle").on("change.editor-expand",(function(){l(this).prop("checked")||l("#wp-content-wrap").hide()})),this.metabox.show().find("> .inside").show(),l(window).resize(),l(document).scroll(),this.attachedVisible=!0,this.trigger("display_builder"),!0},initSortable:function(){if(!this.supports("moveRow"))return this;var e=this,t=e.$el.attr("id");return this.rowsSortable=this.$(".so-rows-container").sortable({appendTo:"#wpwrap",items:".so-row-container",handle:".so-row-move",connectWith:"#"+t+".so-rows-container,.block-editor .so-rows-container",axis:"y",tolerance:"pointer",scroll:!1,remove:function(t,i){e.model.get("rows").remove(l(i.item).data("view").model,{silent:!0}),e.model.refreshPanelsData()},receive:function(t,i){e.model.get("rows").add(l(i.item).data("view").model,{silent:!0,at:l(i.item).index()}),e.model.refreshPanelsData()},stop:function(t,i){var s=l(i.item),o=s.data("view"),n=e.model.get("rows");n.get(o.model)&&(e.addHistoryEntry("row_moved"),n.remove(o.model,{silent:!0}),n.add(o.model,{silent:!0,at:s.index()}),o.trigger("move",s.index()),e.model.refreshPanelsData())}}),this},refreshSortable:function(){_.isNull(this.rowsSortable)||this.rowsSortable.sortable("refresh")},setDataField:function(e,t){if(t=_.extend({load:!0},t),this.dataField=e,this.dataField.data("builder",this),t.load&&""!==e.val()){var i=this.dataField.val();try{i=JSON.parse(i)}catch(e){console.log("Failed to parse Page Builder layout data from supplied data field."),i={}}this.setData(i)}return this},setData:function(e){this.model.loadPanelsData(e),this.currentData=e,this.toggleWelcomeDisplay()},getData:function(){return this.model.get("data")},storeModelData:function(){var e=JSON.stringify(this.model.get("data"));l(this.dataField).val()!==e&&(l(this.dataField).val(e),l(this.dataField).trigger("change"),this.trigger("content_change"))},onAddRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.row({model:e});l.builder=this,l.render(),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".so-rows-container")):l.$el.insertAfter(this.$(".so-rows-container .so-row-container").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),l.resize(),this.trigger("row_added")},displayAddWidgetDialog:function(){this.dialogs.widgets.openDialog()},displayAddRowDialog:function(){var e=new s.model.row,t=new s.collection.cells([{weight:.5},{weight:.5}]);t.each((function(t){t.row=e})),e.set("cells",t),e.builder=this.model,this.dialogs.row.setRowModel(e),this.dialogs.row.openDialog()},displayAddPrebuiltDialog:function(){this.dialogs.prebuilt.openDialog()},displayHistoryDialog:function(){this.dialogs.history.openDialog()},pasteRowHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.addHistoryEntry("row_pasted"),e.builder=this.model,this.model.get("rows").add(e,{at:this.model.get("rows").indexOf(this.model)+1}),this.model.refreshPanelsData())},getActiveCell:function(e){if(e=_.extend({createCell:!0},e),!this.model.get("rows").length){if(!e.createCell)return null;this.model.addRow({},[{weight:1}],{noAnimate:!0})}var t=this.activeCell;return _.isEmpty(t)||-1===this.model.get("rows").indexOf(t.model.row)?this.model.get("rows").last().get("cells").first():t.model},addLiveEditor:function(){return _.isEmpty(this.config.liveEditorPreview)?this:(this.liveEditor=new s.view.liveEditor({builder:this,previewUrl:this.config.liveEditorPreview}),this.liveEditor.hasPreviewUrl()&&this.$(".so-builder-toolbar .so-live-editor").show(),this.trigger("builder_live_editor_added"),this)},displayLiveEditor:function(){_.isUndefined(this.liveEditor)||this.liveEditor.open()},addHistoryBrowser:function(){if(_.isEmpty(this.config.liveEditorPreview))return this;this.dialogs.history=new s.dialog.history,this.dialogs.history.builder=this,this.dialogs.history.entries.builder=this.model,this.dialogs.history.setRevertEntry(this.model),this.$(".so-builder-toolbar .so-history").show()},addHistoryEntry:function(e,t){_.isUndefined(t)&&(t=null),_.isUndefined(this.dialogs.history)||this.dialogs.history.entries.addEntry(e,t)},supports:function(e){return"rowAction"===e?this.supports("addRow")||this.supports("editRow")||this.supports("deleteRow"):"widgetAction"===e?this.supports("addWidget")||this.supports("editWidget")||this.supports("deleteWidget"):!_.isUndefined(this.config.builderSupports[e])&&this.config.builderSupports[e]},handleContentChange:function(){if(panelsOptions.copy_content&&this.attachedToEditor&&this.$el.is(":visible")){var e=this.model.getPanelsData();_.isEmpty(e.widgets)||l.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:this.config.postId},function(e){""!==e.preview&&(this.contentPreview=e.preview),""!==e.post_content&&this.updateEditorContent(e.post_content)}.bind(this))}},updateEditorContent:function(e){if("tinyMCE"!==this.config.editorType||"undefined"==typeof tinyMCE||_.isNull(tinyMCE.get("content"))){l(this.config.editorId).val(e).trigger("change").trigger("keyup")}else{var t=tinyMCE.get("content");t.setContent(e),t.fire("change"),t.fire("keyup")}this.triggerSeoChange()},triggerSeoChange:function(){"undefined"==typeof YoastSEO||_.isNull(YoastSEO)||_.isNull(YoastSEO.app.refresh)||YoastSEO.app.refresh(),"undefined"==typeof rankMathEditor||_.isNull(rankMathEditor)||_.isNull(rankMathEditor.refresh)||rankMathEditor.refresh("content")},handleDisplayBuilder:function(){var e="undefined"!=typeof tinyMCE&&tinyMCE.get("content"),t=e&&_.isFunction(e.getContent)?e.getContent():l("textarea#content").val();if((_.isEmpty(this.model.get("data"))||_.isEmpty(this.model.get("data").widgets)&&_.isEmpty(this.model.get("data").grids))&&""!==t){var i=panelsOptions.text_widget;if(_.isEmpty(i))return;this.model.loadPanelsData(this.model.getPanelsDataFromHtml(t,i)),this.model.trigger("change"),this.model.trigger("change:data")}l("#post-status-info").addClass("for-siteorigin-panels")},handleHideBuilder:function(){l("#post-status-info").show().removeClass("for-siteorigin-panels")},wrapEditorExpandAdjust:function(){try{for(var e,t=(l.hasData(window)&&l._data(window)).events.scroll,i=0;i<t.length;i++)if("editor-expand"===t[i].namespace){e=t[i],l(window).unbind("scroll",e.handler),l(window).bind("scroll",function(t){this.attachedVisible||e.handler(t)}.bind(this));break}}catch(e){return}},handleBuilderSizing:function(){var e=this.$el.width();return e?(e<575?this.$el.addClass("so-display-narrow"):this.$el.removeClass("so-display-narrow"),this):this},setDialogParents:function(e,t){_.each(this.dialogs,(function(i,s,l){l[s].setParent(e,t)})),this.on("add_dialog",(function(i){i.setParent(e,t)}),this)},toggleWelcomeDisplay:function(){this.model.get("rows").isEmpty()?this.$(".so-panels-welcome-message").show():this.$(".so-panels-welcome-message").hide()},activateContextMenu:function(e,t){if(l.contains(this.$el.get(0),e.target)){var i=l([]).add(this.$(".so-panels-welcome-message:visible")).add(this.$(".so-rows-container > .so-row-container")).add(this.$(".so-cells > .cell")).add(this.$(".cell-wrapper > .so-widget")).filter((function(i){return t.isOverEl(l(this),e)})),s=i.last().data("view");void 0!==s&&void 0!==s.buildContextualMenu?s.buildContextualMenu(e,t):i.last().hasClass("so-panels-welcome-message")&&this.buildContextualMenu(e,t)}},buildContextualMenu:function(e,t){var i={};this.supports("addRow")&&(i.add_row={title:panelsOptions.loc.contextual.add_row}),s.helpers.clipboard.canCopyPaste()&&s.helpers.clipboard.isModel("row-model")&&this.supports("addRow")&&(i.paste_row={title:panelsOptions.loc.contextual.row_paste}),_.isEmpty(i)||t.addSection("builder-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},i,function(e){switch(e){case"add_row":this.displayAddRowDialog();break;case"paste_row":this.pasteRowHandler()}}.bind(this))}})},{}],24:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-cell").html())),events:{"click .cell-wrapper":"handleCellClick"},row:null,widgetSortable:null,initialize:function(){this.listenTo(this.model.get("widgets"),"add",this.onAddWidget)},render:function(){var e={weight:this.model.get("weight"),totalWeight:this.row.model.get("cells").totalWeight()};this.setElement(this.template(e)),this.$el.data("view",this);var t=this;return this.model.get("widgets").each((function(e){var i=new s.view.widget({model:e});i.cell=t,i.render(),i.$el.appendTo(t.$(".widgets-container"))})),this.initSortable(),this.initResizable(),this},initSortable:function(){if(!this.row.builder.supports("moveWidget"))return this;var e=this,t=e.row.builder,i=t.$el.attr("id"),s=t.model;return this.widgetSortable=this.$(".widgets-container").sortable({placeholder:"so-widget-sortable-highlight",connectWith:"#"+i+" .so-cells .cell .widgets-container,.block-editor .so-cells .cell .widgets-container",tolerance:"pointer",scroll:!1,over:function(t,i){e.row.builder.trigger("widget_sortable_move")},remove:function(t,i){e.model.get("widgets").remove(l(i.item).data("view").model,{silent:!0}),s.refreshPanelsData()},receive:function(t,i){var o=l(i.item).data("view");o.cell=e;var n=o.model;n.cell=e.model,e.model.get("widgets").add(n,{silent:!0,at:l(i.item).index()}),s.refreshPanelsData()},stop:function(t,i){var o=l(i.item),n=o.data("view"),a=o.closest(".cell").data("view");e.model.get("widgets").get(n.model)&&(e.row.builder.addHistoryEntry("widget_moved"),n.model.moveToCell(a.model,{},o.index()),n.cell=a,s.refreshPanelsData())},helper:function(e,t){var i=t.clone().css({width:t.outerWidth(),"z-index":1e4,position:"fixed"}).addClass("widget-being-dragged").appendTo("body");return t.outerWidth()>720&&i.animate({"margin-left":e.pageX-t.offset().left-240,width:480},"fast"),i}}),this},refreshSortable:function(){_.isNull(this.widgetSortable)||this.widgetSortable.sortable("refresh")},initResizable:function(){if(!this.row.builder.supports("editRow"))return this;var e,t=this.$(".resize-handle").css("position","absolute"),i=this.row.$el,s=this;return t.draggable({axis:"x",containment:i,start:function(t,i){if(e=s.$el.prev().data("view"),!_.isUndefined(e)){var o=s.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:s.$el.outerWidth(),left:5,height:s.$el.outerHeight()});o.find(".resize-handle").remove();var n=e.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:e.$el.outerWidth(),right:5,height:e.$el.outerHeight()});n.find(".resize-handle").remove(),l(this).data({newCellClone:o,prevCellClone:n})}},drag:function(i,o){var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;l(this).data("newCellClone").css("width",n*a).find(".preview-cell-weight").html(Math.round(1e3*a)/10),l(this).data("prevCellClone").css("width",n*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10)},stop:function(i,o){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove();var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;a>.02&&r>.02&&(s.row.builder.addHistoryEntry("cell_resized"),s.model.set("weight",a),e.model.set("weight",r),s.row.resize()),o.helper.css("left",-t.outerWidth()/2),s.row.builder.model.refreshPanelsData()}}),this},onAddWidget:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.widget({model:e});l.cell=this,_.isUndefined(e.isDuplicate)&&(e.isDuplicate=!1),l.render({loadForm:e.isDuplicate}),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".widgets-container")):l.$el.insertAfter(this.$(".widgets-container .so-widget").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),this.row.resize(),this.row.builder.trigger("widget_added",l)},handleCellClick:function(e){this.row.builder.$el.find(".so-cells .cell").removeClass("cell-selected"),this.row.builder.activeCell!==this||this.model.get("widgets").length?(this.$el.addClass("cell-selected"),this.row.builder.activeCell=this):this.row.builder.activeCell=null},pasteHandler:function(){var e=s.helpers.clipboard.getModel("widget-model");!_.isEmpty(e)&&e instanceof s.model.widget&&(this.row.builder.addHistoryEntry("widget_pasted"),e.cell=this.model,this.model.get("widgets").add(e),this.row.builder.model.refreshPanelsData())},buildContextualMenu:function(e,t){var i=this;t.hasSection("add-widget-below")||t.addSection("add-widget-cell",{sectionTitle:panelsOptions.loc.contextual.add_widget_cell,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,(function(e){i.row.builder.trigger("before_user_adds_widget"),i.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=i.model,t.cell.get("widgets").add(t),i.row.builder.model.refreshPanelsData(),i.row.builder.trigger("after_user_adds_widget",t)}));var l={};this.row.builder.supports("addWidget")&&s.helpers.clipboard.isModel("widget-model")&&(l.paste={title:panelsOptions.loc.contextual.cell_paste_widget}),_.isEmpty(l)||t.addSection("cell-actions",{sectionTitle:panelsOptions.loc.contextual.cell_actions,search:!1},l,function(e){switch(e){case"paste":this.pasteHandler()}this.row.builder.model.refreshPanelsData()}.bind(this)),this.row.buildContextualMenu(e,t)}})},{}],25:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({dialogTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog").html())),dialogTabTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-tab").html())),tabbed:!1,rendered:!1,builder:!1,className:"so-panels-dialog-wrapper",dialogClass:"",dialogIcon:"",parentDialog:!1,dialogOpen:!1,editableLabel:!1,events:{"click .so-close":"closeDialog","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext"},initialize:function(){this.once("open_dialog",this.render),this.once("open_dialog",this.attach),this.once("open_dialog",this.setDialogClass),this.trigger("initialize_dialog",this),_.isUndefined(this.initializeDialog)||this.initializeDialog(),_.bindAll(this,"initSidebars","hasSidebar","onResize","toggleLeftSideBar","toggleRightSideBar")},getNextDialog:function(){return null},getPrevDialog:function(){return null},setDialogClass:function(){""!==this.dialogClass&&this.$(".so-panels-dialog").addClass(this.dialogClass)},setBuilder:function(e){return this.builder=e,e.trigger("add_dialog",this,this.builder),this},attach:function(){return this.$el.appendTo("body"),this},parseDialogContent:function(e,t){t=_.extend({cid:this.cid},t);var i=l(_.template(s.helpers.utils.processTemplate(e))(t)),o={title:i.find(".title").html(),buttons:i.find(".buttons").html(),content:i.find(".content").html()};return i.has(".left-sidebar")&&(o.left_sidebar=i.find(".left-sidebar").html()),i.has(".right-sidebar")&&(o.right_sidebar=i.find(".right-sidebar").html()),o},renderDialog:function(e){if(e=_.extend({editableLabel:this.editableLabel,dialogIcon:this.dialogIcon},e),this.$el.html(this.dialogTemplate(e)).hide(),this.$el.data("view",this),this.$el.addClass("so-panels-dialog-wrapper"),!1!==this.parentDialog){var t=l('<h3 class="so-parent-link"></h3>').html(this.parentDialog.text+'<div class="so-separator"></div>');t.click(function(e){e.preventDefault(),this.closeDialog(),this.parentDialog.dialog.openDialog()}.bind(this)),this.$(".so-title-bar .so-title").before(t)}return this.$(".so-title-bar .so-title-editable").length&&this.initEditableLabel(),setTimeout(this.initSidebars,1),this},initSidebars:function(){var e=this.$(".so-show-left-sidebar").hide(),t=this.$(".so-show-right-sidebar").hide(),i=this.hasSidebar("left"),s=this.hasSidebar("right");(i||s)&&(l(window).on("resize",this.onResize),i&&(e.show(),e.on("click",this.toggleLeftSideBar)),s&&(t.show(),t.on("click",this.toggleRightSideBar))),this.onResize()},initTabs:function(){var e=this.$(".so-sidebar-tabs li a");if(0===e.length)return this;var t=this;return e.click((function(e){e.preventDefault();var i=l(this);t.$(".so-sidebar-tabs li").removeClass("tab-active"),t.$(".so-content .so-content-tabs > *").hide(),i.parent().addClass("tab-active");var s=i.attr("href");if(!_.isUndefined(s)&&"#"===s.charAt(0)){var o=s.split("#")[1];t.$(".so-content .so-content-tabs .tab-"+o).show()}t.trigger("tab_click",i)})),this.$(".so-sidebar-tabs li a").first().click(),this},initToolbar:function(){this.$(".so-toolbar .so-buttons .so-toolbar-button").click(function(e){e.preventDefault(),this.trigger("button_click",l(e.currentTarget))}.bind(this)),this.$(".so-toolbar .so-buttons .so-dropdown-button").click(function(e){e.preventDefault();var t=l(e.currentTarget).siblings(".so-dropdown-links-wrapper");t.is(".hidden")?t.removeClass("hidden"):t.addClass("hidden")}.bind(this)),l("html").click(function(e){this.$(".so-dropdown-links-wrapper").not(".hidden").each((function(t,i){var s=l(i),o=l(e.target);0!==o.length&&(o.is(".so-needs-confirm")&&!o.is(".so-confirmed")||o.is(".so-dropdown-button"))||s.addClass("hidden")}))}.bind(this))},initEditableLabel:function(){var e=this.$(".so-title-bar .so-title-editable");e.keypress((function(t){var i="keypress"===t.type&&13===t.keyCode;if(i){var s=l(":tabbable"),o=s.index(e);s.eq(o+1).focus(),window.getSelection().removeAllRanges()}return!i})).blur(function(){var t=e.text().replace(/^\s+|\s+$/gm,"");t!==e.data("original-value").replace(/^\s+|\s+$/gm,"")&&(e.text(t),this.trigger("edit_label",t))}.bind(this)),e.focus((function(){e.data("original-value",e.text()),s.helpers.utils.selectElementContents(this)}))},setupDialog:function(){this.openDialog(),this.closeDialog()},refreshDialogNav:function(){this.$(".so-title-bar .so-nav").show().removeClass("so-disabled");var e=this.getNextDialog(),t=this.$(".so-title-bar .so-next"),i=this.getPrevDialog(),s=this.$(".so-title-bar .so-previous");null===e?t.hide():!1===e&&t.addClass("so-disabled"),null===i?s.hide():!1===i&&s.addClass("so-disabled")},openDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("open_dialog"),this.dialogOpen=!0,this.refreshDialogNav(),s.helpers.pageScroll.lock(),this.onResize(),this.$el.show(),e.silent||(this.trigger("open_dialog_complete"),this.builder.trigger("open_dialog",this),l(document).trigger("open_dialog",this))},closeDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("close_dialog"),this.dialogOpen=!1,this.$el.hide(),s.helpers.pageScroll.unlock(),e.silent||(this.trigger("close_dialog_complete"),this.builder.trigger("close_dialog",this))},navToPrevious:function(){this.closeDialog();var e=this.getPrevDialog();null!==e&&!1!==e&&e.openDialog()},navToNext:function(){this.closeDialog();var e=this.getNextDialog();null!==e&&!1!==e&&e.openDialog()},getFormValues:function(e){_.isUndefined(e)&&(e=".so-content");var t,i=this.$(e),s={};return i.find("[name]").each((function(){var e=l(this);try{var i=/([A-Za-z_]+)\[(.*)\]/.exec(e.attr("name"));if(_.isEmpty(i))return!0;_.isUndefined(i[2])?t=e.attr("name"):(t=i[2].split("][")).unshift(i[1]),t=t.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var o=s,n=null,a=!!_.isString(e.attr("type"))&&e.attr("type").toLowerCase();if("checkbox"===a)n=e.is(":checked")?""===e.val()||e.val():null;else if("radio"===a){if(!e.is(":checked"))return;n=e.val()}else if("SELECT"===e.prop("tagName")){var r=e.find("option:selected");1===r.length?n=e.find("option:selected").val():r.length>1&&(n=_.map(e.find("option:selected"),(function(e,t){return l(e).val()})))}else n=e.val();if(!_.isUndefined(e.data("panels-filter")))switch(e.data("panels-filter")){case"json_parse":try{n=JSON.parse(n)}catch(e){n=""}}if(null!==n)for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?o.push(n):o[t[d]]=n:(_.isUndefined(o[t[d]])&&(""===t[d+1]?o[t[d]]=[]:o[t[d]]={}),o=o[t[d]])}catch(t){console.log("Field ["+e.attr("name")+"] could not be processed and was skipped - "+t.message)}})),s},setStatusMessage:function(e,t,i){var s=i?'<span class="dashicons dashicons-warning"></span>'+e:e;this.$(".so-toolbar .so-status").html(s),!_.isUndefined(t)&&t?this.$(".so-toolbar .so-status").addClass("so-panels-loading"):this.$(".so-toolbar .so-status").removeClass("so-panels-loading")},setParent:function(e,t){this.parentDialog={text:e,dialog:t}},onResize:function(){var e=window.matchMedia("(max-width: 980px)");["left","right"].forEach(function(t){var i=this.$(".so-"+t+"-sidebar"),s=this.$(".so-show-"+t+"-sidebar");this.hasSidebar(t)?(s.hide(),e.matches?(s.show(),s.closest(".so-title-bar").addClass("so-has-"+t+"-button"),i.hide(),i.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-"+t+"-sidebar")):(s.hide(),s.closest(".so-title-bar").removeClass("so-has-"+t+"-button"),i.show(),i.closest(".so-panels-dialog").addClass("so-panels-dialog-has-"+t+"-sidebar"))):(i.hide(),s.hide())}.bind(this))},hasSidebar:function(e){return this.$(".so-"+e+"-sidebar").children().length>0},toggleLeftSideBar:function(){this.toggleSidebar("left")},toggleRightSideBar:function(){this.toggleSidebar("right")},toggleSidebar:function(e){var t=this.$(".so-"+e+"-sidebar");t.is(":visible")?t.hide():t.show()}})},{}],26:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-live-editor").html())),previewScrollTop:0,loadTimes:[],previewFrameId:1,previewUrl:null,previewIframe:null,events:{"click .live-editor-close":"close","click .live-editor-save":"closeAndSave","click .live-editor-collapse":"collapse","click .live-editor-mode":"mobileToggle"},initialize:function(e){e=_.extend({builder:!1,previewUrl:!1},e),_.isEmpty(e.previewUrl)&&(e.previewUrl=panelsOptions.ajaxurl+"&action=so_panels_live_editor_preview"),this.builder=e.builder,this.previewUrl=e.previewUrl,this.listenTo(this.builder.model,"refresh_panels_data",this.handleRefreshData),this.listenTo(this.builder.model,"load_panels_data",this.handleLoadData)},render:function(){if(this.setElement(this.template()),this.$el.hide(),l("#submitdiv #save-post").length>0){var e=this.$el.find(".live-editor-save");e.text(e.data("save"))}var t=!1;l(document).mousedown((function(){t=!0})).mouseup((function(){t=!1}));var i=this;return this.$el.on("mouseenter",".so-widget-wrapper",(function(){var e=l(this).data("live-editor-preview-widget");t||void 0===e||!e.length||i.$(".so-preview-overlay").is(":visible")||(i.highlightElement(e),i.scrollToElement(e))})),this.$el.on("mouseleave",".so-widget-wrapper",function(){this.resetHighlights()}.bind(this)),this.listenTo(this.builder,"open_dialog",(function(){this.resetHighlights()})),this},attach:function(){this.$el.appendTo("body")},open:function(){if(""===this.$el.html()&&this.render(),0===this.$el.closest("body").length&&this.attach(),s.helpers.pageScroll.lock(),this.$el.is(":visible"))return this;if(this.$el.show(),this.refreshPreview(this.builder.model.getPanelsData()),this.originalContainer=this.builder.$el.parent(),this.builder.$el.appendTo(this.$(".so-live-editor-builder")),this.builder.$(".so-tool-button.so-live-editor").hide(),this.builder.trigger("builder_resize"),"auto-draft"===l("#original_post_status").val()&&!this.autoSaved){var e=this;wp.autosave&&(""===l('#title[name="post_title"]').val()&&l('#title[name="post_title"]').val(panelsOptions.loc.draft).trigger("keydown"),l(document).one("heartbeat-tick.autosave",(function(){e.autoSaved=!0,e.refreshPreview(e.builder.model.getPanelsData())})),wp.autosave.server.triggerSave())}},close:function(){if(!this.$el.is(":visible"))return this;this.$el.hide(),s.helpers.pageScroll.unlock(),this.builder.$el.appendTo(this.originalContainer),this.builder.$(".so-tool-button.so-live-editor").show(),this.builder.trigger("builder_resize")},closeAndSave:function(){this.close(),l('#submitdiv input[type="submit"][name="save"]').click()},collapse:function(){this.$el.toggleClass("so-collapsed")},highlightElement:function(e){_.isUndefined(this.resetHighlightTimeout)||clearTimeout(this.resetHighlightTimeout),this.previewIframe.contents().find("body").find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return 0===l(this).parents(".so-panel").length})).not(e).addClass("so-panels-faded"),e.removeClass("so-panels-faded").addClass("so-panels-highlighted")},resetHighlights:function(){var e=this.previewIframe.contents().find("body");this.resetHighlightTimeout=setTimeout((function(){e.find(".panel-grid .panel-grid-cell .so-panel").removeClass("so-panels-faded so-panels-highlighted")}),100)},scrollToElement:function(e){this.$(".so-preview iframe")[0].contentWindow.liveEditorScrollTo(e)},handleRefreshData:function(e){if(!this.$el.is(":visible"))return this;this.refreshPreview(e)},handleLoadData:function(){if(!this.$el.is(":visible"))return this;this.refreshPreview(this.builder.model.getPanelsData())},refreshPreview:function(e){var t=this.loadTimes.length?_.reduce(this.loadTimes,(function(e,t){return e+t}),0)/this.loadTimes.length:1e3;_.isNull(this.previewIframe)||this.$(".so-preview-overlay").is(":visible")||(this.previewScrollTop=this.previewIframe.contents().scrollTop()),this.$(".so-preview-overlay").show(),this.$(".so-preview-overlay .so-loading-bar").clearQueue().css("width","0%").animate({width:"100%"},parseInt(t)+100),this.postToIframe({live_editor_panels_data:JSON.stringify(e),live_editor_post_ID:this.builder.config.postId},this.previewUrl,this.$(".so-preview")),this.previewIframe.data("load-start",(new Date).getTime())},postToIframe:function(e,t,i){_.isNull(this.previewIframe)||this.previewIframe.remove();var s="siteorigin-panels-live-preview-"+this.previewFrameId;this.previewIframe=l('<iframe src="'+t+'" />').attr({id:s,name:s}).appendTo(i),this.setupPreviewFrame(this.previewIframe);var o=l('<form id="soPostToPreviewFrame" method="post" />').attr({id:s,target:this.previewIframe.attr("id"),action:t}).appendTo("body");return l.each(e,(function(e,t){l('<input type="hidden" />').attr({name:e,value:t}).appendTo(o)})),o.submit().remove(),this.previewFrameId++,this.previewIframe},setupPreviewFrame:function(e){var t=this;e.data("iframeready",!1).on("iframeready",(function(){var e=l(this),i=e.contents();if(!e.data("iframeready")){e.data("iframeready",!0),void 0!==e.data("load-start")&&(t.loadTimes.unshift((new Date).getTime()-e.data("load-start")),_.isEmpty(t.loadTimes)||(t.loadTimes=t.loadTimes.slice(0,4))),l(".live-editor-mode.so-active").length&&(l(".so-panels-live-editor .so-preview iframe").css("transition","none"),t.mobileToggle()),setTimeout((function(){i.scrollTop(t.previewScrollTop),t.$(".so-preview-overlay").hide(),l(".so-panels-live-editor .so-preview iframe").css("transition","all .2s ease")}),100);var s=i.find("#pl-"+t.builder.config.postId);s.find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return l(this).closest(".panel-layout").is(s)})).each((function(e,i){var s=l(i),o=t.$(".so-live-editor-builder .so-widget-wrapper").eq(s.data("index"));o.data("live-editor-preview-widget",s),s.css({cursor:"pointer"}).mouseenter((function(){o.parent().addClass("so-hovered"),t.highlightElement(s)})).mouseleave((function(){o.parent().removeClass("so-hovered"),t.resetHighlights()})).click((function(e){e.preventDefault(),o.find(".title h4").click()}))})),i.find("a").css({"pointer-events":"none"}).click((function(e){e.preventDefault()}))}})).on("load",(function(){var e=l(this);e.data("iframeready")||e.trigger("iframeready")}))},hasPreviewUrl:function(){return""!==this.$("form.live-editor-form").attr("action")},mobileToggle:function(e){var t=l(void 0!==e?e.currentTarget:".live-editor-mode.so-active");this.$(".live-editor-mode").not(t).removeClass("so-active"),t.addClass("so-active"),this.$el.removeClass("live-editor-desktop-mode live-editor-tablet-mode live-editor-mobile-mode").addClass("live-editor-"+t.data("mode")+"-mode").find("iframe").css("width",t.data("width"))}})},{}],27:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-row").html())),events:{"click .so-row-settings":"editSettingsHandler","click .so-row-duplicate":"duplicateHandler","click .so-row-delete":"confirmedDeleteHandler","click .so-row-color":"rowColorChangeHandler"},builder:null,dialog:null,initialize:function(){var e=this.model.get("cells");this.listenTo(e,"add",this.handleCellAdd),this.listenTo(e,"remove",this.handleCellRemove),this.listenTo(this.model,"reweight_cells",this.resize),this.listenTo(this.model,"destroy",this.onModelDestroy);var t=this;e.each((function(e){t.listenTo(e.get("widgets"),"add",t.resize)})),e.on("add",(function(e){t.listenTo(e.get("widgets"),"add",t.resize)}),this),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(){var e=this.model.has("color_label")?this.model.get("color_label"):1,t=this.model.has("label")?this.model.get("label"):"";this.setElement(this.template({rowColorLabel:e,rowLabel:t})),this.$el.data("view",this);var i=this;return this.model.get("cells").each((function(e){var t=new s.view.cell({model:e});t.row=i,t.render(),t.$el.appendTo(i.$(".so-cells"))})),this.builder.supports("rowAction")?(this.builder.supports("editRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-settings").parent().remove(),this.$el.addClass("so-row-no-edit")),this.builder.supports("addRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-duplicate").parent().remove(),this.$el.addClass("so-row-no-duplicate")),this.builder.supports("deleteRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-delete").parent().remove(),this.$el.addClass("so-row-no-delete"))):(this.$(".so-row-toolbar .so-dropdown-wrapper").remove(),this.$el.addClass("so-row-no-actions")),this.builder.supports("moveRow")||(this.$(".so-row-toolbar .so-row-move").remove(),this.$el.addClass("so-row-no-move")),l.trim(this.$(".so-row-toolbar").html()).length||this.$(".so-row-toolbar").remove(),this.listenTo(this.builder,"widget_sortable_move",this.resize),this.listenTo(this.builder,"builder_resize",this.resize),this.resize(),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},resize:function(e){if(this.$el.is(":visible")){this.$(".so-cells .cell-wrapper").css("min-height",0),this.$(".so-cells .resize-handle").css("height",0);var t=0;this.$(".so-cells .cell").each((function(){t=Math.max(t,l(this).height()),l(this).css("width",100*l(this).data("view").model.get("weight")+"%")})),this.$(".so-cells .cell-wrapper").css("min-height",Math.max(t,63)),this.$(".so-cells .resize-handle").css("height",this.$(".so-cells .cell-wrapper").outerHeight())}},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){this.builder.addHistoryEntry("row_deleted");var e=this;this.$el.fadeOut("normal",(function(){e.model.destroy(),e.builder.model.refreshPanelsData()}))},onLabelChange:function(e,t){0==this.$(".so-row-label").length?this.$(".so-row-toolbar").prepend('<h3 class="so-row-label">'+t+"</h3>"):this.$(".so-row-label").text(t)},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},pasteHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.builder.addHistoryEntry("row_pasted"),e.builder=this.builder.model,this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData())},confirmedDeleteHandler:function(e){var t=l(e.target);if(t.hasClass("dashicons")&&(t=t.parent()),t.hasClass("so-confirmed"))this.visualDestroyModel();else{var i=t.html();t.addClass("so-confirmed").html('<span class="dashicons dashicons-yes"></span>'+panelsOptions.loc.dropdown_confirm),setTimeout((function(){t.removeClass("so-confirmed").html(i)}),2500)}},editSettingsHandler:function(){if(this.builder.supports("editRow"))return null===this.dialog&&(this.dialog=new s.dialog.row,this.dialog.setBuilder(this.builder).setRowModel(this.model),this.dialog.rowView=this),this.dialog.openDialog(),this},deleteHandler:function(){return this.model.destroy(),this},rowColorChangeHandler:function(e){this.$(".so-row-color").removeClass("so-row-color-selected");var t=l(e.target),i=t.data("color-label"),s=this.model.has("color_label")?this.model.get("color_label"):1;t.addClass("so-row-color-selected"),this.$el.removeClass("so-row-color-"+s),this.$el.addClass("so-row-color-"+i),this.model.set("color_label",i)},handleCellAdd:function(e){var t=new s.view.cell({model:e});t.row=this,t.render(),t.$el.appendTo(this.$(".so-cells"))},handleCellRemove:function(e){this.$(".so-cells > .cell").each((function(){var t=l(this).data("view");_.isUndefined(t)||t.model.cid===e.cid&&t.remove()}))},buildContextualMenu:function(e,t){for(var i=[],l=1;l<5;l++)i.push({title:l+" "+panelsOptions.loc.contextual.column});this.builder.supports("addRow")&&t.addSection("add-row",{sectionTitle:panelsOptions.loc.contextual.add_row,search:!1},i,function(e){this.builder.addHistoryEntry("row_added");for(var t=Number(e)+1,i=[],l=0;l<t;l++)i.push({weight:100/t});var o=new s.model.row({collection:this.collection}),n=new s.collection.cells(i);n.each((function(e){e.row=o})),o.setCells(n),o.builder=this.builder.model,this.builder.model.get("rows").add(o,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()}.bind(this));var o={};this.builder.supports("editRow")&&(o.edit={title:panelsOptions.loc.contextual.row_edit}),s.helpers.clipboard.canCopyPaste()&&(o.copy={title:panelsOptions.loc.contextual.row_copy},this.builder.supports("addRow")&&s.helpers.clipboard.isModel("row-model")&&(o.paste={title:panelsOptions.loc.contextual.row_paste})),this.builder.supports("addRow")&&(o.duplicate={title:panelsOptions.loc.contextual.row_duplicate}),this.builder.supports("deleteRow")&&(o.delete={title:panelsOptions.loc.contextual.row_delete,confirm:!0}),_.isEmpty(o)||t.addSection("row-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},o,function(e){switch(e){case"edit":this.editSettingsHandler();break;case"copy":this.copyHandler();break;case"paste":this.pasteHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this))}})},{}],28:[function(e,t,i){window.panels;var s=jQuery;t.exports=Backbone.View.extend({stylesLoaded:!1,initialize:function(){},render:function(e,t,i){if(!_.isUndefined(e)){i=_.extend({builderType:"",dialog:null},i),this.$el.addClass("so-visual-styles so-"+e+"-styles so-panels-loading");var l={builderType:i.builderType};return"cell"===e&&(l.index=i.index),s.post(panelsOptions.ajaxurl,{action:"so_panels_style_form",type:e,style:this.model.get("style"),args:JSON.stringify(l),postId:t},null,"html").done(function(e){this.$el.html(e),this.setupFields(),this.stylesLoaded=!0,this.trigger("styles_loaded",!_.isEmpty(e)),_.isNull(i.dialog)||i.dialog.trigger("styles_loaded",!_.isEmpty(e))}.bind(this)).fail(function(e){var t;t=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,this.$el.html(t)}.bind(this)).always(function(){this.$el.removeClass("so-panels-loading")}.bind(this)),this}},attach:function(e){e.append(this.$el)},detach:function(){this.$el.detach()},setupFields:function(){this.$(".style-section-wrapper").each((function(){var e=s(this);e.find(".style-section-head").click((function(t){t.preventDefault(),e.find(".style-section-fields").slideToggle("fast")}))})),_.isUndefined(s.fn.wpColorPicker)||(_.isObject(panelsOptions.wpColorPickerOptions.palettes)&&!s.isArray(panelsOptions.wpColorPickerOptions.palettes)&&(panelsOptions.wpColorPickerOptions.palettes=s.map(panelsOptions.wpColorPickerOptions.palettes,(function(e){return e}))),this.$(".so-wp-color-field").wpColorPicker(panelsOptions.wpColorPickerOptions)),this.$(".style-field-image").each((function(){var e=null,t=s(this);t.find(".so-image-selector").click((function(i){i.preventDefault(),null===e&&(e=wp.media({title:"choose",library:{type:"image"},button:{text:"Done",close:!0}})).on("select",(function(){var i=e.state().get("selection").first().attributes,s=i.url;if(!_.isUndefined(i.sizes))try{s=i.sizes.thumbnail.url}catch(e){s=i.sizes.full.url}t.find(".current-image").css("background-image","url("+s+")"),t.find(".so-image-selector > input").val(i.id),t.find(".remove-image").removeClass("hidden")})),e.open()})),t.find(".remove-image").click((function(e){e.preventDefault(),t.find(".current-image").css("background-image","none"),t.find(".so-image-selector > input").val(""),t.find(".remove-image").addClass("hidden")}))})),this.$(".style-field-measurement").each((function(){var e=s(this),t=e.find('input[type="text"]'),i=e.find("select"),l=e.find('input[type="hidden"]');t.focus((function(){s(this).select()}));!function(e){if(""!==e){var o=/(?:([0-9\.,\-]+)(.*))+/,n=l.val().split(" "),a=[];for(var r in n){var d=o.exec(n[r]);_.isNull(d)||_.isUndefined(d[1])||_.isUndefined(d[2])||(a.push(d[1]),i.val(d[2]))}1===t.length?t.val(a.join(" ")):(1===a.length?a=[a[0],a[0],a[0],a[0]]:2===a.length?a=[a[0],a[1],a[0],a[1]]:3===a.length&&(a=[a[0],a[1],a[2],a[1]]),t.each((function(e,t){s(t).val(a[e])})))}}(l.val());var o=function(e){if(1===t.length){var o=t.val().split(" ").filter((function(e){return""!==e})).map((function(e){return e+i.val()})).join(" ");l.val(o)}else{var n=s(e.target),a=[],r=[],d=[];t.each((function(e,t){var i=""!==s(t).val()?parseFloat(s(t).val()):null;a.push(i),null===i?r.push(e):d.push(e)})),3===r.length&&d[0]===t.index(n)&&(t.val(n.val()),a=[n.val(),n.val(),n.val(),n.val()]),JSON.stringify(a)===JSON.stringify([null,null,null,null])?l.val(""):l.val(a.map((function(e){return(null===e?0:e)+i.val()})).join(" "))}};t.change(o),i.change(o)}))}})},{}],29:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-widget").html())),cell:null,dialog:null,events:{"click .widget-edit":"editHandler","click .title h4":"editHandler","click .actions .widget-duplicate":"duplicateHandler","click .actions .widget-delete":"deleteHandler"},initialize:function(){this.listenTo(this.model,"destroy",this.onModelDestroy),this.listenTo(this.model,"change:values",this.onModelChange),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(e){if(e=_.extend({loadForm:!1},e),this.setElement(this.template({title:this.model.getWidgetField("title"),description:this.model.getTitle(),widget_class:this.model.attributes.class})),this.$el.data("view",this),this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")||(this.$(".actions .widget-edit").remove(),this.$el.addClass("so-widget-no-edit")),this.cell.row.builder.supports("addWidget")||(this.$(".actions .widget-duplicate").remove(),this.$el.addClass("so-widget-no-duplicate")),this.cell.row.builder.supports("deleteWidget")||(this.$(".actions .widget-delete").remove(),this.$el.addClass("so-widget-no-delete")),this.cell.row.builder.supports("moveWidget")||this.$el.addClass("so-widget-no-move"),l.trim(this.$(".actions").html()).length||this.$(".actions").remove(),this.model.get("read_only")&&this.$el.addClass("so-widget-read-only"),0===_.size(this.model.get("values"))||e.loadForm){var t=this.getEditDialog();t.once("form_loaded",t.saveWidget,t),t.setupDialog()}return this.listenTo(this.cell.row.builder,"after_user_adds_widget",this.afterUserAddsWidgetHandler),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},getEditDialog:function(){return null===this.dialog&&(this.dialog=new s.dialog.widget({model:this.model}),this.dialog.setBuilder(this.cell.row.builder),this.dialog.widgetView=this),this.dialog},editHandler:function(){return!this.cell.row.builder.supports("editWidget")||this.model.get("read_only")?this:(this.getEditDialog().openDialog(),this)},duplicateHandler:function(){this.cell.row.builder.addHistoryEntry("widget_duplicated");var e=this.model.clone(this.model.cell);return this.cell.model.get("widgets").add(e,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},deleteHandler:function(){return this.visualDestroyModel(),this},onModelChange:function(){this.$(".description").html(this.model.getTitle())},onLabelChange:function(e){this.$(".title > h4").text(e.getWidgetField("title"))},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){return this.cell.row.builder.addHistoryEntry("widget_deleted"),this.$el.fadeOut("fast",function(){this.cell.row.resize(),this.model.destroy(),this.cell.row.builder.model.refreshPanelsData(),this.remove()}.bind(this)),this},buildContextualMenu:function(e,t){this.cell.row.builder.supports("addWidget")&&t.addSection("add-widget-below",{sectionTitle:panelsOptions.loc.contextual.add_widget_below,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,function(e){this.cell.row.builder.trigger("before_user_adds_widget"),this.cell.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=this.cell.model,this.cell.model.get("widgets").add(t,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this.cell.row.builder.trigger("after_user_adds_widget",t)}.bind(this));var i={};this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")&&(i.edit={title:panelsOptions.loc.contextual.widget_edit}),s.helpers.clipboard.canCopyPaste()&&(i.copy={title:panelsOptions.loc.contextual.widget_copy}),this.cell.row.builder.supports("addWidget")&&(i.duplicate={title:panelsOptions.loc.contextual.widget_duplicate}),this.cell.row.builder.supports("deleteWidget")&&(i.delete={title:panelsOptions.loc.contextual.widget_delete,confirm:!0}),_.isEmpty(i)||t.addSection("widget-actions",{sectionTitle:panelsOptions.loc.contextual.widget_actions,search:!1},i,function(e){switch(e){case"edit":this.editHandler();break;case"copy":this.copyHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this)),this.cell.buildContextualMenu(e,t)},afterUserAddsWidgetHandler:function(e){this.model===e&&panelsOptions.instant_open&&setTimeout(this.editHandler.bind(this),350)}})},{}],30:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.customHtmlWidgets,o=s("<div></div>"),n=t.find(".widget-content:first");n.before(o);var a=new l.CustomHtmlWidgetControl({el:o,syncContainer:n});return a.initializeEditor(),a.editor.codemirror.refresh(),a}};t.exports=l},{}],31:[function(e,t,i){var s=e("./custom-html-widget"),l=e("./media-widget"),o=e("./text-widget"),n={CUSTOM_HTML:"custom_html",MEDIA_AUDIO:"media_audio",MEDIA_GALLERY:"media_gallery",MEDIA_IMAGE:"media_image",MEDIA_VIDEO:"media_video",TEXT:"text",addWidget:function(e,t){var i,n=e.find("> .id_base").val();switch(n){case this.CUSTOM_HTML:i=s;break;case this.MEDIA_AUDIO:case this.MEDIA_GALLERY:case this.MEDIA_IMAGE:case this.MEDIA_VIDEO:i=l;break;case this.TEXT:i=o}i.addWidget(n,e,t)}};t.exports=n},{"./custom-html-widget":30,"./media-widget":32,"./text-widget":33}],32:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.mediaWidgets,o=l.controlConstructors[e];if(o){var n=l.modelConstructors[e]||l.MediaWidgetModel,a=t.find("> .widget-content"),r=s('<div class="media-widget-control"></div>');a.before(r);var d={};a.find(".media-widget-instance-property").each((function(){var e=s(this);d[e.data("property")]=e.val()})),d.widget_id=i;var h=new o({el:r,syncContainer:a,model:new n(d)});return h.render(),h}}};t.exports=l},{}],33:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.textWidgets,o={},n=t.find(".visual");if(n.length>0){if(!n.val())return null;var a=s("<div></div>"),r=t.find(".widget-content:first");r.before(a),o={el:a,syncContainer:r}}else o={el:t};var d=new l.TextWidgetControl(o),h=wp.oldEditor?wp.oldEditor:wp.editor;return h&&h.hasOwnProperty("autop")&&(wp.editor.autop=h.autop,wp.editor.removep=h.removep,wp.editor.initialize=h.initialize),d.initializeEditor(),d}};t.exports=l},{}]},{},[16]);
1
+ !function e(t,i,s){function l(n,a){if(!i[n]){if(!t[n]){var r="function"==typeof require&&require;if(!a&&r)return r(n,!0);if(o)return o(n,!0);var d=new Error("Cannot find module '"+n+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[n]={exports:{}};t[n][0].call(h.exports,(function(e){return l(t[n][1][e]||e)}),h,h.exports,e,t,i,s)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n<s.length;n++)l(s[n]);return l}({1:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.cell,initialize:function(){},totalWeight:function(){var e=0;return this.each((function(t){e+=t.get("weight")})),e}})},{}],2:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.historyEntry,builder:null,maxSize:12,initialize:function(){this.on("add",this.onAddEntry,this)},addEntry:function(e,t){_.isEmpty(t)&&(t=this.builder.getPanelsData());var i=new s.model.historyEntry({text:e,data:JSON.stringify(t),time:parseInt((new Date).getTime()/1e3),collection:this});this.add(i)},onAddEntry:function(e){if(this.models.length>1){var t=this.at(this.models.length-2);(e.get("text")===t.get("text")&&e.get("time")-t.get("time")<15||e.get("data")===t.get("data"))&&(this.remove(e),t.set("count",t.get("count")+1))}for(;this.models.length>this.maxSize;)this.shift()}})},{}],3:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.row,empty:function(){for(var e;;){if(!(e=this.collection.first()))break;e.destroy()}}})},{}],4:[function(e,t,i){var s=window.panels;t.exports=Backbone.Collection.extend({model:s.model.widget,initialize:function(){}})},{}],5:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({dialogClass:"so-panels-dialog-add-builder",render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-builder").html(),{})),this.$(".so-content .siteorigin-panels-builder").append(this.builder.$el)},initializeDialog:function(){var e=this;this.once("open_dialog_complete",(function(){e.builder.initSortable()})),this.on("open_dialog_complete",(function(){e.builder.trigger("builder_resize")}))}})},{}],6:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({historyEntryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-history-entry").html())),entries:{},currentEntry:null,revertEntry:null,selectedEntry:null,previewScrollTop:null,dialogClass:"so-panels-dialog-history",dialogIcon:"history",events:{"click .so-close":"closeDialog","click .so-restore":"restoreSelectedEntry"},initializeDialog:function(){this.entries=new s.collection.historyEntries,this.on("open_dialog",this.setCurrentEntry,this),this.on("open_dialog",this.renderHistoryEntries,this)},render:function(){var e=this;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-history").html(),{})),this.$("iframe.siteorigin-panels-history-iframe").load((function(){var t=l(this);t.show(),t.contents().scrollTop(e.previewScrollTop)}))},setRevertEntry:function(e){this.revertEntry=new s.model.historyEntry({data:JSON.stringify(e.getPanelsData()),time:parseInt((new Date).getTime()/1e3)})},setCurrentEntry:function(){this.currentEntry=new s.model.historyEntry({data:JSON.stringify(this.builder.model.getPanelsData()),time:parseInt((new Date).getTime()/1e3)}),this.selectedEntry=this.currentEntry,this.previewEntry(this.currentEntry),this.$(".so-buttons .so-restore").addClass("disabled")},renderHistoryEntries:function(){var e=this,t=this.$(".history-entries").empty();this.currentEntry.get("data")===this.revertEntry.get("data")&&_.isEmpty(this.entries.models)||l(this.historyEntryTemplate({title:panelsOptions.loc.history.revert,count:1})).data("historyEntry",this.revertEntry).prependTo(t),this.entries.each((function(i){var s=e.historyEntryTemplate({title:panelsOptions.loc.history[i.get("text")],count:i.get("count")});l(s).data("historyEntry",i).prependTo(t)})),l(this.historyEntryTemplate({title:panelsOptions.loc.history.current,count:1})).data("historyEntry",this.currentEntry).addClass("so-selected").prependTo(t),t.find(".history-entry").click((function(){var i=jQuery(this);t.find(".history-entry").not(i).removeClass("so-selected"),i.addClass("so-selected");var s=i.data("historyEntry");e.selectedEntry=s,e.selectedEntry.cid!==e.currentEntry.cid?e.$(".so-buttons .so-restore").removeClass("disabled"):e.$(".so-buttons .so-restore").addClass("disabled"),e.previewEntry(s)})),this.updateEntryTimes()},previewEntry:function(e){var t=this.$("iframe.siteorigin-panels-history-iframe");t.hide(),this.previewScrollTop=t.contents().scrollTop(),this.$('form.history-form input[name="live_editor_panels_data"]').val(e.get("data")),this.$('form.history-form input[name="live_editor_post_ID"]').val(this.builder.config.postId),this.$("form.history-form").submit()},restoreSelectedEntry:function(){return!this.$(".so-buttons .so-restore").hasClass("disabled")&&(this.currentEntry.get("data")===this.selectedEntry.get("data")?(this.closeDialog(),!1):("restore"!==this.selectedEntry.get("text")&&this.builder.addHistoryEntry("restore",this.builder.model.getPanelsData()),this.builder.model.loadPanelsData(JSON.parse(this.selectedEntry.get("data"))),this.closeDialog(),!1))},updateEntryTimes:function(){var e=this;this.$(".history-entries .history-entry").each((function(){var t=jQuery(this),i=t.find(".timesince"),s=t.data("historyEntry");i.html(e.timeSince(s.get("time")))}))},timeSince:function(e){var t,i=parseInt((new Date).getTime()/1e3)-e,s=[];return i>3600&&(1===(t=Math.floor(i/3600))?s.push(panelsOptions.loc.time.hour.replace("%d",t)):s.push(panelsOptions.loc.time.hours.replace("%d",t)),i-=3600*t),i>60&&(1===(t=Math.floor(i/60))?s.push(panelsOptions.loc.time.minute.replace("%d",t)):s.push(panelsOptions.loc.time.minutes.replace("%d",t)),i-=60*t),i>0&&(1===i?s.push(panelsOptions.loc.time.second.replace("%d",i)):s.push(panelsOptions.loc.time.seconds.replace("%d",i))),_.isEmpty(s)?panelsOptions.loc.time.now:panelsOptions.loc.time.ago.replace("%s",s.slice(0,2).join(", "))}})},{}],7:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({directoryTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-directory-items").html())),builder:null,dialogClass:"so-panels-dialog-prebuilt-layouts",dialogIcon:"layouts",layoutCache:{},currentTab:!1,directoryPage:1,events:{"click .so-close":"closeDialog","click .so-sidebar-tabs li a":"tabClickHandler","click .so-content .layout":"layoutClickHandler","keyup .so-sidebar-search":"searchHandler","click .so-screenshot, .so-title":"directoryItemClickHandler"},initializeDialog:function(){var e=this;this.on("open_dialog",(function(){e.$(".so-sidebar-tabs li a").first().click(),e.$(".so-status").removeClass("so-panels-loading")})),this.on("button_click",this.toolbarButtonClick,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-prebuilt").html(),{})),this.initToolbar()},tabClickHandler:function(e){e.preventDefault(),this.selectedLayoutItem=null,this.uploadedLayout=null,this.updateButtonState(!1),this.$(".so-sidebar-tabs li").removeClass("tab-active");var t=l(e.target),i=t.attr("href").split("#")[1];t.parent().addClass("tab-active");this.$(".so-content").empty(),this.currentTab=i,"import"==i?this.displayImportExport():this.displayLayoutDirectory("",1,i),this.$(".so-sidebar-search").val("")},displayImportExport:function(){var e=this.$(".so-content").empty().removeClass("so-panels-loading");e.html(l("#siteorigin-panels-dialog-prebuilt-importexport").html());var t=this,i=t.$(".import-upload-ui"),s=new plupload.Uploader({runtimes:"html5,silverlight,flash,html4",browse_button:i.find(".file-browse-button").get(0),container:i.get(0),drop_element:i.find(".drag-upload-area").get(0),file_data_name:"panels_import_data",multiple_queues:!1,max_file_size:panelsOptions.plupload.max_file_size,url:panelsOptions.plupload.url,flash_swf_url:panelsOptions.plupload.flash_swf_url,silverlight_xap_url:panelsOptions.plupload.silverlight_xap_url,filters:[{title:panelsOptions.plupload.filter_title,extensions:"json"}],multipart_params:{action:"so_panels_import_layout"},init:{PostInit:function(e){e.features.dragdrop&&i.addClass("has-drag-drop"),i.find(".progress-precent").css("width","0%")},FilesAdded:function(e){i.find(".file-browse-button").blur(),i.find(".drag-upload-area").removeClass("file-dragover"),i.find(".progress-bar").fadeIn("fast"),t.$(".js-so-selected-file").text(panelsOptions.loc.prebuilt_loading),e.start()},UploadProgress:function(e,t){i.find(".progress-precent").css("width",t.percent+"%")},FileUploaded:function(e,s,l){var o=JSON.parse(l.response);_.isUndefined(o.widgets)?alert(panelsOptions.plupload.error_message):(t.uploadedLayout=o,i.find(".progress-bar").hide(),t.$(".js-so-selected-file").text(panelsOptions.loc.ready_to_insert.replace("%s",s.name)),t.updateButtonState(!0))},Error:function(){alert(panelsOptions.plupload.error_message)}}});s.init(),/Edge\/\d./i.test(navigator.userAgent)&&setTimeout((function(){s.refresh()}),250),i.find(".drag-upload-area").on("dragover",(function(){l(this).addClass("file-dragover")})).on("dragleave",(function(){l(this).removeClass("file-dragover")})),e.find(".so-export").submit((function(e){var i=l(this),s=t.builder.model.getPanelsData(),o=l('input[name="post_title"], .editor-post-title__input').val();if(o){if(void 0!==wp.data){var n=t.getCurrentBlockPosition();n>=0&&(o+="-"+n)}}else o=l('input[name="post_ID"]').val();s.name=o,i.find('input[name="panels_export_data"]').val(JSON.stringify(s))}))},getCurrentBlockPosition:function(){var e=wp.data.select("core/block-editor").getSelectedBlockClientId();return wp.data.select("core/block-editor").getBlocks().findIndex((function(t){return t.clientId===e}))},displayLayoutDirectory:function(e,t,i){var s=this,o=this.$(".so-content").empty().addClass("so-panels-loading");if(void 0===e&&(e=""),void 0===t&&(t=1),void 0===i&&(i="directory-siteorigin"),i.match("^directory-")&&!panelsOptions.directory_enabled)return o.removeClass("so-panels-loading").html(l("#siteorigin-panels-directory-enable").html()),void o.find(".so-panels-enable-directory").click((function(n){n.preventDefault(),l.get(panelsOptions.ajaxurl,{action:"so_panels_directory_enable"},(function(){})),panelsOptions.directory_enabled=!0,o.addClass("so-panels-loading"),s.displayLayoutDirectory(e,t,i)}));l.get(panelsOptions.ajaxurl,{action:"so_panels_layouts_query",search:e,page:t,type:i,builderType:this.builder.config.builderType},(function(n){if(s.currentTab===i){o.removeClass("so-panels-loading").html(s.directoryTemplate(n));var a=o.find(".so-previous"),r=o.find(".so-next");t<=1?a.addClass("button-disabled"):a.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t-1,s.currentTab)})),t===n.max_num_pages||0===n.max_num_pages?r.addClass("button-disabled"):r.click((function(i){i.preventDefault(),s.displayLayoutDirectory(e,t+1,s.currentTab)})),o.find(".so-screenshot").each((function(){var e=l(this),t=e.find(".so-screenshot-wrapper");if(t.css("height",t.width()/4*3+"px").addClass("so-loading"),""!==e.data("src"))var i=l("<img/>").attr("src",e.data("src")).load((function(){t.removeClass("so-loading").css("height","auto"),i.appendTo(t).hide().fadeIn("fast")}));else l("<img/>").attr("src",panelsOptions.prebuiltDefaultScreenshot).appendTo(t).hide().fadeIn("fast")})),o.find(".so-directory-browse").html(n.title)}}),"json")},directoryItemClickHandler:function(e){var t=this.$(e.target).closest(".so-directory-item");this.$(".so-directory-items").find(".selected").removeClass("selected"),t.addClass("selected"),this.selectedLayoutItem={lid:t.data("layout-id"),type:t.data("layout-type")},this.updateButtonState(!0)},toolbarButtonClick:function(e){if(!this.canAddLayout())return!1;var t=e.data("value");if(_.isUndefined(t))return!1;if(this.updateButtonState(!1),e.hasClass("so-needs-confirm")&&!e.hasClass("so-confirmed")){if(this.updateButtonState(!0),e.hasClass("so-confirming"))return;e.addClass("so-confirming");var i=e.html();return e.html('<span class="dashicons dashicons-yes"></span>'+e.data("confirm")),setTimeout((function(){e.removeClass("so-confirmed").html(i)}),2500),setTimeout((function(){e.removeClass("so-confirming"),e.addClass("so-confirmed")}),200),!1}this.addingLayout=!0,"import"===this.currentTab?this.addLayoutToBuilder(this.uploadedLayout,t):this.loadSelectedLayout().then(function(e){this.addLayoutToBuilder(e,t)}.bind(this))},canAddLayout:function(){return(this.selectedLayoutItem||this.uploadedLayout)&&!this.addingLayout},loadSelectedLayout:function(){this.setStatusMessage(panelsOptions.loc.prebuilt_loading,!0);var e=_.extend(this.selectedLayoutItem,{action:"so_panels_get_layout",builderType:this.builder.config.builderType}),t=new l.Deferred;return l.get(panelsOptions.ajaxurl,e,function(e){var i="";e.success?t.resolve(e.data):(i=e.data.message,t.reject(e.data)),this.setStatusMessage(i,!1,!e.success),this.updateButtonState(!0)}.bind(this)),t.promise()},searchHandler:function(e){13===e.keyCode&&this.displayLayoutDirectory(l(e.currentTarget).val(),1,this.currentTab)},updateButtonState:function(e){e=e&&(this.selectedLayoutItem||this.uploadedLayout);var t=this.$(".so-import-layout");t.prop("disabled",!e),e?t.removeClass("disabled"):t.addClass("disabled")},addLayoutToBuilder:function(e,t){this.builder.addHistoryEntry("prebuilt_loaded"),this.builder.model.loadPanelsData(e,t),this.addingLayout=!1,this.closeDialog()}})},{}],8:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({cellPreviewTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-row-cell-preview").html())),editableLabel:!0,events:{"click .so-close":"closeDialog","click .so-toolbar .so-save":"saveHandler","click .so-toolbar .so-insert":"insertHandler","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler","change .row-set-form > *":"setCellsFromForm","click .row-set-form button.set-row":"setCellsFromForm"},rowView:null,dialogIcon:"add-row",dialogClass:"so-panels-dialog-row-edit",styleType:"row",dialogType:"edit",row:{cells:null,style:{}},cellStylesCache:[],initializeDialog:function(){this.on("open_dialog",(function(){_.isUndefined(this.model)||_.isEmpty(this.model.get("cells"))?this.setRowModel(null):this.setRowModel(this.model),this.regenerateRowPreview(),this.renderStyles(),this.openSelectedCellStyles()}),this),this.row={cells:new s.collection.cells([{weight:.5},{weight:.5}]),style:{}},this.dialogFormsLoaded=0;var e=this;this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("close_dialog",this.closeHandler),this.on("edit_label",function(e){if(e!==panelsOptions.loc.row.add&&e!==panelsOptions.loc.row.edit||(e=""),this.model.set("label",e),_.isEmpty(e)){var t="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.$(".so-title").text(t)}}.bind(this))},setRowDialogType:function(e){this.dialogType=e},render:function(){var e="create"===this.dialogType?panelsOptions.loc.row.add:panelsOptions.loc.row.edit;this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-row").html(),{title:e,dialogType:this.dialogType}));var t=this.$(".so-title");return this.model.has("label")&&!_.isEmpty(this.model.get("label"))&&t.text(this.model.get("label")),this.$(".so-edit-title").val(t.text()),this.builder.supports("addRow")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteRow")||this.$(".so-buttons .so-delete").remove(),_.isUndefined(this.model)||(this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction"))),this.$("input.so-row-field").keyup((function(){l(this).trigger("change")})),this},renderStyles:function(){this.styles&&(this.styles.off("styles_loaded"),this.styles.remove()),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("row",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var e=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(e),this.styles.on("styles_loaded",(function(t){t||(this.styles.remove(),0===e.children().length&&(e.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),e.hide()))}),this)},setRowModel:function(e){return this.model=e,_.isEmpty(this.model)?this:(this.row={cells:this.model.get("cells").clone(),style:{},ratio:this.model.get("ratio"),ratio_direction:this.model.get("ratio_direction")},this.$('input[name="cells"].so-row-field').val(this.model.get("cells").length),this.model.has("ratio")&&this.$('select[name="ratio"].so-row-field').val(this.model.get("ratio")),this.model.has("ratio_direction")&&this.$('select[name="ratio_direction"].so-row-field').val(this.model.get("ratio_direction")),this.clearCellStylesCache(),this)},regenerateRowPreview:function(){var e,t=this,i=this.$(".row-preview"),s=this.getSelectedCellIndex();i.empty(),this.row.cells.each((function(o,n){var a=l(this.cellPreviewTemplate({weight:o.get("weight")}));i.append(a),n==s&&a.find(".preview-cell-in").addClass("cell-selected");var r,d=a.prev();d.length&&((r=l('<div class="resize-handle"></div>')).appendTo(a).dblclick((function(){var e=t.row.cells.at(n-1),i=o.get("weight")+e.get("weight");o.set("weight",i/2),e.set("weight",i/2),t.scaleRowWidths()})),r.draggable({axis:"x",containment:i,start:function(e,t){var i=a.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:a.outerWidth(),left:6,height:a.outerHeight()});i.find(".resize-handle").remove();var s=d.clone().appendTo(t.helper).css({position:"absolute",top:"0",width:d.outerWidth(),right:6,height:d.outerHeight()});s.find(".resize-handle").remove(),l(this).data({newCellClone:i,prevCellClone:s}),a.find("> .preview-cell-in").css("visibility","hidden"),d.find("> .preview-cell-in").css("visibility","hidden")},drag:function(e,s){var o=t.row.cells.at(n).get("weight"),a=t.row.cells.at(n-1).get("weight"),r=o-(s.position.left+6)/i.width(),d=a+(s.position.left+6)/i.width();s.helper.offset().left,i.offset().left;l(this).data("newCellClone").css("width",i.width()*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10),l(this).data("prevCellClone").css("width",i.width()*d).find(".preview-cell-weight").html(Math.round(1e3*d)/10)},stop:function(e,s){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove(),a.find(".preview-cell-in").css("visibility","visible"),d.find(".preview-cell-in").css("visibility","visible");var o=(s.position.left+6)/i.width(),r=t.row.cells.at(n),h=t.row.cells.at(n-1);r.get("weight")-o>.02&&h.get("weight")+o>.02&&(r.set("weight",r.get("weight")-o),h.set("weight",h.get("weight")+o)),t.scaleRowWidths(),s.helper.css("left",-6)}})),a.click(function(e){if(l(e.target).is(".preview-cell")||l(e.target).is(".preview-cell-in")){var t=l(e.target);t.closest(".row-preview").find(".preview-cell .preview-cell-in").removeClass("cell-selected"),t.addClass("cell-selected"),this.openSelectedCellStyles()}}.bind(this)),a.find(".preview-cell-weight").click((function(s){t.$(".resize-handle").css("pointer-event","none").draggable("disable"),i.find(".preview-cell-weight").each((function(){var s=jQuery(this).hide();l('<input type="text" class="preview-cell-weight-input no-user-interacted" />').val(parseFloat(s.html())).insertAfter(s).focus((function(){clearTimeout(e)})).keyup((function(e){9!==e.keyCode&&l(this).removeClass("no-user-interacted"),13===e.keyCode&&(e.preventDefault(),l(this).blur())})).keydown((function(e){if(9===e.keyCode){e.preventDefault();var t=i.find(".preview-cell-weight-input"),s=t.index(l(this));s===t.length-1?t.eq(0).focus().select():t.eq(s+1).focus().select()}})).blur((function(){i.find(".preview-cell-weight-input").each((function(e,i){isNaN(parseFloat(l(i).val()))&&l(i).val(Math.floor(1e3*t.row.cells.at(e).get("weight"))/10)})),e=setTimeout((function(){if(0===i.find(".preview-cell-weight-input").length)return!1;var e=[],s=[],o=0,n=0;if(i.find(".preview-cell-weight-input").each((function(i,a){var r=parseFloat(l(a).val());r=isNaN(r)?1/t.row.cells.length:Math.round(10*r)/1e3;var d=!l(a).hasClass("no-user-interacted");e.push(r),s.push(d),d?o+=r:n+=r})),o>0&&n>0&&1-o>0)for(var a=0;a<e.length;a++)s[a]||(e[a]=e[a]/n*(1-o));var r=_.reduce(e,(function(e,t){return e+t}));e=e.map((function(e){return e/r})),Math.min.apply(Math,e)>.01&&t.row.cells.each((function(t,i){t.set("weight",e[i])})),i.find(".preview-cell").each((function(e,i){var s=t.row.cells.at(e).get("weight");l(i).animate({width:Math.round(1e3*s)/10+"%"},250),l(i).find(".preview-cell-weight-input").val(Math.round(1e3*s)/10)})),i.find(".preview-cell").css("overflow","visible"),setTimeout(t.regenerateRowPreview.bind(t),260)}),100)})).click((function(){l(this).select()}))})),l(this).siblings(".preview-cell-weight-input").select()}))}),this),this.trigger("form_loaded",this)},getSelectedCellIndex:function(){var e=-1;return this.$(".preview-cell .preview-cell-in").each((function(t,i){l(i).is(".cell-selected")&&(e=t)})),e},openSelectedCellStyles:function(){if(!_.isUndefined(this.cellStyles)){if(this.cellStyles.stylesLoaded){var e={};try{e=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",e)}this.cellStyles.detach()}if(this.cellStyles=this.getSelectedCellStyles(),this.cellStyles){var t=this.$(".so-sidebar.so-right-sidebar");this.cellStyles.attach(t),this.cellStyles.on("styles_loaded",(function(e){e&&(t.closest(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"),t.show())}))}},getSelectedCellStyles:function(){var e=this.getSelectedCellIndex();if(e>-1){var t=this.cellStylesCache[e];t||((t=new s.view.styles).model=this.row.cells.at(e),t.render("cell",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this,index:e}),this.cellStylesCache[e]=t)}return t},clearCellStylesCache:function(){this.cellStylesCache.forEach((function(e){e.remove(),e.off("styles_loaded")})),this.cellStylesCache=[]},scaleRowWidths:function(){var e=this;this.$(".row-preview .preview-cell").each((function(t,i){var s=e.row.cells.at(t);l(i).css("width",100*s.get("weight")+"%").find(".preview-cell-weight").html(Math.round(1e3*s.get("weight"))/10)}))},setCellsFromForm:function(){try{var e={cells:parseInt(this.$('.row-set-form input[name="cells"]').val()),ratio:parseFloat(this.$('.row-set-form select[name="ratio"]').val()),direction:this.$('.row-set-form select[name="ratio_direction"]').val()};_.isNaN(e.cells)&&(e.cells=1),isNaN(e.ratio)&&(e.ratio=1),e.cells<1?(e.cells=1,this.$('.row-set-form input[name="cells"]').val(e.cells)):e.cells>12&&(e.cells=12,this.$('.row-set-form input[name="cells"]').val(e.cells)),this.$('.row-set-form select[name="ratio"]').val(e.ratio);for(var t=[],i=this.row.cells.length!==e.cells,o=1,n=0;n<e.cells;n++)t.push(o),o*=e.ratio;var a=_.reduce(t,(function(e,t){return e+t}));if(t=_.map(t,(function(e){return e/a})),t=_.filter(t,(function(e){return e>.01})),"left"===e.direction&&(t=t.reverse()),this.row.cells=new s.collection.cells(this.row.cells.first(t.length)),_.each(t,function(e,t){var i=this.row.cells.at(t);i?i.set("weight",e):(i=new s.model.cell({weight:e,row:this.model}),this.row.cells.add(i))}.bind(this)),this.row.ratio=e.ratio,this.row.ratio_direction=e.direction,i)this.regenerateRowPreview();else{var r=this;this.$(".preview-cell").each((function(e,t){var i=r.row.cells.at(e).get("weight");l(t).animate({width:Math.round(1e3*i)/10+"%"},250),l(t).find(".preview-cell-weight").html(Math.round(1e3*i)/10)})),this.$(".preview-cell").css("overflow","visible"),setTimeout(r.regenerateRowPreview.bind(r),260)}}catch(e){console.log("Error setting cells - "+e.message)}this.$(".row-set-form .so-button-row-set").removeClass("button-primary")},tabClickHandler:function(e){"#row-layout"===e.attr("href")?this.$(".so-panels-dialog").addClass("so-panels-dialog-has-right-sidebar"):this.$(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar")},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),_.isEmpty(this.model)||(this.model.setCells(this.row.cells),this.model.set("ratio",this.row.ratio),this.model.set("ratio_direction",this.row.ratio_direction)),!_.isUndefined(this.styles)&&this.styles.stylesLoaded){var t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-row-styles").style}catch(e){console.log("Error retrieving row styles - "+e.message)}this.model.set("style",t)}if(!_.isUndefined(this.cellStyles)&&this.cellStyles.stylesLoaded){t={};try{t=this.getFormValues(".so-sidebar .so-visual-styles.so-cell-styles").style}catch(e){console.log("Error retrieving cell styles - "+e.message)}this.cellStyles.model.set("style",t)}e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},insertHandler:function(){this.builder.addHistoryEntry("row_added"),this.updateModel();var e=this.builder.getActiveCell({createCell:!1}),t={};return null!==e&&(t.at=this.builder.model.get("rows").indexOf(e.row)+1),this.model.collection=this.builder.model.get("rows"),this.builder.model.get("rows").add(this.model,t),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},saveHandler:function(){return this.builder.addHistoryEntry("row_edited"),this.updateModel(),this.closeDialog(),this.builder.model.refreshPanelsData(),!1},deleteHandler:function(){return this.rowView.visualDestroyModel(),this.closeDialog({silent:!0}),!1},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);return this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.closeDialog({silent:!0}),!1},closeHandler:function(){this.clearCellStylesCache(),_.isUndefined(this.cellStyles)||(this.cellStyles=void 0)}})},{}],9:[function(e,t,i){var s=window.panels,l=jQuery,o=e("../view/widgets/js-widget");t.exports=s.view.dialog.extend({builder:null,sidebarWidgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widget-sidebar-widget").html())),dialogClass:"so-panels-dialog-edit-widget",dialogIcon:"add-widget",widgetView:!1,savingWidget:!1,editableLabel:!0,events:{"click .so-close":"saveHandler","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext","click .so-toolbar .so-delete":"deleteHandler","click .so-toolbar .so-duplicate":"duplicateHandler"},initializeDialog:function(){var e=this;this.listenTo(this.model,"change:values",this.handleChangeValues),this.listenTo(this.model,"destroy",this.remove),this.dialogFormsLoaded=0,this.on("form_loaded styles_loaded",(function(){this.dialogFormsLoaded++,2===this.dialogFormsLoaded&&e.updateModel({refreshArgs:{silent:!0}})})),this.on("edit_label",function(e){e===panelsOptions.widgets[this.model.get("class")].title&&(e=""),this.model.set("label",e),_.isEmpty(e)&&this.$(".so-title").text(this.model.getWidgetField("title"))}.bind(this))},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widget").html(),{})),this.loadForm();var e=this.model.getWidgetField("title");this.$(".so-title .widget-name").html(e),this.$(".so-edit-title").val(e),this.builder.supports("addWidget")||this.$(".so-buttons .so-duplicate").remove(),this.builder.supports("deleteWidget")||this.$(".so-buttons .so-delete").remove(),this.styles=new s.view.styles,this.styles.model=this.model,this.styles.render("widget",this.builder.config.postId,{builderType:this.builder.config.builderType,dialog:this});var t=this.$(".so-sidebar.so-right-sidebar");this.styles.attach(t),this.styles.on("styles_loaded",(function(e){e||(t.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-right-sidebar"),t.remove())}),this)},getPrevDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(0===i)return!1;do{if(t=e.eq(--i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t)&&i>0);return!1},getNextDialog:function(){var e=this.builder.$(".so-cells .cell .so-widget");if(e.length<=1)return!1;var t,i=e.index(this.widgetView.$el);if(i===e.length-1)return!1;do{if(t=e.eq(++i).data("view"),!_.isUndefined(t)&&!t.model.get("read_only"))return t.getEditDialog()}while(!_.isUndefined(t));return!1},loadForm:function(){if(this.$("> *").length){this.$(".so-content").addClass("so-panels-loading");var e={action:"so_panels_widget_form",widget:this.model.get("class"),instance:JSON.stringify(this.model.get("values")),raw:this.model.get("raw")},t=this.$(".so-content");l.post(panelsOptions.ajaxurl,e,null,"html").done(function(e){var i=e.replace(/{\$id}/g,this.model.cid);t.removeClass("so-panels-loading").html(i),this.trigger("form_loaded",this),this.$(".panel-dialog").trigger("panelsopen"),this.on("close_dialog",this.updateModel,this),t.find("> .widget-content").length>0&&o.addWidget(t,this.model.widget_id)}.bind(this)).fail((function(e){var i;i=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,t.removeClass("so-panels-loading").html(i)}))}},updateModel:function(e){if(e=_.extend({refresh:!0,refreshArgs:null},e),this.savingWidget=!0,!this.model.get("missing")){var t=this.getFormValues();t=_.isUndefined(t.widgets)?{}:(t=t.widgets)[Object.keys(t)[0]],this.model.setValues(t),this.model.set("raw",!0)}if(this.styles.stylesLoaded){var i={};try{i=this.getFormValues(".so-sidebar .so-visual-styles").style}catch(e){}this.model.set("style",i)}this.savingWidget=!1,e.refresh&&this.builder.model.refreshPanelsData(e.refreshArgs)},handleChangeValues:function(){this.savingWidget||this.loadForm()},saveHandler:function(){this.builder.addHistoryEntry("widget_edited"),this.closeDialog()},deleteHandler:function(){return this.widgetView.visualDestroyModel(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1},duplicateHandler:function(){return this.widgetView.duplicateHandler(),this.closeDialog({silent:!0}),this.builder.model.refreshPanelsData(),!1}})},{"../view/widgets/js-widget":32}],10:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=s.view.dialog.extend({builder:null,widgetTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-widgets-widget").html())),filter:{},dialogClass:"so-panels-dialog-add-widget",dialogIcon:"add-widget",events:{"click .so-close":"closeDialog","click .widget-type":"widgetClickHandler","keyup .so-sidebar-search":"searchHandler"},initializeDialog:function(){this.on("open_dialog",(function(){this.filter.search="",this.filterWidgets(this.filter)}),this),this.on("open_dialog_complete",(function(){this.$(".so-sidebar-search").val("").focus(),this.balanceWidgetHeights()})),this.on("tab_click",this.tabClickHandler,this)},render:function(){this.renderDialog(this.parseDialogContent(l("#siteorigin-panels-dialog-widgets").html(),{})),_.each(panelsOptions.widgets,(function(e){var t=l(this.widgetTemplate({title:e.title,description:e.description}));_.isUndefined(e.icon)&&(e.icon="dashicons dashicons-admin-generic"),l('<span class="widget-icon" />').addClass(e.icon).prependTo(t.find(".widget-type-wrapper")),t.data("class",e.class).appendTo(this.$(".widget-type-list"))}),this);var e=this.$(".so-sidebar-tabs");_.each(panelsOptions.widget_dialog_tabs,(function(t,i){l(this.dialogTabTemplate({title:t.title,tab:i})).data({message:t.message,filter:t.filter}).appendTo(e)}),this),this.initTabs();var t=this;l(window).resize((function(){t.balanceWidgetHeights()}))},tabClickHandler:function(e){this.filter=e.parent().data("filter"),this.filter.search=this.$(".so-sidebar-search").val();var t=e.parent().data("message");return _.isEmpty(t)&&(t=""),this.$(".so-toolbar .so-status").html(t),this.filterWidgets(this.filter),!1},searchHandler:function(e){if(13===e.which){var t=this.$(".widget-type-list .widget-type:visible");1===t.length&&t.click()}else this.filter.search=l(e.target).val().trim(),this.filterWidgets(this.filter)},filterWidgets:function(e){_.isUndefined(e)&&(e={}),_.isUndefined(e.groups)&&(e.groups=""),this.$(".widget-type-list .widget-type").each((function(){var t,i=l(this),s=i.data("class"),o=_.isUndefined(panelsOptions.widgets[s])?null:panelsOptions.widgets[s];(t=!!_.isEmpty(e.groups)||null!==o&&!_.isEmpty(_.intersection(e.groups,panelsOptions.widgets[s].groups)))&&(_.isUndefined(e.search)||""===e.search||-1===o.title.toLowerCase().indexOf(e.search.toLowerCase())&&(t=!1)),t?i.show():i.hide()})),this.balanceWidgetHeights()},widgetClickHandler:function(e){this.builder.trigger("before_user_adds_widget"),this.builder.addHistoryEntry("widget_added");var t=l(e.currentTarget),i=new s.model.widget({class:t.data("class")});i.cell=this.builder.getActiveCell(),i.cell.get("widgets").add(i),this.closeDialog(),this.builder.model.refreshPanelsData(),this.builder.trigger("after_user_adds_widget",i)},balanceWidgetHeights:function(e){var t=[[]],i=null,s=Math.round(this.$(".widget-type").parent().width()/this.$(".widget-type").width());this.$(".widget-type").css("clear","none").filter(":visible").each((function(e,t){e%s==0&&0!==e&&l(t).css("clear","both")})),this.$(".widget-type-wrapper").css("height","auto").filter(":visible").each((function(e,s){var o=l(s);null!==i&&i.position().top!==o.position().top&&(t[t.length]=[]),i=o,t[t.length-1].push(o)})),_.each(t,(function(e,t){var i=_.max(e.map((function(e){return e.height()})));_.each(e,(function(e){e.height(i)}))}))}})},{}],11:[function(e,t,i){t.exports={canCopyPaste:function(){return"undefined"!=typeof Storage&&panelsOptions.user},setModel:function(e){if(!this.canCopyPaste())return!1;var t=panels.helpers.serialize.serialize(e);return e instanceof panels.model.row?t.thingType="row-model":e instanceof panels.model.widget&&(t.thingType="widget-model"),localStorage["panels_clipboard_"+panelsOptions.user]=JSON.stringify(t),!0},isModel:function(e){if(!this.canCopyPaste())return!1;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&((t=JSON.parse(t)).thingType&&t.thingType===e)},getModel:function(e){if(!this.canCopyPaste())return null;var t=localStorage["panels_clipboard_"+panelsOptions.user];return void 0!==t&&(t=JSON.parse(t)).thingType&&t.thingType===e?panels.helpers.serialize.unserialize(t,t.thingType,null):null}}},{}],12:[function(e,t,i){t.exports={isBlockEditor:function(){return void 0!==wp.blocks},isClassicEditor:function(e){return e.attachedToEditor&&e.$el.is(":visible")}}},{}],13:[function(e,t,i){t.exports={lock:function(){if("hidden"!==jQuery("body").css("overflow")){var e=[self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop];jQuery("body").data({"scroll-position":e}).css("overflow","hidden"),_.isUndefined(e)||window.scrollTo(e[0],e[1])}},unlock:function(){if("hidden"===jQuery("body").css("overflow")&&!jQuery(".so-panels-dialog-wrapper").is(":visible")&&!jQuery(".so-panels-live-editor").is(":visible")){jQuery("body").css("overflow","visible");var e=jQuery("body").data("scroll-position");_.isUndefined(e)||window.scrollTo(e[0],e[1])}}}},{}],14:[function(e,t,i){t.exports={serialize:function(e){var t;if(e instanceof Backbone.Model){var i={};for(var s in e.attributes)if(e.attributes.hasOwnProperty(s)){if("builder"===s||"collection"===s)continue;(t=e.attributes[s])instanceof Backbone.Model||t instanceof Backbone.Collection?i[s]=this.serialize(t):i[s]=t}return i}if(e instanceof Backbone.Collection){for(var l=[],o=0;o<e.models.length;o++)(t=e.models[o])instanceof Backbone.Model||t instanceof Backbone.Collection?l.push(this.serialize(t)):l.push(t);return l}},unserialize:function(e,t,i){var s;switch(t){case"row-model":(s=new panels.model.row).builder=i;var l={style:e.style};e.hasOwnProperty("label")&&(l.label=e.label),e.hasOwnProperty("color_label")&&(l.color_label=e.color_label),s.set(l),s.setCells(this.unserialize(e.cells,"cell-collection",s));break;case"cell-model":(s=new panels.model.cell).row=i,s.set("weight",e.weight),s.set("style",e.style),s.set("widgets",this.unserialize(e.widgets,"widget-collection",s));break;case"widget-model":for(var o in(s=new panels.model.widget).cell=i,e)e.hasOwnProperty(o)&&s.set(o,e[o]);s.set("widget_id",panels.helpers.utils.generateUUID());break;case"cell-collection":s=new panels.collection.cells;for(var n=0;n<e.length;n++)s.push(this.unserialize(e[n],"cell-model",i));break;case"widget-collection":s=new panels.collection.widgets;for(n=0;n<e.length;n++)s.push(this.unserialize(e[n],"widget-model",i));break;default:console.log("Unknown Thing - "+t)}return s}}},{}],15:[function(e,t,i){t.exports={generateUUID:function(){var e=(new Date).getTime();return window.performance&&"function"==typeof window.performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(16)}))},processTemplate:function(e){return _.isUndefined(e)||_.isNull(e)?"":e=(e=(e=e.replace(/{{%/g,"<%")).replace(/%}}/g,"%>")).trim()},selectElementContents:function(e){var t=document.createRange();t.selectNodeContents(e);var i=window.getSelection();i.removeAllRanges(),i.addRange(t)}}},{}],16:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=function(e,t){return this.each((function(){var i=jQuery(this);if(!i.data("soPanelsBuilderWidgetInitialized")||t){var o=i.closest("form").find(".widget-id").val(),n=l.extend(!0,{builderSupports:i.data("builder-supports")},e);if(_.isUndefined(o)||!(o.indexOf("__i__")>-1)){var a=new s.model.builder,r=new s.view.builder({model:a,config:n}),d=i.closest(".so-panels-dialog-wrapper").data("view");_.isUndefined(d)||(d.on("close_dialog",(function(){a.refreshPanelsData()})),d.on("open_dialog_complete",(function(){r.trigger("builder_resize")})),d.model.on("destroy",(function(){a.emptyRows().destroy()})),r.setDialogParents(panelsOptions.loc.layout_widget,d));var h=Boolean(i.closest(".widget-content").length);r.render().attach({container:i,dialog:h||"dialog"===i.data("mode"),type:i.data("type")}).setDataField(i.find("input.panels-data")),h||"dialog"===i.data("mode")?(r.setDialogParents(panelsOptions.loc.layout_widget,r.dialog),i.find(".siteorigin-panels-display-builder").click((function(e){e.preventDefault(),r.dialog.openDialog()}))):i.find(".siteorigin-panels-display-builder").parent().remove(),l(document).trigger("panels_setup",r),i.data("soPanelsBuilderWidgetInitialized",!0)}}}))}},{}],17:[function(e,t,i){
2
  /**
3
  * Everything we need for SiteOrigin Page Builder.
4
  *
5
  * @copyright Greg Priday 2013 - 2016 - <https://siteorigin.com/>
6
  * @license GPL 3.0 http://www.gnu.org/licenses/gpl.html
7
  */
8
+ var s={};window.panels=s,window.siteoriginPanels=s,s.helpers={},s.helpers.clipboard=e("./helpers/clipboard"),s.helpers.utils=e("./helpers/utils"),s.helpers.editor=e("./helpers/editor"),s.helpers.serialize=e("./helpers/serialize"),s.helpers.pageScroll=e("./helpers/page-scroll"),s.model={},s.model.widget=e("./model/widget"),s.model.cell=e("./model/cell"),s.model.row=e("./model/row"),s.model.builder=e("./model/builder"),s.model.historyEntry=e("./model/history-entry"),s.collection={},s.collection.widgets=e("./collection/widgets"),s.collection.cells=e("./collection/cells"),s.collection.rows=e("./collection/rows"),s.collection.historyEntries=e("./collection/history-entries"),s.view={},s.view.widget=e("./view/widget"),s.view.cell=e("./view/cell"),s.view.row=e("./view/row"),s.view.builder=e("./view/builder"),s.view.dialog=e("./view/dialog"),s.view.styles=e("./view/styles"),s.view.liveEditor=e("./view/live-editor"),s.dialog={},s.dialog.builder=e("./dialog/builder"),s.dialog.widgets=e("./dialog/widgets"),s.dialog.widget=e("./dialog/widget"),s.dialog.prebuilt=e("./dialog/prebuilt"),s.dialog.row=e("./dialog/row"),s.dialog.history=e("./dialog/history"),s.utils={},s.utils.menu=e("./utils/menu"),jQuery.fn.soPanelsSetupBuilderWidget=e("./jquery/setup-builder-widget"),jQuery((function(e){var t,i,s,l,o=e("#siteorigin-panels-metabox");if(s=e("form#post"),o.length&&s.length)t=o,i=o.find(".siteorigin-panels-data-field"),l={editorType:"tinyMCE",postId:e("#post_ID").val(),editorId:"#content",builderType:o.data("builder-type"),builderSupports:o.data("builder-supports"),loadOnAttach:panelsOptions.loadOnAttach&&1==e("#auto_draft").val(),loadLiveEditor:1==o.data("live-editor"),liveEditorPreview:t.data("preview-url")};else if(e(".siteorigin-panels-builder-form").length){var n=e(".siteorigin-panels-builder-form");t=n.find(".siteorigin-panels-builder-container"),i=n.find('input[name="panels_data"]'),s=n,l={editorType:"standalone",postId:n.data("post-id"),editorId:"#post_content",builderType:n.data("type"),builderSupports:n.data("builder-supports"),loadLiveEditor:!1,liveEditorPreview:n.data("preview-url")}}if(!_.isUndefined(t)){var a=window.siteoriginPanels,r=new a.model.builder,d=new a.view.builder({model:r,config:l});e(document).trigger("before_panels_setup",d),d.render().attach({container:t}).setDataField(i).attachToEditor(),s.submit((function(){r.refreshPanelsData()})),t.removeClass("so-panels-loading"),e(document).trigger("panels_setup",d,window.panels),window.soPanelsBuilderView=d}e(document).on("widget-added",(function(t,i){e(i).find(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e("body").hasClass("wp-customizer")||e((function(){e(".siteorigin-page-builder-widget").soPanelsSetupBuilderWidget()})),e(window).on("keyup",(function(t){27===t.which&&e(".so-panels-dialog-wrapper, .so-panels-live-editor").filter(":visible").last().find(".so-title-bar .so-close, .live-editor-close").click()}))}))},{"./collection/cells":1,"./collection/history-entries":2,"./collection/rows":3,"./collection/widgets":4,"./dialog/builder":5,"./dialog/history":6,"./dialog/prebuilt":7,"./dialog/row":8,"./dialog/widget":9,"./dialog/widgets":10,"./helpers/clipboard":11,"./helpers/editor":12,"./helpers/page-scroll":13,"./helpers/serialize":14,"./helpers/utils":15,"./jquery/setup-builder-widget":16,"./model/builder":18,"./model/cell":19,"./model/history-entry":20,"./model/row":21,"./model/widget":22,"./utils/menu":23,"./view/builder":24,"./view/cell":25,"./view/dialog":26,"./view/live-editor":27,"./view/row":28,"./view/styles":29,"./view/widget":30}],18:[function(e,t,i){t.exports=Backbone.Model.extend({layoutPosition:{BEFORE:"before",AFTER:"after",REPLACE:"replace"},rows:{},defaults:{data:{widgets:[],grids:[],grid_cells:[]}},initialize:function(){this.set("rows",new panels.collection.rows)},addRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var s=new panels.collection.cells(t);e=_.extend({collection:this.get("rows"),cells:s},e);var l=new panels.model.row(e);return l.builder=this,this.get("rows").add(l,i),l},loadPanelsData:function(e,t){try{t===this.layoutPosition.BEFORE?e=this.concatPanelsData(e,this.getPanelsData()):t===this.layoutPosition.AFTER&&(e=this.concatPanelsData(this.getPanelsData(),e)),this.emptyRows(),this.set("data",JSON.parse(JSON.stringify(e)),{silent:!0});var i,s=[];if(_.isUndefined(e.grid_cells))return void this.trigger("load_panels_data");for(var l=0;l<e.grid_cells.length;l++)i=parseInt(e.grid_cells[l].grid),_.isUndefined(s[i])&&(s[i]=[]),s[i].push(e.grid_cells[l]);var o=this;if(_.each(s,(function(t,i){var s={};_.isUndefined(e.grids[i].style)||(s.style=e.grids[i].style),_.isUndefined(e.grids[i].ratio)||(s.ratio=e.grids[i].ratio),_.isUndefined(e.grids[i].ratio_direction)||(s.ratio_direction=e.grids[i].ratio_direction),_.isUndefined(e.grids[i].color_label)||(s.color_label=e.grids[i].color_label),_.isUndefined(e.grids[i].label)||(s.label=e.grids[i].label),o.addRow(s,t,{noAnimate:!0})})),_.isUndefined(e.widgets))return;_.each(e.widgets,(function(e){var t=null;_.isUndefined(e.panels_info)?(t=e.info,delete e.info):(t=e.panels_info,delete e.panels_info);var i=o.get("rows").at(parseInt(t.grid)).get("cells").at(parseInt(t.cell)),s=new panels.model.widget({class:t.class,values:e});_.isUndefined(t.style)||s.set("style",t.style),_.isUndefined(t.read_only)||s.set("read_only",t.read_only),_.isUndefined(t.widget_id)?s.set("widget_id",panels.helpers.utils.generateUUID()):s.set("widget_id",t.widget_id),_.isUndefined(t.label)||s.set("label",t.label),s.cell=i,i.get("widgets").add(s,{noAnimate:!0})})),this.trigger("load_panels_data")}catch(e){console.log("Error loading data: "+e.message)}},concatPanelsData:function(e,t){if(_.isUndefined(t)||_.isUndefined(t.grids)||_.isEmpty(t.grids)||_.isUndefined(t.grid_cells)||_.isEmpty(t.grid_cells))return e;if(_.isUndefined(e)||_.isUndefined(e.grids)||_.isEmpty(e.grids))return t;var i,s=e.grids.length,l=_.isUndefined(e.widgets)?0:e.widgets.length,o={grids:[],grid_cells:[],widgets:[]};for(o.grids=e.grids.concat(t.grids),_.isUndefined(e.grid_cells)||(o.grid_cells=e.grid_cells.slice()),_.isUndefined(e.widgets)||(o.widgets=e.widgets.slice()),i=0;i<t.grid_cells.length;i++){var n=t.grid_cells[i];n.grid=parseInt(n.grid)+s,o.grid_cells.push(n)}if(!_.isUndefined(t.widgets))for(i=0;i<t.widgets.length;i++){var a=t.widgets[i];a.panels_info.grid=parseInt(a.panels_info.grid)+s,a.panels_info.id=parseInt(a.panels_info.id)+l,o.widgets.push(a)}return o},getPanelsData:function(){var e={widgets:[],grids:[],grid_cells:[]},t=0;return this.get("rows").each((function(i,s){i.get("cells").each((function(i,l){i.get("widgets").each((function(i,o){var n={class:i.get("class"),raw:i.get("raw"),grid:s,cell:l,id:t++,widget_id:i.get("widget_id"),style:i.get("style"),label:i.get("label")};_.isEmpty(n.widget_id)&&(n.widget_id=panels.helpers.utils.generateUUID());var a=_.extend(_.clone(i.get("values")),{panels_info:n});e.widgets.push(a)})),e.grid_cells.push({grid:s,index:l,weight:i.get("weight"),style:i.get("style")})})),e.grids.push({cells:i.get("cells").length,style:i.get("style"),ratio:i.get("ratio"),ratio_direction:i.get("ratio_direction"),color_label:i.get("color_label"),label:i.get("label")})})),e},refreshPanelsData:function(e){e=_.extend({silent:!1},e);var t=this.get("data"),i=this.getPanelsData();this.set("data",i,{silent:!0}),e.silent||JSON.stringify(i)===JSON.stringify(t)||(this.trigger("change"),this.trigger("change:data"),this.trigger("refresh_panels_data",i,e))},emptyRows:function(){return _.invoke(this.get("rows").toArray(),"destroy"),this.get("rows").reset(),this},isValidLayoutPosition:function(e){return e===this.layoutPosition.BEFORE||e===this.layoutPosition.AFTER||e===this.layoutPosition.REPLACE},getPanelsDataFromHtml:function(e,t){var i,s=this,l=jQuery('<div id="wrapper">'+e+"</div>");if(l.find(".panel-layout .panel-grid").length){var o={grids:[],grid_cells:[],widgets:[]},n=new RegExp(panelsOptions.siteoriginWidgetRegex,"i"),a=(i=document.createElement("div"),function(e){return e&&"string"==typeof e&&(e=(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,"")).replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gim,""),i.innerHTML=e,e=i.textContent,i.textContent=""),e}),r=function(e){var t,i=e.find("div");if(!i.length)return e.html();for(t=0;t<i.length-1&&jQuery.trim(i.eq(t).text())==jQuery.trim(i.eq(t+1).text());t++);var s=i.eq(t).find(".widget-title:header"),l="";return s.length&&(l=s.html(),s.remove()),{title:l,text:i.eq(t).html()}},d=l.find(".panel-layout").eq(0),h=function(e,t){return jQuery(t).closest(".panel-layout").is(d)};return l.find("> .panel-layout > .panel-grid").filter(h).each((function(e,i){var l=jQuery(i),d=l.find(".panel-grid-cell").filter(h);o.grids.push({cells:d.length,style:l.data("style"),ratio:l.data("ratio"),ratio_direction:l.data("ratio-direction"),color_label:l.data("color-label"),label:l.data("label")}),d.each((function(i,l){var d=jQuery(l),c=d.find(".so-panel").filter(h);o.grid_cells.push({grid:e,weight:_.isUndefined(d.data("weight"))?1:parseFloat(d.data("weight")),style:d.data("style")}),c.each((function(l,d){var h=jQuery(d),c=h.find(".panel-widget-style").length?h.find(".panel-widget-style").html():h.html(),u={grid:e,cell:i,style:h.data("style"),raw:!1,label:h.data("label")};c=c.trim();var p=n.exec(c);if(!_.isNull(p)&&""===c.replace(n,"").trim()){try{var g=/class="(.*?)"/.exec(p[3]),f=jQuery(p[5]),w=JSON.parse(a(f.val())).instance;u.class=g[1].replace(/\\\\+/g,"\\"),u.raw=!1,w.panels_info=u,o.widgets.push(w)}catch(e){u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u}))}return!0}return-1!==c.indexOf("panel-layout")&&jQuery("<div>"+c+"</div>").find(".panel-layout .panel-grid").length?(u.class="SiteOrigin_Panels_Widgets_Layout",o.widgets.push({panels_data:s.getPanelsDataFromHtml(c,t),panels_info:u}),!0):(u.class=t,o.widgets.push(_.extend(r(h),{filter:"1",type:"visual",panels_info:u})),!0)}))}))})),l.find(".panel-layout").remove(),l.find("style[data-panels-style-for-post]").remove(),l.html().replace(/^\s+|\s+$/gm,"").length&&(o.grids.push({cells:1,style:{}}),o.grid_cells.push({grid:o.grids.length-1,weight:1}),o.widgets.push({filter:"1",text:l.html().replace(/^\s+|\s+$/gm,""),title:"",type:"visual",panels_info:{class:t,raw:!1,grid:o.grids.length-1,cell:0}})),o}return{grid_cells:[{grid:0,weight:1}],grids:[{cells:1}],widgets:[{filter:"1",text:e,title:"",type:"visual",panels_info:{class:t,raw:!1,grid:0,cell:0}}]}}})},{}],19:[function(e,t,i){t.exports=Backbone.Model.extend({widgets:{},row:null,defaults:{weight:0,style:{}},indexes:null,initialize:function(){this.set("widgets",new panels.collection.widgets),this.on("destroy",this.onDestroy,this)},onDestroy:function(){_.invoke(this.get("widgets").toArray(),"destroy"),this.get("widgets").reset()},clone:function(e,t){_.isUndefined(e)&&(e=this.row),t=_.extend({cloneWidgets:!0},t);var i=new this.constructor(this.attributes);return i.set("collection",e.get("cells"),{silent:!0}),i.row=e,t.cloneWidgets&&this.get("widgets").each((function(e){i.get("widgets").add(e.clone(i,t),{silent:!0})})),i}})},{}],20:[function(e,t,i){t.exports=Backbone.Model.extend({defaults:{text:"",data:"",time:null,count:1}})},{}],21:[function(e,t,i){t.exports=Backbone.Model.extend({builder:null,defaults:{style:{}},indexes:null,initialize:function(){_.isEmpty(this.get("cells"))?this.set("cells",new panels.collection.cells):this.get("cells").each(function(e){e.row=this}.bind(this)),this.on("destroy",this.onDestroy,this)},setCells:function(e){var t=this.get("cells")||new panels.collection.cells,i=[];t.each((function(s,l){var o=e.at(l);if(o)s.set("weight",o.get("weight"));else{for(var n=t.at(e.length-1),a=s.get("widgets").models.slice(),r=0;r<a.length;r++)a[r].moveToCell(n,{silent:!1});i.push(s)}})),_.each(i,(function(e){t.remove(e)})),e.length>t.length&&_.each(e.slice(t.length,e.length),function(e){e.set({collection:t}),e.row=this,t.add(e)}.bind(this)),this.reweightCells()},reweightCells:function(){var e=0,t=this.get("cells");t.each((function(t){e+=t.get("weight")})),t.each((function(t){t.set("weight",t.get("weight")/e)})),this.trigger("reweight_cells")},onDestroy:function(){_.invoke(this.get("cells").toArray(),"destroy"),this.get("cells").reset()},clone:function(e){_.isUndefined(e)&&(e=this.builder);var t=new this.constructor(this.attributes);t.set("collection",e.get("rows"),{silent:!0}),t.builder=e;var i=new panels.collection.cells;return this.get("cells").each((function(e){i.add(e.clone(t),{silent:!0})})),t.set("cells",i),t}})},{}],22:[function(e,t,i){t.exports=Backbone.Model.extend({cell:null,defaults:{class:null,missing:!1,values:{},raw:!1,style:{},read_only:!1,widget_id:""},indexes:null,initialize:function(){var e=this.get("class");!_.isUndefined(panelsOptions.widgets[e])&&panelsOptions.widgets[e].installed||this.set("missing",!0)},getWidgetField:function(e){return _.isUndefined(panelsOptions.widgets[this.get("class")])?"title"===e||"description"===e?panelsOptions.loc.missing_widget[e]:"":this.has("label")&&!_.isEmpty(this.get("label"))?this.get("label"):panelsOptions.widgets[this.get("class")][e]},moveToCell:function(e,t,i){return t=_.extend({silent:!0},t),this.cell=e,this.collection.remove(this,t),e.get("widgets").add(this,_.extend({at:i},t)),this.trigger("move_to_cell",e,i),this},setValues:function(e){var t=!1;JSON.stringify(e)!==JSON.stringify(this.get("values"))&&(t=!0),this.set("values",e,{silent:!0}),t&&(this.trigger("change",this),this.trigger("change:values"))},clone:function(e,t){_.isUndefined(e)&&(e=this.cell);var i=new this.constructor(this.attributes),s=JSON.parse(JSON.stringify(this.get("values"))),l=function(e){return _.each(e,(function(t,i){_.isString(i)&&"_"===i[0]?delete e[i]:_.isObject(e[i])&&l(e[i])})),e};return s=l(s),"SiteOrigin_Panels_Widgets_Layout"===this.get("class")&&(s.builder_id=Math.random().toString(36).substr(2)),i.set("widget_id",""),i.set("values",s,{silent:!0}),i.set("collection",e.get("widgets"),{silent:!0}),i.cell=e,i.isDuplicate=!0,i},getTitle:function(){var e=panelsOptions.widgets[this.get("class")];if(_.isUndefined(e))return this.get("class").replace(/_/g," ");if(!_.isUndefined(e.panels_title)&&!1===e.panels_title)return panelsOptions.widgets[this.get("class")].description;var t=this.get("values"),i=["title","text"];for(var s in t)"_"!==s.charAt(0)&&"so_sidebar_emulator_id"!==s&&"option_name"!==s&&t.hasOwnProperty(s)&&i.push(s);for(var l in i=_.uniq(i))if(!_.isUndefined(t[i[l]])&&_.isString(t[i[l]])&&""!==t[i[l]]&&"on"!==t[i[l]]&&"true"!==t[i[l]]&&"false"!==t[i[l]]&&"_"!==i[l][0]&&!jQuery.isNumeric(t[i[l]])){var o=t[i[l]],n=(o=o.replace(/<\/?[^>]+(>|$)/g,"")).split(" ");return(n=n.slice(0,20)).join(" ")}return this.getWidgetField("description")}})},{}],23:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({wrapperTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu").html())),sectionTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-context-menu-section").html())),contexts:[],active:!1,events:{"keyup .so-search-wrapper input":"searchKeyUp"},initialize:function(){this.listenContextMenu(),this.render(),this.attach()},listenContextMenu:function(){var e=this;l(window).on("contextmenu",(function(t){return e.active&&!e.isOverEl(e.$el,t)?(e.closeMenu(),e.active=!1,t.preventDefault(),!1):!!e.active||(e.active=!1,e.trigger("activate_context",t,e),void(e.active&&(t.preventDefault(),e.openMenu({left:t.pageX,top:t.pageY}))))}))},render:function(){this.setElement(this.wrapperTemplate())},attach:function(){this.$el.appendTo("body")},openMenu:function(e){this.trigger("open_menu"),l(window).on("keyup",{menu:this},this.keyboardListen),l(window).on("click",{menu:this},this.clickOutsideListen),this.$el.css("max-height",l(window).height()-20),e.left+this.$el.outerWidth()+10>=l(window).width()&&(e.left=l(window).width()-this.$el.outerWidth()-10),e.left<=0&&(e.left=10),e.top+this.$el.outerHeight()-l(window).scrollTop()+10>=l(window).height()&&(e.top=l(window).height()+l(window).scrollTop()-this.$el.outerHeight()-10),e.left<=0&&(e.left=10),this.$el.css({left:e.left+1,top:e.top+1}).show(),this.$(".so-search-wrapper input").focus()},closeMenu:function(){this.trigger("close_menu"),l(window).off("keyup",this.keyboardListen),l(window).off("click",this.clickOutsideListen),this.active=!1,this.$el.empty().hide()},keyboardListen:function(e){var t=e.data.menu;switch(e.which){case 27:t.closeMenu()}},clickOutsideListen:function(e){var t=e.data.menu;3!==e.which&&t.$el.is(":visible")&&!t.isOverEl(t.$el,e)&&t.closeMenu()},addSection:function(e,t,i,s){var o=this;t=_.extend({display:5,defaultDisplay:!1,search:!0,sectionTitle:"",searchPlaceholder:"",titleKey:"title"},t);var n=l(this.sectionTemplate({settings:t,items:i})).attr("id","panels-menu-section-"+e);this.$el.append(n),n.find(".so-item:not(.so-confirm)").click((function(){var e=l(this);s(e.data("key")),o.closeMenu()})),n.find(".so-item.so-confirm").click((function(){var e=l(this);if(e.hasClass("so-confirming"))return s(e.data("key")),void o.closeMenu();e.data("original-text",e.html()).addClass("so-confirming").html('<span class="dashicons dashicons-yes"></span> '+panelsOptions.loc.dropdown_confirm),setTimeout((function(){e.removeClass("so-confirming"),e.html(e.data("original-text"))}),2500)})),n.data("settings",t).find(".so-search-wrapper input").trigger("keyup"),this.active=!0},hasSection:function(e){return this.$el.find("#panels-menu-section-"+e).length>0},searchKeyUp:function(e){var t=l(e.currentTarget),i=t.closest(".so-section"),s=i.data("settings");if(38===e.which||40===e.which){var o=i.find("ul li:visible"),n=o.filter(".so-active").eq(0);if(n.length){o.removeClass("so-active");var a=o.index(n);38===e.which?n=a-1<0?o.last():o.eq(a-1):40===e.which&&(n=a+1>=o.length?o.first():o.eq(a+1))}else 38===e.which?n=o.last():40===e.which&&(n=o.first());return n.addClass("so-active"),!1}if(13===e.which)return 1===i.find("ul li:visible").length?(i.find("ul li:visible").trigger("click"),!1):(i.find("ul li.so-active:visible").trigger("click"),!1);if(""===t.val())if(s.defaultDisplay){i.find(".so-item").hide();for(var r=0;r<s.defaultDisplay.length;r++)i.find('.so-item[data-key="'+s.defaultDisplay[r]+'"]').show()}else i.find(".so-item").show();else i.find(".so-item").hide().each((function(){var e=l(this);-1!==e.html().toLowerCase().indexOf(t.val().toLowerCase())&&e.show()}));i.find(".so-item:visible:gt("+(s.display-1)+")").hide(),0===i.find(".so-item:visible").length&&""!==t.val()?i.find(".so-no-results").show():i.find(".so-no-results").hide()},isOverEl:function(e,t){var i=[[e.offset().left,e.offset().top],[e.offset().left+e.outerWidth(),e.offset().top+e.outerHeight()]];return t.pageX>=i[0][0]&&t.pageX<=i[1][0]&&t.pageY>=i[0][1]&&t.pageY<=i[1][1]}})},{}],24:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({config:{},template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder").html())),dialogs:{},rowsSortable:null,dataField:!1,currentData:"",contentPreview:"",attachedToEditor:!1,attachedVisible:!1,liveEditor:void 0,menu:!1,activeCell:null,events:{"click .so-tool-button.so-widget-add":"displayAddWidgetDialog","click .so-tool-button.so-row-add":"displayAddRowDialog","click .so-tool-button.so-prebuilt-add":"displayAddPrebuiltDialog","click .so-tool-button.so-history":"displayHistoryDialog","click .so-tool-button.so-live-editor":"displayLiveEditor"},rows:null,initialize:function(e){var t=this;return this.config=_.extend({loadLiveEditor:!1,builderSupports:{}},e.config),this.config.builderSupports=_.extend({addRow:!0,editRow:!0,deleteRow:!0,moveRow:!0,addWidget:!0,editWidget:!0,deleteWidget:!0,moveWidget:!0,prebuilt:!0,history:!0,liveEditor:!0,revertToEditor:!0},this.config.builderSupports),e.config.loadLiveEditor&&this.on("builder_live_editor_added",(function(){this.displayLiveEditor()})),this.dialogs={widgets:new s.dialog.widgets,row:new s.dialog.row,prebuilt:new s.dialog.prebuilt},_.each(this.dialogs,(function(e,i,s){s[i].setBuilder(t)})),this.dialogs.row.setRowDialogType("create"),this.listenTo(this.model.get("rows"),"add",this.onAddRow),l(window).resize((function(e){e.target===window&&t.trigger("builder_resize")})),this.listenTo(this.model,"change:data load_panels_data",this.storeModelData),this.listenTo(this.model,"change:data load_panels_data",this.toggleWelcomeDisplay),this.on("builder_attached_to_editor",this.handleContentChange,this),this.on("content_change",this.handleContentChange,this),this.on("display_builder",this.handleDisplayBuilder,this),this.on("hide_builder",this.handleHideBuilder,this),this.on("builder_rendered builder_resize",this.handleBuilderSizing,this),this.on("display_builder",this.wrapEditorExpandAdjust,this),this.menu=new s.utils.menu({}),this.listenTo(this.menu,"activate_context",this.activateContextMenu),this.config.loadOnAttach&&this.on("builder_attached_to_editor",(function(){this.displayAttachedBuilder({confirm:!1})}),this),this},render:function(){return this.setElement(this.template()),this.$el.attr("id","siteorigin-panels-builder-"+this.cid).addClass("so-builder-container"),this.trigger("builder_rendered"),this},attach:function(e){(e=_.extend({container:!1,dialog:!1},e)).dialog?(this.dialog=new s.dialog.builder,this.dialog.builder=this):(this.$el.appendTo(e.container),this.metabox=e.container.closest(".postbox"),this.initSortable(),this.trigger("attached_to_container",e.container)),this.trigger("builder_attached"),this.supports("liveEditor")&&this.addLiveEditor(),this.supports("history")&&this.addHistoryBrowser();var t=this.$(".so-builder-toolbar"),i=this.$(".so-panels-welcome-message"),l=panelsOptions.loc.welcomeMessage,o=[];this.supports("addWidget")?o.push(l.addWidgetButton):t.find(".so-widget-add").hide(),this.supports("addRow")?o.push(l.addRowButton):t.find(".so-row-add").hide(),this.supports("prebuilt")?o.push(l.addPrebuiltButton):t.find(".so-prebuilt-add").hide();var n="";3===o.length?n=l.threeEnabled:2===o.length?n=l.twoEnabled:1===o.length?n=l.oneEnabled:0===o.length&&(n=l.addingDisabled);var a=_.template(s.helpers.utils.processTemplate(n))({items:o})+" "+l.docsMessage;return i.find(".so-message-wrapper").html(a),this},attachToEditor:function(){if("tinyMCE"!==this.config.editorType)return this;this.attachedToEditor=!0;var e=this.metabox,t=this;l("#wp-content-wrap .wp-editor-tabs").find(".wp-switch-editor").click((function(e){e.preventDefault(),l("#wp-content-editor-container").show(),l("#wp-content-wrap").removeClass("panels-active"),l("#content-resize-handle").show(),t.trigger("hide_builder")})).end().append(l('<button type="button" id="content-panels" class="hide-if-no-js wp-switch-editor switch-panels">'+e.find("h2.hndle").html()+"</button>").click((function(e){t.displayAttachedBuilder({confirm:!0})&&e.preventDefault()}))),this.supports("revertToEditor")&&e.find(".so-switch-to-standard").click((function(i){i.preventDefault(),confirm(panelsOptions.loc.confirm_stop_builder)&&(t.addHistoryEntry("back_to_editor"),t.model.loadPanelsData(!1),l("#wp-content-wrap").show(),e.hide(),l(window).resize(),t.attachedVisible=!1,t.trigger("hide_builder"))})).show(),e.insertAfter("#wp-content-wrap").hide().addClass("attached-to-editor");var i=this.model.get("data");_.isEmpty(i.widgets)&&_.isEmpty(i.grids)&&this.supports("revertToEditor")||this.displayAttachedBuilder({confirm:!1});var s=function(){var e=t.$(".so-builder-toolbar");if(t.$el.hasClass("so-display-narrow"))return e.css({top:0,left:0,width:"100%",position:"absolute"}),void t.$el.css("padding-top",e.outerHeight());var i=l(window).scrollTop()-t.$el.offset().top;"fixed"===l("#wpadminbar").css("position")&&(i+=l("#wpadminbar").outerHeight());var s=0,o=t.$el.outerHeight()-e.outerHeight()+20;i>s&&i<o?"fixed"!==e.css("position")&&e.css({top:l("#wpadminbar").outerHeight(),left:t.$el.offset().left,width:t.$el.outerWidth(),position:"fixed"}):e.css({top:Math.min(Math.max(i,0),t.$el.outerHeight()-e.outerHeight()+20),left:0,width:"100%",position:"absolute"}),t.$el.css("padding-top",e.outerHeight())};return this.on("builder_resize",s,this),l(document).scroll(s),s(),this.trigger("builder_attached_to_editor"),this},displayAttachedBuilder:function(e){if((e=_.extend({confirm:!0},e)).confirm){var t="undefined"!=typeof tinyMCE&&tinyMCE.get("content");if(""!==(t&&_.isFunction(t.getContent)?t.getContent():l("textarea#content").val())&&!confirm(panelsOptions.loc.confirm_use_builder))return!1}return l("#wp-content-wrap").hide(),l("#editor-expand-toggle").on("change.editor-expand",(function(){l(this).prop("checked")||l("#wp-content-wrap").hide()})),this.metabox.show().find("> .inside").show(),l(window).resize(),l(document).scroll(),this.attachedVisible=!0,this.trigger("display_builder"),!0},initSortable:function(){if(!this.supports("moveRow"))return this;var e=this,t=e.$el.attr("id");return this.rowsSortable=this.$(".so-rows-container").sortable({appendTo:"#wpwrap",items:".so-row-container",handle:".so-row-move",connectWith:"#"+t+".so-rows-container,.block-editor .so-rows-container",axis:"y",tolerance:"pointer",scroll:!1,remove:function(t,i){e.model.get("rows").remove(l(i.item).data("view").model,{silent:!0}),e.model.refreshPanelsData()},receive:function(t,i){e.model.get("rows").add(l(i.item).data("view").model,{silent:!0,at:l(i.item).index()}),e.model.refreshPanelsData()},stop:function(t,i){var s=l(i.item),o=s.data("view"),n=e.model.get("rows");n.get(o.model)&&(e.addHistoryEntry("row_moved"),n.remove(o.model,{silent:!0}),n.add(o.model,{silent:!0,at:s.index()}),o.trigger("move",s.index()),e.model.refreshPanelsData())}}),this},refreshSortable:function(){_.isNull(this.rowsSortable)||this.rowsSortable.sortable("refresh")},setDataField:function(e,t){if(t=_.extend({load:!0},t),this.dataField=e,this.dataField.data("builder",this),t.load&&""!==e.val()){var i=this.dataField.val();try{i=JSON.parse(i)}catch(e){console.log("Failed to parse Page Builder layout data from supplied data field."),i={}}this.setData(i)}return this},setData:function(e){this.model.loadPanelsData(e),this.currentData=e,this.toggleWelcomeDisplay()},getData:function(){return this.model.get("data")},storeModelData:function(){var e=JSON.stringify(this.model.get("data"));l(this.dataField).val()!==e&&(l(this.dataField).val(e),l(this.dataField).trigger("change"),this.trigger("content_change"))},onAddRow:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.row({model:e});l.builder=this,l.render(),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".so-rows-container")):l.$el.insertAfter(this.$(".so-rows-container .so-row-container").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),l.resize(),this.trigger("row_added")},displayAddWidgetDialog:function(){this.dialogs.widgets.openDialog()},displayAddRowDialog:function(){var e=new s.model.row,t=new s.collection.cells([{weight:.5},{weight:.5}]);t.each((function(t){t.row=e})),e.set("cells",t),e.builder=this.model,this.dialogs.row.setRowModel(e),this.dialogs.row.openDialog()},displayAddPrebuiltDialog:function(){this.dialogs.prebuilt.openDialog()},displayHistoryDialog:function(){this.dialogs.history.openDialog()},pasteRowHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.addHistoryEntry("row_pasted"),e.builder=this.model,this.model.get("rows").add(e,{at:this.model.get("rows").indexOf(this.model)+1}),this.model.refreshPanelsData())},getActiveCell:function(e){if(e=_.extend({createCell:!0},e),!this.model.get("rows").length){if(!e.createCell)return null;this.model.addRow({},[{weight:1}],{noAnimate:!0})}var t=this.activeCell;return _.isEmpty(t)||-1===this.model.get("rows").indexOf(t.model.row)?this.model.get("rows").last().get("cells").first():t.model},addLiveEditor:function(){return _.isEmpty(this.config.liveEditorPreview)?this:(this.liveEditor=new s.view.liveEditor({builder:this,previewUrl:this.config.liveEditorPreview}),this.liveEditor.hasPreviewUrl()&&this.$(".so-builder-toolbar .so-live-editor").show(),this.trigger("builder_live_editor_added"),this)},displayLiveEditor:function(){_.isUndefined(this.liveEditor)||this.liveEditor.open()},addHistoryBrowser:function(){if(_.isEmpty(this.config.liveEditorPreview))return this;this.dialogs.history=new s.dialog.history,this.dialogs.history.builder=this,this.dialogs.history.entries.builder=this.model,this.dialogs.history.setRevertEntry(this.model),this.$(".so-builder-toolbar .so-history").show()},addHistoryEntry:function(e,t){_.isUndefined(t)&&(t=null),_.isUndefined(this.dialogs.history)||this.dialogs.history.entries.addEntry(e,t)},supports:function(e){return"rowAction"===e?this.supports("addRow")||this.supports("editRow")||this.supports("deleteRow"):"widgetAction"===e?this.supports("addWidget")||this.supports("editWidget")||this.supports("deleteWidget"):!_.isUndefined(this.config.builderSupports[e])&&this.config.builderSupports[e]},handleContentChange:function(){if(panelsOptions.copy_content&&(s.helpers.editor.isBlockEditor()||s.helpers.editor.isClassicEditor(this))){var e=this.model.getPanelsData();_.isEmpty(e.widgets)||l.post(panelsOptions.ajaxurl,{action:"so_panels_builder_content_json",panels_data:JSON.stringify(e),post_id:this.config.postId},function(e){this.contentPreview&&""!==e.post_content&&this.updateEditorContent(e.post_content),""!==e.preview&&(this.contentPreview=e.preview)}.bind(this))}},updateEditorContent:function(e){if("tinyMCE"!==this.config.editorType||"undefined"==typeof tinyMCE||_.isNull(tinyMCE.get("content"))){l(this.config.editorId).val(e).trigger("change").trigger("keyup")}else{var t=tinyMCE.get("content");t.setContent(e),t.fire("change"),t.fire("keyup")}this.triggerSeoChange()},triggerSeoChange:function(){"undefined"==typeof YoastSEO||_.isNull(YoastSEO)||_.isNull(YoastSEO.app.refresh)||YoastSEO.app.refresh(),"undefined"==typeof rankMathEditor||_.isNull(rankMathEditor)||_.isNull(rankMathEditor.refresh)||rankMathEditor.refresh("content")},handleDisplayBuilder:function(){var e="undefined"!=typeof tinyMCE&&tinyMCE.get("content"),t=e&&_.isFunction(e.getContent)?e.getContent():l("textarea#content").val();if((_.isEmpty(this.model.get("data"))||_.isEmpty(this.model.get("data").widgets)&&_.isEmpty(this.model.get("data").grids))&&""!==t){var i=panelsOptions.text_widget;if(_.isEmpty(i))return;this.model.loadPanelsData(this.model.getPanelsDataFromHtml(t,i)),this.model.trigger("change"),this.model.trigger("change:data")}l("#post-status-info").addClass("for-siteorigin-panels")},handleHideBuilder:function(){l("#post-status-info").show().removeClass("for-siteorigin-panels")},wrapEditorExpandAdjust:function(){try{for(var e,t=(l.hasData(window)&&l._data(window)).events.scroll,i=0;i<t.length;i++)if("editor-expand"===t[i].namespace){e=t[i],l(window).unbind("scroll",e.handler),l(window).bind("scroll",function(t){this.attachedVisible||e.handler(t)}.bind(this));break}}catch(e){return}},handleBuilderSizing:function(){var e=this.$el.width();return e?(e<575?this.$el.addClass("so-display-narrow"):this.$el.removeClass("so-display-narrow"),this):this},setDialogParents:function(e,t){_.each(this.dialogs,(function(i,s,l){l[s].setParent(e,t)})),this.on("add_dialog",(function(i){i.setParent(e,t)}),this)},toggleWelcomeDisplay:function(){this.model.get("rows").isEmpty()?this.$(".so-panels-welcome-message").show():this.$(".so-panels-welcome-message").hide()},activateContextMenu:function(e,t){if(l.contains(this.$el.get(0),e.target)){var i=l([]).add(this.$(".so-panels-welcome-message:visible")).add(this.$(".so-rows-container > .so-row-container")).add(this.$(".so-cells > .cell")).add(this.$(".cell-wrapper > .so-widget")).filter((function(i){return t.isOverEl(l(this),e)})),s=i.last().data("view");void 0!==s&&void 0!==s.buildContextualMenu?s.buildContextualMenu(e,t):i.last().hasClass("so-panels-welcome-message")&&this.buildContextualMenu(e,t)}},buildContextualMenu:function(e,t){var i={};this.supports("addRow")&&(i.add_row={title:panelsOptions.loc.contextual.add_row}),s.helpers.clipboard.canCopyPaste()&&s.helpers.clipboard.isModel("row-model")&&this.supports("addRow")&&(i.paste_row={title:panelsOptions.loc.contextual.row_paste}),_.isEmpty(i)||t.addSection("builder-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},i,function(e){switch(e){case"add_row":this.displayAddRowDialog();break;case"paste_row":this.pasteRowHandler()}}.bind(this))}})},{}],25:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-cell").html())),events:{"click .cell-wrapper":"handleCellClick"},row:null,widgetSortable:null,initialize:function(){this.listenTo(this.model.get("widgets"),"add",this.onAddWidget)},render:function(){var e={weight:this.model.get("weight"),totalWeight:this.row.model.get("cells").totalWeight()};this.setElement(this.template(e)),this.$el.data("view",this);var t=this;return this.model.get("widgets").each((function(e){var i=new s.view.widget({model:e});i.cell=t,i.render(),i.$el.appendTo(t.$(".widgets-container"))})),this.initSortable(),this.initResizable(),this},initSortable:function(){if(!this.row.builder.supports("moveWidget"))return this;var e=this,t=e.row.builder,i=t.$el.attr("id"),s=t.model;return this.widgetSortable=this.$(".widgets-container").sortable({placeholder:"so-widget-sortable-highlight",connectWith:"#"+i+" .so-cells .cell .widgets-container,.block-editor .so-cells .cell .widgets-container",tolerance:"pointer",scroll:!1,over:function(t,i){e.row.builder.trigger("widget_sortable_move")},remove:function(t,i){e.model.get("widgets").remove(l(i.item).data("view").model,{silent:!0}),s.refreshPanelsData()},receive:function(t,i){var o=l(i.item).data("view");o.cell=e;var n=o.model;n.cell=e.model,e.model.get("widgets").add(n,{silent:!0,at:l(i.item).index()}),s.refreshPanelsData()},stop:function(t,i){var o=l(i.item),n=o.data("view"),a=o.closest(".cell").data("view");e.model.get("widgets").get(n.model)&&(e.row.builder.addHistoryEntry("widget_moved"),n.model.moveToCell(a.model,{},o.index()),n.cell=a,s.refreshPanelsData())},helper:function(e,t){var i=t.clone().css({width:t.outerWidth(),"z-index":1e4,position:"fixed"}).addClass("widget-being-dragged").appendTo("body");return t.outerWidth()>720&&i.animate({"margin-left":e.pageX-t.offset().left-240,width:480},"fast"),i}}),this},refreshSortable:function(){_.isNull(this.widgetSortable)||this.widgetSortable.sortable("refresh")},initResizable:function(){if(!this.row.builder.supports("editRow"))return this;var e,t=this.$(".resize-handle").css("position","absolute"),i=this.row.$el,s=this;return t.draggable({axis:"x",containment:i,start:function(t,i){if(e=s.$el.prev().data("view"),!_.isUndefined(e)){var o=s.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:s.$el.outerWidth(),left:5,height:s.$el.outerHeight()});o.find(".resize-handle").remove();var n=e.$el.clone().appendTo(i.helper).css({position:"absolute",top:"0",width:e.$el.outerWidth(),right:5,height:e.$el.outerHeight()});n.find(".resize-handle").remove(),l(this).data({newCellClone:o,prevCellClone:n})}},drag:function(i,o){var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;l(this).data("newCellClone").css("width",n*a).find(".preview-cell-weight").html(Math.round(1e3*a)/10),l(this).data("prevCellClone").css("width",n*r).find(".preview-cell-weight").html(Math.round(1e3*r)/10)},stop:function(i,o){l(this).data("newCellClone").remove(),l(this).data("prevCellClone").remove();var n=s.row.$el.width()+10,a=s.model.get("weight")-(o.position.left+t.outerWidth()/2)/n,r=e.model.get("weight")+(o.position.left+t.outerWidth()/2)/n;a>.02&&r>.02&&(s.row.builder.addHistoryEntry("cell_resized"),s.model.set("weight",a),e.model.set("weight",r),s.row.resize()),o.helper.css("left",-t.outerWidth()/2),s.row.builder.model.refreshPanelsData()}}),this},onAddWidget:function(e,t,i){i=_.extend({noAnimate:!1},i);var l=new s.view.widget({model:e});l.cell=this,_.isUndefined(e.isDuplicate)&&(e.isDuplicate=!1),l.render({loadForm:e.isDuplicate}),_.isUndefined(i.at)||t.length<=1?l.$el.appendTo(this.$(".widgets-container")):l.$el.insertAfter(this.$(".widgets-container .so-widget").eq(i.at-1)),!1===i.noAnimate&&l.visualCreate(),this.refreshSortable(),this.row.resize(),this.row.builder.trigger("widget_added",l)},handleCellClick:function(e){this.row.builder.$el.find(".so-cells .cell").removeClass("cell-selected"),this.row.builder.activeCell!==this||this.model.get("widgets").length?(this.$el.addClass("cell-selected"),this.row.builder.activeCell=this):this.row.builder.activeCell=null},pasteHandler:function(){var e=s.helpers.clipboard.getModel("widget-model");!_.isEmpty(e)&&e instanceof s.model.widget&&(this.row.builder.addHistoryEntry("widget_pasted"),e.cell=this.model,this.model.get("widgets").add(e),this.row.builder.model.refreshPanelsData())},buildContextualMenu:function(e,t){var i=this;t.hasSection("add-widget-below")||t.addSection("add-widget-cell",{sectionTitle:panelsOptions.loc.contextual.add_widget_cell,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,(function(e){i.row.builder.trigger("before_user_adds_widget"),i.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=i.model,t.cell.get("widgets").add(t),i.row.builder.model.refreshPanelsData(),i.row.builder.trigger("after_user_adds_widget",t)}));var l={};this.row.builder.supports("addWidget")&&s.helpers.clipboard.isModel("widget-model")&&(l.paste={title:panelsOptions.loc.contextual.cell_paste_widget}),_.isEmpty(l)||t.addSection("cell-actions",{sectionTitle:panelsOptions.loc.contextual.cell_actions,search:!1},l,function(e){switch(e){case"paste":this.pasteHandler()}this.row.builder.model.refreshPanelsData()}.bind(this)),this.row.buildContextualMenu(e,t)}})},{}],26:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({dialogTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog").html())),dialogTabTemplate:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-dialog-tab").html())),tabbed:!1,rendered:!1,builder:!1,className:"so-panels-dialog-wrapper",dialogClass:"",dialogIcon:"",parentDialog:!1,dialogOpen:!1,editableLabel:!1,events:{"click .so-close":"closeDialog","click .so-nav.so-previous":"navToPrevious","click .so-nav.so-next":"navToNext"},initialize:function(){this.once("open_dialog",this.render),this.once("open_dialog",this.attach),this.once("open_dialog",this.setDialogClass),this.trigger("initialize_dialog",this),_.isUndefined(this.initializeDialog)||this.initializeDialog(),_.bindAll(this,"initSidebars","hasSidebar","onResize","toggleLeftSideBar","toggleRightSideBar")},getNextDialog:function(){return null},getPrevDialog:function(){return null},setDialogClass:function(){""!==this.dialogClass&&this.$(".so-panels-dialog").addClass(this.dialogClass)},setBuilder:function(e){return this.builder=e,e.trigger("add_dialog",this,this.builder),this},attach:function(){return this.$el.appendTo("body"),this},parseDialogContent:function(e,t){t=_.extend({cid:this.cid},t);var i=l(_.template(s.helpers.utils.processTemplate(e))(t)),o={title:i.find(".title").html(),buttons:i.find(".buttons").html(),content:i.find(".content").html()};return i.has(".left-sidebar")&&(o.left_sidebar=i.find(".left-sidebar").html()),i.has(".right-sidebar")&&(o.right_sidebar=i.find(".right-sidebar").html()),o},renderDialog:function(e){if(e=_.extend({editableLabel:this.editableLabel,dialogIcon:this.dialogIcon},e),this.$el.html(this.dialogTemplate(e)).hide(),this.$el.data("view",this),this.$el.addClass("so-panels-dialog-wrapper"),!1!==this.parentDialog){var t=l('<h3 class="so-parent-link"></h3>').html(this.parentDialog.text+'<div class="so-separator"></div>');t.click(function(e){e.preventDefault(),this.closeDialog(),this.parentDialog.dialog.openDialog()}.bind(this)),this.$(".so-title-bar .so-title").before(t)}return this.$(".so-title-bar .so-title-editable").length&&this.initEditableLabel(),setTimeout(this.initSidebars,1),this},initSidebars:function(){var e=this.$(".so-show-left-sidebar").hide(),t=this.$(".so-show-right-sidebar").hide(),i=this.hasSidebar("left"),s=this.hasSidebar("right");(i||s)&&(l(window).on("resize",this.onResize),i&&(e.show(),e.on("click",this.toggleLeftSideBar)),s&&(t.show(),t.on("click",this.toggleRightSideBar))),this.onResize()},initTabs:function(){var e=this.$(".so-sidebar-tabs li a");if(0===e.length)return this;var t=this;return e.click((function(e){e.preventDefault();var i=l(this);t.$(".so-sidebar-tabs li").removeClass("tab-active"),t.$(".so-content .so-content-tabs > *").hide(),i.parent().addClass("tab-active");var s=i.attr("href");if(!_.isUndefined(s)&&"#"===s.charAt(0)){var o=s.split("#")[1];t.$(".so-content .so-content-tabs .tab-"+o).show()}t.trigger("tab_click",i)})),this.$(".so-sidebar-tabs li a").first().click(),this},initToolbar:function(){this.$(".so-toolbar .so-buttons .so-toolbar-button").click(function(e){e.preventDefault(),this.trigger("button_click",l(e.currentTarget))}.bind(this)),this.$(".so-toolbar .so-buttons .so-dropdown-button").click(function(e){e.preventDefault();var t=l(e.currentTarget).siblings(".so-dropdown-links-wrapper");t.is(".hidden")?t.removeClass("hidden"):t.addClass("hidden")}.bind(this)),l("html").click(function(e){this.$(".so-dropdown-links-wrapper").not(".hidden").each((function(t,i){var s=l(i),o=l(e.target);0!==o.length&&(o.is(".so-needs-confirm")&&!o.is(".so-confirmed")||o.is(".so-dropdown-button"))||s.addClass("hidden")}))}.bind(this))},initEditableLabel:function(){var e=this.$(".so-title-bar .so-title-editable");e.keypress((function(t){var i="keypress"===t.type&&13===t.keyCode;if(i){var s=l(":tabbable"),o=s.index(e);s.eq(o+1).focus(),window.getSelection().removeAllRanges()}return!i})).blur(function(){var t=e.text().replace(/^\s+|\s+$/gm,"");t!==e.data("original-value").replace(/^\s+|\s+$/gm,"")&&(e.text(t),this.trigger("edit_label",t))}.bind(this)),e.focus((function(){e.data("original-value",e.text()),s.helpers.utils.selectElementContents(this)}))},setupDialog:function(){this.openDialog(),this.closeDialog()},refreshDialogNav:function(){this.$(".so-title-bar .so-nav").show().removeClass("so-disabled");var e=this.getNextDialog(),t=this.$(".so-title-bar .so-next"),i=this.getPrevDialog(),s=this.$(".so-title-bar .so-previous");null===e?t.hide():!1===e&&t.addClass("so-disabled"),null===i?s.hide():!1===i&&s.addClass("so-disabled")},openDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("open_dialog"),this.dialogOpen=!0,this.refreshDialogNav(),s.helpers.pageScroll.lock(),this.onResize(),this.$el.show(),e.silent||(this.trigger("open_dialog_complete"),this.builder.trigger("open_dialog",this),l(document).trigger("open_dialog",this))},closeDialog:function(e){(e=_.extend({silent:!1},e)).silent||this.trigger("close_dialog"),this.dialogOpen=!1,this.$el.hide(),s.helpers.pageScroll.unlock(),e.silent||(this.trigger("close_dialog_complete"),this.builder.trigger("close_dialog",this))},navToPrevious:function(){this.closeDialog();var e=this.getPrevDialog();null!==e&&!1!==e&&e.openDialog()},navToNext:function(){this.closeDialog();var e=this.getNextDialog();null!==e&&!1!==e&&e.openDialog()},getFormValues:function(e){_.isUndefined(e)&&(e=".so-content");var t,i=this.$(e),s={};return i.find("[name]").each((function(){var e=l(this);try{var i=/([A-Za-z_]+)\[(.*)\]/.exec(e.attr("name"));if(_.isEmpty(i))return!0;_.isUndefined(i[2])?t=e.attr("name"):(t=i[2].split("][")).unshift(i[1]),t=t.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var o=s,n=null,a=!!_.isString(e.attr("type"))&&e.attr("type").toLowerCase();if("checkbox"===a)n=e.is(":checked")?""===e.val()||e.val():null;else if("radio"===a){if(!e.is(":checked"))return;n=e.val()}else if("SELECT"===e.prop("tagName")){var r=e.find("option:selected");1===r.length?n=e.find("option:selected").val():r.length>1&&(n=_.map(e.find("option:selected"),(function(e,t){return l(e).val()})))}else n=e.val();if(!_.isUndefined(e.data("panels-filter")))switch(e.data("panels-filter")){case"json_parse":try{n=JSON.parse(n)}catch(e){n=""}}if(null!==n)for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?o.push(n):o[t[d]]=n:(_.isUndefined(o[t[d]])&&(""===t[d+1]?o[t[d]]=[]:o[t[d]]={}),o=o[t[d]])}catch(t){console.log("Field ["+e.attr("name")+"] could not be processed and was skipped - "+t.message)}})),s},setStatusMessage:function(e,t,i){var s=i?'<span class="dashicons dashicons-warning"></span>'+e:e;this.$(".so-toolbar .so-status").html(s),!_.isUndefined(t)&&t?this.$(".so-toolbar .so-status").addClass("so-panels-loading"):this.$(".so-toolbar .so-status").removeClass("so-panels-loading")},setParent:function(e,t){this.parentDialog={text:e,dialog:t}},onResize:function(){var e=window.matchMedia("(max-width: 980px)");["left","right"].forEach(function(t){var i=this.$(".so-"+t+"-sidebar"),s=this.$(".so-show-"+t+"-sidebar");this.hasSidebar(t)?(s.hide(),e.matches?(s.show(),s.closest(".so-title-bar").addClass("so-has-"+t+"-button"),i.hide(),i.closest(".so-panels-dialog").removeClass("so-panels-dialog-has-"+t+"-sidebar")):(s.hide(),s.closest(".so-title-bar").removeClass("so-has-"+t+"-button"),i.show(),i.closest(".so-panels-dialog").addClass("so-panels-dialog-has-"+t+"-sidebar"))):(i.hide(),s.hide())}.bind(this))},hasSidebar:function(e){return this.$(".so-"+e+"-sidebar").children().length>0},toggleLeftSideBar:function(){this.toggleSidebar("left")},toggleRightSideBar:function(){this.toggleSidebar("right")},toggleSidebar:function(e){var t=this.$(".so-"+e+"-sidebar");t.is(":visible")?t.hide():t.show()}})},{}],27:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-live-editor").html())),previewScrollTop:0,loadTimes:[],previewFrameId:1,previewUrl:null,previewIframe:null,events:{"click .live-editor-close":"close","click .live-editor-save":"closeAndSave","click .live-editor-collapse":"collapse","click .live-editor-mode":"mobileToggle"},initialize:function(e){e=_.extend({builder:!1,previewUrl:!1},e),_.isEmpty(e.previewUrl)&&(e.previewUrl=panelsOptions.ajaxurl+"&action=so_panels_live_editor_preview"),this.builder=e.builder,this.previewUrl=e.previewUrl,this.listenTo(this.builder.model,"refresh_panels_data",this.handleRefreshData),this.listenTo(this.builder.model,"load_panels_data",this.handleLoadData)},render:function(){if(this.setElement(this.template()),this.$el.hide(),l("#submitdiv #save-post").length>0){var e=this.$el.find(".live-editor-save");e.text(e.data("save"))}var t=!1;l(document).mousedown((function(){t=!0})).mouseup((function(){t=!1}));var i=this;return this.$el.on("mouseenter",".so-widget-wrapper",(function(){var e=l(this).data("live-editor-preview-widget");t||void 0===e||!e.length||i.$(".so-preview-overlay").is(":visible")||(i.highlightElement(e),i.scrollToElement(e))})),this.$el.on("mouseleave",".so-widget-wrapper",function(){this.resetHighlights()}.bind(this)),this.listenTo(this.builder,"open_dialog",(function(){this.resetHighlights()})),this},attach:function(){this.$el.appendTo("body")},open:function(){if(""===this.$el.html()&&this.render(),0===this.$el.closest("body").length&&this.attach(),s.helpers.pageScroll.lock(),this.$el.is(":visible"))return this;if(this.$el.show(),this.refreshPreview(this.builder.model.getPanelsData()),this.originalContainer=this.builder.$el.parent(),this.builder.$el.appendTo(this.$(".so-live-editor-builder")),this.builder.$(".so-tool-button.so-live-editor").hide(),this.builder.trigger("builder_resize"),"auto-draft"===l("#original_post_status").val()&&!this.autoSaved){var e=this;wp.autosave&&(""===l('#title[name="post_title"]').val()&&l('#title[name="post_title"]').val(panelsOptions.loc.draft).trigger("keydown"),l(document).one("heartbeat-tick.autosave",(function(){e.autoSaved=!0,e.refreshPreview(e.builder.model.getPanelsData())})),wp.autosave.server.triggerSave())}},close:function(){if(!this.$el.is(":visible"))return this;this.$el.hide(),s.helpers.pageScroll.unlock(),this.builder.$el.appendTo(this.originalContainer),this.builder.$(".so-tool-button.so-live-editor").show(),this.builder.trigger("builder_resize")},closeAndSave:function(){this.close(),l('#submitdiv input[type="submit"][name="save"]').click()},collapse:function(){this.$el.toggleClass("so-collapsed")},highlightElement:function(e){_.isUndefined(this.resetHighlightTimeout)||clearTimeout(this.resetHighlightTimeout),this.previewIframe.contents().find("body").find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return 0===l(this).parents(".so-panel").length})).not(e).addClass("so-panels-faded"),e.removeClass("so-panels-faded").addClass("so-panels-highlighted")},resetHighlights:function(){var e=this.previewIframe.contents().find("body");this.resetHighlightTimeout=setTimeout((function(){e.find(".panel-grid .panel-grid-cell .so-panel").removeClass("so-panels-faded so-panels-highlighted")}),100)},scrollToElement:function(e){this.$(".so-preview iframe")[0].contentWindow.liveEditorScrollTo(e)},handleRefreshData:function(e){if(!this.$el.is(":visible"))return this;this.refreshPreview(e)},handleLoadData:function(){if(!this.$el.is(":visible"))return this;this.refreshPreview(this.builder.model.getPanelsData())},refreshPreview:function(e){var t=this.loadTimes.length?_.reduce(this.loadTimes,(function(e,t){return e+t}),0)/this.loadTimes.length:1e3;_.isNull(this.previewIframe)||this.$(".so-preview-overlay").is(":visible")||(this.previewScrollTop=this.previewIframe.contents().scrollTop()),this.$(".so-preview-overlay").show(),this.$(".so-preview-overlay .so-loading-bar").clearQueue().css("width","0%").animate({width:"100%"},parseInt(t)+100),this.postToIframe({live_editor_panels_data:JSON.stringify(e),live_editor_post_ID:this.builder.config.postId},this.previewUrl,this.$(".so-preview")),this.previewIframe.data("load-start",(new Date).getTime())},postToIframe:function(e,t,i){_.isNull(this.previewIframe)||this.previewIframe.remove();var s="siteorigin-panels-live-preview-"+this.previewFrameId;this.previewIframe=l('<iframe src="'+t+'" />').attr({id:s,name:s}).appendTo(i),this.setupPreviewFrame(this.previewIframe);var o=l('<form id="soPostToPreviewFrame" method="post" />').attr({id:s,target:this.previewIframe.attr("id"),action:t}).appendTo("body");return l.each(e,(function(e,t){l('<input type="hidden" />').attr({name:e,value:t}).appendTo(o)})),o.submit().remove(),this.previewFrameId++,this.previewIframe},setupPreviewFrame:function(e){var t=this;e.data("iframeready",!1).on("iframeready",(function(){var e=l(this),i=e.contents();if(!e.data("iframeready")){e.data("iframeready",!0),void 0!==e.data("load-start")&&(t.loadTimes.unshift((new Date).getTime()-e.data("load-start")),_.isEmpty(t.loadTimes)||(t.loadTimes=t.loadTimes.slice(0,4))),l(".live-editor-mode.so-active").length&&(l(".so-panels-live-editor .so-preview iframe").css("transition","none"),t.mobileToggle()),setTimeout((function(){i.scrollTop(t.previewScrollTop),t.$(".so-preview-overlay").hide(),l(".so-panels-live-editor .so-preview iframe").css("transition","all .2s ease")}),100);var s=i.find("#pl-"+t.builder.config.postId);s.find(".panel-grid .panel-grid-cell .so-panel").filter((function(){return l(this).closest(".panel-layout").is(s)})).each((function(e,i){var s=l(i),o=t.$(".so-live-editor-builder .so-widget-wrapper").eq(s.data("index"));o.data("live-editor-preview-widget",s),s.css({cursor:"pointer"}).mouseenter((function(){o.parent().addClass("so-hovered"),t.highlightElement(s)})).mouseleave((function(){o.parent().removeClass("so-hovered"),t.resetHighlights()})).click((function(e){e.preventDefault(),o.find(".title h4").click()}))})),i.find("a").css({"pointer-events":"none"}).click((function(e){e.preventDefault()}))}})).on("load",(function(){var e=l(this);e.data("iframeready")||e.trigger("iframeready")}))},hasPreviewUrl:function(){return""!==this.$("form.live-editor-form").attr("action")},mobileToggle:function(e){var t=l(void 0!==e?e.currentTarget:".live-editor-mode.so-active");this.$(".live-editor-mode").not(t).removeClass("so-active"),t.addClass("so-active"),this.$el.removeClass("live-editor-desktop-mode live-editor-tablet-mode live-editor-mobile-mode").addClass("live-editor-"+t.data("mode")+"-mode").find("iframe").css("width",t.data("width"))}})},{}],28:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-row").html())),events:{"click .so-row-settings":"editSettingsHandler","click .so-row-duplicate":"duplicateHandler","click .so-row-delete":"confirmedDeleteHandler","click .so-row-color":"rowColorChangeHandler"},builder:null,dialog:null,initialize:function(){var e=this.model.get("cells");this.listenTo(e,"add",this.handleCellAdd),this.listenTo(e,"remove",this.handleCellRemove),this.listenTo(this.model,"reweight_cells",this.resize),this.listenTo(this.model,"destroy",this.onModelDestroy);var t=this;e.each((function(e){t.listenTo(e.get("widgets"),"add",t.resize)})),e.on("add",(function(e){t.listenTo(e.get("widgets"),"add",t.resize)}),this),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(){var e=this.model.has("color_label")?this.model.get("color_label"):1,t=this.model.has("label")?this.model.get("label"):"";this.setElement(this.template({rowColorLabel:e,rowLabel:t})),this.$el.data("view",this);var i=this;return this.model.get("cells").each((function(e){var t=new s.view.cell({model:e});t.row=i,t.render(),t.$el.appendTo(i.$(".so-cells"))})),this.builder.supports("rowAction")?(this.builder.supports("editRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-settings").parent().remove(),this.$el.addClass("so-row-no-edit")),this.builder.supports("addRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-duplicate").parent().remove(),this.$el.addClass("so-row-no-duplicate")),this.builder.supports("deleteRow")||(this.$(".so-row-toolbar .so-dropdown-links-wrapper .so-row-delete").parent().remove(),this.$el.addClass("so-row-no-delete"))):(this.$(".so-row-toolbar .so-dropdown-wrapper").remove(),this.$el.addClass("so-row-no-actions")),this.builder.supports("moveRow")||(this.$(".so-row-toolbar .so-row-move").remove(),this.$el.addClass("so-row-no-move")),l.trim(this.$(".so-row-toolbar").html()).length||this.$(".so-row-toolbar").remove(),this.listenTo(this.builder,"widget_sortable_move",this.resize),this.listenTo(this.builder,"builder_resize",this.resize),this.resize(),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},resize:function(e){if(this.$el.is(":visible")){this.$(".so-cells .cell-wrapper").css("min-height",0),this.$(".so-cells .resize-handle").css("height",0);var t=0;this.$(".so-cells .cell").each((function(){t=Math.max(t,l(this).height()),l(this).css("width",100*l(this).data("view").model.get("weight")+"%")})),this.$(".so-cells .cell-wrapper").css("min-height",Math.max(t,63)),this.$(".so-cells .resize-handle").css("height",this.$(".so-cells .cell-wrapper").outerHeight())}},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){this.builder.addHistoryEntry("row_deleted");var e=this;this.$el.fadeOut("normal",(function(){e.model.destroy(),e.builder.model.refreshPanelsData()}))},onLabelChange:function(e,t){0==this.$(".so-row-label").length?this.$(".so-row-toolbar").prepend('<h3 class="so-row-label">'+t+"</h3>"):this.$(".so-row-label").text(t)},duplicateHandler:function(){this.builder.addHistoryEntry("row_duplicated");var e=this.model.clone(this.builder.model);this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},pasteHandler:function(){var e=s.helpers.clipboard.getModel("row-model");!_.isEmpty(e)&&e instanceof s.model.row&&(this.builder.addHistoryEntry("row_pasted"),e.builder=this.builder.model,this.builder.model.get("rows").add(e,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData())},confirmedDeleteHandler:function(e){var t=l(e.target);if(t.hasClass("dashicons")&&(t=t.parent()),t.hasClass("so-confirmed"))this.visualDestroyModel();else{var i=t.html();t.addClass("so-confirmed").html('<span class="dashicons dashicons-yes"></span>'+panelsOptions.loc.dropdown_confirm),setTimeout((function(){t.removeClass("so-confirmed").html(i)}),2500)}},editSettingsHandler:function(){if(this.builder.supports("editRow"))return null===this.dialog&&(this.dialog=new s.dialog.row,this.dialog.setBuilder(this.builder).setRowModel(this.model),this.dialog.rowView=this),this.dialog.openDialog(),this},deleteHandler:function(){return this.model.destroy(),this},rowColorChangeHandler:function(e){this.$(".so-row-color").removeClass("so-row-color-selected");var t=l(e.target),i=t.data("color-label"),s=this.model.has("color_label")?this.model.get("color_label"):1;t.addClass("so-row-color-selected"),this.$el.removeClass("so-row-color-"+s),this.$el.addClass("so-row-color-"+i),this.model.set("color_label",i)},handleCellAdd:function(e){var t=new s.view.cell({model:e});t.row=this,t.render(),t.$el.appendTo(this.$(".so-cells"))},handleCellRemove:function(e){this.$(".so-cells > .cell").each((function(){var t=l(this).data("view");_.isUndefined(t)||t.model.cid===e.cid&&t.remove()}))},buildContextualMenu:function(e,t){for(var i=[],l=1;l<5;l++)i.push({title:l+" "+panelsOptions.loc.contextual.column});this.builder.supports("addRow")&&t.addSection("add-row",{sectionTitle:panelsOptions.loc.contextual.add_row,search:!1},i,function(e){this.builder.addHistoryEntry("row_added");for(var t=Number(e)+1,i=[],l=0;l<t;l++)i.push({weight:100/t});var o=new s.model.row({collection:this.collection}),n=new s.collection.cells(i);n.each((function(e){e.row=o})),o.setCells(n),o.builder=this.builder.model,this.builder.model.get("rows").add(o,{at:this.builder.model.get("rows").indexOf(this.model)+1}),this.builder.model.refreshPanelsData()}.bind(this));var o={};this.builder.supports("editRow")&&(o.edit={title:panelsOptions.loc.contextual.row_edit}),s.helpers.clipboard.canCopyPaste()&&(o.copy={title:panelsOptions.loc.contextual.row_copy},this.builder.supports("addRow")&&s.helpers.clipboard.isModel("row-model")&&(o.paste={title:panelsOptions.loc.contextual.row_paste})),this.builder.supports("addRow")&&(o.duplicate={title:panelsOptions.loc.contextual.row_duplicate}),this.builder.supports("deleteRow")&&(o.delete={title:panelsOptions.loc.contextual.row_delete,confirm:!0}),_.isEmpty(o)||t.addSection("row-actions",{sectionTitle:panelsOptions.loc.contextual.row_actions,search:!1},o,function(e){switch(e){case"edit":this.editSettingsHandler();break;case"copy":this.copyHandler();break;case"paste":this.pasteHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this))}})},{}],29:[function(e,t,i){window.panels;var s=jQuery;t.exports=Backbone.View.extend({stylesLoaded:!1,initialize:function(){},render:function(e,t,i){if(!_.isUndefined(e)){i=_.extend({builderType:"",dialog:null},i),this.$el.addClass("so-visual-styles so-"+e+"-styles so-panels-loading");var l={builderType:i.builderType};return"cell"===e&&(l.index=i.index),s.post(panelsOptions.ajaxurl,{action:"so_panels_style_form",type:e,style:this.model.get("style"),args:JSON.stringify(l),postId:t},null,"html").done(function(e){this.$el.html(e),this.setupFields(),this.stylesLoaded=!0,this.trigger("styles_loaded",!_.isEmpty(e)),_.isNull(i.dialog)||i.dialog.trigger("styles_loaded",!_.isEmpty(e))}.bind(this)).fail(function(e){var t;t=e&&e.responseText?e.responseText:panelsOptions.forms.loadingFailed,this.$el.html(t)}.bind(this)).always(function(){this.$el.removeClass("so-panels-loading")}.bind(this)),this}},attach:function(e){e.append(this.$el)},detach:function(){this.$el.detach()},setupFields:function(){this.$(".style-section-wrapper").each((function(){var e=s(this);e.find(".style-section-head").click((function(t){t.preventDefault(),e.find(".style-section-fields").slideToggle("fast")}))})),_.isUndefined(s.fn.wpColorPicker)||(_.isObject(panelsOptions.wpColorPickerOptions.palettes)&&!s.isArray(panelsOptions.wpColorPickerOptions.palettes)&&(panelsOptions.wpColorPickerOptions.palettes=s.map(panelsOptions.wpColorPickerOptions.palettes,(function(e){return e}))),this.$(".so-wp-color-field").wpColorPicker(panelsOptions.wpColorPickerOptions)),this.$(".style-field-image").each((function(){var e=null,t=s(this);t.find(".so-image-selector").click((function(i){i.preventDefault(),null===e&&(e=wp.media({title:"choose",library:{type:"image"},button:{text:"Done",close:!0}})).on("select",(function(){var i=e.state().get("selection").first().attributes,s=i.url;if(!_.isUndefined(i.sizes))try{s=i.sizes.thumbnail.url}catch(e){s=i.sizes.full.url}t.find(".current-image").css("background-image","url("+s+")"),t.find(".so-image-selector > input").val(i.id),t.find(".remove-image").removeClass("hidden")})),e.open()})),t.find(".remove-image").click((function(e){e.preventDefault(),t.find(".current-image").css("background-image","none"),t.find(".so-image-selector > input").val(""),t.find(".remove-image").addClass("hidden")}))})),this.$(".style-field-measurement").each((function(){var e=s(this),t=e.find('input[type="text"]'),i=e.find("select"),l=e.find('input[type="hidden"]');t.focus((function(){s(this).select()}));!function(e){if(""!==e){var o=/(?:([0-9\.,\-]+)(.*))+/,n=l.val().split(" "),a=[];for(var r in n){var d=o.exec(n[r]);_.isNull(d)||_.isUndefined(d[1])||_.isUndefined(d[2])||(a.push(d[1]),i.val(d[2]))}1===t.length?t.val(a.join(" ")):(1===a.length?a=[a[0],a[0],a[0],a[0]]:2===a.length?a=[a[0],a[1],a[0],a[1]]:3===a.length&&(a=[a[0],a[1],a[2],a[1]]),t.each((function(e,t){s(t).val(a[e])})))}}(l.val());var o=function(e){if(1===t.length){var o=t.val().split(" ").filter((function(e){return""!==e})).map((function(e){return e+i.val()})).join(" ");l.val(o)}else{var n=s(e.target),a=[],r=[],d=[];t.each((function(e,t){var i=""!==s(t).val()?parseFloat(s(t).val()):null;a.push(i),null===i?r.push(e):d.push(e)})),3===r.length&&d[0]===t.index(n)&&(t.val(n.val()),a=[n.val(),n.val(),n.val(),n.val()]),JSON.stringify(a)===JSON.stringify([null,null,null,null])?l.val(""):l.val(a.map((function(e){return(null===e?0:e)+i.val()})).join(" "))}};t.change(o),i.change(o)}))}})},{}],30:[function(e,t,i){var s=window.panels,l=jQuery;t.exports=Backbone.View.extend({template:_.template(s.helpers.utils.processTemplate(l("#siteorigin-panels-builder-widget").html())),cell:null,dialog:null,events:{"click .widget-edit":"editHandler","touchend .widget-edit":"editHandler","click .title h4":"editHandler","touchend .title h4":"editHandler","click .actions .widget-duplicate":"duplicateHandler","click .actions .widget-delete":"deleteHandler"},initialize:function(){this.listenTo(this.model,"destroy",this.onModelDestroy),this.listenTo(this.model,"change:values",this.onModelChange),this.listenTo(this.model,"change:label",this.onLabelChange)},render:function(e){if(e=_.extend({loadForm:!1},e),this.setElement(this.template({title:this.model.getWidgetField("title"),description:this.model.getTitle(),widget_class:this.model.attributes.class})),this.$el.data("view",this),this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")||(this.$(".actions .widget-edit").remove(),this.$el.addClass("so-widget-no-edit")),this.cell.row.builder.supports("addWidget")||(this.$(".actions .widget-duplicate").remove(),this.$el.addClass("so-widget-no-duplicate")),this.cell.row.builder.supports("deleteWidget")||(this.$(".actions .widget-delete").remove(),this.$el.addClass("so-widget-no-delete")),this.cell.row.builder.supports("moveWidget")||this.$el.addClass("so-widget-no-move"),l.trim(this.$(".actions").html()).length||this.$(".actions").remove(),this.model.get("read_only")&&this.$el.addClass("so-widget-read-only"),0===_.size(this.model.get("values"))||e.loadForm){var t=this.getEditDialog();t.once("form_loaded",t.saveWidget,t),t.setupDialog()}return this.listenTo(this.cell.row.builder,"after_user_adds_widget",this.afterUserAddsWidgetHandler),this},visualCreate:function(){this.$el.hide().fadeIn("fast")},getEditDialog:function(){return null===this.dialog&&(this.dialog=new s.dialog.widget({model:this.model}),this.dialog.setBuilder(this.cell.row.builder),this.dialog.widgetView=this),this.dialog},editHandler:function(){return!this.cell.row.builder.supports("editWidget")||this.model.get("read_only")?this:(this.getEditDialog().openDialog(),this)},duplicateHandler:function(){this.cell.row.builder.addHistoryEntry("widget_duplicated");var e=this.model.clone(this.model.cell);return this.cell.model.get("widgets").add(e,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this},copyHandler:function(){s.helpers.clipboard.setModel(this.model)},deleteHandler:function(){return this.visualDestroyModel(),this},onModelChange:function(){this.$(".description").html(this.model.getTitle())},onLabelChange:function(e){this.$(".title > h4").text(e.getWidgetField("title"))},onModelDestroy:function(){this.remove()},visualDestroyModel:function(){return this.cell.row.builder.addHistoryEntry("widget_deleted"),this.$el.fadeOut("fast",function(){this.cell.row.resize(),this.model.destroy(),this.cell.row.builder.model.refreshPanelsData(),this.remove()}.bind(this)),this},buildContextualMenu:function(e,t){this.cell.row.builder.supports("addWidget")&&t.addSection("add-widget-below",{sectionTitle:panelsOptions.loc.contextual.add_widget_below,searchPlaceholder:panelsOptions.loc.contextual.search_widgets,defaultDisplay:panelsOptions.contextual.default_widgets},panelsOptions.widgets,function(e){this.cell.row.builder.trigger("before_user_adds_widget"),this.cell.row.builder.addHistoryEntry("widget_added");var t=new s.model.widget({class:e});t.cell=this.cell.model,this.cell.model.get("widgets").add(t,{at:this.model.collection.indexOf(this.model)+1}),this.cell.row.builder.model.refreshPanelsData(),this.cell.row.builder.trigger("after_user_adds_widget",t)}.bind(this));var i={};this.cell.row.builder.supports("editWidget")&&!this.model.get("read_only")&&(i.edit={title:panelsOptions.loc.contextual.widget_edit}),s.helpers.clipboard.canCopyPaste()&&(i.copy={title:panelsOptions.loc.contextual.widget_copy}),this.cell.row.builder.supports("addWidget")&&(i.duplicate={title:panelsOptions.loc.contextual.widget_duplicate}),this.cell.row.builder.supports("deleteWidget")&&(i.delete={title:panelsOptions.loc.contextual.widget_delete,confirm:!0}),_.isEmpty(i)||t.addSection("widget-actions",{sectionTitle:panelsOptions.loc.contextual.widget_actions,search:!1},i,function(e){switch(e){case"edit":this.editHandler();break;case"copy":this.copyHandler();break;case"duplicate":this.duplicateHandler();break;case"delete":this.visualDestroyModel()}}.bind(this)),this.cell.buildContextualMenu(e,t)},afterUserAddsWidgetHandler:function(e){this.model===e&&panelsOptions.instant_open&&setTimeout(this.editHandler.bind(this),350)}})},{}],31:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.customHtmlWidgets,o=s("<div></div>"),n=t.find(".widget-content:first");n.before(o);var a=new l.CustomHtmlWidgetControl({el:o,syncContainer:n});return a.initializeEditor(),a.editor.codemirror.refresh(),a}};t.exports=l},{}],32:[function(e,t,i){var s=e("./custom-html-widget"),l=e("./media-widget"),o=e("./text-widget"),n={CUSTOM_HTML:"custom_html",MEDIA_AUDIO:"media_audio",MEDIA_GALLERY:"media_gallery",MEDIA_IMAGE:"media_image",MEDIA_VIDEO:"media_video",TEXT:"text",addWidget:function(e,t){var i,n=e.find("> .id_base").val();switch(n){case this.CUSTOM_HTML:i=s;break;case this.MEDIA_AUDIO:case this.MEDIA_GALLERY:case this.MEDIA_IMAGE:case this.MEDIA_VIDEO:i=l;break;case this.TEXT:i=o}i.addWidget(n,e,t)}};t.exports=n},{"./custom-html-widget":31,"./media-widget":33,"./text-widget":34}],33:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.mediaWidgets,o=l.controlConstructors[e];if(o){var n=l.modelConstructors[e]||l.MediaWidgetModel,a=t.find("> .widget-content"),r=s('<div class="media-widget-control"></div>');a.before(r);var d={};a.find(".media-widget-instance-property").each((function(){var e=s(this);d[e.data("property")]=e.val()})),d.widget_id=i;var h=new o({el:r,syncContainer:a,model:new n(d)});return h.render(),h}}};t.exports=l},{}],34:[function(e,t,i){var s=jQuery,l={addWidget:function(e,t,i){var l=wp.textWidgets,o={},n=t.find(".visual");if(n.length>0){if(!n.val())return null;var a=s("<div></div>"),r=t.find(".widget-content:first");r.before(a),o={el:a,syncContainer:r}}else o={el:t};var d=new l.TextWidgetControl(o),h=wp.oldEditor?wp.oldEditor:wp.editor;return h&&h.hasOwnProperty("autop")&&(wp.editor.autop=h.autop,wp.editor.removep=h.removep,wp.editor.initialize=h.initialize),d.initializeEditor(),d}};t.exports=l},{}]},{},[17]);
js/styling.js CHANGED
@@ -2,13 +2,13 @@
2
 
3
  jQuery( function ( $ ) {
4
 
5
- var fullContainer = $( panelsStyles.fullContainer );
6
- if ( fullContainer.length === 0 ) {
7
- fullContainer = $( 'body' );
8
- }
9
-
10
  // Stretch all the full width rows
11
  var stretchFullWidthRows = function () {
 
 
 
 
 
12
  var $panelsRow = $( '.siteorigin-panels-stretch.panel-row-style' );
13
  $panelsRow.each( function () {
14
  var $$ = $( this );
2
 
3
  jQuery( function ( $ ) {
4
 
 
 
 
 
 
5
  // Stretch all the full width rows
6
  var stretchFullWidthRows = function () {
7
+ var fullContainer = $( panelsStyles.fullContainer );
8
+ if ( fullContainer.length === 0 ) {
9
+ fullContainer = $( 'body' );
10
+ }
11
+
12
  var $panelsRow = $( '.siteorigin-panels-stretch.panel-row-style' );
13
  $panelsRow.each( function () {
14
  var $$ = $( this );
js/styling.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function(e){var t=e(panelsStyles.fullContainer);0===t.length&&(t=e("body"));var r=function(){var r=e(".siteorigin-panels-stretch.panel-row-style");r.each((function(){var r=e(this),i=r.data("stretch-type"),n="full-stretched-padded"===i?"":0;r.css({"margin-left":0,"margin-right":0,"padding-left":n,"padding-right":n});var l=r.offset().left-t.offset().left,a=t.outerWidth()-l-r.parent().outerWidth();r.css({"margin-left":-l,"margin-right":-a,"padding-left":"full"===i?l:n,"padding-right":"full"===i?a:n});var d=r.find("> .panel-grid-cell");"full-stretched"===i&&1===d.length&&d.css({"padding-left":0,"padding-right":0}),r.css({"border-left":n,"border-right":n})})),r.length&&e(window).trigger("panelsStretchRows")};e(window).on("resize load",r),r(),e("body").removeClass("siteorigin-panels-before-js")}));
1
+ jQuery((function(e){var t=function(){var t=e(panelsStyles.fullContainer);0===t.length&&(t=e("body"));var r=e(".siteorigin-panels-stretch.panel-row-style");r.each((function(){var r=e(this),i=r.data("stretch-type"),n="full-stretched-padded"===i?"":0;r.css({"margin-left":0,"margin-right":0,"padding-left":n,"padding-right":n});var l=r.offset().left-t.offset().left,a=t.outerWidth()-l-r.parent().outerWidth();r.css({"margin-left":-l,"margin-right":-a,"padding-left":"full"===i?l:n,"padding-right":"full"===i?a:n});var d=r.find("> .panel-grid-cell");"full-stretched"===i&&1===d.length&&d.css({"padding-left":0,"padding-right":0}),r.css({"border-left":n,"border-right":n})})),r.length&&e(window).trigger("panelsStretchRows")};e(window).on("resize load",t),t(),e("body").removeClass("siteorigin-panels-before-js")}));
lang/siteorigin-panels.pot CHANGED
@@ -36,19 +36,19 @@ msgstr ""
36
  msgid "https://siteorigin.com"
37
  msgstr ""
38
 
39
- #: siteorigin-panels.php:348
40
  msgid "Read More"
41
  msgstr ""
42
 
43
- #: siteorigin-panels.php:496
44
  msgid "Edit Home Page"
45
  msgstr ""
46
 
47
- #: siteorigin-panels.php:516, tpl/js-templates.php:34, tpl/js-templates.php:36
48
  msgid "Live Editor"
49
  msgstr ""
50
 
51
- #: compat/layout-block.php:89
52
  msgid "You need to add a widget, row, or prebuilt layout before you'll see anything here. :)"
53
  msgstr ""
54
 
@@ -141,7 +141,7 @@ msgstr ""
141
  msgid "WordPress Widgets"
142
  msgstr ""
143
 
144
- #: inc/admin-widget-dialog.php:185, inc/settings.php:357
145
  msgid "Recommended Widgets"
146
  msgstr ""
147
 
@@ -157,7 +157,7 @@ msgstr ""
157
  msgid "Addons"
158
  msgstr ""
159
 
160
- #: inc/admin.php:179, inc/admin.php:585, inc/admin.php:1237, inc/admin.php:1242, inc/settings.php:200, tpl/js-templates.php:197
161
  msgid "Page Builder"
162
  msgstr ""
163
 
@@ -455,69 +455,69 @@ msgid "Unknown error. Failed to load the form. Please check your internet connec
455
  msgstr ""
456
 
457
  #. translators: This is the default name given to a user's home page
458
- #: inc/admin.php:668, inc/home.php:26
459
  msgid "Home Page"
460
  msgstr ""
461
 
462
- #: inc/admin.php:769
463
  msgid "Untitled Widget"
464
  msgstr ""
465
 
466
- #: inc/admin.php:949
467
  msgid "You need to install 1{%1$s} to use the widget 2{%2$s}."
468
  msgstr ""
469
 
470
- #: inc/admin.php:955
471
  msgid "Save and reload this page to start using the widget after you've installed it."
472
  msgstr ""
473
 
474
- #: inc/admin.php:971
475
  msgid "The widget 1{%1$s} is not available. Please try locate and install the missing plugin. Post on the 2{support forums} if you need help."
476
  msgstr ""
477
 
478
- #: inc/admin.php:1140, inc/styles-admin.php:23
479
  msgid "The supplied nonce is invalid."
480
  msgstr ""
481
 
482
- #: inc/admin.php:1141, inc/styles-admin.php:24
483
  msgid "Invalid nonce."
484
  msgstr ""
485
 
486
- #: inc/admin.php:1147
487
  msgid "Please specify the type of widget form to be rendered."
488
  msgstr ""
489
 
490
- #: inc/admin.php:1148
491
  msgid "Missing widget type."
492
  msgstr ""
493
 
494
- #: inc/admin.php:1255
495
  msgid "%s Widget"
496
  msgid_plural "%s Widgets"
497
  msgstr[0] ""
498
  msgstr[1] ""
499
 
500
- #: inc/admin.php:1298
501
  msgid "Get a lightbox addon for SiteOrigin widgets"
502
  msgstr ""
503
 
504
- #: inc/admin.php:1302
505
  msgid "Get the row, cell and widget animations addon"
506
  msgstr ""
507
 
508
- #: inc/admin.php:1306
509
  msgid "Get premium email support for SiteOrigin Page Builder"
510
  msgstr ""
511
 
512
- #: inc/admin.php:1491
513
  msgid "Toggle editor selection menu"
514
  msgstr ""
515
 
516
- #: inc/admin.php:1492, inc/admin.php:1539, inc/settings.php:200, settings/tpl/settings.php:9
517
  msgid "SiteOrigin Page Builder"
518
  msgstr ""
519
 
520
- #: inc/admin.php:1493
521
  msgid "Block Editor"
522
  msgstr ""
523
 
@@ -529,259 +529,267 @@ msgstr ""
529
  msgid "Page Builder Content"
530
  msgstr ""
531
 
532
- #: inc/settings.php:227
533
  msgid "Page Builder Settings"
534
  msgstr ""
535
 
536
- #: inc/settings.php:243
537
  msgid "General"
538
  msgstr ""
539
 
540
- #: inc/settings.php:249
541
  msgid "Post Types"
542
  msgstr ""
543
 
544
- #: inc/settings.php:251
545
  msgid "The post types on which to use Page Builder."
546
  msgstr ""
547
 
548
- #: inc/settings.php:256
549
- msgid "Use Classic Editor for new posts"
550
  msgstr ""
551
 
552
- #: inc/settings.php:257
553
  msgid "New posts of the above Post Types will be created using the Classic Editor."
554
  msgstr ""
555
 
556
- #: inc/settings.php:262
557
  msgid "Live Editor Quick Link"
558
  msgstr ""
559
 
560
- #: inc/settings.php:263
561
  msgid "Display a Live Editor button in the admin bar."
562
  msgstr ""
563
 
564
- #: inc/settings.php:268
565
  msgid "Display Post State"
566
  msgstr ""
567
 
568
- #: inc/settings.php:270
569
  msgid "Display a %sSiteOrigin Page Builder%s post state in the admin lists of posts/pages to indicate Page Builder is active."
570
  msgstr ""
571
 
572
- #: inc/settings.php:278
573
  msgid "Display Widget Count"
574
  msgstr ""
575
 
576
- #: inc/settings.php:279
577
  msgid "Display a widget count in the admin lists of posts/pages where you're using Page Builder."
578
  msgstr ""
579
 
580
- #: inc/settings.php:284
581
  msgid "Limit Parallax Motion"
582
  msgstr ""
583
 
584
- #: inc/settings.php:285
585
  msgid "How many pixels of scrolling result in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect."
586
  msgstr ""
587
 
588
- #: inc/settings.php:290
589
  msgid "Disable Parallax On Mobile"
590
  msgstr ""
591
 
592
- #: inc/settings.php:291
593
  msgid "Disable row/widget background parallax when the browser is smaller than the mobile width."
594
  msgstr ""
595
 
596
- #: inc/settings.php:296
597
  msgid "Sidebars Emulator"
598
  msgstr ""
599
 
600
- #: inc/settings.php:297
601
  msgid "Page Builder will create an emulated sidebar, that contains all widgets in the page."
602
  msgstr ""
603
 
604
- #: inc/settings.php:302
605
  msgid "Upgrade Teaser"
606
  msgstr ""
607
 
608
- #: inc/settings.php:304
609
  msgid "Display the %sSiteOrigin Premium%s upgrade teaser in the Page Builder toolbar."
610
  msgstr ""
611
 
612
- #: inc/settings.php:312
613
  msgid "Default To Page Builder Interface"
614
  msgstr ""
615
 
616
- #: inc/settings.php:314
617
  msgid "New Classic Editor posts/pages that you create will start with the Page Builder loaded. The %s\"Use Classic Editor for new posts\"%s setting must be enabled."
618
  msgstr ""
619
 
620
- #: inc/settings.php:321
621
  msgid "Layout Block Default Mode"
622
  msgstr ""
623
 
624
- #: inc/settings.php:324, tpl/js-templates.php:141
625
  msgid "Edit"
626
  msgstr ""
627
 
628
- #: inc/settings.php:325
629
  msgid "Preview"
630
  msgstr ""
631
 
632
- #: inc/settings.php:327
633
  msgid "Whether to display layout blocks in edit mode or preview mode in the block editor."
634
  msgstr ""
635
 
636
- #: inc/settings.php:333
637
  msgid "Widgets"
638
  msgstr ""
639
 
640
- #: inc/settings.php:339
641
  msgid "Widget Title HTML"
642
  msgstr ""
643
 
644
- #: inc/settings.php:340
645
  msgid "The HTML used for widget titles. {{title}} is replaced with the widget title."
646
  msgstr ""
647
 
648
- #: inc/settings.php:345
649
  msgid "Add Widget Class"
650
  msgstr ""
651
 
652
- #: inc/settings.php:346
653
  msgid "Add the widget class to Page Builder widgets. Disable this if you're experiencing conflicts."
654
  msgstr ""
655
 
656
- #: inc/settings.php:351
657
  msgid "Legacy Bundled Widgets"
658
  msgstr ""
659
 
660
- #: inc/settings.php:352
661
  msgid "Load legacy widgets from Page Builder 1."
662
  msgstr ""
663
 
664
- #: inc/settings.php:358
665
  msgid "Display recommend widgets in Page Builder add widget dialog."
666
  msgstr ""
667
 
668
- #: inc/settings.php:363
669
  msgid "Instant Open Widgets"
670
  msgstr ""
671
 
672
- #: inc/settings.php:364
673
  msgid "Open a widget form as soon as its added to a page."
674
  msgstr ""
675
 
676
- #: inc/settings.php:370, inc/styles-admin.php:88
677
  msgid "Layout"
678
  msgstr ""
679
 
680
- #: inc/settings.php:378
681
  msgid "Responsive Layout"
682
  msgstr ""
683
 
684
- #: inc/settings.php:379
685
  msgid "Collapse widgets, rows and columns on mobile devices."
686
  msgstr ""
687
 
688
- #: inc/settings.php:384
689
  msgid "Use Tablet Layout"
690
  msgstr ""
691
 
692
- #: inc/settings.php:385
693
  msgid "Collapses columns differently on tablet devices."
694
  msgstr ""
695
 
696
- #: inc/settings.php:391
697
  msgid "Detect older browsers"
698
  msgstr ""
699
 
700
- #: inc/settings.php:392
701
  msgid "Never"
702
  msgstr ""
703
 
704
- #: inc/settings.php:393
705
  msgid "Always"
706
  msgstr ""
707
 
708
- #: inc/settings.php:395
709
  msgid "Use Legacy Layout Engine"
710
  msgstr ""
711
 
712
- #: inc/settings.php:396
713
  msgid "The CSS and HTML uses floats instead of flexbox for compatibility with very old browsers."
714
  msgstr ""
715
 
716
- #: inc/settings.php:402
717
  msgid "Tablet Width"
718
  msgstr ""
719
 
720
- #: inc/settings.php:403
721
  msgid "Device width, in pixels, to collapse into a tablet view ."
722
  msgstr ""
723
 
724
- #: inc/settings.php:409
725
  msgid "Mobile Width"
726
  msgstr ""
727
 
728
- #: inc/settings.php:410
729
  msgid "Device width, in pixels, to collapse into a mobile view ."
730
  msgstr ""
731
 
732
- #: inc/settings.php:416
733
  msgid "Row/Widget Bottom Margin"
734
  msgstr ""
735
 
736
- #: inc/settings.php:417
737
  msgid "Default margin below rows and widgets."
738
  msgstr ""
739
 
740
- #: inc/settings.php:422
 
 
 
 
 
 
 
 
741
  msgid "Last Row With Margin"
742
  msgstr ""
743
 
744
- #: inc/settings.php:423
745
  msgid "Allow margin in last row."
746
  msgstr ""
747
 
748
- #: inc/settings.php:429
749
  msgid "Row Gutter"
750
  msgstr ""
751
 
752
- #: inc/settings.php:430
753
  msgid "Default spacing between columns in each row."
754
  msgstr ""
755
 
756
- #: inc/settings.php:436
757
  msgid "Full Width Container"
758
  msgstr ""
759
 
760
- #: inc/settings.php:437
761
  msgid "The container used for the full width layout."
762
  msgstr ""
763
 
764
- #: inc/settings.php:444
765
  msgid "Content"
766
  msgstr ""
767
 
768
- #: inc/settings.php:450
769
  msgid "Copy Content"
770
  msgstr ""
771
 
772
- #: inc/settings.php:451
773
  msgid "Copy content from Page Builder to post content."
774
  msgstr ""
775
 
776
- #: inc/settings.php:456
777
  msgid "Copy Styles"
778
  msgstr ""
779
 
780
- #: inc/settings.php:457
781
  msgid "Include styles into your Post Content. This keeps page layouts, even when Page Builder is deactivated."
782
  msgstr ""
783
 
784
- #: inc/settings.php:510, inc/styles-admin.php:273
785
  msgid "Enabled"
786
  msgstr ""
787
 
@@ -1013,7 +1021,7 @@ msgstr ""
1013
  msgid "Collapse Order"
1014
  msgstr ""
1015
 
1016
- #: inc/styles.php:250, widgets/widgets.php:635, widgets/widgets.php:757, inc/widgets/post-loop.php:344
1017
  msgid "Default"
1018
  msgstr ""
1019
 
@@ -1329,83 +1337,83 @@ msgstr ""
1329
  msgid "%s Style"
1330
  msgstr ""
1331
 
1332
- #: widgets/widgets.php:594, inc/widgets/post-loop.php:302
1333
  msgid "Post Type"
1334
  msgstr ""
1335
 
1336
- #: widgets/widgets.php:601, inc/widgets/post-loop.php:311
1337
  msgid "Posts Per Page"
1338
  msgstr ""
1339
 
1340
- #: widgets/widgets.php:606, inc/widgets/post-loop.php:316
1341
  msgid "Order By"
1342
  msgstr ""
1343
 
1344
- #: widgets/widgets.php:608, widgets/widgets.php:783, inc/widgets/post-content.php:60, inc/widgets/post-loop.php:318
1345
  msgid "None"
1346
  msgstr ""
1347
 
1348
- #: widgets/widgets.php:609, inc/widgets/post-loop.php:319
1349
  msgid "Post ID"
1350
  msgstr ""
1351
 
1352
- #: widgets/widgets.php:610, inc/widgets/post-loop.php:320
1353
  msgid "Author"
1354
  msgstr ""
1355
 
1356
- #: widgets/widgets.php:611, widgets/widgets.php:612, inc/widgets/post-loop.php:321, inc/widgets/post-loop.php:322, widgets/widgets/testimonial/testimonial.php:15
1357
  msgid "Name"
1358
  msgstr ""
1359
 
1360
- #: widgets/widgets.php:613, inc/widgets/post-loop.php:323
1361
  msgid "Date"
1362
  msgstr ""
1363
 
1364
- #: widgets/widgets.php:614, inc/widgets/post-loop.php:324
1365
  msgid "Modified"
1366
  msgstr ""
1367
 
1368
- #: widgets/widgets.php:615, inc/widgets/post-loop.php:325
1369
  msgid "Parent"
1370
  msgstr ""
1371
 
1372
- #: widgets/widgets.php:616, inc/widgets/post-loop.php:326
1373
  msgid "Random"
1374
  msgstr ""
1375
 
1376
- #: widgets/widgets.php:617, inc/widgets/post-loop.php:327
1377
  msgid "Comment Count"
1378
  msgstr ""
1379
 
1380
- #: widgets/widgets.php:618, inc/widgets/post-loop.php:328
1381
  msgid "Menu Order"
1382
  msgstr ""
1383
 
1384
- #: widgets/widgets.php:624, inc/widgets/post-loop.php:334
1385
  msgid "Order"
1386
  msgstr ""
1387
 
1388
- #: widgets/widgets.php:626, inc/widgets/post-loop.php:337
1389
  msgid "Ascending"
1390
  msgstr ""
1391
 
1392
- #: widgets/widgets.php:627, inc/widgets/post-loop.php:336
1393
  msgid "Descending"
1394
  msgstr ""
1395
 
1396
- #: widgets/widgets.php:633, inc/widgets/post-loop.php:342
1397
  msgid "Sticky Posts"
1398
  msgstr ""
1399
 
1400
- #: widgets/widgets.php:636, inc/widgets/post-loop.php:345
1401
  msgid "Ignore Sticky"
1402
  msgstr ""
1403
 
1404
- #: widgets/widgets.php:637, inc/widgets/post-loop.php:346
1405
  msgid "Exclude Sticky"
1406
  msgstr ""
1407
 
1408
- #: widgets/widgets.php:638, inc/widgets/post-loop.php:347
1409
  msgid "Only Sticky"
1410
  msgstr ""
1411
 
@@ -1413,7 +1421,7 @@ msgstr ""
1413
  msgid "Additional Arguments"
1414
  msgstr ""
1415
 
1416
- #: widgets/widgets.php:648, inc/widgets/post-loop.php:359
1417
  msgid "Additional query arguments. See 1{query_posts}."
1418
  msgstr ""
1419
 
@@ -1602,7 +1610,7 @@ msgstr ""
1602
  msgid "Displays content from the current post."
1603
  msgstr ""
1604
 
1605
- #: inc/widgets/post-content.php:61, inc/widgets/post-loop-helper.php:41, inc/widgets/post-loop.php:265, widgets/widgets/call-to-action/call-to-action.php:15, widgets/widgets/list/list.php:15, widgets/widgets/price-box/price-box.php:15
1606
  msgid "Title"
1607
  msgstr ""
1608
 
@@ -1622,27 +1630,27 @@ msgstr ""
1622
  msgid "Displays a post loop."
1623
  msgstr ""
1624
 
1625
- #: inc/widgets/post-loop-helper.php:45, inc/widgets/post-loop.php:269
1626
  msgid "Template"
1627
  msgstr ""
1628
 
1629
- #: inc/widgets/post-loop-helper.php:52, inc/widgets/post-loop.php:287
1630
  msgid "If the template supports it, cut posts and display the more link."
1631
  msgstr ""
1632
 
1633
- #: inc/widgets/post-loop.php:235
1634
  msgid "Your theme doesn't have any post loops."
1635
  msgstr ""
1636
 
1637
- #: inc/widgets/post-loop.php:285
1638
  msgid "More Link"
1639
  msgstr ""
1640
 
1641
- #: inc/widgets/post-loop.php:329
1642
  msgid "Post In Order"
1643
  msgstr ""
1644
 
1645
- #: inc/widgets/post-loop.php:352
1646
  msgid "Additional "
1647
  msgstr ""
1648
 
36
  msgid "https://siteorigin.com"
37
  msgstr ""
38
 
39
+ #: siteorigin-panels.php:353
40
  msgid "Read More"
41
  msgstr ""
42
 
43
+ #: siteorigin-panels.php:501
44
  msgid "Edit Home Page"
45
  msgstr ""
46
 
47
+ #: siteorigin-panels.php:521, tpl/js-templates.php:34, tpl/js-templates.php:36
48
  msgid "Live Editor"
49
  msgstr ""
50
 
51
+ #: compat/layout-block.php:92
52
  msgid "You need to add a widget, row, or prebuilt layout before you'll see anything here. :)"
53
  msgstr ""
54
 
141
  msgid "WordPress Widgets"
142
  msgstr ""
143
 
144
+ #: inc/admin-widget-dialog.php:185, inc/settings.php:358
145
  msgid "Recommended Widgets"
146
  msgstr ""
147
 
157
  msgid "Addons"
158
  msgstr ""
159
 
160
+ #: inc/admin.php:179, inc/admin.php:591, inc/admin.php:1246, inc/admin.php:1251, inc/settings.php:201, tpl/js-templates.php:197
161
  msgid "Page Builder"
162
  msgstr ""
163
 
455
  msgstr ""
456
 
457
  #. translators: This is the default name given to a user's home page
458
+ #: inc/admin.php:674, inc/home.php:26
459
  msgid "Home Page"
460
  msgstr ""
461
 
462
+ #: inc/admin.php:775
463
  msgid "Untitled Widget"
464
  msgstr ""
465
 
466
+ #: inc/admin.php:955
467
  msgid "You need to install 1{%1$s} to use the widget 2{%2$s}."
468
  msgstr ""
469
 
470
+ #: inc/admin.php:961
471
  msgid "Save and reload this page to start using the widget after you've installed it."
472
  msgstr ""
473
 
474
+ #: inc/admin.php:977
475
  msgid "The widget 1{%1$s} is not available. Please try locate and install the missing plugin. Post on the 2{support forums} if you need help."
476
  msgstr ""
477
 
478
+ #: inc/admin.php:1149, inc/styles-admin.php:23
479
  msgid "The supplied nonce is invalid."
480
  msgstr ""
481
 
482
+ #: inc/admin.php:1150, inc/styles-admin.php:24
483
  msgid "Invalid nonce."
484
  msgstr ""
485
 
486
+ #: inc/admin.php:1156
487
  msgid "Please specify the type of widget form to be rendered."
488
  msgstr ""
489
 
490
+ #: inc/admin.php:1157
491
  msgid "Missing widget type."
492
  msgstr ""
493
 
494
+ #: inc/admin.php:1264
495
  msgid "%s Widget"
496
  msgid_plural "%s Widgets"
497
  msgstr[0] ""
498
  msgstr[1] ""
499
 
500
+ #: inc/admin.php:1307
501
  msgid "Get a lightbox addon for SiteOrigin widgets"
502
  msgstr ""
503
 
504
+ #: inc/admin.php:1311
505
  msgid "Get the row, cell and widget animations addon"
506
  msgstr ""
507
 
508
+ #: inc/admin.php:1315
509
  msgid "Get premium email support for SiteOrigin Page Builder"
510
  msgstr ""
511
 
512
+ #: inc/admin.php:1500
513
  msgid "Toggle editor selection menu"
514
  msgstr ""
515
 
516
+ #: inc/admin.php:1501, inc/admin.php:1548, inc/settings.php:201, settings/tpl/settings.php:9
517
  msgid "SiteOrigin Page Builder"
518
  msgstr ""
519
 
520
+ #: inc/admin.php:1502
521
  msgid "Block Editor"
522
  msgstr ""
523
 
529
  msgid "Page Builder Content"
530
  msgstr ""
531
 
532
+ #: inc/settings.php:228
533
  msgid "Page Builder Settings"
534
  msgstr ""
535
 
536
+ #: inc/settings.php:244
537
  msgid "General"
538
  msgstr ""
539
 
540
+ #: inc/settings.php:250
541
  msgid "Post Types"
542
  msgstr ""
543
 
544
+ #: inc/settings.php:252
545
  msgid "The post types on which to use Page Builder."
546
  msgstr ""
547
 
548
+ #: inc/settings.php:257
549
+ msgid "Use Classic Editor for New Posts"
550
  msgstr ""
551
 
552
+ #: inc/settings.php:258
553
  msgid "New posts of the above Post Types will be created using the Classic Editor."
554
  msgstr ""
555
 
556
+ #: inc/settings.php:263
557
  msgid "Live Editor Quick Link"
558
  msgstr ""
559
 
560
+ #: inc/settings.php:264
561
  msgid "Display a Live Editor button in the admin bar."
562
  msgstr ""
563
 
564
+ #: inc/settings.php:269
565
  msgid "Display Post State"
566
  msgstr ""
567
 
568
+ #: inc/settings.php:271
569
  msgid "Display a %sSiteOrigin Page Builder%s post state in the admin lists of posts/pages to indicate Page Builder is active."
570
  msgstr ""
571
 
572
+ #: inc/settings.php:279
573
  msgid "Display Widget Count"
574
  msgstr ""
575
 
576
+ #: inc/settings.php:280
577
  msgid "Display a widget count in the admin lists of posts/pages where you're using Page Builder."
578
  msgstr ""
579
 
580
+ #: inc/settings.php:285
581
  msgid "Limit Parallax Motion"
582
  msgstr ""
583
 
584
+ #: inc/settings.php:286
585
  msgid "How many pixels of scrolling result in a single pixel of parallax motion. 0 means automatic. Lower values give more noticeable effect."
586
  msgstr ""
587
 
588
+ #: inc/settings.php:291
589
  msgid "Disable Parallax On Mobile"
590
  msgstr ""
591
 
592
+ #: inc/settings.php:292
593
  msgid "Disable row/widget background parallax when the browser is smaller than the mobile width."
594
  msgstr ""
595
 
596
+ #: inc/settings.php:297
597
  msgid "Sidebars Emulator"
598
  msgstr ""
599
 
600
+ #: inc/settings.php:298
601
  msgid "Page Builder will create an emulated sidebar, that contains all widgets in the page."
602
  msgstr ""
603
 
604
+ #: inc/settings.php:303
605
  msgid "Upgrade Teaser"
606
  msgstr ""
607
 
608
+ #: inc/settings.php:305
609
  msgid "Display the %sSiteOrigin Premium%s upgrade teaser in the Page Builder toolbar."
610
  msgstr ""
611
 
612
+ #: inc/settings.php:313
613
  msgid "Default To Page Builder Interface"
614
  msgstr ""
615
 
616
+ #: inc/settings.php:315
617
  msgid "New Classic Editor posts/pages that you create will start with the Page Builder loaded. The %s\"Use Classic Editor for new posts\"%s setting must be enabled."
618
  msgstr ""
619
 
620
+ #: inc/settings.php:322
621
  msgid "Layout Block Default Mode"
622
  msgstr ""
623
 
624
+ #: inc/settings.php:325, tpl/js-templates.php:141
625
  msgid "Edit"
626
  msgstr ""
627
 
628
+ #: inc/settings.php:326
629
  msgid "Preview"
630
  msgstr ""
631
 
632
+ #: inc/settings.php:328
633
  msgid "Whether to display layout blocks in edit mode or preview mode in the block editor."
634
  msgstr ""
635
 
636
+ #: inc/settings.php:334
637
  msgid "Widgets"
638
  msgstr ""
639
 
640
+ #: inc/settings.php:340
641
  msgid "Widget Title HTML"
642
  msgstr ""
643
 
644
+ #: inc/settings.php:341
645
  msgid "The HTML used for widget titles. {{title}} is replaced with the widget title."
646
  msgstr ""
647
 
648
+ #: inc/settings.php:346
649
  msgid "Add Widget Class"
650
  msgstr ""
651
 
652
+ #: inc/settings.php:347
653
  msgid "Add the widget class to Page Builder widgets. Disable this if you're experiencing conflicts."
654
  msgstr ""
655
 
656
+ #: inc/settings.php:352
657
  msgid "Legacy Bundled Widgets"
658
  msgstr ""
659
 
660
+ #: inc/settings.php:353
661
  msgid "Load legacy widgets from Page Builder 1."
662
  msgstr ""
663
 
664
+ #: inc/settings.php:359
665
  msgid "Display recommend widgets in Page Builder add widget dialog."
666
  msgstr ""
667
 
668
+ #: inc/settings.php:364
669
  msgid "Instant Open Widgets"
670
  msgstr ""
671
 
672
+ #: inc/settings.php:365
673
  msgid "Open a widget form as soon as its added to a page."
674
  msgstr ""
675
 
676
+ #: inc/settings.php:371, inc/styles-admin.php:88
677
  msgid "Layout"
678
  msgstr ""
679
 
680
+ #: inc/settings.php:379
681
  msgid "Responsive Layout"
682
  msgstr ""
683
 
684
+ #: inc/settings.php:380
685
  msgid "Collapse widgets, rows and columns on mobile devices."
686
  msgstr ""
687
 
688
+ #: inc/settings.php:385
689
  msgid "Use Tablet Layout"
690
  msgstr ""
691
 
692
+ #: inc/settings.php:386
693
  msgid "Collapses columns differently on tablet devices."
694
  msgstr ""
695
 
696
+ #: inc/settings.php:392
697
  msgid "Detect older browsers"
698
  msgstr ""
699
 
700
+ #: inc/settings.php:393
701
  msgid "Never"
702
  msgstr ""
703
 
704
+ #: inc/settings.php:394
705
  msgid "Always"
706
  msgstr ""
707
 
708
+ #: inc/settings.php:396
709
  msgid "Use Legacy Layout Engine"
710
  msgstr ""
711
 
712
+ #: inc/settings.php:397
713
  msgid "The CSS and HTML uses floats instead of flexbox for compatibility with very old browsers."
714
  msgstr ""
715
 
716
+ #: inc/settings.php:403
717
  msgid "Tablet Width"
718
  msgstr ""
719
 
720
+ #: inc/settings.php:404
721
  msgid "Device width, in pixels, to collapse into a tablet view ."
722
  msgstr ""
723
 
724
+ #: inc/settings.php:410
725
  msgid "Mobile Width"
726
  msgstr ""
727
 
728
+ #: inc/settings.php:411
729
  msgid "Device width, in pixels, to collapse into a mobile view ."
730
  msgstr ""
731
 
732
+ #: inc/settings.php:417
733
  msgid "Row/Widget Bottom Margin"
734
  msgstr ""
735
 
736
+ #: inc/settings.php:418
737
  msgid "Default margin below rows and widgets."
738
  msgstr ""
739
 
740
+ #: inc/settings.php:424
741
+ msgid "Row Mobile Bottom Margin"
742
+ msgstr ""
743
+
744
+ #: inc/settings.php:425
745
+ msgid "The default margin below rows on mobile."
746
+ msgstr ""
747
+
748
+ #: inc/settings.php:430
749
  msgid "Last Row With Margin"
750
  msgstr ""
751
 
752
+ #: inc/settings.php:431
753
  msgid "Allow margin in last row."
754
  msgstr ""
755
 
756
+ #: inc/settings.php:437
757
  msgid "Row Gutter"
758
  msgstr ""
759
 
760
+ #: inc/settings.php:438
761
  msgid "Default spacing between columns in each row."
762
  msgstr ""
763
 
764
+ #: inc/settings.php:444
765
  msgid "Full Width Container"
766
  msgstr ""
767
 
768
+ #: inc/settings.php:445
769
  msgid "The container used for the full width layout."
770
  msgstr ""
771
 
772
+ #: inc/settings.php:452
773
  msgid "Content"
774
  msgstr ""
775
 
776
+ #: inc/settings.php:458
777
  msgid "Copy Content"
778
  msgstr ""
779
 
780
+ #: inc/settings.php:459
781
  msgid "Copy content from Page Builder to post content."
782
  msgstr ""
783
 
784
+ #: inc/settings.php:464
785
  msgid "Copy Styles"
786
  msgstr ""
787
 
788
+ #: inc/settings.php:465
789
  msgid "Include styles into your Post Content. This keeps page layouts, even when Page Builder is deactivated."
790
  msgstr ""
791
 
792
+ #: inc/settings.php:518, inc/styles-admin.php:273
793
  msgid "Enabled"
794
  msgstr ""
795
 
1021
  msgid "Collapse Order"
1022
  msgstr ""
1023
 
1024
+ #: inc/styles.php:250, widgets/widgets.php:635, widgets/widgets.php:757, inc/widgets/post-loop.php:355
1025
  msgid "Default"
1026
  msgstr ""
1027
 
1337
  msgid "%s Style"
1338
  msgstr ""
1339
 
1340
+ #: widgets/widgets.php:594, inc/widgets/post-loop.php:313
1341
  msgid "Post Type"
1342
  msgstr ""
1343
 
1344
+ #: widgets/widgets.php:601, inc/widgets/post-loop.php:322
1345
  msgid "Posts Per Page"
1346
  msgstr ""
1347
 
1348
+ #: widgets/widgets.php:606, inc/widgets/post-loop.php:327
1349
  msgid "Order By"
1350
  msgstr ""
1351
 
1352
+ #: widgets/widgets.php:608, widgets/widgets.php:783, inc/widgets/post-content.php:60, inc/widgets/post-loop.php:329
1353
  msgid "None"
1354
  msgstr ""
1355
 
1356
+ #: widgets/widgets.php:609, inc/widgets/post-loop.php:330
1357
  msgid "Post ID"
1358
  msgstr ""
1359
 
1360
+ #: widgets/widgets.php:610, inc/widgets/post-loop.php:331
1361
  msgid "Author"
1362
  msgstr ""
1363
 
1364
+ #: widgets/widgets.php:611, widgets/widgets.php:612, inc/widgets/post-loop.php:332, inc/widgets/post-loop.php:333, widgets/widgets/testimonial/testimonial.php:15
1365
  msgid "Name"
1366
  msgstr ""
1367
 
1368
+ #: widgets/widgets.php:613, inc/widgets/post-loop.php:334
1369
  msgid "Date"
1370
  msgstr ""
1371
 
1372
+ #: widgets/widgets.php:614, inc/widgets/post-loop.php:335
1373
  msgid "Modified"
1374
  msgstr ""
1375
 
1376
+ #: widgets/widgets.php:615, inc/widgets/post-loop.php:336
1377
  msgid "Parent"
1378
  msgstr ""
1379
 
1380
+ #: widgets/widgets.php:616, inc/widgets/post-loop.php:337
1381
  msgid "Random"
1382
  msgstr ""
1383
 
1384
+ #: widgets/widgets.php:617, inc/widgets/post-loop.php:338
1385
  msgid "Comment Count"
1386
  msgstr ""
1387
 
1388
+ #: widgets/widgets.php:618, inc/widgets/post-loop.php:339
1389
  msgid "Menu Order"
1390
  msgstr ""
1391
 
1392
+ #: widgets/widgets.php:624, inc/widgets/post-loop.php:345
1393
  msgid "Order"
1394
  msgstr ""
1395
 
1396
+ #: widgets/widgets.php:626, inc/widgets/post-loop.php:348
1397
  msgid "Ascending"
1398
  msgstr ""
1399
 
1400
+ #: widgets/widgets.php:627, inc/widgets/post-loop.php:347
1401
  msgid "Descending"
1402
  msgstr ""
1403
 
1404
+ #: widgets/widgets.php:633, inc/widgets/post-loop.php:353
1405
  msgid "Sticky Posts"
1406
  msgstr ""
1407
 
1408
+ #: widgets/widgets.php:636, inc/widgets/post-loop.php:356
1409
  msgid "Ignore Sticky"
1410
  msgstr ""
1411
 
1412
+ #: widgets/widgets.php:637, inc/widgets/post-loop.php:357
1413
  msgid "Exclude Sticky"
1414
  msgstr ""
1415
 
1416
+ #: widgets/widgets.php:638, inc/widgets/post-loop.php:358
1417
  msgid "Only Sticky"
1418
  msgstr ""
1419
 
1421
  msgid "Additional Arguments"
1422
  msgstr ""
1423
 
1424
+ #: widgets/widgets.php:648, inc/widgets/post-loop.php:370
1425
  msgid "Additional query arguments. See 1{query_posts}."
1426
  msgstr ""
1427
 
1610
  msgid "Displays content from the current post."
1611
  msgstr ""
1612
 
1613
+ #: inc/widgets/post-content.php:61, inc/widgets/post-loop-helper.php:41, inc/widgets/post-loop.php:276, widgets/widgets/call-to-action/call-to-action.php:15, widgets/widgets/list/list.php:15, widgets/widgets/price-box/price-box.php:15
1614
  msgid "Title"
1615
  msgstr ""
1616
 
1630
  msgid "Displays a post loop."
1631
  msgstr ""
1632
 
1633
+ #: inc/widgets/post-loop-helper.php:45, inc/widgets/post-loop.php:280
1634
  msgid "Template"
1635
  msgstr ""
1636
 
1637
+ #: inc/widgets/post-loop-helper.php:52, inc/widgets/post-loop.php:298
1638
  msgid "If the template supports it, cut posts and display the more link."
1639
  msgstr ""
1640
 
1641
+ #: inc/widgets/post-loop.php:246
1642
  msgid "Your theme doesn't have any post loops."
1643
  msgstr ""
1644
 
1645
+ #: inc/widgets/post-loop.php:296
1646
  msgid "More Link"
1647
  msgstr ""
1648
 
1649
+ #: inc/widgets/post-loop.php:340
1650
  msgid "Post In Order"
1651
  msgstr ""
1652
 
1653
+ #: inc/widgets/post-loop.php:363
1654
  msgid "Additional "
1655
  msgstr ""
1656
 
license.txt CHANGED
File without changes
readme.txt CHANGED
@@ -2,8 +2,9 @@
2
  Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
3
  Requires at least: 4.7
4
  Tested up to: 5.5
5
- Stable tag: 2.11.2
6
- Build time: 2020-08-12T17:13:16+02:00
 
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
  Donate link: https://siteorigin.com/downloads/premium/
@@ -96,6 +97,23 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.
96
 
97
  == Changelog ==
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  = 2.11.2 - 12 August 2020 =
100
  * Updated build scripts.
101
 
2
  Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
3
  Requires at least: 4.7
4
  Tested up to: 5.5
5
+ Requires PHP: 5.6.20
6
+ Stable tag: 2.11.3
7
+ Build time: 2020-09-14T15:27:03+02:00
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
  Donate link: https://siteorigin.com/downloads/premium/
97
 
98
  == Changelog ==
99
 
100
+ = 2.11.3 - 14 September 2020 =
101
+ * Block Editor: Added SEO support for multiple Layout Block instances.
102
+ * Yoast SEO Sitemap: Added images added using Page Builder.
103
+ * Prevented potential `Are you sure you want to navigate away?` notice.
104
+ * Post Loop: Resolved `Undefined index` notice when used outside of Page Builder.
105
+ * Android Chrome: Improved edit widget touch detection.
106
+ * Yoast SEO: Resolved version `14.6` integration issue.
107
+ * Block Editor: Used new categories for the Layout Block for WP 5.5+.
108
+ * Block Editor: Resolved potential Layout Block data validation issue by running `wp_targeted_link_rel` on the generated preview content.
109
+ * Block Editor: Added preview support for the Layout Block.
110
+ * Block Editor: Updated translation functions to avoid potential conflicts.
111
+ * Block Editor: Added the page name and block number to Layout Block JSON export files.
112
+ * Block Editor: Improved SEO plugin support.
113
+ * Added a global `Row Mobile Bottom Margin` setting at `Settings > Page Builder > Layout`.
114
+ * Ensured Yoast SEO is ready before running compatibility functionality.
115
+ * Global Settings: Resolved a jQuery Migrate Helper warning.
116
+
117
  = 2.11.2 - 12 August 2020 =
118
  * Updated build scripts.
119
 
settings/admin-settings.css CHANGED
File without changes
settings/admin-settings.js CHANGED
@@ -16,8 +16,7 @@ jQuery( function($){
16
  .animate({'margin-top' : 0, 'opacity': opacity}, 280 + 40*(4 - v) );
17
  }, 150 + 225 * (4 - v) );
18
  });
19
- })
20
- .each(function() { if(this.complete) { $(this).load(); } });
21
 
22
  // Settings page tabbing
23
 
@@ -224,4 +223,4 @@ jQuery( function($){
224
  $.fn.fitVids._count = 0;
225
 
226
  // Works with either jQuery or Zepto
227
- })( window.jQuery || window.Zepto );
16
  .animate({'margin-top' : 0, 'opacity': opacity}, 280 + 40*(4 - v) );
17
  }, 150 + 225 * (4 - v) );
18
  });
19
+ });
 
20
 
21
  // Settings page tabbing
22
 
223
  $.fn.fitVids._count = 0;
224
 
225
  // Works with either jQuery or Zepto
226
+ })( window.jQuery || window.Zepto );
settings/admin-settings.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function(t){t(".settings-banner img").hide().eq(0).one("load",(function(){t.each([1,2,3],(function(e,i){var s=t(".settings-banner img.layer-"+i),n=s.css("opacity");setTimeout((function(){s.show().css({"margin-top":-5,opacity:0}).animate({"margin-top":0,opacity:n},280+40*(4-i))}),150+225*(4-i))}))})).each((function(){this.complete&&t(this).load()})),t(".settings-nav li a").click((function(e){e.preventDefault();var i=t(this);t(".settings-nav li a").not(i).closest("li").removeClass("active"),i.closest("li").addClass("active");var s=i.attr("href").split("#")[1],n=t("#panels-settings-section-"+s);t("#panels-settings-sections .panels-settings-section").not(n).hide(),n.show(),t('#panels-settings-page input[type="submit"]').css({visibility:"welcome"===s?"hidden":"visible"}),setUserSetting("siteorigin_panels_setting_tab",s)})),window.location.hash&&t('.settings-nav li a[href="'+window.location.hash+'"]').click(),t("#panels-settings-section-welcome").fitVids();var e=getUserSetting("siteorigin_panels_setting_tab");""===e?t(".settings-nav li a").first().click():t('.settings-nav li a[href="#'+e+'"]').first().click();var i=function(){var e=t(this),i=t("#panels-settings-search .results"),s=e.val();if(""===s)return i.empty().hide(),!1;var n=[];t("#panels-settings-sections .panels-setting").each((function(){var e=t(this),i=0,a=e.find("label").html().toLowerCase().indexOf(s),r=e.find(".description").data("keywords").toLowerCase().indexOf(s),o=e.find(".description").html().toLowerCase().indexOf(s);0===a?i+=10:-1!==a&&(i+=7),0===r?i+=4:-1!==r&&(i+=3),0===o?i+=2:-1!==o&&(i+=1),i>0&&(n.push(e),e.data("isMatch",i))})),i.empty(),n.length>0?(i.show(),n.sort((function(t,e){return e.data("isMatch")-t.data("isMatch")})),n=n.slice(0,8),t.each(n,(function(e,s){t("#panels-settings-search .results").append(t("<li></li>").html(s.find("label").html()).click((function(){var e;t('.settings-nav li a[href="#'+(e=s).closest(".panels-settings-section").data("section")+'"]').first().click(),e.addClass("highlighted"),e.find("label").css("border-left-width",0).animate({"border-left-width":5},"normal").delay(4e3).animate({"border-left-width":0},"normal",(function(){e.removeClass("highlighted")})),e.find("input,textarea").focus(),i.fadeOut("fast"),t("#panels-settings-search input").blur()})))}))):i.hide()};t("#panels-settings-search input").keyup(i).click(i).blur((function(){t("#panels-settings-search .results").fadeOut("fast")}))})),function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("div");n.innerHTML='<p>x</p><style id="fit-vids-style">.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>',s.appendChild(n.childNodes[1])}return e&&t.extend(i,e),this.each((function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var s=".fitvidsignore";i.ignore&&(s=s+", "+i.ignore);var n=t(this).find(e.join(","));(n=(n=n.not("object object")).not(s)).each((function(){var e=t(this);if(!(e.parents(s).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i=("object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height())/(isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10));if(!e.attr("name")){var n="fitvid"+t.fn.fitVids._count;e.attr("name",n),t.fn.fitVids._count++}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*i+"%"),e.removeAttr("height").removeAttr("width")}}))}))},t.fn.fitVids._count=0}(window.jQuery||window.Zepto);
1
+ jQuery((function(t){t(".settings-banner img").hide().eq(0).one("load",(function(){t.each([1,2,3],(function(e,i){var s=t(".settings-banner img.layer-"+i),n=s.css("opacity");setTimeout((function(){s.show().css({"margin-top":-5,opacity:0}).animate({"margin-top":0,opacity:n},280+40*(4-i))}),150+225*(4-i))}))})),t(".settings-nav li a").click((function(e){e.preventDefault();var i=t(this);t(".settings-nav li a").not(i).closest("li").removeClass("active"),i.closest("li").addClass("active");var s=i.attr("href").split("#")[1],n=t("#panels-settings-section-"+s);t("#panels-settings-sections .panels-settings-section").not(n).hide(),n.show(),t('#panels-settings-page input[type="submit"]').css({visibility:"welcome"===s?"hidden":"visible"}),setUserSetting("siteorigin_panels_setting_tab",s)})),window.location.hash&&t('.settings-nav li a[href="'+window.location.hash+'"]').click(),t("#panels-settings-section-welcome").fitVids();var e=getUserSetting("siteorigin_panels_setting_tab");""===e?t(".settings-nav li a").first().click():t('.settings-nav li a[href="#'+e+'"]').first().click();var i=function(){var e=t(this),i=t("#panels-settings-search .results"),s=e.val();if(""===s)return i.empty().hide(),!1;var n=[];t("#panels-settings-sections .panels-setting").each((function(){var e=t(this),i=0,a=e.find("label").html().toLowerCase().indexOf(s),r=e.find(".description").data("keywords").toLowerCase().indexOf(s),o=e.find(".description").html().toLowerCase().indexOf(s);0===a?i+=10:-1!==a&&(i+=7),0===r?i+=4:-1!==r&&(i+=3),0===o?i+=2:-1!==o&&(i+=1),i>0&&(n.push(e),e.data("isMatch",i))})),i.empty(),n.length>0?(i.show(),n.sort((function(t,e){return e.data("isMatch")-t.data("isMatch")})),n=n.slice(0,8),t.each(n,(function(e,s){t("#panels-settings-search .results").append(t("<li></li>").html(s.find("label").html()).click((function(){var e;t('.settings-nav li a[href="#'+(e=s).closest(".panels-settings-section").data("section")+'"]').first().click(),e.addClass("highlighted"),e.find("label").css("border-left-width",0).animate({"border-left-width":5},"normal").delay(4e3).animate({"border-left-width":0},"normal",(function(){e.removeClass("highlighted")})),e.find("input,textarea").focus(),i.fadeOut("fast"),t("#panels-settings-search input").blur()})))}))):i.hide()};t("#panels-settings-search input").keyup(i).click(i).blur((function(){t("#panels-settings-search .results").fadeOut("fast")}))})),function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("div");n.innerHTML='<p>x</p><style id="fit-vids-style">.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>',s.appendChild(n.childNodes[1])}return e&&t.extend(i,e),this.each((function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];i.customSelector&&e.push(i.customSelector);var s=".fitvidsignore";i.ignore&&(s=s+", "+i.ignore);var n=t(this).find(e.join(","));(n=(n=n.not("object object")).not(s)).each((function(){var e=t(this);if(!(e.parents(s).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i=("object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height())/(isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10));if(!e.attr("name")){var n="fitvid"+t.fn.fitVids._count;e.attr("name",n),t.fn.fitVids._count++}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*i+"%"),e.removeAttr("height").removeAttr("width")}}))}))},t.fn.fitVids._count=0}(window.jQuery||window.Zepto);
settings/images/icon-layer.png CHANGED
File without changes
settings/tpl/help.php CHANGED
File without changes
settings/tpl/settings.php CHANGED
File without changes
siteorigin-panels.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Page Builder by SiteOrigin
4
  Plugin URI: https://siteorigin.com/page-builder/
5
  Description: A drag and drop, responsive page builder that simplifies building your website.
6
- Version: 2.11.2
7
  Author: SiteOrigin
8
  Author URI: https://siteorigin.com
9
  License: GPL3
@@ -11,7 +11,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
11
  Donate link: http://siteorigin.com/page-builder/#donate
12
  */
13
 
14
- define( 'SITEORIGIN_PANELS_VERSION', '2.11.2' );
15
  if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
16
  define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
17
  }
@@ -31,13 +31,13 @@ class SiteOrigin_Panels {
31
  add_action( 'plugins_loaded', array( $this, 'init' ) );
32
  add_action( 'plugins_loaded', array( $this, 'init_compat' ), 100 );
33
  add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100 );
34
-
35
  add_action('widgets_init', array( $this, 'widgets_init' ) );
36
 
37
  add_filter( 'body_class', array( $this, 'body_class' ) );
38
  add_filter( 'siteorigin_panels_data', array( $this, 'process_panels_data' ), 5 );
39
  add_filter( 'siteorigin_panels_widget_class', array( $this, 'fix_namespace_escaping' ), 5 );
40
-
41
  add_action( 'activated_plugin', array($this, 'activation_flag_redirect') );
42
  add_action( 'admin_init', array($this, 'activation_do_redirect') );
43
 
@@ -58,7 +58,7 @@ class SiteOrigin_Panels {
58
  if ( self::is_live_editor() ) {
59
  SiteOrigin_Panels_Live_Editor::single();
60
  }
61
-
62
  SiteOrigin_Panels::renderer();
63
  SiteOrigin_Panels_Styles_Admin::single();
64
 
@@ -67,22 +67,22 @@ class SiteOrigin_Panels {
67
  }
68
 
69
  SiteOrigin_Panels_Widget_Shortcode::init();
70
-
71
  // We need to generate fresh post content
72
  add_filter( 'the_content', array( $this, 'generate_post_content' ) );
73
  add_filter( 'woocommerce_format_content', array( $this, 'generate_woocommerce_content' ) );
74
  add_filter( 'wp_enqueue_scripts', array( $this, 'generate_post_css' ) );
75
-
76
  // Remove the default excerpt function
77
  add_filter( 'get_the_excerpt', array( $this, 'generate_post_excerpt' ), 9 );
78
-
79
  // Content cache has been removed. SiteOrigin_Panels_Cache_Renderer just deletes any existing caches.
80
  SiteOrigin_Panels_Cache_Renderer::single();
81
-
82
  if ( function_exists( 'register_block_type' ) ) {
83
  SiteOrigin_Panels_Compat_Layout_Block::single();
84
  }
85
-
86
  define( 'SITEORIGIN_PANELS_BASE_FILE', __FILE__ );
87
  }
88
 
@@ -91,7 +91,7 @@ class SiteOrigin_Panels {
91
  static $single;
92
  return empty( $single ) ? $single = new self() : $single;
93
  }
94
-
95
  /**
96
  * Get an instance of the renderer
97
  *
@@ -104,11 +104,11 @@ class SiteOrigin_Panels {
104
  case 'always':
105
  $renderer = SiteOrigin_Panels_Renderer_Legacy::single();
106
  break;
107
-
108
  case 'never':
109
  $renderer = SiteOrigin_Panels_Renderer::single();
110
  break;
111
-
112
  default :
113
  $renderer = self::is_legacy_browser() ?
114
  SiteOrigin_Panels_Renderer_Legacy::single() :
@@ -116,14 +116,14 @@ class SiteOrigin_Panels {
116
  break;
117
  }
118
  }
119
-
120
  return $renderer;
121
  }
122
-
123
  public static function is_legacy_browser(){
124
  $agent = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
125
  if( empty( $agent ) ) return false;
126
-
127
  return
128
  // IE lte 11
129
  ( preg_match('/Trident\/(?P<v>\d+)/i', $agent, $B) && $B['v'] <= 7 ) ||
@@ -156,7 +156,7 @@ class SiteOrigin_Panels {
156
  $filename = str_replace( array( 'SiteOrigin_Panels_', '_' ), array( '', '-' ), $class );
157
  $filename = plugin_dir_path( __FILE__ ) . 'inc/' . strtolower( $filename ) . '.php';
158
  }
159
-
160
  if ( ! empty( $filename ) && file_exists( $filename ) ) {
161
  include $filename;
162
  }
@@ -202,6 +202,11 @@ class SiteOrigin_Panels {
202
  require_once plugin_dir_path( __FILE__ ) . 'compat/widget-options.php';
203
  }
204
 
 
 
 
 
 
205
  // Compatibility with AMP plugin
206
  if ( is_admin() && function_exists( 'amp_bootstrap_plugin' ) ) {
207
  require_once plugin_dir_path( __FILE__ ) . 'compat/amp.php';
@@ -285,7 +290,7 @@ class SiteOrigin_Panels {
285
 
286
  return $panels_data;
287
  }
288
-
289
  /**
290
  * Generate post content for WooCommerce shop page if it's using a PB layout.
291
  *
@@ -299,7 +304,7 @@ class SiteOrigin_Panels {
299
  if ( class_exists( 'WooCommerce' ) && is_shop() ) {
300
  return $this->generate_post_content( $content );
301
  }
302
-
303
  return $content;
304
  }
305
 
@@ -321,9 +326,9 @@ class SiteOrigin_Panels {
321
  if ( ! apply_filters( 'siteorigin_panels_filter_content_enabled', true ) ) {
322
  return $content;
323
  }
324
-
325
  $post_id = $this->get_post_id();
326
-
327
  // Check if this post has panels_data
328
  if ( get_post_meta( $post_id, 'panels_data', true ) ) {
329
  $panel_content = SiteOrigin_Panels::renderer()->render(
@@ -357,7 +362,7 @@ class SiteOrigin_Panels {
357
 
358
  return $content;
359
  }
360
-
361
  /**
362
  * Generate an excerpt for the current post, if possible.
363
  *
@@ -370,9 +375,9 @@ class SiteOrigin_Panels {
370
  if ( ( empty( $post ) && ! in_the_loop() ) || $text !== '' ) {
371
  return $text;
372
  }
373
-
374
  $post_id = $this->get_post_id();
375
-
376
  // Check if this post has panels_data
377
  $panels_data = get_post_meta( $post_id, 'panels_data', true );
378
  if ( $panels_data && ! empty( $panels_data['widgets'] ) ) {
@@ -396,19 +401,19 @@ class SiteOrigin_Panels {
396
  }
397
  }
398
  }
399
-
400
  $text = strip_shortcodes( $raw_excerpt );
401
  $text = str_replace( ']]>', ']]&gt;', $text );
402
-
403
  $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );
404
  $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
405
  }
406
-
407
  return $text;
408
  }
409
-
410
  private function get_localized_word_count( $text ) {
411
-
412
  // From the core `wp_trim_words` function to get localized word count.
413
  $text = wp_strip_all_tags( $text );
414
  if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
@@ -418,29 +423,29 @@ class SiteOrigin_Panels {
418
  } else {
419
  $words_array = preg_split( "/[\n\r\t ]+/", $text, -1, PREG_SPLIT_NO_EMPTY );
420
  }
421
-
422
  return count( $words_array );
423
  }
424
-
425
  /**
426
  * Generate CSS for the current post
427
  */
428
  public function generate_post_css() {
429
  $post_id = $this->get_post_id();
430
-
431
  if( is_singular() && get_post_meta( $post_id, 'panels_data', true ) ) {
432
  $renderer = SiteOrigin_Panels::renderer();
433
  $renderer->add_inline_css( $post_id, $renderer->generate_css( $post_id ) );
434
  }
435
  }
436
-
437
  /**
438
  * Get the post id for the current post.
439
  */
440
  function get_post_id() {
441
-
442
  $post_id = get_the_ID();
443
-
444
  if ( class_exists( 'WooCommerce' ) && is_shop() ) {
445
  $post_id = wc_get_page_id( 'shop' );
446
  }
@@ -452,7 +457,7 @@ class SiteOrigin_Panels {
452
  $post_id = $preview_post->ID;
453
  }
454
  }
455
-
456
  return $post_id;
457
  }
458
 
@@ -525,7 +530,7 @@ class SiteOrigin_Panels {
525
 
526
  return $admin_bar;
527
  }
528
-
529
  function widgets_init(){
530
  register_widget( 'SiteOrigin_Panels_Widgets_PostContent' );
531
  register_widget( 'SiteOrigin_Panels_Widgets_PostLoop' );
@@ -587,7 +592,7 @@ class SiteOrigin_Panels {
587
 
588
  return $panels_data;
589
  }
590
-
591
  /**
592
  * Fix class names that have been incorrectly escaped
593
  *
@@ -620,7 +625,7 @@ class SiteOrigin_Panels {
620
  public function strip_before_js(){
621
  ?><script type="text/javascript">document.body.className = document.body.className.replace("siteorigin-panels-before-js","");</script><?php
622
  }
623
-
624
  /**
625
  * Should we display premium addon messages
626
  *
@@ -648,8 +653,8 @@ class SiteOrigin_Panels {
648
  }
649
  return $url;
650
  }
651
-
652
-
653
  /**
654
  * Get the registered widget instance by it's class name or the hash generated when it was registered.
655
  *
@@ -670,7 +675,7 @@ class SiteOrigin_Panels {
670
  }
671
  return null;
672
  }
673
-
674
  /**
675
  * Flag redirect to welcome page after activation
676
  *
3
  Plugin Name: Page Builder by SiteOrigin
4
  Plugin URI: https://siteorigin.com/page-builder/
5
  Description: A drag and drop, responsive page builder that simplifies building your website.
6
+ Version: 2.11.3
7
  Author: SiteOrigin
8
  Author URI: https://siteorigin.com
9
  License: GPL3
11
  Donate link: http://siteorigin.com/page-builder/#donate
12
  */
13
 
14
+ define( 'SITEORIGIN_PANELS_VERSION', '2.11.3' );
15
  if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
16
  define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
17
  }
31
  add_action( 'plugins_loaded', array( $this, 'init' ) );
32
  add_action( 'plugins_loaded', array( $this, 'init_compat' ), 100 );
33
  add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100 );
34
+
35
  add_action('widgets_init', array( $this, 'widgets_init' ) );
36
 
37
  add_filter( 'body_class', array( $this, 'body_class' ) );
38
  add_filter( 'siteorigin_panels_data', array( $this, 'process_panels_data' ), 5 );
39
  add_filter( 'siteorigin_panels_widget_class', array( $this, 'fix_namespace_escaping' ), 5 );
40
+
41
  add_action( 'activated_plugin', array($this, 'activation_flag_redirect') );
42
  add_action( 'admin_init', array($this, 'activation_do_redirect') );
43
 
58
  if ( self::is_live_editor() ) {
59
  SiteOrigin_Panels_Live_Editor::single();
60
  }
61
+
62
  SiteOrigin_Panels::renderer();
63
  SiteOrigin_Panels_Styles_Admin::single();
64
 
67
  }
68
 
69
  SiteOrigin_Panels_Widget_Shortcode::init();
70
+
71
  // We need to generate fresh post content
72
  add_filter( 'the_content', array( $this, 'generate_post_content' ) );
73
  add_filter( 'woocommerce_format_content', array( $this, 'generate_woocommerce_content' ) );
74
  add_filter( 'wp_enqueue_scripts', array( $this, 'generate_post_css' ) );
75
+
76
  // Remove the default excerpt function
77
  add_filter( 'get_the_excerpt', array( $this, 'generate_post_excerpt' ), 9 );
78
+
79
  // Content cache has been removed. SiteOrigin_Panels_Cache_Renderer just deletes any existing caches.
80
  SiteOrigin_Panels_Cache_Renderer::single();
81
+
82
  if ( function_exists( 'register_block_type' ) ) {
83
  SiteOrigin_Panels_Compat_Layout_Block::single();
84
  }
85
+
86
  define( 'SITEORIGIN_PANELS_BASE_FILE', __FILE__ );
87
  }
88
 
91
  static $single;
92
  return empty( $single ) ? $single = new self() : $single;
93
  }
94
+
95
  /**
96
  * Get an instance of the renderer
97
  *
104
  case 'always':
105
  $renderer = SiteOrigin_Panels_Renderer_Legacy::single();
106
  break;
107
+
108
  case 'never':
109
  $renderer = SiteOrigin_Panels_Renderer::single();
110
  break;
111
+
112
  default :
113
  $renderer = self::is_legacy_browser() ?
114
  SiteOrigin_Panels_Renderer_Legacy::single() :
116
  break;
117
  }
118
  }
119
+
120
  return $renderer;
121
  }
122
+
123
  public static function is_legacy_browser(){
124
  $agent = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
125
  if( empty( $agent ) ) return false;
126
+
127
  return
128
  // IE lte 11
129
  ( preg_match('/Trident\/(?P<v>\d+)/i', $agent, $B) && $B['v'] <= 7 ) ||
156
  $filename = str_replace( array( 'SiteOrigin_Panels_', '_' ), array( '', '-' ), $class );
157
  $filename = plugin_dir_path( __FILE__ ) . 'inc/' . strtolower( $filename ) . '.php';
158
  }
159
+
160
  if ( ! empty( $filename ) && file_exists( $filename ) ) {
161
  include $filename;
162
  }
202
  require_once plugin_dir_path( __FILE__ ) . 'compat/widget-options.php';
203
  }
204
 
205
+ // Compatibility with Yoast Sitemap.
206
+ if ( defined( 'WPSEO_FILE' ) ) {
207
+ require_once plugin_dir_path( __FILE__ ) . 'compat/yoast-sitemap.php';
208
+ }
209
+
210
  // Compatibility with AMP plugin
211
  if ( is_admin() && function_exists( 'amp_bootstrap_plugin' ) ) {
212
  require_once plugin_dir_path( __FILE__ ) . 'compat/amp.php';
290
 
291
  return $panels_data;
292
  }
293
+
294
  /**
295
  * Generate post content for WooCommerce shop page if it's using a PB layout.
296
  *
304
  if ( class_exists( 'WooCommerce' ) && is_shop() ) {
305
  return $this->generate_post_content( $content );
306
  }
307
+
308
  return $content;
309
  }
310
 
326
  if ( ! apply_filters( 'siteorigin_panels_filter_content_enabled', true ) ) {
327
  return $content;
328
  }
329
+
330
  $post_id = $this->get_post_id();
331
+
332
  // Check if this post has panels_data
333
  if ( get_post_meta( $post_id, 'panels_data', true ) ) {
334
  $panel_content = SiteOrigin_Panels::renderer()->render(
362
 
363
  return $content;
364
  }
365
+
366
  /**
367
  * Generate an excerpt for the current post, if possible.
368
  *
375
  if ( ( empty( $post ) && ! in_the_loop() ) || $text !== '' ) {
376
  return $text;
377
  }
378
+
379
  $post_id = $this->get_post_id();
380
+
381
  // Check if this post has panels_data
382
  $panels_data = get_post_meta( $post_id, 'panels_data', true );
383
  if ( $panels_data && ! empty( $panels_data['widgets'] ) ) {
401
  }
402
  }
403
  }
404
+
405
  $text = strip_shortcodes( $raw_excerpt );
406
  $text = str_replace( ']]>', ']]&gt;', $text );
407
+
408
  $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );
409
  $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
410
  }
411
+
412
  return $text;
413
  }
414
+
415
  private function get_localized_word_count( $text ) {
416
+
417
  // From the core `wp_trim_words` function to get localized word count.
418
  $text = wp_strip_all_tags( $text );
419
  if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
423
  } else {
424
  $words_array = preg_split( "/[\n\r\t ]+/", $text, -1, PREG_SPLIT_NO_EMPTY );
425
  }
426
+
427
  return count( $words_array );
428
  }
429
+
430
  /**
431
  * Generate CSS for the current post
432
  */
433
  public function generate_post_css() {
434
  $post_id = $this->get_post_id();
435
+
436
  if( is_singular() && get_post_meta( $post_id, 'panels_data', true ) ) {
437
  $renderer = SiteOrigin_Panels::renderer();
438
  $renderer->add_inline_css( $post_id, $renderer->generate_css( $post_id ) );
439
  }
440
  }
441
+
442
  /**
443
  * Get the post id for the current post.
444
  */
445
  function get_post_id() {
446
+
447
  $post_id = get_the_ID();
448
+
449
  if ( class_exists( 'WooCommerce' ) && is_shop() ) {
450
  $post_id = wc_get_page_id( 'shop' );
451
  }
457
  $post_id = $preview_post->ID;
458
  }
459
  }
460
+
461
  return $post_id;
462
  }
463
 
530
 
531
  return $admin_bar;
532
  }
533
+
534
  function widgets_init(){
535
  register_widget( 'SiteOrigin_Panels_Widgets_PostContent' );
536
  register_widget( 'SiteOrigin_Panels_Widgets_PostLoop' );
592
 
593
  return $panels_data;
594
  }
595
+
596
  /**
597
  * Fix class names that have been incorrectly escaped
598
  *
625
  public function strip_before_js(){
626
  ?><script type="text/javascript">document.body.className = document.body.className.replace("siteorigin-panels-before-js","");</script><?php
627
  }
628
+
629
  /**
630
  * Should we display premium addon messages
631
  *
653
  }
654
  return $url;
655
  }
656
+
657
+
658
  /**
659
  * Get the registered widget instance by it's class name or the hash generated when it was registered.
660
  *
675
  }
676
  return null;
677
  }
678
+
679
  /**
680
  * Flag redirect to welcome page after activation
681
  *
tpl/admin-home-page.php CHANGED
File without changes
tpl/help.php CHANGED
File without changes
tpl/js-templates.php CHANGED
File without changes
tpl/metabox-panels.php CHANGED
File without changes
widgets/img/checks/black.png CHANGED
File without changes
widgets/img/checks/blue.png CHANGED
File without changes
widgets/img/checks/charcoal.png CHANGED
File without changes
widgets/img/checks/green.png CHANGED
File without changes
widgets/img/checks/light.png CHANGED
File without changes
widgets/img/checks/orange.png CHANGED
File without changes
widgets/img/checks/pink.png CHANGED
File without changes
widgets/img/checks/purple.png CHANGED
File without changes
widgets/img/checks/slate.png CHANGED
File without changes
widgets/img/checks/tirquoise.png CHANGED
File without changes
widgets/img/textures/dark-dashed.png CHANGED
File without changes
widgets/img/textures/light-dashed.png CHANGED
File without changes
widgets/js/admin.js CHANGED
File without changes
widgets/js/embedded-video.js CHANGED
File without changes
widgets/js/jquery.fitvids.min.js CHANGED
File without changes
widgets/less/functions.php CHANGED
File without changes
widgets/lib/color.php CHANGED
File without changes
widgets/lib/lessc.inc.php CHANGED
File without changes
widgets/migration.php CHANGED
File without changes
widgets/widgets.php CHANGED
File without changes
widgets/widgets/animated-image/animated-image.php CHANGED
File without changes
widgets/widgets/animated-image/js/main.js CHANGED
File without changes
widgets/widgets/animated-image/js/onscreen.js CHANGED
File without changes
widgets/widgets/animated-image/tpl/default.php CHANGED
File without changes
widgets/widgets/button/button.php CHANGED
File without changes
widgets/widgets/button/presets/simple.php CHANGED
File without changes
widgets/widgets/button/styles/simple.less CHANGED
File without changes
widgets/widgets/button/tpl/simple.php CHANGED
File without changes
widgets/widgets/call-to-action/call-to-action.php CHANGED
File without changes
widgets/widgets/call-to-action/presets/simple.php CHANGED
File without changes
widgets/widgets/call-to-action/styles/simple.less CHANGED
File without changes
widgets/widgets/call-to-action/tpl/simple.php CHANGED
File without changes
widgets/widgets/list/list.php CHANGED
File without changes
widgets/widgets/list/presets/simple.php CHANGED
File without changes
widgets/widgets/list/styles/simple.less CHANGED
File without changes
widgets/widgets/list/tpl/simple.php CHANGED
File without changes
widgets/widgets/price-box/presets/simple.php CHANGED
File without changes
widgets/widgets/price-box/price-box.php CHANGED
File without changes
widgets/widgets/price-box/styles/simple.less CHANGED
File without changes
widgets/widgets/price-box/tpl/simple.php CHANGED
File without changes
widgets/widgets/testimonial/presets/simple.php CHANGED
File without changes
widgets/widgets/testimonial/styles/simple.less CHANGED
File without changes
widgets/widgets/testimonial/testimonial.php CHANGED
File without changes
widgets/widgets/testimonial/tpl/simple.php CHANGED
File without changes