1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3239],{56557:function(e){e.exports=function(){"use strict";var e="millisecond",t="second",s="minute",r="hour",n="week",i="month",a="quarter",o="year",c="date",l="Invalid Date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(e,t,s){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(s)+e},p="en",f={};f[p]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],s=e%100;return"["+e+(t[(s-20)%10]||t[s]||t[0])+"]"}};var x="$isDayjsObject",g=function(e){return e instanceof b||!(!e||!e[x])},w=function e(t,s,r){var n;if(!t)return p;if("string"==typeof t){var i=t.toLowerCase();f[i]&&(n=i),s&&(f[i]=s,n=i);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var o=t.name;f[o]=t,n=o}return!r&&n&&(p=n),n||!r&&p},m=function(e,t){if(g(e))return e.clone();var s="object"==typeof t?t:{};return s.date=e,s.args=arguments,new b(s)},y={s:h,z:function(e){var t=-e.utcOffset(),s=Math.abs(t);return(t<=0?"+":"-")+h(Math.floor(s/60),2,"0")+":"+h(s%60,2,"0")},m:function e(t,s){if(t.date()<s.date())return-e(s,t);var r=12*(s.year()-t.year())+(s.month()-t.month()),n=t.clone().add(r,i),a=s-n<0,o=t.clone().add(r+(a?-1:1),i);return+(-(r+(s-n)/(a?n-o:o-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(l){return({M:i,y:o,w:n,d:"day",D:c,h:r,m:s,s:t,ms:e,Q:a})[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};y.l=w,y.i=g,y.w=function(e,t){return m(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var b=function(){function h(e){this.$L=w(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var p=h.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,s=e.utc;if(null===t)return new Date(NaN);if(y.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(u);if(r){var n=r[2]-1||0,i=(r[7]||"0").substring(0,3);return s?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return y},p.isValid=function(){return this.$d.toString()!==l},p.isSame=function(e,t){var s=m(e);return this.startOf(t)<=s&&s<=this.endOf(t)},p.isAfter=function(e,t){return m(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<m(e)},p.$g=function(e,t,s){return y.u(e)?this[t]:this.set(s,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,a){var l=this,u=!!y.u(a)||a,d=y.p(e),h=function(e,t){var s=y.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return u?s:s.endOf("day")},p=function(e,t){return y.w(l.toDate()[e].apply(l.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},f=this.$W,x=this.$M,g=this.$D,w="set"+(this.$u?"UTC":"");switch(d){case o:return u?h(1,0):h(31,11);case i:return u?h(1,x):h(0,x+1);case n:var m=this.$locale().weekStart||0,b=(f<m?f+7:f)-m;return h(u?g-b:g+(6-b),x);case"day":case c:return p(w+"Hours",0);case r:return p(w+"Minutes",1);case s:return p(w+"Seconds",2);case t:return p(w+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(n,a){var l,u=y.p(n),d="set"+(this.$u?"UTC":""),h=((l={}).day=d+"Date",l[c]=d+"Date",l[i]=d+"Month",l[o]=d+"FullYear",l[r]=d+"Hours",l[s]=d+"Minutes",l[t]=d+"Seconds",l[e]=d+"Milliseconds",l)[u],p="day"===u?this.$D+(a-this.$W):a;if(u===i||u===o){var f=this.clone().set(c,1);f.$d[h](p),f.init(),this.$d=f.set(c,Math.min(this.$D,f.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[y.p(e)]()},p.add=function(e,a){var c,l=this;e=Number(e);var u=y.p(a),d=function(t){var s=m(l);return y.w(s.date(s.date()+Math.round(t*e)),l)};if(u===i)return this.set(i,this.$M+e);if(u===o)return this.set(o,this.$y+e);if("day"===u)return d(1);if(u===n)return d(7);var h=((c={})[s]=6e4,c[r]=36e5,c[t]=1e3,c)[u]||1,p=this.$d.getTime()+e*h;return y.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,s=this.$locale();if(!this.isValid())return s.invalidDate||l;var r=e||"YYYY-MM-DDTHH:mm:ssZ",n=y.z(this),i=this.$H,a=this.$m,o=this.$M,c=s.weekdays,u=s.months,h=s.meridiem,p=function(e,s,n,i){return e&&(e[s]||e(t,r))||n[s].slice(0,i)},f=function(e){return y.s(i%12||12,e,"0")},x=h||function(e,t,s){var r=e<12?"AM":"PM";return s?r.toLowerCase():r};return r.replace(d,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return y.s(t.$y,4,"0");case"M":return o+1;case"MM":return y.s(o+1,2,"0");case"MMM":return p(s.monthsShort,o,u,3);case"MMMM":return p(u,o);case"D":return t.$D;case"DD":return y.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(s.weekdaysMin,t.$W,c,2);case"ddd":return p(s.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(i);case"HH":return y.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return x(i,a,!0);case"A":return x(i,a,!1);case"m":return String(a);case"mm":return y.s(a,2,"0");case"s":return String(t.$s);case"ss":return y.s(t.$s,2,"0");case"SSS":return y.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")})},p.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},p.diff=function(e,c,l){var u,d=this,h=y.p(c),p=m(e),f=(p.utcOffset()-this.utcOffset())*6e4,x=this-p,g=function(){return y.m(d,p)};switch(h){case o:u=g()/12;break;
1case i:u=g();break;case a:u=g()/3;break;case n:u=(x-f)/6048e5;break;case"day":u=(x-f)/864e5;break;case r:u=x/36e5;break;case s:u=x/6e4;break;case t:u=x/1e3;break;default:u=x}return l?u:y.a(u)},p.daysInMonth=function(){return this.endOf(i).$D},p.$locale=function(){return f[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var s=this.clone(),r=w(e,t,!0);return r&&(s.$L=r),s},p.clone=function(){return y.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},h}(),M=b.prototype;return m.prototype=M,[["$ms",e],["$s",t],["$m",s],["$H",r],["$W","day"],["$M",i],["$y",o],["$D",c]].forEach(function(e){M[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),m.extend=function(e,t){return e.$i||(e(t,b,m),e.$i=!0),m},m.locale=w,m.isDayjs=g,m.unix=function(e){return m(1e3*e)},m.en=f[p],m.Ls=f,m.p={},m}()},60276:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/employee-portal/BlogManager",function(){return s(76175)}])},76175:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>w,default:()=>m});var r=s(37876),n=s(14232),i=s(77328),a=s.n(i),o=s(56557),c=s.n(o),l=s(72193),u=s(10284),d=s.n(u),h=s(3422),p=s.n(h),f=s(39119),x=s(40406);class g extends n.Component{componentDidMount(){p().get(null).token,this.state.user?(0,f.MC)(this.state.user)||(window.location.href="/garage?tab=preferences"):window.location.href="/employee-portal",this.fetchArticles()}componentDidUpdate(e,t){}async fetchArticles(){let e=await fetch("/api/articles/"),t=await e.json();this.setState({articles:t})}attemptToDeleteArticle(){let e=p().get(null).token;if(!this.state.selectedArticle)return void alert("An error occurred while deleting the article. Please reach out to the SWAC dev team.");fetch("/api/articles/".concat(this.state.selectedArticle.slug),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}}).then(e=>{200===e.status?(this.setState({successOccurred:!0,successMessage:"Article deleted successfully",successOrFailModal:!0,confirmDeleteModal:!1}),this.fetchArticles()):this.setState({errorOccurred:!0,errorMessage:"An error occurred while deleting the article"})}).catch(e=>{this.setState({errorOccurred:!0,errorMessage:"An error occurred while deleting the article"})})}render(){var e,t,s,n;return(0,r.jsxs)("div",{style:{fontFamily:"Roboto, sans-serif",letterSpacing:"0.0125em"},children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:"Blog Manager | Stephen Wade Auto Center"})}),(0,r.jsxs)("div",{style:{backgroundColor:"transparent"},children:[(0,r.jsx)("div",{style:{width:"100%",height:"150px"},className:"background sw-flex sw-justify-center sw-align-center",children:(0,r.jsx)("h1",{className:"sw--white sw--center",children:"Blog Manager"})}),(0,r.jsxs)("div",{className:"sw-flex sw-flex-col sw-container-sm",style:{margin:"auto"},children:[(0,r.jsx)("button",{style:{backgroundColor:"#343a40",width:"138px",height:"38px",margin:"10px 0 0",padding:"6px 12px"},onClick:()=>{window.location.href="/employee-portal/menu"},children:"Return To Menu"}),(0,r.jsxs)("h2",{className:"sw--center",style:{marginTop:"20px"},children:["Welcome, ",null==(e=this.state.user)?void 0:e.firstName," ",null==(t=this.state.user)?void 0:t.lastName,"."]}),(0,r.jsx)("hr",{style:{width:"100%",height:"2px",backgroundColor:"#ccc"}}),(0,r.jsx)("button",{style:{width:"56px",height:"56px",borderRadius:"50%",backgroundColor:"#1976d2",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px",marginLeft:"auto",marginBottom:"24px"},onClick:()=>{window.location.href="/employee-portal/CreateNewArticle"},children:(0,r.jsx)(d(),{path:l.biz,size:2,color:"white"})}),this.state.articles.length>0?this.state.articles.sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()).map(e=>(0,r.jsxs)("div",{className:"sw-flex sw-justify-between",style:{width:"100%",backgroundColor:"white",borderRadius:"6px",marginBottom:"16px",padding:"16px",boxShadow:"0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)",alignItems:"flex-start"},children:[(0,r.jsxs)("div",{style:{flex:1},children:[(0,r.jsxs)("div",{className:"sw-flex sw-w-100P sw-justify-between",children:[(0,r.jsx)("div",{style:{fontSize:"14px",color:"#888"},children:c()(e.createdAt).format("M-D-YYYY")}
1),(0,r.jsx)("div",{style:{fontSize:"14px",color:"#888"},children:null==e?void 0:e.category})]}),(0,r.jsx)("h2",{style:{marginTop:"4px",marginBottom:"4px"},children:e.title}),(0,r.jsx)("p",{style:{color:"#555",marginBottom:"12px"},children:e.description}),(0,r.jsxs)("div",{className:"sw-flex sw-align-center",style:{gap:"12px"},children:[(0,r.jsx)("button",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#d32f2f",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},onClick:()=>{this.setState({confirmDeleteModal:!0,selectedArticle:e})},children:(0,r.jsx)(d(),{path:l.y_G,size:.9,color:"white"})}),(0,r.jsx)("button",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#1976d2",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},onClick:()=>{window.location.href="/employee-portal/EditArticle/?slug=".concat(e.slug)},children:(0,r.jsx)(d(),{path:l.Q43,size:.9,color:"white"})}),(0,r.jsx)("button",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#1976d2",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},onClick:()=>{this.setState({copyLinkModal:!0,selectedArticle:e})},children:(0,r.jsx)(d(),{path:l.opG,size:.9,color:"white"})}),(0,r.jsx)("button",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#1976d2",display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},onClick:()=>{window.open("/blog/articles/".concat(e.slug))},children:(0,r.jsx)(d(),{path:l.gs2,size:.9,color:"white"})})]})]}),(0,r.jsx)("div",{style:{width:"120px",height:"90px",marginLeft:"16px",borderRadius:"4px",overflow:"hidden",backgroundColor:"#ccc"},children:e.photoURL&&(0,r.jsx)("img",{src:e.photoURL,alt:"article preview",style:{width:"100%",height:"100%",objectFit:"cover"}})})]},e._id)):null]}),(0,r.jsxs)(x.A,{BGClose:!0,render:this.state.confirmDeleteModal,callBack:e=>{this.setState({confirmDeleteModal:e})},className:"sw-container sw-p-0 sw-align-center",style:{borderRadius:"0px",maxWidth:"600px"},children:[(0,r.jsx)("div",{style:{backgroundColor:"red",padding:"18px 0",boxShadow:"0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)"},className:"",children:(0,r.jsxs)("span",{className:"sw--white",style:{fontSize:"16px",padding:"4px 16px"},children:["Delete: ",null==(s=this.state.selectedArticle)?void 0:s.title]})}),(0,r.jsxs)("div",{className:"sw-flex sw-flex-col sw-align-center",style:{marginTop:"32px"},children:[(0,r.jsx)("p",{className:"sw--center sw-p-md sw-m-0",children:'Note: By clicking "apply" you will permanently delete this article. This cannot be undone.'}),(0,r.jsxs)("div",{className:"sw-flex",style:{justifyContent:"space-around",marginTop:"12px"},children:[(0,r.jsx)("button",{className:"sw--center sw-m-sm",style:{transition:"filter 0.1s ease-in-out",width:"100px",height:"36px",backgroundColor:"red",color:"white",fontSize:"14px",boxShadow:"none"},onMouseLeave:e=>e.currentTarget.style.backgroundColor="red",onMouseEnter:e=>e.currentTarget.style.backgroundColor="#b70101",onClick:()=>{this.attemptToDeleteArticle()},children:"APPLY"}),(0,r.jsx)("button",{className:"sw--center sw-m-sm",style:{transition:"filter 0.1s ease-in-out",width:"75px",height:"36px",backgroundColor:"white",color:"black",fontSize:"14px",boxShadow:"none"},onMouseLeave:e=>e.currentTarget.style.backgroundColor="white",onMouseEnter:e=>e.currentTarget.style.backgroundColor="#e6e6e6",onClick:()=>{this.setState({confirmDeleteModal:!1,errorOccurred:!1,errorMessage:"",successMessage:"",successOccurred:!1})},children:"CLOSE"})]})]})]}),(0,r.jsx)(x.A,{BGClose:!0,render:this.state.successOrFailModal,callBack:e=>{this.setState({successOrFailModal:e})},className:"sw-container sw-p-0 sw-align-center",style:{borderRadius:"05x",maxWidth:"600px"},children:(0,r.jsxs)("div",{className:"sw-flex sw-flex-col sw-align-center",style:{marginTop:"32px"},children:[this.state.errorOccurred?(0,r.jsx)("span",{style:{color:"red",marginTop:"24px",fontWeight:"bold"},children:this.state.errorMessage}):null,this.state.successOccurred?(0,r.jsx)("span",{style:{color:"green",marginTop:"24px",fontWeight:"bold"},children:this.state.successMessage}):null,(0,r.jsx)("div",{className:"sw-flex",style:{justifyContent:"space-around",marginTop:"12px"},children:(0,r.jsx)("button",{className:"sw--center sw-m-sm",style:{transition:"filter 0.1s ease-in-out",width:"75px",height:"36px",backgroundColor:"white",color:"black",fontSize:"14px",boxShadow:"none"},onMouseLeave:e=>e.currentTarget.style.backgroundColor="white",onMouseEnter:e=>e.currentTarget.style.backgroundColor="#e6e6e6",onClick:()=>{this.setState({successOrFailModal:!1,errorOccurred:!1,errorMessage:"",successMessage:"",successOccurred:!1})},children:"CLOSE"})})]})}),(0,r.jsxs)(x.A,{BGClose:!0,render:this.state.copyLinkModal,callBack:e=>{this.setState({copyLinkModal:e})},className:"sw-container sw-p-0 sw-align-center",style:{borderRadius:"0px",maxWidth:"600px"},children:[(0,r.jsx)("div",{style:{backgroundColor:"#1976d2",padding:"18px 0",boxShadow:"0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)"},className:"",children:(0,r.jsx)("span",{className:"sw--white",style:{fontSize:"32px",padding:"4px 16px"},children:"Copy the Link Below:"})}),(0,r.jsxs)("div",{className:"sw-flex sw-flex-col sw-align-center",style:{marginTop:"32px"},children:[(0,r.jsxs)("p",{className:"sw--center sw-p-md sw-m-0",style:{color:"#2196f3",fontWeight:"bold",fontSize:"20px"},children:["https://www.stephenwade.com/blog/articles/",null==(n=this.state.selectedArticle)?void 0:n.slug]}),(0,r.jsx)("div",{className:"sw-flex",style:{justifyContent:"space-around",marginTop:"12px"},children:(0,r.jsx)("button",{className:"sw--center sw-m-sm",style:{transition:"filter 0.1s ease-in-out",width:"75px",height:"36px",backgroundColor:"white",color:"black",fontSize:"14px",boxShadow:"none"},onMouseLeave:e=>e.currentTarget.style.backgroundColor="white",onMouseEnter:e=>e.currentTarget.style.backgroundColor="#e6e6e6",onClick:()=>{this.setState({copyLinkModal:!1,errorOccurred:!1,errorMessage:"",successMessage:"",successOccurred:!1,selectedArticle:{createdAt:"",description:"",markdown:"",photoURL:"",sanitizedHTML:"",slug:"",category:"",title:"",views:"",_id:""}})},children:"CLOSE"})})]})]})]})]})}constructor(e){super(e),this.props.user,this.state={user:this.props.user?this.props.user:null,articles:[],confirmDeleteModal:!1,errorOccurred:!1,errorMessage:"",successOccurred:!1,successMessage:"",successOrFailModal:!1,copyLinkModal:!1,selectedArticle:null}}}var w=!0;let m=g},77328:(e,t,s)=>{e.exports=s(29269)}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=60276)),_N_E=e.O()}]);
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.