2022-09-23 21:55:30 +02:00
|
|
|
*/!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var o=r.apply(null,n);o&&e.push(o)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)i.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};!function(){"use strict";n.r(i),n.d(i,{MoveToWidgetArea:function(){return X},addWidgetIdToBlock:function(){return K},getWidgetIdFromBlock:function(){return q},registerLegacyWidgetBlock:function(){return ee},registerLegacyWidgetVariations:function(){return Y},registerWidgetGroupBlock:function(){return te}});var e={};n.r(e),n.d(e,{metadata:function(){return W},name:function(){return O},settings:function(){return j}});var t={};n.r(t),n.d(t,{metadata:function(){return $},name:function(){return Z},settings:function(){return U}});var r=window.wp.blocks,a=window.wp.element,o=window.wp.primitives;var s=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.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"})),l=n(4403),c=n.n(l),d=window.wp.blockEditor,u=window.wp.components;var m=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.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=window.wp.i18n,w=window.wp.data,g=window.wp.coreData;function p(e){let{selectedId:t,onSelect:n}=e;const i=(0,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(g.store).getWidgetTypes({per_page:-1}))||void 0===i?void 0:i.filter((e=>!r.includes(e.id)))}),[]);return i?0===i.length?(0,h.__)("There are no widgets available."):(0,a.createElement)(u.SelectControl,{label:(0,h.__)("Select a legacy widget to display:"),value:null!=t?t:"",options:[{value:"",label:(0,h.__)("Select widget")},...i.map((e=>({value:e.id,label:e.name})))],onChange:e=>{if(e){const t=i.find((t=>t.id===e));n({selectedId:t.id,isMulti:t.is_multi})}else n({selectedId:null})}}):(0,a.createElement)(u.Spinner,null)}function f(e){let{name:t,description:n}=e;return(0,a.createElement)("div",{className:"wp-block-legacy-widget-inspector-card"},(0,a.createElement)("h3",{className:"wp-block-legacy-widget-inspector-card__name"},t),(0,a.createElement)("span",null,n))}var v=window.wp.notices,b=window.wp.compose,y=window.lodash,E=window.wp.apiFetch,_=n.n(E);class k{constructor(e){let{id:t,idBase:n,instance:i,onChangeInstance:r,onChangeHasPreview:a,onError:o}=e;this.id=t,this.idBase=n,this._instance=i,this._hasPreview=null,this.onChange
|