PageSourceSearch

https://videotoblog.ai/_next/static/chunks/32502-f089052367385fe9.js

js videotoblog.ai collected 2026-10-02 06:37:32 UTC 139,086 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[32502,1972],{6851:function(e,i,t){t.d(i,{N:function(){return n}});let n=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/articles",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new URLSearchParams(t);i&&"/articles"!==i?n.set("next",i):n.delete("next");let l=n.toString();return l?"".concat(e,"?").concat(l):e}},80218:function(e,i,t){t.d(i,{mp:function(){return r}});var n=t(1972),l=t(83198);l.Z.init("71db00bc242854f9b087cad519ab3432",{debug:n.L1});let r=l.Z},17539:function(e,i,t){t.d(i,{Cq:function(){return c},FK:function(){return r},NY:function(){return u},dK:function(){return d},eQ:function(){return h}});var n=t(76258);let l="/blog",r="https://videotoblog.ai".concat(l),o="preview",a=e=>(e||"").split(":")[0].toLowerCase(),s=e=>{let i=a(e).split(".");return i.length>=4&&i[i.length-3]===o&&"videotoblog"===i[i.length-2]&&"ai"===i[i.length-1]?i.slice(0,-3).join(".")||null:i.length>=3&&i[i.length-2]===o&&i[i.length-1].includes("localhost")&&i.slice(0,-2).join(".")||null},d=e=>!!s(e),c=function(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i&&(null==e?void 0:e.id)===n.AS},u=e=>e===l||(null==e?void 0:e.startsWith("".concat(l,"/"))),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(l).concat(e)}},1972:function(e,i,t){t.d(i,{$M:function(){return C},Cf:function(){return w},Cg:function(){return P},Cw:function(){return _},Gz:function(){return q},H:function(){return y},Jh:function(){return E},Jj:function(){return g},L1:function(){return m},Mi:function(){return V},Nn:function(){return j},Ny:function(){return L},Oe:function(){return v},Pf:function(){return f},Qm:function(){return Y},S3:function(){return G},SZ:function(){return R},VL:function(){return U},_y:function(){return A},aF:function(){return X},b5:function(){return B},bg:function(){return b},dD:function(){return S},f5:function(){return x},gO:function(){return I},ht:function(){return D},j0:function(){return z},lq:function(){return N},nM:function(){return M},o_:function(){return W},ov:function(){return $},pK:function(){return k},q9:function(){return K},qD:function(){return Z},ql:function(){return O},qz:function(){return F},rR:function(){return Q},un:function(){return T},xW:function(){return J},zD:function(){return ee},ze:function(){return H}});var n=t(14859),l=t(18745),r=t(46716),o=t(39828),a=t(30381),s=t.n(a),d=t(9351),c=t(76258),u=t(17539),h=t(31114),p=t(21793);let x=async(e,i,t)=>{let n=Math.max(Math.floor(Math.min(t,e.length)),1),l=[],r=0;return await Promise.all(Array.from({length:n}).map(async(t,n)=>{for(;r<e.length;){let t=r;r++,l[t]=await i(e[t],t,n)}})),l},m=!1,g=!1,v=!1;s()("2/12/2025","M/D/YYYY").toDate();let j=!1,f=!0;s()().isBefore(s()("12/2/2025","M/D/YYYY"));let y=s()().isBefore(s()("12/2/2025","M/D/YYYY")),b=m,Z=m,w=m,k=m,C=!0,S=()=>(0,n.Z)((0,l.Z)().breakpoints.down("md")),I=e=>{var i;return null!==(i=(0,r.zD)(e)("h1").text())&&void 0!==i?i:""},P=()=>"<div ".concat("data-vtb-membership-paywall",'="true" class="publication-membership-preview-divider" contenteditable="false"><span class="publication-membership-preview-divider__label">Member-only content below this line <span class="publication-membership-preview-divider__arrow">↓</span></span></div>'),T=e=>{var i,t;return e.title?e.title:I(null!==(t=null!==(i=null==e?void 0:e.html)&&void 0!==i?i:null==e?void 0:e.publishedHtml)&&void 0!==t?t:"")},W=e=>e.html?(0,r.zD)(e.html).text().slice(0,137).trim()+"...":"",U=e=>{if(!e)return[];let i=(0,r.zD)(e);return i("img").map(function(){return i(this).attr("src")}).toArray().filter(Boolean)},A=function(e){var i;let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e.featuredImageUrl&&"undefined"!==e.featuredImageUrl)return e.featuredImageUrl;if(t&&!e.publishedHtml||!t&&!e.html)return"";let n=U(null!==(i=t?e.publishedHtml:null==e?void 0:e.html)&&void 0!==i?i:"").filter(e=>"undefined"!=e);return e.featuredImageUrl&&"undefined"!==e.featuredImageUrl&&n.includes(e.featuredImageUrl)?e.featuredImageUrl:null==n?void 0:n[0]},E=e=>/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,8}$/i.test(e),M=e=>{var i,t,n,l,r,o;let a="";try{let t=(0,d.Ei)(null!==(i=null==e?void 0:e.videoUrl)&&void 0!==i?i:"");if(!t)throw Error("No YouTube video ID found");a="https://img.youtube.com/vi/".concat(t,"/0.jpg")}catch(e){}let s=null!==(l=null!==(n=null==e?void 0:e.displayTitle)&&void 0!==n?n:I(null!==(t=null==e?void 0:e.html)&&void 0!==t?t:""))&&void 0!==l?l:"Video To Blog",c=null!==(o=null!==(r=null==e?void 0:e.featuredImageUrl)&&void 0!==r?r:A(e))&&void 0!==o?o:a;return{title:s,description:e.description,openGraph:{images:c?[{url:c}]:[]},twitter:{handle:"@Video_To_Blog",site:"@Video_To_Blog",cardType:"summary_large_image"}}},F=e=>{try{return Array.from(new Intl.Segmenter(D(),{granularity:"word"}).segment(e)).filter(e=>e.isWordLike).map(e=>e.segment)}catch(i){return e.split(" ")}},O=e=>{try{return Array.from(new Intl.Segmenter(D(),{granularity:"grapheme"}).segment(e)).map(e=>e.segment).filter(e=>!!e.trim())}catch(i){return e.replaceAll(" ","")}},R=e=>{try{return Array.from(new Intl.Segmenter(D(),{granularity:"sentence"}).segment(e),e=>e.segment)}catch(i){return e.match(/[^\.!\?]+[\.!\?]+/g)}},D=()=>{let e="";try{e=navigator.language}catch(i){e="en"}return e},z=e=>{try{let i=new Date(1e3*e).toISOString().slice(12,19);if("0:"===i.slice(0,2))return i.slice(2);return i}catch(e){return""}},L=e=>e<1024?"".concat(e," bytes"):"".concat((e/1024).toFixed(2)," kB"),N=e=>{try{if(0==e)return"0s";let i=Math.floor(e/3600),t=Math.floor(e%3600/60),n=Math.floor(e%3600%60);return(i>0?i+"h ":"")+(t>0?t+"m ":"")+(n>0?n+"s":"")}catch(i){return console.error("error converting str",{sec_num:e,e:i}),"err"}},_=e=>{var i;return{isPublished:!1,publishedHtml:null,publishedPublicationId:null,publishedDate:null,publicationPostStatus:null!==(i=(0,d.OG)({...e,isPublished:!1,publishedPublicationId:null}))&&void 0!==i?i:void 0}},B=e=>{let i={};return e?(Object.keys(e).forEach((t,n)=>{var l;let r=(null===(l=e[t])||void 0===l?void 0:l._seconds)?o.Timestamp.fromMillis(1e3*e[t]._seconds):e[t];i[t]=r}),i):e},Y=e=>{e=null==e?void 0:e.trim();try{var i,t;if(!e)return"";if(e.split(" ").length<2)return e[0].toUpperCase();return"".concat(null==e?void 0:null===(i=e.split(" ")[0][0])||void 0===i?void 0:i.toUpperCase()).concat(null==e?void 0:null===(t=e.split(" ")[1][0])||void 0===t?void 0:t.toUpperCase())}catch(e){return""}},H=e=>e.toLowerCase().trim().replaceAll(" ","-").replace(/[\W_]+/g,"-"),V=e=>
1{let i=(0,h.QT)(e)===h.ew?(0,h.am)(h.ew):"videoToBlog.io";return"".concat(e.subdomain,"@").concat(i)},q=e=>{var i;if(!e)return;let t=[];for(let n=0;n<(null!==(i=null==e?void 0:e.length)&&void 0!==i?i:0);n++)if(t.push(null==e?void 0:e[n]),n+1<(null==e?void 0:e.length)){let i=s()(e[n+1].dimensions[0]).diff(s()(e[n].dimensions[0]),"days");for(let l=0;l<i-1;l++)t.push({dimensions:[s()(e[n].dimensions[0]).add(l+1,"days").format("YYYY-MM-DD")],metrics:[0]})}return t},G=e=>{let{title:i,link:t,publication:n,buttonBackgroundColor:l}=e,r=null!=l?l:(0,p.eV)(n).colors.accentColor,o=X(r);return'\n    <div class="mceNonEditable vtb-button" >\n  <table  style="border-width: 0px; width: 100%">\n  <tbody>\n\n    \n     <tr>\n       <td width=\'100%\' style="border-width: 0px; text-align: start; justify-content: center; align-items: center;">\n         <a '.concat(t?'href="'.concat(t,'"'):"",' target="_blank" style="display: inline-block; padding: 12px 24px; text-decoration: none; border-radius: 8px; background-color: ').concat(r,"; color: ").concat(o,'; font-size: 16px; line-height: 1.2; font-weight: 600; font-family: inherit;">\n         ').concat(i,"\n      </a>\n    </td>\n    </tr>\n   \n   \n    \n  </tbody>\n  </table>\n  </div>\n  ").trim()},X=e=>{let i=e.replace("#",""),t=+"0x".concat(i.slice(0,2));return .299*t+.587*+"0x".concat(i.slice(2,4))+.114*+"0x".concat(i.slice(4,6))>186?"#15171A":"#ffffff"},$=(e,i,t)=>{var n,l,r,o,a,s,d,c;let u=[null==e?void 0:e.wordpressOrg,...null!==(o=null==e?void 0:e.wordpressOrgs)&&void 0!==o?o:[]].filter(Boolean),h=[null==e?void 0:e.wordpress,...null!==(a=null==e?void 0:e.wordpresses)&&void 0!==a?a:[]].filter(Boolean),p=[null==e?void 0:e.medium,...null!==(s=null==e?void 0:e.mediums)&&void 0!==s?s:[]].filter(Boolean),x=[null==e?void 0:e.ghostOrg,...null!==(d=null==e?void 0:e.ghostOrgs)&&void 0!==d?d:[]].filter(Boolean),m=u.length+h.length+p.length+x.length;return(e.blogger&&(m+=1),(null===(n=e.wixSites)||void 0===n?void 0:n.length)&&(m+=1),(null===(l=e.shopifySites)||void 0===l?void 0:l.length)&&(m+=1),m+=null!==(c=null===(r=e.webflows)||void 0===r?void 0:r.length)&&void 0!==c?c:0,t&&(null==i?void 0:i.website_integrations.hasAccess))?(null==i?void 0:i.website_integrations.isUnlimited)||!(m>=i.website_integrations.limit)?{status:!0}:{status:!1,title:"Upgrade needed",subtitle:"You have reached your max amount of website integrations. Please upgrade to create another website integration."}:{status:!1,title:"Upgrade needed",subtitle:t?"You are currently on an older unlimited plan. Please upgrade to a newer plan to connect a website.":"Please upgrade to connect a website."}},Q=e=>e<60?"".concat(e," minutes"):e%60==0?"".concat(e/60," hours"):"".concat(Math.round(10*e/60)/10," hours"),K=(e,i)=>e.id===c.AS?(0,u.eQ)(i):i,J=e=>{if(!e)return"";let i=e.toLowerCase().trim();return(i=(i=i.replace(/\/+$/,"")).replace(/^https?:\/\//,"")).replace(/^www\./,"")};function ee(e){return new Promise((i,t)=>{let n=new Image;n.crossOrigin="anonymous",n.onload=()=>{i({width:n.naturalWidth,height:n.naturalHeight})},n.onerror=t,n.src=e})}},87713:function(e,i,t){t.d(i,{J:function(){return T},z:function(){return W}});var n=t(85893),l=t(1972),r=t(38444),o=t(39875),a=t(67131),s=t(63214),d=t(6310),c=t(36515),u=t(25714),h=t(88196),p=t(92365),x=t(21485),m=t(52857),g=t(40110),v=t(30055),j=t(28578),f=t(51015),y=t(40492),b=t(95611),Z=t(44069),w=t(15103),k=t(48583),C=t(46532),S=t(29496);let I=(0,w.cn)(!1),P=(0,w.cn)(null),T=()=>{let[e,i]=(0,k.KO)(I),[t,n]=(0,k.KO)(P);return{close:()=>{i(!1),n(null)},isOpen:e,open:(e,t)=>{n({blog:e,publication:t}),i(!0)},props:t}},W=()=>{let[e]=(0,k.KO)(C.k),{close:i,isOpen:t,props:w}=T(),I=null==w?void 0:w.blog,P=null==w?void 0:w.publication,W=I&&P&&I.slug?(0,Z.AY)(P,I.slug):"",U=I?(0,l.un)(I)||"Untitled article":"",A=I?I.description||(0,l.o_)(I):"",E=I?(0,l._y)(I):"",M="Check out this article: ".concat(U),F=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Link copied.";if(W)try{await navigator.clipboard.writeText(W),(0,S.yv)(e,{variant:"success"})}catch(e){(0,S.yv)("Could not copy the published link.",{variant:"error"})}},O=e=>{window.open(e,"_blank","noopener,noreferrer")};if(!I||!P||!W)return null;let R=[{label:"Instagram",icon:(0,n.jsx)(s.default,{}),onClick:()=>void F("Link copied. Paste it into your Instagram post.")},{label:"X",icon:(0,n.jsx)(u.default,{}),onClick:()=>O("https://x.com/intent/tweet?url=".concat(encodeURIComponent(W),"&text=").concat(encodeURIComponent(M)))},{label:"Facebook",icon:(0,n.jsx)(a.default,{}),onClick:()=>O("https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(W)))},{label:"LinkedIn",icon:(0,n.jsx)(c.default,{}),onClick:()=>O("https://www.linkedin.com/shareArticle?url=".concat(encodeURIComponent(W),"&title=").concat(encodeURIComponent(U)))}];return(0,n.jsxs)(h.Z,{fullWidth:!0,maxWidth:"sm",onClose:i,open:t&&!e,children:[(0,n.jsxs)(p.Z,{sx:{pb:3,position:"relative",textAlign:"center"},children:[(0,n.jsx)(x.Z,{fontWeight:700,variant:"h5",children:"Your post is live!"}),(0,n.jsx)(m.Z,{"aria-label":"Close share dialog",onClick:i,sx:{position:"absolute",right:12,top:10},children:(0,n.jsx)(r.default,{})})]}),(0,n.jsx)(g.Z,{sx:{pb:3,pt:1.5},children:(0,n.jsxs)(v.Z,{spacing:2.5,children:[(0,n.jsxs)(j.Z,{component:"a",href:W,rel:"noreferrer",target:"_blank",sx:{border:1,borderColor:"divider",borderRadius:2,color:"inherit",display:"flex",gap:2,overflow:"hidden",p:2,textDecoration:"none",transition:"border-color 150ms ease, box-shadow 150ms ease","&:hover":{borderColor:"text.secondary",boxShadow:1}},children:[E&&(0,n.jsx)(j.Z,{alt:"",component:"img",src:E,sx:{borderRadius:1,height:88,objectFit:"cover",width:132}}),(0,n.jsxs)(v.Z,{justifyContent:"center",spacing:.5,sx:{minWidth:0},children:[(0,n.jsx)(x.Z,{fontWeight:700,noWrap:!0,children:U}
1),A&&(0,n.jsx)(x.Z,{color:"text.secondary",sx:{display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:2},variant:"body2",children:A})]}),(0,n.jsx)(d.Z,{color:"action",sx:{flexShrink:0,ml:"auto"}})]}),(0,n.jsx)(j.Z,{sx:{border:1,borderColor:"divider",borderRadius:2,p:{xs:2,sm:2.5}},children:(0,n.jsxs)(v.Z,{spacing:2,children:[(0,n.jsxs)(v.Z,{alignItems:"flex-start",direction:"row",justifyContent:"space-between",spacing:2,children:[(0,n.jsxs)(j.Z,{children:[(0,n.jsx)(x.Z,{fontWeight:700,children:"Share your link"}),(0,n.jsx)(x.Z,{color:"text.secondary",variant:"body2",children:"Copy this link and share it everywhere."})]}),(0,n.jsx)(f.Z,{onClick:()=>void F(),variant:"outlined",children:"Copy link"})]}),(0,n.jsx)(y.Z,{"aria-label":"Published article link",fullWidth:!0,inputProps:{readOnly:!0},value:W,InputProps:{endAdornment:(0,n.jsx)(b.Z,{position:"end",children:(0,n.jsx)(m.Z,{"aria-label":"Copy published article link",edge:"end",onClick:()=>void F(),children:(0,n.jsx)(o.Z,{fontSize:"small"})})})}}),(0,n.jsx)(j.Z,{sx:{display:"grid",gap:1,gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"}},children:R.map(e=>{let{label:i,icon:t,onClick:l}=e;return(0,n.jsx)(f.Z,{color:"inherit",onClick:l,startIcon:t,variant:"contained",children:i},i)})})]})})]})})]})}},51186:function(e,i,t){t.d(i,{H:function(){return er}});var n,l,r=t(85893),o=t(88196),a=t(92365),s=t(40110),d=t(1972),c=t(37461),u=t(97115),h=t(90281);let p=()=>{let{callApi:e,...i}=(0,h.W)("getTeamMember"),t=async i=>await e(i);return{...i,getTeamMember:t}},x=()=>{let{callApi:e,...i}=(0,h.W)("removeTeamMember"),t=async i=>await e(i);return{...i,removeTeamMember:t}},m=()=>{let{callApi:e,isLoading:i}=(0,h.W)("resendInvite");return{isLoading:i,resendInvite:async i=>e(i)}},g=()=>{let{callApi:e,isLoading:i}=(0,h.W)("sendInvite");return{isLoading:i,sendInvite:async i=>e(i)}};var v=t(8080),j=t(39828),f=t(29496),y=t(76245);let b=()=>{let e=(0,y.II)(),{enqueueSnackbar:i}=(0,f.Ds)();return{deleteInvite:async t=>{try{await (0,j.deleteDoc)((0,j.doc)(v.db,"users/".concat(e,"/invites/").concat(t))),i("Invite deleted successfully.",{variant:"success"})}catch(e){i("Failed to delete Invite.",{variant:"error"})}}}};var Z=t(7921),w=t(26677);let k=()=>{var e,i;let t=(0,y.II)(),[n,l,r]=(0,w.Kx)((0,j.query)((0,j.collection)(v.db,"users/".concat(t,"/invites")),(0,j.orderBy)("dateSent","desc")));return{invites:null!==(i=null==n?void 0:null===(e=n.docs)||void 0===e?void 0:e.map(e=>e.data()))&&void 0!==i?i:[],isLoading:l}};var C=t(4338),S=t(4726),I=t(92623),P=t(53839),T=t(38444),W=t(89090),U=t(40851),A=t(32083),E=t(35083),M=t(30055),F=t(95858),O=t(40492),R=t(61769),D=t(96727),z=t(28578),L=t(21485),N=t(81873),_=t(51015),B=t(52857),Y=t(18745),H=t(19304),V=t(7638),q=t(21201),G=t(32200);t(29346),t(15972);var X=t(84324),$=t(70429),Q=t(65536),K=t(67294),J=t(73500),ee=t(10089);let ei=()=>{var e,i;let{invites:t,isLoading:n}=k(),{user:l}=(0,I.a)(),{deleteInvite:r}=b(),{resendInvite:o}=m(),{updateUser:a}=(0,S.I)(),{featureAccess:s,hasPlan:d}=(0,C.X)(),u=(0,ee.O$)(),{featureAccess:h}=(0,Z.X)(),{open:p}=(0,c.v)(),x=Object.values(null!==(e=null==l?void 0:l.teamMembers)&&void 0!==e?e:{}).filter(e=>"Administrator"===e.role),g=Object.values(null!==(i=null==l?void 0:l.teamMembers)&&void 0!==i?i:{}).filter(e=>"Contributor"===e.role),v=async(e,i)=>{try{let t={...l.teamMembers};t[e].role=i,await a(l.id,{teamMembers:t})}catch(t){$.cM.error("Error changing team member role",{error:t,teamMemberId:e,newRole:i}),(0,f.yv)("Uh oh. Something went wrong. Please try again or contact support.",{variant:"error"})}};return{invites:t,user:l,admins:x,contributors:g,isLoadingInvites:n,onResend:async e=>{try{if(!(await o({inviteId:e})).success)throw Error("not successful");(0,f.yv)("Invite successfully resent",{variant:"success"})}catch(i){$.cM.error("Error resending invite",{error:i,inviteId:e}),(0,f.yv)("Uh oh. Something went wrong. Please try again or contact support.",{variant:"error"})}},onRoleChange:v,onAddTeamMember:()=>{var e,i,n,l;let r=u?null==h?void 0:h.team_members:null==s?void 0:s.team_members,o=(null!==(e=null==x?void 0:x.length)&&void 0!==e?e:0)+(null!==(i=null==t?void 0:t.length)&&void 0!==i?i:0)+1;
1if(!u&&!d){p({title:"Upgrade to add team members."});return}if(!(null==r?void 0:r.hasAccess)||!r.isUnlimited&&(null!==(n=r.limit)&&void 0!==n?n:0)<=o){p({title:"Upgrade to add more team members.",subtitle:"Your current plan only allows you to have ".concat(null!==(l=null==r?void 0:r.limit)&&void 0!==l?l:0," team members.")});return}return!0},onRevoke:async e=>{try{await r(e),(0,f.yv)("Invite successfully revoked",{variant:"success"})}catch(i){$.cM.error("Error revoking invite",{error:i,inviteId:e}),(0,f.yv)("Uh oh. Something went wrong. Please try again or contact support.",{variant:"error"})}}}};(n=l||(l={})).Page="page",n.Dialog="dialog";let et=e=>{let{variant:i,onClose:t}=e,n=(0,ee.WL)(),{showDialog:l,closeDialog:o}=(0,u.Rh)(),{onAddTeamMember:d}=ei(),c=()=>{!0===d()&&l((0,r.jsx)(()=>{let[e,i]=(0,K.useState)(""),{sendInvite:t,isLoading:l}=g(),[d,c]=(0,K.useState)("Contributor"),u=async()=>{if(!e){(0,f.yv)("Please enter an email address",{variant:"warning"});return}(await t({email:e,role:"Administrator"})).success?((0,f.yv)("Invite sent!",{variant:"success"}),o()):(0,f.yv)("Uh oh. Something went wrong. Please try again or contact support.",{variant:"error"})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{children:"Invite a new team member"}),(0,r.jsxs)(s.Z,{children:[(0,r.jsxs)(M.Z,{spacing:2,sx:{mb:3},children:[(0,r.jsxs)(F.Z,{children:["Send an invitation for a new person to join your ",n," account."]}),(0,r.jsx)(O.Z,{value:e,onChange:e=>i(e.target.value),placeholder:"[email protected]",label:"Email",helperText:(0,r.jsxs)(r.Fragment,{children:["Team Members will have full access to manage articles, automations, integrations, publications, and more. ",(0,r.jsx)(R.Z,{href:"https://docs.videotoblog.ai/en/help/articles/8877308-team-members",target:"_blank",children:"Learn more"})," "]})})]}),(0,r.jsx)(D.Z,{children:(0,r.jsx)(E.Z,{loading:l,variant:"contained",onClick:u,children:(0,r.jsx)("div",{children:"Send Invitation"})})})]})]})},{}))};return"page"===i?(0,r.jsxs)(z.Z,{flex:1,display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,r.jsxs)(M.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,r.jsx)(L.Z,{variant:"h6",children:"Team Members"}),(0,r.jsx)(N.Z,{size:"small",label:"Beta",color:"secondary",icon:(0,r.jsx)(A.default,{})})]}),(0,r.jsx)(_.Z,{onClick:c,startIcon:(0,r.jsx)(P.default,{}),children:"Invite People"})]}):"dialog"===i?(0,r.jsxs)(z.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,r.jsxs)(z.Z,{display:"flex",alignItems:"center",gap:2,children:[(0,r.jsx)(B.Z,{onClick:t,"aria-label":"Close dialog",children:(0,r.jsx)(T.default,{})}),(0,r.jsx)(L.Z,{variant:"h6",children:"Team Members"})]}),(0,r.jsx)(_.Z,{onClick:c,startIcon:(0,r.jsx)(P.default,{}),size:"small",children:"Invite People"})]}):null},en=e=>{var i,t;let{showHeader:n=!0}=e,{invites:l,user:o,admins:a,onResend:s,onRoleChange:c,onRevoke:u}=ei(),h=(0,Y.Z)();return(0,r.jsxs)(M.Z,{children:[n&&(0,r.jsx)(et,{variant:"page"}),o&&(0,r.jsxs)(H.ZP,{children:[(0,r.jsx)(V.Z,{children:(0,r.jsx)(q.Z,{sx:{fontSize:14,bgcolor:"".concat(h.palette.secondary.light," !important")},src:null!==(i=null==o?void 0:o.photoUrl)&&void 0!==i?i:void 0,alt:null!==(t=null==o?void 0:o.displayName)&&void 0!==t?t:"",children:(0,d.Qm)(null==o?void 0:o.displayName)})}),(0,r.jsx)(G.Z,{primary:"".concat(null==o?void 0:o.displayName),secondary:"Owner"})]}),a.map(e=>(0,r.jsx)(el,{teamMember:e,onRoleChange:c},e.userId)),l.map(e=>(0,r.jsxs)(H.ZP,{children:[(0,r.jsx)(G.Z,{primary:(0,r.jsxs)(M.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,r.jsx)("div",{children:e.email}),(0,r.jsx)(N.Z,{size:"small",label:"Pending invitation"})]})}),(0,r.jsx)(J.j,{menuButtons:[{onClick:()=>s(e.id),title:"Resend",icon:(0,r.jsx)(U.Z,{})},{onClick:()=>u(e.id),title:"Revoke",icon:(0,r.jsx)(W.default,{color:"error"}),color:h.palette.error.main}]})]},e.id))]})},el=e=>{var i,t;let{teamMember:n,onRoleChange:l}=e,{getTeamMember:o}=p(),{removeTeamMember:a,isLoading:s}=x(),c=(0,y.II)(),{showDialog:h,closeDialog:m}=(0,u.Rh)(),g=(0,Q.N4)(),v=(0,Y.Z)(),[j,b]=(0,K.useState)();(0,K.useEffect)(()=>{c&&o({userId:c,teamMemberId:n.userId}).then(e=>{b(e)}).catch(e=>{$.cM.error("Error getting team member info",{error:e,teamMemberId:n.userId})})},[c,n.userId]);let Z=async()=>
1{if(c){try{await g({title:"Are you sure?",description:"This cannot be undone",confirmationText:"Yes, delete",confirmationButtonProps:{variant:"contained",color:"error"}})}catch(e){return}try{m(),await a({teamMemberId:n.userId,userId:c}),(0,f.yv)("Team member successfully deleted",{variant:"success"})}catch(e){$.cM.error("Error removing team member",{error:e,teamMemberId:n.userId}),(0,f.yv)("Uh oh. Something went wrong. Please try again or contact support.",{variant:"error"})}}};return(0,r.jsx)(H.ZP,{children:j&&!s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{children:(0,r.jsx)(q.Z,{sx:{fontSize:14,bgcolor:"".concat(v.palette.secondary.light," !important")},src:null!==(i=null==j?void 0:j.photoUrl)&&void 0!==i?i:void 0,alt:null!==(t=null==j?void 0:j.displayName)&&void 0!==t?t:"",children:(0,d.Qm)(null==j?void 0:j.displayName)})}),(0,r.jsx)(G.Z,{primary:j.displayName,secondary:j.email}),(0,r.jsx)(J.j,{menuButtons:[{onClick:()=>Z(),title:"Delete",icon:(0,r.jsx)(W.default,{color:"error"}),color:v.palette.error.main}]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{children:(0,r.jsx)(X.Z,{variant:"circular",width:40,height:40})}),(0,r.jsxs)(z.Z,{sx:{flex:1},children:[(0,r.jsx)(X.Z,{variant:"text",width:"60%",height:24}),(0,r.jsx)(X.Z,{variant:"text",width:"40%",height:20})]})]})})},er=e=>{let{open:i,onClose:t}=e;return(0,r.jsxs)(o.Z,{open:i,onClose:t,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(a.Z,{children:(0,r.jsx)(et,{variant:l.Dialog,onClose:t})}),(0,r.jsx)(s.Z,{children:(0,r.jsx)(en,{showHeader:!1})})]})}},84954:function(e,i,t){t.d(i,{l:function(){return o}});var n=t(8080),l=t(39828),r=t(76245);let o=()=>{let e=(0,r.II)();return async(i,t)=>{if(!e)throw Error("Sign in before changing automation settings.");let r=Object.fromEntries(Object.entries(t).filter(e=>{let[,i]=e;return void 0!==i}).map(e=>{let[i,t]=e;return["convellaAutomation.".concat(i),t]}));await (0,l.updateDoc)((0,l.doc)(n.db,"users/".concat(e,"/publications/").concat(i)),{...r,"convellaAutomation.configuredAt":Date.now()})}}},27084:function(e,i,t){t.d(i,{j:function(){return c}});var n=t(8080),l=t(70429),r=t(39828),o=t(11163),a=t(67294),s=t(76245),d=t(3349);let c=()=>{let e=(0,s.II)(),[i]=(0,d.F_)(n.bU),[t,c]=(0,a.useState)(!1);return(0,o.useRouter)(),{upgradeSubscription:async(t,o,a)=>{c(!0);try{var s,d,u;let h=null!==(d=null==a?void 0:a.successUrl)&&void 0!==d?d:"".concat(window.location.href,"?subscriptionStatus=success"),p=null!==(u=null==a?void 0:a.cancelUrl)&&void 0!==u?u:window.location.href,x={price:t,allow_promotion_codes:!0,success_url:h,cancel_url:p,payment_method_collection:"if_required"};(null==i?void 0:i.email)&&(x.customer_email=i.email);let m=null===(s=window.Rewardful)||void 0===s?void 0:s.referral;m&&(x.client_reference_id=m);let g=await (0,r.addDoc)((0,r.collection)(n.db,"customers/".concat(null!=o?o:e,"/checkout_sessions")),x),v=(0,r.onSnapshot)(g,e=>{var i;let{url:t,error:n}=null!==(i=e.data())&&void 0!==i?i:{};n?(v(),l.cM.error("Error when upgrading subscription in snapshot",{error:n}),c(!1)):"string"==typeof t&&t&&(v(),window.location.assign(t),c(!1))})}catch(e){console.error("Error when upgrading subscription",e),l.cM.error("Error when upgrading subscription",{error:e}),c(!1)}},isLoading:t}}},91838:function(e,i,t){t.d(i,{b:function(){return u}});var n=t(8080),l=t(70429),r=t(77004),o=t(11163),a=t(29496),s=t(67294),d=t(10089),c=t(12116);let u=()=>{let[e,i]=(0,s.useState)(!1);(0,o.useRouter)();let t=(0,d.O$)(),{createCustomerPortalSession:u}=(0,c.qD)();return{goToBilling:async(e,o,s)=>{i(!0);let d=null;try{var c;if(t){d=window.open("","_blank");let e=await u();d?(d.opener=null,d.location.href=e.url):window.location.assign(e.url);return}let i=(0,r.V1)(n.mr,"ext-firestore-stripe-payments-createPortalLink"),{data:l}=await i({returnUrl:null!==(c=null==s?void 0:s.returnUrl)&&void 0!==c?c:window.location.href,locale:"auto"}),a=l.url;e&&o?a+="/subscriptions/".concat(e,"/preview/").concat(o):e&&(a+="/subscriptions/".concat(e,"/update")),window.location.assign(a)}catch(e){null==d||d.close(),console.error("Error loading billing"),l.cM.error("Error loading billing",{error:e}),(0,a.yv)("Whoops, something went wrong",{variant:"error"})}finally{i(!1)}},isLoading:e}}},32502:function(e,i,t){t.r(i),t.d(i,{default:function(){return nS}});var n,l,r=t(85893);t(61667),t(94140),t(36750),t(18157),t(97696),t(54483),t(90189);var o=t(6851),a=t(8080),s=t(80218),d=t(19876),c=t(32052),u=t(90543),h=t(92623),p=t(39188),x=t(52668),m=t(91669),g=t(16383),v=t(90737),j=t(72892),f=t(97597),y=t(54558),b=t(9527),Z=t(50899),w=t(53246),k=t(44771),C=t(34777),S=t(42348),I=t(27643),P=t(10089),T=t(75459),W=t(12320),U=t(40580),A=t(11552),E=t(1972),M=t(75854),F=t(11509),O=t(36977),R=t(2824),D=t(70178),z=t(52311),L=t(33034),N=t(40423),_=t(60762),B=t(71919),Y=t(30055),H=t(28578),V=t(21485),q=t(92608),G=t(51015),X=t(52857),$=t(97182),Q=t(51423),K=t(23647),J=t(47407),ee=t(19304),ei=t(7638),et=t(21201),en=t(32200),el=t(25381),er=t(4989),eo=t(56912),ea=t(84324),es=t(79533),ed=t(81359),ec=t(15972),eu=t(75527),eh=t(10980),ep=t(31754),ex=t(5059),em=t(92365),eg=t(40110),ev=t(95858),ej=t(96727),ef=t(11163),ey=t(67294),eb=t(53839),eZ=t(53819),ew=t(29954),ek=t(45771),eC=t(77527),eS=t(18745),eI=t(15103),eP=t(48583),eT=t(67997),eW=t(42171),eU=t(61258),eA=t(69073),eE=t(37461),eM=t(4338),eF=t(7921),eO=t(12922),eR=t(24719),eD=t(6262),ez=t(4726),eL=t(27084),eN=t(70504),e_=t(76245),eB=t(91838),eY=t(28245),eH=t(54050),eV=t(70751),eq=t(24106),eG=t(39828),eX=t(41664),e$=t.n(eX),eQ=t(39332),eK=t(29496),eJ=t(3349),e0=t(88196),e1=t(78181),e2=t(90281);let e5=()=>{let{callApi:e,isLoading:i}=(0,e2.W)("createStripeSession");return{isLoading:i,createStripeSession:e}};var e3=t(39203),e4=t(38444),e8=t(68573),e9=t(81873),e7=t(85518);function e6(e){let{isOpen:i,close:t}=e;return(0,r.jsxs)(e0.Z,{maxWidth:"md",open:i,onClose:t,fullWidth:!0,fullScreen:e7.tq,TransitionComponent:e7.tq?e1.R:void 0,children:[(0,r.jsx)(em.Z,{children:"Lifetime Upgrade Details"}),(0,r.jsx)(eg.Z,{children:(0,r.jsxs)(Y.Z,{spacing:2,children:[(0,r.jsxs)(ev.Z,{children:["For a limited time, we are allowing lifetime members to upgrade their plans. This will ",(0,r.jsx)("i",{children:"likely*"})," be the final opportunity for lifetime members to upgrade their plans."]}),(0,r.jsx)(ev.Z,{children:"Offer good through Cyber Monday (12/01/2025)."}),(0,r.jsx)(ev.Z,{children:"Offer is only available to current lifetime members."}),(0,r.jsx)(ev.Z,{children:"Prices shown are the same as our last App Sumo campaign and already factor in the price you already paid for your current tier (i.e. the price you pay for an upgrade is the same price as our last App Sumo campaign minus whatever you already paid)."}),(0,r.jsx)(ev.Z,{children:"All sales are final. We will not be offering refunds since all current lifetime members have had adequate time to evaluate Video To Blog."}),(0,r.jsx)(ev.Z,{children:"This promotion is offered directly by Video To Blog and is not affiliated with AppSumo. This means that any upgrades will not show in your Ap
1p Sumo account**."}),(0,r.jsx)(ev.Z,{children:"If anything is not clear or you have any questions/comments please reach out to me directly at [email protected] or use our in app help."}),(0,r.jsx)(eo.Z,{}),(0,r.jsx)(V.Z,{variant:"caption",color:"textSecondary",children:"* - We say likely because at this time we have no plans to go back on App Sumo and/or offer any more lifetime deals."}),(0,r.jsx)(V.Z,{variant:"caption",color:"textSecondary",children:"** - In the off chance we do go back on App Sumo in the future and you have purchased an upgrade directly from us, you would not be able to upgrade through App Sumo. In that case we would support direct upgrade through our platform instead."})]})}),(0,r.jsx)(ej.Z,{children:(0,r.jsx)(G.Z,{onClick:t,children:"Ok"})})]})}let ie=[{tier:1,price:59,blogPostsPerMonth:10,factor:1},{tier:2,price:119,blogPostsPerMonth:20,factor:2},{tier:3,price:229,blogPostsPerMonth:40,factor:4},{tier:4,price:539,blogPostsPerMonth:100,factor:10},{tier:5,price:1049,blogPostsPerMonth:200,factor:20}];function ii(e){let{isOpen:i,close:t}=e,{appSumoTier:n}=(0,eM.X)(),[l,o]=(0,ey.useState)(!1),a=(0,E.dD)(),s=null!=n?n:0,d=ie.find(e=>e.tier===s);return d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e6,{isOpen:l,close:()=>o(!1)}),(0,r.jsxs)(e0.Z,{maxWidth:"lg",open:i,onClose:t,fullWidth:!0,fullScreen:a,TransitionComponent:a?e1.R:void 0,children:[(0,r.jsxs)(H.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,r.jsx)(em.Z,{children:"\uD83C\uDF89 Lifetime Upgrade"}),(0,r.jsx)(X.Z,{sx:{mr:2},onClick:t,children:(0,r.jsx)(e4.default,{})})]}),(0,r.jsxs)(eg.Z,{children:[(0,r.jsx)(Y.Z,{spacing:2,children:(0,r.jsxs)(ev.Z,{children:["For a limited time, we are allowing lifetime members to upgrade their plans. This will likely be the final opportunity to upgrade your lifetime deal. Offer good through Cyber Monday (12/01/2025). ",(0,r.jsx)(G.Z,{onClick:()=>o(!0),children:"See details"})]})}),(0,r.jsx)(e8.ZP,{container:!0,spacing:1,sx:{mt:2},children:ie.map(e=>(0,r.jsx)(it,{gridWidth:12/ie.length,appSumoPlan:e,currentPlan:d},e.tier))}),(0,r.jsx)(ev.Z,{sx:{mt:3,textAlign:"center"},children:"...plus all of other features like auto screenshots, custom writing examples, smart links, and more."})]})]})]}):(0,r.jsx)(r.Fragment,{})}let it=e=>{var i;let{currentPlan:t,appSumoPlan:n,gridWidth:l}=e,{tier:o,price:a,factor:d,blogPostsPerMonth:c}=n;(0,eS.Z)();let{createStripeSession:u}=e5(),[h,p]=(0,ey.useState)(!1),x=async()=>{if(m)try{p(!0),s.mp.track("Lifetime Upgrade Started",{...m});let{url:e}=await u({successUrl:"".concat(window.location.href,"?didUpgradeAppSumo=true"),cancelUrl:window.location.href,priceId:null==m?void 0:m.priceId,tier:m.toTier});if(!e){(0,eK.yv)("Uh oh. Something went wrong. Please try again or contact support",{variant:"error"});return}window.location.assign(e)}catch(e){(0,eK.yv)("Uh oh. Something went wrong. Please try again or contact support.",{variant:"error"}),s.mp.track("Lifetime Upgrade Error",{...m,error:{e}})}finally{p(!1)}},m=il.find(e=>e.fromTier===t.tier&&e.toTier==o),g=Math.round(91.19999999999999*c)-t.price;return(0,r.jsx)(e8.ZP,{item:!0,xs:12,sm:6,md:4,lg:l,children:(0,r.jsx)(_.Z,{variant:"outlined",children:(0,r.jsx)(B.Z,{sx:{textAlign:"start"},children:(0,r.jsxs)(Y.Z,{spacing:3,children:[(0,r.jsxs)(Y.Z,{sx:{textAlign:"left"},spacing:1,children:[(0,r.jsxs)(H.Z,{display:"flex",justifyContent:"space-between",children:[(0,r.jsxs)(V.Z,{variant:"h6",sx:{},children:["Tier ",o]}),o===t.tier&&(0,r.jsx)(e9.Z,{size:"small",label:"Current",color:"primary",variant:"outlined"})]}),(0,r.jsxs)(H.Z,{sx:{pt:2},children:[(0,r.jsxs)(Y.Z,{direction:"row",spacing:1,children:[(0,r.jsx)(L.Z,{title:"This is the price you would normally pay if you subscribed to one of our current monthly plans for 2 years.",children:(0,r.jsx)(V.Z,{variant:"body2",color:"textSecondary",children:(0,r.jsxs)("s",{children:["$",g]})})}),m&&(0,r.jsx)(L.Z,{title:"This is the discount you get when compared to what you would normally pay if you subscribed to one of our current monthly plans for 2 years.",children:(0,r.jsxs)(V.Z,{variant:"body2",color:"error",children:["-",Math.round(100*(1-m.price/g)),"%"]})})]}),(0,r.jsxs)(Y.Z,{direction:"row",spacing:1,alignItems:"center",children:[o>t.tier&&(0,r.jsx)(L.Z,{title:"This is the original price for this lifetime deal. The actual price you pay is this minus the price you already paid for your current tier. ",children:(0,r.jsx)(V.Z,{variant:"h4",color:"textSecondary",children:(0,r.jsxs)("s",{children:["$",n.price]})})}),(0,r.jsx)(L.Z,{title:"This is the final price you will pay. It's the same price of our last App Sumo campaign minus the price you already paid for you current tier. ",children:(0,r.jsxs)(V.Z,{variant:"h4",children:["$",null!==(i=null==m?void 0:m.price)&&void 0!==i?i:n.price]})})]})]})]}),(0,r.jsx)(Y.Z,{spacing:0,style:{marginTop:14},children:(0,r.jsx)(G.Z,{loading:h,variant:"contained",disabled:o<=t.tier,onClick:x,children:"Upgrade"})}),(0,r.jsx)(L.Z,{title:"This is how many videos your can upload (and therefore, how many video to blog article convertions you can create). We use to call this just 'blog articles per month' but changed the semantics to make it more clear.",children:(0,r.jsxs)(V.Z,{variant:"body2",sx:{color:"grey",display:"flex",alignItems:"center"},children:[(0,r.jsx)(e3.default,{color:"success",sx:{mr:1}}),c," video uploads per month"]})}),(0,r.jsx)(L.Z,{title:"This is how many people (including yourself) you can add to your account",children:(0,r.jsxs)(V.Z,{variant:"body2",sx:{color:"grey",display:"flex",alignItems:"center"},children:[(0,r.jsx)(e3.default,{color:"success",sx:{mr:1}}),Math.max(d,10)," Team Members"]})}),(0,r.jsx)(L.Z,{title:"This is how many external websites you can integrate with to export your blog articles to.",children:(0,r.jsxs)(V.Z,{variant:"body2",sx:{color:"grey",display:"flex",alignItems:"center"},children:[(0,r.jsx)(e3.default,{color:"success",sx:{mr:1}}),Math.max(d,10)," Integrations"]})}),(0,r.jsx)(L.Z,{title:"Publications are a way to host your blog articles if you don't already have an external website",children:(0,r.jsxs)(V.Z,{variant:"body2",sx:{color:"grey",display:"flex",alignItems:"center"},children:[(0,r.jsx)(e3.default,{color:"success",sx:{mr:1}}),Math.max(d,10)," Publications"]})}),(0,r.jsx)(L.Z,{title:"This is how many internal websites you can connect in order to automatically include internal links from your website.",children:(0,r.jsxs)(V.Z,{variant:"body2",sx:{color:"grey",display:"flex",alignItems:"center"},children:[(0,r.jsx)(e3.default,{color:"success",sx:{mr:1}}),d," Internal Website",d<=1?"":"s"]})})]})})})})},il=[{fromTier:1,toTier:2,price:60,productId:"prod_TPWjt9dwbcae20",priceId:"price_1SShgBFrrvOd9bXLPIe0qIPs"},{fromTier:1,toTier:3,price:170,productId:"prod_TQHxLSzjnzj6i0",priceId:"price_1STRNbFrrvOd9bXL8m3OJsCB"},{fromTier:1,toTier:4,price:480,productId:"prod_TQI1S0cJOon2x5",priceId:"price_1STRRdFrrvOd9bXL664K0Y2q"},{fromTier:1,toTier:5,price:990,productId:"prod_TQI257IxKDYtP9",priceId:"price_1STRSZFrrvOd9bXLY0dqj5gr"},{fromTier:2,toTier:3,price:110,productId:"prod_TQI3VuSowwS2S6",priceId:"price_1STRTSFrrvOd9bXLYOiXpm7J"},{fromTier:2,toTier:4,price:420,productId:"prod_TQI4VooF1rBd63",priceId:"price_1STRUOFrrvOd9bXLVKY8z3NW"},{fromTier:2,toTier:5,price:930,productId:"prod_TQI5GSMnUiQVTP",priceId:"price_1STRVMFrrvOd9bXLm4ao2SNj"},{fromTier:3,toTier:4,price:310,productId:"prod_TQI6kmXUD07Fmx",priceId:"price_1STRWGFrrvOd9bXL0BsfwTA0"},{fromTier:3,toTier:5,price:820,productId:"prod_TQI7iZFMQDO4fK",priceId:"price_1STRXCFrrvOd9bXL363y6oCX"},{fromTier:4,toTier:5,price:510,productId:"prod_TQI8djl3s6kcfm",priceId:"price_1STRXxFrrvOd9bXLLlDPq0xL"}];var ir=t(75326),io=t(51314);let ia=(0,eC.ZP)(z.Z)(e=>{let{theme:i}=e;return{borderRadius:8,"&.Mui-selected":{"& .MuiListItemIcon-root":{color:i.palette.primary.dark},"& .MuiTypography-root":{color:i.palette.primary.dark},"& .MuiSvgIcon-root":{color:i.palette.primary.dark},"& .MuiAvatar-root":{backgroundColor:i.palette.primary.dark},"& .MuiTouchRipple-child":{backgroundColor:i.palette.primary.dark}},"& .MuiSvgIcon-root":{color:i.palette.action.active},"& .MuiAvatar-root":{backgroundColor:i.palette.action.active}}});var is=t(31114),id=t(97115),ic=t(40492),iu=t(70429),ih=t(91259);let ip=(0,eI.cn)(!1);function ix(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code?e.code:"unknown"}let im=()=>{let[e,i]=(0,eP.KO)(ip);return{open:()=>{i(!0)},close:()=>i(!1),isOpen:e}};
1function ig(){let[e,i]=(0,ey.useState)(""),t=(0,ef.useRouter)(),[n,l]=(0,ey.useState)(!1),o=(0,ey.useRef)(!1),[s,d]=(0,ey.useState)(""),{isOpen:c,close:u}=im();(0,ey.useEffect)(()=>{i(""),d("")},[c]);let h=async()=>{if(o.current)return;let n=a.bU.currentUser;if(!(null==n?void 0:n.email)){d("Please sign in again before adding a password.");return}if(!e){d("Please enter a password.");return}o.current=!0,l(!0),d("");try{let l=ih.w9.credential(n.email,e);try{await (0,ih.ZJ)(n,l)}catch(i){if("auth/requires-recent-login"!==ix(i))throw i;let e=new ih.hJ;e.setCustomParameters({login_hint:n.email}),await (0,ih.bc)(n,e),await (0,ih.ZJ)(n,l)}i(""),(0,eK.yv)("Success! You can now log in with just email and password",{variant:"success"}),u(),t.reload()}catch(i){var r;let e=ix(i);d(null!==(r=({"auth/weak-password":"Please choose a stronger password with at least 6 characters.","auth/password-does-not-meet-requirements":"This password does not meet the password requirements. Please choose a stronger password.","auth/user-mismatch":"Please choose the Google account you are currently signed in with.","auth/popup-closed-by-user":"Google verification was canceled. Please try again to add your password.","auth/cancelled-popup-request":"Google verification was interrupted. Please try again.","auth/popup-blocked":"Please allow popups for this site, then try again.","auth/network-request-failed":"Please check your internet connection and try again.","auth/requires-recent-login":"Your session could not be verified. Please sign out and sign back in, then try again.","auth/provider-already-linked":"Your account already has a password. Use Update Password or reset it from the sign-in page."})[e])&&void 0!==r?r:"Unable to add your password. Please try again."),iu.cM.error("Error adding password",{code:e,userId:n.uid})}finally{o.current=!1,l(!1)}};return(0,r.jsxs)(e0.Z,{open:c,fullWidth:!0,fullScreen:!1,children:[(0,r.jsx)(em.Z,{children:"Add Password"}),(0,r.jsx)(eg.Z,{sx:{py:4,textAlign:"center"},children:(0,r.jsx)(ic.Z,{label:"Password",value:e,onChange:e=>{i(e.target.value),d("")},type:"password",autoComplete:"new-password",fullWidth:!0,disabled:n,error:!!s,helperText:null!=s?s:"",sx:{mb:2,mt:2}})}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:u,disabled:n,children:"Cancel"}),(0,r.jsx)(G.Z,{onClick:h,variant:"contained",disabled:n||!e,children:n?"Adding password…":"Add password"})]})]})}let iv=(0,eI.cn)(!1),ij=()=>{let[e,i]=(0,eP.KO)(iv);return{open:()=>{i(!0)},close:()=>i(!1),isOpen:e}};function iy(){let e=(0,E.dD)(),{isOpen:i,close:t}=ij(),{open:n}=im();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ig,{}),(0,r.jsxs)(e0.Z,{open:i,fullWidth:!0,fullScreen:!1,TransitionComponent:e?e1.R:void 0,children:[(0,r.jsx)(em.Z,{children:"Account email"}),(0,r.jsx)(eg.Z,{sx:{py:4},children:(0,r.jsx)(ev.Z,{children:"You signed up using your Google account. If you want, you can add a password to be able to log in using email and password."})}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:t,children:"Cancel"}),(0,r.jsx)(G.Z,{onClick:()=>{n(),t()},variant:"contained",children:"Add a password"})]})]})]})}var ib=t(97553);let iZ=(0,eI.cn)(!1),iw=()=>{let[e,i]=(0,eP.KO)(iZ);return{open:()=>{i(!0)},close:()=>i(!1),isOpen:e}};function ik(){let[e,i]=(0,ey.useState)(""),[t,n]=(0,ey.useState)(""),[l,o]=(0,ey.useState)(""),s=(0,ef.useRouter)(),[d]=(0,eJ.Kp)(a.bU),[c,u]=(0,ey.useState)(!1),[h,p]=(0,ey.useState)(1),[x,m]=(0,ey.useState)(""),{isOpen:g,close:v}=iw(),[j]=(0,eJ.F_)(a.bU),{updateUser:f}=(0,ez.I)(),{getSignInMethods:y}=(0,ib.A)();(0,ey.useEffect)(()=>{p(1),i(""),n(""),o(""),m("")},[g]);let b=async()=>{if(null==j?void 0:j.email){u(!0);try{await (0,ih.e5)(a.bU,null==j?void 0:j.email,t),p(3)}catch(e){o("Invalid password.")}finally{u(!1)}}},Z=async()=>{if(a.bU.currentUser&&a.bU.currentUser.email){if(!e){(0,eK.yv)("Please enter a valid email",{variant:"error"});return}u(!0);try{let{success:i,methods:t,errorInfo:n}=await y({email:e});if(console.log({methods:t}),null==t?void 0:t.length)throw Error("Email already in use");await (0,ih.s)(a.bU.currentUser,e),await f(a.bU.currentUser.uid,{email:e}),(0,eK.yv)("Success! Your email has been updated",{variant:"success"}),s.reload(),v()}catch(e){m(e.message),iu.cM.error("Error adding email",{e}),(0,eK.yv)("Uh oh. Something went wrong",{variant:"error"})}finally{u(!1)}}};return(0,r.jsxs)(e0.Z,{open:g,fullWidth:!0,fullScreen:!1,children:[1==h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(em.Z,{children:"Do you want to update your email?"}),(0,r.jsxs)(eg.Z,{sx:{py:4,textAlign:"center"},children:[(0,r.jsx)(ev.Z,{}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:v,children:"Cancel"}),(0,r.jsx)(G.Z,{onClick:()=>p(2),variant:"contained",children:"Yes"})]})]})]}),2==h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(em.Z,{children:"Enter Password"}),(0,r.jsxs)(eg.Z,{sx:{py:4,textAlign:"center"},children:[(0,r.jsx)(ic.Z,{label:"Current Password",value:t,onChange:e=>{o(""),n(e.target.value)},fullWidth:!0,type:"password",disabled:c,error:!!l,helperText:null!=l?l:"",sx:{mb:2,mt:2}}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:v,children:"Cancel"}),(0,r.jsx)(G.Z,{onClick:b,variant:"contained",disabled:c,loading:c,children:(0,r.jsx)("div",{children:"Next"})})]})]})]}),3==h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(em.Z,{children:"Update Email"}),(0,r.jsxs)(eg.Z,{sx:{py:4,textAlign:"center"}
1,children:[(0,r.jsx)(ic.Z,{label:"New Email",value:e,onChange:e=>i(e.target.value),fullWidth:!0,disabled:c,error:!!x,helperText:null!=x?x:"",sx:{mb:2,mt:2}}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:v,children:"Cancel"}),(0,r.jsx)(G.Z,{onClick:Z,variant:"contained",disabled:c,loading:c,children:(0,r.jsx)("div",{children:"Update Email"})})]})]})]})]})}let iC=(0,eI.cn)(!1),iS=()=>{let[e,i]=(0,eP.KO)(iC);return{open:()=>{i(!0)},close:()=>i(!1),isOpen:e}};function iI(){let[e,i]=(0,ey.useState)(""),[t,n]=(0,ey.useState)(""),[l,o]=(0,ey.useState)(!1),[s,d]=(0,ey.useState)(""),[c,u]=(0,ey.useState)(""),[h,p]=(0,ey.useState)(""),{isOpen:x,close:m}=iS(),[g]=(0,eJ.F_)(a.bU);(0,ey.useEffect)(()=>{i(""),n(""),u(""),d("")},[x]);let v=async()=>{if(a.bU.currentUser&&a.bU.currentUser.email)try{let i=ih.w9.credential(a.bU.currentUser.email,t);try{await (0,ih.aF)(a.bU.currentUser,i)}catch(e){d(e.message);return}try{await (0,ih.gQ)(a.bU.currentUser,e)}catch(e){u(e.message);return}(0,eK.yv)("Success! Your password has been updated",{variant:"success"}),m()}catch(e){iu.cM.error("Error adding password",{e}),(0,eK.yv)("Uh oh. Something went wrong",{variant:"error"})}};return(0,r.jsxs)(e0.Z,{open:x,fullWidth:!0,fullScreen:!1,children:[(0,r.jsx)(em.Z,{children:"Update Password"}),(0,r.jsxs)(eg.Z,{sx:{py:4,textAlign:"center"},children:[(0,r.jsx)(ic.Z,{label:"Current Password",value:t,onChange:e=>{n(e.target.value),d("")},type:"password",fullWidth:!0,disabled:l,error:!!s,helperText:null!=s?s:"",sx:{mb:2,mt:2}}),(0,r.jsx)(ic.Z,{label:"New Password",value:e,onChange:e=>{i(e.target.value),u("")},type:"password",fullWidth:!0,disabled:l,error:!!c,helperText:null!=c?c:"",sx:{mb:2,mt:2}})]}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:m,children:"Cancel"}),(0,r.jsx)(G.Z,{onClick:v,variant:"contained",children:"Update password"})]})]})}var iP=t(84879),iT=t(28907),iW=t(29437),iU=t(35083);let iA={newSignups:!0},iE=e=>{var i;let{open:t,onClose:n,hasPublications:l,initialTabIndex:o}=e,{userActual:s}=(0,eN.L)(),{updateUser:d,isLoading:c}=(0,ez.I)(),{showInputDialog:h}=(0,u.q)(),{open:p}=ij(),{open:x}=iw(),{open:m}=iS(),[g]=(0,eJ.F_)(a.bU),{showDialog:v}=(0,id.Rh)(),j=(0,E.dD)(),[f,y]=(0,ey.useState)(o),b=(0,eS.Z)(),[Z,w]=(0,ey.useState)(iA),k=null==g?void 0:g.providerData.some(e=>"password"===e.providerId),C=null==g?void 0:null===(i=g.providerData)||void 0===i?void 0:i.every(e=>"google.com"===e.providerId),S={newSignups:{primary:"New signups",secondary:"Every time a new member signs up"}};(0,ey.useEffect)(()=>{var e;w(null!==(e=null==s?void 0:s.emailNotifications)&&void 0!==e?e:iA)},[null==s?void 0:s.emailNotifications]);let I=async()=>{var e;let i=await h({title:"Name",buttonText:"Update",initialValue:null!==(e=null==s?void 0:s.displayName)&&void 0!==e?e:""});if(i)try{await d(null==g?void 0:g.uid,{displayName:i}),(0,eK.yv)("Name updated successfully",{variant:"success"})}catch(e){(0,eK.yv)("Failed to update name",{variant:"error"})}},P=async(e,i)=>{var t,n,l,r;try{let l={...Z,[e]:i};await d(null==g?void 0:g.uid,{emailNotifications:l}),w(l),(0,eK.yv)("".concat(null!==(n=null===(t=S[e])||void 0===t?void 0:t.primary)&&void 0!==n?n:e," notification updated successfully"),{variant:"success"})}catch(i){(0,eK.yv)("Failed to update ".concat(null!==(r=null===(l=S[e])||void 0===l?void 0:l.primary)&&void 0!==r?r:e," notification"),{variant:"error"})}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(iy,{}),(0,r.jsx)(iI,{}),(0,r.jsx)(ik,{}),(0,r.jsx)(e0.Z,{open:t,onClose:n,maxWidth:"sm",fullWidth:!0,fullScreen:j,TransitionComponent:j?e1.R:void 0,children:(0,r.jsx)(eg.Z,{sx:{padding:0},children:(0,r.jsxs)(H.Z,{sx:{p:3},children:[(0,r.jsxs)(H.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[(0,r.jsx)(V.Z,{variant:"h6",children:"Account"}),(0,r.jsx)(X.Z,{onClick:n,children:(0,r.jsx)(e4.default,{})})]}),(l||o>0)&&(0,r.jsx)(H.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(iP.Z,{value:f,onChange:(e,i)=>y(i),sx:{backgroundColor:b.palette.background.paper},children:[(0,r.jsx)(iT.Z,{label:"Profile"}),(0,r.jsx)(iT.Z,{label:"Email Notifications"})]})}),0===f&&(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsxs)(ee.ZP,{sx:{justifyContent:"space-between",px:0},children:[(0,r.jsx)(en.Z,{primary:"Email",secondary:null==s?void 0:s.email}),(0,r.jsx)(G.Z,{onClick:()=>{k?x():v((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.Z,{variant:"h6",children:"⚠️ Please add a password"}),(0,r.jsx)(V.Z,{variant:"body2",children:"You signed up with your Google account. In order to change your email you will need to add a password first. You can do this by clicking the Add Password o
1ption in settings."})]}))},children:"Update"})]}),(0,r.jsxs)(ee.ZP,{sx:{justifyContent:"space-between",px:0},children:[(0,r.jsx)(en.Z,{primary:"Name",secondary:null==s?void 0:s.displayName}),(0,r.jsx)(iU.Z,{onClick:I,loading:c,disabled:c,children:(0,r.jsx)("div",{children:"Update"})})]}),k&&(0,r.jsx)(z.Z,{sx:{justifyContent:"space-between",px:0},onClick:()=>{m()},children:(0,r.jsx)(V.Z,{variant:"body2",children:"Update Password"})}),C&&(0,r.jsx)(z.Z,{sx:{justifyContent:"space-between",px:0},onClick:()=>{p()},children:(0,r.jsx)(V.Z,{variant:"body2",children:"Add Password"})})]}),1===f&&(0,r.jsx)(Y.Z,{spacing:1,children:Object.entries(S).map(e=>{var i;let[t,n]=e,l=null===(i=Z[t])||void 0===i||i;return(0,r.jsxs)(ee.ZP,{sx:{justifyContent:"space-between",px:0},children:[(0,r.jsx)(en.Z,{primary:n.primary,secondary:n.secondary}),(0,r.jsx)(iW.Z,{checked:l,onChange:e=>P(t,e.target.checked)})]},t)})})]})})})]})};var iM=t(51186),iF=t(26677),iO=t(70020),iR=t(67187),iD=t(80736),iz=t(32806),iL=t(97427);let iN={progress:{background:"#F7F5FF",border:"#E6DFFF",accent:"#7540E8",icon:"#ECE5FF",text:"#39275D",secondary:"#736588"},success:{background:"#F0FAF5",border:"#CCEADA",accent:"#208459",icon:"#DDF3E7",text:"#20533D",secondary:"#5C7B6A"},warning:{background:"#FFFAF1",border:"#F2E2BD",accent:"#AE741A",icon:"#FBECCF",text:"#684B1E",secondary:"#897247"}};function i_(e){let{view:i,variant:t="app-bar",isSidebarOpen:n=!0,onDismiss:l,isDismissing:o,onNavigate:a,indeterminate:s=!1}=e,d=iN[i.tone],c=i.complete&&!!l,u=i.success?iR.Z:iz.Z;return"sidebar"!==t||n?(0,r.jsxs)(H.Z,{sx:{position:"relative",mx:"sidebar"===t?1.25:0,mb:"sidebar"===t?1.25:0,width:"app-bar"===t?{xs:190,sm:240}:"auto",flexShrink:0,bgcolor:d.background,border:"1px solid",borderColor:d.border,borderRadius:2,overflow:"hidden",transition:"background-color 180ms, border-color 180ms","@media (prefers-reduced-motion: reduce)":{transition:"none"}},children:[(0,r.jsxs)(iL.Z,{component:e$(),href:"/articles",onClick:a,"aria-label":i.ariaLabel,sx:{display:"block",width:"100%",textAlign:"left",color:d.text,px:1.5,py:"sidebar"===t?1.5:.75,"&:hover":{bgcolor:d.icon},"&.Mui-focusVisible":{outline:"2px solid ".concat(d.accent),outlineOffset:-3,borderRadius:2}},children:[(0,r.jsxs)(H.Z,{sx:{display:"flex",alignItems:"center",gap:1,pr:c?2.25:0},children:[(0,r.jsx)(H.Z,{sx:{display:"grid",placeItems:"center",width:28,height:28,flexShrink:0,borderRadius:1.5,bgcolor:d.icon,color:d.accent},children:i.complete?(0,r.jsx)(u,{sx:{fontSize:17}}):(0,r.jsx)($.Z,{size:17,thickness:4,"aria-label":"Writing articles",sx:{color:"inherit"}})}),(0,r.jsxs)(H.Z,{sx:{flex:1,minWidth:0},children:[(0,r.jsx)(V.Z,{component:"span",sx:{display:"block",fontSize:13,fontWeight:700,lineHeight:1.45},children:i.title}),i.subtitle&&(0,r.jsx)(V.Z,{component:"span",sx:{display:"block",mt:.25,fontSize:11.5,lineHeight:1.5,color:d.secondary},children:i.subtitle})]}),!c&&(0,r.jsx)(iO.Z,{sx:{fontSize:15,color:d.secondary,flexShrink:0}})]}),(0,r.jsx)(q.Z,{variant:s?"indeterminate":"determinate",value:i.percent,"aria-label":"Articles ready",sx:{mt:1.25,height:4,borderRadius:2,bgcolor:d.border,"& .MuiLinearProgress-bar":{borderRadius:2,bgcolor:d.accent,"@media (prefers-reduced-motion: reduce)":{transition:"none"}}}})]}),c&&(0,r.jsx)(L.Z,{title:"Dismiss completion notice",children:(0,r.jsx)(X.Z,{"aria-label":"Dismiss completion notice",disabled:o,onClick:l,size:"small",sx:{position:"absolute",top:"sidebar"===t?9:4,right:5,color:d.secondary,width:28,height:28,"&:hover":{bgcolor:d.icon}},children:(0,r.jsx)(iD.Z,{sx:{fontSize:16}})})}),(0,r.jsxs)(H.Z,{role:"status","aria-live":"polite","aria-atomic":"true",sx:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:[i.title,". ",i.subtitle]})]}):(0,r.jsx)(L.Z,{title:i.ariaLabel,placement:"right",children:(0,r.jsx)(iL.Z,{component:e$(),href:"/articles",onClick:a,"aria-label":i.ariaLabel,sx:{display:"flex",position:"relative",mx:"auto",mb:1,width:44,height:44,borderRadius:2,bgcolor:d.background,color:d.accent,"&.Mu
1i-focusVisible":{outline:"2px solid ".concat(d.accent),outlineOffset:2}},children:i.complete?(0,r.jsx)(u,{sx:{fontSize:22}}):(0,r.jsx)($.Z,{size:22,thickness:4,"aria-label":"Writing articles",sx:{color:"inherit"}})})})}let iB=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,P.O$)(),t=(0,ef.useRouter)(),n="/articles"===t.asPath.split(/[?#]/)[0].replace(/\/$/,""),l=(0,e_.II)(),o=(0,e_.T_)(),{userActual:s}=(0,eN.L)(),d=null==s?void 0:s.selectedPublicationId,[c,u]=(0,ey.useState)(!1),h=(0,ey.useMemo)(()=>i&&l&&d?(0,eG.doc)(a.db,"users/".concat(l,"/publications/").concat(d,"/generationProgress/current")):void 0,[i,l,d]),p=(0,ey.useMemo)(()=>i&&l&&o&&d?(0,eG.doc)(a.db,"users/".concat(o,"/generationProgressDismissals/").concat(l,":").concat(d)):void 0,[i,l,o,d]),[x,m,g]=(0,iF.ky)(h),[v,j,f]=(0,iF.ky)(p),y=(null==x?void 0:x.ref.path)===(null==h?void 0:h.path)?null==x?void 0:x.data():void 0,b=function(e,i){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!(null==e?void 0:e.sessionId)||!Number.isInteger(e.revision))return null;let{total:n,ready:l,active:r,failed:o,removed:a}=e;if(![n,l,r,o,a].every(e=>Number.isInteger(e)&&e>=0)||0===n||l+r+o+a!==n)return null;let s=0===r;if(s&&(null==i?void 0:i.sessionId)===e.sessionId&&i.revision===e.revision)return null;let d=s&&l===n;if(d&&"number"==typeof e.completedAt&&Number.isFinite(e.completedAt)&&t>=e.completedAt+864e5)return null;let c=d?"".concat(1===n?"Your article is":"All ".concat(n," articles are")," ready"):s?"Writing finished":"Writing articles",u=[d?"":"".concat(l," of ").concat(n," ready"),o?"".concat(o," failed"):"",a?"".concat(a," removed"):""].filter(Boolean).join(" \xb7 ");return{title:c,subtitle:u,complete:s,success:d,tone:d?"success":o?"warning":"progress",percent:l/n*100,ariaLabel:"".concat(c,". ").concat(u||"Writing complete",". View articles.")}}(y,(null==v?void 0:v.ref.path)===(null==p?void 0:p.path)?null==v?void 0:v.data():void 0),[,Z]=(0,ey.useState)(0),w=null==y?void 0:y.completedAt,k=(null==b?void 0:b.success)===!0;(0,ey.useEffect)(()=>{if(!k||"number"!=typeof w||!Number.isFinite(w))return;let e=window.setTimeout(()=>Z(e=>e+1),Math.max(0,w+864e5-Date.now()));return()=>window.clearTimeout(e)},[w,k]);let C=(0,ey.useRef)(!1),S=(0,ey.useRef)(null),I=null==y?void 0:y.sessionId,T=null==y?void 0:y.revision,W=null==b?void 0:b.complete,U=(0,ey.useCallback)(async()=>{if(p&&I&&void 0!==T&&W&&!C.current){C.current=!0,u(!0);try{await (0,eG.setDoc)(p,{sessionId:I,revision:T,dismissedAt:(0,eG.serverTimestamp)()})}catch(e){(0,eK.yv)("Could not dismiss the notice. Please try again.",{variant:"error"})}finally{C.current=!1,u(!1)}}},[p,I,T,W]);return((0,ey.useEffect)(()=>{if(!t.isReady||!n){S.current=null;return}if(!k||m||j||c||g||f||!p)return;let e=JSON.stringify([p.path,I,T]);S.current!==e&&(S.current=e,U())},[t.isReady,n,k,m,j,c,g,f,p,I,T,U]),i&&l&&d&&!m&&(!x||x.ref.path===(null==h?void 0:h.path)))?(null==x?void 0:x.exists())&&!g?!b||b.complete&&j||t.isReady&&n&&b.success&&!f?null:(0,r.jsx)(i_,{...e,view:b,isDismissing:c,onDismiss:p&&!f?U:void 0}):(0,r.jsx)(iY,{...e,userId:l,publicationId:d}):null};function iY(e){var i;let{userId:t,publicationId:n,...l}=e,o=(0,ey.useMemo)(()=>(0,eG.query)((0,eG.collection)(a.db,"users/".concat(t,"/blogs")),(0,eG.where)("status","in",["generating","queued"])),[t]),[s]=(0,iF.Kx)(o),d=(null!==(i=null==s?void 0:s.docs)&&void 0!==i?i:[]).filter(e=>{let i=e.data();return(i.createdForPublicationId===n||i.publishedPublicationId===n)&&("generating"===i.status||!!i.generationRequestId)}).length;return d?(0,r.jsx)(i_,{...l,indeterminate:!0,view:{title:"Writing articles",subtitle:"".concat(d," ").concat(1===d?"article":"articles"," in progress"),complete:!1,success:!1,tone:"progress",percent:0,ariaLabel:"".concat(d," ").concat(1===d?"article":"articles"," in progress. View articles.")}}):null}var iH=t(70576),iV=t(83713),iq=t(59021);let iG=(0,eC.ZP)(e=>{let{className:i,...t}=e;return(0,r.jsx)(L.Z,{...t,classes:{popper:i}})})(e=>{let{theme:i}=e;return{["& .".concat(N.Z.tooltip)]:{backgroundColor:"transparent",color:"rgba(0, 0, 0, 0.87)",fontSize:i.typography.pxToRem(12),margin:"0 !important",maxWidth:350,pointerEvents:"auto !important"}}}),iX=e=>null!==e.used&&e.limit&&e.limit>0?Math.min(100,Math.max(0,e.used/e.limit*100)):0,i$=e=>null===e.used?"—":e.isUnlimited||!e.limit?"".concat(e.used.toLocaleStr
1ing()," used"):"".concat(iJ(e).toLocaleString()," left"),iQ=e=>null===e.used?"—":e.isUnlimited||!e.limit?"".concat(e.used.toLocaleString()," used"):"".concat(Math.min(e.used,e.limit).toLocaleString()," / ").concat(e.limit.toLocaleString()),iK=e=>null!==e.used&&e.limit?Math.max(0,e.limit-e.used):0,iJ=e=>iK(e),i0=e=>null===e.used||!e.limit||e.isUnlimited?"neutral":0>=iJ(e)?"error":iX(e)>=80?"warning":"neutral",i1=e=>({neutral:0,warning:1,error:2})[e],i2=e=>"error"===e?"error.main":"warning"===e?"warning.dark":"action.disabled",i5=e=>"error"===e?"error":"warning"===e?"warning":"primary",i3=e=>{var i;let{variant:t="app-bar",isSidebarOpen:n=!0}=e,l=(0,P.O$)(),o=(0,e_.II)(),{newsletterEmails:a,featureAccess:s,isLoading:d}=(0,eF.X)(),{getTotalSubscribersCount:c}=(0,iH.F)(),[u,h]=(0,ey.useState)(null),[p,x]=(0,ey.useState)(!1),[m,g]=(0,ey.useState)(null);(0,ey.useEffect)(()=>{if(!l||!o){h(null),x(!1);return}let e=!0;return x(!0),c().then(i=>{e&&h(i)}).catch(()=>{e&&h(null)}).finally(()=>{e&&x(!1)}),()=>{e=!1}},[c,l,o]);let v=(0,ey.useMemo)(()=>{var e,i,t,n,l;let r=null==s?void 0:s.website_members,o=(null==r?void 0:r.hasAccess)&&!r.isUnlimited?r.limit:null;return[{key:"newsletter-emails",label:"Emails sent",used:null!==(t=null==a?void 0:null===(e=a.usage)||void 0===e?void 0:e.used)&&void 0!==t?t:0,limit:(null==a?void 0:a.hasAccess)&&!a.isUnlimited?a.limit:0,isUnlimited:null!==(n=null==a?void 0:a.isUnlimited)&&void 0!==n&&n,nextReset:null==a?void 0:null===(i=a.usage)||void 0===i?void 0:i.nextReset},{key:"website-members",label:"Website members",used:u,limit:o,isUnlimited:null!==(l=null==r?void 0:r.isUnlimited)&&void 0!==l&&l}]},[a,null==s?void 0:s.website_members,u]),j=(0,ey.useMemo)(()=>v.reduce((e,i)=>{if(null===i.used||!i.limit||i.limit<=0)return e;if(!e)return i;let t=i1(i0(i))-i1(i0(e));return t>0||0===t&&iX(i)>iX(e)?i:e},void 0),[v]),f=j?iX(j):0,y=j?i0(j):"neutral",b="error"===y,Z=i2(y);if(!l||d&&p)return null;let w=null==a?void 0:null===(i=a.usage)||void 0===i?void 0:i.nextReset,k=(0,r.jsx)(_.Z,{variant:"outlined",sx:{width:300,borderRadius:2},children:(0,r.jsx)(B.Z,{sx:{p:2,"&:last-child":{pb:2.75}},children:(0,r.jsxs)(Y.Z,{spacing:1.5,children:[(0,r.jsxs)(Y.Z,{alignItems:"center",direction:"row",justifyContent:"space-between",children:[(0,r.jsx)(V.Z,{fontWeight:600,variant:"body1",children:"Usage"}),(0,r.jsx)(G.Z,{endIcon:(0,r.jsx)(iq.default,{}),href:"/usage",size:"small",sx:{minWidth:0,px:0,textTransform:"none"},variant:"text",children:"View usage"})]}),v.map(e=>{let i=iX(e),t=i5(i0(e));return(0,r.jsxs)(H.Z,{children:[(0,r.jsxs)(Y.Z,{alignItems:"center",direction:"row",justifyContent:"space-between",spacing:2,children:[(0,r.jsx)(V.Z,{color:"text.primary",fontWeight:600,variant:"body2",children:e.label}),(0,r.jsx)(V.Z,{color:"text.secondary",fontWeight:600,variant:"body2",children:null===e.used&&p?"Loading…":iQ(e)})]}),e.limit&&null!==e.used&&(0,r.jsx)(q.Z,{color:t,sx:{borderRadius:99,height:5,mt:.65},value:i,variant:"determinate"}),"website-members"===e.key&&(0,r.jsx)(iV.W,{memberCount:u,variant:"inline"})]},e.key)}),(0,r.jsx)(V.Z,{color:"text.secondary",variant:"caption",sx:{fontSize:"0.75rem",lineHeight:1.3},children:w?"Emails reset ".concat(new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(w)),"."):"Emails reset monthly."})]})})}),C="neutral"!==y,S=(0,r.jsxs)(H.Z,{sx:{height:22,position:"relative",width:22},children:[(0,r.jsx)($.Z,{"aria-hidden":!0,size:22,sx:{color:"action.disabledBackground",left:0,position:"absolute",top:0},thickness:5,value:100,variant:"determinate"}),(0,r.jsx)($.Z,{"aria-hidden":!0,size:22,sx:{color:Z,left:0,position:"absolute",top:0},thickness:5,value:f,variant:"determinate"})]});if("sidebar"===t)return(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",px:1,pb:1},children:(0,r.jsx)(iG,{title:k,children:(0,r.jsxs)(ia,{"aria-label":j?"".concat(j.label,": ").concat(i$(j)):"Convella usage",sx:{minHeight:44,justifyContent:n?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:n?3:"auto",justifyContent:"center"},children:S}),(0,r.jsx)(en.Z,{sx:{opacity:n?1:0},primary:"Usage"})]})})});if("footer"===t)return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(iG,{title:k,children:(0,r.jsx)(X.Z,{"aria-expanded":!!m,"aria-haspopup":"dialog","aria-label":j?"".concat(j.label,": ").concat(i$(j)):"Convella usage",onClick:e=>g(e.currentTarget),sx:{color:Z},children:S})}),(0,r.jsx)(Q.ZP,{anchorEl:m,anchorOrigin:{horizontal:"right",vertical:"top"},onClose:()=>g(null),open:!!m,transformOrigin:{horizontal:"right",vertical:"bottom"},children:k})]});let I=(0,r.jsxs)(G.Z,{"aria-label":j?"".concat(j.label,": ").concat(i$(j)):"Convella usage",sx:{alignItems:"center",bgcolor:C?b?"#fff1f2":"#fff7e8":"transparent",borderRadius:99,color:C?Z:"text.secondary",display:"inline-flex",gap:.75,minWidth:0,p:C?"4px 9px 4px 5px":.5,textTransform:"none","&:hover":{bgcolor:C?b?"#ffe4e6":"#fff0cf":"action.hover"}},children:[S,C&&j&&(0,r.jsx)(V.Z,{component:"span",sx:{fontSize:12,fontWeight:700,lineHeight:1.2,whiteSpace:"nowrap"},children:i$(j)})]});return(0,r.jsx)(iG,{title:k,children:I})},i4=e=>{let{accountName:i,avatarAlt:t,avatarInitials:n,avatarUrl:l,earnControl:o,helpControl:a,onAccountClick:s,onContactSupportClick:d,usageControl:c}=e;return(0,r.jsxs)(H.Z,{sx:{alignItems:"center",bgcolor:"background.paper",borderTop:"1px solid #dadce0",display:"flex",flexShrink:0,gap:.5,minHeight:64,px:1.5,py:.75},children:[(0,r.jsx)(L.Z,{title:i,children:(0,r.jsx)(X.Z,{"aria-label":"Open ".concat(i," account menu"),onClick:s,size:"small",children:(0,r.jsx)(et.Z,{sx:{height:36,width:36,bgcolor:e=>e.palette.secondary.light},src:l,alt:t,children:n})})}),(0,r.jsx)(H.Z,{sx:{flexGrow:1}}),null!=a?a:(0,r.jsx)(L.Z,{title:"Contact support",children:(0,r.jsx)(X.Z,{"aria-label":"Contact support",onClick:d,children:(0,r.jsx)(y.default,{})})}
1),o,c]})},i8=(0,eI.cn)(!0),i9=()=>{let[e,i]=(0,eP.KO)(i8);return{open:()=>{i(!0)},close:()=>i(!1),isOpen:e}},i7=[{id:"site",label:"Website",icon:(0,r.jsx)(R.default,{}),items:[{id:"site-design",label:"Website editor"},{id:"general-availability",label:"Availability"},{id:"general-language",label:"Language"},{id:"general-title",label:"Title"},{id:"general-description",label:"Description"}]},{id:"newsletter",label:"Email newsletter",icon:(0,r.jsx)(F.default,{}),items:[{id:"newsletter-sending",label:"Newsletter sending"},{id:"newsletter-list",label:"Newsletters"}]},{id:"articles",label:"Writing",icon:(0,r.jsx)(f.Z,{}),showForConvella:!0,items:[{id:"writing-defaults",label:"Writing defaults"},{id:"writing-ctas",label:"Calls to action"}]},{id:"automation",label:"Automation",icon:(0,r.jsx)(ek.Z,{}),showForConvella:!0,items:[{id:"automation-enabled",label:"Automation"},{id:"automation-video-publishing",label:"New video publishing"}]},{id:"memberships",label:"Memberships",icon:(0,r.jsx)(j.default,{}),showForConvella:!0,items:[{id:"memberships-access",label:"Member access"},{id:"memberships-connect",label:"Connect with Stripe"},{id:"memberships-products",label:"Membership products"}]},{id:"automations",label:"Automations",icon:(0,r.jsx)(ek.Z,{}),showForConvella:!1,items:[{id:"automations-manage",label:"Manage automations"}]},{id:"team",label:"Team",icon:(0,r.jsx)(w.default,{}),items:[{id:"team-members",label:"Team members"},{id:"team-authors",label:"Authors"}]},{id:"advanced",label:"Advanced",icon:(0,r.jsx)(O.default,{}),items:[{id:"domain-subdomain",label:"Subdomain"},{id:"domain-custom",label:"Custom domain"},{id:"advanced-rss",label:"RSS feed"},{id:"advanced-code",label:"Code injection"},{id:"advanced-youtube-channel",label:"YouTube channel",showForConvella:!0}]}],i6=e=>{var i,t;return null!==(t=null===(i=i7.find(i=>i.id===e||i.items.some(i=>i.id===e)))||void 0===i?void 0:i.id)&&void 0!==t?t:e},te=(e,i)=>void 0===e.showForConvella||e.showForConvella===i,ti=(e,i)=>void 0===e.showForConvella||e.showForConvella===i,tt=e=>({width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}),tn=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(7)," + 1px)"),[e.breakpoints.up("sm")]:{width:"calc(".concat(e.spacing(8)," + 1px)")}}),tl=(0,eC.ZP)(D.ZP,{})(e=>{let{theme:i,open:t}=e;return{width:240,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...t&&{...tt(i),"& .MuiDrawer-paper":tt(i)},...!t&&{...tn(i),"& .MuiDrawer-paper":tn(i)}}}),tr=(0,eC.ZP)(z.Z)(e=>{let{theme:i}=e;return{alignItems:"center",backgroundColor:i.palette.primary.main,borderRadius:4,boxShadow:"0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)",color:i.palette.common.white,display:"flex",minWidth:0,width:"100%","& .MuiListItemIcon-root":{color:"inherit"},"& .MuiTypography-root":{color:"inherit",fontWeight:700,whiteSpace:"nowrap"},"& .MuiSvgIcon-root":{color:"inherit"},"& .MuiAvatar-root":{backgroundColor:i.palette.primary.dark},"& .MuiTouchRipple-child":{backgroundColor:i.palette.primary.dark},"&:hover":{backgroundColor:i.palette.primary.dark,color:i.palette.common.white}}}),to=(0,eC.ZP)(e=>{let{className:i,...t}=e;return(0,r.jsx)(L.Z,{...t,classes:{popper:i}})})(e=>{let{theme:i}=e;return{["& .".concat(N.Z.tooltip)]:{backgroundColor:"transparent",color:"rgba(0, 0, 0, 0.87)",fontSize:i.typography.pxToRem(12),margin:"0px !important",maxWidth:350,pointerEvents:"auto !important"}}}),ta=()=>{var e,i,t,n,l,o,u,f,F,O,R,D,N,eC,eI,eP,eX,e0;let e1=(0,ef.useRouter)(),e2=(0,eS.Z)(),e5=(0,E.dD)(),e3=(0,P.O$)(),e4=(0,P.WL)(),{isOpen:e8,open:e9,close:e7}=i9(),{open:e6}=(0,eE.v)(),{featureAccess:ie,hasPlan:it,hasLifetimePlan:il,isPastDue:ic,isLoading:iu,appSumoTier:ih}=(0,eM.X)({includeUsage:!0}),{featureAccess:ip,hasPaidPlan:ix}=(0,eF.X)(),{isLoading:im}=(0,eL.j)(),{goToBilling:ig,isLoading:iv}=(0,eB.b)(),{open:ij}=(0,c.w)(),{user:iy}=(0,h.a)(),{userActual:ib}=(0,eN.L)(),{updateUser:iZ}=(0,ez.I)(),{showDialog:iw,closeDialog:ik}=(0,id.Rh)(),{open:iC}=(0,ir.t)(),{setIsSigningOut:iS}=(0,d.Sn)(),[iI]=(0,eJ.QJ)(a.bU),{publications:iP,isLoading:iT}=(0,eO.f)(),{open:iW}
1=(0,eR.v7)(),[iU,iA]=(0,ey.useState)(null),[iF,iO]=(0,ey.useState)(null),[iR,iD]=(0,ey.useState)(null),[iz,iL]=(0,ey.useState)(null),{autoCreatePublication:iN}=(0,eY.M)(),i_=(0,e_.T_)(),{subscribers:iY,isLoading:iH}=(0,eD.B)(null!==(t=null==ib?void 0:ib.selectedPublicationId)&&void 0!==t?t:void 0),[iV,iq]=(0,ey.useState)(!1),[iG,iX]=(0,ey.useState)([]),[i$,iQ]=(0,ey.useState)(!1),[iK,iJ]=(0,ey.useState)(!1),[i0,i1]=(0,ey.useState)(0),[i2,i5]=(0,ey.useState)("site"),[i8,tt]=(0,ey.useState)("site-design"),tn="/settings"===e1.pathname,ta=E.L1&&"grouped"===e1.query.settingsNav,ts=e3?null==iP?void 0:iP.filter(e=>(0,is.QT)(e)===is.ew):iP,td=null==ts?void 0:ts.find(e=>e.id===(null==ib?void 0:ib.selectedPublicationId)),tc=!!td&&(0,is.QT)(td)===is.ew,tu=null==td?void 0:td.convellaAutomation,th=null!==(n=null==tu?void 0:tu.enabled)&&void 0!==n?n:(null==tu?void 0:tu.newVideos)==="draft"||(null==tu?void 0:tu.newVideos)==="publish",tp=(null==td?void 0:td.isEmailNewsletterEnabled)===!0&&"nobody"!==(0,T.Tk)(td),tx=(0,A.Um)(td),tm=e3?ix:it,tg=!e3&&ic,tv=e3?null==ip?void 0:ip.sites:null==ie?void 0:ie.publications,tj=!iT&&(null!==(l=null==iP?void 0:iP.length)&&void 0!==l?l:0)>0,tf=!!(null==ib?void 0:null===(e=ib.teamIds)||void 0===e?void 0:e.length),ty=null==ib?void 0:ib.id,tb=(null!==(o=null==ib?void 0:ib.teamIds)&&void 0!==o?o:[]).join("|"),tZ=(0,eQ.useSearchParams)();(0,ey.useEffect)(()=>{(async()=>{if(!ty)return;let e=tb?tb.split("|"):[];iX(await Promise.all(e.map(async e=>(await (0,eG.getDoc)((0,eG.doc)(a.db,"users/".concat(e)))).data())))})()},[ty,tb]),(0,ey.useEffect)(()=>{if("true"===tZ.get("didUpgradeAppSumo")){(0,eK.yv)("\uD83C\uDF89 Your lifetime plan has been upgraded successfully!",{variant:"success"}),s.mp.track("Lifetime Upgrade Complete",{});let e=window.location.pathname;e1.replace(e)}},[tZ,e1]),(0,ey.useEffect)(()=>{let e=e=>{let i=e.detail;i&&(tt(i),i5(i6(i)))};return window.addEventListener("publication-settings-section-change",e),()=>window.removeEventListener("publication-settings-section-change",e)},[]),(0,ey.useEffect)(()=>{if(e5){e7();return}["/appsumo","/automations","/dashboard","/analytics","/articles","/posts","/integrations","/tags","/settings","/pages","/site","/subscribers","/members","/earn","/usage"].some(e=>e1.pathname.toLowerCase().includes(e.toLowerCase()))&&![].some(e=>e1.pathname.toLowerCase().includes(e.toLowerCase()))?e9():e7()},[e1.pathname,e5]);let tw=e=>{iA(null),iO(null),e5&&e7(),e1.push(e)},tk=()=>{iA(null),iO(null),e5&&e7()},tC=e=>{var i;tt(e),i5(i6(e)),null===(i=document.getElementById("publication-settings-".concat(e)))||void 0===i||i.scrollIntoView({behavior:"smooth",block:"start"}),e5&&e7()},tS=()=>{ij({createdForPublicationId:null==td?void 0:td.id}),e5&&e7()},tI=()=>{var e,i,t;if(s.mp.track("Add Publication Click"),!(null==tv?void 0:tv.hasAccess)){e6({title:"Upgrade needed",subtitle:e3||it?"Your current plan does not include another ".concat(e3?"site":"publication","."):"Please upgrade to create a publication."});return}if(!tv.isUnlimited&&(e3?null!==(e=null==ts?void 0:ts.length)&&void 0!==e?e:0:null!==(i=null==iP?void 0:iP.length)&&void 0!==i?i:0)>=(null!==(t=tv.limit)&&void 0!==t?t:0)){e6({title:"Upgrade needed",subtitle:"You have reached your maximum number of ".concat(e3?"sites":"publications",". Please upgrade to create another.")});return}iN({requireYoutubeChannel:e3})},tP=()=>{td&&(window.open((0,U.UP)(td),"_blank"),e5&&e7())},tT=e=>e8?"":e,tW=async e=>{if(iA(null),"_addPublication"===e){tI();return}i_&&await iZ(i_,{selectedPublicationId:e})},tU=()=>{tw("/earn")},tA=()=>{e6({title:"Upgrade",subtitle:""})},tE=async e=>{(null==ib?void 0:ib.id)&&await iZ(ib.id,{selectedTeamId:e})},tM=e=>{if(!e)return null;let i=new Date(e),t=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(i),n=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(i),l=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).format(i);return{summary:"".concat(t," at ").concat(n),withZone:"".concat(t," at ").concat(l)}},tF=e=>{let i=tM(e);return i?"Resets ".concat(i.summary):"Resets monthly at the UTC cutoff"},tO=e=>{let i=tM(e);return i?"Monthly usage resets at midnight UTC on the first of each month, which is ".concat(i.withZone," in your local time."):"Monthly usage resets at midnight UTC on the first of each month."},tR=e=>{let{label:i,remaining:t,limit:n,progressValue:l,nextReset:o,bonusRemaining:a}=e;return(0,r.jsx)(_.Z,{variant:"outlined",sx:{width:"250px",margin:0},children:(0,r.jsx)(B.Z,{children:(0,r.jsxs)(Y.Z,{children:[(0,r.jsxs)(H.Z,{display:"flex",justifyContent:"space-between",children:[(0,r.jsx)(V.Z,{variant:"caption",color:"grey",children:i}),(0,r.jsx)(L.Z,{title:tO(o),children:(0,r.jsx)(eT.Z,{style:{cursor:"pointer"},color:"grey",height:15,width:15})})]}),(0,r.jsxs)(V.Z,{variant:"subtitle1",children:[t," ",(0,r.jsxs)(H.Z,{component:"span",sx:{color:"text.secondary",fontSize:"0.75rem"},children:["/ ",n]})]}),(0,r.jsx)(H.Z,{sx:{width:"100%"},children:(0,r.jsx)(q.Z,{value:l,color:"success",variant:"determinate"})}),(0,r.jsx)(V.Z,{variant:"caption",sx:{color:"rgba(0, 0, 0, 0.5)",fontSize:"0.64rem",lineHeight:1.3,mt:.35,mb:1.35},children:tF(o)}),!!a&&(0,r.jsxs)(H.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{mt:.5},children:[(0,r.jsxs)(V.Z,{variant:"caption",fontStyle:"italic",color:"success",children:["+",a," bonus blogs"]}),(0,r.jsx)(L.Z,{title:"Bonus blogs will only get used when you run out of your monthly usage. Bonus blogs do not expire and will be rolled over to following month so they will not show in your monthly available blog posts.",children:(0,r.jsx)(eT.Z,{style:{cursor:"pointer"},color:"grey",height:14,width:14})})]}),(0,r.jsx)(G.Z,{onClick:e=>{e.currentTarget.blur(),tA()},sx:{mt:1},variant:"outlined",startIcon:(0,r.jsx)(v.default,{}),children:"Upgrade"})]})})})},tD=()=>{var e,i,t,n,l,r,o,a,s,d;let c=null!==(r=null==ie?void 0:null===(e=ie.credits.usage)||void 0===e?void 0:e.used)&&void 0!==r?r:0,u=null!==(o=null==ie?void 0:null===(i=ie.blogs.usage)||void 0===i?void 0:i.used)&&void 0!==o?o:0,h=null!==(a=null==ie?void 0:ie.credits.limit)&&void 0!==a?a:0,p=Math.max(0,h-c),x=null!==(s=null==ie?void 0:ie.blogs.limit)&&void 0!==s?s:1,m=Math.max(0,x-u);return(null==ie?void 0:ie.credits.hasAccess)?tR({label:"Available Credits",remaining:p,limit:h,progressValue:h>0?p/h*100:0,nextReset:null==ie?void 0:null===(d=ie.credits.usage)||void 0===d?void 0:d.nextReset}):tR({label:"Available Video Uploads",remaining:m,limit:x,progressValue:x>0?m/x*100:0,nextReset:null==ie?void 0:null===(t=ie.blogs.usage)||void 0===t?void 0:t.nextReset,bonusRemaining:null==ie?void 0:null===(l=ie.blogs)||void 0===l?void 0:null===(n=l.usage)||void 0===n?void 0:n.bonus
1Remaining})},tz=()=>{var e,i,t,n,l,r,o,a;if(null==ie?void 0:ie.credits.hasAccess){let e=null!==(n=null==ie?void 0:null===(t=ie.credits.usage)||void 0===t?void 0:t.used)&&void 0!==n?n:0,i=null!==(l=null==ie?void 0:ie.credits.limit)&&void 0!==l?l:0,r=Math.max(0,i-e);return{label:"Available Credits",displayValue:r,limit:i,progressValue:i>0?r/i*100:0,color:"success",mode:"credits"}}let s=null!==(r=null==ie?void 0:null===(e=ie.blogs.usage)||void 0===e?void 0:e.used)&&void 0!==r?r:0,d=null!==(o=null==ie?void 0:ie.blogs.limit)&&void 0!==o?o:1,c=Math.max(0,d-s);return{label:"Available Uploads",displayValue:c,limit:d,progressValue:d>0?c/d*100:0,color:!(d-s<=0)||(null!==(a=null==ie?void 0:null===(i=ie.blogs.usage)||void 0===i?void 0:i.bonusRemaining)&&void 0!==a?a:0)?"success":"error",mode:"uploads"}};return(0,r.jsxs)("div",{children:[(0,r.jsx)(ii,{close:()=>iq(!1),isOpen:iV}),i$&&(0,r.jsx)(iE,{onClose:()=>{iQ(!1),i1(0)},open:i$,hasPublications:tj,initialTabIndex:i0}),(0,r.jsx)(iM.H,{onClose:()=>iJ(!1),open:iK}),e5&&E.$M&&!e8&&(0,r.jsx)(K.Z,{size:"medium","aria-label":"menu",sx:{bottom:20,left:20,position:"fixed",zIndex:e=>e.zIndex.drawer+1},onClick:e9,children:(0,r.jsx)(Z.default,{})}),(0,r.jsx)(H.Z,{sx:{display:"flex",position:"sticky",top:0,zIndex:100},children:(0,r.jsx)(tl,{anchor:"left",open:e8,onClose:e7,variant:e5?"temporary":"permanent",sx:{flexShrink:0,"& .MuiDrawer-paper":{boxSizing:"border-box"}},children:(0,r.jsxs)(J.Z,{sx:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[(0,r.jsx)(H.Z,{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"auto",children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(r.Fragment,{children:[(null==iP?void 0:iP.length)?(0,r.jsx)(ee.ZP,{sx:{display:"block",p:0,pl:1,pr:1},children:(0,r.jsx)(L.Z,{title:"Publications",children:(0,r.jsx)(ia,{dense:!0,onClick:e=>iA(e.currentTarget),sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2,border:"lightgray",borderWidth:1,borderStyle:"solid",borderRadius:2},children:iT?(0,r.jsx)(io.g,{loadingSize:20,gridStyle:{flex:1,minHeight:void 0}}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(ei.Z,{sx:{minWidth:0,mr:e8?2.5:"auto",justifyContent:"center"},children:[td&&(0,r.jsx)(et.Z,{sx:{height:"28px",width:"28px",borderRadius:"6px",backgroundColor:(null==td?void 0:td.iconUrl)?"transparent !important":"".concat(e2.palette.secondary.light," !important")},src:null!==(u=null==td?void 0:td.iconUrl)&&void 0!==u?u:void 0,children:null==td?void 0:null===(i=td.title)||void 0===i?void 0:i[0]}),!td&&(0,r.jsx)(p.default,{})]}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:null!==(f=null==td?void 0:td.title)&&void 0!==f?f:"All Articles",secondaryTypographyProps:{overflow:"hidden",textOverflow:"ellipsis"},primaryTypographyProps:{overflow:"hidden",textOverflow:"ellipsis"}}),(0,r.jsx)(eW.Z,{})]})})})}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(e$(),{href:"/",children:(0,r.jsxs)(ee.ZP,{disablePadding:!0,children:[(0,r.jsx)(W.q,{style:{marginLeft:16,paddingLeft:0},alt:"".concat(e4," logo"),variant:"icon",width:48,height:48}),(0,r.jsx)(V.Z,{color:"black",fontSize:14,children:e4})]})})}),(0,r.jsxs)(el.Z,{anchorEl:iU,sx:{ml:7},transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},open:!!iU,onClose:()=>iA(null),children:[!!(null==ts?void 0:ts.length)&&(0,r.jsxs)(r.Fragment,{children:[!e3&&(0,r.jsx)(er.Z,{children:"My Publications"}),null==ts?void 0:ts.map(e=>e?(0,r.jsxs)(z.Z,{onClick:()=>{tW(e.id)},children:[(null==e?void 0:e.iconUrl)&&(0,r.jsx)(ei.Z,{sx:{minWidth:"38px"},children:(0,r.jsx)(et.Z,{sx:{height:"28px",width:"28px",borderRadius:"6px"},src:e.iconUrl})}),(0,r.jsx)(en.Z,{primary:null==e?void 0:e.title}),(null==ib?void 0:ib.selectedPublicationId)===e.id&&(0,r.jsx)(ei.Z,{sx:{ml:2},children:(0,r.jsx)(eZ.default,{color:"success"})})]},e.id):(0,r.jsx)(r.Fragment,{})),!e3&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eo.Z,{}),(0,r.jsx)(L.Z,{title:"Select this option if you plan on exporting your articles to an external website or anywhere outside of ".concat(e4,"."),placement:"top",children:(0,r.jsxs)(z.Z,{onClick:()=>{iA(null),tW(null)},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:"38px"},children:(0,r.jsx)(p.default,{})}),(0,r.jsx)(en.Z,{primary:"All Articles",secondary:"Show all my blog articles"}),!(null==ib?void 0:ib.selectedPublicationId)&&(0,r.jsx)(ei.Z,{sx:{ml:2},children:(0,r.jsx)(eZ.default,{color:"success"})})]})})]}),(0,r.jsx)(eo.Z,{})]}),(0,r.jsxs)(z.Z,{onClick:()=>{iA(null),tI()},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:"38px"},children:(0,r.jsx)(eb.default,{})}),(0,r.jsx)(en.Z,{primary:e3?"New Site":"Create Publication"})]})]}),(0,r.jsx)(H.Z,{pt:1,pb:1,children:(0,r.jsx)(eo.Z,{})})]}),!tn&&(tc&&tx?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",p:1,pb:.5},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Go Live"),children:(0,r.jsx)(G.Z,{fullWidth:!0,variant:"contained",onClick:()=>{(null==td?void 0:td.id)&&iW(td.id)},startIcon:(0,r.jsx)(eq.Z,{}),sx:{fontWeight:700,justifyContent:"center",minHeight:40,textTransform:"none"},children:"Go Live"})})}),e8&&(0,r.jsx)(V.Z,{color:"text.secondary",fontSize:12,lineHeight:1.35,sx:{px:2,pb:1,textAlign:"center"},children:"Your site isn't published yet."})]}):tc?null:(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",p:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Create Article"),children:(0,r.jsxs)(tr,{onClick:tS,sx:{minHeight:36,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(eb.default,{})}),(0,r.jsx)(en.Z,{id:"createPostBtn",sx:{opacity:e8?1:0},primary:"Create Article"})]})})})),tn?(0,r.jsxs)(H.Z,{display:"flex",flexDirection:"column",flex:1,sx:{pt:.5},children:[(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{px:1,pb:.5},children:(0,r.jsx)(L.Z,{title:tT("Back"),children:(0,r.jsx)(X.Z,{"aria-label":"Back",onClick:()=>{e5&&e7(),tw("/articles")},sx:{ml:e8?.5:"auto",mr:e8?0:"auto"},children:(0,r.jsx)(eU.Z,{size:22})})})}),ta?i7.filter(e=>te(e,e3)).map(e=>(0,r.jsxs)(H.Z,{sx:{pb:.75},children:[(0,r.jsx)(er.Z,{component:"div",disableSticky:!0,sx:{bgcolor:"transparent",color:"text.secondary",fontSize:11,fontWeight:700,letterSpacing:.7,lineHeight:"32px",opacity:e8?1:0,px:2.5,textTransform:"uppercase"},children:e.label}),e.items.filter(e=>ti(e,e3)&&(th||"automation-video-publishing"!==e.id)&&(tp||"newsletter-list"!==e.id)).map(e=>(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",px:1,pb:.25},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT(e.label),children:(0,r.jsx)(ia,{selected:i8===e.id,onClick:()=>tC(e.id),sx:{minHeight:34,justifyContent:e8?"initial":"center",px:2.5},children:(0,r.jsx)(en.Z,{primary:e.label,primaryTypographyProps:{fontSize:13,fontWeight:600,lineHeight:1.25},sx:{opacity:e8?1:0}})})})},e.id))]},e.id)):i7.filter(e=>te(e,e3)).map(e=>(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",px:1,pb:.5},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT(e.label),children:(0,r.jsxs)(ia,{selected:i2===e.id,onClick:()=>tC(e.id),sx:{minHeight:42,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:e.icon}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:e.label})]})})},e.id))]}):ib?(null==ib?void 0:ib.selectedPublicationId)&&(iT||td)?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(H.Z,{display:"flex",flexDirection:"column",flex:1,children:(0,r.jsxs)(H.Z,{display:"flex",flexDirection:"column",flex:1,children:[(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",p:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Analytics"),children:(0,r.jsxs)(ia,{selected:e1.pathname.includes("analytics"),component:e$(),href:"/analytics",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(ew.default,{})}),(0,r.jsx)(en.Z,{id:"analyticsBtn",sx:{opacity:e8?1:0},primary:"Analytics"})]})})}),td&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Website"),children:(0,r.jsxs)(ia,{selected:e1.pathname.includes("site"),component:e$(),href:"/site",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5,"& .view-site-external-link":{opacity:0,pointerEvents:"none",transition:"opacity 150ms ease"},"&:hover .view-site-external-link":{opacity:1,pointerEvents:"auto"}},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(eH.Z,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:"Website"}),e8&&(0,r.jsx)(L.Z,{title:"Open live site",children:(0,r.jsx)(X.Z,{className:"view-site-external-link",size:"small",onClick:e=>{e.preventDefault(),e.stopPropagation(),tP()},sx:{ml:"auto"},children:(0,r.jsx)(eV.default,{fontSize:"small"})})})]})})}),(0,r.jsx)(H.Z,{sx:{pb:2.5}})]}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Articles"),children:(0,r.jsxs)(ia,{selected:(e1.pathname.includes("articles")||e1.pathname.includes("posts"))&&
1!e1.pathname.includes("publications"),component:e$(),href:"/articles",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(m.Z,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:"Articles"}),tc&&e8&&(0,r.jsx)(L.Z,{title:"Create Article",children:(0,r.jsx)(X.Z,{"aria-label":"Create Article",size:"small",onClick:e=>{e.preventDefault(),e.stopPropagation(),tS()},sx:{ml:"auto"},children:(0,r.jsx)(eb.default,{fontSize:"small"})})})]})})}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Pages"),children:(0,r.jsxs)(ia,{selected:e1.pathname.includes("pages"),component:e$(),href:"/pages",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(g.default,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:"Pages"})]})})}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Tags"),children:(0,r.jsxs)(ia,{selected:e1.pathname.includes("tags"),component:e$(),href:"/tags",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(S.default,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:"Tags"})]})})}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1},children:(0,r.jsxs)(ia,{component:e$(),href:tc?"/members":"/subscribers",onClick:tk,selected:e1.pathname.includes("subscribers")||e1.pathname.includes("members"),sx:{minHeight:48,px:2.5,justifyContent:e8?"initial":"center"},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:3,justifyContent:"center"},children:(0,r.jsx)(w.default,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:tc?"Members":"Subscribers"}),e8&&!iH&&(0,r.jsx)(H.Z,{sx:{ml:"auto",mr:1,display:"flex",alignItems:"center"},children:(0,r.jsx)(es.Z,{badgeContent:null!==(F=null==iY?void 0:iY.length)&&void 0!==F?F:0,sx:{"& .MuiBadge-badge":{backgroundColor:"#f5f5f5",color:"#666",fontSize:"11px",fontWeight:600,minWidth:"20px",height:"18px",borderRadius:"9px",border:"1px solid #e0e0e0"}},children:(0,r.jsx)("span",{style:{opacity:0}})})})]})}),(0,r.jsx)(H.Z,{sx:{pb:2.5}}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1,mb:3},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Settings"),children:(0,r.jsxs)(ia,{selected:e1.pathname.includes("settings"),component:e$(),href:"/settings",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(M.default,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:"Settings"})]})})})]})})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",p:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Articles"),children:(0,r.jsxs)(ia,{selected:(e1.pathname.includes("articles")||e1.pathname.includes("posts"))&&!e1.pathname.includes("publications"),component:e$(),href:"/articles",onClick:tk,sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(m.Z,{})}),(0,r.jsx)(en.Z,{id:"postsBtn",sx:{opacity:e8?1:0},primary:"Articles"})]})})}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Automations"),children:(0,r.jsxs)(ia,{component:e$(),href:"/automations",onClick:tk,selected:e1.pathname.includes("automations"),sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(ek.Z,{})}),(0,r.jsx)(en.Z,{sx:{opacity:e8?1:0},primary:(0,r.jsxs)(H.Z,{sx:{display:"flex",alignItems:"center"},children:["Automations"," "]}),primaryTypographyProps:{}})]})})}),(0,r.jsx)(ee.ZP,{disablePadding:!0,sx:{display:"block",pl:1,pr:1,pb:1,mb:3},children:(0,r.jsx)(L.Z,{enterDelay:e8?1e4:void 0,title:tT("Integrations"),children:(0,r.jsxs)(ia,{component:e$(),href:"/integrations",onClick:tk,selected:e1.pathname.includes("integrations")&&!e1.pathname.includes("publications"),sx:{minHeight:48,justifyContent:e8?"initial":"center",px:2.5},children:[(0,r.jsx)(ei.Z,{sx:{minWidth:0,mr:e8?3:"auto",justifyContent:"center"},children:(0,r.jsx)(I.Z,{})}),(0,r.jsx)(en.Z,{id:"integrationsBtn",sx:{opacity:e8?1:0},primary:"Integrations"})]})})})]}):(0,r.jsx)(Y.Z,{spacing:2,sx:{p:1},children:[1,2,3,4,5,6].map(e=>(0,r.jsx)(ea.Z,{variant:"rectangular",sx:{borderRadius:2},height:48},e))})]})}),!E.$M&&(0,r.jsx)(H.Z,{suppressHydrationWarning:!0,p:1,children:!e3&&(0,r.jsx)(_.Z,{variant:"outlined",children:(0,r.jsx)(ed.Z,{onClick:tU,children:(0,r.jsx)(B.Z,{children:(0,r.jsxs)(Y.Z,{children:[(0,r.jsxs)(H.Z,{display:"flex",justifyContent:"space-between",children:[(0,r.jsx)(eA.Z,{}),(0,r.jsx)(eV.default,{fontSize:"small",sx:{color:"grey"}})]}),(0,r.jsx)(en.Z,{primary:"Earn more uploads!",secondary:"Earn more credits by inviting friends, leaving a review, and more.",slotProps:{secondary:{style:{textWrap:"wrap"}}}})]})})})})}),E.$M&&(0,r.jsxs)(H.Z,{suppressHydrationWarning:!0,sx:{flexShrink:0},children:[e3&&(0,r.jsx)(iB,{isSidebarOpen:e8,variant:"sidebar",onNavigate:tk}),(0,r.jsx)(i4,{accountName:(()=>{var e,i,t,n;let l=(null!==(i=null!==(e=null==iy?void 0:iy.displayName)&&void 0!==e?e:null==ib?void 0:ib.displayName)&&void 0!==i?i:"").trim();if(!l)return null!==(n=null!==(t=null==iy?void 0:iy.email)&&void 0!==t?t:null==ib?void 0:ib.email)&&void 0!==n?n:"Account";
1let r=l.split(/\s+/).filter(Boolean);return r.length<=2?l:"".concat(r[0]," ").concat(r[r.length-1])})(),avatarAlt:null!==(R=null!==(O=null==iy?void 0:iy.displayName)&&void 0!==O?O:null==ib?void 0:ib.displayName)&&void 0!==R?R:"",avatarInitials:(0,E.Qm)(null!==(D=null==iy?void 0:iy.displayName)&&void 0!==D?D:null==ib?void 0:ib.displayName),avatarUrl:null!==(eC=null!==(N=null==iy?void 0:iy.photoUrl)&&void 0!==N?N:null==ib?void 0:ib.photoUrl)&&void 0!==eC?eC:void 0,onAccountClick:e=>iO(e.currentTarget),onContactSupportClick:iC,helpControl:e3?void 0:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L.Z,{title:"Help",children:(0,r.jsx)(X.Z,{"aria-controls":iR?"sidebar-help-menu":void 0,"aria-expanded":!!iR,"aria-haspopup":"menu","aria-label":"Help",onClick:e=>iD(e.currentTarget),children:(0,r.jsx)(y.default,{})})}),(0,r.jsxs)(el.Z,{anchorEl:iR,anchorOrigin:{horizontal:"right",vertical:"top"},id:"sidebar-help-menu",onClose:()=>iD(null),open:!!iR,transformOrigin:{horizontal:"right",vertical:"bottom"},children:[(0,r.jsxs)(ec.Z,{onClick:()=>{iD(null),window.open("https://docs.videotoblog.ai/","_blank","noopener,noreferrer")},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(C.Z,{fontSize:"small"})}),(0,r.jsx)(en.Z,{primary:"View docs"})]}),(0,r.jsxs)(ec.Z,{onClick:()=>{iD(null),iC()},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(y.default,{fontSize:"small"})}),(0,r.jsx)(en.Z,{primary:"Contact support"})]})]})]}),earnControl:e3?void 0:(0,r.jsx)(L.Z,{title:"Earn more uploads",children:(0,r.jsx)(X.Z,{"aria-label":"Earn more uploads",onClick:tU,children:(0,r.jsx)(eA.Z,{})})}),usageControl:e3?(0,r.jsx)(i3,{variant:"footer"}):(()=>{if(!iy||iu)return null;let e=tz();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(to,{title:tD(),children:(0,r.jsx)(X.Z,{"aria-expanded":!!iz,"aria-haspopup":"dialog","aria-label":e.label,onClick:e=>iL(e.currentTarget),children:(0,r.jsxs)(H.Z,{sx:{height:24,position:"relative",width:24},children:[(0,r.jsx)($.Z,{"aria-hidden":!0,size:24,sx:{color:"action.disabledBackground",left:0,position:"absolute",top:0},thickness:5,value:100,variant:"determinate"}),(0,r.jsx)($.Z,{"aria-hidden":!0,color:e.color,size:24,sx:{left:0,position:"absolute",top:0},thickness:5,value:e.progressValue,variant:"determinate"})]})})}),(0,r.jsx)(Q.ZP,{anchorEl:iz,anchorOrigin:{horizontal:"right",vertical:"top"},onClose:()=>iL(null),open:!!iz,transformOrigin:{horizontal:"right",vertical:"bottom"},children:tD()})]})})()})]})]})})}),E.$M&&(0,r.jsx)(eu.Z,{anchorEl:iF,open:!!iF,placement:"right-end",sx:{zIndex:e=>e.zIndex.modal},children:(0,r.jsx)(eh.d,{onClickAway:()=>iO(null),children:(0,r.jsx)(ep.Z,{elevation:8,sx:{minWidth:260},children:(0,r.jsxs)(ex.Z,{autoFocusItem:!!iF,sx:{p:0},children:[tf?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er.Z,{children:"My Accounts"}),(0,r.jsxs)(ec.Z,{onClick:()=>{(null==ib?void 0:ib.id)&&tE(ib.id),iO(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(et.Z,{sx:{mr:2,width:32,height:32,bgcolor:"".concat(e2.palette.secondary.light," !important")},src:null!==(eI=null==ib?void 0:ib.photoUrl)&&void 0!==eI?eI:void 0,alt:null!==(eP=null==ib?void 0:ib.displayName)&&void 0!==eP?eP:""})}),(0,r.jsx)(en.Z,{primary:"Me (".concat(null==ib?void 0:ib.displayName,")")}),(null==ib?void 0:ib.id)===(null==iy?void 0:iy.id)&&(0,r.jsx)(ei.Z,{sx:{ml:2},children:(0,r.jsx)(eZ.default,{color:"success"})})]}),iG.map(e=>{var i,t;return e?(0,r.jsxs)(ec.Z,{onClick:()=>{tE(e.id),iO(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(et.Z,{sx:{mr:2,width:32,height:32,bgcolor:"".concat(e2.palette.secondary.light," !important")},src:null!==(i=null==e?void 0:e.photoUrl)&&void 0!==i?i:void 0,alt:null!==(t=null==e?void 0:e.displayName)&&void 0!==t?t:""})}),(0,r.jsx)(en.Z,{primary:"".concat(null==e?void 0:e.displayName,"'s Team")}),(null==iy?void 0:iy.id)===e.id&&(0,r.jsx)(ei.Z,{sx:{ml:2},children:(0,r.jsx)(eZ.default,{color:"success"})})]},e.id):(0,r.jsx)(r.Fragment,{})})]}):(0,r.jsxs)(ee.ZP,{children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(et.Z,{sx:{width:32,height:32,bgcolor:"".concat(e2.palette.secondary.light," !important")},src:null!==(eX=null==ib?void 0:ib.photoUrl)&&void 0!==eX?eX:void 0,alt:null!==(e0=null==ib?void 0:ib.displayName)&&void 0!==e0?e0:"",children:(0,E.Qm)(null==ib?void 0:ib.displayName)})}),(0,r.jsx)(en.Z,{primary:null==ib?void 0:ib.displayName,secondary:null==ib?void 0:ib.email})]}),(null==ib?void 0:ib.id)===(null==iy?void 0:iy.id)&&(0,r.jsx)(eo.Z,{}),ib&&(null==ib?void 0:ib.id)===(null==iy?void 0:iy.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(z.Z,{onClick:()=>{iQ(!0),iO(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(k.default,{})}),(0,r.jsx)(en.Z,{primary:"Your profile"})]}),(0,r.jsxs)(z.Z,{onClick:()=>{iJ(!0),iO(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(w.default,{})}),(0,r.jsx)(en.Z,{primary:"Team members"})]}),il&&(0,r.jsxs)(z.Z,{onClick:()=>{iO(null),iw((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(em.Z,{children:"App Sumo plan"}),(0,r.jsxs)(eg.Z,{children:[(0,r.jsx)(ev.Z,{children:"You can manage your App Sumo plan in App Sumo. If you would like to switch to a subscription plan press the Upgrade button."}),(0,r.jsx)(ej.Z,{children:(0,r.jsx)(G.Z,{onClick:ik,children:"Ok"})})]})]}))},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(x.Z,{})}),(0,r.jsx)(en.Z,{primary:"Lifetime Plan",secondary:"App Sumo: Tier ".concat(ih)})]}),(tm||tg)&&!il&&(0,r.jsxs)(z.Z,{onClick:async()=>{await ig(),iO(null)},children:[(0,r.jsx)(ei.Z,{children:iv?(0,r.jsx)($.Z,{size:20}):(0,r.jsx)(j.default,{})}),(0,r.jsx)(en.Z,{primary:"Billing"})]}),(!tm&&!tg||il)&&(0,r.jsxs)(z.Z,{onClick:()=>{iO(null),tA()},children:[(0,r.jsx)(ei.Z,{children:im?(0,r.jsx)($.Z,{size:20}):(0,r.jsx)(v.default,{})}),(0,r.jsx)(en.Z,{primary:"Upgrade"})]})]}),(0,r.jsx)(eo.Z,{}),(0,r.jsxs)(z.Z,{onClick:async()=>{iS(!0),iI(),iO(null),await e1.replace("/"),iS(!1)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(b.default,{})}),(0,r.jsx)(en.Z,{primary:"Sign out"})]})]})})})})]})},ts="extraAiArticles",td=()=>{let e=(0,P.O$)(),i=(0,ef.useRouter)(),{enqueueSnackbar:t}=(0,eK.Ds)(),{refetch:n}=(0,eF.X)(),l=(0,ey.useRef)(),r=(0,ey.useRef)([]),o=i.query[ts];return(0,ey.useEffect)(()=>()=>
1{r.current.forEach(e=>window.clearTimeout(e))},[]),(0,ey.useEffect)(()=>{if(!e||!i.isReady||"string"!=typeof o){l.current=void 0;return}if(l.current===o)return;if(l.current=o,"success"===o)t("Your video credits have been purchased and will appear shortly.",{variant:"success"}),n(),r.current.forEach(e=>window.clearTimeout(e)),r.current=[5e3,15e3,3e4].map(e=>window.setTimeout(()=>void n(),e));else{if("cancelled"!==o)return;t("Video credit purchase cancelled.",{variant:"info"})}let{[ts]:a,...s}=i.query;i.replace({pathname:i.pathname,query:s},void 0,{shallow:!0})},[t,e,n,i,o]),null};var tc=t(65536);t(61020);var tu=t(22967),th=t(64487),tp=t(50990),tx=t(19214),tm=t(14150),tg=t(98426),tv=t(61769),tj=t(39101);let tf=(0,eI.cn)(!1),ty=()=>{let[e,i]=(0,eP.KO)(tf);return{open:()=>{i(!0)},close:()=>i(!1),isOpen:e}},tb=e=>["What is your primary use of ".concat(e,"?"),"What type of videos are you creating content from?","How are you sharing/exporting blogs? Own website? Social media? Email? All?","What do you like most about ".concat(e,"?"),"What do you like least about ".concat(e,"?"),"What is the #1 thing we could do to improve ".concat(e,"?"),"What other features would you like to see?","Any other feedback you have for us?","Contact email (if different than the one on your account)"];function tZ(){let{isOpen:e,close:i}=ty(),t=tb((0,P.WL)()),[n,l]=(0,ey.useState)(t.map(e=>"")),[o,a]=(0,ey.useState)(!1),{enqueueSnackbar:s}=(0,eK.Ds)(),{user:d}=(0,h.a)(),{showDialog:c,closeDialog:u}=(0,id.Rh)(),{updateUser:p}=(0,ez.I)(),x=(e,i)=>{let t=[...n];t[e]=i,l(t)},m=async()=>{if(!n.some(Boolean)){s("Please fill out the form to submit",{variant:"error"});return}console.log(t.map((e,i)=>"".concat(e,"\n").concat(n[i])).join("\n\n"));let e={survey:t.map((e,i)=>"".concat(e,"\n").concat(n[i])).join("\n\n"),reply_to:null==d?void 0:d.email,userId:null==d?void 0:d.id};a(!0);try{await tj.ZP.send("service_9okw5xl","template_m464ztl",e,"TqeOAeUuYry9Ftvnj"),s("Message sent!",{variant:"success"}),await p(d.id,{preferences:{...d.preferences,hasEnteredFeedback:!0}}),i()}catch(e){s("Something went wrong. Please reach out to [email protected] for help.",{variant:"error"}),iu.cM.error("Email sending failed:",{error:e})}finally{a(!1)}};return(0,r.jsx)(e0.Z,{open:e,onClose:i,fullWidth:!0,fullScreen:!0,TransitionComponent:e1.R,children:(0,r.jsxs)(tg.Z,{maxWidth:"md",sx:{},children:[(0,r.jsxs)(Y.Z,{direction:"row",spacing:2,alignItems:"center",mt:6,mb:0,children:[(0,r.jsx)(X.Z,{onClick:i,children:(0,r.jsx)(e4.default,{})}),(0,r.jsx)(V.Z,{variant:"h4",fontWeight:500,children:"Win a $25 Amazon Gift Card!"})]}),(0,r.jsxs)(eg.Z,{sx:{py:4},children:[(0,r.jsxs)(V.Z,{children:["Fill out the form and get a chance to win a $25 Amazon gift card. 1 winner will be chosen each week based on quality of answers and randomness. ",(0,r.jsx)(tv.Z,{onClick:()=>{c((0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(Y.Z,{direction:"row",children:[(0,r.jsx)(X.Z,{onClick:u,children:(0,r.jsx)(e4.default,{})}),(0,r.jsx)(em.Z,{children:"Details"})]}),(0,r.jsx)(eg.Z,{children:(0,r.jsxs)(Y.Z,{spacing:2,children:[(0,r.jsx)(V.Z,{children:"We will give a $25 Amazon gift card away each week to users who give us written feedback about this app.  "}),(0,r.jsx)(V.Z,{children:"To be eligible you must write the feedback in English, be located in the US, and be over the age of 18."}),(0,r.jsx)(V.Z,{children:"To qualify your feedback must be honest and answer most (if not all) the questions."}),(0,r.jsx)(V.Z,{children:"The winner will be chosen randomly and be notified by the email on their account or you can specifiy another contact email in the feedback."})]})})]}))},children:"See details here."})]}),(0,r.jsxs)(Y.Z,{spacing:2,mt:3,children:[t.map((e,i)=>(0,r.jsxs)(H.Z,{children:[(0,r.jsx)(V.Z,{children:e}),(0,r.jsx)(ic.Z,{multiline:!0,fullWidth:!0,value:n[i],onChange:e=>x(i,e.target.value)})]},e)),(0,r.jsx)(iU.Z,{loading:o,onClick:m,variant:"contained",children:(0,r.jsx)("div",{children:"Submit"})})]})]})]})})}var tw=t(87713),tk=t(70518),tC=t(76530);let tS=e=>{let{pathname:i,isConvella:t,ready:n,hasPublication:l,hasActiveBuild:r,setupStarted:o,youtubeError:a}=e;return!t||!n||(0,tk.E)(i)||"/invite"===i||"/login/[userId]"===i?null:"/get-started"===i?!l||r||o?null:"/site":l?null:(0,tC.w)("/get-started",a)},tI=e=>{let{children:i}=e,t=(0,P.O$)(),n=(0,ef.useRouter)(),[l,o]=(0,eJ.F_)(a.bU),{userActual:s,isLoading:c}=(0,eN.L)(),{user:u,isLoading:p}=(0,h.a)(),{publications:x,isLoading:m}=(0,eO.f)(),{updateUser:g}=(0,ez.I)(),{isSigningOut:v}
1=(0,d.Sn)(),[j,f]=(0,ey.useState)(null),[y,b]=(0,ey.useState)(!1);(0,ey.useEffect)(()=>{b(!0)},[]);let Z=(0,ey.useMemo)(()=>(null!=x?x:[]).filter(e=>(0,is.QT)(e)===is.ew),[x]),w=(0,ey.useMemo)(()=>Z.find(e=>e.id===(null==s?void 0:s.selectedPublicationId)),[Z,null==s?void 0:s.selectedPublicationId]),k=y&&n.isReady&&t&&!!l&&!l.isAnonymous&&!!s&&!!u&&void 0!==x&&!(o||l&&(c||p||m))&&!v,C="".concat(null==l?void 0:l.uid,":").concat(null==u?void 0:u.id),S="/get-started"===n.pathname,I=!!(null==u?void 0:u.activePublicationBuildId),T=Z.length>0;(0,ey.useEffect)(()=>{S?k&&(!T||I)&&f(C):f(null)},[S,k,T,I,C]);let W=tS({pathname:n.pathname,isConvella:t,ready:k,hasPublication:T,hasActiveBuild:I,setupStarted:j===C,youtubeError:"string"==typeof n.query.youtubeError?n.query.youtubeError:void 0});return((0,ey.useEffect)(()=>{W&&n.replace(W)},[W,n]),(0,ey.useEffect)(()=>{k&&s&&Z.length&&!w&&g(s.id,{selectedPublicationId:Z[0].id})},[k,w,g,s,Z]),t&&"/invite"!==n.pathname&&"/login/[userId]"!==n.pathname&&(!k||W))?(0,r.jsx)(io.g,{}):(0,r.jsx)(r.Fragment,{children:i})};var tP=t(17017),tT=t(41290);let tW=(0,eI.cn)(!1),tU=(0,eI.cn)({}),tA=()=>{let[e,i]=(0,eP.KO)(tW),[t,n]=(0,eP.KO)(tU);return{open:e=>{i(!0),n(null!=e?e:{})},close:()=>i(!1),isOpen:e,props:t}};function tE(){let{isOpen:e,close:i,props:t}=tA(),n=(0,P.O$)(),{title:l,subtitle:o}=t,{updateUser:a}=(0,ez.I)(),d=(0,e_.II)(),{user:c}=(0,h.a)();return((0,ey.useEffect)(()=>{e&&!n&&a(d,{lastSawReviewDialog:eG.Timestamp.now()})},[n,e]),n)?null:(0,r.jsxs)(e0.Z,{maxWidth:"sm",open:e,onClose:i,fullWidth:!0,fullScreen:e7.tq,TransitionComponent:e7.tq?e1.R:void 0,children:[(0,r.jsxs)(em.Z,{sx:{display:"flex",alignItem:"center"},children:["Enjoying Video To Blog?  ",(0,r.jsx)(tT.Z,{sx:{ml:1},defaultValue:5,size:"large"})]}),(0,r.jsx)(eg.Z,{children:(0,r.jsxs)(H.Z,{display:"flex",children:[(0,r.jsxs)(H.Z,{mr:3,textAlign:"center",children:[(0,r.jsx)("img",{style:{borderRadius:80,height:88},src:"https://firebasestorage.googleapis.com/v0/b/videotoblog-35c6e.appspot.com/o/blogs%2FProfilePicCroppedReduced.png?alt=media&token=1fe9dcd3-f74f-41ad-b340-fc9caf6fda1b"}),(0,r.jsx)(V.Z,{variant:"body2",color:"grey",children:"Andrew Petrovics, Founder"})]}),(0,r.jsxs)(Y.Z,{spacing:2,children:[(0,r.jsx)(ev.Z,{children:"Hey, I hope you are enjoying Video To Blog."}),(0,r.jsx)(ev.Z,{children:"I know this is a lot to ask, but I wondering if you would be willing to write us a review on G2?"}),(0,r.jsx)(ev.Z,{children:"This would help us tremendously to spread the word about Video To Blog to other creators like you."}),(0,r.jsxs)(ej.Z,{children:[(0,r.jsx)(G.Z,{onClick:i,children:"Maybe later"}),(0,r.jsx)(G.Z,{variant:"contained",onClick:()=>{s.mp.track("Review Click"),window.open("https://www.g2.com/products/video-to-blog/reviews","_blank"),a(d,{preferences:{...c.preferences,dontShowAppReviewDialog:!0}}),i()},children:"Write a review on G2"})]})]})]})})]})}var tM=t(41326),tF=t(46532),tO=t(84954),tR=t(92878),tD=t(65806),tz=t(12467),tL=t(44723),tN=t(77713);let t_=()=>{let[e,i]=(0,eP.KO)(tF.k),t=(0,e_.II)(),n=(0,tO.l)(),{isOpen:l}=(0,tN.HZ)(),[o,a]=(0,ey.useState)("publish"),[s,d]=(0,ey.useState)(!1),[c,u]=(0,ey.useState)("");(0,ey.useEffect)(()=>{a("publish"),u("")},[e]),(0,ey.useEffect)(()=>{e&&e.userId!==t&&i(null)},[e,i,t]);let h=async()=>{if(e&&e.userId===t){d(!0),u("");try{await n(e.publicationId,{enabled:!0,newVideos:o}),i(null)}catch(e){u("Your article is published. We couldn't save this preference. Please try again.")}finally{d(!1)}}};return(0,r.jsx)(e0.Z,{open:!!(e&&e.userId===t&&!l),disableEscapeKeyDown:!0,"aria-labelledby":"automation-publish-title",maxWidth:"xs",fullWidth:!0,sx:{zIndex:e=>e.zIndex.modal+2},PaperProps:{sx:{borderRadius:3}},children:(0,r.jsxs)(eg.Z,{sx:{p:3},children:[(0,r.jsxs)(Y.Z,{direction:"row",spacing:.75,alignItems:"center",sx:{color:"success.main",mb:.5},children:[(0,r.jsx)(eZ.default,{sx:{fontSize:16}}),(0,r.jsx)(V.Z,{variant:"caption",fontWeight:700,children:"Published"})]}),(0,r.jsx)(V.Z,{id:"automation-publish-title",variant:"h6",fontWeight:800,sx:{mb:2,lineHeight:1.3},children:"What should happen next time you post?"}),(0,r.jsx)(tR.Z,{value:o,onChange:(e,i)=>a(i),"aria-labelledby":"automation-publish-title",sx:{gap:1}
1,children:[{value:"publish",title:"Publish automatically",description:"New videos go live on your site as soon as they're ready. We'll email you each time."},{value:"draft",title:"Save as drafts for review",description:"We'll email you when each one is ready to check and publish."}].map(e=>(0,r.jsx)(tD.Z,{value:e.value,disabled:s,control:(0,r.jsx)(tz.Z,{size:"small",sx:{p:0,mr:1,mt:.25}}),sx:{m:0,p:1.75,alignItems:"flex-start",border:"2px solid",borderColor:o===e.value?"primary.main":"divider",borderRadius:2,bgcolor:o===e.value?"action.selected":"transparent"},label:(0,r.jsxs)(H.Z,{children:[(0,r.jsxs)(Y.Z,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",children:[(0,r.jsx)(V.Z,{variant:"body2",fontWeight:700,children:e.title}),"publish"===e.value&&(0,r.jsx)(e9.Z,{label:"Recommended",color:"primary",size:"small",sx:{height:18,fontSize:9}})]}),(0,r.jsx)(V.Z,{variant:"caption",component:"p",color:"text.secondary",sx:{lineHeight:1.4,mt:.25},children:e.description})]})},e.value))}),c&&(0,r.jsx)(tL.Z,{severity:"error",sx:{mt:2},children:c}),(0,r.jsx)(iU.Z,{fullWidth:!0,variant:"contained",loading:s,onClick:h,sx:{mt:2,py:1.25},children:"Save"}),(0,r.jsx)(V.Z,{variant:"caption",component:"p",textAlign:"center",color:"text.secondary",sx:{mt:1},children:"You can change this anytime in Settings → Automation."})]})})};var tB=t(36165),tY=t(37056),tH=t(6735),tV=t(27371),tq=t(44069),tG=t(65023),tX=t(3990),t$=t(57632),tQ=t(20997),tK=t(23043),tJ=t(4307),t0=t(54339),t1=t(67131),t2=t(63214),t5=t(36515),t3=t(25714),t4=t(49510),t8=t(19052),t9=t(47023),t7=t(31532),t6=t(95946),ne=t(79402),ni=t(34235),nt=t(14486),nn=t(14670),nl=t(47351),nr=t(56742),no=t.n(nr);(n=l||(l={})).inital="inital",n.videos="videos",n.publicationOrExport="publicationOrExport",n.publicationName="publicationName",n.pricing="pricing",n.youtubeChannel="youtubeChannel",n.hearAboutUs="hearAboutUs",n.websiteIntegrations="websiteIntegrations";let na=[{key:"Reddit",icon:(0,r.jsx)(t0.default,{})},{key:"Facebook",icon:(0,r.jsx)(t1.default,{})},{key:"Tik Tok"},{key:"Instagram",icon:(0,r.jsx)(t2.default,{})},{key:"Linked In",icon:(0,r.jsx)(t5.default,{})},{key:"Twitter / X",icon:(0,r.jsx)(t3.default,{})},{key:"YouTube",icon:(0,r.jsx)(t4.default,{})},{key:"Google Search",icon:(0,r.jsx)(t8.default,{})}],ns=[{key:"YouTube",icon:(0,r.jsx)(t4.default,{})},{key:"Google Drive",icon:(0,r.jsx)(t9.default,{})},{key:"My Computer",icon:(0,r.jsx)(t7.default,{})},{key:"Dropbox"},{key:"Vimeo"},{key:"Zoom",icon:(0,r.jsx)(t6.Z,{})},{key:"Twitch",icon:(0,r.jsx)(tK.Z,{})},{key:"Facebook",icon:(0,r.jsx)(t1.default,{})}],nd=[{key:"Wordpress",type:"Web",hasIntegration:!0},{key:"Medium",type:"Web",hasIntegration:!0},{key:"Shopify",type:"Web",hasIntegration:!0},{key:"Squarespace",type:"Web",hasIntegration:!1},{key:"GoHighLevel",type:"Web",hasIntegration:!1},{key:"Wix",type:"Web",hasIntegration:!0},{key:"Mailchimp",type:"Email",hasIntegration:!1},{key:"Klaviyo",type:"Email",hasIntegration:!1},{key:"Substack",type:"Web",hasIntegration:!1},{key:"Blogger",type:"Web",hasIntegration:!0},{key:"LinkedIn",type:"Web",hasIntegration:!1},{key:"Ghost.org",type:"Web",hasIntegration:!0},{key:"Beehiiv",type:"Email",hasIntegration:!1},{key:"SendGrid",type:"Email",hasIntegration:!1}],nc=e=>{let{isOpen:i,close:t}=e,n=(0,ef.useRouter)(),l=(0,P.WL)(),o=(0,P.O$)(),{createPublication:d}=(0,tG.l)(),c=(0,tX.X)(),{user:p}=(0,h.a)(),x=(0,eS.Z)(),{updateUser:m}=(0,ez.I)(),[g,v]=(0,ey.useState)(!1),[j,f]=(0,ey.useState)("inital"),[y,b]=(0,ey.useState)(!1),[Z,w]=(0,ey.useState)(!1),[k,C]=(0,ey.useState)(0),[S,I]=(0,ey.useState)(),[T,W]=(0,ey.useState)(""),[U,A]=(0,ey.useState)([]),[M,O]=(0,ey.useState)([]),[D,L]=(0,ey.useState)(),[N,B]=(0,ey.useState)(),[q,$]=(0,ey.useState)([]),[Q,K]=(0,ey.useState)(),[J,el]=(0,ey.useState)(""),[ea,es]=(0,ey.useState)(),[ed,ec]=(0,ey.useState)(),{addYouTubeChannel:eu}=(0,nl.V)(),{updateBlog:eh}=(0,tB.X)(),ep=(0,E.dD)(),{showInputDialog:ex}=(0,u.q)(),{showDialog:eb,closeDialog:ew}=(0,id.Rh)(),ek=(0,ey.useMemo)(()=>[...(0,nt.shuffle)(nd)],[]),eC=(0,ey.useMemo)(()=>[...(0,nt.shuffle)(na),{key:"Other",icon:(0,r.jsx)(ne.default,{})}],[]),eI=(0,ey.useMemo)(()=>[...ns,{key:"Other",icon:(0,r.jsx)(ne.default,{})}],[]);(0,ey.useEffect)(()=>
1{i&&(eP(),s.mp.track("Started Onboarding"))},[i]);let eP=()=>{v(!0),setTimeout(()=>{v(!1)},750)},eT=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eg.Z,{children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsxs)(V.Z,{variant:"h5",textAlign:"center",children:["\uD83C\uDF89 Welcome to ",l,"!"]}),(0,r.jsxs)(H.Z,{mr:3,textAlign:"center",children:[(0,r.jsx)("img",{style:{borderRadius:80,height:88},src:"https://firebasestorage.googleapis.com/v0/b/videotoblog-35c6e.appspot.com/o/blogs%2FProfilePicCroppedReduced.png?alt=media&token=1fe9dcd3-f74f-41ad-b340-fc9caf6fda1b"}),(0,r.jsx)(V.Z,{variant:"body2",color:"grey",children:"Andrew Petrovics, Founder"})]}),(0,r.jsx)(eo.Z,{}),(0,r.jsx)(ev.Z,{sx:{fontWeight:"bold"},children:"Thanks so much for signing up!"}),(0,r.jsxs)(ev.Z,{children:["My name is Andrew and I am the creator of ",l,". I built ",l," to give people an easy way to convert their videos into great articles and email newsletters."]}),(0,r.jsx)(ev.Z,{children:o?"If you ever need a hand, you can reach us through the support menu.":"If you ever need a hand, you can reach me at [email protected]."}),(0,r.jsx)(ev.Z,{children:"To better customize your experience we will ask you just a few questions to get started."}),(0,r.jsxs)(Y.Z,{children:[(0,r.jsx)(ev.Z,{children:"Thanks again,"}),(0,r.jsx)(ev.Z,{children:"Andrew Petrovics"})]}),(0,r.jsx)(eo.Z,{}),!ep&&(0,r.jsx)(G.Z,{fullWidth:!0,variant:"contained",onClick:()=>{s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j}),f("videos")},children:"Get Started"})]})})}),ep&&(0,r.jsx)(ej.Z,{children:(0,r.jsx)(G.Z,{fullWidth:!0,variant:"contained",onClick:()=>f("publicationOrExport"),children:"Get Started"})})]}),eW=()=>(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eg.Z,{children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsx)(V.Z,{variant:"h5",textAlign:"center",children:"How do you want to publish your articles?"}),(0,r.jsx)(ev.Z,{textAlign:"center",children:"Choose between creating a publication or exporting your articles somewhere else."})]}),(0,r.jsx)(_.Z,{variant:"outlined",sx:{borderColor:x.palette.primary.main,borderWidth:2},children:(0,r.jsxs)(z.Z,{onClick:()=>{s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,type:"Publication"}),I("publication"),f("publicationName")},children:[!ep&&(0,r.jsx)(ei.Z,{children:(0,r.jsx)(R.default,{})}),(0,r.jsx)(en.Z,{primary:(0,r.jsxs)(H.Z,{display:"flex",alignItems:"center",children:["Create a publication ",(0,r.jsx)(e9.Z,{sx:{ml:1},color:"primary",size:"small",label:"Recommended"})]}),secondary:(0,r.jsxs)(Y.Z,{children:["Create your very own website on ",l," and instantly publish and email your articles.",(0,r.jsxs)(H.Z,{mt:2,display:"flex",alignItems:"center",children:[(0,r.jsx)(eZ.default,{color:"success"}),"Website builder"]}),(0,r.jsxs)(H.Z,{display:"flex",alignItems:"center",children:[(0,r.jsx)(eZ.default,{color:"success"}),"Built-in newsletters"]}),(0,r.jsxs)(H.Z,{display:"flex",alignItems:"center",children:[(0,r.jsx)(eZ.default,{color:"success"})," Custom domain"]})]})}),(0,r.jsx)(tJ.Z,{})]})}),(0,r.jsx)(_.Z,{variant:"outlined",children:(0,r.jsxs)(z.Z,{onClick:()=>{s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,type:"Export"}),I("export"),f("websiteIntegrations")},children:[!ep&&(0,r.jsx)(ei.Z,{children:(0,r.jsx)(ni.default,{})}),(0,r.jsx)(en.Z,{primary:"Export",secondary:"Export your articles to an existing website or somewhere else outside of ".concat(l,".")}),(0,r.jsx)(tJ.Z,{})]})})]})})})}),eU=()=>{let e=async()=>{try{var e,i,t,n;b(!0);let l=T;l||(l=p.displayName?"".concat(p.displayName,"'s Publication"):"My Publication");let r=await c(l),o=await d({subdomain:r,isEmailNewsletterEnabled:!0,title:l,authors:p.displayName?[{id:(0,t$.Z)(),name:null!==(e=p.displayName)&&void 0!==e?e:"",imageUrl:null!==(i=p.photoUrl)&&void 0!==i?i:null}]:[]});if(o){let e=null===(n=await (0,eG.getDocs)((0,eG.query)((0,eG.collection)(a.db,"/users/".concat(p.id,"/blogs")),(0,eG.where)("isWaitingForSubscriptionToGenerate","==",!0),(0,eG.orderBy)("created","desc"))))||void 0===n?void 0:null===(t=n.docs)||void 0===t?void 0:t.map(e=>e.data());await Promise.all(e.map(e=>{var i;return eh(e.id,{createdForPublicationId:o.id,publicationPostStatus:null!==(i=(0,tq.OG)({...e,createdForPublicationId:o.id}))&&void 0!==i?i:void 0})}))}}catch(e){(0,eK.yv)("Error creating publication",{variant:"error"})}finally{b(!1),s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j}),f("hearAboutUs")}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eg.Z,{children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsx)(V.Z,{variant:"h5",textAlign:"center",children:"Let's give your publication a name"}),(0,r.jsx)(ic.Z,{placeholder:"My Awesome Blog",value:T,helperText:"Don't worry, you can always change this later",onChange:e=>W(e.target.value),inputProps:{maxLength:94},fullWidth:!0}),(0,r.jsx)(iU.Z,{disabled:!T,size:"large",loading:y,variant:"contained",onClick:e,children:(0,r.jsx)("div",{children:"Next"})})]})})})})},eA=()=>{let e=async()=>{try{w(!0),eu({channelUrl:J})}catch(e){iu.cM.error("Error adding youtube channel",{e})}finally{f("publicationOrExport"),w(!1),s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,channelUrl:J,didSkip:!1})}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eg.Z,{sx:{minHeight:558.2},children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsx)(V.Z,{variant:"h5",textAlign:"center",children:"What's your YouTube channel?"}),(0,r.jsx)(ev.Z,{textAlign:"center",children:"This will make it easier to import videos"})]}),!J&&(0,r.jsx)(nn.Xb,{onChannelValidated:e=>
1{let{channelUrl:i,channelName:t,channelThumbnail:n}=e;el(i),es(t),ec(n)},onInvalidChannel:e=>{s.mp.track("Invalid Youtube channel",{channelUrl:e})}}),ea&&(0,r.jsxs)(ee.ZP,{children:[ed&&(0,r.jsx)(ei.Z,{children:(0,r.jsx)(et.Z,{src:ed})}),(0,r.jsx)(en.Z,{primary:ea}),(0,r.jsx)(X.Z,{onClick:()=>{el(""),es(""),ec("")},children:(0,r.jsx)(e4.default,{})})]}),(0,r.jsxs)(Y.Z,{spacing:2,children:[(0,r.jsx)(iU.Z,{disabled:!J,fullWidth:!0,loading:Z,variant:"contained",onClick:e,children:(0,r.jsx)("div",{children:"Add Channel"})}),(0,r.jsx)(G.Z,{onClick:()=>{f("publicationOrExport"),s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,channelUrl:J,didSkip:!0})},children:"Skip"})]})]})})})})},eE=()=>{let e=async e=>{if(q.some(i=>i===e))$(q.filter(i=>i!=e));else{if("Other"===e){let e=await ex({title:"Where do you want to export to?"});if(!e)return;K(e),i(e)}$([...q,e])}},i=e=>{let i=ek.filter(e=>e.hasIntegration&&q.includes(e.key)),t=()=>{ew(),s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,selectedIntegrations:[...q,e||void 0].filter(Boolean)}),f("hearAboutUs")};if(i.length){let e=i.length>1;eb((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(em.Z,{children:"Good news!"}),(0,r.jsxs)(eg.Z,{children:[(0,r.jsxs)(Y.Z,{spacing:2,children:[(0,r.jsxs)(ev.Z,{children:["We offer ",e?"":"an"," integration",e?"s":""," for ",i.map(e=>e.key).join(", ").replace(/,(?=[^,]+$)/,", and"),"."]}),(0,r.jsx)(ev.Z,{children:"You can set these up anytime in your integrations page."})]}),(0,r.jsx)(ej.Z,{children:(0,r.jsx)(G.Z,{variant:"contained",onClick:t,children:"Ok"})})]})]}))}else t()};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eg.Z,{sx:{minHeight:558.2},children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsx)(V.Z,{variant:"h5",textAlign:"center",children:"Where do you want to export your articles to?"}),(0,r.jsx)(ev.Z,{textAlign:"center",children:"Select all that apply. "})]}),(0,r.jsx)(H.Z,{children:ep?ek.map(i=>{let t=q.some(e=>e===i.key);return(0,r.jsx)(G.Z,{startIcon:i.icon,endIcon:t?(0,r.jsx)(eZ.default,{}):void 0,sx:{m:.5},variant:t?"contained":"outlined",onClick:()=>e(i.key),children:"Other"===i.key&&t?Q:i.key},i.key)}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(er.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,r.jsx)(R.default,{sx:{mr:1}})," Web"]}),ek.filter(e=>"Web"===e.type).map(i=>{let t=q.some(e=>e===i.key);return(0,r.jsx)(G.Z,{startIcon:i.icon,endIcon:t?(0,r.jsx)(eZ.default,{}):void 0,sx:{m:.5},variant:t?"contained":"outlined",onClick:()=>e(i.key),children:"Other"===i.key&&t?Q:i.key},i.key)}),(0,r.jsxs)(er.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,r.jsx)(F.default,{sx:{mr:1}})," Email"]}),ek.filter(e=>"Email"===e.type).map(i=>{let t=q.some(e=>e===i.key);return(0,r.jsx)(G.Z,{startIcon:i.icon,endIcon:t?(0,r.jsx)(eZ.default,{}):void 0,sx:{m:.5},variant:t?"contained":"outlined",onClick:()=>e(i.key),children:"Other"===i.key&&t?Q:i.key},i.key)})]})}),(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsx)(iU.Z,{disabled:!q.length,fullWidth:!0,loading:y,variant:"contained",onClick:()=>i(Q),children:(0,r.jsx)("div",{children:"Next"})}),(0,r.jsx)(G.Z,{onClick:()=>e("Other"),children:"I want to export somewhere else"})]})]})})})})},eM=()=>{let e=async e=>{if(M.some(i=>i===e))O(M.filter(i=>i!=e));else{if("Other"===e){let e=await ex({title:"Where are your videos?"});if(!e)return;B(e)}O([...M,e])}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eg.Z,{sx:{minHeight:558.2},children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsx)(V.Z,{variant:"h5",children:"Where are your videos?"}),(0,r.jsx)(ev.Z,{children:"Select all that apply"})]}),(0,r.jsx)(H.Z,{children:eI.map(i=>{let t=M.some(e=>e===i.key);return(0,r.jsx)(G.Z,{startIcon:i.icon,endIcon:t?(0,r.jsx)(eZ.default,{}):void 0,sx:{m:.5},variant:t?"contained":"outlined",onClick:()=>e(i.key),children:"Other"===i.key&&t?N:i.key},i.key)})}),(0,r.jsx)(iU.Z,{disabled:!(null==M?void 0:M.length),fullWidth:!0,variant:"contained",onClick:()=>{s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,selectedVideoSources:[...M,N||void 0].filter(
1Boolean)}),f(M.includes("YouTube")?"youtubeChannel":"publicationOrExport")},children:(0,r.jsx)("div",{children:"Next"})})]})})})})},eF=()=>{let e=async e=>{if(U.some(i=>i===e))A(U.filter(i=>i!=e));else{if("Other"===e){let e=await ex({title:"How did you hear about us?"});if(!e)return;L(e)}A([...U,e])}},i=async()=>{s.mp.track("Completed Onboarding Step",{step:eR(),currentView:j,selectedSources:[...U,D||void 0].filter(Boolean)}),s.mp.track("Onboarding Completed",{channelUrl:J,selectedVideoSources:M.map(e=>"Other"===e?D:e),selectedIntegrations:q.map(e=>"Other"===e?Q:e),selectedSources:U.map(e=>"Other"===e?N:e),selectedPublishMethod:S}),"publication"===S&&n.replace("/analytics"),await m(p.id,{preferences:{...p.preferences,hasSeenOnboarding:!0}}),t()};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eg.Z,{sx:{minHeight:558.2},children:(0,r.jsx)(tg.Z,{maxWidth:"sm",disableGutters:!0,children:(0,r.jsxs)(Y.Z,{spacing:4,children:[(0,r.jsxs)(Y.Z,{spacing:1,children:[(0,r.jsx)(V.Z,{variant:"h5",children:"How did you hear about us?"}),(0,r.jsx)(ev.Z,{children:"Select all that apply"})]}),(0,r.jsx)(H.Z,{children:eC.map(i=>{let t=U.some(e=>e===i.key);return(0,r.jsx)(G.Z,{startIcon:i.icon,endIcon:t?(0,r.jsx)(eZ.default,{}):void 0,sx:{m:.5},variant:t?"contained":"outlined",onClick:()=>e(i.key),children:"Other"===i.key&&t?D:i.key},i.key)})}),(0,r.jsx)(iU.Z,{disabled:!(null==U?void 0:U.length),fullWidth:!0,loading:y,variant:"contained",onClick:i,children:(0,r.jsx)("div",{children:"Next"})})]})})})})},eO=()=>(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(eg.Z,{children:[(0,r.jsx)(tQ.n,{title:"Select a plan",subtitle:"Money back gurantee within the first 30 days if you are not satisfied."}),!o&&(0,r.jsx)(H.Z,{display:"flex",justifyContent:"center",children:(0,r.jsx)(G.Z,{href:"https://www.videotoblog.ai/pricing",target:"_blank",endIcon:(0,r.jsx)(eV.default,{}),children:"See pricing details"})})]})}),eR=()=>{switch(j){case"inital":return -1;case"videos":case"youtubeChannel":return 0;case"publicationOrExport":case"publicationName":case"websiteIntegrations":return 1;case"hearAboutUs":case"pricing":return 2}};return(0,r.jsxs)(e0.Z,{maxWidth:"pricing"===j?"md":"sm",onClose:t,open:null!=i&&i,fullWidth:!0,fullScreen:!0,children:[g&&(0,r.jsx)(no(),{autorun:{speed:3}}),(0,r.jsx)(Y.Z,{sx:{justifyContent:"center",width:"100%"},children:"inital"!=j&&(0,r.jsxs)(tY.Z,{alternativeLabel:!0,activeStep:eR(),sx:{p:3},children:[(0,r.jsx)(tH.Z,{children:(0,r.jsx)(tV.Z,{children:"Video sources"})}),(0,r.jsx)(tH.Z,{children:(0,r.jsx)(tV.Z,{children:"Publish destinations"})}),(0,r.jsx)(tH.Z,{children:(0,r.jsx)(tV.Z,{children:"Finish"})})]})}),(()=>{switch(j){case"inital":return eT();case"videos":return eM();case"publicationOrExport":return eW();case"publicationName":return eU();case"websiteIntegrations":return eE();case"youtubeChannel":return eA();case"hearAboutUs":return eF();case"pricing":return eO()}})()]})};var nu=t(51525),nh=t(9891),np=t(9645),nx=t(34697),nm=t(53963),ng=t(36795),nv=t(88539),nj=t(73500);let nf=()=>{var e,i,t,n,l,o,s,c,u,p;let m=(0,ef.useRouter)(),{user:g}=(0,h.a)(),f=(0,E.dD)(),y=(0,P.O$)(),S=(0,eS.Z)(),{showDialog:I,closeDialog:T}=(0,id.Rh)(),{featureAccess:W,isPastDue:U,hasLifetimePlan:A,hasPlan:M,isLoading:F,appSumoTier:O}=(0,eM.X)({includeUsage:!0}),{hasPaidPlan:R}=(0,eF.X)(),D=y?R:M,N=!y&&U,{upgradeSubscription:_,isLoading:B}=(0,eL.j)(),{goToBilling:q,isLoading:Q}=(0,eB.b)(),{open:K}=(0,eE.v)(),{userActual:J}=(0,eN.L)(),{updateUser:ea}=(0,ez.I)(),{open:es}=(0,ir.t)(),{open:ed,close:eu,isOpen:eh}=i9(),{setIsSigningOut:ep}=(0,d.Sn)(),[ex]=(0,eJ.QJ)(a.bU),{publications:eb,isLoading:ew}=(0,eO.f)(),ek=!ew&&(null!==(n=null==eb?void 0:eb.length)&&void 0!==n?n:0)>0,[eC,eI]=(0,ey.useState)([]),[eP,eT]=(0,ey.useState)(null),[eW,eU]=(0,ey.useState)(!1),[eR,eD]=(0,ey.useState)(!1),[e_,eY]=(0,ey.useState)(0),[eH,eV]=(0,ey.useState)(!1);(0,ey.useEffect)(()=>{var e;if((null==m?void 0:null===(e=m.query)||void 0===e?void 0:e.openEmailPreference)=="true"){eY(1),eU(!0);let e=new URL(window.location.href);e.searchParams.delete("openEmailPreference"),m.replace(e.pathname+e.search,void 0,{shallow:!0})}},[null==m?void 0:null===(e=m.query)||void 0===e?void 0:e.openEmailPreference]),(0,ey.useEffect)(()=>{eq()},[null==J?void 0:J.id,null==J?void 0:null===(i=J.teamIds)||void 0===i?void 0:i.length]);let eq=async()=>{var e;J&&eI(await Promise.all((null!==(e=null==J?void 0:J.teamIds)&&void 0!==e?e:[]).map(async e=>(await (0,eG.getDoc)((0,eG.doc)(a.db,"users/".concat(e)))).data())))},eX=async()=>{console.log("here"),K({title:"Upgrade",subtitle:""})},e$=async e=>{await ea(J.id,{selectedTeamId:e})},eQ=!!(null==J?void 0:null===(t=J.teamIds)||void 0===t?void 0:t.length);return(0,r.jsxs)(r.Fragment,{children:[eW&&(0,r.jsx)(iE,{onClose:()=>{eU(!1),eY(0)},open:eW,hasPublications:ek,initialTabIndex:e_}),(0,r.jsx)(iM.H,{onClose:()=>eD(!1),open:eR}),(0,r.jsx)(ng.Z,{position:"sticky",sx:{bgcolor:S.palette.background.paper,marginBottom:0},elevation:0,style:{borderBottom:"1px solid #dadce0"},children:(0,r.jsx)(tg.Z,{maxWidth:"xl",disableGutters:!0,style:{paddingLeft:f?void 0:0,maxWidth:"100%"},children:(0,r.jsx)(nv.Z,{style:{paddingLeft:f?void 0:0},children:(0,r.jsxs)(H.Z,{display:"flex",flex:1,justifyContent:"space-between",children:[f?(0,r.jsx)(X.Z,{size:"small",sx:{},onClick:()=>eh?eu():ed(),children:(0,r.jsx)(Z.default,{})}):(0,r.jsx)(H.Z,{}),(0,r.jsxs)(Y.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,r.jsx)(V.Z,{sx:{fontSize:2,display:"none"},id:"dogText",children:"dog"}),!y&&g&&(0,r.jsx)(nb,{user:g,isLoading:F,isOpen:!0,onUpgradeClick:eX,setIsOpen:()=>{},hasPlan:M,featureAccess:W}),(0,r.jsx)(iB,{}),y&&(0,r.jsx)(i3,{}),(0,r.jsx)(L.Z,{title:"Earn more credits!",id:"earnTooltip",children:(0,r.jsx)(X.Z,{href:"/earn",children:(0,r.jsx)(eA.Z,{})})}),(0,r.jsx)(L.Z,{title:"Help",id:"helpTooltip",children:(0,r.jsx)(nj.j,{Button:e=>(0,r.jsx)(X.Z,{...e,children:(0,r.jsx)(np.default,{})}),menuButtons:[...y?[]:[{onClick:()=>{window.open("https://docs.videotoblog.ai/","_blank")},title:"See Docs",icon:(0,r.jsx)(C.Z,{})}],{onClick:()=>{es()},title:"Contact Support",icon:(0,r.jsx)(nx.Z,{})}]})}),(0,r.jsx)(X.Z,{onClick:e=>eT(e.currentTarget),children:(0,r.jsx)(et.Z,{sx:{width:36,height:36,bgcolor:"".concat(S.palette.secondary.light," !important")},src:null!==(l=null==g?void 0:g.photoUrl)&&void 0!==l?l:void 0,alt:null!==(o=null==g?void 0:g.displayName)&&void 0!==o?o:"",children:(0,E.Qm)(null==g?void 0:g.displayName)})}
1),(0,r.jsxs)(el.Z,{anchorEl:eP,slotProps:{list:{sx:{p:0}}},transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},open:!!eP,onClose:()=>eT(null),children:[eQ?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er.Z,{children:"My Accounts"}),(0,r.jsxs)(ec.Z,{onClick:()=>{e$(J.id),eT(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(et.Z,{sx:{mr:2,width:32,height:32,bgcolor:"".concat(S.palette.secondary.light," !important")},src:null!==(s=null==J?void 0:J.photoUrl)&&void 0!==s?s:void 0,alt:null!==(c=null==J?void 0:J.displayName)&&void 0!==c?c:""})}),(0,r.jsx)(en.Z,{primary:"Me (".concat(null==J?void 0:J.displayName,")")}),(null==J?void 0:J.id)===(null==g?void 0:g.id)&&(0,r.jsx)(ei.Z,{sx:{ml:2},children:(0,r.jsx)(eZ.default,{color:"success"})})]}),eC.map(e=>{var i,t;return e?(0,r.jsxs)(ec.Z,{onClick:()=>{e$(e.id),eT(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(et.Z,{sx:{mr:2,width:32,height:32,bgcolor:"".concat(S.palette.secondary.light," !important")},src:null!==(i=null==e?void 0:e.photoUrl)&&void 0!==i?i:void 0,alt:null!==(t=null==e?void 0:e.displayName)&&void 0!==t?t:""})}),(0,r.jsx)(en.Z,{primary:"".concat(null==e?void 0:e.displayName,"'s Team")}),(null==g?void 0:g.id)===e.id&&(0,r.jsx)(ei.Z,{sx:{ml:2},children:(0,r.jsx)(eZ.default,{color:"success"})})]},e.id):(0,r.jsx)(r.Fragment,{})})]}):(0,r.jsxs)(ee.ZP,{children:[(0,r.jsx)(ei.Z,{children:(0,r.jsxs)(et.Z,{sx:{width:32,height:32,bgcolor:"".concat(S.palette.secondary.light," !important")},src:null!==(u=null==J?void 0:J.photoUrl)&&void 0!==u?u:void 0,alt:null!==(p=null==J?void 0:J.displayName)&&void 0!==p?p:"",children:[" ",(0,E.Qm)(null==J?void 0:J.displayName)]})}),(0,r.jsx)(en.Z,{primary:null==J?void 0:J.displayName,secondary:null==J?void 0:J.email})]}),(null==J?void 0:J.id)===(null==g?void 0:g.id)&&(0,r.jsx)(eo.Z,{}),J&&(null==J?void 0:J.id)===(null==g?void 0:g.id)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(z.Z,{onClick:()=>{eU(!0),eT(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(k.default,{})}),(0,r.jsx)(en.Z,{primary:"Your profile"})]}),(0,r.jsxs)(z.Z,{onClick:()=>{eD(!0),eT(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(w.default,{})}),(0,r.jsx)(en.Z,{primary:"Team members"})]}),y&&(0,r.jsxs)(z.Z,{onClick:()=>{m.push("/usage"),eT(null)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(nm.Z,{})}),(0,r.jsx)(en.Z,{primary:"Usage & billing"})]}),A&&(0,r.jsxs)(z.Z,{onClick:()=>{eT(null),I((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(em.Z,{children:"App Sumo plan"}),(0,r.jsxs)(eg.Z,{children:[(0,r.jsx)(ev.Z,{children:"You can manage your App Sumo plan in App Sumo. If you would like to switch to a subscription plan press the Upgrade button."}),(0,r.jsx)(ej.Z,{children:(0,r.jsx)(G.Z,{onClick:T,children:"Ok"})})]})]}))},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(x.Z,{})}),(0,r.jsx)(en.Z,{primary:"Lifetime Plan",secondary:"App Sumo: Tier ".concat(O)})]}),!y&&(D||N)&&!A&&(0,r.jsxs)(z.Z,{onClick:async()=>{await q(),eT(null)},children:[(0,r.jsx)(ei.Z,{children:Q?(0,r.jsx)($.Z,{size:20}):(0,r.jsx)(j.default,{})}),(0,r.jsx)(en.Z,{primary:"Billing"})]}),(!D&&!N||A)&&(0,r.jsxs)(z.Z,{onClick:()=>{eT(null),eX()},children:[(0,r.jsx)(ei.Z,{children:B?(0,r.jsx)($.Z,{size:20}):(0,r.jsx)(v.default,{})}),(0,r.jsx)(en.Z,{primary:"Upgrade"})]})]}),(0,r.jsx)(eo.Z,{}),(0,r.jsxs)(z.Z,{onClick:async()=>{ep(!0),ex(),eT(null),await m.replace("/"),ep(!1)},children:[(0,r.jsx)(ei.Z,{children:(0,r.jsx)(b.default,{})}),(0,r.jsx)(en.Z,{primary:"Sign out"})]})]})]})]})})})})]})},ny=(0,eC.ZP)(e=>{let{className:i,...t}=e;return(0,r.jsx)(L.Z,{...t,classes:{popper:i}})})(e=>{let{theme:i}=e;return{["& .".concat(N.Z.tooltip)]:{backgroundColor:"transparent",margin:"0px !important",pointerEvents:"auto !important",color:"rgba(0, 0, 0, 0.87)",maxWidth:350,fontSize:i.typography.pxToRem(12)}}}),nb=e=>{var i,t,n,l,o,a,s,d,c,u,h,p;let{user:x,featureAccess:m,isLoading:g,isOpen:j,setIsOpen:f,onUpgradeClick:y,hasPlan:b}=e,Z=null!==(n=null==m?void 0:null===(i=m.credits.usage)||void 0===i?void 0:i.used)&&void 0!==n?n:0,w=null!==(l=null==m?void 0:null===(t=m.blogs.usage)||void 0===t?void 0:t.used)&&void 0!==l?l:0,k=null!==(o=null==m?void 0:m.credits.limit)&&void 0!==o?o:0,C=Math.max(0,k-Z),S=Math.max(0,(null!==(a=null==m?void 0:m.blogs.limit)&&void 0!==a?a:1)-(null!=w?w:0)),I=e=>{if(!e)return null;let i=new Date(e),t=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(i),n=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(i),l=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).format(i);return{summary:"".concat(t," at ").concat(n),withZone:"".concat(t," at ").concat(l)}},P=e=>{let i=I(e);return i?"Resets ".concat(i.summary):"Resets monthly at the UTC cutoff"},T=e=>{let i=I(e);return i?"Monthly usage resets at midnight UTC on the first of each month, which is ".concat(i.withZone," in your local time."):"Monthly usage resets at midnight UTC on the first of each month."},W=e=>{let{label:i,remaining:t,limit:n,progressValue:l,nextReset:o,bonusRemaining:a}=e;return(0,r.jsx)(_.Z,{variant:"outlined",sx:{width:"250px",margin:0},children:(0,r.jsx)(B.Z,{children:(0,r.jsxs)(Y.Z,{children:[(0,r.jsxs)(H.Z,{display:"flex",justifyContent:"space-between",children:[(0,r.jsx)(V.Z,{variant:"caption",color:"grey",children:i}),(0,r.jsx)(L.Z,{title:T(o),children:(0,r.jsx)(eT.Z,{style:{cursor:"pointer"},color:"grey",height:15,width:15})})]}),(0,r.jsxs)(V.Z,{variant:"subtitle1",children:[t," ",(0,r.jsxs)(H.Z,{component:"span",sx:{color:"text.secondary",fontSize:"0.75rem"},children:["/ ",n]})]}),(0,r.jsx)(H.Z,{sx:{width:"100%"},children:(0,r.jsx)(q.Z,{value:l,color:"success",variant:"determinate"})}),(0,r.jsx)(V.Z,{variant:"caption",sx:{color:"rgba(0, 0, 0, 0.5)",fontSize:"0.64rem",lineHeight:1.3,mt:.35,mb:1.35},children:P(o)}),!!a&&(0,r.jsxs)(H.Z,{display:"flex",alignItems:"center",justifyContent:"space-between",sx:{mt:.5},children:[(0,r.jsxs)(V.Z,{variant:"caption",fontStyle:"italic",color:"success",children:["+",a," bonus blogs"]}),(0,r.jsx)(L.Z,{title:"Bonus blogs will only get used when you run out of your monthly usage. Bonus blogs do not expire and will be rolled over to following month so they will not show in your monthly available blog posts.",children:(0,r.jsx)(eT.Z,{style:{cursor:"pointer"},color:"grey",height:14,width:14})})]}),(0,r.jsx)(G.Z,{onClick:e=>{e.currentTarget.blur(),y()},sx:{mt:1},variant:"outlined",startIcon:(0,r.jsx)(v.default,{}),children:"Upgrade"})]})})})},U=()=>{var e,i,t,n,l,r,o;return(null==m?void 0:m.credits.hasAccess)?W({label:"Available Credits",remaining:C,limit:k,progressValue:k>0?C/k*100:0,nextReset:null==m?void 0:null===(n=m.credits.usage)||void 0===n?void 0:n.nextReset}):W({label:"Available Video Uploads",remaining:S,limit:null!==(l=null==m?void 0:m.blogs.limit)&&void 0!==l?l:1,progressValue:(null!==(r=null==m?void 0:m.blogs.limit)&&void 0!==r?r:1)>0?S/(null!==(o=null==m?void 0:m.blogs.limit)&&void 0!==o?o:1)*100:0,nextReset:null==m?void 0:null===(e=m.blogs.usage)||void 0===e?void 0:e.nextReset,bonusRemaining:null==m?void 0:null===(t=m.blogs)||void 0===t?void 0:null===(i=t.usage)||void 0===i?void 0:i.bonus
1Remaining})};return x&&(null==m?void 0:m.credits.hasAccess)&&!g?(0,r.jsx)(H.Z,{sx:{display:"block",p:0},children:(0,r.jsx)(ny,{title:U(),children:(0,r.jsx)(ia,{onClick:()=>f(!0),sx:{justifyContent:j?"initial":"center",p:0},children:(0,r.jsx)(ei.Z,{sx:{minWidth:0,justifyContent:"center"},children:(0,r.jsx)(io.g,{innerGridStyle:{display:"flex"},minContainerHeight:0,color:"success",displayValue:(null!==(s=null==m?void 0:m.credits.limit)&&void 0!==s?s:0)-(null!=Z?Z:0),value:((null!==(d=null==m?void 0:m.credits.limit)&&void 0!==d?d:0)-(null!=Z?Z:0))/(null!==(c=null==m?void 0:m.credits.limit)&&void 0!==c?c:0)*100,hidePercent:!0})})})})}):x&&(!b||(null==m?void 0:m.blogs.limit))&&!g?S<=0&&!b?(0,r.jsx)(ny,{title:U(),children:(0,r.jsx)(G.Z,{onClick:y,variant:"contained",color:"secondary",startIcon:(0,r.jsx)(v.default,{}),children:"Upgrade"})}):(0,r.jsx)(H.Z,{sx:{p:0},children:(0,r.jsx)(ny,{title:U(),children:(0,r.jsx)(ia,{onClick:()=>f(!0),sx:{minHeight:48,justifyContent:j?"initial":"center",p:0},children:(0,r.jsx)(ei.Z,{sx:{minWidth:0,justifyContent:"center"},children:(0,r.jsx)(io.g,{innerGridStyle:{display:"flex"},minContainerHeight:0,color:(null==m?void 0:m.blogs.limit)&&void 0!=w&&(null==m?void 0:m.blogs.limit)-w<=0?"error":"success",displayValue:(null!==(u=null==m?void 0:m.blogs.limit)&&void 0!==u?u:1)-(null!=w?w:0),value:((null!==(h=null==m?void 0:m.blogs.limit)&&void 0!==h?h:1)-(null!=w?w:0))/(null!==(p=null==m?void 0:m.blogs.limit)&&void 0!==p?p:1)*100,hidePercent:!0})})})})}):(0,r.jsx)(r.Fragment,{})};var nZ=t(12116),nw=t(1198),nk=t(15399);let nC=()=>{let{pricingPlanId:e,hasPlan:i,planName:t}=(0,eM.X)(),{user:n}=(0,h.a)(),{updateUser:l}=(0,ez.I)();return(0,ey.useEffect)(()=>{var i;if(!e)return;let t=Object.values(nw.dO).find(i=>i.id===e);s.mp.people.set({plan:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"none"})},[e]),(0,ey.useEffect)(()=>{if(i&&n&&n.plan!==t){l(n.id,{plan:t});try{window.gtag("event","conversion",{send_to:"AW-779375814/1OmuCJjc7Y4ZEMap0fMC"})}catch(e){console.log("error sending conversion event")}}},[i,n,null==n?void 0:n.id,null==n?void 0:n.plan,t,l]),null};var nS=function(e){let{Component:i,pageProps:n,isThirdPartyInitialized:l}=e,p=(0,ey.useRef)(!1),[x,m]=(0,eJ.F_)(a.bU),{user:g}=(0,h.a)(),{updateUser:v}=(0,ez.I)(),j=(0,ef.useRouter)(),f=(0,P.O$)(),{open:y,isOpen:b,close:Z}=(0,d.dn)(),{isSigningOut:w}=(0,d.Sn)(),[k,C]=(0,ey.useState)(!1),[S,I]=(0,ey.useState)("idle"),T=(0,ey.useRef)(j);T.current=j;let W="/login/[userId]"===j.pathname,U="/site"===j.pathname&&"reveal"===j.query.convellaOnboarding;(0,ey.useEffect)(()=>{p.current||(p.current=!0,Promise.all([t.e(75336),t.e(19069)]).then(t.bind(t,53078)).then(e=>{let{Replay:i}=e;tu.M5(new i({maskAllText:!1,blockAllMedia:!1,mask:["input[type='password']"]}))}))},[]),(0,ey.useEffect)(()=>{let e;if(!U){"/site"!==j.pathname&&I("idle");return}I("site");let i=()=>{void 0===e&&(e=window.setTimeout(()=>{I("chrome"),T.current.replace("/site",void 0,{shallow:!0})},3e3))};window.addEventListener("convella-site-preview-loaded",i);let t=window.setTimeout(i,15e3);return()=>{window.removeEventListener("convella-site-preview-loaded",i),window.clearTimeout(t),void 0!==e&&window.clearTimeout(e)}},[U,j.pathname]),(0,ey.useEffect)(()=>{if(W){b&&Z();return}if(!m&&(!x||f&&x.isAnonymous)&&!w){if(f){b&&Z(),j.replace((0,o.N)("/login",j.asPath));return}b||y({preventClose:!0});return}b&&Z()},[x,Z,m,b,W,f,j,w,y]),(0,ey.useEffect)(()=>{if(g&&!(null==g?void 0:g.languageCode))try{v(null==g?void 0:g.id,{languageCode:navigator.language})}catch(e){iu.cM.warn("could not update language code",{})}},[v,g,null==g?void 0:g.languageCode]),(0,ey.useEffect)(()=>{var e;(null==x?void 0:x.uid)&&l&&(th.av({email:x.email,id:x.uid}),s.mp.identify(x.uid),s.mp.people.set({email:x.email}),nk.clarity.identify(x.uid,{email:null!==(e=x.email)&&void 0!==e?e:""}),window.clarity&&window.clarity("identify",x.uid),iu.cM.set({userId:x.uid}))},[null==x?void 0:x.email,null==x?void 0:x.uid,l]);let A=f&&(U||"site"===S),M=f&&"chrome"===S,F=f&&"/get-started"===j.pathname||A||j.pathname.includes("/pages/")||(j.pathname.includes("/articles/")||j.pathname.includes("/posts/"))&&!j.pathname.includes("/analytics")||"/referral/[referralCode]"==j.pathname||"/wordpress-plugin"==j.pathname||"/shopify-connect"==j.pathname,O=!F&&!E.$M;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(nZ.sc,{backendUrl:f?"/api/priceos/convella":void 0,logLevel:"debug",getBearerToken:async()=>null==x?void 0:x.getIdToken(),children:[!f&&(null==x?void 0:x.uid)&&(0,r.jsx)(nC,{}),(0,r.jsx)(eK.wT,{children:(0,r.jsx)(tc.WT,{children:(0,r.jsx)(id.Tu,{children:(0,r.jsx)(tM.I,{children:(0,r.jsx)(u.i,{children:(0,r.jsxs)(tp.s,{children:[(0,r.jsx)(c.f,{}),(0,r.jsx)(ir.o,{}),(0,r.jsx)(tx.S9,{}),(0,r.jsx)(nu.Q,{}),(0,r.jsx)(nh.Uy,{}),(0,r.jsx)(tm.rF,{}),(0,r.jsx)(eE.E,{}),(0,r.jsx)(eR.uO,{}),(0,r.jsx)(td,{}),(0,r.jsx)(tE,{}),(0,r.jsx)(tZ,{}),(0,r.jsx)(tP.z,{}),(0,r.jsx)(nc,{isOpen:k,close:()=>C(!1)}),(0,r.jsx)(tw.z,{}),(0,r.jsx)(t_,{}),(0,r.jsx)(d.ol,{}),(0,r.jsx)(tI,{children:(0,r.jsxs)(H.Z,{sx:{display:"flex",overscrollBehavior:"none"},children:[!F&&(0,r.jsx)(H.Z,{sx:M?{animation:"convellaNavReveal 420ms ease-out both","@keyframes convellaNavReveal":{from:{opacity:0,transform:"translateX(-24px)"},to:{opacity:1,transform:"translateX(0)"}}}:void 0,children:(0,r.jsx)(ta,{})}),(0,r.jsxs)(H.Z,{sx:{flexGrow:1,minWidth:0},children:[O&&(0,r.jsx)(H.Z,{sx:M?{animation:"convellaAppBarReveal 420ms ease-out both","@keyframes convellaAppBarReveal":{from:{opacity:0,transform:"translateY(-20px)"},to:{opacity:1,transform:"translateY(0)"}}}:void 0,children:(0,r.jsx)(nf,{})}),(0,r.jsx)(i,{sx:{flexGrow:1,p:3},...n})]})]})}),A&&(0,r.jsxs)(ep.Z,{elevation:8,sx:{alignItems:"center",bgcolor:"#1f2937",borderRadius:999,bottom:{xs:18,sm:28},color:"#fff",display:"flex",gap:1,left:"50%",maxWidth:"calc(100vw - 32px)",px:2,py:1.25,position:"fixed",transform:"translateX(-50%)",zIndex:e
1=>e.zIndex.modal+1},children:[(0,r.jsx)(H.Z,{"aria-hidden":!0,sx:{color:"#c4b5fd",fontSize:16},children:"✦"}),(0,r.jsx)(V.Z,{sx:{fontSize:13,fontWeight:700,whiteSpace:"nowrap"},children:"Your site is ready. Writing posts from your latest 25 videos."})]})]})})})})})})]})})}},9351:function(e,i,t){t.d(i,{AY:function(){return c},Ei:function(){return o},OG:function(){return l},Sb:function(){return r},lD:function(){return s},ng:function(){return d}});var n=t(88632);let l=e=>{var i,t;return e&&(e.publishedPublicationId||e.createdForPublicationId||e.emailSentPublicationId)?e.publishedPublicationId&&!0===e.isPublished?(null===(t=e.mailgunMessageIds)||void 0===t?void 0:t.length)||e.emailSentDate?"published_and_sent":"published":(null===(i=e.mailgunMessageIds)||void 0===i?void 0:i.length)||e.emailSentDate?"email_only":"draft":null},r=e=>{var i;return!!(null==e?void 0:null===(i=e.youtubeChannels)||void 0===i?void 0:i.some(e=>{var i,t;return!!(null==e?void 0:null===(i=e.channelId)||void 0===i?void 0:i.trim())||!!(null==e?void 0:null===(t=e.channelUrl)||void 0===t?void 0:t.trim())}))},o=e=>{if(!(null==e?void 0:e.trim()))return null;try{var i,t,n;let l=new URL(e.trim()),r=l.hostname.toLowerCase();if(!new Set(["youtube.com","www.youtube.com","m.youtube.com","music.youtube.com","gaming.youtube.com","www.youtube-nocookie.com","youtube-nocookie.com","youtu.be"]).has(r))return null;let o=l.pathname.split("/").filter(Boolean),a=null!==(n=null!==(i=l.searchParams.get("v"))&&void 0!==i?i:"youtu.be"===r?o[0]:void 0)&&void 0!==n?n:["embed","v","shorts","live"].includes(null!==(t=o[0])&&void 0!==t?t:"")?o[1]:void 0;return a&&/^[a-zA-Z0-9_-]{11}$/.test(a)?a:null}catch(e){return null}},a=e=>{let i=new URL(/^[a-zA-Z][a-zA-Z\d+.-]*:/i.test(e.trim())?e.trim():"https://".concat(e.trim())),t=i.hostname.replace(/^www\./,""),n=i.pathname.replace(/\/$/,"")||"/";if(!("vimeo.com"===t?/^\/\d+$/.test(n)||/^\/groups\/[^/]+\/videos\/\d+$/.test(n):"player.vimeo.com"===t&&/^\/video\/\d+$/.test(n)))throw Error("Not a valid Vimeo URL");let l=n.split("/").filter(Boolean);return l[l.length-1]},s=e=>{let i=o(e);if(i)return{provider:"youtube",id:i,key:"youtube:".concat(i),embedUrl:"https://www.youtube.com/embed/".concat(i),watchUrl:"https://www.youtube.com/watch?v=".concat(i),aspectRatio:(null==e?void 0:e.includes("/shorts/"))?"9 / 16":"16 / 9"};try{if(!e)return null;let i=a(e);return{provider:"vimeo",id:i,key:"vimeo:".concat(i),embedUrl:"https://player.vimeo.com/video/".concat(i),watchUrl:"https://vimeo.com/".concat(i),aspectRatio:"16 / 9"}}catch(e){return null}},d=e=>{var i,t;return null!==(t=null===(i=s(e))||void 0===i?void 0:i.key)&&void 0!==t?t:null},c=(e,i)=>e?"".concat((0,n.WZ)(e),"/").concat(i):""},88632:function(e,i,t){t.d(i,{WZ:function(){return o},Mz:function(){return r}});var n=t(31114);let l="ugJ0fOrTG3nNE2dXLlmw",r=e=>{if(!e)return"";if(e.id===l)return"https://videotoblog.ai";if(e.customDomain)return"https://".concat(e.customDomain);let i=(0,n.am)((0,n.QT)(e));return"https://".concat(e.subdomain,".").concat(i)},o=e=>{let i=r(e);return i?e.id===l?"".concat(i).concat("/blog"):i:""}}}]);

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.