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
21 KiB

var Y=Object.defineProperty;var q=(e,i,l)=>i in e?Y(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l;var a=(e,i,l)=>q(e,typeof i!="symbol"?i+"":i,l);import{y as Q,d as M}from"./js-yaml-CxlQHuPU.js";import{R as x}from"./index-BH4jUAKp.js";import{V as J,f as W,e as Z,y as K,C as X,_ as ee,g as A,h as o,i as u,j as t,k as n,t as v,l as d,w as E,F as T,z as V,p as S,x as s}from"./index-BLqts8WY.js";import{u as ie}from"./index-CsfPLOYu.js";import{G as te}from"./GiftedDialog-CFmou4Be.js";import{Q as se}from"./QuickNav-DgCyvgDx.js";import{B,l as oe,s as le,e as re,h as ae,i as ne,g as G,j as de,k as me,m as fe,n as ue,p as he,q as ce,u as pe,v as ve}from"./index-MyY_xqVN.js";import"./concat-BK8PKeDS.js";import"./sort-Dh4GzQVc.js";var Ce=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,ge=(e,i,l,m)=>{for(var h=m>1?void 0:m?ye(i,l):i,g=e.length-1,C;g>=0;g--)(C=e[g])&&(h=(m?C(i,l,h):C(h))||h);return m&&h&&Ce(i,l,h),h};let L=class extends J{constructor(){super(...arguments);a(this,"$notify");a(this,"activeDid","");a(this,"allMyDids",[]);a(this,"allContacts",[]);a(this,"apiServer","");a(this,"canShare",!1);a(this,"confirmerIdList",[]);a(this,"confsVisibleErrorMessage","");a(this,"confsVisibleToIdList",[]);a(this,"detailsForGive",null);a(this,"detailsForOffer",null);a(this,"fullClaim",null);a(this,"fullClaimDump","");a(this,"fullClaimMessage","");a(this,"isEditedGlobalId",!1);a(this,"isRegistered",!1);a(this,"issuerName","");a(this,"numConfsNotVisible",0);a(this,"providersForGive",[]);a(this,"showIdCopy",!1);a(this,"showVeriClaimDump",!1);a(this,"veriClaim",B);a(this,"veriClaimDump","");a(this,"veriClaimDidsVisible",{});a(this,"windowLocation",window.location.href);a(this,"R",x);a(this,"yaml",Q);a(this,"libsUtil",oe);a(this,"serverUtil",le);a(this,"window",window)}resetThisValues(){this.confirmerIdList=[],this.confsVisibleErrorMessage="",this.confsVisibleToIdList=[],this.detailsForGive=null,this.detailsForOffer=null,this.fullClaim=null,this.fullClaimDump="",this.fullClaimMessage="",this.isEditedGlobalId=!1,this.numConfsNotVisible=0,this.providersForGive=[],this.veriClaim=B,this.veriClaimDump="",this.veriClaimDidsVisible={}}async created(){const l=await W();this.activeDid=l.activeDid||"",this.apiServer=l.apiServer||"",this.allContacts=await Z.contacts.toArray(),this.isRegistered=l.isRegistered||!1;try{this.allMyDids=await re()}catch(g){K("Error retrieving all account DIDs on home page:"+g,!0),this.$notify({group:"alert",type:"danger",title:"Error Loading Profile",text:"See the Help page for problems with your personal data."},-1)}const m=window.location.pathname.substring(7);let h;m?(h=decodeURIComponent(m),await this.loadClaim(h,this.activeDid)):this.$notify({group:"alert",type:"danger",title:"Error",text:"No claim ID was provided."},-1),this.canShare=!!navigator.share}capitalizeAndInsertSpacesBeforeCaps(l){return l?l[0].toUpperCase()+l.substr(1).replace(/([A-Z])/g," $1"):""}totalConfirmers(){return this.numConfsNotVisible+this.confirmerIdList.length+this.confsVisibleToIdList.length}didInfo(l){return ae(l,this.activeDid,this.allMyDids,this.allContacts)}async loadClaim(l,m){var f;const h=ne(l)?"/api/claim/byHandle/":"/api/claim/",g=this.apiServer+h+encodeURIComponent(l),C=await G(m);try{const c=await this.axios.get(g,{headers:C});if(c.status===200)this.veriClaim=c.data,this.issuerName=this.didInfo(this.veriClaim.issuer),this.veriClaimDump=M(this.veriClaim),this.veriClaimDidsVisible=de(this.veriClaim,!0);else{console.error("Error getting claim:",c),this.$notify({group:"alert",type:"danger",title:"Error",text:"There was a problem retrieving that claim."},-1);return}if(this.isEditedGlobalId=!this.veriClaim.handleId.endsWith(l),this.veriClaim.claimType==="GiveAction"){const k=this.apiServer+"/api/v2/report/gives?handleId="+encodeURIComponent(this.veriClaim.handleId),I=await G(m),y=await this.axios.get(k,{headers:I});y.status===200&&((f=y.data.data)==null?void 0:f.length)>0?this.detailsForGive=y.data.data[0]:console.error("Error getting detailed give info:",y);const $=this.apiServer+"/api/v2/report/providersToGive?h