/*! For license information please see 359.min.js.LICENSE.txt */ "use strict";(self.webpackChunkreact_typescript_webpack_backend_editor=self.webpackChunkreact_typescript_webpack_backend_editor||[]).push([[359],{1736:(t,e,r)=>{r.r(e),r.d(e,{default:()=>P});var n=r(3871),o=r(935),i=r(7498),a=r(7264),c=r(5791),u=r(7579),l=r(3039),s=r(7894),h=r(824),f=r(4185),p=r(917),d=r(1234),v=r(3417),y=r(3425),m=r(6511);const _=r.p+"images/344512fa3e835050e39a.svg",g=r.p+"images/2e39db9b3cb737b3c6b5.png";var E=r(8008),O=r(230),b=r(7294),C=r(5944);function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function I(){I=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new L(o||[]);return n(a,"_invoke",{value:O(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function p(){}function d(){}var v={};u(v,i,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(S([])));m&&m!==e&&r.call(m,i)&&(v=m);var _=d.prototype=f.prototype=Object.create(v);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function o(n,i,a,c){var u=s(t[n],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==T(h)&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,c)}))}c(u.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function b(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=d,n(_,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},g(E.prototype),u(E.prototype,a,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(_),u(_,c,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function w(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var S=function(t){var e,r,i=t.icon,u=(0,d.$)(),l=(e=(0,b.useState)(Boolean(i.published)),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=l[0],h=l[1],f=(0,E.hC)(),p=(0,E.eP)();return(0,C.tZ)(v.Z,{children:(0,C.BX)("div",{css:Z.itemWrapper,children:[(0,C.tZ)("div",{css:Z.thumbWrapper,children:(0,C.tZ)("img",{src:i.thumb,alt:i.name})}),(0,C.BX)("div",{css:Z.footer,children:[(0,C.tZ)("h6",{children:i.title}),f.isLoading?(0,C.tZ)(o.ZP,{size:20}):(0,C.tZ)(c.Z,{checked:s,onChange:function(){var t,e=(t=I().mark((function t(e){return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.mutateAsync({id:i.id,status:e?1:0});case 2:h(!s);case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){w(i,n,o,a,c,"next",t)}function c(t){w(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}()})]}),(0,C.tZ)("div",{css:Z.thumbOverlay,"data-thumb-overlay":!0,children:(0,C.tZ)(n.Z,{variant:"error",icon:(0,C.tZ)(a.Z,{name:"trash"}),onClick:function(){confirm(u("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_DELETE_CONFIRMATION"))&&p.mutate(i.id)},loading:p.isLoading,children:u("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_DELETE")})})]})},i.id)};const P=function(){var t,e,r,o=(0,d.$)(),c=(0,b.useRef)(null),h=(0,E.uw)(),f=(0,E.Ap)();return O.Eu?(0,C.BX)(l.Z,{children:[(0,C.tZ)(s.Z,{title:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_PAGE_TITLE"),subtitle:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_PAGE_SUB_TITLE"),action:(0,C.tZ)(n.Z,{icon:(0,C.tZ)(a.Z,{name:"upload"}),disabled:!0,children:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_UPLOAD_ICON")})}),(0,C.tZ)(u.Z,{children:(0,C.tZ)(y.Z,{emptyStateImage:g,imageAltText:"upgrade to pro",title:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_LIBRARY"),content:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_LIBRARY_CONTENT"),action:(0,C.tZ)(i.Z,{}),orientation:"vertical",customCss:Z.proBannerContentCss})})]}):(0,C.BX)(l.Z,{children:[(0,C.tZ)(s.Z,{title:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_PAGE_TITLE"),subtitle:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_PAGE_SUB_TITLE"),action:(0,C.BX)(C.HY,{children:[(0,C.tZ)(n.Z,{icon:(0,C.tZ)(a.Z,{name:"upload"}),onClick:function(){var t;return null===(t=c.current)||void 0===t?void 0:t.click()},loading:f.isLoading,children:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_UPLOAD_ICON")}),(0,C.tZ)("input",{ref:c,type:"file","aria-hidden":"true",hidden:!0,onChange:function(t){var e,r=null===(e=t.target.files)||void 0===e?void 0:e[0];r&&f.mutate(r)}})]})}),(0,C.tZ)(u.Z,{children:(0,C.tZ)(m.Z,{query:h,children:(null!==(t=null===(e=h.data)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0?(0,C.tZ)("div",{css:Z.wrapper,children:null===(r=h.data)||void 0===r?void 0:r.map((function(t){return(0,C.tZ)(S,{icon:t},t.id)}))}):(0,C.tZ)("div",{css:Z.emptyStateWrapper,children:(0,C.tZ)(y.Z,{orientation:"vertical",emptyStateImage:_,imageAltText:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_EMPTY_STATE_TITLE"),title:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_EMPTY_STATE_TITLE"),content:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_EMPTY_STATE_CONTENT"),action:(0,C.tZ)(n.Z,{icon:(0,C.tZ)(a.Z,{name:"upload"}),onClick:function(){var t;return null===(t=c.current)||void 0===t?void 0:t.click()},loading:f.isLoading,children:o("COM_SPPAGEBUILDER_EDITOR_CUSTOM_ICON_UPLOAD_ICON")})})})})})]})};var Z={emptyStateWrapper:(0,p.iv)("margin-top:",h.W0[72],";;label:emptyStateWrapper;"),wrapper:(0,p.iv)("display:grid;grid-template-columns:repeat(4, 1fr);gap:",h.W0[32],";padding:",h.W0[24]," 0;;label:wrapper;"),itemWrapper:(0,p.iv)("position:relative;border-radius:",h.E0[5],";overflow:hidden;;label:itemWrapper;"),thumbWrapper:{name:"fgdz63-thumbWrapper",styles:"&:hover~[data-thumb-overlay]{visibility:visible;opacity:1;}img{width:100%;};label:thumbWrapper;"},thumbOverlay:(0,p.iv)("position:absolute;inset:0;background-color:",h.qo.alternate.backdrop,";display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:0;transition:opacity 0.3s ease;z-index:",h.W5.positive,";&:hover{visibility:visible;opacity:1;};label:thumbOverlay;"),footer:(0,p.iv)("display:flex;justify-content:space-between;padding:",h.W0[10]," ",h.W0[16],";h6{",f.c.heading6("medium"),";line-height:",h.Nv[20],";};label:footer;"),proBannerContentCss:(0,p.iv)("padding:",h.W0[12],";;label:proBannerContentCss;")}}}]);