- License
- information please see https://acorn-store-frontend-47gv1yuc5.cdn.withremark.com/chunk-HQILTOF6.js.LEGAL.txt
- Authors
- r,impersonatedExpert:a}=e;return wH(t)?h4(r)||, r,impersonatedExpert:a}=e;return wH(t)?h4(r)||!!a:!1}function Hl(e){return e.filter(dke)}var _H,xH,Hu=m(()=>{"use strict";_H=[fe.Message,fe.Recommended],xH=new Set(["ExpertProfile","SystemAuthor"])});function AH(e){let[t]=Kn(M2.getStorageItem());return(0,FH.useMemo)(()=>{let r=new Set;if(t)try{r=new Set(JSON.parse(t))}catch{}let a=Hl(e),n=a.filter(o=>r.has(o.id)).length,i;for(let o=a.length-1;o>=0;o--){let s=a[o];if(r.has(s.id)&&s.body){i=s.body;break}}return{unreadCount:n,lastUnreadMessage:i}},[t,e])}var M2,Yl,Yu=m(()=>{"use strict";vc(),Hu(),Es(),M2=class EH{static STORAGE_KEY="remark-unread-message-ids";static storageItem=new oo(EH.STORAGE_KEY);static getUnreadMessageIds(){let t=this.storageItem.value;if(!t)return new Set;try{return new Set(JSON.parse(t))}catch{return new Set}}static markAsUnread(t){let r=this.getUnreadMessageIds();r.has(t)||(r.add(t),this.storageItem.value=JSON.stringify(Array.from(r)))}static markAsRead(t){let r=this.getUnreadMessageIds();r.has(t)&&(r.delete(t),this.storageItem.value=JSON.stringify(Array.from(r)))}static markAllAsRead(){this.storageItem.value=JSON.stringify([])}static getUnreadCount(t){let r=this.getUnreadMessageIds();return Hl(t).filter(a=>r.has(a.id)).length}static getLastUnreadMessage(t){let r=this.getUnreadMessageIds(),a=Hl(t);for(let n=a.length-1;n>=0;n--){let i=a[n];if(r.has(i.id)&&i.body)return i.body}}static isMessageUnread(t){return this.getUnreadMessageIds().has(t)}static getStorageItem(){return this.storageItem}},Yl=M2});function zH(e,t){let r=ge();return e.tagline??t??D2(r)}var D2,Ay,Lz,Vz,Wz,Qi,CH,Ku=m(()=>{"use strict";ke(),D2=e=>e.expert.defaultTagline,Ay=e=>{if(!e)return;let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).getFullYear()},Lz=e=>{let t=e?.gallery?.map(a=>a&&"url"in a?a.url:void 0).filter(a=>!!a)??[];if(t.length>0)return t;let r=e?.coverPhoto;return r?[r]:void 0},Vz=(e,t)=>{if(!t?.workExperience||!Array.isArray(t.workExperience))return;let r=t.workExperience.map(a=>{if(!a||typeof a.role!="string"||a.role.trim().length===0)return null;let n=typeof a.startDate=="string"?Ay(a.startDate):void 0,i=typeof a.endDate=="string"&&a.endDate?Ay(a.endDate):void 0,o=n||i?`${n??"\u2014"} \u2013 ${i??e.expert.present}`:void 0;return{title:a.employer?`${a.role} @ ${a.employer}`:a.role,timeframe:o,description:null}}).filter(a=>!!a);return r.length>0?r:void 0},Wz=(e,t,r,a)=>r?ie(e.expert.expertSuffix,{vendorExpertise:r}):t?.tagline?t.tagline:t?.bio?t.bio:a?ie(e.expert.expertSuffix,{vendorExpertise:a}):D2(e),Qi=(e,t,r={})=>{let{vendor:a,fallbackName:n,defaultIsAi:i=!0}=r,o=a?.expertise?.text??null,s=e.expert.fallbackName;a?.name&&(s=ie(e.expert.agentSuffix,{brandName:a.name})),o&&(s=ie(e.expert.expertSuffix,{vendorExpertise:o})),n&&(s=n);let l=t?.publicName&&t.publicName.trim().length>0?t.publicName:s,c=Lz(t),d=Vz(e,t),p=Wz(e,t,a?.expertise?.text??null,a?.name??null),u=t?.bio??null,h=t&&"location"in t&&typeof t.location=="string"?t.location:null,g=t&&"link"in t&&typeof t.link=="string"?t.link:void 0,y=t?.isAiExpert??i,k=t?.isExternalExpert??!1,v=typeof t?.rating=="number"?t.rating:void 0;return{id:t&&"id"in t&&typeof t.id=="string"?t.id:void 0,name:l,avatarUrl:t?.avatar??a?.logo??null,coverPhotos:c,tagline:p,location:h,profileMarkdown:u,experience:d,profileLink:g,rating:v,isAi:y,isExternal:k}},CH=(e,t)=>{let r=e.coverPhotos??[];return typeof t=="number"?r.slice(0,t):r}});function uke(){let e=ge(),[t,r]=(0,en.useState)([]),[a,n]=(0,en.useState)(null),i=(0,en.useRef)(void 0),o=(0,en.useCallback)(()=>{clearTimeout(i.current),n(null)},[]),s=(0,en.useCallback)(p=>{clearTimeout(i.current),n(p),i.current=setTimeout(()=>n(null),SH)},[]),l=(0,en.useCallback)(p=>{o();let u=p.filter(y=>y.type.startsWith("image/"));if(u.length===0)return;let h=u.filter(y=>y.size>P2),g=u.filter(y=>y.size
- Version (from header)
- 1.0.18