PageSourceSearch

https://alqabas.com/_next/static/chunks/pages/editCategories-00f987d272866943.js

js alqabas.com collected 2026-10-02 07:40:38 UTC 14,931 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45],{78492:function(e,t,n){"use strict";n.d(t,{Oq:function(){return f},dO:function(){return c},jn:function(){return o},iz:function(){return g},Dz:function(){return i},cv:function(){return l},oc:function(){return d}});var r="Invariant failed";var i=function(e){var t=e.top,n=e.right,r=e.bottom,i=e.left;return{top:t,right:n,bottom:r,left:i,width:n-i,height:r-t,x:i,y:t,center:{x:(n+i)/2,y:(r+t)/2}}},o=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},a=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},u={top:0,right:0,bottom:0,left:0},c=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?u:n,c=e.border,s=void 0===c?u:c,l=e.padding,d=void 0===l?u:l,f=i(o(t,r)),g=i(a(t,s)),m=i(a(g,d));return{marginBox:f,borderBox:i(t),paddingBox:g,contentBox:m,margin:r,border:s,padding:d}},s=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(e,t){if(!e)throw new Error(r)}(!1),n},l=function(e,t){var n,r,i=e.borderBox,o=e.border,a=e.margin,u=e.padding,s=(r=t,{top:(n=i).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return c({borderBox:s,border:o,margin:a,padding:u})},d=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),l(e,t)},f=function(e,t){var n={top:s(t.marginTop),right:s(t.marginRight),bottom:s(t.marginBottom),left:s(t.marginLeft)},r={top:s(t.paddingTop),right:s(t.paddingRight),bottom:s(t.paddingBottom),left:s(t.paddingLeft)},i={top:s(t.borderTopWidth),right:s(t.borderRightWidth),bottom:s(t.borderBottomWidth),left:s(t.borderLeftWidth)};return c({borderBox:e,margin:n,padding:r,border:i})},g=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return f(t,n)}},30845:function(e,t,n){"use strict";n.r(t);var r=Number.isNaN||function(e){return"number"===typeof e&&e!==e};function i(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(i=e[n],o=t[n],!(i===o||r(i)&&r(o)))return!1;var i,o;return!0}t.default=function(e,t){var n;void 0===t&&(t=i);var r,o=[],a=!1;return function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return a&&n===this&&t(i,o)||(r=e.apply(this,i),a=!0,n=this,o=i),r}}},82161:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/editCategories",function(){return n(87475)}])},93072:function(e,t,n){"use strict";var r=n(85893),i=n(67294),o=n(10682),a=n(34051),u=n(47166),c=n.n(u),s=n(74555),l=n(91622),d=n.n(l),f=n(7571),g=n(83192),m=n(12288),p=n(76067);function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t.Z=function(e){var t=e.categories,n=e.onSubmit,u=e.oldData,l=e.access_token,b=e.saveLocally,y=e.isWhite,C=(0,g.useTranslation)().t,_=(0,i.useState)([]),x=_[0],I=_[1],j=(0,s.I0)(),P=(0,s.v9)((function(e){return e.myPage})).data;(0,i.useEffect)((function(){I(t.filter((function(e){return!1===e.isFavorite})))}),[t]);var A=function(e,t){var n=t;return e.map((function(e){return!0===e.isFavorite&&null==e.order?v({},e,{order:n+=1}):v({},e,{order:e.order>0?e.order:0})}))};return!x||(null===x||void 0===x?void 0:x.length)<=0?(0,r.jsx)("span",{className:c()(d().noMoreCat,"pt-3 pb-3"),children:C("myPage.nomorecat")}):(0,r.jsxs)(o.Z,{className:d().container,children:[(0,r.jsx)(a.Z,{noGutters:!0,className:c()(d().container),children:x.map((function(e,t){return(0,r.jsx)("div",{className:c()(d().colWrapper,"pt-4"),children:(0,r.jsx)("span",{className:c()(d().catWrapper,e.isFavorite&&d().selected,y&&d().isWhite),onClick:function(){return function(e){var t=h(x);t[e].isFavorite=!t[e].isFavorite,I(t)}(t)},children:(0,r.jsx)("span",{className:d().title,children:e.name})})},t)}))}),(0,r.jsx)("div",{className:c()(d().btnContainer,"pt-5"),children:(0,r.jsx)(f.Z,{label:C("myPage.add"),onClick:function(){var e;if(0!==x.filter((function(e){return!0===e.isFavorite})).length){var t=u?(e=Math).max.apply(e,h(P.map((function(e){return e.order})))):0,r=A(P,t);if(b)n(r);else{var i=null;l?j((0,m.bB)((0,p.WQ)((0,p.zf)(r)))).then((function(){j((0,m.GE)(r)),n()})):(j((0,m.GE)(r)),i=(0,p.zf)(r),j((0,m.s9)(i)),j((0,m.Sx)(null,i)).then((function(){n()})))}}},additionalClassName:c()(d().submitBtn,y&&d().isWhite),disabled:x.filter((function(e){return!0===e.isFavorite})).length<=0})})]})}},40975:function(e,t,n){"use strict";var r=n(85893),i=(n(67294),n(45697)),o=n.n(i),a=n(47166),u=n.n(a),c=n(56590),s=n.n(c),l=function(e){var t=e.children,n=e.darkContent;return(0,r.jsx)("div",{className:u()(s().container,n?s().darkContent:""),children:t})};l.propTypes={children:o().node.isRequired,darkContent:o().bool},l.defaultProps={darkContent:!1},t.Z=l},87475:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return L},default:function(){return R}});var r=n(85893),i=n(47166),o=n.n(i),a=n(67294),u=n(74555),c=n(10682),s=n(11163),l=n(66648),d=n(40844),f=n.n(d),g=n(83192),m=n(40975),p=n(7571),b=n(12288),v=n(15948),h=n(8432),y=n.n(h),C=n(69777),_=n.n(C);function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){x(e,t,n[t])}))}return e}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(c){i=!0,o=c}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}
1(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var P=function(e){var t=e.itemList,n=e.onDragEnd,i=e.items,o=e.uniqueKey,a=e.useDragImage,u=void 0===a||a;return(0,r.jsx)(v.Z5,{onDragEnd:function(e){if(e.destination&&e.source.index!==e.destination.index){var t=function(e,t,n){var r=Array.from(e),i=j(r.splice(t,1),1)[0];return r.splice(n,0,i),r}(i,e.source.index,e.destination.index);n(t)}},children:(0,r.jsx)(v.bK,{droppableId:"droppable",children:function(e){return(0,r.jsx)("div",I({},e.droppableProps,{ref:e.innerRef,children:i.map((function(e,n){return!0===e.isFavorite&&(0,r.jsx)(v._l,{draggableId:e[o],index:n,children:function(n){return(0,r.jsxs)("div",I({ref:n.innerRef},n.draggableProps,{className:y().dragElement,children:[t(e,n.dragHandleProps),(0,r.jsx)("div",{className:y().imageWrapper,children:u&&(0,r.jsx)("img",I({src:_(),className:"drag-handler",alt:""},n.dragHandleProps))})]}))}},e[o])}))}))}})})},A=a.memo(P),N=n(81497),w=n(35723),S=n(93072),Z=n(98215),O=n.n(Z),E=function(e){var t=e.showModal,n=e.hideModal,i=e.submitModal,a=(0,u.v9)((function(e){return e.myPage})),c=a.selectedCat,s=a.availableCategories,l=(0,u.v9)((function(e){return e.authentication})).access_token,d=(0,g.useTranslation)().t;return(0,r.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:(0,r.jsx)(N.Z,{centered:!0,className:O().modal,dialogClassName:O().modalContainer,show:t,id:"editCategoryModel",onHide:function(){n()},children:(0,r.jsxs)(N.Z.Body,{children:[(0,r.jsx)("div",{className:O().closeButtonContainer,role:"button",tabIndex:0,onClick:function(){n()},children:(0,r.jsx)("img",{src:w.UFW,className:O().close,alt:"",onContextMenu:function(e){return e.preventDefault()}})}),(0,r.jsx)("span",{className:o()(O().title,"mb-4 mt-2"),children:d("editCategories.addMoreCategries")}),(0,r.jsx)(S.Z,{access_token:l,categories:s,oldData:c,onSubmit:function(e){i(e)},hideSelectedCats:!0,saveLocally:!0})]})})})},k=n(76067),M=n(75074),W=n(94504),B=n(96076);function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){D(e,t,n[t])}))}return e}function F(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var L=!0,R=function(e){var t=e.settings,n=(0,g.useTranslation)().t,i=(0,u.I0)(),d=(0,u.v9)((function(e){return e.authentication})).access_token,v=(0,u.v9)((function(e){return e.myPage})),h=v.loading,y=v.data,C=v.selectedCat,_=v.availableCategories,x=(0,a.useState)(!1),I=x[0],j=x[1],P=(0,a.useState)(!1),N=P[0],w=P[1],S=(0,a.useState)(!0),Z=S[0],O=S[1],D=(0,a.useState)([]),L=D[0],R=D[1],z=(0,s.useRouter)();(0,a.useEffect)((function(){0===y.filter((function(e){return e.isFavorite})).length&&0===C.length&&z.push(W.Z.myPageFlow)}),[y,z,C]),(0,a.useEffect)((function(){N||(R(y),w(!0),i((0,b.Sx)(d,C)))}),[y,i,C,d,N]);(0,a.useEffect)((function(){R(y)}),[y]);var H=function(e){var t=1,n=e.map((function(e){return T({},e,{order:e.isFavorite?t++:null})}));O(!1),R(n)};return(0,r.jsx)(l.Z,{fixed:!0,currentCategory:"",footerTabs:t?t.footer:null,headerData:t?t.header:null,showFooter:!0,defaultCategory:B.Z.appCategories.myPage,settings:t,hideCategories:!0,children:(0,r.jsxs)(c.Z,{fluid:!0,className:"fixed-page-content-no-categories",children:[(0,r.jsx)(E,{showModal:I,hideModal:function(){j(!1)},submitModal:function(e){j(!1),H(e)}}),(0,r.jsx)("div",{className:o()(f().screenContent),children:(0,r.jsxs)(c.Z,{children:[(0,r.jsx)(m.Z,{children:n("editCategories.title")}),_&&_.length>0&&(0,r.jsx)("div",{children:(0,r.jsx)(p.Z,{label:n("editCategories.addMoreCategries"),additionalClassName:f().btn,onClick:function(){return j(!I)}})}),(0,r.jsxs)("div",{className:"pt-4 pb-4",children:[(0,r.jsx)("span",{className:f().myTopics,children:n("myPage.myTopics")}),(0,r.jsxs)("span",{className:f().reorderSentence,children:["(",n("myPage.rearrangeOrderSentence"),")"]})]}),h?(0,r.jsx)(M.Z,{}):(0,r.jsx)(A,{items:L,onDragEnd:function(e){return H(e)},uniqueKey:"uniqueKey",itemList:function(e,t){return(0,r.jsx)("div",{className:f().listItem,onClick:function(){return function(e){O(!1);var t=L.map((function(t){return T({},t,{isFavorite:t===e?!t.isFavorite:t.isFavorite,order:t===e?null:t.order})}));R(F(t)),i((0,b.$g)(F(t)))}(e)},children:e.name})},itemReadOnlyStyle:f().listItem}),(0,r.jsx)("div",{className:"pt-5",children:(0,r.jsx)(p.Z,{label:"\u062d\u0641\u0638",additionalClassName:f().submitBtn,onClick:function(){return function(){var e=(0,k.zf)(L);d?i((0,b.bB)((0,k.WQ)(e))).then((function(){z.push(W.Z.myPageFlow)})):(i((0,b.s9)(e)),i((0,b.Sx)(d,e,!0)).then((function(){z.push(W.Z.myPageFlow)})))}()},disabled:Z})})]})})]})})}},91622:function(e){e.exports={container:"myPageCategory_container__3qVGn",catWrapper:"myPageCategory_catWrapper__2L0iF",t
1itle:"myPageCategory_title__1oYbA",noMoreCat:"myPageCategory_noMoreCat__3FGCq",colWrapper:"myPageCategory_colWrapper__2NfAN",isWhite:"myPageCategory_isWhite__2ICpI",selected:"myPageCategory_selected__1PzhI",submitBtn:"myPageCategory_submitBtn__-VZm-",btnContainer:"myPageCategory_btnContainer__3dRTY"}},56590:function(e){e.exports={container:"sectionHeader_container__1AxGP",darkContent:"sectionHeader_darkContent__12-I3"}},8432:function(e){e.exports={dragElement:"dragList_dragElement__2ql1-","drag-handler":"dragList_drag-handler__2AsV-",imageWrapper:"dragList_imageWrapper__3Q7ob"}},98215:function(e){e.exports={title:"categoryPopup_title__2X89m",modal:"categoryPopup_modal__3uk6A"}},40844:function(e){e.exports={screenContent:"editCategories_screenContent__2qa_V",btn:"editCategories_btn__3DxQY",submitBtn:"editCategories_submitBtn__15g9n",myTopics:"editCategories_myTopics__pcLvs",reorderSentence:"editCategories_reorderSentence__2PTCw",listItem:"editCategories_listItem__2e3P_"}},5729:function(e,t){"use strict";t.Z=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t=i,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r}},10682:function(e,t,n){"use strict";var r=n(1368),i=n(38321),o=n(94184),a=n.n(o),u=n(67294),c=n(76792),s=["bsPrefix","fluid","as","className"],l=u.forwardRef((function(e,t){var n=e.bsPrefix,o=e.fluid,l=e.as,d=void 0===l?"div":l,f=e.className,g=(0,i.Z)(e,s),m=(0,c.vE)(n,"container"),p="string"===typeof o?"-"+o:"-fluid";return u.createElement(d,(0,r.Z)({ref:t},g,{className:a()(f,o?""+m+p:m)}))}));l.displayName="Container",l.defaultProps={fluid:!1},t.Z=l},69777:function(e){e.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIxMyIgdmlld0JveD0iMCAwIDIyIDEzIj4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICAgICAgICA8ZyBzdHJva2U9IiMxRjIzMjciPgogICAgICAgICAgICA8Zz4KICAgICAgICAgICAgICAgIDxnPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0uNS41TDIxLjUuNU0uNSA2LjVMMjEuNSA2LjVNLjUgMTIuNUwyMS41IDEyLjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zNjEgLTM1OSkgdHJhbnNsYXRlKDM2MSAzMzQpIHRyYW5zbGF0ZSgwIDI1KSIvPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K"},51163:function(e,t,n){"use strict";n.d(t,{I4:function(){return a},Ye:function(){return o}});var r=n(67294);function i(e,t){var n=(0,r.useState)((function(){return{inputs:t,result:e()}}))[0],i=(0,r.useRef)(!0),o=(0,r.useRef)(n),a=i.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,o.current.inputs))?o.current:{inputs:t,result:e()};return(0,r.useEffect)((function(){i.current=!1,o.current=a}),[a]),a.result}var o=i,a=function(e,t){return i((function(){return e}),t)}}},function(e){e.O(0,[630,4652,7131,1497,1517,7184,9774,2888,179],(function(){return t=82161,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.