2021-07-06 10:38:40 -04:00
|
|
|
this.wp=this.wp||{},this.wp.widgets=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="4g8P")}({"1ZqX":function(e,t){e.exports=window.wp.data},"4g8P":function(e,t,n){"use strict";n.r(t),n.d(t,"MoveToWidgetArea",(function(){return R})),n.d(t,"getWidgetIdFromBlock",(function(){return G})),n.d(t,"addWidgetIdToBlock",(function(){return Z})),n.d(t,"registerLegacyWidgetBlock",(function(){return U})),n.d(t,"registerLegacyWidgetVariations",(function(){return z}));var i={};n.r(i),n.d(i,"metadata",(function(){return W})),n.d(i,"name",(function(){return N})),n.d(i,"settings",(function(){return A}));var r=n("HSyU"),o=n("GRId"),a=n("Tqx9");var s=Object(o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(a.Path,{d:"M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"})),c=n("TSYQ"),l=n.n(c),d=n("axFQ"),u=n("tI+e");var m=Object(o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(a.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),h=n("l3Sj"),w=n("1ZqX"),b=n("jZUy");function g({selectedId:e,onSelect:t}){const n=Object(w.useSelect)(e=>{var t,n,i;const r=null!==(t=null===(n=e(d.store).getSettings())||void 0===n?void 0:n.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return null===(i=e(b.store).getWidgetTypes({per_page:-1}))||void 0===i?void 0:i.filter(e=>!r.includes(e.id))},[]);return n?0===n.length?Object(h.__)("There are no widgets available."):Object(o.createElement)(u.SelectControl,{label:Object(h.__)("Select a legacy widget to display:"),value:null!=e?e:"",options:[{value:"",label:Object(h.__)("Select widget")},...n.map(e=>({value:e.id,label:e.name}))],onChange:e=>{if(e){const i=n.find(t=>t.id===e);t({selectedId:i.id,isMulti:i.is_multi})}else t({selectedId:null})}}):Object(o.createElement)(u.Spinner,null)}function p({name:e,description:t}){return Object(o.createElement)("div",{className:"wp-block-legacy-widget-inspector-card"},Object(o.createElement)("h3",{className:"wp-block-legacy-widget-inspector-card__name"},e),Object(o.createElement)("span",null,t))}var f=n("onLe"),v=n("K9lf"),y=n("YLtl"),j=n("ywyh"),O=n.n(j);class _{constructor({id:e,idBase:t,instance:n,onChangeInstance:i,onChangeHasPreview:r,onError:o}){this.id=e,this.idBase=t,this._instance=n,this._hasPreview=null,this.onChangeInstance=i,this.onChangeHasPreview=r,this.onError=o,this.number=++E,this.handleFormChange=Object(y.debounce)(this.handleFormChange.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}i
|