PageSourceSearch

https://contently.com/tev2/static/js/4806.9d356625.chunk.js

js contently.com collected 2026-09-24 08:31:46 UTC 123,098 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkplatform_web=self.webpackChunkplatform_web||[]).push([[4806],{94450:function(n,e,t){t.d(e,{cX:function(){return f}});var r,i,o=t(30168),a=t(37762),c=t(93433),l=t(29439),s=t(50390),d=t(96692),u=t(35640),p=t(65700),x=t(97356),h=(t(62559),["MMM d, yyyy 'at' h:mmaaa","yyyy-MM-dd HH:mm:ss","MM/dd/yyyy","yyyy-MM-dd","MMM d, yyyy"]);function f(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"",direction:null},t=(0,s.useState)(e),r=(0,l.Z)(t,2),i=r[0],o=r[1],a=(0,s.useMemo)((function(){return i.key&&i.direction?(0,c.Z)(n).sort((function(n,e){var t=b(n,i.key),r=b(e,i.key);if(null==t&&null==r)return 0;if(null==t)return"asc"===i.direction?-1:1;if(null==r)return"asc"===i.direction?1:-1;if("number"===typeof t&&"number"===typeof r)return"asc"===i.direction?t-r:r-t;if("string"===typeof t&&"string"===typeof r){var o=/^-?\d+(\.\d+)?$/;if(o.test(t.trim())&&o.test(r.trim())){var a=parseFloat(t),c=parseFloat(r);return"asc"===i.direction?a-c:c-a}}if(t instanceof Date&&r instanceof Date)return"asc"===i.direction?t.getTime()-r.getTime():r.getTime()-t.getTime();var l=g(t),s=g(r);if(l&&s)return"asc"===i.direction?l.getTime()-s.getTime():s.getTime()-l.getTime();var d=String(t).toLowerCase(),u=String(r).toLowerCase();return d<u?"asc"===i.direction?-1:1:d>u?"asc"===i.direction?1:-1:0})):n}),[n,i]),d=(0,s.useCallback)((function(n){o((function(e){if(e.key===n){if("asc"===e.direction)return{key:n,direction:"desc"};if("desc"===e.direction)return{key:"",direction:null}}return{key:n,direction:"asc"}}))}),[]),u=(0,s.useCallback)((function(n){return i.key===n?i.direction:null}),[i]);return{sortedData:a,sortConfig:i,requestSort:d,getSortDirection:u}}function b(n,e){return e.split(".").reduce((function(n,e){return null===n||void 0===n?void 0:n[e]}),n)}function g(n){if("string"!==typeof n||!n.trim())return null;var e=(0,u.D)(n);if((0,p.J)(e))return e;var t,r=(0,a.Z)(h);try{for(r.s();!(t=r.n()).done;){var i=t.value;try{var o=(0,x.Qc)(n,i,new Date);if((0,p.J)(o))return o}catch(c){}}}catch(l){r.e(l)}finally{r.f()}return null}d.ZP.th(r||(r=(0,o.Z)(["\n  text-align: left;\n  padding: 12px 16px;\n  background: #f8f9fa;\n  font-size: 11px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: ",";\n  border-bottom: 1px solid #e9ecef;\n  cursor: ",";\n  user-select: none;\n  white-space: nowrap;\n  \n  &:hover {\n    ","\n  }\n"])),(function(n){return n.$sorted?"#00a6c2":"#666"}),(function(n){return n.$sortable?"pointer":"default"}),(function(n){return n.$sortable&&"\n      background: #f0f0f0;\n      color: #00a6c2;\n    "})),d.ZP.span(i||(i=(0,o.Z)(["\n  margin-left: 4px;\n  display: inline-block;\n  \n  &::after {\n    content: '","';\n    font-size: 12px;\n  }\n"])),(function(n){var e=n.$direction;return"asc"===e?"\u2193":"desc"===e?"\u2191":""}))},64806:function(n,e,t){t.r(e),t.d(e,{AdminAddRecommendedContributorPage:function(){return Nc},AdminPublicationBulkStoryTaggingPage:function(){return Bo},AdminPublicationEditPage:function(){return St},AdminPublicationFixedArrCreditsPage:function(){return lo},AdminPublicationTalentRequestShowPage:function(){return bc},AdminPublicationTalentRequestsPage:function(){return wa},AdminPublicationTransactionsPage:function(){return xi},AdminPublicationUsersPage:function(){return kr},AdminPublicationsPage:function(){return Qn}});var r,i,o,a,c,l,s,d,u,p,x,h,f,b,g,m,v,j,Z,y,k,P=t(37762),w=t(74165),C=t(15861),_=t(29439),S=t(30168),$=t(50390),T=t(75400),z=t(15545),I=t(96692),q=t(32804),R=t(88410),U=t(41354),A=t(94450),D=t(91966),F=t(62559),N=I.ZP.div(r||(r=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin-bottom: 24px;\n"]))),E=I.ZP.h1(i||(i=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),M=(0,I.ZP)(T.rU)(o||(o=(0,S.Z)(["\n  padding: 10px 20px;\n  background: #6b7280;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  font-size: 14px;\n  text-decoration: none;\n  &:hover { background: #4b5563; color: white; }\n"]))),L=I.ZP.div(a||(a=(0,S.Z)(["\n  display: flex;\n  gap: 8px;\n  margin-bottom: 24px;\n  position: relative;\n"]))),O=I.ZP.div(c||(c=(0,S.Z)(["\n  position: relative;\n  flex: 1;\n  max-width: 400px;\n"]))),H=I.ZP.input(l||(l=(0,S.Z)(["\n  width: 100%;\n  padding: 10px 14px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n  background: white;\n  box-sizing: border-box;\n  &:focus { outline: none; border-color: #00a6c2; }\n  &::placeholder { color: #9ca3af; }\n"]))),B=I.ZP.div(s||(s=(0,S.Z)(["\n  position: absolute;\n  top: 100%;\n  left: 0;\n  right: 0;\n  background: white;\n  border: 1px solid #d1d5db;\n  border-top: none;\n  border-radius: 0 0 4px 4px;\n  max-height: 300px;\n  overflow-y: auto;\n  z-index: 100;\n  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n"]))),G=I.ZP.div(d||(d=(0,S.Z)(["\n  padding: 10px 14px;\n  cursor: pointer;\n  font-size: 14px;\n  background: ",";\n  &:hover { background: #f3f4f6; }\n"])),(function(n){return n.$highlighted?"#f3f4f6":"white"})),X=I.ZP.button(u||(u=(0,S.Z)(["\n  padding: 10px 24px;\n  background: #00a6c2;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  font-size: 14px;\n  cursor: pointer;\n  &:hover { background: #0094ab; }\n"]))),K=I.ZP.table(p||(p=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;\n  background: white;\n  border: 1px solid #e5e7eb;
1\n"]))),V=I.ZP.th(x||(x=(0,S.Z)(["\n  text-align: left;\n  padding: 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: ",";\n  border-bottom: 2px solid #e5e7eb;\n  background: #f9fafb;\n  cursor: ",";\n  user-select: none;\n  white-space: nowrap;\n  \n  &:hover {\n    ","\n  }\n"])),(function(n){return n.$sorted?"#00a6c2":"#374151"}),(function(n){return n.$sortable?"pointer":"default"}),(function(n){return n.$sortable&&"\n      background: #f0f0f0;\n      color: #00a6c2;\n    "})),W=I.ZP.span(h||(h=(0,S.Z)(["\n  margin-left: 4px;\n  \n  &::after {\n    content: '","';\n  }\n"])),(function(n){var e=n.$direction;return"asc"===e?"\u2193":"desc"===e?"\u2191":""})),Q=I.ZP.td(f||(f=(0,S.Z)(["\n  padding: 12px;\n  font-size: 14px;\n  color: #374151;\n  border-bottom: 1px solid #e5e7eb;\n  vertical-align: middle;\n"]))),Y=I.ZP.div(b||(b=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 12px;\n"]))),J=I.ZP.img(g||(g=(0,S.Z)(["\n  width: 40px;\n  height: 40px;\n  border-radius: 4px;\n  object-fit: cover;\n"]))),nn=I.ZP.div(m||(m=(0,S.Z)(["\n  width: 40px;\n  height: 40px;\n  border-radius: 4px;\n  background: #e5e7eb;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: #9ca3af;\n  font-size: 12px;\n"]))),en=I.ZP.div(v||(v=(0,S.Z)(["\n  a { color: #d97706; text-decoration: none; font-weight: 500; &:hover { text-decoration: underline; } }\n  small { display: block; color: #6b7280; font-size: 12px; }\n"]))),tn=(0,I.ZP)(T.rU)(j||(j=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  &:hover { text-decoration: underline; }\n"]))),rn=I.ZP.div(Z||(Z=(0,S.Z)(["\n  display: flex;\n  justify-content: flex-end;\n  align-items: center;\n  gap: 4px;\n  margin-top: 24px;\n"]))),on=I.ZP.button(y||(y=(0,S.Z)(["\n  padding: 6px 12px;\n  border: 1px solid ",";\n  background: ",";\n  color: ",";\n  border-radius: 4px;\n  font-size: 13px;\n  cursor: pointer;\n  &:hover { background: ","; }\n  &:disabled { cursor: not-allowed; opacity: 0.5; }\n"])),(function(n){return n.$active?"#00a6c2":"#d1d5db"}),(function(n){return n.$active?"#00a6c2":"white"}),(function(n){return n.$active?"white":"#374151"}),(function(n){return n.$active?"#0094ab":"#f3f4f6"})),an=I.ZP.div(k||(k=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"])));var cn,ln,sn,dn,un,pn,xn,hn,fn,bn,gn,mn,vn,jn,Zn,yn,kn,Pn,wn,Cn,_n,Sn,$n,Tn,zn,In,qn,Rn,Un,An,Dn,Fn,Nn,En,Mn,Ln,On,Hn,Bn,Gn,Xn,Kn,Vn,Wn,Qn=function(){var n=(0,z.s0)(),e=(0,$.useState)([]),t=(0,_.Z)(e,2),r=t[0],i=t[1],o=(0,$.useState)(!0),a=(0,_.Z)(o,2),c=a[0],l=a[1],s=(0,$.useState)(""),d=(0,_.Z)(s,2),u=d[0],p=d[1],x=(0,$.useState)(1),h=(0,_.Z)(x,2),f=h[0],b=h[1],g=(0,$.useState)(1),m=(0,_.Z)(g,2),v=m[0],j=m[1],Z=(0,D.Q)(),y=Z.setTimezoneFromResponse,k=Z.formatDateTime,S=(0,A.cX)(r,{key:"createdAt",direction:"desc"}),I=S.sortedData,cn=S.requestSort,ln=S.getSortDirection,sn=(0,$.useState)([]),dn=(0,_.Z)(sn,2),un=dn[0],pn=dn[1],xn=(0,$.useState)(!1),hn=(0,_.Z)(xn,2),fn=hn[0],bn=hn[1],gn=(0,$.useState)(-1),mn=(0,_.Z)(gn,2),vn=mn[0],jn=mn[1],Zn=(0,$.useState)(null),yn=(0,_.Z)(Zn,2),kn=yn[0],Pn=yn[1],wn=(0,$.useRef)(null),Cn=(0,$.useRef)(null),_n=(0,$.useCallback)(function(){var n=(0,C.Z)((0,w.Z)().mark((function n(e,t){var r,o,a;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return l(!0),n.prev=1,(r=new URLSearchParams).append("page",e.toString()),r.append("per_page",20..toString()),t&&r.append("id",t.toString()),n.next=8,q.ZP.get("/admin2/publications.json?".concat(r.toString()));case 8:o=n.sent,a=o.data,i(a.publications||[]),j(a.totalPages||Math.ceil((a.total||0)/2
10)||1),y(a),n.next=19;break;case 15:n.prev=15,n.t0=n.catch(1),R.Am.error("Failed to load publications."),i([]);case 19:return n.prev=19,l(!1),n.finish(19);case 22:case"end":return n.stop()}}),n,null,[[1,15,19,22]])})));return function(e,t){return n.apply(this,arguments)}}(),[y]),Sn=(0,$.useCallback)(function(){var n=(0,C.Z)((0,w.Z)().mark((function n(e){var t;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e&&!(e.length<2)){n.next=4;break}return pn([]),bn(!1),n.abrupt("return");case 4:return n.prev=4,n.next=7,q.ZP.get("/admin2/publications/autocomplete.json?query=".concat(encodeURIComponent(e)));case 7:t=n.sent,pn(t.data||[]),bn(!0),jn(-1),n.next=16;break;case 13:n.prev=13,n.t0=n.catch(4),pn([]);case 16:case"end":return n.stop()}}),n,null,[[4,13]])})));return function(e){return n.apply(this,arguments)}}(),[]);(0,$.useEffect)((function(){_n(f)}),[]),(0,$.useEffect)((function(){var n=function(n){wn.current&&!wn.current.contains(n.target)&&bn(!1)};return document.addEventListener("mousedown",n),function(){return document.removeEventListener("mousedown",n)}}),[]);var $n=function(e){p(e.text),Pn(e.id),bn(!1),n("/admin2/publications/".concat(e.id,"/edit"))},Tn=function(n){b(n),_n(n,kn)};return c&&0===r.length?(0,F.jsx)(U.Z,{title:"Publications",pageTitle:"Publications",children:(0,F.jsx)(an,{children:"Loading..."})}):(0,F.jsxs)(U.Z,{title:"Publications",pageTitle:"Publications",children:[(0,F.jsxs)(N,{children:[(0,F.jsx)(E,{children:"Publications"}),(0,F.jsx)(M,{to:"/admin2/publications/new",children:"Create a publication"})]}),(0,F.jsxs)(L,{children:[(0,F.jsxs)(O,{ref:wn,children:[(0,F.jsx)(H,{ref:Cn,type:"text",placeholder:"Publication",value:u,onChange:function(n){var e=n.target.value;p(e),Pn(null),Sn(e)},onKeyDown:function(n){fn&&0!==un.length&&("ArrowDown"===n.key?(n.preventDefault(),jn((function(n){return Math.min(n+1,un.length-1)}))):"ArrowUp"===n.key?(n.preventDefault(),jn((function(n){return Math.max(n-1,0)}))):"Enter"===n.key&&vn>=0?(n.preventDefault(),$n(un[vn])):"Escape"===n.key&&bn(!1))},onFocus:function(){return u.length>=2&&bn(!0)}}),fn&&un.length>0&&(0,F.jsx)(B,{children:un.map((function(n,e){return(0,F.jsx)(G,{$highlighted:e===vn,onClick:function(){return $n(n)},children:n.text},n.id)}))})]}),(0,F.jsx)(X,{onClick:function(){kn?n("/admin2/publications/".concat(kn,"/edit")):(b(1),_n(1))},children:"Go"})]}),(0,F.jsxs)(K,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsxs)(V,{$sortable:!0,$sorted:null!==ln("name"),onClick:function(){return cn("name")},children:["Name ",(0,F.jsx)(W,{$direction:ln("name")}
1)]}),(0,F.jsxs)(V,{$sortable:!0,$sorted:null!==ln("active"),onClick:function(){return cn("active")},children:["Active ",(0,F.jsx)(W,{$direction:ln("active")})]}),(0,F.jsxs)(V,{$sortable:!0,$sorted:null!==ln("internal"),onClick:function(){return cn("internal")},children:["Internal ",(0,F.jsx)(W,{$direction:ln("internal")})]}),(0,F.jsxs)(V,{$sortable:!0,$sorted:null!==ln("billingType"),onClick:function(){return cn("billingType")},children:["Billing Type ",(0,F.jsx)(W,{$direction:ln("billingType")})]}),(0,F.jsxs)(V,{$sortable:!0,$sorted:null!==ln("createdAt"),onClick:function(){return cn("createdAt")},children:["Created at ",(0,F.jsx)(W,{$direction:ln("createdAt")})]})]})}),(0,F.jsx)("tbody",{children:I.map((function(n){return(0,F.jsxs)("tr",{children:[(0,F.jsx)(Q,{children:(0,F.jsxs)(Y,{children:[n.avatarUrl?(0,F.jsx)(J,{src:n.avatarUrl,alt:n.name}):(0,F.jsx)(nn,{children:"\ud83d\udcc4"}),(0,F.jsxs)(en,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(n.id,"/edit"),children:n.name}),(0,F.jsx)("small",{children:n.accountName})]})]})}),(0,F.jsx)(Q,{children:n.active?"true":"false"}),(0,F.jsx)(Q,{children:n.internal?"true":"false"}),(0,F.jsx)(Q,{children:(0,F.jsx)(tn,{to:"/admin2/publications/".concat(n.id,"/edit"),children:n.billingType})}),(0,F.jsx)(Q,{children:k(n.createdAt)})]},n.id)}))})]}),v>1&&(0,F.jsxs)(rn,{children:[function(){var n=[];n.push(1);for(var e=Math.max(2,f-1);e<=Math.min(v-1,f+1);e++)n.includes(e)||n.push(e);v>1&&!n.includes(v)&&n.push(v);var t,r=[],i=0,o=(0,P.Z)(n.sort((function(n,e){return n-e})));try{for(o.s();!(t=o.n()).done;){var a=t.value;a-i>1&&r.push("..."),r.push(a),i=a}}catch(c){o.e(c)}finally{o.f()}return r}().map((function(n,e){return"number"===typeof n?(0,F.jsx)(on,{$active:n===f,onClick:function(){return Tn(n)},children:n},e):(0,F.jsx)("span",{style:{padding:"0 8px",color:"#6b7280"},children:"..."},e)})),(0,F.jsx)(on,{onClick:function(){return Tn(f+1)},disabled:f>=v,children:"\u2192"}),(0,F.jsx)(on,{onClick:function(){return Tn(v)},disabled:f>=v,children:"\u21e5"})]})]})},Yn=t(4942),Jn=t(1413),ne=t(93433),ee=["analytics_return_on_investment","detailed_balance","download_pitches_csv","download_stories_csv","download_story","download_story_activity","overdraft_blocking","standard_roles_only"],te=["analytics_production","content_strategy","content_assist","fields","quick_edit","recommended_contributor","social_posts","story_attributes"],re=["approval_flow","brief_templates","campaign","command_center","content_portal","content_requests","dashboard","dashboard_beta","integrations_aem","media_library","remote_approval","salesforce","user_activity_metrics","seo_story_ideas"],ie=["analytics_performance","analytics_documents","analytics_email","analytics_social_stats","documents"],oe={content_generation:[].concat(ee,te),efficiency:[].concat(ee,te,re),optimization:[].concat(ee,te,re,ie)},ae=["create_talent_request","invite_talent"],ce=["request_more_talent"],le={management:[].concat(ae),placement:[].concat(ae,ce)},se=[].concat(ee,te,re,ie),de=[].concat(ae,ce),ue=I.ZP.div(cn||(cn=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n\n  a {\n    color: #00a6c2;\n    text-decoration: none;\n    &:hover {\n      text-decoration: underline;\n    }\n  }\n"]))),pe=I.ZP.div(ln||(ln=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 24px;\n"]))),xe=I.ZP.h1(sn||(sn=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),he=I.ZP.div(dn||(dn=(0,S.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  text-align: right;\n\n  a {\n    color: #00a6c2;\n    text-decoration: none;\n    font-size: 14px;\n    &:hover {\n      text-decoration: underline;\n    }\n  }\n"]))),fe=I.ZP.div(un||(un=(0,S.Z)(["\n  display: flex;\n  gap: 0;\n  border-bottom: 1px solid #e5e7eb;\n  margin-bottom: 24px;\n"]))),be=(0,I.ZP)(T.rU)(pn||(pn=(0,S.Z)(["\n  padding: 12px 20px;\n  font-size: 14px;\n  font-weight: 500;\n  color: ",";\n  text-decoration: none;\n  border-bottom: 2px solid ",";\n  margin-bottom: -1px;\n  transition: all 0.2s;\n\n  &:hover {\n    color: #00a6c2;\n    background: #f9fafb;\n  }\n"])),(function(n){return n.$active?"#00a6c2":"#6b7280"}),(function(n){return n.$active?"#00a6c2":"transparent"}
1)),ge=I.ZP.div(xn||(xn=(0,S.Z)(["\n  margin-bottom: 32px;\n"]))),me=I.ZP.h2(hn||(hn=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0 0 16px 0;\n"]))),ve=I.ZP.div(fn||(fn=(0,S.Z)(["\n  margin-bottom: 16px;\n"]))),je=(I.ZP.div(bn||(bn=(0,S.Z)(["\n  display: flex;\n  gap: 20px;\n  margin-bottom: 16px;\n\n  @media (max-width: 768px) {\n    flex-direction: column;\n  }\n"]))),I.ZP.div(gn||(gn=(0,S.Z)(["\n  flex: ",";\n  min-width: 0;\n"])),(function(n){return n.$flex||1})),I.ZP.label(mn||(mn=(0,S.Z)(["\n  display: block;\n  font-size: 14px;\n  font-weight: 500;\n  color: #374151;\n  margin-bottom: 6px;\n\n  ","\n"])),(function(n){return n.$required&&"\n    &::after {\n      content: ' *';\n      color: #ef4444;\n    }\n  "}))),Ze=I.ZP.div(vn||(vn=(0,S.Z)(["\n  font-size: 12px;\n  color: #6b7280;\n  margin-bottom: 8px;\n"]))),ye=I.ZP.input(jn||(jn=(0,S.Z)(["\n  width: 100%;\n  padding: 10px 14px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n  box-sizing: border-box;\n\n  &:focus {\n    outline: none;\n    border-color: #00a6c2;\n    box-shadow: 0 0 0 3px rgba(0, 166, 194, 0.1);\n  }\n\n  &:disabled,\n  &[readonly] {\n    background: #f3f4f6;\n    cursor: not-allowed;\n  }\n"]))),ke=I.ZP.select(Zn||(Zn=(0,S.Z)(["\n  width: 100%;\n  padding: 10px 14px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n  background: white;\n  cursor: pointer;\n  box-sizing: border-box;\n\n  &:focus {\n    outline: none;\n    border-color: #00a6c2;\n    box-shadow: 0 0 0 3px rgba(0, 166, 194, 0.1);\n  }\n"]))),Pe=I.ZP.textarea(yn||(yn=(0,S.Z)(["\n  width: 100%;\n  padding: 10px 14px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n  min-height: 100px;\n  resize: vertical;\n  font-family: inherit;\n  box-sizing: border-box;\n\n  &:focus {\n    outline: none;\n    border-color: #00a6c2;\n    box-shadow: 0 0 0 3px rgba(0, 166, 194, 0.1);\n  }\n"]))),we=I.ZP.input(kn||(kn=(0,S.Z)(["\n  width: 16px;\n  height: 16px;\n  margin-right: 8px;\n  cursor: pointer;\n"]))),Ce=I.ZP.label(Pn||(Pn=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  color: #374151;\n  cursor: pointer;\n  padding: 6px 0;\n\n  &:hover {\n    color: #111827;\n  }\n"]))),_e=I.ZP.div(wn||(wn=(0,S.Z)(["\n  display: flex;\n  gap: 24px;\n"]))),Se=I.ZP.label(Cn||(Cn=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  font-size: 14px;\n  color: #374151;\n  cursor: pointer;\n  gap: 6px;\n"]))),$e=I.ZP.div(_n||(_n=(0,S.Z)(["\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 8px;\n\n  @media (max-width: 1024px) {\n    grid-template-columns: repeat(2, 1fr);\n  }\n\n  @media (max-width: 600px) {\n    grid-template-columns: 1fr;\n  }\n"]))),Te=I.ZP.label(Sn||(Sn=(0,S.Z)(["\n  display: flex;\n  align-items: flex-start;\n  font-size: 13px;\n  color: #374151;\n  cursor: pointer;\n  padding: 4px 0;\n\n  input {\n    margin-top: 2px;\n  }\n\n  &:hover {\n    color: #111827;\n  }\n"]))),ze=I.ZP.span($n||($n=(0,S.Z)(["\n  color: #9ca3af;\n  margin-left: 4px;\n  cursor: help;\n"]))),Ie=I.ZP.div(Tn||(Tn=(0,S.Z)(["\n  display: flex;\n  justify-content: flex-start;\n  gap: 12px;\n  margin-top: 24px;\n"]))),qe=I.ZP.button(zn||(zn=(0,S.Z)(["\n  padding: 10px 20px;\n  border: none;\n  border-radius: 4px;\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n\n  ","\n\n  &:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n  }\n"])),(function(n){var e=n.$variant;return"primary"===(void 0===e?"secondary":e)?"background: #00a6c2; color: white; &:hover { background: #0094ab; }":"background: #e5e7eb; color: #374151; &:hover { background: #d1d5db; }"})),Re=I.ZP.div(In||(In=(0,S.Z)(["\n  position: fixed;\n  bottom: 24px;\n  right: 24px;\n  padding: 12px 20px;\n  border-radius: 8px;\n  font-size: 14px;\n  font-weight: 500;\n  z-index: 1000;\n  animation: slideIn 0.3s ease;\n\n  ","\n\n  @keyframes slideIn {\n    from {\n      transform: translateX(100%);\n      opacity: 0;\n    }\n    to {\n      transform: translateX(0);\n      opacity: 1;\n    }\n  }\n"])),(function(n){return"success"===n.$type?"background: #10b981; color: white;":"background: #ef4444; color: white;"})),Ue=I.ZP.div(qn||(qn=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),Ae=I.ZP.div(Rn||(Rn=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #ef4444;
1\n"]))),De=I.ZP.div(Un||(Un=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 16px;\n\n  img {\n    width: 64px;\n    height: 64px;\n    border-radius: 4px;\n    object-fit: cover;\n    border: 1px solid #e5e7eb;\n  }\n"]))),Fe=I.ZP.div(An||(An=(0,S.Z)(["\n  padding: 10px 14px;\n  background: #f9fafb;\n  border: 1px solid #e5e7eb;\n  border-radius: 4px;\n  font-size: 14px;\n\n  a {\n    color: #00a6c2;\n    text-decoration: none;\n    &:hover {\n      text-decoration: underline;\n    }\n  }\n"]))),Ne=I.ZP.div(Dn||(Dn=(0,S.Z)(["\n  position: relative;\n  width: 100%;\n"]))),Ee=I.ZP.div(Fn||(Fn=(0,S.Z)(["\n  position: absolute;\n  top: 100%;\n  left: 0;\n  right: 0;\n  background: white;\n  border: 1px solid #d1d5db;\n  border-top: none;\n  border-radius: 0 0 4px 4px;\n  max-height: 300px;\n  overflow-y: auto;\n  z-index: 1000;\n  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n"]))),Me=I.ZP.div(Nn||(Nn=(0,S.Z)(["\n  padding: 10px 14px;\n  cursor: pointer;\n  font-size: 14px;\n  color: #111827;\n  background: ",";\n\n  &:hover {\n    background: #f3f4f6;\n  }\n"])),(function(n){return n.$isHighlighted?"#f3f4f6":"white"})),Le=I.ZP.div(En||(En=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 14px;\n  cursor: pointer;\n  background: ",";\n\n  &:hover {\n    background: #f3f4f6;\n  }\n"])),(function(n){return n.$isHighlighted?"#f3f4f6":"white"})),Oe=I.ZP.img(Mn||(Mn=(0,S.Z)(["\n  width: 36px;\n  height: 36px;\n  border-radius: 50%;\n  object-fit: cover;\n  background: #e5e7eb;\n"]))),He=I.ZP.div(Ln||(Ln=(0,S.Z)(["\n  flex: 1;\n  min-width: 0;\n"]))),Be=I.ZP.div(On||(On=(0,S.Z)(["\n  font-size: 14px;\n  font-weight: 500;\n  color: #111827;\n"]))),Ge=I.ZP.div(Hn||(Hn=(0,S.Z)(["\n  font-size: 13px;\n  color: #6b7280;\n"]))),Xe=I.ZP.div(Bn||(Bn=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 8px 12px;\n  background: #f3f4f6;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  width: 100%;\n  box-sizing: border-box;\n"]))),Ke=I.ZP.span(Gn||(Gn=(0,S.Z)(["\n  flex: 1;\n  font-size: 14px;\n  color: #111827;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n"]))),Ve=I.ZP.button(Xn||(Xn=(0,S.Z)(["\n  background: none;\n  border: none;\n  color: #6b7280;\n  cursor: pointer;\n  padding: 4px;\n  font-size: 18px;\n  line-height: 1;\n\n  &:hover {\n    color: #111827;\n  }\n"]))),We=I.ZP.input(Kn||(Kn=(0,S.Z)(["\n  width: 100%;\n  padding: 8px 12px;\n  border: none;\n  border-bottom: 1px solid #d1d5db;\n  font-size: 14px;\n  box-sizing: border-box;\n  &:focus {\n    outline: none;\n  }\n"]))),Qe=I.ZP.div(Vn||(Vn=(0,S.Z)(["\n  padding: 10px 14px;\n  font-size: 13px;\n  color: #6b7280;\n  text-align: center;
1\n"]))),Ye=I.ZP.span(Wn||(Wn=(0,S.Z)(["\n  color: #9ca3af;\n  margin-left: 4px;\n  cursor: help;\n  font-size: 12px;\n"])));var Je,nt,et,tt,rt,it,ot,at,ct,lt,st,dt,ut,pt,xt,ht,ft,bt,gt,mt,vt,jt,Zt,yt,kt,Pt,wt,Ct,_t,St=function(){var n,e=(0,z.UO)().id,t=(0,z.s0)(),r=(0,z.TH)(),i=(0,$.useState)(null),o=(0,_.Z)(i,2),a=o[0],c=o[1],l=!e||r.pathname.includes("/new"),s=(0,$.useState)(null),d=(0,_.Z)(s,2),u=d[0],p=d[1],x=(0,$.useState)(null),h=(0,_.Z)(x,2),f=h[0],b=h[1],g=(0,$.useState)({}),m=(0,_.Z)(g,2),v=m[0],j=m[1],Z=(0,$.useState)(!0),y=(0,_.Z)(Z,2),k=y[0],P=y[1],S=(0,$.useState)(null),I=(0,_.Z)(S,2),R=I[0],A=I[1],D=(0,$.useState)(!1),N=(0,_.Z)(D,2),E=N[0],M=N[1],L=(0,$.useState)(null),O=(0,_.Z)(L,2),H=O[0],B=O[1],G=(0,$.useState)(null),X=(0,_.Z)(G,2),K=X[0],V=X[1],W=(0,$.useState)(""),Q=(0,_.Z)(W,2),Y=Q[0],J=Q[1],nn=(0,$.useState)([]),en=(0,_.Z)(nn,2),tn=en[0],rn=en[1],on=(0,$.useState)(null),an=(0,_.Z)(on,2),cn=an[0],ln=an[1],sn=(0,$.useState)(!1),dn=(0,_.Z)(sn,2),un=dn[0],pn=dn[1],xn=(0,$.useState)(-1),hn=(0,_.Z)(xn,2),fn=hn[0],bn=hn[1],gn=(0,$.useRef)(null),mn=(0,$.useRef)(null),vn=(0,$.useState)(""),jn=(0,_.Z)(vn,2),Zn=jn[0],yn=jn[1],kn=(0,$.useState)([]),Pn=(0,_.Z)(kn,2),wn=Pn[0],Cn=Pn[1],_n=(0,$.useState)(null),Sn=(0,_.Z)(_n,2),$n=Sn[0],Tn=Sn[1],zn=(0,$.useState)(!1),In=(0,_.Z)(zn,2),qn=In[0],Rn=In[1],Un=(0,$.useState)(-1),An=(0,_.Z)(Un,2),Dn=An[0],Fn=An[1],Nn=(0,$.useRef)(null),En=(0,$.useRef)(null),Mn=(0,$.useState)(""),Ln=(0,_.Z)(Mn,2),On=Ln[0],Hn=Ln[1],Bn=(0,$.useState)([]),Gn=(0,_.Z)(Bn,2),Xn=Gn[0],Kn=Gn[1],Vn=(0,$.useState)(!1),Wn=(0,_.Z)(Vn,2),Qn=Wn[0],ee=Wn[1],te=(0,$.useState)(-1),re=(0,_.Z)(te,2),ie=re[0],ae=re[1],ce=(0,$.useRef)(null),Je=(0,$.useCallback)(function(){var n=(0,C.Z)((0,w.Z)().mark((function n(e){var t,r,i,o;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,q.ZP.get("/admin2/publications/".concat(e,".json"));case 3:t=n.sent,p(t.data.publication),b(t.data.options),t.data.publication.contentlyEditorId&&t.data.publication.contentlyEditorName&&Tn({id:t.data.publication.contentlyEditorId,name:t.data.publication.contentlyEditorName,email:"",avatar_url:"",text:t.data.publication.contentlyEditorName}),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(0),A((null===(r=n.t0.response)||void 0===r||null===(i=r.data)||void 0===i||null===(o=i.errors)||void 0===o?void 0:o.join(", "))||"Failed to load publication");case 12:return n.prev=12,P(!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,9,12,15]])})));return function(e){return n.apply(this,arguments)}}(),[]),nt=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function n(){var e,t,r,i,o,a,c,l,s,d,u,p;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,q.ZP.get("/admin2/publications/new.json");case 3:l=n.sent,b(l.data.options),s=l.data.publication,j({name:s.name||"",salesforceId:s.salesforceId||"",active:null===(e=s.active)||void 0===e||e,internal:null!==(t=s.internal)&&void 0!==t&&t,billingType:s.billingType||"",contentCommit:null!==(r=s.contentCommit)&&void 0!==r&&r,perPieceManagementFeePercentage:null!==(i=s.perPieceManagementFeePercentage)&&void 0!==i?i:20,fixedManagementFeeInDollars:null!==(o=s.fixedManagementFeeInDollars)&&void 0!==o?o:0,purchaseOrderNumber:s.purchaseOrderNumber||"",billingContacts:s.billingContacts||"",editorialRateInDollars:null!==(a=s.editorialRateInDollars)&&void 0!==a?a:0,editorialHours:null!==(c=s.editorialHours)&&void 0!==c?c:0,contentlyEditorId:s.contentlyEditorId||null,nonCompeteAccountIds:s.nonCompeteAccountIds||[],package:s.package||"",servicesPackage:s.servicesPackage||"",featureIds:s.featureIds||[],siteUrl:s.siteUrl||"",documentSubdomain:s.documentSubdomain||"",marketoClientId:s.marketoClientId||"",marketoClientSecret:s.marketoClientSecret||"",marketoHost:s.marketoHost||"",currentContentStrategyId:s.currentContentStrategyId||null,contentStrategyId:s.currentContentStrategyId||null,details:s.details||"",qualityControlCriteria:s.qualityControlCriteria||""}),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(0),A((null===(d=n.t0.response)||void 0===d||null===(u=d.data)||void 0===u||null===(p=u.errors)||void 0===p?void 0:p.join(", "))||"Failed to load form options");case 12:return n.prev=12,P(!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,9,12,15]])}))),[]);(0,$.useEffect)((function(){l?nt():e&&Je(e)}
1),[e,l,Je,nt]),(0,$.useEffect)((function(){u&&!l&&j({name:u.name||"",salesforceId:u.salesforceId||"",active:u.active,internal:u.internal,billingType:u.billingType||"",contentCommit:u.contentCommit||!1,perPieceManagementFeePercentage:u.perPieceManagementFeePercentage||20,fixedManagementFeeInDollars:u.fixedManagementFeeInDollars||0,purchaseOrderNumber:u.purchaseOrderNumber||"",billingContacts:u.billingContacts||"",editorialRateInDollars:u.editorialRateInDollars||0,editorialHours:u.editorialHours||0,contentlyEditorId:u.contentlyEditorId||null,nonCompeteAccountIds:u.nonCompeteAccountIds||[],package:u.package||"",servicesPackage:u.servicesPackage||"",featureIds:u.featureIds||[],siteUrl:u.siteUrl||"",documentSubdomain:u.documentSubdomain||"",marketoClientId:u.marketoClientId||"",marketoClientSecret:u.marketoClientSecret||"",marketoHost:u.marketoHost||"",currentContentStrategyId:u.currentContentStrategyId||null,details:u.details||"",qualityControlCriteria:u.qualityControlCriteria||""})}),[u,l]),(0,$.useEffect)((function(){var n=function(n){mn.current&&!mn.current.contains(n.target)&&pn(!1),En.current&&!En.current.contains(n.target)&&Rn(!1),ce.current&&!ce.current.contains(n.target)&&ee(!1)};return document.addEventListener("mousedown",n),function(){return document.removeEventListener("mousedown",n)}}),[]);var et=function(n,e){c({message:n,type:e}),setTimeout((function(){return c(null)}),4e3)},tt=(0,$.useMemo)((function(){return null!==f&&void 0!==f&&f.features?new Map(f.features.map((function(n){return[n.name,n.id]}))):new Map}),[null===f||void 0===f?void 0:f.features]),rt=(0,$.useCallback)((function(n){return n.map((function(n){return tt.get(n)})).filter((function(n){return void 0!==n}))}),[tt]),it=(0,$.useCallback)((function(n,e){var t=v.featureIds||[],r=(0,ne.Z)(t);if("package"===n){var i=rt(se);if(r=r.filter((function(n){return!i.includes(n)})),e&&oe[e]){var o=rt(oe[e]);r=(0,ne.Z)(new Set([].concat((0,ne.Z)(r),(0,ne.Z)(o))))}}else{var a=rt(de);if(r=r.filter((function(n){return!a.includes(n)})),e&&le[e]){var c=rt(le[e]);r=(0,ne.Z)(new Set([].concat((0,ne.Z)(r),(0,ne.Z)(c))))}}j((function(t){var i;return(0,Jn.Z)((0,Jn.Z)({},t),{},(i={},(0,Yn.Z)(i,n,e),(0,Yn.Z)(i,"featureIds",r),i))}))}),[v.featureIds,rt]),ot=function(n,e){"package"!==n&&"servicesPackage"!==n?j((function(t){return(0,Jn.Z)((0,Jn.Z)({},t),{},(0,Yn.Z)({},n,e))})):it(n,e)},at=(0,$.useCallback)(function(){var n=(0,C.Z)((0,w.Z)().mark((function n(e){var t;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(e.length<2)){n.next=4;break}return rn([]),bn(-1),n.abrupt("return");case 4:return n.prev=4,n.next=7,q.ZP.get("/admin2/accounts/autocomplete.json",{params:{query:e}});case 7:t=n.sent,rn(t.data||[]),bn(-1),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(4),console.error("Organization autocomplete search failed:",n.t0),rn([]);case 16:case"end":return n.stop()}}),n,null,[[4,12]])})));return function(e){return n.apply(this,arguments)}}(),[]),ct=function(n){ln(n),J(""),pn(!1),rn([])},lt=(0,$.useCallback)(function(){var n=(0,C.Z)((0,w.Z)().mark((function n(e){var t;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(e.length<2)){n.next=4;break}return Cn([]),Fn(-1),n.abrupt("return");case 4:return n.prev=4,n.next=7,q.ZP.get("/admin2/users/autocomplete.json",{params:{query:e}});case 7:t=n.sent,Cn(t.data||[]),Fn(-1),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(4),console.error("Editor autocomplete search failed:",n.t0),Cn([]);case 16:case"end":return n.stop()}}),n,null,[[4,12]])})));return function(e){return n.apply(this,arguments)}}(),[]),st=function(n){Tn(n),yn(""),Rn(!1),Cn([]),j((function(e){return(0,Jn.Z)((0,Jn.Z)({},e),{},{contentlyEditorId:n.id})}))},dt=function(n){Hn(n);var e=(null===f||void 0===f?void 0:f.contentStrategies)||[];0===n.length?Kn(e):Kn(e.filter((function(e){return e.label.toLowerCase().includes(n.toLowerCase())}))),ae(-1)},ut=function(n){ot("currentContentStrategyId",n.id),Hn(""),ee(!1),Kn([])},pt=function(){var n=(0,C.Z)((0,w.Z)().mark((function n(){var r,i,o,a,c,s,d,u,x,h,f,b;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!l){n.next=13;break}if(null!==(r=v.name)&&void 0!==r&&r.trim()){n.next=4;break}return et("Name is required","error"),n.abrupt("return");case 4:if(cn){n.next=7;break}return et("Organization is required","error"),n.abrupt("return");case 7:if(v.internal||null!==(i=v.salesforceId)&&void 0!==i&&i.trim()){n.next=10;break}return et("Salesforce Group ID is required for non-internal publications","error"),n.abrupt("return");case 10:if(v.billingType){n.next=13;break}return et("Billing type is required","error"),n.abrupt("return");case 13:if(M(!0),n.prev=14,a={brand_profile:(0,Jn.Z)((0,Jn.Z)({name:v.name,salesforce_id:v.salesforceId,active:v.active,internal:v.internal,billing_type:v.billingType,content_commit:v.contentCommit,per_piece_management_fee_percentage:v.perPieceManagementFeePercentage,fixed_management_fee_in_dollars:v.fixedManagementFeeInDollars,purchase_order_number:v.purchaseOrderNumber,billing_contacts:v.b
1illingContacts,editorial_rate_in_dollars:v.editorialRateInDollars,editorial_hours:v.editorialHours,contently_editor_id:v.contentlyEditorId,package:v.package,services_package:v.servicesPackage,feature_ids:v.featureIds,site_url:v.siteUrl,document_subdomain:v.documentSubdomain,marketo_client_id:v.marketoClientId,marketo_client_secret:v.marketoClientSecret,marketo_host:v.marketoHost,current_content_strategy_id:v.currentContentStrategyId},l?{content_strategy:v.contentStrategyId}:{}),{},{details:v.details,quality_control_criteria:v.qualityControlCriteria,non_competes_attributes:{account_ids:v.nonCompeteAccountIds||[]}},l&&cn?{account_id:cn.id}:{})},s=function(){var n=new FormData;return n.append("brand_profile[avatar]",H),Object.entries(a.brand_profile).forEach((function(e){var t=(0,_.Z)(e,2),r=t[0],i=t[1];if("feature_ids"===r&&Array.isArray(i))i.forEach((function(e){return n.append("brand_profile[feature_ids][]",String(e))}));else if("non_competes_attributes"===r){((null===i||void 0===i?void 0:i.account_ids)||[]).forEach((function(e){return n.append("brand_profile[non_competes_attributes][account_ids][]",String(e))}))}else void 0!==i&&null!==i&&n.append("brand_profile[".concat(r,"]"),String(i))})),n},!l){n.next=29;break}if(!H){n.next=24;break}return n.next=21,q.ZP.post("/admin2/publications.json",s(),{headers:{"Content-Type":"multipart/form-data"}});case 21:c=n.sent,n.next=27;break;case 24:return n.next=26,q.ZP.post("/admin2/publications.json",a);case 26:c=n.sent;case 27:n.next=38;break;case 29:if(!H){n.next=35;break}return n.next=32,q.ZP.put("/admin2/publications/".concat(e,".json"),s(),{headers:{"Content-Type":"multipart/form-data"}});case 32:c=n.sent,n.next=38;break;case 35:return n.next=37,q.ZP.put("/admin2/publications/".concat(e,".json"),a);case 37:c=n.sent;case 38:null!==(o=c.data)&&void 0!==o&&o.success?(et(l?"Publication created successfully":"Publication saved successfully","success"),l&&null!==(d=c.data.publication)&&void 0!==d&&d.id?t("/admin2/publications/".concat(c.data.publication.id,"/edit")):p(c.data.publication)):et((null===(u=c.data)||void 0===u||null===(x=u.errors)||void 0===x?void 0:x.join(", "))||"Failed to save publication","error"),n.next=44;break;case 41:n.prev=41,n.t0=n.catch(14),et((null===(h=n.t0.response)||void 0===h||null===(f=h.data)||void 0===f||null===(b=f.errors)||void 0===b?void 0:b.join(", "))||"Failed to save publication","error");case 44:M(!1);case 45:case"end":return n.stop()}}),n,null,[[14,41]])})));return function(){return n.apply(this,arguments)}}();if(k)return(0,F.jsx)(U.Z,{title:"Publications",pageTitle:l?"Create a publication":"Edit Publication",children:(0,F.jsxs)(Ue,{children:["Loading ",l?"form options":"publication","..."]})});if(R||!l&&!u)return(0,F.jsx)(U.Z,{title:"Publications",pageTitle:l?"Create a publication":"Edit Publication",children:(0,F.jsx)(Ae,{children:R||"Publication not found"})});var xt=l?"Create a publication":"Edit ".concat(null===u||void 0===u?void 0:u.accountName," - ").concat(null===u||void 0===u?void 0:u.name),ht=v.currentContentStrategyId?null===f||void 0===f||null===(n=f.contentStrategies.find((function(n){return n.id===v.currentContentStrategyId})))||void 0===n?void 0:n.label:null;return(0,F.jsxs)(U.Z,{title:"Publications",pageTitle:l?"Publications / New":"Publications / ".concat((null===u||void 0===u?void 0:u.name)||""),children:[(0,F.jsxs)(ue,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:l?"New":"".concat(null===u||void 0===u?void 0:u.accountName," - ").concat(null===u||void 0===u?void 0:u.name)})]}),(0,F.jsxs)(pe,{children:[(0,F.jsx)(xe,{children:xt}),!l&&(0,F.jsxs)(he,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(e,"/talent_requests"),children:"Manage talent requests"}),(null===u||void 0===u?void 0:u.currentContentStrategyId)&&(0,F.jsx)(T.rU,{to:"/admin2/content_strategies/".concat(u.currentContentStrategyId,"/edit"),children:"Manage content strategy"})]})]}),!l&&(0,F.jsxs)(fe,{children:[(0,F.jsx)(be,{to:"/admin2/publications/".concat(e,"/edit"),$active:!0,children:"Publication info"}),(0,F.jsx)(be,{to:"/admin2/publications/".concat(e,"/users"),children:"Users"}),(0,F.jsx)(be,{to:"/admin2/publications/".concat(e,"/transactions"),children:"Transactions"}),(0,F.jsx)(be,{to:"/admin2/publications/".concat(e,"/fixed_arr_credits"),children:"Fixed ARR Credits"}),(0,F.jsx)(be,{to:"/admin2/publications/".concat(e,"/bulk_story_tagging/new"),children:"Bulk Story Tagging"}),(0,F.jsx)(be,{to:"/admin2/publications/".concat(e,"/talent_requests"),children:"Talent Requests"})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{$required:!0,children:"Name"}),(0,F.jsx)(ye,{type:"text",value:v.name||"",onChange:function(n){return ot("name",n.target.value)},required:!0})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{$required:!v.internal,children:"SalesForce Group ID (required if publication is not internal)"}),(0,F.jsx)(ye,{type:"text",value:v.salesforceId||"",onChange:function(n){return ot("salesforceId",n.target.value)},required:!v.internal})]}),(0,F.jsxs)(ge,{children:[(0,F.jsx)(me,{children:"Status"}),(0,F.jsxs)(Ce,{children:[(0,F.jsx)(we,{type:"checkbox",checked:v.active||!1,onChange:function(n){return ot("active",n.target.checked)}}),"Active"]}),(0,F.jsxs)(Ce,{children:[(0,F.jsx)(we,{type:"checkbox",checked:v.internal||!1,onChange:function(n){return ot("internal",n.target.checked)}}),"Internal"]}
1)]}),(0,F.jsxs)(ge,{children:[(0,F.jsx)(me,{children:"Management"}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Logo"}),(0,F.jsxs)(De,{children:[(K||(null===u||void 0===u?void 0:u.avatarUrl))&&(0,F.jsx)("img",{src:K||(null===u||void 0===u?void 0:u.avatarUrl),alt:"Logo"}),(0,F.jsx)(ye,{type:"file",accept:"image/jpeg,image/png,image/gif",onChange:function(n){var e,t=null===(e=n.target.files)||void 0===e?void 0:e[0];if(t){B(t);var r=new FileReader;r.onloadend=function(){V(r.result)},r.readAsDataURL(t)}},style:{width:"auto"}})]})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{$required:!0,children:"Organization"}),l?(0,F.jsx)(Ne,{ref:mn,children:cn?(0,F.jsxs)(Xe,{children:[(0,F.jsx)(Ke,{children:cn.text}),(0,F.jsx)(Ve,{onClick:function(){ln(null),J("")},title:"Clear selection",children:"\xd7"})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ye,{type:"text",placeholder:"Account",value:Y,onChange:function(n){return e=n.target.value,J(e),ln(null),gn.current&&clearTimeout(gn.current),void(gn.current=setTimeout((function(){at(e)}),300));var e},onFocus:function(){return pn(!0)},onKeyDown:function(n){un&&0!==tn.length&&("ArrowDown"===n.key?(n.preventDefault(),bn((function(n){return n<tn.length-1?n+1:n}))):"ArrowUp"===n.key?(n.preventDefault(),bn((function(n){return n>0?n-1:n}))):"Enter"===n.key&&fn>=0?(n.preventDefault(),ct(tn[fn])):"Escape"===n.key&&pn(!1))}}),un&&(0,F.jsx)(Ee,{children:Y.length<2?(0,F.jsx)(Qe,{children:"Please enter 2 or more characters"}):0===tn.length?(0,F.jsx)(Qe,{children:"No results found"}):tn.map((function(n,e){return(0,F.jsx)(Me,{$isHighlighted:e===fn,onClick:function(){return ct(n)},children:n.text},n.id)}))})]})}):(0,F.jsx)(Fe,{children:(0,F.jsx)(T.rU,{to:"/admin2/accounts/".concat(null===u||void 0===u?void 0:u.accountId,"/edit"),children:null===u||void 0===u?void 0:u.accountName})})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{$required:!0,children:"Billing type"}),(0,F.jsxs)(ke,{value:v.billingType||"",onChange:function(n){return ot("billingType",n.target.value)},required:!0,children:[(0,F.jsx)("option",{value:"",children:"Select one"}),null===f||void 0===f?void 0:f.billingTypes.map((function(n){return(0,F.jsx)("option",{value:n.value,children:n.label},n.value)}))]})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Content commit status"}),(0,F.jsx)(Ze,{children:"Indicate whether or not this publication has committed to a content spend bracket. Customers who commit to content spend pay their Contently margin directly to the finance team and not in the product."}),(0,F.jsxs)(_e,{children:[(0,F.jsxs)(Se,{children:[(0,F.jsx)("input",{type:"radio",name:"contentCommit",checked:!0===v.contentCommit,onChange:function(){return ot("contentCommit",!0)}}),"Yes"]}),(0,F.jsxs)(Se,{children:[(0,F.jsx)("input",{type:"radio",name:"contentCommit",checked:!1===v.contentCommit,onChange:function(){return ot("contentCommit",!1)}}),"No"]})]})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Contently content margin %"}),(0,F.jsx)(Ze,{children:"This is the Contently content margin added to every payment on a piece of content created in the product. Changing this margin will only affect new payments."}),(0,F.jsx)(ye,{type:"number",min:"0",max:"100",value:v.perPieceManagementFeePercentage||0,onChange:function(n){return ot("perPieceManagementFeePercentage",Number(n.target.value))},readOnly:v.contentCommit})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Fixed management fee"}),(0,F.jsx)(ye,{type:"number",min:"0",value:v.fixedManagementFeeInDollars||0,onChange:function(n){return ot("fixedManagementFeeInDollars",Number(n.target.value))}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Purchase order number"}),(0,F.jsx)(ye,{type:"text",value:v.purchaseOrderNumber||"",onChange:function(n){return ot("purchaseOrderNumber",n.target.value)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Billing contacts' email"}),(0,F.jsx)(Ze,{children:"If left blank, will be sent to all admins of publication. Separate by commas."}),(0,F.jsx)(ye,{type:"text",value:v.billingContacts||"",onChange:function(n){return ot("billingContacts",n.target.value)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Editorial services: hourly rate $"}),(0,F.jsx)(ye,{type:"number",min:"0",value:v.editorialRateInDollars||0,onChange:function(n){return ot("editorialRateInDollars",Number(n.target.value)||0)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Editorial services: hours per month"}),(0,F.jsx)(ye,{type:"number",min:"0",value:v.editorialHours||0,onChange:function(n){return ot("editorialHours",Number(n.target.value)||0)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Contently editor"}),(0,F.jsx)(Ne,{ref:En,children:$n?(0,F.jsxs)(Xe,{children:[(0,F.jsx)(Ke,{children:$n.name||$n.text}),(0,F.jsx)(Ve,{onClick:function(){Tn(null),yn(""),j((function(n){return(0,Jn.Z)((0,Jn.Z)({},n),{},{contentlyEditorId:null})}))},title:"Clear selection",children:"\xd7"})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ye,{type:"text",placeholder:"Start typing to find a user",value:Zn,onChange:function(n){return e=n.target.value,yn(e),Tn(null),j((function(n){return(0,Jn.Z)((0,Jn.Z)({},n),{},{contentlyEditorId:null})})),Nn.current&&clearTimeout(Nn.current),void(Nn.current=setTimeout((function(){lt(e)}),300));var e},onFocus:function(){return Rn(!0)},onKeyDown:function(n){qn&&0!==wn.length&&("ArrowDown"===n.key?(n.preventDefault(),Fn((function(n){return n<wn.length-1?n+1:n}))):"ArrowUp"===n.key?(n.preventDefault(),Fn((function(n){return n>0?n-1:n}))):"Enter"===n.key&&Dn>=0?(n.preventDefault(),st(wn[Dn])):"Escape"===n.key&&Rn(!1))}}),qn&&(0,F.jsx)(Ee,{children:Zn.length<2?(0,F.jsx)(Qe,{children:"Please enter 2 or more characters"}):0===wn.length?(0,F.jsx)(Qe,{children:"No results found"}):wn.map((function(n,e){return(0,F.jsxs)(Le,{$isHighlighted:e===Dn,onClick:function(){return st(n)},children:[(0,F.jsx)(Oe,{src:n.avatar_url||"/images/default_avatar.png",alt:n.name,onError:function(n){n.target.src="/images/default_avatar.png"}}),(0,F.jsxs)(He,{children:[(0,F.jsx)(Be,{children:n.name}),(0,F.jsx)(Ge,{children:n.email})]})]},n.id)}))})]})})]}),(0,F.jsxs)(ve,{children:[(0,F.jsxs)(je,{children:["Contributor exclusivity",(0,F.jsx)(Ye,{title:"Contributors working in any organizations listed here will be ineligible to work for this publication. Similarly, contributors working on this publication will be ineligible to work in any organizations listed below.",children:"\u24d8"})]}),(0,F.jsx)(ke,{multiple:!0,value:(v.nonCompeteAccountIds||[]).map(String),onChange:function(n){var e=Array.from(n.target.selectedOptions,(function(n){return Number(n.value)}));ot("nonCompeteAccountIds",e)},style:{minHeight:"120px"},children:null===f||void 0===f?void 0:f.accounts.map((function(n){return(0,F.jsx)("option",{value:n.id,children:n.name},n.id)}))}),(0,F.jsx)(Ze,{children:"Hold Ctrl/Cmd to select multiple accounts"})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Product package"}),(0,F.jsx)(Ze,{children:"Changing a publication's product package will alter the associated features to match those within the package."}),(0,F.jsxs)(ke,{value:v.package||"",onChange:function(n){return ot("package",n.target.value)},children:[(0,F.jsx)("option",{value:"",children:"Select a product package"}),null===f||void 0===f?void 0:f.packages.map((function(n){return(0,F.jsx)("option",{value:n.value,children:n.label},n.value)}))]})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Services package"}),(0,F.jsx)(Ze,{children:"Changing a publication's services package will alter the associated features to match those within the services package."}),(0,F.jsxs)(ke,{value:v.servicesPackage||"",onChange:function(n){return ot("servicesPackage",n.target.value)},children:[(0,F.jsx)("option",{value:"",children:"Select a services package"}),null===f||void 0===f?void 0:f.servicesPackages.map((function(n){return(0,F.jsx)("option",{value:n.value,children:n.label},n.value)}))]})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Features"}),(0,F.jsx)($e,{children:null===f||void 0===f?void 0:f.features.map((function(n){return(0,F.jsxs)(Te,{children:[(0,F.jsx)(we,{type:"checkbox",checked:(v.featureIds||[]).includes(n.id
1),onChange:function(){return function(n){var e=v.featureIds||[],t=e.includes(n)?e.filter((function(e){return e!==n})):[].concat((0,ne.Z)(e),[n]);ot("featureIds",t)}(n.id)}}),(0,F.jsxs)("span",{children:[n.label,n.description&&(0,F.jsx)(ze,{title:n.description,children:"\u24d8"})]})]},n.id)}))})]})]}),(0,F.jsxs)(ge,{children:[(0,F.jsx)(me,{children:"Publish & tracking"}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Site url"}),(0,F.jsx)(ye,{type:"text",value:v.siteUrl||"",onChange:function(n){return ot("siteUrl",n.target.value)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Document subdomain"}),(0,F.jsx)(ye,{type:"text",value:v.documentSubdomain||"",onChange:function(n){return ot("documentSubdomain",n.target.value)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Marketo client"}),(0,F.jsx)(ye,{type:"text",value:v.marketoClientId||"",onChange:function(n){return ot("marketoClientId",n.target.value)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Marketo client secret"}),(0,F.jsx)(ye,{type:"text",value:v.marketoClientSecret||"",onChange:function(n){return ot("marketoClientSecret",n.target.value)}})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Marketo host"}),(0,F.jsx)(ye,{type:"text",value:v.marketoHost||"",onChange:function(n){return ot("marketoHost",n.target.value)}})]})]}),(0,F.jsxs)(ge,{children:[(0,F.jsx)(me,{children:"Content Strategy"}),(0,F.jsx)(ve,{children:(0,F.jsx)(Ne,{ref:ce,children:ht?(0,F.jsxs)(Xe,{children:[(0,F.jsx)(Ke,{children:ht}),(0,F.jsx)(Ve,{onClick:function(){ot("currentContentStrategyId",null),Hn("")},title:"Clear selection",children:"\xd7"})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ye,{type:"text",placeholder:"Select a content strategy",value:On,onChange:function(n){return dt(n.target.value)},onFocus:function(){ee(!0),Kn((null===f||void 0===f?void 0:f.contentStrategies)||[])},onKeyDown:function(n){Qn&&0!==Xn.length&&("ArrowDown"===n.key?(n.preventDefault(),ae((function(n){return n<Xn.length-1?n+1:n}))):"ArrowUp"===n.key?(n.preventDefault(),ae((function(n){return n>0?n-1:n}))):"Enter"===n.key&&ie>=0?(n.preventDefault(),ut(Xn[ie])):"Escape"===n.key&&ee(!1))}}),Qn&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(We,{type:"text",placeholder:"Search...",value:On,onChange:function(n){return dt(n.target.value)},autoFocus:!0}),0===Xn.length?(0,F.jsx)(Qe,{children:"No content strategies found"}):Xn.map((function(n,e){return(0,F.jsx)(Me,{$isHighlighted:e===ie,onClick:function(){return ut(n)},children:n.label},n.id)}))]})]})})})]}),(0,F.jsxs)(ge,{children:[(0,F.jsx)(me,{children:"Miscellaneous"}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Details"}),(0,F.jsx)(Pe,{value:v.details||"",onChange:function(n){return ot("details",n.target.value)},rows:5})]}),(0,F.jsxs)(ve,{children:[(0,F.jsx)(je,{children:"Quality Control Criteria"}),(0,F.jsx)(Pe,{value:v.qualityControlCriteria||"",onChange:function(n){return ot("qualityControlCriteria",n.target.value)},rows:5})]})]}),(0,F.jsxs)(Ie,{children:[(0,F.jsx)(qe,{onClick:function(){return t("/admin2/publications")},children:"Cancel"}),(0,F.jsx)(qe,{$variant:"primary",onClick:pt,disabled:E,children:E?"Saving...":"Save"})]}),a&&(0,F.jsx)(Re,{$type:a.type,children:a.message})]})},$t=I.ZP.div(Je||(Je=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),Tt=I.ZP.div(nt||(nt=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 24px;\n"]))),zt=I.ZP.h1(et||(et=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),It=I.ZP.div(tt||(tt=(0,S.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  text-align: right;\n  a { color: #00a6c2; text-decoration: none; font-size: 14px; &:hover { text-decoration: underline; } }\n"]))),qt=I.ZP.div(rt||(rt=(0,S.Z)(["\n  display: flex;\n  gap: 0;\n  border-bottom: 1px solid #e5e7eb;\n  margin-bottom: 24px;\n"]))),Rt=(0,I.ZP)(T.rU)(it||(it=(0,S.Z)(["\n  padding: 12px 20px;\n  font-size: 14px;\n  font-weight: 500;\n  color: ",";\n  text-decoration: none;\n  border-bottom: 2px solid ",";\n  margin-bottom: -1px;\n  &:hover { color: #00a6c2; background: #f9fafb; }\n"])),(function(n){return n.$active?"#00a6c2":"#6b7280"}),(function(n){return n.$active?"#00a6c2":"transparent"})),Ut=I.ZP.div(ot||(ot=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),At=I.ZP.div(at||(at=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 20px;\n"]))),Dt=I.ZP.h2(ct||(ct=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0;\n"]))),Ft=I.ZP.button(lt||(lt=(0,S.Z)(["\n  padding: 8px 16px;\n  background: #00a6c2;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  font-size: 14px;\n  cursor: pointer;\n  &:hover { background: #0094ab; }\n"]))),Nt=I.ZP.div(st||(st=(0,S.Z)(["\n  margin-bottom: 16px;\n  h4 { font-size: 14px; font-weight: 600; margin: 0 0 8px 0; }\n  ul { margin: 0; padding-left: 20px; font-size: 14px; color: #374151; }\n"]))),Et=(0,I.ZP)(T.rU)(dt||(dt=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  font-size: 14px;\n  &:hover { text-decoration: underline; }\n"]))),Mt=I.ZP.table(ut||(ut=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;
1\n"]))),Lt=I.ZP.th(pt||(pt=(0,S.Z)(["\n  text-align: left;\n  padding: 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: ",";\n  border-bottom: 2px solid #e5e7eb;\n  background: #f9fafb;\n  cursor: ",";\n  user-select: none;\n  white-space: nowrap;\n  \n  &:hover {\n    ","\n  }\n"])),(function(n){return n.$sorted?"#00a6c2":"#374151"}),(function(n){return n.$sortable?"pointer":"default"}),(function(n){return n.$sortable&&"\n      background: #f0f0f0;\n      color: #00a6c2;\n    "})),Ot=I.ZP.span(xt||(xt=(0,S.Z)(["\n  margin-left: 4px;\n  \n  &::after {\n    content: '","';\n  }\n"])),(function(n){var e=n.$direction;return"asc"===e?"\u2193":"desc"===e?"\u2191":""})),Ht=I.ZP.td(ht||(ht=(0,S.Z)(["\n  padding: 12px;\n  font-size: 14px;\n  color: #374151;\n  border-bottom: 1px solid #e5e7eb;\n  vertical-align: middle;\n"]))),Bt=I.ZP.div(ft||(ft=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 12px;\n"]))),Gt=I.ZP.img(bt||(bt=(0,S.Z)(["\n  width: 40px;\n  height: 40px;\n  border-radius: 50%;\n  object-fit: cover;\n"]))),Xt=I.ZP.div(gt||(gt=(0,S.Z)(["\n  width: 40px;\n  height: 40px;\n  border-radius: 50%;\n  background: #e5e7eb;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: #9ca3af;\n  font-size: 16px;\n"]))),Kt=I.ZP.div(mt||(mt=(0,S.Z)(["\n  a { color: #00a6c2; text-decoration: none; font-weight: 500; &:hover { text-decoration: underline; } }\n  small { display: block; color: #6b7280; font-size: 12px; }\n"]))),Vt=I.ZP.button(vt||(vt=(0,S.Z)(["\n  padding: 6px 10px;\n  background: #f3f4f6;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  cursor: ",";\n  margin-right: 4px;\n  opacity: ",";\n  filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.3));\n  &:hover { \n    background: ","; \n  }\n"])),(function(n){return n.disabled?"not-allowed":"pointer"}),(function(n){return n.disabled?.5:1}),(function(n){return n.disabled?"#f3f4f6":"#e5e7eb"})),Wt=I.ZP.div(jt||(jt=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),Qt=I.ZP.div(Zt||(Zt=(0,S.Z)(["\n  position: fixed;\n  inset: 0;\n  background: rgba(0, 0, 0, 0.4);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  z-index: 1000;\n"]))),Yt=I.ZP.div(yt||(yt=(0,S.Z)(["\n  background: white;\n  border-radius: 8px;\n  padding: 24px;\n  width: 420px;\n  max-width: 90vw;\n  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n"]))),Jt=I.ZP.h3(kt||(kt=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0 0 16px 0;\n"]))),nr=I.ZP.label(Pt||(Pt=(0,S.Z)(["\n  display: block;\n  font-size: 13px;\n  font-weight: 600;\n  color: #374151;\n  margin-bottom: 6px;\n"]))),er=I.ZP.select(wt||(wt=(0,S.Z)(["\n  width: 100%;\n  padding: 8px 12px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n  color: #111827;\n  margin-bottom: 16px;\n"]))),tr=I.ZP.div(Ct||(Ct=(0,S.Z)(["\n  display: flex;\n  justify-content: flex-end;\n  gap: 8px;\n"]))),rr=I.ZP.button(_t||(_t=(0,S.Z)(["\n  padding: 8px 16px;\n  border-radius: 4px;\n  font-size: 14px;\n  cursor: pointer;\n  border: 1px solid ",";\n  background: ",";\n  color: ",";\n  &:hover { opacity: 0.9; }\n  &:disabled { opacity: 0.5; cursor: not-allowed; }\n"])),(function(n){return n.$primary?"#00a6c2":"#d1d5db"}),(function(n){return n.$primary?"#00a6c2":"white"}),(function(n){return n.$primary?"white":"#374151"}));var ir,or,ar,cr,lr,sr,dr,ur,pr,xr,hr,fr,br,gr,mr,vr,jr,Zr,yr,kr=function(){var n=(0,z.UO)().id,e=(0,$.useState)(null),t=(0,_.Z)(e,2),r=t[0],i=t[1],o=(0,$.useState)([]),a=(0,_.Z)(o,2),c=a[0],l=a[1],s=(0,$.useState)({}),d=(0,_.Z)(s,2),u=d[0],p=d[1],x=(0,$.useState)([]),h=(0,_.Z)(x,2),f=h[0],b=h[1],g=(0,$.useState)(!0),m=(0,_.Z)(g,2),v=m[0],j=m[1],Z=(0,$.useState)(null),y=(0,_.Z)(Z,2),k=y[0],P=y[1],S=(0,$.useState)(""),I=(0,_.Z)(S,2),R=I[0],D=I[1],N=(0,$.useState)(!1),E=(0,_.Z)(N,2),M=E[0],L=E[1],O=(0,A.cX)(c),H=O.sortedData,B=O.requestSort,G=O.getSortDirection,X=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function e(){var t;return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,q.ZP.get("/admin2/publications/".concat(n,"/staffer_roles.json"));case 3:t=e.sent,i(t.data.brandProfile),l(t.data.staffers||[]),p(t.data.seat
1Counts||{}),b(t.data.standardRoles||[]),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("Failed to load data",e.t0);case 13:return e.prev=13,j(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,10,13,16]])}))),[n]);(0,$.useEffect)((function(){X()}),[X]);var K=function(){var n=(0,C.Z)((0,w.Z)().mark((function n(e){var t,r;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,q.ZP.post("/admin2/users/".concat(e,"/impersonate"));case 3:t=n.sent,r=t.data,window.location.href=(null===r||void 0===r?void 0:r.redirectUrl)||"/tasks",n.next=12;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("Failed to impersonate user",n.t0),alert("Failed to impersonate user");case 12:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(e){return n.apply(this,arguments)}}(),V=function(){var e=(0,C.Z)((0,w.Z)().mark((function e(t,r){return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm("Are you sure you want to remove ".concat(r," from this publication?"))){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,q.ZP.delete("/admin2/publications/".concat(n,"/staffer_roles/").concat(t,".json"));case 5:X(),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error("Failed to remove staffer",e.t0),alert("Failed to remove staffer");case 12:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(n,t){return e.apply(this,arguments)}}(),W=function(){var e=(0,C.Z)((0,w.Z)().mark((function e(){return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k&&R){e.next=2;break}return e.abrupt("return");case 2:return L(!0),e.prev=3,e.next=6,q.ZP.patch("/admin2/publications/".concat(n,"/staffer_roles/").concat(k.id,".json"),{staffer_role_type:R});case 6:P(null),X(),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(3),console.error("Failed to update role",e.t0),alert("Failed to update role");case 14:return e.prev=14,L(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[3,10,14,17]])})));return function(){return e.apply(this,arguments)}}(),Q=r?"".concat(r.accountName," - ").concat(r.name):"Publication";if(v)return(0,F.jsx)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(Wt,{children:"Loading..."})});var Y=Object.values(u).reduce((function(n,e){return n+e}),0);return(0,F.jsxs)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:Q,href:"/admin2/publications/".concat(n,"/edit")},{label:"Users"}],children:[(0,F.jsxs)($t,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsxs)(T.rU,{to:"/admin2/publications/".concat(n,"/edit"),children:[null===r||void 0===r?void 0:r.accountName," - ",null===r||void 0===r?void 0:r.name]}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Users"})]}),(0,F.jsxs)(Tt,{children:[(0,F.jsxs)(zt,{children:["Edit ",null===r||void 0===r?void 0:r.accountName," - ",null===r||void 0===r?void 0:r.name]}),(0,F.jsxs)(It,{children:[(0,F.jsx)("a",{href:"/admin2/publications/".concat(n,"/talent_requests"),children:"Manage talent requests"}),(null===r||void 0===r?void 0:r.currentContentStrategyId)&&(0,F.jsx)(T.rU,{to:"/admin2/content_strategies/".concat(r.currentContentStrategyId,"/edit"),children:"Manage content strategy"})]})]}),(0,F.jsxs)(qt,{children:[(0,F.jsx)(Rt,{to:"/admin2/publications/".concat(n,"/edit"),children:"Publication info"}),(0,F.jsx)(Rt,{to:"/admin2/publications/".concat(n,"/users"),$active:!0,children:"Users"}),(0,F.jsx)(Rt,{to:"/admin2/publications/".concat(n,"/transactions"),children:"Transactions"}),(0,F.jsx)(Rt,{to:"/admin2/publications/".concat(n,"/fixed_arr_credits"),children:"Fixed ARR Credits"}),(0,F.jsx)(Rt,{to:"/admin2/publications/".concat(n,"/bulk_story_tagging"),children:"Bulk Story Tagging"}),(0,F.jsx)(Rt,{to:"/admin2/publications/".concat(n,"/talent_requests"),children:"Talent Requests"})]}),(0,F.jsxs)(Ut,{children:[(0,F.jsxs)(At,{children:[(0,F.jsx)(Dt,{children:"Users"}),(0,F.jsx)(Ft,{onClick:function(){window.location.href="/admin2/publications/".concat(n,"/staffer_roles.csv")},children:"Download CSV"})]}),(0,F.jsxs)(Nt,{children:[(0,F.jsxs)("h4",{children:["Seat count - ",Y," total"]}),(0,F.jsx)("ul",{children:Object.entries(u).map((function(n){var e=(0,_.Z)(n,2),t=e[0],r=e[1];return(0,F.jsxs)("li",{children:[t," - ",r]},t)}
1))})]}),(0,F.jsxs)("p",{style:{marginBottom:16},children:["Map users to new ",(0,F.jsx)(Et,{to:"/admin2/publications/".concat(n,"/staffer_roles"),children:"Standard roles"})]}),(0,F.jsxs)(Mt,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsxs)(Lt,{$sortable:!0,$sorted:null!==G("name"),onClick:function(){return B("name")},children:["Name ",(0,F.jsx)(Ot,{$direction:G("name")})]}),(0,F.jsxs)(Lt,{$sortable:!0,$sorted:null!==G("role"),onClick:function(){return B("role")},children:["Role ",(0,F.jsx)(Ot,{$direction:G("role")})]}),(0,F.jsxs)(Lt,{$sortable:!0,$sorted:null!==G("addedOn"),onClick:function(){return B("addedOn")},children:["Added on ",(0,F.jsx)(Ot,{$direction:G("addedOn")})]}),(0,F.jsxs)(Lt,{$sortable:!0,$sorted:null!==G("talentScore"),onClick:function(){return B("talentScore")},children:["Talent Score ",(0,F.jsx)(Ot,{$direction:G("talentScore")})]}),(0,F.jsxs)(Lt,{$sortable:!0,$sorted:null!==G("storyCount"),onClick:function(){return B("storyCount")},children:["Story count ",(0,F.jsx)(Ot,{$direction:G("storyCount")})]}),(0,F.jsxs)(Lt,{$sortable:!0,$sorted:null!==G("lastStaffedDate"),onClick:function(){return B("lastStaffedDate")},children:["Last Staffed Date ",(0,F.jsx)(Ot,{$direction:G("lastStaffedDate")})]}),(0,F.jsx)(Lt,{children:"Actions"})]})}),(0,F.jsx)("tbody",{children:H.map((function(n){return(0,F.jsxs)("tr",{children:[(0,F.jsx)(Ht,{children:(0,F.jsxs)(Bt,{children:[n.avatarUrl?(0,F.jsx)(Gt,{src:n.avatarUrl,alt:n.name}):(0,F.jsx)(Xt,{children:"\ud83d\udc64"}),(0,F.jsxs)(Kt,{children:[(0,F.jsx)(T.rU,{to:"/admin2/users/".concat(n.userId,"/edit"),children:n.name}),(0,F.jsx)("small",{children:n.email})]})]})}),(0,F.jsx)(Ht,{children:n.role}),(0,F.jsx)(Ht,{children:n.addedOn}),(0,F.jsx)(Ht,{children:n.talentScore||""}),(0,F.jsx)(Ht,{children:n.storyCount}),(0,F.jsx)(Ht,{children:n.lastStaffedDate||""}),(0,F.jsxs)(Ht,{children:[(0,F.jsx)(Vt,{title:"Edit role",onClick:function(){return function(n){var e=f.find((function(e){return e.friendlyName===n.role}));D((null===e||void 0===e?void 0:e.name)||""),P(n)}(n)},children:"\u270f\ufe0f"}),(0,F.jsx)(Vt,{title:n.canImpersonate?"Impersonate":"Cannot impersonate this user",onClick:function(){return n.canImpersonate&&K(n.userId)},disabled:!n.canImpersonate,children:"\ud83d\udd75\ufe0f"}),(0,F.jsx)(Vt,{title:n.canRemove?"Remove staffer":"Cannot remove this staffer",onClick:function(){return n.canRemove&&V(n.id,n.name)},disabled:!n.canRemove,children:"\ud83d\uddd1\ufe0f"})]})]},n.id)}))})]})]}),k&&(0,F.jsx)(Qt,{onClick:function(){return P(null)},children:(0,F.jsxs)(Yt,{onClick:function(n){return n.stopPropagation()},children:[(0,F.jsxs)(Jt,{children:["Edit role for ",k.name]}),(0,F.jsx)(nr,{children:"Role"}),(0,F.jsxs)(er,{value:R,onChange:function(n){return D(n.target.value)},children:[(0,F.jsx)("option",{value:"",children:"Select a role"}),f.map((function(n){return(0,F.jsx)("option",{value:n.name,children:n.friendlyName},n.name)}))]}),(0,F.jsxs)(tr,{children:[(0,F.jsx)(rr,{onClick:function(){return P(null)},children:"Cancel"}),(0,F.jsx)(rr,{$primary:!0,onClick:W,disabled:!R||M,children:M?"Saving...":"Save"})]})]})})]})},Pr=I.ZP.div(ir||(ir=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),wr=I.ZP.div(or||(or=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 24px;\n"]))),Cr=I.ZP.h1(ar||(ar=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),_r=I.ZP.div(cr||(cr=(0,S.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  text-align: right;\n  a { color: #00a6c2; text-decoration: none; font-size: 14px; &:hover { text-decoration: underline; } }\n"]))),Sr=I.ZP.div(lr||(lr=(0,S.Z)(["\n  display: flex;\n  gap: 0;\n  border-bottom: 1px solid #e5e7eb;\n  margin-bottom: 24px;\n"]))),$r=(0,I.ZP)(T.rU)(sr||(sr=(0,S.Z)(["\n  padding: 12px 20px;\n  font-size: 14px;\n  font-weight: 500;\n  color: ",";\n  text-decoration: none;\n  border-bottom: 2px solid ",";\n  margin-bottom: -1px;\n  &:hover { color: #00a6c2; background: #f9fafb; }\n"])),(function(n){return n.$active?"#00a6c2":"#6b7280"}),(function(n){return n.$active?"#00a6c2":"transparent"})),Tr=I.ZP.div(dr||(dr=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),zr=I.ZP.h2(ur||(ur=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0 0 20px 0;\n  border-bottom: 1px solid #e5e7eb;\n  padding-bottom: 12px;\n"]))),Ir=I.ZP.h3(pr||(pr=(0,S.Z)(["\n  font-size: 16px;\n  font-weight: 600;\n  color: #111827;\n  margin: 24px 0 12px 0;\n  border-bottom: 1px solid #e5e7eb;\n  padding-bottom: 8px;\n"]))),qr=I.ZP.h4(xr||(xr=(0,S.Z)(["\n  font-size: 14px;\n  font-weight: 500;\n  color: #374151;\n  margin: 16px 0 8px 0;\n"]))),Rr=I.ZP.table(hr||(hr=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;\n  margin-bottom: 16px;\n"]))),Ur=I.ZP.th(fr||(fr=(0,S.Z)(["\n  text-align: left;\n  padding: 10px 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: ",";\n  border: 1px solid #e5e7eb;\n  background: #f9fafb;\n  cursor: ",";\n  user-select: none;\n  white-space: nowrap;\n  \n  &:hover {\n    ","\n  }\n"])),(function(n){return n.$sorted?"#00a6c2":"#374151"}),(function(n){return n.$sortable?"pointer":"default"}),(function(n){return n.$sortable&&"\n      background: #f0f0f0;\n      color: #00a6c2;\n    "})),Ar=I.ZP.span(br||(br=(0,S.Z)(["\n  margin-left: 4px;\n  \n  &::after {\n    content: '","';\n  }\n"])),(function(n){var e=n.$direction;return"asc"===e?"\u2193":"desc"===e?"\u2191":""})),Dr=I.ZP.td(gr||(gr=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  color: #374151;\n  border: 1px solid #e5e7eb;
1\n"]))),Fr=I.ZP.tr(mr||(mr=(0,S.Z)(["\n  background: #f9fafb;\n  font-weight: 500;\n"]))),Nr=(0,I.ZP)(T.rU)(vr||(vr=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  &:hover { text-decoration: underline; }\n"]))),Er=I.ZP.a(jr||(jr=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  &:hover { text-decoration: underline; }\n"]))),Mr=I.ZP.div(Zr||(Zr=(0,S.Z)(["\n  padding: 16px;\n  color: #6b7280;\n  background: #f9fafb;\n  border-radius: 4px;\n  text-align: center;\n"]))),Lr=I.ZP.div(yr||(yr=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),Or=function(n){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n/100)};function Hr(n){var e=n.transactions,t=n.formatDollars,r=(0,A.cX)(e),i=r.sortedData,o=r.requestSort,a=r.getSortDirection;return(0,F.jsxs)(Rr,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("id"),onClick:function(){return o("id")},children:["Id ",(0,F.jsx)(Ar,{$direction:a("id")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("reason"),onClick:function(){return o("reason")},children:["Reason ",(0,F.jsx)(Ar,{$direction:a("reason")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("createdAt"),onClick:function(){return o("createdAt")},children:["Created ",(0,F.jsx)(Ar,{$direction:a("createdAt")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("who"),onClick:function(){return o("who")},children:["Who ",(0,F.jsx)(Ar,{$direction:a("who")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("type"),onClick:function(){return o("type")},children:["Type ",(0,F.jsx)(Ar,{$direction:a("type")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("amount"),onClick:function(){return o("amount")},children:["Amount ",(0,F.jsx)(Ar,{$direction:a("amount")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("category"),onClick:function(){return o("category")},children:["Category ",(0,F.jsx)(Ar,{$direction:a("category")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("storyId"),onClick:function(){return o("storyId")},children:["Story Id ",(0,F.jsx)(Ar,{$direction:a("storyId")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("invoiceCreditMemo"),onClick:function(){return o("invoiceCreditMemo")},children:["Invoice/Credit memo ",(0,F.jsx)(Ar,{$direction:a("invoiceCreditMemo")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==a("postedDate"),onClick:function(){return o("postedDate")},children:["Posted Date ",(0,F.jsx)(Ar,{$direction:a("postedDate")})]})]})}),(0,F.jsx)("tbody",{children:i.map((function(n){return(0,F.jsxs)("tr",{children:[(0,F.jsx)(Dr,{children:(0,F.jsx)(Nr,{to:"/admin2/transactions/".concat(n.id),children:n.id})}),(0,F.jsx)(Dr,{children:n.reason}),(0,F.jsx)(Dr,{children:n.createdAt}),(0,F.jsx)(Dr,{children:n.who}),(0,F.jsx)(Dr,{children:n.type}),(0,F.jsx)(Dr,{children:t(n.amount)}),(0,F.jsx)(Dr,{children:n.category}),(0,F.jsx)(Dr,{children:n.storyId&&(0,F.jsx)(Er,{href:"/stories/".concat(n.storyId),target:"_blank",children:n.storyId})}),(0,F.jsx)(Dr,{children:n.invoiceCreditMemo||""}),(0,F.jsx)(Dr,{children:n.postedDate})]},n.id)}))})]})}var Br,Gr,Xr,Kr,Vr,Wr,Qr,Yr,Jr,ni,ei,ti,ri,ii,oi,ai,ci,li,si,di,ui,pi,xi=function(){var n=(0,z.UO)().id,e=(0,$.useState)(null),t=(0,_.Z)(e,2),r=t[0],i=t[1],o=(0,$.useState)({creditTotal:0,debitTotal:0,balance:0}),a=(0,_.Z)(o,2),c=a[0],l=a[1],s=(0,$.useState)([]),d=(0,_.Z)(s,2),u=d[0],p=d[1],x=(0,$.useState)(!0),h=(0,_.Z)(x,2),f=h[0],b=h[1],g=(0,A.cX)(u),m=g.sortedData,v=g.requestSort,j=g.getSortDirection,Z=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function e(){var t;return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,q.ZP.get("/admin2/publications/".concat(n,"/transactions.json"));case 3:t=e.sent,i(t.data.brandProfile),l(t.data.overall),p(t.data.groups||[]),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("Failed to load data",e.t0);case 12:return e.prev=12,b(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,9,12,15]])}))),[n]);(0,$.useEffect)((function(){Z()}),[Z]);var y=r?"".concat(r.accountName," - ").concat(r.name):"Publication";return f?(0,F.jsx)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(Lr,{children:"Loading..."})}):(0,F.jsxs)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:y,href:"/admin2/publications/".concat(n,"/edit")},{label:"Transactions"}],children:[(0,F.jsxs)(Pr,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsxs)(T.rU,{to:"/admin2/publications/".concat(n,"/edit"),children:[null===r||void 0===r?void 0:r.accountName," - ",null===r||void 0===r?void 0:r.name]}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Transactions"})]}),(0,F.jsxs)(wr,{children:[(0,F.jsxs)(Cr,{children:["Edit ",null===r||void 0===r?void 0:r.accountName," - ",null===r||void 0===r?void 0:r.name]}),(0,F.jsxs)(_r,{children:[(0,F.jsx)("a",{href:"/admin2/publications/".concat(n,"/talent_requests"),children:"Manage talent requests"}),(null===r||void 0===r?void 0:r.currentContentStrategyId)&&(0,F.jsx)(T.rU,{to:"/admin2/content_strategies/".concat(r.currentContentStrategyId,"/edit"),children:"Manage content strategy"})]})]}),(0,F.jsxs)(Sr,{children:[(0,F.jsx)($r,{to:"/admin2/publications/".concat(n,"/edit"),children:"Publication info"}),(0,F.jsx)($r,{to:"/admin2/publications/".concat(n,"/users"),children:"Users"}),(0,F.jsx)($r,{to:"/admin2/publications/".concat(n,"/transactions"),$active:!0,children:"Transactions"}),(0,F.jsx)($r,{to:"/admin2/publications/".concat(n,"/fixed_arr_credits"),children:"Fixed ARR Credits"}),(0,F.jsx)($r,{to:"/admin2/publications/".concat(n,"/bulk_story_tagging"),children:"Bulk Story Tagging"}),(0,F.jsx)($r,{to:"/admin2/publications/".concat(n,"/talent_requests"),children:"Talent Requests"})]}),(0,F.jsxs)(Tr,{children:[(0,F.jsx)(zr,{children:"Transactions"}),(0,F.jsxs)(Rr,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Ur,{children:"Total Credit"}),(0,F.jsx)(Ur,{children:"Total Debit"}),(0,F.jsx)(Ur,{children:"Balance"})]})}),(0,F.jsx)("tbody",{children:(0,F.jsxs)(Fr,{children:[(0,F.jsx)(Dr,{children:Or(c.creditTotal)}),(0,F.jsx)(Dr,{children:Or(c.debitTotal)}),(0,F.jsx)(Dr,{children:Or(c.balance)})]})})]}),(0,F.jsxs)(Rr,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==j("parentCategory"),onClick:function(){return v("parentCategory")},children:["Parent Category ",(0,F.jsx)(Ar,{$direction:j("parentCategory")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==j("creditTotal"),onClick:function(){return v("creditTotal")},children:["Total Credit ",(0,F.jsx)(Ar,{$direction:j("creditTotal")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==j("debitTotal"),onClick:function(){return v("debitTotal")},children:["Total Debit ",(0,F.jsx)(Ar,{$direction:j("debitTotal")})]}),(0,F.jsxs)(Ur,{$sortable:!0,$sorted:null!==j("balance"),onClick:function(){return v("balance")},children:["Balance ",(0,F.jsx)(Ar,{$direction:j("balance")})]})]})}),(0,F.jsx)("tbody",{children:m.map((function(n){return(0,F.jsxs)(Fr,{children:[(0,F.jsx)(Dr,{children:n.parentCategory}),(0,F.jsx)(Dr,{children:Or(n.creditTotal)}),(0,F.jsx)(Dr,{children:Or(n.debitTotal)}),(0,F.jsx)(Dr,{children:Or(n.balance)})]},n.parentCategory)}))})]}),m.map((function(n){return(0,F.jsxs)("div",{children:[(0,F.jsx)(Ir,{children:n.parentCategory}),(0,F.jsxs)(Rr,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Ur,{children:"Credit"}),(0,F.jsx)(Ur,{children:"Debit"}),(0,F.jsx)(Ur,{children:"Balance"})]})}),(0,F.jsx)("tbody",{children:(0,F.jsxs)(Fr,{children:[(0,F.jsx)(Dr,{children:Or(n.creditTotal)}),(0,F.jsx)(Dr,{children:Or(n.debitTotal)}),(0,F.jsx)(Dr,{children:Or(n.balance)})]})})]}),(0,F.jsxs)(qr,{children:[n.transactionCount," Transactions"]}),0===n.transactions.length?(0,F.jsx)(Mr,{children:"0 results"}):(0,F.jsx)(Hr,{transactions:n.transactions,formatDollars:Or})]},n.parentCategory)}))]})]})},hi=I.ZP.div(Br||(Br=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),fi=I.ZP.div(Gr||(Gr=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 24px;\n"]))),bi=I.ZP.h1(Xr||(Xr=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),gi=I.ZP.div(Kr||(Kr=(0,S.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  text-align: right;\n  a { color: #00a6c2; text-decoration: none; font-size: 14px; &:hover { text-decoration: underline; } }\n"]))),mi=I.ZP.div(Vr||(Vr=(0,S.Z)(["\n  display: flex;\n  gap: 0;\n  border-bottom: 1px solid #e5e7eb;\n  margin-bottom: 24px;\n"]))),vi=(0,I.ZP)(T.rU)(Wr||(Wr=(0,S.Z)(["\n  padding: 12px 20px;\n  font-size: 14px;\n  font-weight: 500;\n  color: ",";\n  text-decoration: none;\n  border-bottom: 2px solid ",";\n  margin-bottom: -1px;\n  &:hover { color: #00a6c2; background: #f9fafb; }\n"])),(function(n){return n.$active?"#00a6c2":"#6b7280"}),(function(n){return n.$active?"#00a6c2":"transparent"})),ji=I.ZP.div(Qr||(Qr=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),Zi=I.ZP.div(Yr||(Yr=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin-bottom: 20px;\n  border-bottom: 1px solid #e5e7eb;\n  padding-bottom: 16px;\n"]))),yi=I.ZP.h2(Jr||(Jr=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0;\n"]))),ki=(0,I.ZP)(T.rU)(ni||(ni=(0,S.Z)(["\n  padding: 8px 16px;\n  background: #00a6c2;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  font-size: 14px;\n  text-decoration: none;\n  &:hover { background: #0094ab; color: white; }\n"]))),Pi=I.ZP.div(ei||(ei=(0,S.Z)(["\n  background: #f8f8f8;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 12px 16px;\n  margin-bottom: 20px;\n"]))),wi=I.ZP.label(ti||(ti=(0,S.Z)(["\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  cursor: pointer;\n  font-size: 14px;\n  color: #666;\n  text-transform: uppercase;\n  font-weight: 500;\n  input { cursor: pointer; }\n"]))),Ci=I.ZP.div(ri||(ri=(0,S.Z)(["\n  background: #e8f4f8;\n  border: 1px solid #b8dce8;\n  border-radius: 4px;\n  padding: 16px 20px;\n  color: #2980b9;\n  display: flex;\n  align-items: center;\n  gap: 10px;\n"]))),_i=I.ZP.table(ii||(ii=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;
1\n"]))),Si=I.ZP.th(oi||(oi=(0,S.Z)(["\n  text-align: left;\n  padding: 10px 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: #374151;\n  border-bottom: 2px solid #e5e7eb;\n  background: #f9fafb;\n"]))),$i=I.ZP.td(ai||(ai=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  color: #374151;\n  border-bottom: 1px solid #e5e7eb;\n"]))),Ti=I.ZP.span(ci||(ci=(0,S.Z)(["\n  display: inline-block;\n  padding: 4px 8px;\n  border-radius: 4px;\n  font-size: 12px;\n  font-weight: 500;\n  ","\n"])),(function(n){var e=n.$status;return n.$archived?"background: #e5e7eb; color: #6b7280;":"active"===e?"background: #d1fae5; color: #065f46;":"expired"===e?"background: #fee2e2; color: #991b1b;":"background: #fef3c7; color: #92400e;"})),zi=I.ZP.span(li||(li=(0,S.Z)(["\n  ","\n"])),(function(n){var e=n.$warning;return n.$expired?"color: #dc2626;":e?"color: #d97706;":""})),Ii=I.ZP.button(si||(si=(0,S.Z)(["\n  padding: 4px 8px;\n  background: #f3f4f6;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 12px;\n  cursor: pointer;\n  margin-right: 4px;\n  &:hover { background: #e5e7eb; }\n"]))),qi=(0,I.ZP)(Ii)(di||(di=(0,S.Z)(["\n  background: #fee2e2;\n  border-color: #fecaca;\n  color: #991b1b;\n  &:hover { background: #fecaca; }\n"]))),Ri=I.ZP.div(ui||(ui=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),Ui=I.ZP.tr(pi||(pi=(0,S.Z)(["\n  opacity: 0.6;\n"]))),Ai=function(n){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n)},Di=function(n){return n?new Date(n).toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}):""};var Fi,Ni,Ei,Mi,Li,Oi,Hi,Bi,Gi,Xi,Ki,Vi,Wi,Qi,Yi,Ji,no,eo,to,ro,io,oo,ao,co,lo=function(){var n=(0,z.UO)().id,e=(0,$.useState)(null),t=(0,_.Z)(e,2),r=t[0],i=t[1],o=(0,$.useState)([]),a=(0,_.Z)(o,2),c=a[0],l=a[1],s=(0,$.useState)(!1),d=(0,_.Z)(s,2),u=d[0],p=d[1],x=(0,$.useState)(!0),h=(0,_.Z)(x,2),f=h[0],b=h[1],g=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function e(){var t;return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,q.ZP.get("/admin2/publications/".concat(n,"/fixed_arr_credits.json"),{params:{show_archived:u}});case 3:t=e.sent,i(t.data.brand_profile),l(t.data.fixed_arr_credits||[]),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error("Failed to load data",e.t0);case 11:return e.prev=11,b(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])}
1))),[n,u]);(0,$.useEffect)((function(){g()}),[g]);var m=function(){var e=(0,C.Z)((0,w.Z)().mark((function e(t,r){var i;return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r?"This will write off the remaining balance, mark as expired, and archive this credit. Continue?":"Archive this exhausted FARR credit? It will be hidden from this list.",window.confirm(i)){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,e.next=6,q.ZP.delete("/admin2/publications/".concat(n,"/fixed_arr_credits/").concat(t,".json"));case 6:R.Am.success("Fixed ARR credit archived successfully"),g(),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),R.Am.error("Failed to archive Fixed ARR credit");case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(n,t){return e.apply(this,arguments)}}(),v=r?r.accountName?"".concat(r.accountName," - ").concat(r.name):r.name:"Publication";return f?(0,F.jsx)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(Ri,{children:"Loading..."})}):(0,F.jsxs)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:v,href:"/admin2/publications/".concat(n,"/edit")},{label:"Fixed ARR Credits"}],children:[(0,F.jsxs)(hi,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(n,"/edit"),children:null===r||void 0===r?void 0:r.name}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Fixed arr credits"})]}),(0,F.jsxs)(fi,{children:[(0,F.jsxs)(bi,{children:["Edit ",null===r||void 0===r?void 0:r.name]}),(0,F.jsxs)(gi,{children:[(0,F.jsx)("a",{href:"/admin2/publications/".concat(n,"/talent_requests"),children:"Manage talent requests"}),(null===r||void 0===r?void 0:r.currentContentStrategyId)&&(0,F.jsx)(T.rU,{to:"/admin2/content_strategies/".concat(r.currentContentStrategyId,"/edit"),children:"Manage content strategy"})]})]}),(0,F.jsxs)(mi,{children:[(0,F.jsx)(vi,{to:"/admin2/publications/".concat(n,"/edit"),children:"Publication info"}),(0,F.jsx)(vi,{to:"/admin2/publications/".concat(n,"/users"),children:"Users"}),(0,F.jsx)(vi,{to:"/admin2/publications/".concat(n,"/transactions"),children:"Transactions"}),(0,F.jsx)(vi,{to:"/admin2/publications/".concat(n,"/fixed_arr_credits"),$active:!0,children:"Fixed ARR Credits"}),(0,F.jsx)(vi,{to:"/admin2/publications/".concat(n,"/bulk_story_tagging"),children:"Bulk Story Tagging"}),(0,F.jsx)(vi,{to:"/admin2/publications/".concat(n,"/talent_requests"),children:"Talent Requests"})]}),(0,F.jsxs)(ji,{children:[(0,F.jsxs)(Zi,{children:[(0,F.jsx)(yi,{children:"Fixed ARR Credits"}),(0,F.jsx)(ki,{to:"/admin2/publications/".concat(n,"/fixed_arr_credits/new"),children:"Add Fixed ARR Credit"})]}),(0,F.jsx)(Pi,{children:(0,F.jsxs)(wi,{children:[(0,F.jsx)("input",{type:"checkbox",checked:u,onChange:function(n){return p(n.target.checked)}}),"Show Archived"]})}),0===c.length?(0,F.jsxs)(Ci,{children:[(0,F.jsx)("span",{children:"\u2139\ufe0f"}),"No Fixed ARR credits have been created for this publication yet."]}):(0,F.jsxs)(_i,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Si,{children:"Status"}),(0,F.jsx)(Si,{children:"Initial Amount"}),(0,F.jsx)(Si,{children:"Remaining Amount"}),(0,F.jsx)(Si,{children:"Utilization"}),(0,F.jsx)(Si,{children:"Margin %"}),(0,F.jsx)(Si,{children:"Term Start"}),(0,F.jsx)(Si,{children:"Term End"}),(0,F.jsx)(Si,{children:"Days Left"}),(0,F.jsx)(Si,{children:"Created By"}),(0,F.jsx)(Si,{children:"Actions"})]})}),(0,F.jsx)("tbody",{children:c.map((function(e){var t=e.is_archived?Ui:"tr";return(0,F.jsxs)(t,{children:[(0,F.jsx)($i,{children:(0,F.jsx)(Ti,{$status:e.status,$archived:e.is_archived,children:e.is_archived?"Archived":e.status.charAt(0).toUpperCase()+e.status.slice(1)})}),(0,F.jsx)($i,{children:Ai(e.initial_amount_dollars)}),(0,F.jsx)($i,{children:Ai(e.remaining_amount_dollars)}),(0,F.jsxs)($i,{children:[e.utilization_percentage,"%"]}),(0,F.jsxs)($i,{children:[e.margin_percentage,"%"]}),(0,F.jsx)($i,{children:Di(e.term_start_date)}),(0,F.jsx)($i,{children:Di(e.term_end_date)}),(0,F.jsx)($i,{children:(0,F.jsx)(zi,{$expired:e.days_left<0,$warning:e.days_left<=30&&e.days_left>=0,children:e.days_left<0?"Expired":"".concat(e.days_left," days")})}),(0,F.jsx)($i,{children:e.created_by}),(0,F.jsx)($i,{children:e.is_archived?(0,F.jsx)("span",{style:{color:"#9ca3af"},children:"(read-only)"}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ii,{as:T.rU,to:"/admin2/publications/".concat(n,"/fixed_arr_credits/").concat(e.id,"/edit"),children:"Edit"}),"active"===e.status&&(0,F.jsx)(qi,{onClick:function(){return m(e.id,e.remaining_amount_dollars>0)},children:e.remaining_amount_dollars>
10?"Expire & Write Off":"Archive"})]})})]},e.id)}))})]})]})]})},so=I.ZP.div(Fi||(Fi=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),uo=I.ZP.div(Ni||(Ni=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 24px;\n"]))),po=I.ZP.h1(Ei||(Ei=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),xo=I.ZP.div(Mi||(Mi=(0,S.Z)(["\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  text-align: right;\n  a { color: #00a6c2; text-decoration: none; font-size: 14px; &:hover { text-decoration: underline; } }\n"]))),ho=I.ZP.div(Li||(Li=(0,S.Z)(["\n  display: flex;\n  gap: 0;\n  border-bottom: 1px solid #e5e7eb;\n  margin-bottom: 24px;\n"]))),fo=(0,I.ZP)(T.rU)(Oi||(Oi=(0,S.Z)(["\n  padding: 12px 20px;\n  font-size: 14px;\n  font-weight: 500;\n  color: ",";\n  text-decoration: none;\n  border-bottom: 2px solid ",";\n  margin-bottom: -1px;\n  &:hover { color: #00a6c2; background: #f9fafb; }\n"])),(function(n){return n.$active?"#00a6c2":"#6b7280"}),(function(n){return n.$active?"#00a6c2":"transparent"})),bo=I.ZP.div(Hi||(Hi=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),go=I.ZP.h2(Bi||(Bi=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0 0 20px 0;\n  border-bottom: 1px solid #e5e7eb;\n  padding-bottom: 12px;\n"]))),mo=I.ZP.h3(Gi||(Gi=(0,S.Z)(["\n  font-size: 14px;\n  font-weight: 500;\n  color: #6b7280;\n  margin: 0 0 12px 0;\n"]))),vo=I.ZP.table(Xi||(Xi=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;\n  margin-bottom: 24px;\n"]))),jo=I.ZP.th(Ki||(Ki=(0,S.Z)(["\n  text-align: left;\n  padding: 10px 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n  background: #f9fafb;\n"]))),Zo=I.ZP.td(Vi||(Vi=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n"]))),yo=I.ZP.span(Wi||(Wi=(0,S.Z)(["\n  color: #00a6c2;\n"]))),ko=I.ZP.div(Qi||(Qi=(0,S.Z)(["\n  margin-top: 24px;\n"]))),Po=I.ZP.div(Yi||(Yi=(0,S.Z)(["\n  font-size: 14px;\n  font-weight: 500;\n  color: #374151;\n  margin-bottom: 8px;\n"]))),wo=I.ZP.div(Ji||(Ji=(0,S.Z)(["\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin-bottom: 16px;\n"]))),Co=I.ZP.span(no||(no=(0,S.Z)(["\n  display: inline-block;\n  padding: 4px 10px;\n  background: #e5e7eb;\n  border-radius: 16px;\n  font-size: 13px;\n  color: #374151;\n"]))),_o=I.ZP.div(eo||(eo=(0,S.Z)(["\n  margin-top: 24px;\n  padding: 20px;\n  border: 2px dashed #d1d5db;\n  border-radius: 8px;\n  text-align: center;
1\n"]))),So=I.ZP.input(to||(to=(0,S.Z)(["\n  display: none;\n"]))),$o=I.ZP.button(ro||(ro=(0,S.Z)(["\n  padding: 8px 16px;\n  background: #f3f4f6;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  cursor: pointer;\n  font-size: 14px;\n  \n  &:hover {\n    background: #e5e7eb;\n  }\n"]))),To=I.ZP.span(io||(io=(0,S.Z)(["\n  font-size: 14px;\n  color: #374151;\n  margin-left: 12px;\n"]))),zo=I.ZP.button(oo||(oo=(0,S.Z)(["\n  padding: 10px 20px;\n  background: #00a6c2;\n  color: white;\n  border: none;\n  border-radius: 4px;\n  font-size: 14px;\n  cursor: pointer;\n  margin-top: 12px;\n  &:hover { background: #0094ab; }\n  &:disabled { background: #9ca3af; cursor: not-allowed; }\n"]))),Io=I.ZP.div(ao||(ao=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),qo=I.ZP.div(co||(co=(0,S.Z)(["\n  color: #6b7280;\n  font-size: 14px;\n  font-style: italic;\n"])));var Ro,Uo,Ao,Do,Fo,No,Eo,Mo,Lo,Oo,Ho,Bo=function(){var n=(0,z.UO)().id,e=(0,$.useRef)(null),t=(0,$.useState)(null),r=(0,_.Z)(t,2),i=r[0],o=r[1],a=(0,$.useState)([]),c=(0,_.Z)(a,2),l=c[0],s=c[1],d=(0,$.useState)(!0),u=(0,_.Z)(d,2),p=u[0],x=u[1],h=(0,$.useState)(!0),f=(0,_.Z)(h,2),b=f[0],g=f[1],m=(0,$.useState)(null),v=(0,_.Z)(m,2),j=v[0],Z=v[1],y=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function e(){var t;return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,q.ZP.get("/admin2/publications/".concat(n,"/bulk_story_tagging/new.json"));case 3:t=e.sent,o(t.data.brandProfile),s(t.data.tagGroups||[]),g(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("Failed to load data",e.t0),g(!1);case 13:return e.prev=13,x(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,9,13,16]])}))),[n]);(0,$.useEffect)((function(){y()}),[y]);var k=i?"".concat(i.accountName," - ").concat(i.name):"Publication";return p?(0,F.jsx)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(Io,{children:"Loading..."})}):(0,F.jsxs)(U.Z,{title:"Publications",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:k,href:"/admin2/publications/".concat(n,"/edit")},{label:"Bulk Story Tagging"}],children:[(0,F.jsxs)(so,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsxs)(T.rU,{to:"/admin2/publications/".concat(n,"/edit"),children:[null===i||void 0===i?void 0:i.accountName," - ",null===i||void 0===i?void 0:i.name]}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Bulk story tagging"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"New"})]}),(0,F.jsxs)(uo,{children:[(0,F.jsxs)(po,{children:["Edit ",null===i||void 0===i?void 0:i.accountName," - ",null===i||void 0===i?void 0:i.name]}),(0,F.jsxs)(xo,{children:[(0,F.jsx)("a",{href:"/admin2/publications/".concat(n,"/talent_requests"),children:"Manage talent requests"}),(null===i||void 0===i?void 0:i.currentContentStrategyId)&&(0,F.jsx)(T.rU,{to:"/admin2/content_strategies/".concat(i.currentContentStrategyId,"/edit"),children:"Manage content strategy"})]})]}),(0,F.jsxs)(ho,{children:[(0,F.jsx)(fo,{to:"/admin2/publications/".concat(n,"/edit"),children:"Publication info"}),(0,F.jsx)(fo,{to:"/admin2/publications/".concat(n,"/users"),children:"Users"}),(0,F.jsx)(fo,{to:"/admin2/publications/".concat(n,"/transactions"),children:"Transactions"}),(0,F.jsx)(fo,{to:"/admin2/publications/".concat(n,"/fixed_arr_credits"),children:"Fixed ARR Credits"}),(0,F.jsx)(fo,{to:"/admin2/publications/".concat(n,"/bulk_story_tagging"),$active:!0,children:"Bulk Story Tagging"}),(0,F.jsx)(fo,{to:"/admin2/publications/".concat(n,"/talent_requests"),children:"Talent Requests"})]}),(0,F.jsxs)(bo,{children:[(0,F.jsx)(go,{children:"Bulk Story Tagging"}),(0,F.jsx)(mo,{children:"Example CSV"}),(0,F.jsxs)(vo,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(jo,{children:"Title"}),(0,F.jsx)(jo,{children:"Id"}),l.slice(0,2).map((function(n,e){return(0,F.jsxs)(jo,{children:["Tag Group ",e+1]},n.id)})),l.length<2&&(0,ne.Z)(Array(2-l.length)).map((function(n,e){return(0,F.jsxs)(jo,{children:["Tag Group ",l.length+e+1]},"placeholder-".concat(e))}))]})}),(0,F.jsx)("tbody",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Zo,{children:"How to Upload Stuff!"}),(0,F.jsx)(Zo,{children:"23145"}),(0,F.jsx)(Zo,{children:(0,F.jsx)(yo,{children:"Example Tag Name 1, Another Example Tag Name 1"})}),(0,F.jsx)(Zo,{children:(0,F.jsx)(yo,{children:"Example Tag Name 2, Another Example Tag Name 2"})})]})})]}),(0,F.jsx)(ko,{children:b?(0,F.jsx)(qo,{children:"loading..."}):0===l.length?(0,F.jsx)(qo,{children:"No tag groups configured for this publication."}):l.map((function(n){return(0,F.jsxs)("div",{children:[(0,F.jsx)(Po,{children:n.name}),(0,F.jsx)(wo,{children:0===n.tags.length?(0,F.jsx)("span",{style:{color:"#9ca3af",fontStyle:"italic"},children:"No tags in this group"}):n.tags.map((function(n){return(0,F.jsx)(Co,{children:n.name},n.id)}))})]},n.id)}))}),(0,F.jsxs)(_o,{children:[(0,F.jsx)("h4",{style:{margin:"0 0 12px 0",color:"#374151"},children:"Upload CSV File"}),(0,F.jsx)("p",{style:{margin:"0 0 16px 0",color:"#6b7280",fontSize:"14px"},children:"Upload a CSV file with story IDs and tags to bulk tag stories for this publication."}),(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:"16px 0"},children:[(0,F.jsx)(So,{ref:e,type:"file",accept:".csv",onChange:function(n){var e;return Z((null===(e=n.target.files)||void 0===e?void 0:e[0])||null)}}),(0,F.jsx)($o,{type:"button",onClick:function(){var n;return null===(n=e.current)||void 0===n?void 0:n.click()},children:"Choose File"}),(0,F.jsx)(To,{children:j?j.name:"No file chosen"})]}),(0,F.jsx)(zo,{disabled:!0,children:"Upload and Process"})]})]})]})},Go=I.ZP.div(Ro||(Ro=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),Xo=I.ZP.div(Uo||(Uo=(0,S.Z)(["\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n  margin-bottom: 24px;\n"]))),Ko=I.ZP.h1(Ao||(Ao=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0;\n"]))),Vo=I.ZP.div(Do||(Do=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),Wo=(I.ZP.h2(Fo||(Fo=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0 0 20px 0;\n  border-bottom: 1px solid #e5e7eb;\n  padding-bottom: 12px;\n"]))),I.ZP.table(No||(No=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;
1\n"])))),Qo=I.ZP.th(Eo||(Eo=(0,S.Z)(["\n  text-align: left;\n  padding: 10px 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n  background: #f9fafb;\n"]))),Yo=I.ZP.td(Mo||(Mo=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  color: ",";\n  border: 1px solid #e5e7eb;\n"])),(function(n){return n.$deleted?"#dc2626":"#374151"})),Jo=(0,I.ZP)(T.rU)(Lo||(Lo=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  &:hover { text-decoration: underline; }\n"]))),na=I.ZP.div(Oo||(Oo=(0,S.Z)(["\n  padding: 16px;\n  color: #6b7280;\n  background: #f9fafb;\n  border-radius: 4px;\n  text-align: center;\n"]))),ea=I.ZP.div(Ho||(Ho=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),ta=function(n){return n?new Date(n).toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}):"N/A"},ra=function(n){if(!n)return"Never updated";var e=new Date(n);return"(".concat(e.toLocaleString(),")")};var ia,oa,aa,ca,la,sa,da,ua,pa,xa,ha,fa,ba,ga,ma,va,ja,Za,ya,ka,Pa,wa=function(){var n,e=(0,z.UO)().id,t=(0,$.useState)(null),r=(0,_.Z)(t,2),i=r[0],o=r[1],a=(0,$.useState)(!0),c=(0,_.Z)(a,2),l=c[0],s=c[1],d=(0,$.useState)(null),u=(0,_.Z)(d,2),p=u[0],x=u[1],h=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function n(){var t;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,s(!0),n.next=4,q.ZP.get("/admin2/publications/".concat(e,"/talent_requests.json"));case 4:t=n.sent,o(t.data),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("Failed to load talent requests",n.t0),x("Failed to load talent requests");case 12:return n.prev=12,s(!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,8,12,15]])}))),[e]);(0,$.useEffect)((function(){h()}),[h]);var f=null!==i&&void 0!==i&&i.publication?"".concat(null===(n=i.publication.account)||void 0===n?void 0:n.name," - ").concat(i.publication.name):"Publication";return l?(0,F.jsx)(U.Z,{title:"Talent Requests",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(ea,{children:"Loading..."})}):p?(0,F.jsx)(U.Z,{title:"Talent Requests",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Error"}],children:(0,F.jsx)(Vo,{children:(0,F.jsx)(na,{children:p})})}):(0,F.jsxs)(U.Z,{title:"Talent Requests",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:f,href:"/admin2/publications/".concat(e,"/edit")},{label:"Talent requests"}],children:[(0,F.jsxs)(Go,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(e,"/edit"),children:f}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Talent requests"})]}),(0,F.jsx)(Xo,{children:(0,F.jsx)(Ko,{children:"Talent Requests"})}),(0,F.jsx)(Vo,{children:null!==i&&void 0!==i&&i.talentRequests&&i.talentRequests.length>0?(0,F.jsxs)(Wo,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Qo,{children:"ID"}),(0,F.jsx)(Qo,{children:"Title"}),(0,F.jsx)(Qo,{children:"Submitted"}),(0,F.jsx)(Qo,{children:"Needed by"}),(0,F.jsx)(Qo,{children:"Unfulfilled custom requests"}),(0,F.jsx)(Qo,{children:"Deleted"}),(0,F.jsx)(Qo,{children:"Eligible for ITR (last update date)"})]})}),(0,F.jsx)("tbody",{children:i.talentRequests.map((function(n){return(0,F.jsxs)("tr",{children:[(0,F.jsx)(Yo,{children:(0,F.jsx)(Jo,{to:"/admin2/publications/".concat(e,"/talent_requests/").concat(n.id),children:n.id})}),(0,F.jsx)(Yo,{children:(0,F.jsx)(Jo,{to:"/admin2/publications/".concat(e,"/talent_requests/").concat(n.id),children:n.title})}),(0,F.jsx)(Yo,{children:ta(n.submittedAt)}),(0,F.jsx)(Yo,{children:ta(n.neededBy)}),(0,F.jsx)(Yo,{children:n.unfulfilledCustomRequests}),(0,F.jsx)(Yo,{$deleted:!!n.deletedAt,children:n.deletedAt?ta(n.deletedAt):""}),(0,F.jsxs)(Yo,{children:[n.eligibleForItr?"true":"false",n.eligibleForItr&&(0,F.jsx)("span",{style:{marginLeft:"8px",color:"#6b7280"},children:n.lastRefreshedAt?ra(n.lastRefreshedAt):"(Never updated)"})]})]},n.id)}))})]}):(0,F.jsx)(na,{children:"No talent requests found"})})]})},Ca=I.ZP.div(ia||(ia=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  flex-wrap: wrap;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),_a=I.ZP.h1(oa||(oa=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0 0 24px 0;\n"]))),Sa=I.ZP.div(aa||(aa=(0,S.Z)(["\n  background: #fef2f2;\n  border: 1px solid #fecaca;\n  color: #dc2626;\n  padding: 12px 16px;\n  border-radius: 4px;\n  margin-bottom: 24px;\n  font-size: 14px;\n"]))),$a=I.ZP.div(ca||(ca=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),Ta=I.ZP.h2(la||(la=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  color: #111827;\n  margin: 0 0 20px 0;\n"]))),za=I.ZP.table(sa||(sa=(0,S.Z)(["\n  width: 100%;\n  max-width: 800px;\n  border-collapse: collapse;
1\n"]))),Ia=I.ZP.tr(da||(da=(0,S.Z)([""]))),qa=I.ZP.td(ua||(ua=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  font-weight: 600;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n  background: #f9fafb;\n  width: 200px;\n  vertical-align: top;\n"]))),Ra=I.ZP.td(pa||(pa=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n"]))),Ua=I.ZP.table(xa||(xa=(0,S.Z)(["\n  width: 100%;\n  border-collapse: collapse;\n  margin-top: 16px;\n"]))),Aa=I.ZP.th(ha||(ha=(0,S.Z)(["\n  text-align: left;\n  padding: 10px 12px;\n  font-size: 13px;\n  font-weight: 600;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n  background: #f9fafb;\n"]))),Da=I.ZP.td(fa||(fa=(0,S.Z)(["\n  padding: 10px 12px;\n  font-size: 14px;\n  color: #374151;\n  border: 1px solid #e5e7eb;\n  vertical-align: top;\n"]))),Fa=(0,I.ZP)(T.rU)(ba||(ba=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  font-size: 14px;\n  &:hover { text-decoration: underline; }\n"]))),Na=I.ZP.button(ga||(ga=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  font-size: 14px;\n  background: none;\n  border: none;\n  padding: 0;\n  cursor: pointer;\n  &:hover { text-decoration: underline; }\n"]))),Ea=I.ZP.a(ma||(ma=(0,S.Z)(["\n  color: #00a6c2;\n  text-decoration: none;\n  &:hover { text-decoration: underline; }\n"]))),Ma=I.ZP.ul(va||(va=(0,S.Z)(["\n  margin: 0;\n  padding-left: 20px;\n  list-style-type: disc;\n  \n  li {\n    margin-bottom: 4px;\n  }\n"]))),La=I.ZP.div(ja||(ja=(0,S.Z)(["\n  padding: 16px;\n  color: #6b7280;\n  background: #f9fafb;\n  border-radius: 4px;\n  text-align: left;\n  margin-top: 8px;\n"]))),Oa=I.ZP.div(Za||(Za=(0,S.Z)(["\n  padding: 12px 16px;\n  background: #f3f4f6;\n  border-radius: 4px;\n  margin-top: 12px;\n  font-size: 14px;\n  color: #374151;\n  \n  ul {\n    margin: 8px 0 0 0;\n    padding-left: 20px;\n  }\n  \n  li {\n    margin-bottom: 4px;\n  }\n"]))),Ha=I.ZP.div(ya||(ya=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),Ba=I.ZP.div(ka||(ka=(0,S.Z)(["\n  border-top: 1px solid #e5e7eb;\n  margin: 8px 0;\n"]))),Ga=I.ZP.div(Pa||(Pa=(0,S.Z)(["\n  font-weight: 600;\n  margin-top: 8px;\n"]))),Xa=function(n){return n?new Date(n).toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"}):"N/A"};var Ka,Va,Wa,Qa,Ya,Ja,nc,ec,tc,rc,ic,oc,ac,cc,lc,sc,dc,uc,pc,xc,hc,fc,bc=function(){var n,e,t,r=(0,z.UO)(),i=r.id,o=r.talentRequestId,a=(0,$.useState)(null),c=(0,_.Z)(a,2),l=c[0],s=c[1],d=(0,$.useState)(!0),u=(0,_.Z)(d,2),p=u[0],x=u[1],h=(0,$.useState)(null),f=(0,_.Z)(h,2),b=f[0],g=f[1],m=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function n(){var e;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,x(!0),n.next=4,q.ZP.get("/admin2/publications/".concat(i,"/talent_requests/").concat(o,".json"));case 4:e=n.sent,s(e.data),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("Failed to load talent request",n.t0),g("Failed to load talent request");case 12:return n.prev=12,x(!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,8,12,15]])}))),[i,o]);(0,$.useEffect)((function(){m()}),[m]);var v=null!==l&&void 0!==l&&l.publication?"".concat(null===(n=l.publication.account)||void 0===n?void 0:n.name," - ").concat(l.publication.name):"Publication",j=null===l||void 0===l?void 0:l.talentRequest;return p?(0,F.jsx)(U.Z,{title:"Talent Request",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(Ha,{children:"Loading..."})}):b||!j?(0,F.jsx)(U.Z,{title:"Talent Request",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Error"}],children:(0,F.jsx)($a,{children:(0,F.jsx)(La,{children:b||"Talent request not found"})})}):(0,F.jsxs)(U.Z,{title:"Talent Request",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:v,href:"/admin2/publications/".concat(i,"/edit")},{label:"Talent requests",href:"/admin2/publications/".concat(i,"/talent_requests")},{label:j.title}],children:[(0,F.jsxs)(Ca,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(i,"/edit"),children:v}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(i,"/talent_requests"),children:"Talent requests"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:j.title})]}),(0,F.jsx)(_a,{children:"Talent Request"}),j.deletedAt&&j.deletedBy&&(0,F.jsxs)(Sa,{children:["The talent request you are viewing was deleted by ",j.deletedBy," on ",Xa(j.deletedAt),"."]}),(0,F.jsx)($a,{children:(0,F.jsx)(za,{children:(0,F.jsxs)("tbody",{children:[(0,F.jsxs)(Ia,{
1children:[(0,F.jsx)(qa,{children:"Title"}),(0,F.jsx)(Ra,{children:j.title})]}),!j.defaultRequest&&j.description&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Description"}),(0,F.jsx)(Ra,{children:j.description})]}),j.pillar&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Pillar"}),(0,F.jsx)(Ra,{children:j.pillar})]}),j.storyFormat&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Format"}),(0,F.jsx)(Ra,{children:j.storyFormat})]}),j.language&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Language"}),(0,F.jsx)(Ra,{children:j.language})]}),!j.defaultRequest&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"On site"}),(0,F.jsx)(Ra,{children:j.onSite?j.location:"N/A"})]}),j.otherInfo&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Other info"}),(0,F.jsx)(Ra,{children:j.otherInfo})]}),j.contentExamples&&j.contentExamples.length>0&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Content examples"}),(0,F.jsxs)(Ra,{children:[(0,F.jsx)(Ma,{children:j.contentExamples.map((function(n,e){return(0,F.jsx)("li",{children:(0,F.jsx)(Ea,{href:n,target:"_blank",rel:"noopener noreferrer",children:n})},e)}))}),j.nlpTopics&&j.nlpTopics.length>0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ba,{}),(0,F.jsx)(Ga,{children:"Topics from content examples"}),j.nlpTopics.join(", ")]})]})]}),(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Topics"}),(0,F.jsx)(Ra,{children:(null===(e=j.topics)||void 0===e?void 0:e.join(", "))||"None"})]}),(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Skills"}),(0,F.jsx)(Ra,{children:(null===(t=j.skills)||void 0===t?void 0:t.join(", "))||"None"})]}),(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Contributor pay"}),(0,F.jsxs)(Ra,{children:["$",j.budgetRangeMin||0," - $",j.budgetRangeMax||0]})]}),(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Needed by"}),(0,F.jsx)(Ra,{children:Xa(j.neededBy)})]}),(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Submitted"}),(0,F.jsx)(Ra,{children:Xa(j.submittedAt)})]}),j.creator&&(0,F.jsxs)(Ia,{children:[(0,F.jsx)(qa,{children:"Creator"}),(0,F.jsx)(Ra,{children:j.creator})]})]})]})})}),(0,F.jsxs)($a,{children:[(0,F.jsx)(Ta,{children:"Custom talent requests"}),j.customTalentRequests&&j.customTalentRequests.length>0?(0,F.jsxs)(Ua,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Aa,{children:"ID"}),(0,F.jsx)(Aa,{children:"Submitted"}),(0,F.jsx)(Aa,{children:"Recommended User Count"}),(0,F.jsx)(Aa,{children:"Reasons"}),(0,F.jsx)(Aa,{children:"Add. Info"}),(0,F.jsx)(Aa,{children:"Actions"})]})}),(0,F.jsx)("tbody",{children:j.customTalentRequests.map((function(n){return(0,F.jsxs)("tr",{children:[(0,F.jsx)(Da,{children:n.id}),(0,F.jsx)(Da,{children:Xa(n.submittedAt)}),(0,F.jsx)(Da,{children:n.recommendedUserCount}),(0,F.jsx)(Da,{children:n.reasons&&n.reasons.length>0?(0,F.jsx)(Ma,{children:n.reasons.map((function(n,e){return(0,F.jsx)("li",{children:n},e)}))}):"None"}),(0,F.jsx)(Da,{children:n.additionalInformation||"N/A"}),(0,F.jsxs)(Da,{children:[(0,F.jsx)(Fa,{to:"/admin2/publications/".concat(i,"/talent_requests/").concat(o,"/custom_talent_requests/").concat(n.id,"/recommended_contributors/new"),children:"Add a recommended contributor"})," | ",(0,F.jsx)(Na,{onClick:(0,C.Z)((0,w.Z)().mark((function e(){var t,r,a,c;return(0,w.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(confirm("Send notification to the talent request creator about newly recommended contributors?")){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,q.ZP.get("/admin2/publications/".concat(i,"/talent_requests/").concat(o,"/custom_talent_requests/").concat(n.id,"/recommended_contributors/notify.json"));case 5:(t=e.sent).data.success?(alert(t.data.message),m()):alert(t.data.message||"Failed to send notification"),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),c=(null===e.t0||void 0===e.t0||null===(r=e.t0.response)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.message)||"Failed to send notification",alert(c);case 13:case"end":return e.stop()}}),e,null,[[2,9]])}))),children:"Send notification"})]})]},n.id)}))})]}):(0,F.jsx)(La,{children:"No custom talent requests"})]}),(0,F.jsxs)($a,{children:[(0,F.jsx)(Ta,{children:"Recommended contributors"}),null!==l&&void 0!==l&&l.recommendedContributors&&l.recommendedContributors.length>0?(0,F.jsxs)(Ua,{children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)(Aa,{children:"Name"}),(0,F.jsx)(Aa,{children:"Email"}),(0,F.jsx)(Aa,{children:"Clips"}),(0,F.jsx)(Aa,{children:"Status"}),(0,F.jsx)(Aa,{children:"Manual"}),(0,F.jsx)(Aa,{children:"Custom Talent Request ID"})]})}),(0,F.jsx)("tbody",{children:l.recommendedContributors.map((function(n){return(0,F.jsxs)("tr",{children:[(0,F.jsx)(Da,{
1children:n.name||"Not found"}),(0,F.jsx)(Da,{children:n.email||"Not found"}),(0,F.jsx)(Da,{children:n.clips&&n.clips.length>0?n.clips.map((function(n,e){return(0,F.jsx)("div",{children:n},e)})):""}),(0,F.jsx)(Da,{children:n.status}),(0,F.jsx)(Da,{children:n.manual?"true":"false"}),(0,F.jsx)(Da,{children:n.customTalentRequestId})]},n.id)}))})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(La,{children:"No recommended contributors"}),void 0!==(null===l||void 0===l?void 0:l.enoughContent)&&void 0!==(null===l||void 0===l?void 0:l.contentStrategyCompleted)&&(0,F.jsx)(Oa,{children:l.enoughContent&&l.contentStrategyCompleted?"This publication has met all requirements, but recommendations have not yet been generated. Check back tomorrow.":(0,F.jsxs)("ul",{children:[!l.contentStrategyCompleted&&(0,F.jsx)("li",{children:"This publication does not have a content strategy."}),!l.enoughContent&&(0,F.jsx)("li",{children:"This publication has not created enough english content."})]})})]})]})]})},gc=I.ZP.div(Ka||(Ka=(0,S.Z)(["\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font-size: 14px;\n  margin-bottom: 16px;\n  color: #6b7280;\n  flex-wrap: wrap;\n  a { color: #00a6c2; text-decoration: none; &:hover { text-decoration: underline; } }\n"]))),mc=I.ZP.h1(Va||(Va=(0,S.Z)(["\n  font-size: 24px;\n  font-weight: 600;\n  color: #d97706;\n  margin: 0 0 24px 0;\n"]))),vc=I.ZP.div(Wa||(Wa=(0,S.Z)(["\n  background: #fef3c7;\n  border: 1px solid #f59e0b;\n  color: #92400e;\n  padding: 12px 16px;\n  border-radius: 4px;\n  margin-bottom: 24px;\n  font-size: 14px;\n  font-weight: 500;\n"]))),jc=I.ZP.div(Qa||(Qa=(0,S.Z)(["\n  background: #fef2f2;\n  border: 1px solid #fecaca;\n  color: #dc2626;\n  padding: 12px 16px;\n  border-radius: 4px;\n  margin-bottom: 16px;\n  font-size: 14px;\n"]))),Zc=I.ZP.div(Ya||(Ya=(0,S.Z)(["\n  background: white;\n  border: 1px solid #e0e0e0;\n  border-radius: 4px;\n  padding: 24px;\n  margin-bottom: 24px;\n"]))),yc=I.ZP.div(Ja||(Ja=(0,S.Z)(["\n  margin-bottom: 20px;\n"]))),kc=I.ZP.label(nc||(nc=(0,S.Z)(["\n  display: block;\n  font-size: 14px;\n  font-weight: 500;\n  color: #374151;\n  margin-bottom: 6px;\n\n  ","\n"])),(function(n){return n.$required&&"\n    &::after {\n      content: ' *';\n      color: #ef4444;\n    }\n  "})),Pc=I.ZP.input(ec||(ec=(0,S.Z)(["\n  width: 100%;\n  max-width: 400px;\n  padding: 10px 14px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n\n  &:focus {\n    outline: none;\n    border-color: #00a6c2;\n    box-shadow: 0 0 0 3px rgba(0, 166, 194, 0.1);\n  }\n"]))),wc=I.ZP.select(tc||(tc=(0,S.Z)(["\n  width: 100%;\n  max-width: 400px;\n  padding: 10px 14px;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  font-size: 14px;\n  background: white;\n\n  &:focus {\n    outline: none;\n    border-color: #00a6c2;\n    box-shadow: 0 0 0 3px rgba(0, 166, 194, 0.1);\n  }\n"]))),Cc=I.ZP.div(rc||(rc=(0,S.Z)(["\n  position: absolute;\n  top: 100%;\n  left: 0;\n  right: 0;\n  max-width: 400px;\n  background: white;\n  border: 1px solid #d1d5db;\n  border-radius: 4px;\n  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n  max-height: 300px;\n  overflow-y: auto;\n  z-index: 100;\n"]))),_c=I.ZP.div(ic||(ic=(0,S.Z)(["\n  padding: 10px 14px;\n  cursor: pointer;\n  background: ",";\n  \n  &:hover {\n    background: #f3f4f6;\n  }\n  \n  .name { font-weight: 500; }\n  .email { font-size: 12px; color: #6b7280; }\n"])),(function(n){return n.$selected?"#f3f4f6":"white"})),Sc=I.ZP.div(oc||(oc=(0,S.Z)(["\n  position: relative;\n"]))),$c=I.ZP.div(ac||(ac=(0,S.Z)(["\n  margin-top: 16px;\n  padding: 16px;\n  background: #f9fafb;\n  border-radius: 4px;\n"]))),Tc=I.ZP.div(cc||(cc=(0,S.Z)(["\n  padding: 12px;\n  border-radius: 4px;\n  margin-bottom: 16px;\n  background: ",";\n  color: ",";\n  border: 1px solid ",";\n"])),(function(n){var e=n.$type;return"error"===e?"#fef2f2":"warning"===e?"#fef3c7":"#f0f9ff"}),(function(n){var e=n.$type;return"error"===e?"#dc2626":"warning"===e?"#92400e":"#0369a1"}),(function(n){var e=n.$type;return"error"===e?"#fecaca":"warning"===e?"#f59e0b":"#bae6fd"})),zc=I.ZP.div(lc||(lc=(0,S.Z)(["\n  display: flex;\n  gap: 12px;\n  margin-top: 24px;\n"]))),Ic=I.ZP.button(sc||(sc=(0,S.Z)(["\n  padding: 10px 20px;\n  border-radius: 4px;\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: all 0.2s;\n\n  ","\n"])),(function(n){return n.$primary?"\n    background: #00a6c2;\n    color: white;\n    border: none;\n    &:hover { background: #0891b2; }\n    &:disabled { background: #9ca3af;
1 cursor: not-allowed; }\n  ":"\n    background: white;\n    color: #374151;\n    border: 1px solid #d1d5db;\n    &:hover { background: #f9fafb; }\n  "})),qc=I.ZP.div(dc||(dc=(0,S.Z)(["\n  text-align: center;\n  padding: 48px;\n  color: #6b7280;\n"]))),Rc=I.ZP.div(uc||(uc=(0,S.Z)(["\n  display: ",";\n  position: fixed;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: rgba(0, 0, 0, 0.5);\n  align-items: center;\n  justify-content: center;\n  z-index: 1000;\n"])),(function(n){return n.$visible?"flex":"none"})),Uc=I.ZP.div(pc||(pc=(0,S.Z)(["\n  background: white;\n  border-radius: 8px;\n  padding: 24px;\n  max-width: 500px;\n  width: 90%;\n"]))),Ac=I.ZP.h3(xc||(xc=(0,S.Z)(["\n  font-size: 18px;\n  font-weight: 600;\n  margin: 0 0 16px 0;\n"]))),Dc=I.ZP.p(hc||(hc=(0,S.Z)(["\n  margin: 0 0 24px 0;\n  color: #374151;\n"]))),Fc=I.ZP.div(fc||(fc=(0,S.Z)(["\n  display: flex;\n  gap: 12px;\n  justify-content: flex-end;\n"])));var Nc=function(){var n,e,t,r,i=(0,z.UO)(),o=i.id,a=i.talentRequestId,c=i.ctrId,l=(0,z.s0)(),s=(0,$.useState)(null),d=(0,_.Z)(s,2),u=d[0],p=d[1],x=(0,$.useState)(!0),h=(0,_.Z)(x,2),f=h[0],b=h[1],g=(0,$.useState)(null),m=(0,_.Z)(g,2),v=m[0],j=m[1],Z=(0,$.useState)(!1),y=(0,_.Z)(Z,2),k=y[0],P=y[1],S=(0,$.useState)(""),I=(0,_.Z)(S,2),R=I[0],A=I[1],D=(0,$.useState)([]),N=(0,_.Z)(D,2),E=N[0],M=N[1],L=(0,$.useState)(null),O=(0,_.Z)(L,2),H=O[0],B=O[1],G=(0,$.useState)(!1),X=(0,_.Z)(G,2),K=X[0],V=X[1],W=(0,$.useState)(!1),Q=(0,_.Z)(W,2),Y=Q[0],J=Q[1],nn=(0,$.useState)(null),en=(0,_.Z)(nn,2),tn=en[0],rn=en[1],on=(0,$.useState)(!1),an=(0,_.Z)(on,2),cn=an[0],ln=an[1],sn=(0,$.useState)([null,null,null]),dn=(0,_.Z)(sn,2),un=dn[0],pn=dn[1],xn=(0,$.useState)(!1),hn=(0,_.Z)(xn,2),fn=hn[0],bn=hn[1],gn=(0,$.useState)(""),mn=(0,_.Z)(gn,2),vn=mn[0],jn=mn[1],Zn=(0,$.useCallback)((0,C.Z)((0,w.Z)().mark((function n(){var e;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,b(!0),n.next=4,q.ZP.get("/admin2/publications/".concat(o,"/talent_requests/").concat(a,"/custom_talent_requests/").concat(c,"/recommended_contributors/new.json"));case 4:e=n.sent,p(e.data),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("Failed to load page data",n.t0),j("Failed to load page data");case 12:return n.prev=12,b(!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[0,8,12,15]])}))),[o,a,c]);(0,$.useEffect)((function(){Zn()}),[Zn]),(0,$.useEffect)((function(){if(!(R.length<2)){var n=setTimeout((0,C.Z)((0,w.Z)().mark((function n(){var e;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return J(!0),n.prev=1,n.next=4,q.ZP.get("/admin2/users/autocomplete.json",{params:{query:R}});case 4:e=n.sent,M(e.data||[]),V(!0),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(1),console.error("User search failed",n.t0);case 12:return n.prev=12,J(!1),n.finish(12);case 15:case"end":return n.stop()}}),n,null,[[1,9,12,15]])}))),300);return function(){return clearTimeout(n)}}M([])}),[R]),(0,$.useEffect)((function(){if(H){var n=function(){var n=(0,C.Z)((0,w.Z)().mark((function n(){var e;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return ln(!0),n.prev=1,n.next=4,q.ZP.get("/admin2/publications/".concat(o,"/talent_requests/").concat(a,"/custom_talent_requests/").concat(c,"/recommended_contributors/users/").concat(H.id,".json"));case 4:e=n.sent,rn(e.data),pn([null,null,null]),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(1),console.error("Failed to load clips",n.t0),rn({error:"Failed to load clips",clips:[]});case 13:return n.prev=13,ln(!1),n.finish(13);case 16:case"end":return n.stop()}}),n,null,[[1,9,13,16]])})));return function(){return n.apply(this,arguments)}}();n()}else rn(null)}),[H,o,a,c]);var yn=function(){if(!H||!u)return null;var n=H.id;if(u.declinedUserIds.includes(n)){var e=u.declinedReasons[n];return"previously declined to work with this publication because they were ".concat(e,".")}return u.dismissedUserIds.includes(n)?"was previously dismissed by this publication.":"banned"===H.talentStatus?"was previously banned.":null},kn=function(){var n=(0,C.Z)((0,w.Z)().mark((function n(){var e,t,r,i,s,d,u,p,x=arguments;return(0,w.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=x.length>0&&void 0!==x[0]&&x[0],H){n.next=4;break}return alert("Please select a user"),n.abrupt("return");case 4:if(e){n.next=10;break}if(!(t=yn())){n.next=10;break}return jn("The contributor you are recommending ".concat(t)),bn(!0),n.abrupt("return");case 10:if(r=(null===tn||void 0===tn?void 0:tn.clips)&&tn.clips.length>0,i=null===tn||void 0===tn?void 0:tn.info,!r||i){n.next=17;break}
1if(!(un.filter((function(n){return null!==n})).length<3)){n.next=17;break}return alert("Please select 3 clips for this contributor"),n.abrupt("return");case 17:return P(!0),n.prev=18,s={recommended_contributor:{user_id:H.id,talent_request_id:a,recommended_contributor_clips_attributes:un.filter((function(n){return null!==n})).map((function(n){return{clip_id:n}}))}},n.next=22,q.ZP.post("/admin2/publications/".concat(o,"/talent_requests/").concat(a,"/custom_talent_requests/").concat(c,"/recommended_contributor.json"),s);case 22:l("/admin2/publications/".concat(o,"/talent_requests/").concat(a)),n.next=29;break;case 25:n.prev=25,n.t0=n.catch(18),p=(null===n.t0||void 0===n.t0||null===(d=n.t0.response)||void 0===d||null===(u=d.data)||void 0===u?void 0:u.message)||"Failed to add recommended contributor",j(p);case 29:return n.prev=29,P(!1),bn(!1),n.finish(29);case 33:case"end":return n.stop()}}),n,null,[[18,25,29,33]])})));return function(){return n.apply(this,arguments)}}(),Pn=null!==u&&void 0!==u&&u.publication?"".concat(null===(n=u.publication.account)||void 0===n?void 0:n.name," - ").concat(u.publication.name):"Publication";return f?(0,F.jsx)(U.Z,{title:"Add Recommended Contributor",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:"Loading..."}],children:(0,F.jsx)(qc,{children:"Loading..."})}):(0,F.jsxs)(U.Z,{title:"Add Recommended Contributor",breadcrumb:[{label:"Publications",href:"/admin2/publications"},{label:Pn,href:"/admin2/publications/".concat(o,"/edit")},{label:"Talent requests",href:"/admin2/publications/".concat(o,"/talent_requests")},{label:(null===u||void 0===u||null===(e=u.talentRequest)||void 0===e?void 0:e.title)||"Talent Request",href:"/admin2/publications/".concat(o,"/talent_requests/").concat(a)},{label:"Custom talent requests"},{label:"Add recommended contributor"}],children:[(0,F.jsxs)(gc,{children:[(0,F.jsx)(T.rU,{to:"/admin2/publications",children:"Publications"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(o,"/edit"),children:Pn}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(o,"/talent_requests"),children:"Talent requests"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)(T.rU,{to:"/admin2/publications/".concat(o,"/talent_requests/").concat(a),children:null===u||void 0===u||null===(t=u.talentRequest)||void 0===t?void 0:t.title}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Custom talent requests"}),(0,F.jsx)("span",{children:"\u203a"}),(0,F.jsx)("span",{children:"Add recommended contributor"})]}),(0,F.jsx)(mc,{children:"Add a recommended contributor"}),!(null!==u&&void 0!==u&&null!==(r=u.publication)&&void 0!==r&&r.contentStrategyCompleted)&&(0,F.jsx)(vc,{children:"WARNING! THIS PUBLICATION HAS NOT INPUT THEIR CONTENT STRATEGY IN CONTENTLY."}),v&&(0,F.jsx)(jc,{children:v}),(0,F.jsxs)(Zc,{children:[(0,F.jsxs)(yc,{children:[(0,F.jsx)(kc,{$required:!0,children:"User"}),(0,F.jsxs)(Sc,{children:[(0,F.jsx)(Pc,{type:"text",placeholder:"Start typing to find a user",value:R,onChange:function(n){A(n.target.value),n.target.value||B(null)},onFocus:function(){return E.length>0&&V(!0)},onBlur:function(){return setTimeout((function(){return V(!1)}),200)}}),K&&E.length>0&&(0,F.jsx)(Cc,{children:E.map((function(n){return(0,F.jsxs)(_c,{onClick:function(){return function(n){B(n),A(n.name),V(!1)}(n)},$selected:(null===H||void 0===H?void 0:H.id)===n.id,children:[(0,F.jsx)("div",{className:"name",children:n.name}),(0,F.jsx)("div",{className:"email",children:n.email})]},n.id)}))})]}),Y&&(0,F.jsx)("div",{style:{marginTop:8,color:"#6b7280"},children:"Searching..."}),"banned"===(null===H||void 0===H?void 0:H.talentStatus)&&(0,F.jsx)(jc,{style:{marginTop:12},children:"This contributor was previously banned."})]}),H&&(0,F.jsx)($c,{children:cn?(0,F.jsx)("div",{children:"Loading clips..."}):null!==tn&&void 0!==tn&&tn.error?(0,F.jsx)(Tc,{$type:"error",children:tn.error}):null!==tn&&void 0!==tn&&tn.warning?(0,F.jsx)(Tc,{$type:"warning",children:tn.warning}):null!==tn&&void 0!==tn&&tn.info?(0,F.jsx)(Tc,{$type:"info",children:tn.info}):null!==tn&&void 0!==tn&&tn.clips&&tn.clips.length>0?(0,F.jsx)(F.Fragment,{children:[0,1,2].map((function(n){return(0,F.jsxs)(yc,{children:[(0,F.jsxs)(kc,{$required:!0,children:["Clip ",n+1]}),(0,F.jsxs)(wc,{value:un[n]||"",onChange:function(e){return function(n,e){var t=(0,ne.Z)(un);t[n]=e?parseInt(e,10):null,pn(t)}(n,e.target.value)},required:!0,children:[(0,F.jsx)("option",{value:"",children:"Select a clip..."}),tn.clips.map((function(n){return(0,F.jsx)("option",{value:n.id,children:n.title},n.id)}))]})]},n)}))}):(0,F.jsxs)(Tc,{$type:"info",children:["The user ",H.name," has no clips to add."]})}),(0,F.jsxs)(zc,{children:[(0,F.jsx)(Ic,{onClick:function(){return l("/admin2/publications/".concat(o,"/talent_requests/").concat(a))},children:"Cancel"}),(0,F.jsx)(Ic,{$primary:!0,onClick:function(){return kn()}
1,disabled:!H||k,children:k?"Saving...":"Save"})]})]}),(0,F.jsx)(Rc,{$visible:fn,children:(0,F.jsxs)(Uc,{children:[(0,F.jsx)(Ac,{children:"Warning"}),(0,F.jsx)(Dc,{children:vn}),(0,F.jsxs)(Fc,{children:[(0,F.jsx)(Ic,{onClick:function(){return bn(!1)},children:"Cancel"}),(0,F.jsx)(Ic,{$primary:!0,onClick:function(){return kn(!0)},children:"Recommend anyway"})]})]})})]})}}}]);
2//# sourceMappingURL=4806.9d356625.chunk.js.map

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.