You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
7.8 KiB

var A=Object.defineProperty;var I=(e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var a=(e,t,r)=>I(e,typeof t!="symbol"?t+"":t,r);import{V as P,f as b,e as x,u as h,C,_ as $,g as k,h as d,i as w,j as o,k as c,t as l,p as y,l as u,w as T,F as U,z as g,x as f}from"./index-BLqts8WY.js";import{G as J}from"./GiftedDialog-CFmou4Be.js";import{Q as N}from"./QuickNav-DgCyvgDx.js";import{E as S}from"./EntityIcon-CF1RwQI5.js";import{h as M,A as R,e as _,ax as V,ay as L}from"./index-MyY_xqVN.js";import"./index-CsfPLOYu.js";var B=Object.defineProperty,H=Object.getOwnPropertyDescriptor,E=(e,t,r,i)=>{for(var n=i>1?void 0:i?H(t,r):t,O=e.length-1,p;O>=0;O--)(p=e[O])&&(n=(i?p(t,r,n):p(n))||n);return i&&n&&B(t,r,n),n};let j=class extends P{constructor(){super(...arguments);a(this,"$notify");a(this,"activeDid","");a(this,"allContacts",[]);a(this,"allMyDids",[]);a(this,"apiServer","");a(this,"lastAckedOfferToUserJwtId","");a(this,"lastAckedOfferToUserProjectsJwtId","");a(this,"newOffersToUser",[]);a(this,"newOffersToUserHitLimit",!1);a(this,"newOffersToUserProjects",[]);a(this,"newOffersToUserProjectsHitLimit",!1);a(this,"showOffersDetails",!1);a(this,"showOffersToUserProjectsDetails",!1);a(this,"didInfo",M);a(this,"displayAmount",R)}async created(){try{const r=await b();this.apiServer=r.apiServer||"",this.activeDid=r.activeDid||"",this.lastAckedOfferToUserJwtId=r.lastAckedOfferToUserJwtId||"",this.lastAckedOfferToUserProjectsJwtId=r.lastAckedOfferToUserProjectsJwtId||"",this.allContacts=await x.contacts.toArray(),this.allMyDids=await _();const i=await V(this.axios,this.apiServer,this.activeDid,this.lastAckedOfferToUserJwtId);this.newOffersToUser=i.data,this.newOffersToUserHitLimit=i.hitLimit;const n=await L(this.axios,this.apiServer,this.activeDid,this.lastAckedOfferToUserProjectsJwtId);this.newOffersToUserProjects=n.data,this.newOffersToUserProjectsHitLimit=n.hitLimit}catch(r){console.error("Error retrieving settings & contacts:",r),this.$notify({group:"alert",type:"danger",title:"Error",text:r.message||"There was an error retrieving your activity."},5e3)}}async expandOffersToUserAndMarkRead(){this.showOffersDetails=!this.showOffersDetails,this.showOffersDetails&&(await h(this.activeDid,{lastAckedOfferToUserJwtId:this.newOffersToUser[0].jwtId}),this.$notify({group:"alert",type:"info",title:"Marked as Read",text:"The offers are marked as viewed. Click in the list to keep them as new."},5e3))}async markOffersAsReadStartingWith(r){const i=this.newOffersToUser.findIndex(n=>n.jwtId===r);i!==-1&&i<this.newOffersToUser.length-1?await h(this.activeDid,{lastAckedOfferToUserJwtId:this.newOffersToUser[i+1].jwtId}):await h(this.activeDid,{lastAckedOfferToUserJwtId:this.lastAckedOfferToUserJwtId}),this.$notify({group:"alert",type:"info",title:"Marked as Unread",text:"All offers above that one are marked as unread."},3e3)}async expandOffersToUserProjectsAndMarkRead(){this.showOffersToUserProjectsDetails=!this.showOffersToUserProjectsDetails,this.showOffersToUserProjectsDetails&&(await h(this.activeDid,{lastAckedOfferToUserProjectsJwtId:this.newOffersToUserProjects[0].jwtId}),this.$notify({group:"alert",type:"info",title:"Marked as Read",text:"The offers are marked as viewed. Click in the list to keep them as new."},5e3))}async markOffersToUserProjectsAsReadStartingWith(r){const i=this.newOffersToUserProjects.findIndex(n=>n.jwtId===r);i!==-1&&i<this.newOffersToUserProjects.length-1?await h(this.activeDid,{lastAckedOfferToUserProjectsJwtId:this.newOffersToUserProjects[i+1].jwtId}):await h(this.activeDid,{lastAckedOfferToUserProjectsJwtId:this.lastAckedOfferToUserProjectsJwtId}),this.$notify({group:"alert",type:"info",title:"Marked as Unread",text:"All offers above that one are marked as unread."},3e3)}};j=E([C({components:{GiftedDialog:J,QuickNav:N,EntityIcon:S}})],j);const F={id:"Content",class:"p-6 pb-24 max-w-3xl mx-auto"},Q={id:"ViewBreadcrumb",class:"mb-8"},W={class:"text-lg text-center font-light relative px-7"},Y={class:"flex justify-between","data-testId":"showOffersToUser"},G={class:"text-lg font-medium"},z={cla