1"use strict";(self.webpackChunk_minimal_kit_cra_ts=self.webpackChunk_minimal_kit_cra_ts||[]).push([[4e3],{52861:function(e,n,t){t.d(n,{By:function(){return c},JH:function(){return u},U1:function(){return d},_F:function(){return p},em:function(){return h}});var r=t(61819),a=t(15861),o=t(29439),i=t(1010),s=t(47313),l=t(59864);function c(e,n){var t=localStorage.getItem("id"),r="".concat(l.Hv.comany.getCompany,"?page=").concat(e,"&per_page=").concat(n,"&user_id=").concat(t),a=(0,i.ZP)(r,l._i),o=a.data,c=a.isLoading,d=a.error,u=a.isValidating;return(0,s.useMemo)((function(){return{products:(null===o||void 0===o?void 0:o.data)||[],totalCount:(null===o||void 0===o?void 0:o.total)||0,productsLoading:c,productsError:d,productsValidating:u,productsEmpty:!c&&(!(null!==o&&void 0!==o&&o.data)||0===(null===o||void 0===o?void 0:o.data.length))}}),[o,d,c,u])}function d(){var e=(0,s.useState)(!1),n=(0,o.Z)(e,2),t=n[0],i=n[1],c=(0,s.useState)(null),d=(0,o.Z)(c,2),u=d[0],h=d[1],p=(0,s.useState)(null),x=(0,o.Z)(p,2),g=x[0],f=x[1],m=(0,s.useCallback)(function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),h(null),e.prev=2,t="".concat(l.Hv.comany.deleteCompany,"/").concat(n),e.next=6,(0,l.B5)([t,null,"DELETE"]);case 6:return a=e.sent,f(a),e.abrupt("return",a);case 11:throw e.prev=11,e.t0=e.catch(2),h(e.t0.message),e.t0;case 15:return e.prev=15,i(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[2,11,15,18]])})));return function(n){return e.apply(this,arguments)}}(),[]);return{deleteCompany:m,loading:t,error:u,response:g}}function u(){var e=(0,s.useState)(!1),n=(0,o.Z)(e,2),t=n[0],i=n[1],c=(0,s.useState)(null),d=(0,o.Z)(c,2),u=d[0],h=d[1],p=(0,s.useState)(null),x=(0,o.Z)(p,2),g=x[0],f=x[1],m=(0,s.useCallback)(function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n){var t,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),h(null),t={name:n.name.trim(),domain:n.domain.trim(),status:n.status,max_admin:Number(n.max_admin),max_analyst:Number(n.max_analyst),max_takedown:Number(n.max_takedown),license_start_date:n.license_start_date,license_end_date:n.license_end_date,services:n.services,created_by:n.created_by},n.parent_id&&(t.parent_id=n.parent_id),e.prev=4,e.next=7,(0,l.B5)([l.Hv.comany.postCompany,t,"POST"]);case 7:return a=e.sent,f(a),e.abrupt("return",a);case 12:throw e.prev=12,e.t0=e.catch(4),h(e.t0.message),e.t0;case 16:return e.prev=16,i(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,12,16,19]])})));return function(n){return e.apply(this,arguments)}}(),[]);return{postCompany:m,loading:t,error:u,response:g}}function h(){var e=(0,s.useState)(!1),n=(0,o.Z)(e,2),t=n[0],i=n[1],c=(0,s.useState)(null),d=(0,o.Z)(c,2),u=d[0],h=d[1],p=(0,s.useState)(null),x=(0,o.Z)(p,2),g=x[0],f=x[1],m=(0,s.useCallback)(function(){var e=(0,a.Z)((0,r.Z)().mark((function e(n,t){var a,o;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),h(null),e.prev=2,a="".concat(l.Hv.comany.putCompany,"/").concat(n),e.next=6,(0,l.B5)([a,t,"PUT"]);case 6:return o=e.sent,f(o),e.abrupt("return",o);case 11:throw e.prev=11,e.t0=e.catch(2),h(e.t0.message),e.t0;case 15:return e.prev=15,i(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[2,11,15,18]])})));return function(n,t){return e.apply(this,arguments)}}(),[]);return{updateCompany:m,loading:t,error:u,response:g}}function p(e){var n,t=Boolean(e),r=t?"".concat(l.Hv.comany.preFillCompany,"/").concat(e):null;console.log("\ud83d\ude80 companyId:",e,"| shouldFetch:",t,"| URL:",r);var a=(0,i.ZP)(r,l._i),o=a.data,s=a.error,c=a.isLoading,d=a.isValidating;return{company:null!==(n=null===o||void 0===o?void 0:o.company)&&void 0!==n?n:null,companyLoading:c,companyError:s,companyValidating:d,companyEmpty:!c&&!(null!==o&&void 0!==o&&o.company)}}},78744:function(e,n,t){t.d(n,{R:function(){return i}});var r=t(1010),a=t(47313),o=t(59864);function i(e,n,t,i,s,l,c){var d=null;if((null===c||void 0===c?void 0:c.enabled)&&!!e){var u=new URLSearchParams;u.append("query",e),u.append("section",n),console.log("idCompany---------",s,typeof s),u.append("page",String(1)),u.append("per_page",String(i)),null!==s&&"undefined"!==s&&"null"!==s&&u.append("company_id",String(s)),null!==l&&void 0!==l&&"null"!==l&&u.append("type_id",String(l));var h=localStorage.getItem("id");d="".concat(o.Hv.search.search,"?").concat(u.toString(),"&user_id=").concat(h)}
1var p=(0,r.ZP)(d,o._i),x=p.data,g=p.isLoading,f=p.error,m=p.isValidating;return(0,a.useMemo)((function(){var e=(null===x||void 0===x?void 0:x.data)||[];return{results:e,totalCount1:(null===x||void 0===x?void 0:x.total)||0,isLoading:g,error:f,isValidating:m,isEmpty:!g&&0===e.length,totalPages:(null===x||void 0===x?void 0:x.last_page)||1}}),[x,g,f,m])}},14368:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(1413),a=t(45987),o=t(9506),i=t(90891),s=t(42832),l=t(47605),c=t(3404),d=t(98880),u=t(46417);function h(e){var n=e.link,t=e.activeLast,a=e.disabled,s=n.name,l=n.href,c=n.icon,h=(0,r.Z)({typography:"body2",alignItems:"center",color:"text.primary",display:"inline-flex"},a&&!t&&{cursor:"default",pointerEvents:"none",color:"text.disabled"}),p=(0,u.jsxs)(u.Fragment,{children:[c&&(0,u.jsx)(o.Z,{component:"span",sx:{mr:1,display:"inherit","& svg":{width:20,height:20}},children:c}),s]});return l?(0,u.jsx)(i.Z,{component:d.r,href:l,sx:h,children:p}):(0,u.jsxs)(o.Z,{sx:h,children:[" ",p," "]})}var p=["links","action","heading","moreLink","activeLast","sx"];function x(e){var n=e.links,t=e.action,d=e.heading,x=e.moreLink,f=e.activeLast,m=e.sx,Z=(0,a.Z)(e,p),v=n[n.length-1].name;return(0,u.jsxs)(o.Z,{sx:(0,r.Z)({},m),children:[(0,u.jsxs)(s.Z,{direction:"row",alignItems:"center",children:[(0,u.jsxs)(o.Z,{sx:{flexGrow:1},children:[d&&(0,u.jsx)(l.Z,{variant:"h4",gutterBottom:!0,children:d}),!!n.length&&(0,u.jsx)(c.Z,(0,r.Z)((0,r.Z)({separator:(0,u.jsx)(g,{})},Z),{},{children:n.map((function(e){return(0,u.jsx)(h,{link:e,activeLast:f,disabled:e.name===v},e.name||"")}))}))]}),t&&(0,u.jsxs)(o.Z,{sx:{flexShrink:0},children:[" ",t," "]})]}),!!x&&(0,u.jsx)(o.Z,{sx:{mt:2},children:x.map((function(e){return(0,u.jsx)(i.Z,{href:e,variant:"body2",target:"_blank",rel:"noopener",sx:{display:"table"},children:e},e)}))})]})}function g(){return(0,u.jsx)(o.Z,{component:"span",sx:{width:4,height:4,borderRadius:"50%",bgcolor:"text.disabled"}})}},76522:function(e,n,t){t.d(n,{Q:function(){return h}});var r=t(1413),a=t(45987),o=t(71003),i=t(94469),s=t(33604),l=t(4117),c=t(96467),d=t(46417),u=["title","content","action","open","onClose"];function h(e){var n=e.title,t=e.content,h=e.action,p=e.open,x=e.onClose,g=(0,a.Z)(e,u);return(0,d.jsxs)(i.Z,(0,r.Z)((0,r.Z)({fullWidth:!0,maxWidth:"xs",open:p,onClose:x},g),{},{children:[(0,d.jsx)(s.Z,{sx:{pb:2},children:n}),t&&(0,d.jsxs)(c.Z,{sx:{typography:"body2"},children:[" ",t," "]}),(0,d.jsxs)(l.Z,{children:[h,(0,d.jsx)(o.Z,{variant:"outlined",color:"inherit",onClick:x,children:"Cancel"})]})]}))}},76996:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1413),a=t(45987),o=t(17551),i=t(9506),s=t(47605),l=t(42832),c=t(46417),d=["title","imgUrl","action","filled","description","sx"];function u(e){var n=e.title,t=e.imgUrl,u=e.action,h=e.filled,p=e.description,x=e.sx,g=(0,a.Z)(e,d);return(0,c.jsxs)(l.Z,(0,r.Z)((0,r.Z)({flexGrow:1,alignItems:"center",justifyContent:"center",sx:(0,r.Z)((0,r.Z)({px:3,height:1},h&&{borderRadius:2,bgcolor:function(e){return(0,o.Fq)(e.palette.grey[500],.04)},border:function(e){return"dashed 1px ".concat((0,o.Fq)(e.palette.grey[500],.08))}}),x)},g),{},{children:[(0,c.jsx)(i.Z,{component:"img",alt:"empty content",src:t||"/assets/icons/empty/ic_content.svg",sx:{width:1,maxWidth:160}}),n&&(0,c.jsx)(s.Z,{variant:"h6",component:"span",sx:{mt:1,color:"text.disabled",textAlign:"center"},children:n}),p&&(0,c.jsx)(s.Z,{variant:"caption",sx:{mt:1,color:"text.disabled",textAlign:"center"},children:p}),u&&u]}))}},43190:function(e,n,t){function r(e,n,t){return e?Math.max(0,(1+e)*n-t):0}function a(e,n,t){return null===e[t]?1:null===n[t]||n[t]<e[t]?-1:n[t]>e[t]?1:0}function o(e,n){return"desc"===e?function(e,t){return a(e,t,n)}
1:function(e,t){return-a(e,t,n)}}t.d(n,{$W:function(){return j},K:function(){return b},et:function(){return g},S_:function(){return F},Z4:function(){return P},hM:function(){return v},fQ:function(){return r},sQ:function(){return o},x6:function(){return c}});var i=t(93433),s=t(29439),l=t(47313);function c(e){var n=(0,l.useState)(!(null===e||void 0===e||!e.defaultDense)),t=(0,s.Z)(n,2),r=t[0],a=t[1],o=(0,l.useState)((null===e||void 0===e?void 0:e.defaultCurrentPage)||0),c=(0,s.Z)(o,2),d=c[0],u=c[1],h=(0,l.useState)((null===e||void 0===e?void 0:e.defaultOrderBy)||"name"),p=(0,s.Z)(h,2),x=p[0],g=p[1],f=(0,l.useState)((null===e||void 0===e?void 0:e.defaultRowsPerPage)||15),m=(0,s.Z)(f,2),Z=m[0],v=m[1],j=(0,l.useState)((null===e||void 0===e?void 0:e.defaultOrder)||"asc"),w=(0,s.Z)(j,2),y=w[0],b=w[1],C=(0,l.useState)((null===e||void 0===e?void 0:e.defaultSelected)||[]),S=(0,s.Z)(C,2),k=S[0],P=S[1],_=(0,l.useCallback)((function(e){""!==e&&(b(x===e&&"asc"===y?"desc":"asc"),g(e))}),[y,x]),R=(0,l.useCallback)((function(e){var n=k.includes(e)?k.filter((function(n){return n!==e})):[].concat((0,i.Z)(k),[e]);P(n)}),[k]),D=(0,l.useCallback)((function(e){u(0),v(parseInt(e.target.value,10))}),[]),I=(0,l.useCallback)((function(e){a(e.target.checked)}),[]),L=(0,l.useCallback)((function(e,n){P(e?n:[])}),[]),F=(0,l.useCallback)((function(e,n){u(n)}),[]),E=(0,l.useCallback)((function(){u(0)}),[]),A=(0,l.useCallback)((function(e){P([]),d&&e<2&&u(d-1)}),[d]),W=(0,l.useCallback)((function(e){var n=e.totalRows,t=e.totalRowsInPage,r=e.totalRowsFiltered,a=k.length;if(P([]),d)if(a===t)u(d-1);else if(a===r)u(0);else if(a>t){var o=Math.ceil((n-a)/Z)-1;u(o)}}),[d,Z,k.length]);return{dense:r,order:y,page:d,orderBy:x,rowsPerPage:Z,selected:k,onSelectRow:R,onSelectAllRows:L,onSort:_,onChangePage:F,onChangeDense:I,onResetPage:E,onChangeRowsPerPage:D,onUpdatePageDeleteRow:A,onUpdatePageDeleteRows:W,setPage:u,setDense:a,setOrder:b,setOrderBy:g,setSelected:P,setRowsPerPage:v}}var d=t(1413),u=t(42988),h=t(70941),p=t(76996),x=t(46417);function g(e){var n=e.notFound,t=e.sx;return(0,x.jsx)(u.Z,{children:n?(0,x.jsx)(h.Z,{colSpan:12,children:(0,x.jsx)(p.Z,{filled:!0,title:"No Data",sx:(0,d.Z)({py:10},t)})}):(0,x.jsx)(h.Z,{colSpan:12,sx:{p:0}})})}var f=t(36459),m=t(42832),Z=t(84488);function v(e){var n=Object.assign({},((0,f.Z)(e),e));return(0,x.jsx)(u.Z,(0,d.Z)((0,d.Z)({},n),{},{children:(0,x.jsx)(h.Z,{colSpan:12,children:(0,x.jsxs)(m.Z,{spacing:3,direction:"row",alignItems:"center",children:[(0,x.jsx)(Z.Z,{sx:{borderRadius:1.5,width:48,height:48,flexShrink:0}}),(0,x.jsx)(Z.Z,{sx:{width:1,height:12}}),(0,x.jsx)(Z.Z,{sx:{width:180,height:12}}),(0,x.jsx)(Z.Z,{sx:{width:160,height:12}}),(0,x.jsx)(Z.Z,{sx:{width:140,height:12}}),(0,x.jsx)(Z.Z,{sx:{width:120,height:12}})]})})}))}function j(e){var n=e.emptyRows,t=e.height;return n?(0,x.jsx)(u.Z,{sx:(0,d.Z)({},t&&{height:t*n}),children:(0,x.jsx)(h.Z,{colSpan:9})}):null}var w=t(49969),y=t(23477);function b(e){var n=e.rowCount,t=void 0===n?0:n,r=e.headLabel,a=e.numSelected,o=void 0===a?0:a,i=e.onSelectAllRows,s=e.sx;return(0,x.jsx)(y.Z,{sx:s,children:(0,x.jsxs)(u.Z,{children:[i&&(0,x.jsx)(h.Z,{padding:"checkbox",children:(0,x.jsx)(w.Z,{indeterminate:!!o&&o<t,checked:!!t&&o===t,onChange:function(e){return i(e.target.checked)}})}),r.map((function(e){return(0,x.jsx)(h.Z,{align:e.align||"left",sx:{width:e.width,minWidth:e.minWidth,fontWeight:"bold",fontSize:"15px"},children:e.label},e.id)}))]})})}var C=t(45987),S=t(47605),k=["dense","action","rowCount","numSelected","onSelectAllRows","sx"];function P(e){var n=e.dense,t=e.action,r=e.rowCount,a=e.numSelected,o=e.onSelectAllRows,i=e.sx,s=(0,C.Z)(e,k);return a?(0,x.jsxs)(m.Z,(0,d.Z)((0,d.Z)({direction:"row",alignItems:"center",sx:(0,d.Z)((0,d.Z)({pl:1,pr:2,top:0,left:0,width:1,zIndex:9,height:58,position:"absolute",bgcolor:"primary.lighter"},n&&{height:38}),i)},s),{},{children:[(0,x.jsx)(w.Z,{indeterminate:!!a&&a<r,checked:!!r&&a===r,onChange:function(e){return o(e.target.checked)}}),(0,x.jsxs)(S.Z,{variant:"subtitle2",sx:(0,d.Z)({ml:2,flexGrow:1,color:"primary.main"},n&&{ml:3}),children:[a," selected"]}),t&&t]})):null}
1var _=t(9506),R=t(67426),D=t(69173),I=t(41493),L=["dense","onChangeDense","rowsPerPageOptions","sx"];function F(e){var n=e.dense,t=e.onChangeDense,r=e.rowsPerPageOptions,a=void 0===r?[15,25,50,100]:r,o=e.sx,i=(0,C.Z)(e,L);return(0,x.jsxs)(_.Z,{sx:(0,d.Z)({position:"relative"},o),children:[(0,x.jsx)(I.Z,(0,d.Z)((0,d.Z)({rowsPerPageOptions:a,component:"div"},i),{},{sx:{borderTopColor:"transparent"}})),t&&(0,x.jsx)(D.Z,{label:"Dense",control:(0,x.jsx)(R.Z,{checked:n,onChange:t}),sx:{pl:2,py:1.5,top:0,position:{sm:"absolute"}}})]})}},64e3:function(e,n,t){t.r(n),t.d(n,{default:function(){return $}});var r=t(65964),a=t(4942),o=t(1413),i=t(29439),s=t(93433),l=t(58467),c=t(47313),d=t(73428),u=t(66835),h=t(71003),p=t(47825),x=t(57861),g=t(47131),f=t(51629),m=t(9506),Z=t(24631),v=t(42988),j=t(70941),w=t(41493),y=t(19860),b=t(90842),C=t(76025),S=t(31087),k=t(98880),P=t(2248),_=t(77599),R=t(58568),D=t(30127),I=t(76522),L=t(95168),F=t(14368),E=t(43190),A=t(52861),W=t(78744),B=t(61819),H=t(15861),O=t(97741),U=t(94469),N=t(33604),V=t(96467),z=t(4117),M=t(27480),Q=t(46417);function T(e){var n=e.row,t=e.selected,r=e.onEditRow,a=(e.onSelectRow,e.onDeleteRow),o=n.id,s=n.name,l=n.domain,d=(n.max_admin,n.max_analyst,n.max_takedown,n.license_start_date,n.license_end_date,n.services),u=(n.remember_token,n.status),p=(n.created_at,n.updated_at,n.deleted_at,n.created_by,n.updated_by,n.deleted_by,(0,A.U1)().deleteCompany),x=(0,_.k)(),f=((0,_.k)(),(0,M.S)()),Z=(0,c.useState)(!1),w=(0,i.Z)(Z,2),y=w[0],C=w[1],S=[];try{S="string"===typeof d?JSON.parse(d):d,Array.isArray(S)||(S=[String(d)])}catch(k){S=[String(d)]}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(v.Z,{hover:!0,selected:t,children:[(0,Q.jsx)(j.Z,{sx:{whiteSpace:"nowrap"},children:o}),(0,Q.jsx)(j.Z,{sx:{whiteSpace:"nowrap"},children:s}),(0,Q.jsx)(j.Z,{sx:{whiteSpace:"nowrap"},children:u}),(0,Q.jsx)(j.Z,{sx:{whiteSpace:"nowrap"},children:l}),(0,Q.jsx)(j.Z,{sx:{whiteSpace:"nowrap"},children:(0,Q.jsx)(g.Z,{onClick:function(){return C(!0)},children:(0,Q.jsx)(R.Z,{icon:"solar:eye-bold",width:24})})}),(0,Q.jsx)(j.Z,{align:"left",sx:{px:1,whiteSpace:"nowrap"},children:(0,Q.jsx)(m.Z,{sx:{display:"flex",justifyContent:"left",alignItems:"left",width:"100%"},children:(0,Q.jsx)(g.Z,{color:f.open?"inherit":"default",onClick:f.onOpen,children:(0,Q.jsx)(R.Z,{icon:"eva:more-vertical-fill"})})})})]}),(0,Q.jsxs)(M.Z,{open:f.open,onClose:f.onClose,arrow:"right-top",sx:{width:140},children:[(0,Q.jsxs)(O.Z,{onClick:function(){x.onTrue(),f.onClose()},sx:{color:"error.main"},children:[(0,Q.jsx)(R.Z,{icon:"solar:trash-bin-trash-bold"}),"Delete"]}),(0,Q.jsxs)(O.Z,{onClick:function(){r(),f.onClose()},children:[(0,Q.jsx)(R.Z,{icon:"solar:pen-bold"}),"Edit"]})]}),(0,Q.jsx)(I.Q,{open:x.value,onClose:x.onFalse,title:"Delete",content:"Are you sure want to delete?",action:(0,Q.jsx)(h.Z,{variant:"contained",color:"error",onClick:(0,H.Z)((0,B.Z)().mark((function e(){return(0,B.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(o);case 3:(0,b.yv)("Company deleted successfully!",{variant:"success"}),a(),x.onFalse(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),(0,b.yv)("Failed to delete company.",{variant:"error"});case 11:case"end":return e.stop()}}),e,null,[[0,8]])}))),children:"Delete"})}),(0,Q.jsxs)(U.Z,{open:y,onClose:function(){return C(!1)},maxWidth:"sm",fullWidth:!0,children:[(0,Q.jsx)(N.Z,{children:"Services"}),(0,Q.jsx)(V.Z,{dividers:!0,children:S.length>0?(0,Q.jsx)(m.Z,{component:"div",children:S.map((function(e,n){return(0,Q.jsxs)(m.Z,{sx:{display:"flex",mb:1},children:[(0,Q.jsxs)(m.Z,{sx:{minWidth:24,fontWeight:"bold",mr:1},children:[n+1,"."]}),(0,Q.jsx)(m.Z,{children:e.replace(/_/g," ")})]},n)}))}):(0,Q.jsx)(m.Z,{children:"No services available"})}),(0,Q.jsx)(z.Z,{children:(0,Q.jsx)(h.Z,{onClick:function(){return C(!1)},children:"Close"})})]})]})}[{value:"all",label:"All"}].concat((0,s.Z)(P.e$));var q=[{id:"id",label:"ID"},{id:"name",label:"Company Name"},{id:"status",label:"Status"},{id:"domain",label:"Domain"},{id:"services",label:"Service"},{id:"action",label:"Action"}],K={name:"",role:[],status:"all"};function G(){var e=(0,E.x6)(),n=(0,L.K$)(),t=(0,S.tv)(),r=(0,_.k)(),P=((0,y.Z)(),(0,c.useState)("")),B=(0,i.Z)(P,2),H=B[0],O=B[1],U=(0,c.useState)(!1),N=(0,i.Z)(U,2),V=N[0],z=N[1],M=(0,c.useState)({keyword:"",page:1,limit:10}),G=(0,i.Z)(M,2),$=G[0],J=G[1],Y=V&&""!==$.keyword.trim(),X=(0,A.By)(e.page+1,e.rowsPerPage),ee=X.products,ne=X.totalCount,te=X.productsLoading,re=localStorage.getItem("company_id"),ae=(0,W.R)($.keyword,"company",$.page,$.limit,re||"null","null",{enabled:Y}),oe=ae.results,ie=void 0===oe?[]:oe,se=ae.totalCount1,le=void 0===se?0:se,ce=ae.isLoading,de
1=(0,c.useState)([]),ue=(0,i.Z)(de,2),he=ue[0],pe=ue[1],xe=(0,c.useState)(K),ge=(0,i.Z)(xe,2),fe=(ge[0],ge[1]);(0,c.useEffect)((function(){if(V){var e=ie.every((function(e){return"domain"in e}));pe(e?ie:[])}else pe(ee||[])}),[V,ie,ee]),(0,c.useEffect)((function(){V&&J((function(n){return(0,o.Z)((0,o.Z)({},n),{},{page:e.page+1,limit:e.rowsPerPage})}))}),[e.page,e.rowsPerPage,V]),(0,c.useEffect)((function(){""===H.trim()&&z(!1)}),[H]);var me=he,Ze=me.slice(e.page*e.rowsPerPage,e.page*e.rowsPerPage+e.rowsPerPage),ve=e.dense?52:72,je=(he.length,(0,c.useCallback)((function(n,t){e.onResetPage(),fe((function(e){return(0,o.Z)((0,o.Z)({},e),{},(0,a.Z)({},n,t))}))}),[e]),(0,c.useCallback)((function(n){var t=he.filter((function(e){return e.id!==n}));pe(t),e.onUpdatePageDeleteRow(Ze.length)}),[Ze.length,e,he])),we=(0,c.useCallback)((function(){var n=he.filter((function(n){return!e.selected.includes(n.id)}));pe(n),e.onUpdatePageDeleteRows({totalRows:he.length,totalRowsInPage:Ze.length,totalRowsFiltered:me.length}),r.onFalse()}),[me.length,Ze.length,e,he,r]),ye=(0,c.useCallback)((function(e){t.push(C.H.dashboard.user.comapnyCreateView(e))}),[t]),be=((0,c.useCallback)((function(){fe(K)}),[]),function(){H.trim().length<2?(0,b.yv)("Please enter at least 2 characters ",{variant:"warning"}):(J({keyword:H,page:1,limit:e.rowsPerPage}),e.onResetPage(),z(!0))}),Ce=Number(localStorage.getItem("role"));return 1!==Ce&&3!==Ce?(0,Q.jsx)(l.Fg,{to:"/404",replace:!0}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(p.Z,{maxWidth:!n.themeStretch&&"lg",children:[(0,Q.jsx)(F.Z,{sx:{mb:2},heading:"Company List",links:[{name:"Dashboard",href:C.H.dashboard.root},{name:"Companies"}],action:(0,Q.jsx)(m.Z,{display:"flex",alignItems:"center",justifyContent:"center",gap:2,flexWrap:"wrap",sx:{width:"100%"},children:(0,Q.jsx)(h.Z,{component:k.r,href:C.H.dashboard.user.comapnyCreateView("null"),variant:"contained",startIcon:(0,Q.jsx)(R.Z,{icon:"mingcute:add-line"}),children:"Add Company"})})}),(0,Q.jsxs)(m.Z,{display:"flex",gap:2,flexWrap:"wrap",sx:{width:"100%",mb:2},children:[(0,Q.jsx)(Z.Z,{placeholder:"Search by name,Domain...",value:H,onChange:function(e){return O(e.target.value)},size:"small",onKeyDown:function(e){"Enter"===e.key&&be()},sx:{width:{xs:"100%",sm:300,md:432}},InputProps:{endAdornment:H&&(0,Q.jsx)(g.Z,{size:"small",onClick:function(){O(""),z(!1)},children:(0,Q.jsx)(R.Z,{icon:"ic:round-close"})})}}),(0,Q.jsx)(h.Z,{onClick:be,variant:"outlined",startIcon:(0,Q.jsx)(R.Z,{icon:"mingcute:search-line"}),children:"Search"})]}),(0,Q.jsxs)(d.Z,{children:[(0,Q.jsx)(f.Z,{component:m.Z,sx:{maxHeight:8*ve,overflowY:"auto"},children:(0,Q.jsx)(D.Z,{children:(0,Q.jsxs)(u.Z,{stickyHeader:!0,size:e.dense?"small":"medium",sx:{minWidth:960},children:[(0,Q.jsx)(E.K,{headLabel:q,rowCount:he.length,numSelected:e.selected.length}),(0,Q.jsx)(x.Z,{children:V&&ce||!V&&te?(0,s.Z)(Array(e.rowsPerPage)).map((function(e,n){return(0,Q.jsx)(E.hM,{sx:{height:ve}},n)})):me.length>0?me.map((function(n){return(0,Q.jsx)(T,{row:n,selected:e.selected.includes(n.id),onSelectRow:function(){return e.onSelectRow(n.id)},onDeleteRow:function(){return je(n.id)},onEditRow:function(){return ye(n.id)}},n.id)})):(0,Q.jsx)(v.Z,{children:(0,Q.jsx)(j.Z,{colSpan:q.length,align:"center",children:(0,Q.jsx)(m.Z,{sx:{height:400,display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary",fontSize:"1.2rem"},children:"No data found"})})})})]})})}),(0,Q.jsx)(w.Z,{component:"div",count:V?le:ne,page:e.page,onPageChange:function(n,t){n&&e.onChangePage(n,t)},rowsPerPage:e.rowsPerPage,onRowsPerPageChange:function(n){e.onChangeRowsPerPage(n)},rowsPerPageOptions:[15,25,50,100],showFirstButton:!0,showLastButton:!0})]})]}),(0,Q.jsx)(I.Q,{open:r.value,onClose:r.onFalse,title:"Delete",content:(0,Q.jsxs)("span",{children:["Are you sure you want to delete ",(0,Q.jsx)("strong",{children:e.selected.length})," items?"]}),action:(0,Q.jsx)(h.Z,{variant:"contained",color:"error",onClick:we,children:"Delete"})})]})}function $(){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(r.ql,{children:(0,Q.jsx)("title",{children:"Company"})}),(0,Q.jsx)(G,{})]})}}}]);
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.