/*! For license information please see 980.min.js.LICENSE.txt */ "use strict";(self.webpackChunkreact_typescript_webpack_backend_editor=self.webpackChunkreact_typescript_webpack_backend_editor||[]).push([[980],{6184:(t,e,r)=>{r.d(e,{U:()=>x});var n=r(824),o=r(4185),i=r(917),a=r(7264),c=r(5944);const l=function(t){var e=t.type,r=void 0===e?"primary":e,n=t.message,o=void 0===n?"":n;return(0,c.tZ)("div",{css:u.modalWrapper(r),children:(0,c.BX)("div",{css:u.content(r),children:[(0,c.tZ)(a.Z,{name:r,width:20,height:20}),o]})})};var u={modalWrapper:function(t){return(0,i.iv)("max-width:450px;min-height:30px;background:",n.qo.background[t],";border-radius:",n.E0[4],";;label:modalWrapper;")},content:function(t){return(0,i.iv)("padding:",n.W0[8]," ",n.W0[12],";",o.c.body()," color:",n.qo.text[t],";display:flex;align-items:center;gap:",n.W0[4],";;label:content;")}},s=r(3871),d=r(7870),f=r(7898),p=r(1234),h=r(2328),y=r(230),v=r(7294),b=r(1337),g=r(9781);function m(t){return m="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},m(t)}function E(){E=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 l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new I(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=u;var d={};function f(){}function p(){}function h(){}var y={};l(y,i,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(x([])));b&&b!==e&&r.call(b,i)&&(y=b);var g=h.prototype=f.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(n,i,a,c){var l=s(t[n],t,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==m(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(l.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=P(a,r);if(c){if(c===d)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 l=s(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function P(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,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;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,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function x(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:C}}function C(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=l(h,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,h):(t.__proto__=h,l(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},w(_.prototype),l(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(g),l(g,c,"Generator"),l(g,i,(function(){return this})),l(g,"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=x,I.prototype={constructor:I,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(L),!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"),l=r.call(i,"finallyLoc");if(c&&l){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(!l)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,d):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),d},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),L(r),d}},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;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){O(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function O(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==m(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===m(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function S(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){P(i,n,o,a,c,"next",t)}function c(t){P(i,n,o,a,c,"throw",t)}a(void 0)}))}}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 I=function(t){var e,r,n=t.title,o=t.label,i=t.bulkAction,a=t.confirmButtonText,u=t.closeModal,b=t.mutationFn,m=t.invalidateKeys,w=t.skipMutation,O=void 0!==w&&w,P=t.payload,I=(0,p.$)(),x=(0,h.v)((function(t){return t.appConfig})),D={language:"languages",access:"access_levels",category:"categories"},A=(e=(0,v.useState)({label:(0,y.$K)(x[D[i]])&&x[D[i]].length>0?x[D[i]][0].label:"",value:(0,y.$K)(x[D[i]])&&x[D[i]].length>0?x[D[i]][0].value:""}),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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)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.")}()),T=A[0],k=A[1],j=(0,f.A)({mutationFn:b,invalidateKeys:m});return(0,c.tZ)(g.Z,{onClose:function(){return u({action:"CLOSE"})},title:n,headerCss:C.modalHeaderCss,contentCss:C.modalContentCss,wrapperCss:C.modalWrapper,children:(0,c.BX)("div",{children:[(0,c.BX)("div",{css:C.content,children:[x[D[i]].length>0?(0,c.tZ)(l,{type:"primary",message:I("COM_SPPAGEBUILDER_EDITOR_BULK_ACTION_MODAL_INFO")}):(0,c.tZ)(l,{type:"warning",message:I("COM_SPPAGEBUILDER_EDITOR_BULK_ACTION_MODAL_WARNING")}),(0,c.tZ)(d.Z,{options:x[D[i]],value:T,label:o,onChange:function(t){k(t)},clearOption:function(){return k({label:"",value:""})}})]}),(0,c.BX)("div",{css:C.footerWrapper,children:[(0,c.tZ)(s.Z,{variant:"secondary",onClick:function(){return u({action:"CLOSE"})},children:I("COM_SPPAGEBUILDER_EDITOR_CANCEL")}),(0,c.tZ)(s.Z,{disabled:0===x[D[i]].length||""===T.value,onClick:S(E().mark((function t(){var e,r;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!O){t.next=3;break}return u({action:"CONFIRM"}),t.abrupt("return");case 3:if(!P){t.next=11;break}return t.next=6,j.mutateAsync(_(_({},P),{},{value:T.value}));case 6:if(e=t.sent,r=e.data,!((0,y.$K)(r.status)?r.status:r)){t.next=11;break}return u({action:"CONFIRM"}),t.abrupt("return");case 11:u({action:"CLOSE"});case 12:case"end":return t.stop()}}),t)}))),loading:j.isLoading,children:a||I("COM_SPPAGEBUILDER_EDITOR_UPDATE")})]})]})})},x=function(){var t=(0,b.d)().showModal;return function(e){return t({component:I,props:e,closeOnOutsideClick:!0})}},C={modalWrapper:{name:"1utdhwa-modalWrapper",styles:"max-width:450px;label:modalWrapper;"},content:(0,i.iv)("display:flex;flex-direction:column;gap:",n.W0[16],";padding:",n.W0[16]," ",n.W0[24],";p{",o.c.body(),";};label:content;"),footerWrapper:(0,i.iv)("display:flex;justify-content:end;gap:",n.W0[8],";padding:",n.W0[12]," ",n.W0[16],";box-shadow:",n.AF.dividerTop,";;label:footerWrapper;"),modalHeaderCss:(0,i.iv)("padding:",n.W0[12]," ",n.W0[24],";;label:modalHeaderCss;"),modalContentCss:(0,i.iv)("background-color:",n.qo.background.white,";;label:modalContentCss;"),labelCss:(0,i.iv)("width:fit-content;",o.c.body("medium"),";;label:labelCss;")}},7995:(t,e,r)=>{r.d(e,{Z:()=>mt});var n=r(9085),o=r(9313),i=r(824),a=r(4185),c=r(917),l=r(1234),u=r(230),s=r(4101),d=r(3579),f=r(7264),p=r(1954),h=r(1921),y=r(7294),v=r(5944);function b(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}const g=function(t){var e,r,n=t.value,o=t.options,i=t.onChange,a=void 0===i?u.ZT:i,c=t.label,l=t.disabled,s=(e=(0,y.useState)(!1),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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return b(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)?b(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.")}()),h=s[0],g=s[1],m=(0,p.l)({isOpen:h,isDropdown:!0}),E=m.triggerRef,O=m.triggerWidth,P=m.position,S=m.popoverRef,L=o.find((function(t){return t.value===n})),I={0:"unpublished",1:"published","-2":"trashed"};if(!(0,u.$K)(n)||(0,u.$K)(n)&&!(n in I))return null;var x=_[I[n]];return(0,v.BX)("div",{css:w.mainWrapper,children:[!!c&&(0,v.tZ)("div",{children:c}),(0,v.BX)("button",{type:"button",css:w.dropDownLabel({statusVariant:x,isOpen:h,isDisabled:l||!o.length}),onClick:function(){return g(!0)},ref:E,disabled:l,children:[(0,v.BX)("div",{children:[x.leftIcon,(0,v.tZ)("span",{children:(null==L?void 0:L.label)||""})]}),(0,v.tZ)(f.Z,{name:"chevronDown",width:12,height:8})]}),(0,v.tZ)(p.h,{isOpen:h,onClickOutside:function(){return g(!1)},children:(0,v.tZ)("div",{css:[w.optionsWrapper,{left:P.left,top:P.top,maxWidth:O},";label:StatusSelect;"],ref:S,children:(0,v.tZ)("ul",{css:w.options,children:o.map((function(t){return(0,v.tZ)("li",{css:w.optionItem({isSelected:n===t.value}),children:(0,v.tZ)(d.Z,{label:t.label,checked:n===t.value,onChange:function(){g(!1),a(t)},labelCss:w.radioLabel,disabled:t.disabled})},t.value)}))})})})]})};var m={name:"1f3qfry-dropDownLabel",styles:"pointer-events:none;label:dropDownLabel;"},E={name:"i3yy6i-dropDownLabel",styles:"transform:rotate(180deg);label:dropDownLabel;"},w={mainWrapper:{name:"e9i770-mainWrapper",styles:"width:100%;label:mainWrapper;"},dropDownLabel:function(t){var e=t.statusVariant,r=t.isOpen,n=void 0!==r&&r,o=t.isDisabled,a=void 0!==o&&o;return(0,c.iv)(h.iZ.resetButton," width:124px;display:flex;justify-content:space-between;align-items:center;border-radius:42px;height:24px;padding:0 ",i.W0[8]," 0 ",i.W0[6],";border:1px solid ",e.borderColor,";background-color:",e.backgroundColor,";position:relative;div{display:flex;gap:",i.W0[4],";align-items:center;span{color:",e.color,";}svg{height:16px;width:16px;color:",e.leftIconColor,";transform:none;}}& svg{width:12px;height:8px;color:",e.rightIconColor,";transition:transform 0.3s ease-in-out;",n&&E," ",a&&m,";}",a&&(0,c.iv)("background-color:",i.qo.background.disabled,";border:1px solid ",i.qo.stroke.disabled,";div{span{color:",i.qo.text.disabled,";}svg{color:",i.qo.icon.disabled,";}};label:dropDownLabel;"),";;label:dropDownLabel;")},optionsWrapper:{name:"1cmtbh-optionsWrapper",styles:"position:absolute;min-width:170px;width:100%;label:optionsWrapper;"},options:(0,c.iv)("z-index:",i.W5.dropdown,";background-color:",i.qo.base.white,";list-style-type:none;box-shadow:",i.AF.popover,";padding:",i.W0[4]," 0;margin:0;max-height:500px;overflow-y:auto;border-radius:",i.E0[6],";::-webkit-scrollbar{background-color:",i.qo.base.white,";width:10px;}::-webkit-scrollbar-thumb{background-color:",i.qo.base.secondary,";border-radius:",i.E0[6],";};label:options;"),optionItem:function(t){var e=t.isSelected;return(0,c.iv)(a.c.body(),";min-height:40px;transition:background-color 0.3s ease-in-out;:hover{background-color:",i.qo.background.hover,";}",e&&(0,c.iv)("background-color:",i.qo.background.active,";;label:optionItem;"),";;label:optionItem;")},radioLabel:(0,c.iv)("line-height:40px;padding-left:",i.W0[12],";;label:radioLabel;")},_={published:{backgroundColor:i.qo.background.success,borderColor:i.qo.stroke.success,color:i.qo.base.success,leftIconColor:i.qo.base.success,rightIconColor:i.qo.icon.success,leftIcon:(0,v.tZ)(f.Z,{name:"markCircle",width:16,height:16})},unpublished:{backgroundColor:i.qo.background.neutral,borderColor:i.qo.stroke.neutral,color:i.qo.text.neutral,leftIconColor:i.qo.icon.hints,rightIconColor:i.qo.icon.default,leftIcon:(0,v.tZ)(f.Z,{name:"circleCross",width:16,height:16})},trashed:{backgroundColor:i.qo.background.danger,borderColor:i.qo.stroke.danger,color:i.qo.text.error,leftIconColor:i.qo.icon.error,rightIconColor:i.qo.icon.error,leftIcon:(0,v.tZ)(f.Z,{name:"crossCircle",width:16,height:16})}},O=r(1731),P=r(5350),S=r(3871),L=r(935),I=r(8122),x=r(802),C=r(6537),D=r(6492),A=r(4469),T=r(5501),k=function(t){return T.u.put(C.H.ADD_TO_MENU,t.data)},j=r(7536),R=r(9781);function Z(t){return Z="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},Z(t)}function G(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?G(Object(r),!0).forEach((function(e){B(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function B(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Z(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Z(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function U(){U=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 l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new S(o||[]);return n(a,"_invoke",{value:w(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=u;var d={};function f(){}function p(){}function h(){}var y={};l(y,i,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(L([])));b&&b!==e&&r.call(b,i)&&(y=b);var g=h.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function o(n,i,a,c){var l=s(t[n],t,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==Z(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(l.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 w(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=_(a,r);if(c){if(c===d)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 l=s(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function _(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,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;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,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(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:I}}function I(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=l(h,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,h):(t.__proto__=h,l(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(E.prototype),l(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(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),l(g,c,"Generator"),l(g,i,(function(){return this})),l(g,"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=L,S.prototype={constructor:S,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(P),!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"),l=r.call(i,"finallyLoc");if(c&&l){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(!l)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,d):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),d},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),P(r),d}},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;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function N(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}const W=function(t){var e,r=t.closeModal,n=t.title,o=t.id,i=(0,l.$)(),a=(0,x.O)({defaultValues:{page_id:o,menu_id:0,parent_id:1,menu_type:"mainmenu",title:"",alias:"",ordering:0}}),c=a.setValue,u=a.reset,s=a.getValues,d=a.watch,f=function(t){var e=(0,O.p)().showToast;return(0,D.a)({queryKey:["MenuByPageId",t],queryFn:function(){return function(t){return T.u.get(C.H.MENU_BY_PAGE_ID,{params:{id:t}})}(t).then((function(t){return t.data}))},onError:function(t){e({type:"danger",message:t.message})}})}(o),p=(e=(0,O.p)().showToast,(0,D.a)({queryKey:["MenuList"],queryFn:function(){return T.u.get(C.H.MENU_LIST).then((function(t){return t.data}))},onError:function(t){e({type:"danger",message:t.message})}})),h=function(t){var e=t.menutype,r=t.id,n=(0,O.p)().showToast;return(0,D.a)({queryKey:["MenuParentItems",e,r],queryFn:function(){return function(t){var e=t.menutype,r=t.id;return T.u.get(C.H.MENU_PARENT_ITEMS,{params:{menutype:e,id:r}})}({menutype:e,id:r}).then((function(t){return t.data}))},onError:function(t){n({type:"danger",message:t.message})}})}({menutype:d("menu_type"),id:s("menu_id")}),b=function(){var t=(0,O.p)().showToast,e=(0,l.$)();return(0,A.D)({mutationFn:k,onSuccess:function(){t({type:"success",message:e("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_SUCCESS_MESSAGE")})},onError:function(e){t({type:"danger",message:e.message})}})}();return(0,y.useEffect)((function(){f.data&&u({menu_id:f.data.id,parent_id:f.data.parent_id,menu_type:f.data.menutype,title:f.data.title,alias:f.data.alias,ordering:f.data.id})}),[f.data,u]),f.isLoading||p.isLoading?(0,v.tZ)(L.fz,{}):(0,v.tZ)(R.Z,{onClose:function(){return r({action:"CLOSE"})},title:n,wrapperCss:q.wrapper,children:(0,v.BX)("form",{onSubmit:a.handleSubmit(function(){var t,e=(t=U().mark((function t(e){return U().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,b.mutateAsync({id:o,data:e});case 2:t.sent.data&&r({action:"CONFIRM"});case 4: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){N(i,n,o,a,c,"next",t)}function c(t){N(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}()),children:[(0,v.BX)("div",{css:q.fieldWrapper,children:[(0,v.tZ)(j.Qr,{name:"title",control:a.control,render:function(t){return(0,v.tZ)(P.Z,M(M({},t),{},{label:i("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU_TITLE")}))}}),(0,v.tZ)(j.Qr,{name:"alias",control:a.control,render:function(t){return(0,v.tZ)(P.Z,M(M({},t),{},{label:i("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU_ALIAS")}))}}),(0,v.tZ)(j.Qr,{name:"menu_type",control:a.control,render:function(t){var e;return(0,v.tZ)(I.Z,M(M({},t),{},{label:i("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU"),options:null!==(e=p.data)&&void 0!==e?e:[],isClearable:!1,onChange:function(){c("parent_id",1)}}))}}),(0,v.tZ)(j.Qr,{name:"parent_id",control:a.control,render:function(t){var e;return(0,v.tZ)(I.Z,M(M({},t),{},{label:i("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_MENU_PARENT"),options:null!==(e=h.data)&&void 0!==e?e:[],isClearable:!1}))}})]}),(0,v.BX)("div",{css:q.buttonWrapper,children:[(0,v.tZ)(S.Z,{variant:"secondary",onClick:function(){return r({action:"CLOSE"})},children:i("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_CANCEL")}),(0,v.tZ)(S.Z,{type:"submit",loading:b.isLoading,children:i("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_SAVE_CHANGES")})]})]})})};var q={wrapper:{name:"1vd4vqj-wrapper",styles:"max-width:500px;label:wrapper;"},fieldWrapper:(0,c.iv)("background-color:",i.qo.base.white,";padding:",i.W0[20],";display:flex;flex-direction:column;gap:",i.W0[12],";;label:fieldWrapper;"),buttonWrapper:(0,c.iv)("background-color:",i.qo.background.white,";box-shadow:",i.AF.dividerTop,";padding:",i.W0[12]," ",i.W0[16],";display:flex;justify-content:end;gap:",i.W0[8],";;label:buttonWrapper;")},F=r(3816),X=r(5827),H=r(1337),$=r(1974),K=r(3106),Y=r(8138),V=r(5587),Q=r(4285);function z(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 J=r(1709),tt=r(908),et=r(9101),rt=r(1073),nt=r(2328),ot=r(7184),it=r(7679),at=r(6680),ct=r(9655);function lt(t){return lt="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},lt(t)}function ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function st(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(r),!0).forEach((function(e){dt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==lt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===lt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ft(){ft=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 l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),c=new S(o||[]);return n(a,"_invoke",{value:w(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=u;var d={};function f(){}function p(){}function h(){}var y={};l(y,i,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(L([])));b&&b!==e&&r.call(b,i)&&(y=b);var g=h.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function o(n,i,a,c){var l=s(t[n],t,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==lt(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,c)}),(function(t){o("throw",t,a,c)})):e.resolve(d).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,c)}))}c(l.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 w(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=_(a,r);if(c){if(c===d)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 l=s(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function _(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,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;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,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function L(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:I}}function I(){return{value:void 0,done:!0}}return p.prototype=h,n(g,"constructor",{value:h,configurable:!0}),n(h,"constructor",{value:p,configurable:!0}),p.displayName=l(h,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,h):(t.__proto__=h,l(t,c,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(E.prototype),l(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(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),l(g,c,"Generator"),l(g,i,(function(){return this})),l(g,"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=L,S.prototype={constructor:S,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(P),!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"),l=r.call(i,"finallyLoc");if(c&&l){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(!l)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,d):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),d},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),P(r),d}},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;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function pt(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function ht(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){pt(i,n,o,a,c,"next",t)}function c(t){pt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function yt(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}const vt=function(t){var e,r,o,c=t.selectedItems,s=t.index,d=t.page,p=t.data,b=t.lastSelectedIndex,m=t.setLastSelectedIndex,E=t.setSelectedItems,w=t.columns,_=t.isPopup,S=(0,l.$)(),L=function(){var t,e,r=(t=(0,y.useState)(!1),e=2,function(t){if(Array.isArray(t))return t}(t)||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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return z(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)?z(t,e):void 0}}(t,e)||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.")}()),n=r[0],o=r[1],i=function(t){"shift"===t.key.toLowerCase()&&o(!0)},a=function(t){"shift"===t.key.toLowerCase()&&o(!1)};return(0,y.useEffect)((function(){return window.addEventListener("keydown",i),window.addEventListener("keyup",a),function(){window.removeEventListener("keydown",i),window.removeEventListener("keyup",a)}}),[]),n}(),I=(0,H.d)().showModal,C=(0,O.p)().showToast,D=(0,F.g)(),A=(r=(0,y.useState)(!1),o=2,function(t){if(Array.isArray(t))return t}(r)||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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return yt(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)?yt(t,e):void 0}}(r,o)||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.")}()),T=A[0],k=A[1],R=(0,nt.v)((function(t){return t.appConfig})),Z=(0,it.R4)(),G=(0,it.es)(),M=(0,ot.Xu)(),B=(0,J.T)().closeSettingPanel,U=(0,rt.j)((function(t){return t.setActiveAction})),N=(0,X.L)(),q=(0,tt.Q)(),lt=(0,x.O)({defaultValues:{title:d.title}}),ut=(0,V.nB)({id:d.id}),dt=ut.attributes,pt=ut.listeners,vt=ut.setNodeRef,bt=ut.transform,mt=ut.transition,Et=ut.isDragging,wt={transform:Q.ux.Transform.toString(bt),transition:mt,zIndex:Et?i.W5.positive:i.W5.level,backgroundColor:Et?i.qo.background.hover:""};(0,y.useEffect)((function(){var t=function(t){"Escape"===t.key&&(k(!1),lt.reset({title:d.title}))};return window.addEventListener("keydown",t),function(){window.removeEventListener("keydown",t)}}),[]);var _t=d.permissions.page.edit,Ot=q.edit_own&&d.created_by===R.user_id,Pt=_t||Ot,St=q.create&&Pt,Lt=d.permissions.page.edit_state,It=d.permissions.page.delete,xt=[{id:"view",icon:"eye",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_VIEW"},{id:"rename",icon:"pencil",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_RENAME",isDisabled:!Pt},{id:"duplicate",icon:"cloneLine",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_DUPLICATE",isDisabled:!St},{id:"copyLink",icon:"link",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_COPY_LINK"},{id:"addToMenu",icon:"plus",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_ADD_TO_MENU",isDisabled:!Pt},{id:"export",icon:"upload",title:"COM_SPPAGEBUILDER_EDITOR_PAGE_EXPORT",isDisabled:!Pt},{id:"remove",icon:"trash",title:-2===d.published?"COM_SPPAGEBUILDER_EDITOR_PAGE_DELETE":"COM_SPPAGEBUILDER_EDITOR_PAGE_TRASH",variant:"critical",isDisabled:!It}],Ct=[{label:S("COM_SPPAGEBUILDER_EDITOR_FILTER_PUBLISHED"),value:1,disabled:!Lt},{label:S("COM_SPPAGEBUILDER_EDITOR_FILTER_UNPUBLISHED"),value:0,disabled:!Lt},{label:S("COM_SPPAGEBUILDER_EDITOR_FILTER_TRASHED"),value:-2,disabled:!Lt||!It}],Dt=function(){var t=ht(ft().mark((function t(){var e,r,n;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,N({title:S("COM_SPPAGEBUILDER_EDITOR_PAGE_EXPORT_TITLE")});case 2:e=t.sent,r=e.action,n=e.seoChecked,"CONFIRM"===r&&M.mutateAsync({pageId:String(d.id),isSeoChecked:n});case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,v.BX)("tr",{css:gt.bodyTr({isSelected:c.ids.includes(d.id),isShownFrontendButton:R.enable_frontend_editing&&Pt}),ref:vt,style:wt,children:[(0,v.BX)("td",{css:gt.checkboxWrapper,children:[(0,v.tZ)("div",st(st(st({css:gt.dragPoint,"data-drag-point":!0},dt),pt),{},{children:(0,v.tZ)(f.Z,{name:"dragger",height:32,width:32})})),(0,v.tZ)(n.Z,{onChange:function(t){var e=(0,u.R5)({itemId:d.id,isShiftHolding:L,lastSelectedIndex:b,currentIndex:s,isChecked:t,selectedItemIds:c.ids,selectedItemsIndex:c.indexes,totalItemsList:p}),r=e.updatedItemIds,n=e.updatedItemIndexes;E({ids:r,indexes:n}),m(s)},checked:c.ids.includes(d.id)})]}),(0,v.tZ)("td",{children:(0,v.tZ)("div",{css:gt.pageName,children:T?(0,v.tZ)("form",{onSubmit:lt.handleSubmit((0,at.GI)(lt,function(){var t=ht(ft().mark((function t(e){var r;return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.title,t.next=3,Z.mutateAsync({ids:d.id.toString(),type:"rename",value:r});case 3:k(!1);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())),children:(0,v.tZ)(j.Qr,{control:lt.control,name:"title",render:function(t){return(0,v.tZ)(P.Z,st(st({},t),{},{hasAutoFocus:!0}))}})}):(0,v.BX)(v.HY,{children:[Pt?function(t){return(0,v.tZ)(ct.rU,{css:gt.titleButton({canEdit:Pt}),to:t?Y.F.PopupEditor.buildLink({id:d.id.toString(),type:""}):Y.F.PageEditor.buildLink({id:d.id.toString(),type:""}),state:{prevPageName:K.lr},onClick:function(){U(void 0),B()},children:d.title})}(_):(0,v.tZ)("span",{css:gt.titleButton({canEdit:Pt}),children:d.title}),0!==d.checked_out&&(0,v.tZ)("button",{type:"button",css:gt.lockButton,onClick:function(){Z.mutate({type:"check-out",ids:d.id.toString()})},children:(0,v.tZ)(f.Z,{name:"lock",width:24,height:24})}),R.enable_frontend_editing&&Pt&&(0,v.BX)("a",{"data-frontend-editor-button":!0,css:gt.frontendEditorButton,href:d.url,target:"_blank",rel:"noopener noreferrer",children:[(0,v.tZ)(f.Z,{name:"parmaLink",width:16,height:16}),(0,v.tZ)("span",{children:S("COM_SPPAGEBUILDER_EDITOR_FRONTEND_EDITOR")})]})]})})}),w.includes("author")&&(0,v.tZ)("td",{css:gt.widthStyles({width:200}),children:(0,v.tZ)("p",{children:d.author})}),w.includes("categories")&&(0,v.tZ)("td",{children:(0,v.tZ)("p",{children:d.category})}),w.includes("access")&&(0,v.tZ)("td",{css:gt.access,children:(0,v.tZ)("p",{children:d.access_title})}),w.includes("id")&&(0,v.tZ)("td",{css:[a.c.body("medium"),h.iZ.textCenter,";label:PageListItem;"],children:(0,v.tZ)("p",{children:d.id})}),w.includes("hits")&&(0,v.tZ)("td",{css:[a.c.body("medium"),h.iZ.textCenter,";label:PageListItem;"],children:d.hits}),w.includes("language")&&(0,v.tZ)("td",{css:h.iZ.textCenter,children:(0,v.tZ)("p",{children:null!==(e=d.language_title)&&void 0!==e?e:S("COM_SPPAGEBUILDER_EDITOR_LANGUAGE_ALL")})}),(0,v.tZ)("td",{css:gt.status,children:(0,v.tZ)(g,{value:d.published,options:Ct,onChange:function(t){Z.mutate({type:{1:"published",0:"unpublished","-2":"trash"}[t.value],ids:d.id.toString()})},disabled:!Lt})}),(0,v.tZ)("td",{css:gt.actionColumn,children:(0,v.tZ)(et.Z,{actions:xt,triggerButtonContent:(0,v.tZ)(f.Z,{name:"ellipsisX",width:24,height:24,style:gt.triggerIcon}),onSelect:function(){var t=ht(ft().mark((function t(e){return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="remove"===t.t0?3:"addToMenu"===t.t0?12:"view"===t.t0?14:"copyLink"===t.t0?16:"duplicate"===t.t0?18:"export"===t.t0?20:"rename"===t.t0?22:25;break;case 3:if(-2===d.published){t.next=6;break}return Z.mutate({type:"trash",ids:d.id.toString()}),t.abrupt("break",25);case 6:return t.next=8,D({title:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_TITLE"),confirmationMessage:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_MESSAGE_SINGLE_PAGE"),confirmButtonText:S("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_DELETE_MODAL_DELETE_BUTTON_TEXT_SINGLE_ITEM"),mutationFn:it.hh,payload:{ids:d.id.toString(),type:"delete"},invalidateKeys:[["PageList"]]});case 8:return"CONFIRM"===t.sent.action&&C({type:"success",message:S("COM_SPPAGEBUILDER_EDITOR_BULK_ACTION_PERFORMED_SUCCESSFULLY")}),t.abrupt("break",25);case 12:return I({component:W,props:{title:S("COM_SPPAGEBUILDER_EDITOR_ADD_TO_MENU_MODAL_TITLE"),id:d.id}}),t.abrupt("break",25);case 14:return window.open(d.preview,"_blank","noopener=true,noreferrer=true"),t.abrupt("break",25);case 16:return r="".concat($.Z.APPLICATION_ROOT,"index.php?option=com_sppagebuilder&view=page&id=").concat(d.id),n=void 0,(n=document.createElement("textarea")).value=r,n.setAttribute("readonly",""),n.style.position="absolute",n.style.left="-9999px",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),C({type:"success",message:S("COM_SPPAGEBUILDER_EDITOR_PAGE_COPY_LINK_MESSAGE")}),t.abrupt("break",25);case 18:return G.mutate({id:d.id}),t.abrupt("break",25);case 20:return Dt(),t.abrupt("break",25);case 22:return lt.setValue("title",d.title),k(!0),t.abrupt("break",25);case 25:case"end":return t.stop()}var r,n}),t)})));return function(e){return t.apply(this,arguments)}}()})})]},d.id)};var bt={name:"1qe2gq2-bodyTr",styles:"[data-frontend-editor-button]{display:flex;};label:bodyTr;"},gt={bodyTr:function(t){var e=t.isSelected,r=t.isShownFrontendButton;return(0,c.iv)("height:80px;border-bottom:1px solid ",i.qo.stroke.neutral,";position:relative;&:hover{background-color:",i.qo.background.hover,";",r&&bt," [data-drag-point]{opacity:1;}}",e&&(0,c.iv)("background-color:",i.qo.background.disabled,";;label:bodyTr;"),";;label:bodyTr;")},lockButton:(0,c.iv)(h.iZ.resetButton,";svg{color:",i.qo.icon.default,";};label:lockButton;"),titleButton:function(t){var e=t.canEdit;return(0,c.iv)(a.c.heading6(),";padding-inline:0;",e&&(0,c.iv)(":hover{color:",i.qo.text.primary,";};label:titleButton;")," ",!e&&(0,c.iv)("cursor:not-allowed;color:",i.qo.text.disabled,";;label:titleButton;"),";;label:titleButton;")},widthStyles:function(t){var e=t.width;return(0,c.iv)("width:",e,"px;;label:widthStyles;")},pageName:(0,c.iv)("position:relative;display:flex;gap:",i.W0[12],";align-items:center;max-width:400px;width:100%;;label:pageName;"),frontendEditorButton:(0,c.iv)(a.c.body(),";background-color:",i.qo.base.white,";border-radius:",i.E0[24],";padding:",i.W0[4]," ",i.W0[12]," ",i.W0[4]," ",i.W0[4],";width:fit-content;align-items:center;gap:",i.W0[8],";color:",i.qo.text.neutral,";display:none;position:absolute;left:100%;white-space:nowrap;svg{fill:none;}&:hover{color:",i.qo.text.hover,";}&::before,&::after{content:''!important;all:unset!important;};label:frontendEditorButton;"),checkboxWrapper:{name:"l0wqz3-checkboxWrapper",styles:"position:relative;label:checkboxWrapper;"},dragPoint:(0,c.iv)("position:absolute;top:0;left:0;height:100%;width:32px;display:flex;align-items:center;opacity:0;cursor:grab;svg{color:",i.qo.icon.default,";};label:dragPoint;"),access:{name:"sx074l-access",styles:"text-align:center;label:access;"},status:{name:"1n9i8ph-status",styles:"display:grid;place-content:center;height:inherit;label:status;"},triggerIcon:(0,c.iv)("color:",i.qo.icon.hints,";;label:triggerIcon;"),actionColumn:{name:"1m7ix2e-actionColumn",styles:"text-align:right;label:actionColumn;"}};const mt=function(t){var e=t.data,r=t.selectedItems,i=t.setSelectedItems,a=t.lastSelectedIndex,c=t.setLastSelectedIndex,s=t.isLoading,d=void 0!==s&&s,f=t.columns,p=t.isPopup,h=(0,l.$)(),y=e.length,b=r.ids.length,g=f.length+3;return(0,v.tZ)("div",{css:wt.tableContainer,children:(0,v.BX)("table",{css:wt.table({selectedColumns:f.length}),children:[(0,v.tZ)("thead",{children:(0,v.BX)("tr",{css:wt.headRow,children:[(0,v.tZ)("th",{css:wt.widthStyles({width:70}),children:(0,v.tZ)(n.Z,{checked:b>0&&b===y,isIndeterminate:b>0&&b<y,onChange:function(){var t=b===y?[]:(0,u.x9)(e),r=b===y?[]:(0,u.w6)(y);i({ids:t,indexes:r}),c(-1)}})}),(0,v.tZ)("th",{css:wt.widthStyles({width:250}),children:h(p?"COM_SPPAGEBUILDER_EDITOR_POPUP_LIST_POPUP_NAME":"COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_PAGE_NAME")}),f.includes("author")&&(0,v.tZ)("th",{css:wt.widthStyles({width:180}),children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_AUTHOR")}),f.includes("categories")&&(0,v.tZ)("th",{children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_CATEGORIES")}),f.includes("access")&&(0,v.tZ)("th",{css:wt.textCenter,children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_ACCESS")}),f.includes("id")&&(0,v.tZ)("th",{css:wt.textCenter,children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_ID")}),f.includes("hits")&&(0,v.tZ)("th",{css:wt.textCenter,children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_HITS")}),f.includes("language")&&(0,v.tZ)("th",{css:wt.textCenter,children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_LANGUAGE")}),(0,v.tZ)("th",{css:[wt.widthStyles({width:160}),wt.textCenter,";label:PageListTable;"],children:h("COM_SPPAGEBUILDER_EDITOR_PAGE_LIST_STATUS")}),(0,v.tZ)("th",{css:wt.widthStyles({width:100})})]})}),(0,v.tZ)("tbody",{children:d?Array(10).fill(0).map((function(t,e){return(0,v.tZ)("tr",{css:wt.skeletonWrapper,children:Array(g).fill(0).map((function(t,e){return(0,v.tZ)("td",{css:wt.widthStyles({width:0===e?70:(0,u.sZ)(100,250)}),children:(0,v.tZ)(o.Z,{animation:!0,height:20,width:"".concat(0===e?100:(0,u.sZ)(90,100),"%")})},e)}))},e)})):e.map((function(t,n){return(0,v.tZ)(vt,{index:n,data:e,page:t,lastSelectedIndex:a,setLastSelectedIndex:function(t){return c(t)},selectedItems:r,setSelectedItems:function(t){i(t)},columns:f,isPopup:p},t.id)}))})]})})};var Et={name:"vq4tj-table",styles:"tr:hover{td{:nth-of-type(3)>*{display:none;}}};label:table;"},wt={tableContainer:{name:"1c7p8s-tableContainer",styles:"display:block;width:100%;overflow-x:auto;label:tableContainer;"},table:function(t){var e=t.selectedColumns;return(0,c.iv)("width:100%;th{background-color:",(0,s.m4)(i.qo.base.primary,.15),";color:",i.qo.text.default,";height:49px;}th,td{",a.c.body(),";padding:",i.W0[16],";:first-of-type{padding-left:",i.W0[32],";}:last-of-type{padding-right:",i.W0[24],";}}",e>0&&Et,";;label:table;")},headRow:(0,c.iv)("th{",a.c.body(),";};label:headRow;"),paginatorWrapper:(0,c.iv)("margin-top:",i.W0[32],";;label:paginatorWrapper;"),widthStyles:function(t){var e=t.width;return(0,c.iv)("width:",e,"px;;label:widthStyles;")},textCenter:{name:"lfnssf-textCenter",styles:"text-align:center;label:textCenter;"},skeletonWrapper:(0,c.iv)("border-bottom:1px solid ",i.qo.stroke.neutral,";height:80px;;label:skeletonWrapper;")}},4370:(t,e,r)=>{r.d(e,{a:()=>p});var n=r(3106),o=r(7294),i=r(4420);function a(t){return a="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},a(t)}function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==a(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===a(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(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 f=(0,i.createEnumParam)(["asc","desc"]),p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.limit,r=void 0===e?n.Hy:e,a=t.updateQueryParams,c=void 0!==a&&a,u=s((0,i.useQueryParams)({page:(0,i.withDefault)(i.NumberParam,1),sortProperty:(0,i.withDefault)(i.StringParam,""),sortDirection:(0,i.withDefault)(f,void 0),filter:(0,i.withDefault)(i.JsonParam,{})}),2),d=u[0],p=u[1],h=s((0,o.useState)({page:1,sortProperty:"",sortDirection:void 0,filter:{}}),2),y=h[0],v=h[1],b=c?y:d,g=(r=d.filter.limit?Number(d.filter.limit):r)*Math.max(0,b.page-1),m=(0,o.useCallback)((function(t){c?v((function(e){return l(l({},e),t)})):p(l({},t))}),[p,v,c]),E=(0,o.useCallback)((function(t){return m({filter:t})}),[m]);return{pageInfo:b,onPageChange:function(t){return m({page:t})},onColumnSort:function(t){var e;e=t!==b.sortProperty?{sortDirection:"asc",sortProperty:t}:{sortDirection:"asc"===b.sortDirection?"desc":"asc",sortProperty:t},m(e)},offset:g,itemsPerPage:r,onFilterItems:E}}},7902:(t,e,r)=>{r.d(e,{Z:()=>h});var n=r(3871),o=r(7870),i=r(824),a=r(917),c=r(1234),l=r(2328),u=r(5944);function s(t){return s="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},s(t)}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==s(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===s(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const h=function(t){var e=t.values,r=t.onChange,i=t.wrapperCss,a=t.clearButtonStatus,s=t.onClearFilter,d=(0,c.$)(),p=(0,l.v)((function(t){return t.appConfig})),h=e.status,v=e.access,b=e.category,g=e.language,m=[{label:d("COM_SPPAGEBUILDER_EDITOR_FILTER_PUBLISHED"),value:1},{label:d("COM_SPPAGEBUILDER_EDITOR_FILTER_UNPUBLISHED"),value:0},{label:d("COM_SPPAGEBUILDER_EDITOR_FILTER_TRASHED"),value:-2}];return(0,u.BX)("div",{css:[y.wrapper,i,";label:FilterSelectGroup;"],children:[(0,u.tZ)(o.Z,{placeholder:d("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_STATUS"),wrapperStyle:y.itemCss,value:m.find((function(t){return t.value===h})),options:m,clearOption:function(){r(f(f({},e),{},{status:null}))},onChange:function(t){r(f(f({},e),{},{status:t.value}))}}),(0,u.tZ)(o.Z,{placeholder:d("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_ACCESS"),wrapperStyle:y.itemCss,value:p.access_levels.find((function(t){return t.value===v})),options:p.access_levels,clearOption:function(){r(f(f({},e),{},{access:null}))},onChange:function(t){r(f(f({},e),{},{access:t.value}))}}),(0,u.tZ)(o.Z,{placeholder:d("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_CATEGORY"),wrapperStyle:y.itemCss,value:b?p.categories.find((function(t){return t.value===Number(b)})):void 0,options:p.categories,clearOption:function(){r(f(f({},e),{},{category:null}))},onChange:function(t){r(f(f({},e),{},{category:t.value}))}}),(0,u.tZ)(o.Z,{placeholder:d("COM_SPPAGEBUILDER_EDITOR_FILTER_PLACEHOLDER_LANGUAGE"),wrapperStyle:y.itemCss,value:p.languages.find((function(t){return t.value===g})),options:p.languages,clearOption:function(){r(f(f({},e),{},{language:null}))},onChange:function(t){r(f(f({},e),{},{language:t.value}))}}),(0,u.tZ)(n.Z,{variant:"secondary",disabled:!a,buttonCss:y.itemCss,onClick:function(){r({status:null,access:null,category:null,language:null}),s()},children:d("COM_SPPAGEBUILDER_EDITOR_CLEAR")})]})};var y={wrapper:(0,a.iv)("display:flex;border:1px solid ",i.qo.stroke.neutral,";border-radius:",i.E0[5],";overflow:hidden;box-shadow:",i.AF.input,";input,button{border:none;border-radius:0;box-shadow:none;}input{border-right:1px solid ",i.qo.stroke.neutral,";:focus{box-shadow:none;}}button:last-of-type{display:flex;justify-content:center;align-items:center;};label:wrapper;"),itemCss:{name:"1qky7zh-itemCss",styles:"min-width:108px;label:itemCss;"}}},2028:(t,e,r)=>{r.d(e,{Z:()=>f});var n=r(7264),o=r(824),i=r(4185),a=r(917),c=r(1234),l=r(1921),u=r(7294),s=r(5944);function d(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}const f=function(t){var e,r,o=t.currentPage,i=t.onPageChange,a=t.totalItems,l=t.itemsPerPage,f=(0,c.$)(),h=(e=(0,u.useState)(""),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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return d(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)?d(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.")}()),y=h[0],v=h[1],b=Math.max(Math.ceil(a/l),1);(0,u.useEffect)((function(){v(o.toString())}),[o]);var g=function(t){t<1||t>b||i(t)};return(0,s.BX)("div",{css:p.wrapper,children:[(0,s.BX)("div",{css:p.pageStatus,children:[f("COM_SPPAGEBUILDER_EDITOR_PAGINATION_PAGE"),(0,s.tZ)("span",{children:(0,s.tZ)("input",{type:"text",css:p.paginationInput,value:y,onChange:function(t){var e=t.currentTarget.value.replace(/[^0-9]/g,""),r=Number(e);r>0&&r<=b?(v(e),i(r)):e||v(e)},autoComplete:"off"})}),f("COM_SPPAGEBUILDER_EDITOR_PAGINATION_PAGE_OF")," ",(0,s.tZ)("span",{children:b})]}),(0,s.BX)("div",{css:p.pageController,children:[(0,s.tZ)("button",{type:"button",css:p.paginationButton,onClick:function(){return g(o-1)},disabled:1===o,children:(0,s.tZ)(n.Z,{name:"chevronLeft",width:24,height:24})}),(0,s.tZ)("button",{type:"button",css:p.paginationButton,onClick:function(){return g(o+1)},disabled:o===b,children:(0,s.tZ)(n.Z,{name:"chevronRight",width:24,height:24})})]})]})};var p={wrapper:(0,a.iv)("display:flex;justify-content:end;align-items:center;flex-wrap:wrap;gap:",o.W0[8],";height:36px;;label:wrapper;"),pageStatus:(0,a.iv)(i.c.body()," color:",o.qo.text.neutral,";min-width:100px;;label:pageStatus;"),paginationInput:(0,a.iv)("outline:0;border:1px solid ",o.qo.stroke.neutral,";border-radius:",o.E0[5],";margin:0 ",o.W0[8],";color:",o.qo.text.neutral,";padding:",o.W0[8]," ",o.W0[12],";width:72px;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:",o.W0[0],";};label:paginationInput;"),pageController:(0,a.iv)("gap:",o.W0[8],";display:flex;justify-content:center;align-items:center;height:100%;;label:pageController;"),paginationButton:(0,a.iv)(l.iZ.resetButton,";background-color:",o.qo.background.white,";color:",o.qo.icon.default,";border-radius:",o.E0[6],";height:32px;width:32px;display:grid;place-items:center;transition:background-color 0.2s ease-in-out,color 0.3s ease-in-out;&:hover{background-color:",o.qo.base.primary,";&>svg{color:",o.qo.base.white,";}}&:disabled{background-color:",o.qo.background.disabled,";&>svg{color:",o.qo.icon.disabled,";}};label:paginationButton;")}},5602:(t,e,r)=>{function n(t){return n="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},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==n(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,{l:()=>a});var a=function(t){var e=t.draggingNodeRect,r=t.transform,n=t.scrollableAncestorRects[0];return e&&n?c(r,e,n):r},c=function(t,e,r){var n=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);return e.top+t.y<=r.top?n.y=r.top-e.top:e.bottom+t.y>=r.top+r.height&&(n.y=r.top+r.height-e.bottom),e.left+t.x<=r.left?n.x=r.left-e.left:e.right+t.x>=r.left+r.width&&(n.x=r.left+r.width-e.right),n}}}]);