player-map 2.0.14 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -70748,8 +70748,8 @@ const zo = {
70748
70748
  // predicate → is member of
70749
70749
  IN: "0xb0d3de9abeebc79e74504814f69d38eae809410c9759678855f79d1b4c7405cb",
70750
70750
  // predicate → in
70751
- ACCEPTED: "0x69b32b0ec575de94fea50d8ed84f198d46ab1590b6ec10d6527a1cc93c2c2dc"
70752
- // TODO: replace with real term_id once atom is created on-chain
70751
+ ACCEPTED: "0x69b32b0ec575de94fea50d8ed84f198d46ab1590b6ec10d6527a1cc93c2c2dc1"
70752
+ // predicate accepted
70753
70753
  }, qfe = zo.HAS_ALIAS, $fe = {
70754
70754
  PLAYER_GAME: {
70755
70755
  predicateId: zo.IS_PLAYER_OF,
package/dist/index.umd.js CHANGED
@@ -5840,7 +5840,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
5840
5840
  image
5841
5841
  }
5842
5842
  }
5843
- }`;try{const a=await(await fetch(Xi[e],{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:i,variables:{termIds:n}})})).json();return a.errors?(console.error("[fetchTriplesByTermIds] GraphQL errors:",a.errors),[]):((r=a.data)==null?void 0:r.triples)??[]}catch(s){return console.error("[fetchTriplesByTermIds] error:",s),[]}},Zhe=(n,e=jt.MAINNET,i)=>{const[r,s]=H.useState([]),[a,o]=H.useState({follows:[],followers:[]}),{COMMON_IDS:l}=i,{aliases:u,playerAtomId:c,isLoading:h}=Ib({walletAddress:n,constants:i,network:e}),d=H.useMemo(()=>{if(!c)return null;const M=u.find(w=>w.isPrimary)??u[0]??null;let A=(M==null?void 0:M.pseudo)??"";try{A=JSON.parse(A).name||A}catch{}return{term_id:c,label:A,image:(M==null?void 0:M.image)??""}},[c,u]),{positions:p,loading:f,error:m}=O0(n,e),b=H.useMemo(()=>p.filter(M=>{var A,w;return((w=(A=M.term)==null?void 0:A.triple)==null?void 0:w.predicate_id)===l.IN}).map(M=>M.term.triple.subject_id).filter(Boolean),[p,l.IN]),{data:y}=ra({queryKey:["triplesByTermIds",b,e],queryFn:()=>Qhe(b,e),enabled:b.length>0,staleTime:5*60*1e3,gcTime:10*60*1e3}),g=H.useMemo(()=>{const M=new Map;for(const A of y??[])A.object&&M.set(A.term_id,A.object);return M},[y]),x=H.useMemo(()=>{const M=new Set([l.IS_PLAYER_OF,l.IS_MEMBER_OF,l.IS,l.IN]),A=new Set;return p.filter(w=>{var N;const E=(N=w.term)==null?void 0:N.triple;return!E||!M.has(E.predicate_id)?!1:E.predicate_id===l.IS&&c?E.subject_id===c:!0}).filter(w=>{const E=w.term.triple.term_id;return A.has(E)?!1:(A.add(E),!0)}).map(w=>{const E=w.term.triple;if(E.predicate_id===l.IN){const N=g.get(E.subject_id)??null;return{term_id:E.term_id,predicate_id:l.IS,object_id:(N==null?void 0:N.term_id)??E.subject_id,object:N,term:w.term,counter_term:E.counter_term}}return{term_id:E.term_id,predicate_id:E.predicate_id,object_id:E.object_id,object:E.object,term:w.term,counter_term:E.counter_term}}).filter(w=>w.object!=null)},[p,l,g,c]),{data:_}=ra({queryKey:["triplesForAgent",n,e],queryFn:()=>$he(n,e),enabled:!!n,staleTime:2*60*1e3,gcTime:5*60*1e3}),{data:v}=ra({queryKey:["followsAndFollowers",l.FOLLOWS,n,e],queryFn:()=>Xhe(l.FOLLOWS,n,e),enabled:!!n,staleTime:2*60*1e3,gcTime:5*60*1e3});H.useEffect(()=>{_&&s(_)},[_]),H.useEffect(()=>{v&&o(v)},[v]);const T=h||f,S=m;return{atomDetails:d,triples:r,positions:p,activities:x,connections:a,loading:T,error:S?typeof S=="string"?S:S.message:null}},Jhe=(n,e=jt.MAINNET)=>{const{data:i,isLoading:r,error:s,isError:a}=ra({queryKey:["atomDetails",n==null?void 0:n.id,e],queryFn:()=>qhe(n.id,e),enabled:!!(n!=null&&n.id),staleTime:3e5,gcTime:6e5,retry:1});return{atomDetails:i||null,loading:r,error:a?s.message:null}},ede=(n,e=jt.MAINNET)=>{const{data:i,isLoading:r,error:s,isError:a}=ra({queryKey:["claimsBySubject",n==null?void 0:n.id,e],queryFn:()=>KD(n.id,e),enabled:!!(n!=null&&n.id),staleTime:12e4,gcTime:3e5,retry:1});return{claims:i||[],loading:r,error:a?s.message:null}},Ef={overlay:"_overlay_vc3i0_3",card:"_card_vc3i0_18",title:"_title_vc3i0_27",subtitle:"_subtitle_vc3i0_32",btn:"_btn_vc3i0_38"},QD=({isOpen:n,onConnectWallet:e})=>n?R.jsx("div",{className:Ef.overlay,children:R.jsxs("div",{className:Ef.card,children:[R.jsx("h2",{className:Ef.title,children:"Wallet Required"}),R.jsx("p",{className:Ef.subtitle,children:"Please connect your wallet to access this feature"}),R.jsx("button",{onClick:e,className:Ef.btn,children:"Connect Wallet"})]})}):null,jh={overlay:"_overlay_5roae_3",card:"_card_5roae_18",closeBtn:"_closeBtn_5roae_28",title:"_title_5roae_39",subtitle:"_subtitle_5roae_44",btn:"_btn_5roae_50"},tde=({isOpen:n,onCreatePlayer:e,onClose:i})=>n?R.jsx("div",{className:jh.overlay,children:R.jsxs("div",{className:jh.card,children:[i&&R.jsx("button",{onClick:i,className:jh.closeBtn,children:"×"}),R.jsx("h2",{className:jh.title,children:"Player Required"}),R.jsx("p",{className:jh.subtitle,children:"You need to create a player before you can vote on claims"}),R.jsx("button",{onClick:e,className:jh.btn,children:"Create Player"})]})}):null;var ZD={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},JD=H.createContext&&H.createContext(ZD),ide=["attr","size","title"];function nde(n,e){if(n==null)return{};var i,r,s=rde(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)i=a[r],e.indexOf(i)===-1&&{}.propertyIsEnumerable.call(n,i)&&(s[i]=n[i])}return s}function rde(n,e){if(n==null)return{};var i={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;i[r]=n[r]}return i}function D0(){return D0=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},D0.apply(null,arguments)}function eL(n,e){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),i.push.apply(i,r)}return i}function L0(n){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?eL(Object(i),!0).forEach(function(r){sde(n,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):eL(Object(i)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(i,r))})}return n}function sde(n,e,i){return(e=ade(e))in n?Object.defineProperty(n,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[e]=i,n}function ade(n){var e=ode(n,"string");return typeof e=="symbol"?e:e+""}function ode(n,e){if(typeof n!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function tL(n){return n&&n.map((e,i)=>H.createElement(e.tag,L0({key:i},e.attr),tL(e.child)))}function k0(n){return e=>H.createElement(lde,D0({attr:L0({},n.attr)},e),tL(n.child))}function lde(n){var e=i=>{var{attr:r,size:s,title:a}=n,o=nde(n,ide),l=s||i.size||"1em",u;return i.className&&(u=i.className),n.className&&(u=(u?u+" ":"")+n.className),H.createElement("svg",D0({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,r,o,{className:u,style:L0(L0({color:n.color||i.color},i.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&H.createElement("title",null,a),n.children)};return JD!==void 0?H.createElement(JD.Consumer,null,i=>e(i)):e(ZD)}function iL(n){return k0({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(n)}function ude(n){return k0({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M384 320H256c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h128c17.67 0 32-14.33 32-32V352c0-17.67-14.33-32-32-32zM192 32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v128c0 17.67 14.33 32 32 32h95.72l73.16 128.04C211.98 300.98 232.4 288 256 288h.28L192 175.51V128h224V64H192V32zM608 0H480c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h128c17.67 0 32-14.33 32-32V32c0-17.67-14.33-32-32-32z"},child:[]}]})(n)}function cde(n){return k0({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(n)}function hde(n){return k0({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(n)}const dde={placeholder:"_placeholder_11mfg_3"},zh=({src:n,alt:e="Image",style:i,fallbackSrc:r,fallbackSources:s=[],showPlaceholder:a=!0,placeholderText:o="?",placeholderElement:l})=>{const[u,c]=H.useState(n),[h,d]=H.useState(!1),[p,f]=H.useState(-1);H.useEffect(()=>{c(n),d(!1),f(-1)},[n]);const m=()=>{if(!h){if(d(!0),r&&u!==r){c(r);return}const b=p+1;if(s&&b<s.length){console.log(`Trying fallback ${b+1}/${s.length}:`,s[b]),f(b),c(s[b]),d(!1);return}a&&c(void 0)}};return!u||h&&a&&!r?R.jsx("div",{className:dde.placeholder,style:{...i,fontSize:i!=null&&i.width?`${parseInt(String(i.width))/3}px`:"24px"},title:e,children:l??o}):R.jsx("img",{src:u,alt:e,style:i,onError:m,loading:"lazy"})},pde="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4710_10877)'%3e%3cpath%20d='M46.9991%2046.9991L36.3906%2036.3906'%20stroke='%23FFD32A'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.5548%2042.1095C33.3546%2042.1095%2042.1095%2033.3546%2042.1095%2022.5548C42.1095%2011.755%2033.3546%203%2022.5548%203C11.755%203%203%2011.755%203%2022.5548C3%2033.3546%2011.755%2042.1095%2022.5548%2042.1095Z'%20stroke='%23FFD32A'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4710_10877'%3e%3crect%20width='50.0001'%20height='49.9991'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",fde="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21%2013H25V17H21V13ZM21%2021H25V33H21V21ZM23%203C11.96%203%203%2011.96%203%2023C3%2034.04%2011.96%2043%2023%2043C34.04%2043%2043%2034.04%2043%2023C43%2011.96%2034.04%203%2023%203ZM23%2039C14.18%2039%207%2031.82%207%2023C7%2014.18%2014.18%207%2023%207C31.82%207%2039%2014.18%2039%2023C39%2031.82%2031.82%2039%2023%2039Z'%20fill='%23FFD32A'/%3e%3c/svg%3e",Hi={nav:"_nav_1ulys_4",agentLogo:"_agentLogo_1ulys_20",iconBtn:"_iconBtn_1ulys_28",searchBtn:"_searchBtn_1ulys_59",searchWrapper:"_searchWrapper_1ulys_64",searchPanel:"_searchPanel_1ulys_71",searchPanelOpen:"_searchPanelOpen_1ulys_81",searchPanelClosed:"_searchPanelClosed_1ulys_88",spacer:"_spacer_1ulys_96",separator:"_separator_1ulys_101",infoWrapper:"_infoWrapper_1ulys_109",infoIcon:"_infoIcon_1ulys_115",infoTooltip:"_infoTooltip_1ulys_120",infoTooltipParagraph:"_infoTooltipParagraph_1ulys_139",profileBtn:"_profileBtn_1ulys_144",profileName:"_profileName_1ulys_162",avatarContainer:"_avatarContainer_1ulys_173"},mw={p1:"Intuition is a decentralized protocol enabling users to create and attest to structured relationships between digital entities.",p2:'Unless expressly marked as "Certified by Studio", game titles, character names and related references are community-generated identifiers used for descriptive purposes only.',p3:"No affiliation, endorsement, or sponsorship by any game studio is implied."},mde=({graphControls:n,endpoint:e="base",rightPanelMode:i,onPanelModeChange:r,myAtomDetails:s})=>{const a=s==null?void 0:s.image,o=a?ua(a)?go(a):a:void 0,l=s==null?void 0:s.label,[u,c]=H.useState(!1),[h,d]=H.useState(!1),p=H.useRef(null);return R.jsxs("nav",{className:Hi.nav,children:[R.jsx("img",{src:Ow,alt:"Agent",className:Hi.agentLogo}),R.jsx("button",{className:Hi.iconBtn,onClick:()=>n==null?void 0:n.resetGraph(),disabled:!n,"aria-label":"Reset graph view",title:"Reset view",children:R.jsx(ude,{size:35})}),R.jsx("button",{className:Hi.iconBtn,onClick:()=>n==null?void 0:n.goBack(),disabled:!(n!=null&&n.canGoBack),"aria-label":"Go back",title:"Back",children:R.jsx(hde,{size:35})}),R.jsx("button",{className:Hi.iconBtn,onClick:()=>n==null?void 0:n.goForward(),disabled:!(n!=null&&n.canGoForward),"aria-label":"Go forward",title:"Forward",children:R.jsx(cde,{size:35})}),R.jsxs("div",{ref:p,className:Hi.searchWrapper,children:[R.jsx("button",{className:`${Hi.iconBtn} ${Hi.searchBtn}`,onClick:()=>c(f=>!f),disabled:!n,"aria-label":"Search",title:"Search",children:R.jsx("img",{src:pde,alt:"search",width:35,height:35})}),R.jsx("div",{className:`${Hi.searchPanel} ${u?Hi.searchPanelOpen:Hi.searchPanelClosed}`,children:(n==null?void 0:n.handleSearch)&&R.jsx(HD,{endpoint:e,onSearch:n.handleSearch,isSearching:n.isSearching,onSearchStart:n.handleSearchStart??(()=>{})})})]}),R.jsx("div",{className:Hi.spacer}),R.jsxs("div",{className:Hi.infoWrapper,children:[R.jsx("button",{className:Hi.iconBtn,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),"aria-label":"Information",title:"Information",children:R.jsx("img",{src:fde,alt:"Info",className:Hi.infoIcon})}),h&&R.jsxs("div",{className:Hi.infoTooltip,children:[R.jsx("p",{className:Hi.infoTooltipParagraph,children:mw.p1}),R.jsx("p",{className:Hi.infoTooltipParagraph,children:mw.p2}),R.jsx("p",{style:{margin:0},children:mw.p3})]})]}),R.jsx("div",{className:Hi.separator}),R.jsxs("button",{className:Hi.profileBtn,onClick:()=>r(i==="profile"?"speakup":"profile"),"aria-label":"My profile",title:"My profile",children:[l&&R.jsx("span",{className:Hi.profileName,children:l}),R.jsx("div",{className:Hi.avatarContainer,children:o?R.jsx(zh,{src:o,fallbackSrc:"",alt:l??"Profile",style:{width:"100%",height:"100%",objectFit:"cover"}}):R.jsx(iL,{size:45,color:"#ffd32a"})})]})]})};var Ct=(n=>(n.For="FOR",n.Against="AGAINST",n.None="NONE",n))(Ct||{});const ll={GAMES_ID:"0x15fd51c3248baf65414b97a52ff4302e653bd4f765e6784fd5eb4906ea322390",FOLLOWS:"0x8f9b5dc2e7b8bd12f6762c839830672f1d13c08e72b5f09f194cafc153f2df8a",IS:"0xdd4320a03fcd85ed6ac29f3171208f05418324d6943f1fac5d3c23cc1ce10eb3",IS_PLAYER_OF:"0x6bd2557fa101349b1adab869c7f14bdcb5dce3ae0bc722bee3ae183a544faa81",HAS_ALIAS:"0x90b0a11a334ba1a7c3613ed8ea007f1f41b274892f0f05cc0b24d3ab34042d3c",IS_MEMBER_OF:"0xe489948c4bd4fa6f50f402434996b90942ab67585a71c71d81dff8e624f661d4",IN:"0xb0d3de9abeebc79e74504814f69d38eae809410c9759678855f79d1b4c7405cb",ACCEPTED:"0x69b32b0ec575de94fea50d8ed84f198d46ab1590b6ec10d6527a1cc93c2c2dc"},gde=ll.HAS_ALIAS,yde={PLAYER_GAME:{predicateId:ll.IS_PLAYER_OF,objectId:ll.GAMES_ID,label:"is player of BossFighters"},PLAYER_QUALITY_1:{predicateId:ll.IS,objectId:"0xe8c70540064241818928054f9d655b79a9fc06fad93967db766347d9ed678795",label:"is fairplay"},PLAYER_QUALITY_2:{predicateId:ll.IS,objectId:"0x0b5b1eecbe6c655584f57c15b1fd0a8fbec0ba39bbc1f253824b2075739c3fe1",label:"is strong boss"},PLAYER_QUALITY_3:{predicateId:ll.IS,objectId:"0x48e31f7beaec9a71b62de49865ee2ba664c72c6860f7802d2174d003e635ff7d",label:"is strong fighter"},PLAYER_GUILD:{predicateId:ll.IS_PLAYER_OF,objectId:null}},bde=[{id:"0x4320ae619f6a9c9b79ee8e2a9415585aff1c287f0b72b08c049cf7a5780eb08d",name:"The Alchemists"},{id:"0x12d4b4425dcfeaf46af6543e8de0133f22f768a69d56a3aa28662ecb06aa9ca1",name:"Big Time Warriors"},{id:"0xd9e1d54c0cb904c23e04caea94f9d0dae00874ec18849ca74a832e94c6de01fa",name:"The NEST"},{id:"0xd473ceacf850609ff8881c398e85e59aadbc315588ca78182313cc1af05a2800",name:"Clock Work Gamers"},{id:"0x14511bc4065a1e7d67ba7d50d4706a8899a148a2e68b55213794c14e347acaa",name:"Vast Impact Gaming"},{id:"0x4ba717c7f309c98d2ba72c8412960af16872def8e8462f69da2e340762a01627",name:"Kraken Gaming"}],U0=10000000000000000n,nL=["0x27191de92fe0308355319ec8f2359e5ce85123bd243bf7ffa6eb8028347b3eab","0x561a2c3e4359c8ed1c468aef27691e8e48b4424344a38c7693b9127b1911efc9","0x6d7e52c5e80bf6c2873a21cb7013ba0655dc0458c77f2c0e7446c49efdbd0033"],gw={COMMON_IDS:ll,PLAYER_TRIPLE_TYPES:yde,OFFICIAL_GUILDS:bde,PREDEFINED_CLAIM_IDS:nL,HAS_ALIAS_PREDICATE_ID:gde},rL=({walletConnected:n,walletAddress:e,publicClient:i,network:r=jt.MAINNET})=>{const[s,a]=H.useState(!1),o=ld(),l=async c=>{var h;try{const d=Xi[r],p=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:`
5843
+ }`;try{const a=await(await fetch(Xi[e],{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:i,variables:{termIds:n}})})).json();return a.errors?(console.error("[fetchTriplesByTermIds] GraphQL errors:",a.errors),[]):((r=a.data)==null?void 0:r.triples)??[]}catch(s){return console.error("[fetchTriplesByTermIds] error:",s),[]}},Zhe=(n,e=jt.MAINNET,i)=>{const[r,s]=H.useState([]),[a,o]=H.useState({follows:[],followers:[]}),{COMMON_IDS:l}=i,{aliases:u,playerAtomId:c,isLoading:h}=Ib({walletAddress:n,constants:i,network:e}),d=H.useMemo(()=>{if(!c)return null;const M=u.find(w=>w.isPrimary)??u[0]??null;let A=(M==null?void 0:M.pseudo)??"";try{A=JSON.parse(A).name||A}catch{}return{term_id:c,label:A,image:(M==null?void 0:M.image)??""}},[c,u]),{positions:p,loading:f,error:m}=O0(n,e),b=H.useMemo(()=>p.filter(M=>{var A,w;return((w=(A=M.term)==null?void 0:A.triple)==null?void 0:w.predicate_id)===l.IN}).map(M=>M.term.triple.subject_id).filter(Boolean),[p,l.IN]),{data:y}=ra({queryKey:["triplesByTermIds",b,e],queryFn:()=>Qhe(b,e),enabled:b.length>0,staleTime:5*60*1e3,gcTime:10*60*1e3}),g=H.useMemo(()=>{const M=new Map;for(const A of y??[])A.object&&M.set(A.term_id,A.object);return M},[y]),x=H.useMemo(()=>{const M=new Set([l.IS_PLAYER_OF,l.IS_MEMBER_OF,l.IS,l.IN]),A=new Set;return p.filter(w=>{var N;const E=(N=w.term)==null?void 0:N.triple;return!E||!M.has(E.predicate_id)?!1:E.predicate_id===l.IS&&c?E.subject_id===c:!0}).filter(w=>{const E=w.term.triple.term_id;return A.has(E)?!1:(A.add(E),!0)}).map(w=>{const E=w.term.triple;if(E.predicate_id===l.IN){const N=g.get(E.subject_id)??null;return{term_id:E.term_id,predicate_id:l.IS,object_id:(N==null?void 0:N.term_id)??E.subject_id,object:N,term:w.term,counter_term:E.counter_term}}return{term_id:E.term_id,predicate_id:E.predicate_id,object_id:E.object_id,object:E.object,term:w.term,counter_term:E.counter_term}}).filter(w=>w.object!=null)},[p,l,g,c]),{data:_}=ra({queryKey:["triplesForAgent",n,e],queryFn:()=>$he(n,e),enabled:!!n,staleTime:2*60*1e3,gcTime:5*60*1e3}),{data:v}=ra({queryKey:["followsAndFollowers",l.FOLLOWS,n,e],queryFn:()=>Xhe(l.FOLLOWS,n,e),enabled:!!n,staleTime:2*60*1e3,gcTime:5*60*1e3});H.useEffect(()=>{_&&s(_)},[_]),H.useEffect(()=>{v&&o(v)},[v]);const T=h||f,S=m;return{atomDetails:d,triples:r,positions:p,activities:x,connections:a,loading:T,error:S?typeof S=="string"?S:S.message:null}},Jhe=(n,e=jt.MAINNET)=>{const{data:i,isLoading:r,error:s,isError:a}=ra({queryKey:["atomDetails",n==null?void 0:n.id,e],queryFn:()=>qhe(n.id,e),enabled:!!(n!=null&&n.id),staleTime:3e5,gcTime:6e5,retry:1});return{atomDetails:i||null,loading:r,error:a?s.message:null}},ede=(n,e=jt.MAINNET)=>{const{data:i,isLoading:r,error:s,isError:a}=ra({queryKey:["claimsBySubject",n==null?void 0:n.id,e],queryFn:()=>KD(n.id,e),enabled:!!(n!=null&&n.id),staleTime:12e4,gcTime:3e5,retry:1});return{claims:i||[],loading:r,error:a?s.message:null}},Ef={overlay:"_overlay_vc3i0_3",card:"_card_vc3i0_18",title:"_title_vc3i0_27",subtitle:"_subtitle_vc3i0_32",btn:"_btn_vc3i0_38"},QD=({isOpen:n,onConnectWallet:e})=>n?R.jsx("div",{className:Ef.overlay,children:R.jsxs("div",{className:Ef.card,children:[R.jsx("h2",{className:Ef.title,children:"Wallet Required"}),R.jsx("p",{className:Ef.subtitle,children:"Please connect your wallet to access this feature"}),R.jsx("button",{onClick:e,className:Ef.btn,children:"Connect Wallet"})]})}):null,jh={overlay:"_overlay_5roae_3",card:"_card_5roae_18",closeBtn:"_closeBtn_5roae_28",title:"_title_5roae_39",subtitle:"_subtitle_5roae_44",btn:"_btn_5roae_50"},tde=({isOpen:n,onCreatePlayer:e,onClose:i})=>n?R.jsx("div",{className:jh.overlay,children:R.jsxs("div",{className:jh.card,children:[i&&R.jsx("button",{onClick:i,className:jh.closeBtn,children:"×"}),R.jsx("h2",{className:jh.title,children:"Player Required"}),R.jsx("p",{className:jh.subtitle,children:"You need to create a player before you can vote on claims"}),R.jsx("button",{onClick:e,className:jh.btn,children:"Create Player"})]})}):null;var ZD={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},JD=H.createContext&&H.createContext(ZD),ide=["attr","size","title"];function nde(n,e){if(n==null)return{};var i,r,s=rde(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)i=a[r],e.indexOf(i)===-1&&{}.propertyIsEnumerable.call(n,i)&&(s[i]=n[i])}return s}function rde(n,e){if(n==null)return{};var i={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;i[r]=n[r]}return i}function D0(){return D0=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},D0.apply(null,arguments)}function eL(n,e){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),i.push.apply(i,r)}return i}function L0(n){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?eL(Object(i),!0).forEach(function(r){sde(n,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):eL(Object(i)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(i,r))})}return n}function sde(n,e,i){return(e=ade(e))in n?Object.defineProperty(n,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[e]=i,n}function ade(n){var e=ode(n,"string");return typeof e=="symbol"?e:e+""}function ode(n,e){if(typeof n!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var r=i.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function tL(n){return n&&n.map((e,i)=>H.createElement(e.tag,L0({key:i},e.attr),tL(e.child)))}function k0(n){return e=>H.createElement(lde,D0({attr:L0({},n.attr)},e),tL(n.child))}function lde(n){var e=i=>{var{attr:r,size:s,title:a}=n,o=nde(n,ide),l=s||i.size||"1em",u;return i.className&&(u=i.className),n.className&&(u=(u?u+" ":"")+n.className),H.createElement("svg",D0({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,r,o,{className:u,style:L0(L0({color:n.color||i.color},i.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&H.createElement("title",null,a),n.children)};return JD!==void 0?H.createElement(JD.Consumer,null,i=>e(i)):e(ZD)}function iL(n){return k0({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(n)}function ude(n){return k0({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M384 320H256c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h128c17.67 0 32-14.33 32-32V352c0-17.67-14.33-32-32-32zM192 32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v128c0 17.67 14.33 32 32 32h95.72l73.16 128.04C211.98 300.98 232.4 288 256 288h.28L192 175.51V128h224V64H192V32zM608 0H480c-17.67 0-32 14.33-32 32v128c0 17.67 14.33 32 32 32h128c17.67 0 32-14.33 32-32V32c0-17.67-14.33-32-32-32z"},child:[]}]})(n)}function cde(n){return k0({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(n)}function hde(n){return k0({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(n)}const dde={placeholder:"_placeholder_11mfg_3"},zh=({src:n,alt:e="Image",style:i,fallbackSrc:r,fallbackSources:s=[],showPlaceholder:a=!0,placeholderText:o="?",placeholderElement:l})=>{const[u,c]=H.useState(n),[h,d]=H.useState(!1),[p,f]=H.useState(-1);H.useEffect(()=>{c(n),d(!1),f(-1)},[n]);const m=()=>{if(!h){if(d(!0),r&&u!==r){c(r);return}const b=p+1;if(s&&b<s.length){console.log(`Trying fallback ${b+1}/${s.length}:`,s[b]),f(b),c(s[b]),d(!1);return}a&&c(void 0)}};return!u||h&&a&&!r?R.jsx("div",{className:dde.placeholder,style:{...i,fontSize:i!=null&&i.width?`${parseInt(String(i.width))/3}px`:"24px"},title:e,children:l??o}):R.jsx("img",{src:u,alt:e,style:i,onError:m,loading:"lazy"})},pde="data:image/svg+xml,%3csvg%20width='50'%20height='50'%20viewBox='0%200%2050%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4710_10877)'%3e%3cpath%20d='M46.9991%2046.9991L36.3906%2036.3906'%20stroke='%23FFD32A'%20stroke-width='4'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.5548%2042.1095C33.3546%2042.1095%2042.1095%2033.3546%2042.1095%2022.5548C42.1095%2011.755%2033.3546%203%2022.5548%203C11.755%203%203%2011.755%203%2022.5548C3%2033.3546%2011.755%2042.1095%2022.5548%2042.1095Z'%20stroke='%23FFD32A'%20stroke-width='6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4710_10877'%3e%3crect%20width='50.0001'%20height='49.9991'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",fde="data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21%2013H25V17H21V13ZM21%2021H25V33H21V21ZM23%203C11.96%203%203%2011.96%203%2023C3%2034.04%2011.96%2043%2023%2043C34.04%2043%2043%2034.04%2043%2023C43%2011.96%2034.04%203%2023%203ZM23%2039C14.18%2039%207%2031.82%207%2023C7%2014.18%2014.18%207%2023%207C31.82%207%2039%2014.18%2039%2023C39%2031.82%2031.82%2039%2023%2039Z'%20fill='%23FFD32A'/%3e%3c/svg%3e",Hi={nav:"_nav_1ulys_4",agentLogo:"_agentLogo_1ulys_20",iconBtn:"_iconBtn_1ulys_28",searchBtn:"_searchBtn_1ulys_59",searchWrapper:"_searchWrapper_1ulys_64",searchPanel:"_searchPanel_1ulys_71",searchPanelOpen:"_searchPanelOpen_1ulys_81",searchPanelClosed:"_searchPanelClosed_1ulys_88",spacer:"_spacer_1ulys_96",separator:"_separator_1ulys_101",infoWrapper:"_infoWrapper_1ulys_109",infoIcon:"_infoIcon_1ulys_115",infoTooltip:"_infoTooltip_1ulys_120",infoTooltipParagraph:"_infoTooltipParagraph_1ulys_139",profileBtn:"_profileBtn_1ulys_144",profileName:"_profileName_1ulys_162",avatarContainer:"_avatarContainer_1ulys_173"},mw={p1:"Intuition is a decentralized protocol enabling users to create and attest to structured relationships between digital entities.",p2:'Unless expressly marked as "Certified by Studio", game titles, character names and related references are community-generated identifiers used for descriptive purposes only.',p3:"No affiliation, endorsement, or sponsorship by any game studio is implied."},mde=({graphControls:n,endpoint:e="base",rightPanelMode:i,onPanelModeChange:r,myAtomDetails:s})=>{const a=s==null?void 0:s.image,o=a?ua(a)?go(a):a:void 0,l=s==null?void 0:s.label,[u,c]=H.useState(!1),[h,d]=H.useState(!1),p=H.useRef(null);return R.jsxs("nav",{className:Hi.nav,children:[R.jsx("img",{src:Ow,alt:"Agent",className:Hi.agentLogo}),R.jsx("button",{className:Hi.iconBtn,onClick:()=>n==null?void 0:n.resetGraph(),disabled:!n,"aria-label":"Reset graph view",title:"Reset view",children:R.jsx(ude,{size:35})}),R.jsx("button",{className:Hi.iconBtn,onClick:()=>n==null?void 0:n.goBack(),disabled:!(n!=null&&n.canGoBack),"aria-label":"Go back",title:"Back",children:R.jsx(hde,{size:35})}),R.jsx("button",{className:Hi.iconBtn,onClick:()=>n==null?void 0:n.goForward(),disabled:!(n!=null&&n.canGoForward),"aria-label":"Go forward",title:"Forward",children:R.jsx(cde,{size:35})}),R.jsxs("div",{ref:p,className:Hi.searchWrapper,children:[R.jsx("button",{className:`${Hi.iconBtn} ${Hi.searchBtn}`,onClick:()=>c(f=>!f),disabled:!n,"aria-label":"Search",title:"Search",children:R.jsx("img",{src:pde,alt:"search",width:35,height:35})}),R.jsx("div",{className:`${Hi.searchPanel} ${u?Hi.searchPanelOpen:Hi.searchPanelClosed}`,children:(n==null?void 0:n.handleSearch)&&R.jsx(HD,{endpoint:e,onSearch:n.handleSearch,isSearching:n.isSearching,onSearchStart:n.handleSearchStart??(()=>{})})})]}),R.jsx("div",{className:Hi.spacer}),R.jsxs("div",{className:Hi.infoWrapper,children:[R.jsx("button",{className:Hi.iconBtn,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),"aria-label":"Information",title:"Information",children:R.jsx("img",{src:fde,alt:"Info",className:Hi.infoIcon})}),h&&R.jsxs("div",{className:Hi.infoTooltip,children:[R.jsx("p",{className:Hi.infoTooltipParagraph,children:mw.p1}),R.jsx("p",{className:Hi.infoTooltipParagraph,children:mw.p2}),R.jsx("p",{style:{margin:0},children:mw.p3})]})]}),R.jsx("div",{className:Hi.separator}),R.jsxs("button",{className:Hi.profileBtn,onClick:()=>r(i==="profile"?"speakup":"profile"),"aria-label":"My profile",title:"My profile",children:[l&&R.jsx("span",{className:Hi.profileName,children:l}),R.jsx("div",{className:Hi.avatarContainer,children:o?R.jsx(zh,{src:o,fallbackSrc:"",alt:l??"Profile",style:{width:"100%",height:"100%",objectFit:"cover"}}):R.jsx(iL,{size:45,color:"#ffd32a"})})]})]})};var Ct=(n=>(n.For="FOR",n.Against="AGAINST",n.None="NONE",n))(Ct||{});const ll={GAMES_ID:"0x15fd51c3248baf65414b97a52ff4302e653bd4f765e6784fd5eb4906ea322390",FOLLOWS:"0x8f9b5dc2e7b8bd12f6762c839830672f1d13c08e72b5f09f194cafc153f2df8a",IS:"0xdd4320a03fcd85ed6ac29f3171208f05418324d6943f1fac5d3c23cc1ce10eb3",IS_PLAYER_OF:"0x6bd2557fa101349b1adab869c7f14bdcb5dce3ae0bc722bee3ae183a544faa81",HAS_ALIAS:"0x90b0a11a334ba1a7c3613ed8ea007f1f41b274892f0f05cc0b24d3ab34042d3c",IS_MEMBER_OF:"0xe489948c4bd4fa6f50f402434996b90942ab67585a71c71d81dff8e624f661d4",IN:"0xb0d3de9abeebc79e74504814f69d38eae809410c9759678855f79d1b4c7405cb",ACCEPTED:"0x69b32b0ec575de94fea50d8ed84f198d46ab1590b6ec10d6527a1cc93c2c2dc1"},gde=ll.HAS_ALIAS,yde={PLAYER_GAME:{predicateId:ll.IS_PLAYER_OF,objectId:ll.GAMES_ID,label:"is player of BossFighters"},PLAYER_QUALITY_1:{predicateId:ll.IS,objectId:"0xe8c70540064241818928054f9d655b79a9fc06fad93967db766347d9ed678795",label:"is fairplay"},PLAYER_QUALITY_2:{predicateId:ll.IS,objectId:"0x0b5b1eecbe6c655584f57c15b1fd0a8fbec0ba39bbc1f253824b2075739c3fe1",label:"is strong boss"},PLAYER_QUALITY_3:{predicateId:ll.IS,objectId:"0x48e31f7beaec9a71b62de49865ee2ba664c72c6860f7802d2174d003e635ff7d",label:"is strong fighter"},PLAYER_GUILD:{predicateId:ll.IS_PLAYER_OF,objectId:null}},bde=[{id:"0x4320ae619f6a9c9b79ee8e2a9415585aff1c287f0b72b08c049cf7a5780eb08d",name:"The Alchemists"},{id:"0x12d4b4425dcfeaf46af6543e8de0133f22f768a69d56a3aa28662ecb06aa9ca1",name:"Big Time Warriors"},{id:"0xd9e1d54c0cb904c23e04caea94f9d0dae00874ec18849ca74a832e94c6de01fa",name:"The NEST"},{id:"0xd473ceacf850609ff8881c398e85e59aadbc315588ca78182313cc1af05a2800",name:"Clock Work Gamers"},{id:"0x14511bc4065a1e7d67ba7d50d4706a8899a148a2e68b55213794c14e347acaa",name:"Vast Impact Gaming"},{id:"0x4ba717c7f309c98d2ba72c8412960af16872def8e8462f69da2e340762a01627",name:"Kraken Gaming"}],U0=10000000000000000n,nL=["0x27191de92fe0308355319ec8f2359e5ce85123bd243bf7ffa6eb8028347b3eab","0x561a2c3e4359c8ed1c468aef27691e8e48b4424344a38c7693b9127b1911efc9","0x6d7e52c5e80bf6c2873a21cb7013ba0655dc0458c77f2c0e7446c49efdbd0033"],gw={COMMON_IDS:ll,PLAYER_TRIPLE_TYPES:yde,OFFICIAL_GUILDS:bde,PREDEFINED_CLAIM_IDS:nL,HAS_ALIAS_PREDICATE_ID:gde},rL=({walletConnected:n,walletAddress:e,publicClient:i,network:r=jt.MAINNET})=>{const[s,a]=H.useState(!1),o=ld(),l=async c=>{var h;try{const d=Xi[r],p=await fetch(d,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:`
5844
5844
  query Triple($tripleId: String!) {
5845
5845
  triple(term_id: $tripleId) {
5846
5846
  term_id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "player-map",
3
- "version": "2.0.14",
3
+ "version": "2.0.15",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",