PageSourceSearch

https://app.tweethunter.io/_next/static/chunks/pages/collaboration-5fdeec9a055c3638.js

js tweethunter.io collected 2026-09-24 09:24:13 UTC 7,200 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d693c9f4-bdb4-4902-9158-1a4e24a0a40e",e._sentryDebugIdIdentifier="sentry-dbid-d693c9f4-bdb4-4902-9158-1a4e24a0a40e")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4412],{18593:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/collaboration",function(){return l(48158)}])},63801:function(e,t,l){"use strict";l.d(t,{M:function(){return S}});var n=l(85893),i=l(67294),o=l(38488),a=l(48633),r=l(69106),s=l(31046),d=l(90038),u=l(83658),c=l(68029),v=l(88329),h=l(57879),f=l(42811),w=l(90092),g=l(15715),b=l(67142),m=l(96885),x=l(25295),p=l(29992),y=l(80961),j=l(6630),_=l(29141),k=l(39180);let S=()=>{var e,t,l,S,I;let{colorMode:C,toggleColorMode:N}=(0,s.If)();(0,m.useRouter)();let[E,U]=(0,a.kP)(),O=(0,p.I)(),[P]=(0,d.a)("(max-width: 600px)"),[G,z]=i.useState(!1),[D,A]=i.useState(""),[R,T]=i.useState([]),{isOpen:M,onOpen:W,onClose:X}=(0,u.q)(),[q,B]=i.useState(!1),[L,Z]=i.useState({}),[F,H]=(0,i.useState)([]),[J,K]=(0,i.useState)([]),[Q,V]=(0,i.useState)([]),[Y,$]=(0,i.useState)([]),[ee,et]=(0,i.useState)([]),[el,en]=(0,i.useState)([]),ei=(0,i.useContext)(_.B1),[eo,ea]=(0,i.useState)(void 0),[er,es]=i.useState([]),[ed,eu]=i.useState([]),ec=async function(){var e,t,l,n,i,o,a,s,d,u,c;B(!0);let v=b.GX.firestore(),h=await v.collectionGroup("tweets").where("ghostwriterId","==",null==E?void 0:null===(e=E.user)||void 0===e?void 0:e.uid).get(),f=h.docs.map(e=>e.data());if((null==E?void 0:null===(n=E.user)||void 0===n?void 0:null===(l=n.data)||void 0===l?void 0:null===(t=l.subscription)||void 0===t?void 0:t.org)&&(null==E?void 0:null===(a=E.user)||void 0===a?void 0:null===(o=a.data)||void 0===o?void 0:null===(i=o.subscription)||void 0===i?void 0:i.orgRole)!=="Member"){let e=await v.collectionGroup("tweets").where("ghostwriterIdOrg","==",null==E?void 0:null===(c=E.user)||void 0===c?void 0:null===(u=c.data)||void 0===u?void 0:null===(d=u.subscription)||void 0===d?void 0:d.org).get(),t=e.docs.map(e=>e.data());f=f.concat(t)}console.log("tweets:",f),(f=(0,r.R1)(f,"id")).forEach(e=>{"rejected"===e.statusGhost?e.priority=3:"pending"===e.statusGhost?e.priority=1:"done"===e.statusGhost?e.priority=0:e.priority=2}),(null===(s=f=f.sort((e,t)=>t.priority-e.priority))||void 0===s?void 0:s.length)&&(et(f),ev(f)),B(!1)},ev=function(e){let t=e;(null==eo?void 0:eo.id)&&(t=e.filter(e=>e.idAccount==eo.id)),en(t)},eh=async()=>{var e,t,l;console.log("getContracts");let n=await (0,k.Wq)(E,"ghostwriter"),i=null!==(l=null==E?void 0:null===(t=E.user)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.linkAccounts)&&void 0!==l?l:[];n.forEach(e=>{i.push(e.client)}),i=(0,r.R1)(i,"id"),es(n),eu(i)};(0,i.useEffect)(()=>{if(O){var e,t,l;eu(null!==(l=null==E?void 0:null===(t=E.user)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.linkAccounts)&&void 0!==l?l:[]),ec(),eh()}},[O,ei.refresh]),(0,i.useEffect)(()=>{ev(ee)},[eo]);let ef=null==er?void 0:er.find(e=>{var t;return(null==e?void 0:null===(t=e.client)||void 0===t?void 0:t.id)==(null==eo?void 0:eo.id)&&"running"==e.status});return(0,n.jsxs)(c.x,{children:[((null==E?void 0:null===(t=E.user)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.ghostwriterData)||(null==E?void 0:null===(S=E.user)||void 0===S?void 0:null===(l=S.data)||void 0===l?void 0:l.isBeta))&&(0,n.jsx)(v.k,{justifyContent:"flex-end",alignItems:"center",w:"100%",mt:"0",pb:0,children:(0,n.jsx)(v.k,{children:(0,n.jsx)(o.z,{variant:"outline",colorScheme:"neutral",as:h.r,href:"/ghostwriter",children:"Ghostwriting Settings (beta)"})})}),(null==ee?void 0:ee.length)>0&&(0,n.jsxs)(v.k,{justifyContent:"space-between",alignItems:"center",w:"100%",mt:"4",pb:4,children:[(0,n.jsxs)(v.k,{children:[(0,n.jsx)(c.x,{mr:3,minW:"180px",children:(0,n.jsx)(x.P,{options:[{label:"All clients",value:"__all__",data:{}},...(ed||[]).map(e=>({label:"@".concat(e.twUserName),value:e.id||e.twUserName,data:e}))],value:(null==eo?void 0:eo.twUserName)?{label:"@".concat(eo.twUserName),value:eo.id||eo.twUserName,data:eo}:{label:"All clients",value:"__all__",data:{}},onChange:e=>e&&ea(e.data),isSearchable:!1,size:"sm",formatOptionLabel:e=>{var t,l,i;return(0,n.jsxs)(v.k,{alignItems:"center",children:[(null===(t=e.data)||void 0===t?void 0:t.twUserName)&&(0,n.jsx)(f.E,{src:null!==(I=null===(l=e.data)||void 0===l?void 0:l.image)&&void 0!==I?I:"/assets/resources/emptyProfile.png",w:"6",h:"6",rounded:"full"}),(0,n.jsx)(w.x,{noOfLines:1,wordBreak:"break-all",ml:(null===(i=e.data)||void 0===i?void 0:i.twUserName)?2:0,children:e.label})]})}})}),!!ef&&(0,n.jsx)(o.z,{as:"a",href:"/ghostwriter?tab=My+contracts",variant:"outline",colorScheme:"neutral",children:"Contract"}),!!(null==ef?void 0:ef.contentPlanUrl)&&(0,n.jsx)(o.z,{as:"a",ml:2,href:null==ef?void 0:ef.contentPlanUrl,target:"_blank",variant:"outline",colorScheme:"neutral",children:"Content Plan"})]}
1),(0,n.jsx)(v.k,{children:(null==eo?void 0:eo.id)&&(0,n.jsxs)(o.z,{variant:"text",color:"neutral.content",fontWeight:400,as:"a",target:"_blank",href:"https://tweethunter.io/write?handle="+(null==eo?void 0:eo.twUserName),children:["+ write for @",null==eo?void 0:eo.twUserName]})})]}),(null==el?void 0:el.length)>0&&(0,n.jsx)(v.k,{flexDir:"column",children:el.map(e=>(0,n.jsx)(y.S,{type:"ghost",tweet:e,isGhostwriter:!0,disableIcon:!0,disableGhostInfo:!0},e.id))}),q?(0,n.jsx)(g.M,{pt:20,w:"100%",children:(0,n.jsx)(j.r,{loading:!0,css:"display: block; margin: 0 auto; border-color: red;",size:50})}):(null==el?void 0:el.length)==0&&(0,n.jsx)(w.x,{mt:20,textStyle:"body.medium",color:"neutral.content-strong",children:"Ask your clients to give you their personal link to start writing for them"})]})}},48158:function(e,t,l){"use strict";l.a(e,async function(e,n){try{l.r(t),l.d(t,{Collaboration:function(){return p}});var i=l(85893),o=l(95478),a=l(59342),r=l(90573),s=l(68029),d=l(67294),u=l(48633),c=l(493),v=l(96885),h=l(1467),f=l(29992),w=l(81293),g=l(63801),b=l(85551),m=e([h]);h=(m.then?(await m)():m)[0];let x=["client","ghostwriter"],p=e=>{let{query:t}=e,[l,n]=(0,u.kP)(),m=(0,v.useRouter)(),[p,y]=d.useState(0);return((0,f.I)(),(0,d.useEffect)(()=>{let e=x.indexOf(t.tab);-1!==e&&y(e)},[t.tab]),n||l)?(0,i.jsx)(h.T,{title:"Collaboration",description:"Check, review and validate content that your collaborators have written for you.",contentOnRightOfTitle:(0,i.jsx)(o.m,{variant:"secondary",size:"sm",index:p,onChange:e=>{y(e),m.push({pathname:"/collaboration",query:{tab:x[e]}},void 0,{shallow:!1}),(0,b._m)("collaboration_last_mode",x[e])},ml:"sm-8",children:(0,i.jsxs)(a.t,{children:[(0,i.jsx)(r.O,{children:"Writer mode"}),(0,i.jsx)(r.O,{children:"Client mode"})]})}),children:(0,i.jsxs)(s.x,{mb:"xl-20",mt:"sm-8",children:[1===p&&(0,i.jsx)(w.XD,{isSelected:!0}),0===p&&(0,i.jsx)(g.M,{})]})}):(0,i.jsx)(c.Z,{})};p.getInitialProps=async e=>{let{query:t}=e;return{query:t}},t.default=p,n()}catch(e){n(e)}})}},function(e){e.O(0,[4980,1778,2618,6765,1467,2439,9774,2888,179],function(){return e(e.s=18593)}),_N_E=e.O()}]);

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