1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4714],{80334:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[username]/articles",function(){return n(46319)}])},38171:function(e,t,n){"use strict";var a=n(34051),r=n.n(a),s=n(85893),c=n(11510),i=n(25675),l=n(41664),o=(n(67294),n(40611)),u=n(88767),d=n(80471),m=n(89583),x=n(74931);function h(e,t,n,a,r,s,c){try{var i=e[s](c),l=i.value}catch(o){return void n(o)}i.done?t(l):Promise.resolve(l).then(a,r)}function f(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function c(e){h(s,a,r,c,i,"next",e)}function i(e){h(s,a,r,c,i,"throw",e)}c(void 0)}))}}t.Z=function(e){var t,n=e.article,a=e.user,h=void 0===a?null:a,p=(0,u.useQuery)("user.".concat(n.author),f(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.Z.get("/api/users/".concat(n.author)).then((function(e){return e.data})).catch((function(e){return console.log(e)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))),v=p.data,j=p.isLoading,b=(0,u.useMutation)({mutationFn:f(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.Z.delete("/api/cms/articles/".concat(n.slug));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),onSuccess:function(){x.ZP.success("Article deleted successfully")}}),w=function(){var e=f(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.confirm("Are you sure you want to delete this article? This action cannot be undone")){e.next=3;break}return e.next=3,b.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,s.jsxs)("div",{className:"relative pb-16 border border-slate-300 rounded-lg bg-white hover:drop-shadow-lg md:mb-0 mb-4",children:[(0,s.jsxs)("div",{className:"md:p-4 p-4",children:[(0,s.jsx)("p",{className:"text-slate-500 mb-1",children:(0,c.Z)(new Date(n.createdAt),"PPP")}),(0,s.jsx)(l.default,{href:"/articles/".concat(n.slug),children:(0,s.jsxs)("a",{className:"hover:no-underline",target:"_blank",rel:"noreferrer",children:[(0,s.jsx)("h2",{className:"font-bold text-2xl mb-2 text-slate-800",children:n.title}),(0,s.jsx)("p",{dangerouslySetInnerHTML:{__html:(t=n.description,t?t.replace(/(<([^>]+)>)/gi,"").slice(0,128)+"...":"")},className:"text-slate-600"})]})})]}),j?(0,s.jsx)("div",{className:"absolute bottom-0 left-0 right-0 border-t border-slate-300 px-4 py-2",children:(0,s.jsx)(d.frZ,{className:"animate-spin"})}):(0,s.jsx)(s.Fragment,{children:v&&(0,s.jsxs)("div",{className:"absolute flex justify-between items-center bottom-0 left-0 right-0 border-t border-slate-300 px-4 py-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{href:"/".concat(v.username),children:(0,s.jsxs)("a",{target:"_blank",className:"inline-flex items-center space-x-2 text-slate-800",rel:"noreferrer",children:[(0,s.jsx)("span",{className:" top-1 relative",children:(0,s.jsx)(i.default,{src:v.avatar||"/images/avatar.png",alt:v.fullName,width:30,height:30,className:"object-cover rounded-full"})}),(0,s.jsx)("span",{children:v.fullName})]})})}),h&&"admin"===h.role?(0,s.jsx)("div",{children:(0,s.jsx)("button",{onClick:w,className:"text-red-600 hover:text-red-500",children:(0,s.jsx)(m.AMf,{})})}):null]})})]})}},41694:function(e,t,n){"use strict";var a=n(85893),r=(n(67294),n(25675)),s=n(53854),c=n(41664),i=n(11163),l=n(74931),o=n(47516),u=n(5434),d=n(89583),m=n(66653);t.Z=function(e){var t=e.profile,n=(0,i.useRouter)();return(0,a.jsxs)("div",{className:"bg-slate-900 pt-24",children:[(0,a.jsxs)("div",{className:"md:py-8 pt-12 md:mx-auto mx-8 md:flex items-center max-w-6xl md:text-left text-center",children:[(0,a.jsx)("div",{className:"cols-span-1",children:(0,a.jsx)(r.default,{src:t.avatar||"/images/avatar.png",alt:"".concat(t.first_name," ").concat(t.last_name),width:180,height:180,priority:!0,className:"rounded-full object-cover"})}),(0,a.jsxs)("div",{className:"md:ml-6 ml-0 md:mt-0 mt-6",children:[(0,a.jsxs)("h1",{className:"md:text-3xl text-3xl font-black text-slate-200",children:[t.first_name," ",t.last_name]}),(0,a.jsxs)("p",{className:"flex md:justify-start justify-center items-center text-slate-400 mb-0",children:[(0,a.jsx)(s.XAC,{className:"mr-2"})," ",t.city?"".concat(t.city,", "):"",t.state]}),t.university&&(0,a.jsxs)("p",{className:"flex md:justify-start justify-center items-center space-x-2 text-slate-400 mb-0",children:[(0,a.jsx)(d.Q7H,{})," ",(0,a.jsx)("span",{children:t.university})]}),t.law_firm&&(0,a.jsxs)("p",{className:"flex md:justify-start justify-center items-center space-x-2 text-slate-400 mb-0",children:[(0,a.jsx)(m.$Ff,{})," ",(0,a.jsx)("span",{children:t.law_firm})]}),(0,a.jsxs)("div",{className:"flex inline-block mt-4 space-x-3 md:justify-start justify-center md:mb-0 mb-12",children:[t.phone&&(0,a.jsxs)("button",{type:"button",className:"flex items-center text-sm bg-white py-1.5 px-4 roun
1ded-lg text-slate-800 space-x-1",onClick:function(){navigator.clipboard.writeText(t.phone).then((function(){l.ZP.success("Phone number copied")})).catch((function(){return l.ZP.error("Error copying phone number")}))},children:[(0,a.jsx)(o.a54,{})," ",(0,a.jsx)("span",{children:"Get phone"})]}),t.email&&(0,a.jsxs)("button",{type:"button",className:"flex items-center text-sm bg-white py-1.5 px-4 rounded-lg text-slate-800 space-x-1",onClick:function(){navigator.clipboard.writeText(t.email).then((function(){l.ZP.success("Email address copied")})).catch((function(){return l.ZP.error("Error copying email address")}))},children:[(0,a.jsx)(u.yr3,{})," ",(0,a.jsx)("span",{children:"Get email"})]})]})]})]}),(0,a.jsx)("div",{className:"max-w-6xl md:mx-auto mx-4",children:(0,a.jsxs)("ul",{className:"profile-menu overflow-x-scroll",children:[(0,a.jsx)("li",{children:(0,a.jsx)(c.default,{href:"/".concat(t.username),children:(0,a.jsx)("a",{className:"".concat(/\/\[username\]$/.test(n.pathname)?"active":""," whitespace-nowrap"),children:"About Me"})})}),(0,a.jsx)("li",{children:(0,a.jsx)(c.default,{href:"/".concat(t.username,"/reviews"),children:(0,a.jsx)("a",{className:"".concat(/\/reviews$/.test(n.pathname)?"active":""," whitespace-nowrap"),children:"Reviews"})})}),(0,a.jsx)("li",{children:(0,a.jsx)(c.default,{href:"/".concat(t.username,"/articles"),children:(0,a.jsx)("a",{className:"".concat(/\/articles$/.test(n.pathname)?"active":""," whitespace-nowrap"),children:"Articles"})})}),(0,a.jsx)("li",{children:(0,a.jsx)(c.default,{href:"/".concat(t.username,"/contact"),children:(0,a.jsx)("a",{className:"".concat(/\/contact$/.test(n.pathname)?"active":""," whitespace-nowrap"),children:"Contact Me"})})})]})})]})}},46319:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return h},default:function(){return f}});var a=n(34051),r=n.n(a),s=n(85893),c=n(67294),i=n(65357),l=n(41694),o=(n(41664),n(38171));var u=function(e){var t=e.articles;return(0,s.jsx)("div",{className:"md:grid grid-cols-3 gap-8",children:t&&t.data.map((function(e){return(0,s.jsx)(o.Z,{article:e},e.id)}))})},d=n(40611);function m(e,t,n,a,r,s,c){try{var i=e[s](c),l=i.value}catch(o){return void n(o)}i.done?t(l):Promise.resolve(l).then(a,r)}function x(e){return function(){var t=this,n=arguments;return new Promise((function(a,r){var s=e.apply(t,n);function c(e){m(s,a,r,c,i,"next",e)}function i(e){m(s,a,r,c,i,"throw",e)}c(void 0)}))}}var h=!0;function f(e){var t,n=e.profile,a=(0,c.useState)(!0),o=a[0],m=a[1],h=(0,c.useState)(null),f=h[0],p=h[1];return(0,c.useEffect)((function(){function e(){return(e=x(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.get("/api/cms/articles?author=".concat(n.id));case 3:t=e.sent.data,p(t),m(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0),m(!1);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),(0,s.jsxs)(i.Z,{meta:!0,title:"".concat(n.fullName," Articles"),description:"Read articles written by ".concat(n.fullName),image:n.avatar||"/images/avatar.png",children:[(0,s.jsx)(l.Z,{profile:n}),(0,s.jsx)("div",{className:"py-12 max-w-6xl md:mx-auto mx-4",children:!o&&(null===f||void 0===f||null===(t=f.data)||void 0===t?void 0:t.length)>0?(0,s.jsx)(u,{articles:f}):(0,s.jsxs)("div",{className:"p-4 rounded-lg border border-slate-200",children:[n.first_name," ",n.last_name," has not published any articles."]})})]})}}},function(e){e.O(0,[5445,2013,9866,955,3874,6556,1228,3276,2175,6653,1510,5357,9774,2888,179],(function(){return t=80334,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.