From 4996f617315148b9cf33dc4dffdb7d090c578472 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 27 Sep 2023 15:57:33 +0000 Subject: [PATCH] ci: automatic build fixes --- .../{index-08de87c8.js => index-91468c4e.js} | 22 +++++++++---------- build/index.html | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) rename build/assets/{index-08de87c8.js => index-91468c4e.js} (99%) diff --git a/build/assets/index-08de87c8.js b/build/assets/index-91468c4e.js similarity index 99% rename from build/assets/index-08de87c8.js rename to build/assets/index-91468c4e.js index 2f222a8f1..58702ffa5 100644 --- a/build/assets/index-08de87c8.js +++ b/build/assets/index-91468c4e.js @@ -6761,7 +6761,7 @@ void main() { border-radius: ${({rounded:tt})=>tt?"50%":"2px"}; `;function formatDescription(tt){return tt?tt.replace(/[[]{2}/g,"").replace(/[\]]{2}/g,""):""}var loadjs_umd={exports:{}};(function(tt,et){(function(nt,rt){tt.exports=rt()})(commonjsGlobal,function(){var nt=function(){},rt={},it={},ot={};function at(dt,pt){dt=dt.push?dt:[dt];var mt=[],gt=dt.length,yt=gt,bt,wt,vt,kt;for(bt=function(St,Tt){Tt.length&&mt.push(St),yt--,yt||pt(mt)};gt--;){if(wt=dt[gt],vt=it[wt],vt){bt(wt,vt);continue}kt=ot[wt]=ot[wt]||[],kt.push(bt)}}function st(dt,pt){if(dt){var mt=ot[dt];if(it[dt]=pt,!!mt)for(;mt.length;)mt[0](dt,pt),mt.splice(0,1)}}function lt(dt,pt){dt.call&&(dt={success:dt}),pt.length?(dt.error||nt)(pt):(dt.success||nt)(dt)}function ct(dt,pt,mt,gt){var yt=document,bt=mt.async,wt=(mt.numRetries||0)+1,vt=mt.before||nt,kt=dt.replace(/[\?|#].*$/,""),St=dt.replace(/^(css|img)!/,""),Tt,At;gt=gt||0,/(^css!|\.css$)/.test(kt)?(At=yt.createElement("link"),At.rel="stylesheet",At.href=St,Tt="hideFocus"in At,Tt&&At.relList&&(Tt=0,At.rel="preload",At.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(kt)?(At=yt.createElement("img"),At.src=St):(At=yt.createElement("script"),At.src=dt,At.async=bt===void 0?!0:bt),At.onload=At.onerror=At.onbeforeload=function(Et){var Mt=Et.type[0];if(Tt)try{At.sheet.cssText.length||(Mt="e")}catch(Lt){Lt.code!=18&&(Mt="e")}if(Mt=="e"){if(gt+=1,gt{const[nt,rt]=reactExports.useState(!0);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Flex,{direction:"row",children:jsxRuntimeExports.jsx(Flex,{align:"flex-start",pb:12,children:jsxRuntimeExports.jsxs(Text$3,{children:["Tweet by @",tt]})})}),jsxRuntimeExports.jsxs(Flex,{direction:"column",py:16,children:[nt&&jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"center",p:10,children:jsxRuntimeExports.jsx(ClipLoader$2,{color:colors.white})}),et&&jsxRuntimeExports.jsx(Tweet,{onLoad:()=>rt(!1),renderError:()=>jsxRuntimeExports.jsx(Error$1,{}),tweetId:et})]})]})},Error$1=()=>jsxRuntimeExports.jsx(Flex,{children:"Error occurred"}),Wrapper$j=styled$4(Flex)(({theme:tt})=>({position:"absolute",top:"20px",right:"20px",width:"300px",pointerEvents:"none",background:colors.dashboardHeader,boxShadow:"0px 1px 6px rgba(0, 0, 0, 0.1)",color:colors.primaryText1,zIndex:100,transition:"opacity 0.6s",padding:tt.spacing(2,3),[tt.breakpoints.down("sm")]:{padding:tt.spacing(1,1.5)}})),Divider$1=styled$4(Flex)` width: 22.5%; -`,Tooltip$1=({node:tt})=>{if(!tt)return null;const{node_type:et,show_title:nt,episode_title:rt,description:it,label:ot,text:at,timestamp:st,type:lt,tweet_id:ct,twitter_handle:ut}=tt,ht=tt.guests;let dt=!1,pt=!1;ht&&(ht.length&&ht[0]!==null&&(dt=!0),typeof ht[0]=="object"&&(pt=!0));let mt=tt.image_url;if(lt==="twitter_space"&&(mt="twitter_placeholder.png"),mt==null)switch(et){case"guest":mt="person_placeholder2.png";break;default:mt="noimage.jpeg"}return jsxRuntimeExports.jsx(Wrapper$j,{borderRadius:8,px:24,py:16,children:et==="tweet"?jsxRuntimeExports.jsx(TwitData$1,{tweetId:ct,twitterHandle:ut}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"row",children:[jsxRuntimeExports.jsx(Divider$1,{}),jsxRuntimeExports.jsx(Flex,{align:"flex-start",pb:12,children:jsxRuntimeExports.jsx(Text$3,{children:et==null?void 0:et.toUpperCase()})})]}),jsxRuntimeExports.jsxs(Flex,{direction:"row",children:[jsxRuntimeExports.jsx(Flex,{pr:12,children:jsxRuntimeExports.jsx(Avatar$1,{src:mt,type:"person"})}),jsxRuntimeExports.jsxs("div",{children:[lt==="guest"?jsxRuntimeExports.jsxs(Flex,{direction:"column",children:[jsxRuntimeExports.jsx(Text$3,{children:ot}),at&&jsxRuntimeExports.jsx(Flex,{pt:4,children:jsxRuntimeExports.jsxs(Text$3,{color:"primaryText1",kind:"tiny",children:["@",at]})})]}):jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:nt}),jsxRuntimeExports.jsxs(Flex,{pt:4,children:[et==="clip"||et==="episode"&&jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",children:"Episode"}),et==="clip"?jsxRuntimeExports.jsx(Text$3,{as:"div",kind:"regularBold",children:formatDescription(it)}):jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:rt})]}),jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:st}),jsxRuntimeExports.jsxs(Flex,{pt:12,children:[et==="clip"&&jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",children:"Episode"}),jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:et==="clip"?rt:formatDescription(it)})]}),dt&&jsxRuntimeExports.jsxs(Flex,{pt:12,children:[jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",children:"People"}),jsxRuntimeExports.jsx(Flex,{pt:4,children:jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:pt?ht.map(gt=>gt.name?gt.name:`@${gt.twitter_handle}`).join(", "):ht==null?void 0:ht.join(", ")})})]})]})]})]})})},Overlay=()=>{const[tt,et,nt,rt]=useDataStore(ot=>[ot.selectedNode,ot.hoveredNode,ot.cameraFocusTrigger,ot.setCameraFocusTrigger]),it=useControlStore(ot=>ot.userMovedCamera);return reactExports.useEffect(()=>{document.body.style.cursor=et?"pointer":"auto"},[et]),jsxRuntimeExports.jsxs(OverlayWrap,{children:[!!tt&&it&&jsxRuntimeExports.jsx(Button,{background:"bluePressState",kind:"small",onClick:()=>rt(!nt),children:"Re-center map"}),et&&jsxRuntimeExports.jsx("div",{id:"tooltip-portal",children:jsxRuntimeExports.jsx(Tooltip$1,{node:et})})]})},OverlayWrap=styled$4("div")(({theme:tt})=>({position:"absolute",zIndex:1,top:0,left:0,userSelect:"none",pointerEvents:"none",display:"flex",justifyContent:"flex-end",alignItems:"flex-start",height:"100%",width:"100%",padding:"16px",[tt.breakpoints.down("sm")]:{top:50}})),Fallback=()=>jsxRuntimeExports.jsx(Html$1,{children:jsxRuntimeExports.jsx(Loader$1,{})}),Content$1=()=>{const{universeColor:tt}=useControls("universe",{universeColor:colors.black}),et=useSelectedNode(),nt=reactExports.useMemo(()=>et!=null&&et.node_type?getNodeColorByType(et.node_type):outlineEffectColor,[et]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("color",{args:[tt],attach:"background"}),jsxRuntimeExports.jsx(Lights,{}),jsxRuntimeExports.jsx(Controls,{}),jsxRuntimeExports.jsxs(Selection,{children:[jsxRuntimeExports.jsxs(EffectComposer,{autoClear:!1,multisampling:8,children:[jsxRuntimeExports.jsx(Vignette,{darkness:.7,eskil:!1,offset:.05}),jsxRuntimeExports.jsx(Bloom,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Resolution.AUTO_SIZE,resolutionY:Resolution.AUTO_SIZE}),jsxRuntimeExports.jsx(Outline,{blendFunction:BlendFunction.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:nt,visibleEdgeColor:nt})]}),jsxRuntimeExports.jsx(Graph,{})]})]})};let wheelEventTimeout=null;const cameraProps={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z]},_Universe=()=>{const[tt,et,nt]=[useControlStore(ot=>ot.setIsUserScrollingOnHtmlPanel),useControlStore(ot=>ot.setIsUserScrolling),useControlStore(ot=>ot.setUserMovedCamera)],rt=reactExports.useCallback(ot=>{var lt;const{target:at}=ot,{offsetParent:st}=at;wheelEventTimeout&&clearTimeout(wheelEventTimeout),(lt=st==null?void 0:st.classList)!=null&<.contains("html-panel")&&st.clientHeight{et(!1),tt(!1)},200)},[et,tt,nt]),it=reactExports.useCallback(ot=>addToGlobalForE2e(ot,"threeState"),[]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Overlay,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsxs(Canvas$1,{camera:cameraProps,id:"universe-canvas",onCreated:it,onWheel:rt,children:[isDevelopment&&jsxRuntimeExports.jsx(Perf,{position:"top-right"}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:[jsxRuntimeExports.jsx(Preload,{}),jsxRuntimeExports.jsx(AdaptiveDpr,{}),jsxRuntimeExports.jsx(AdaptiveEvents,{}),jsxRuntimeExports.jsx(Content$1,{})]})]})})]})},Universe=reactExports.memo(_Universe),defaultData$3={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,teachMeAnswer:null},useTeachStore=react(tt=>({...defaultData$3,setAskedQuestion:et=>tt(nt=>({askedQuestions:[...nt.askedQuestions||[],et],hasQuestionInProgress:!0})),setAskedQuestionAnswer:et=>tt(nt=>({askedQuestionsAnswers:[...nt.askedQuestionsAnswers||[],et],hasQuestionInProgress:!1})),setHasQuestionInProgress:et=>tt({hasQuestionInProgress:et}),setHasTeachingInProgress:et=>tt({hasTeachingInProgress:et}),setTeachMeAnswer:et=>tt({hasTeachingInProgress:!1,teachMeAnswer:et})})),version="0.1.70",StyledTableCell=styled$4(TableCell$1)` +`,Tooltip$1=({node:tt})=>{if(!tt)return null;const{node_type:et,show_title:nt,episode_title:rt,description:it,label:ot,text:at,timestamp:st,type:lt,tweet_id:ct,twitter_handle:ut}=tt,ht=tt.guests;let dt=!1,pt=!1;ht&&(ht.length&&ht[0]!==null&&(dt=!0),typeof ht[0]=="object"&&(pt=!0));let mt=tt.image_url;if(lt==="twitter_space"&&(mt="twitter_placeholder.png"),mt==null)switch(et){case"guest":mt="person_placeholder2.png";break;default:mt="noimage.jpeg"}return jsxRuntimeExports.jsx(Wrapper$j,{borderRadius:8,px:24,py:16,children:et==="tweet"?jsxRuntimeExports.jsx(TwitData$1,{tweetId:ct,twitterHandle:ut}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Flex,{direction:"row",children:[jsxRuntimeExports.jsx(Divider$1,{}),jsxRuntimeExports.jsx(Flex,{align:"flex-start",pb:12,children:jsxRuntimeExports.jsx(Text$3,{children:et==null?void 0:et.toUpperCase()})})]}),jsxRuntimeExports.jsxs(Flex,{direction:"row",children:[jsxRuntimeExports.jsx(Flex,{pr:12,children:jsxRuntimeExports.jsx(Avatar$1,{src:mt,type:"person"})}),jsxRuntimeExports.jsxs("div",{children:[lt==="guest"?jsxRuntimeExports.jsxs(Flex,{direction:"column",children:[jsxRuntimeExports.jsx(Text$3,{children:ot}),at&&jsxRuntimeExports.jsx(Flex,{pt:4,children:jsxRuntimeExports.jsxs(Text$3,{color:"primaryText1",kind:"tiny",children:["@",at]})})]}):jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:nt}),jsxRuntimeExports.jsxs(Flex,{pt:4,children:[et==="clip"||et==="episode"&&jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",children:"Episode"}),et==="clip"?jsxRuntimeExports.jsx(Text$3,{as:"div",kind:"regularBold",children:formatDescription(it)}):jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:rt})]}),jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:st}),jsxRuntimeExports.jsxs(Flex,{pt:12,children:[et==="clip"&&jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",children:"Episode"}),jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:et==="clip"?rt:formatDescription(it)})]}),dt&&jsxRuntimeExports.jsxs(Flex,{pt:12,children:[jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",children:"People"}),jsxRuntimeExports.jsx(Flex,{pt:4,children:jsxRuntimeExports.jsx(Text$3,{color:"primaryText1",kind:"tiny",children:pt?ht.map(gt=>gt.name?gt.name:`@${gt.twitter_handle}`).join(", "):ht==null?void 0:ht.join(", ")})})]})]})]})]})})},Overlay=()=>{const[tt,et,nt,rt]=useDataStore(ot=>[ot.selectedNode,ot.hoveredNode,ot.cameraFocusTrigger,ot.setCameraFocusTrigger]),it=useControlStore(ot=>ot.userMovedCamera);return reactExports.useEffect(()=>{document.body.style.cursor=et?"pointer":"auto"},[et]),jsxRuntimeExports.jsxs(OverlayWrap,{children:[!!tt&&it&&jsxRuntimeExports.jsx(Button,{background:"bluePressState",kind:"small",onClick:()=>rt(!nt),children:"Re-center map"}),et&&jsxRuntimeExports.jsx("div",{id:"tooltip-portal",children:jsxRuntimeExports.jsx(Tooltip$1,{node:et})})]})},OverlayWrap=styled$4("div")(({theme:tt})=>({position:"absolute",zIndex:1,top:0,left:0,userSelect:"none",pointerEvents:"none",display:"flex",justifyContent:"flex-end",alignItems:"flex-start",height:"100%",width:"100%",padding:"16px",[tt.breakpoints.down("sm")]:{top:50}})),Fallback=()=>jsxRuntimeExports.jsx(Html$1,{children:jsxRuntimeExports.jsx(Loader$1,{})}),Content$1=()=>{const{universeColor:tt}=useControls("universe",{universeColor:colors.black}),et=useSelectedNode(),nt=reactExports.useMemo(()=>et!=null&&et.node_type?getNodeColorByType(et.node_type):outlineEffectColor,[et]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("color",{args:[tt],attach:"background"}),jsxRuntimeExports.jsx(Lights,{}),jsxRuntimeExports.jsx(Controls,{}),jsxRuntimeExports.jsxs(Selection,{children:[jsxRuntimeExports.jsxs(EffectComposer,{autoClear:!1,multisampling:8,children:[jsxRuntimeExports.jsx(Vignette,{darkness:.7,eskil:!1,offset:.05}),jsxRuntimeExports.jsx(Bloom,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Resolution.AUTO_SIZE,resolutionY:Resolution.AUTO_SIZE}),jsxRuntimeExports.jsx(Outline,{blendFunction:BlendFunction.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:nt,visibleEdgeColor:nt})]}),jsxRuntimeExports.jsx(Graph,{})]})]})};let wheelEventTimeout=null;const cameraProps={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[initialCameraPosition.x,initialCameraPosition.y,initialCameraPosition.z]},_Universe=()=>{const[tt,et,nt]=[useControlStore(ot=>ot.setIsUserScrollingOnHtmlPanel),useControlStore(ot=>ot.setIsUserScrolling),useControlStore(ot=>ot.setUserMovedCamera)],rt=reactExports.useCallback(ot=>{var lt;const{target:at}=ot,{offsetParent:st}=at;wheelEventTimeout&&clearTimeout(wheelEventTimeout),(lt=st==null?void 0:st.classList)!=null&<.contains("html-panel")&&st.clientHeight{et(!1),tt(!1)},200)},[et,tt,nt]),it=reactExports.useCallback(ot=>addToGlobalForE2e(ot,"threeState"),[]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Overlay,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:null,children:jsxRuntimeExports.jsxs(Canvas$1,{camera:cameraProps,id:"universe-canvas",onCreated:it,onWheel:rt,children:[isDevelopment&&jsxRuntimeExports.jsx(Perf,{position:"top-right"}),jsxRuntimeExports.jsxs(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Fallback,{}),children:[jsxRuntimeExports.jsx(Preload,{}),jsxRuntimeExports.jsx(AdaptiveDpr,{}),jsxRuntimeExports.jsx(AdaptiveEvents,{}),jsxRuntimeExports.jsx(Content$1,{})]})]})})]})},Universe=reactExports.memo(_Universe),defaultData$3={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,teachMeAnswer:null},useTeachStore=react(tt=>({...defaultData$3,setAskedQuestion:et=>tt(nt=>({askedQuestions:[...nt.askedQuestions||[],et],hasQuestionInProgress:!0})),setAskedQuestionAnswer:et=>tt(nt=>({askedQuestionsAnswers:[...nt.askedQuestionsAnswers||[],et],hasQuestionInProgress:!1})),setHasQuestionInProgress:et=>tt({hasQuestionInProgress:et}),setHasTeachingInProgress:et=>tt({hasTeachingInProgress:et}),setTeachMeAnswer:et=>tt({hasTeachingInProgress:!1,teachMeAnswer:et})})),version="0.1.71",StyledTableCell=styled$4(TableCell$1)` && { color: ${colors.white}; border: none; @@ -7467,13 +7467,7 @@ ${({disabled:tt})=>tt&&Ae` background: ${({selected:tt})=>tt?colors.gray300:colors.gray200}; } } -`,ErrorWrapper=styled$4(Flex)` - padding: 10px; - border-bottom: 1px solid ${colors.divider2}; -`,ErrorMsgWrapper=styled$4.textarea` - resize: none; - margin-bottom: 5px; -`,ErrorSection=()=>{const tt=useSelectedNode(),[et,nt]=reactExports.useState(""),[rt,it]=reactExports.useState(""),ot=useAppStore(st=>st.setFlagErrorOpen),at=async()=>{const st={content_node_ref_id:tt==null?void 0:tt.ref_id,message:et};await distExports$2.enable(!0)||console.warn("Sphinx enable failed");try{const ct=await api$1.post("/prediction/feedback",JSON.stringify(st));if(ct.error){const{message:ut}=ct.error;throw new Error(ut)}nt(""),it("Sent successfully")}catch(ct){ct instanceof Error&&it(ct.message||"Failed to send")}};return reactExports.useEffect(()=>{et||it("")},[et]),jsxRuntimeExports.jsxs(ErrorWrapper,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",justify:"center",p:6,children:jsxRuntimeExports.jsx(Text$3,{color:"white",kind:"medium",children:"Report Error"})}),jsxRuntimeExports.jsx(ErrorMsgWrapper,{cols:1,onChange:st=>{const{value:lt}=st.target;nt(lt)},placeholder:"flag incorrect information (misspelled words, etc)",rows:10,value:et}),jsxRuntimeExports.jsxs(Flex,{direction:"row",justify:"flex-end",p:8,children:[rt&&jsxRuntimeExports.jsx(Flex,{justify:"center",pb:3,style:{color:rt==="Sent successfully"?colors.green400:"#FF8F80",marginRight:"20px"},children:rt}),jsxRuntimeExports.jsx(Pill,{disabled:!et,onClick:at,children:"Send"}),jsxRuntimeExports.jsx(Pill,{onClick:()=>{ot(!1),nt("")},children:"Cancel"})]})]})},sphinxPubkey="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",boostAgainstBudget=async tt=>{let et=await distExports$2.enable(!0);if(et||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),et=await distExports$2.keysend(sphinxPubkey,tt),!(et!=null&&et.success)){if(et=await distExports$2.topup(),!(et!=null&&et.budget)||(et==null?void 0:et.budget){await boostAgainstBudget(et);const nt={amount:et,ref:tt};return api$1.post("/boost",JSON.stringify(nt))},notify=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:tt===BOOST_SUCCESS?"success":"error"})},Booster=({count:tt,content:et,readOnly:nt,refId:rt})=>{const[it,ot]=reactExports.useState(!1),[at,st]=reactExports.useState(!1);reactExports.useEffect(()=>{st(!1),ot(!1)},[rt]);let{image_url:lt}=et||{};lt&&(lt=lt.replace(".jpg","_l.jpg"));const ct=5;async function ut(){if(!(it||!rt)){ot(!0);try{await boost(rt,ct),st(!0),notify(BOOST_SUCCESS)}catch{notify(BOOST_ERROR_BUDGET)}ot(!1)}}return nt?tt?jsxRuntimeExports.jsx(Pill,{className:"booster__pill",style:{padding:"1px 8px 1px 3px",width:"fit-content"},children:jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(MdBolt,{fontSize:12}),jsxRuntimeExports.jsx("div",{style:{fontSize:10},children:tt||0})]})}):null:jsxRuntimeExports.jsx("div",{children:at?jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"center",children:jsxRuntimeExports.jsx(MdBolt,{color:"#49c998",fontSize:20})}):jsxRuntimeExports.jsx(Pill,{disabled:at||it,onClick:()=>{at||it||ut()},style:{padding:"4px 8px",width:"fit-content"},children:it?jsxRuntimeExports.jsx(_default,{color:"#fff",loading:!0,size:10}):jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(MdBolt,{fontSize:14}),jsxRuntimeExports.jsx("div",{style:{marginRight:8},children:"Boost"})]})})})},EpisodeTypeImages={podcast:{img:"audio_badge.svg",label:"podcast"},clip:{img:"audio_badge.svg",label:"clip"},show:{img:"audio_badge.svg",label:"show"},tweet:{img:"twitter_badge.svg",label:"tweet"},twitter_space:{img:"audio_badge.svg",label:"twitter_space"},youtube:{img:"video_badge.svg",label:"episode"},document:{img:"notes_badge.svg",label:"text"}},TypeBadge=({type:tt})=>{var et,nt,rt;return jsxRuntimeExports.jsxs(EpisodeWrapper$3,{children:[jsxRuntimeExports.jsx("img",{alt:((et=EpisodeTypeImages[tt])==null?void 0:et.label)||tt,src:((nt=EpisodeTypeImages[tt])==null?void 0:nt.img)||""}),jsxRuntimeExports.jsx("div",{className:"label",children:((rt=EpisodeTypeImages[tt])==null?void 0:rt.label)||tt})]})},EpisodeWrapper$3=styled$4(Flex).attrs({direction:"row"})` +`,sphinxPubkey="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",boostAgainstBudget=async tt=>{let et=await distExports$2.enable(!0);if(et||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),et=await distExports$2.keysend(sphinxPubkey,tt),!(et!=null&&et.success)){if(et=await distExports$2.topup(),!(et!=null&&et.budget)||(et==null?void 0:et.budget){await boostAgainstBudget(et);const nt={amount:et,ref:tt};return api$1.post("/boost",JSON.stringify(nt))},notify=tt=>{toast(jsxRuntimeExports.jsx(ToastMessage,{message:tt}),{icon:!1,position:toast.POSITION.BOTTOM_CENTER,type:tt===BOOST_SUCCESS?"success":"error"})},Booster=({count:tt,content:et,readOnly:nt,refId:rt})=>{const[it,ot]=reactExports.useState(!1),[at,st]=reactExports.useState(!1);reactExports.useEffect(()=>{st(!1),ot(!1)},[rt]);let{image_url:lt}=et||{};lt&&(lt=lt.replace(".jpg","_l.jpg"));const ct=5;async function ut(){if(!(it||!rt)){ot(!0);try{await boost(rt,ct),st(!0),notify(BOOST_SUCCESS)}catch{notify(BOOST_ERROR_BUDGET)}ot(!1)}}return nt?tt?jsxRuntimeExports.jsx(Pill,{className:"booster__pill",style:{padding:"1px 8px 1px 3px",width:"fit-content"},children:jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(MdBolt,{fontSize:12}),jsxRuntimeExports.jsx("div",{style:{fontSize:10},children:tt||0})]})}):null:jsxRuntimeExports.jsx("div",{children:at?jsxRuntimeExports.jsx(Flex,{align:"center",direction:"row",justify:"center",children:jsxRuntimeExports.jsx(MdBolt,{color:"#49c998",fontSize:20})}):jsxRuntimeExports.jsx(Pill,{disabled:at||it,onClick:()=>{at||it||ut()},style:{padding:"4px 8px",width:"fit-content"},children:it?jsxRuntimeExports.jsx(_default,{color:"#fff",loading:!0,size:10}):jsxRuntimeExports.jsxs(Flex,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(MdBolt,{fontSize:14}),jsxRuntimeExports.jsx("div",{style:{marginRight:8},children:"Boost"})]})})})},EpisodeTypeImages={podcast:{img:"audio_badge.svg",label:"podcast"},clip:{img:"audio_badge.svg",label:"clip"},show:{img:"audio_badge.svg",label:"show"},tweet:{img:"twitter_badge.svg",label:"tweet"},twitter_space:{img:"audio_badge.svg",label:"twitter_space"},youtube:{img:"video_badge.svg",label:"episode"},document:{img:"notes_badge.svg",label:"text"}},TypeBadge=({type:tt})=>{var et,nt,rt;return jsxRuntimeExports.jsxs(EpisodeWrapper$3,{children:[jsxRuntimeExports.jsx("img",{alt:((et=EpisodeTypeImages[tt])==null?void 0:et.label)||tt,src:((nt=EpisodeTypeImages[tt])==null?void 0:nt.img)||""}),jsxRuntimeExports.jsx("div",{className:"label",children:((rt=EpisodeTypeImages[tt])==null?void 0:rt.label)||tt})]})},EpisodeWrapper$3=styled$4(Flex).attrs({direction:"row"})` cursor: pointer; background: ${colors.white}; border-radius: 1px; @@ -7614,9 +7608,9 @@ ${({disabled:tt})=>tt&&Ae` height: 4px; background: ${colors.GRAY6}; } -`,pageSize=80,Relevance=({header:tt=null})=>{const et=useGraphData(),nt=reactExports.useRef(null),rt=useDataStore(yt=>yt.setSelectedNode),it=useDataStore(yt=>yt.setSelectedTimestamp),ot=useAppStore(yt=>yt.flagErrorIsOpen),[at]=useAppStore(yt=>[yt.setSidebarOpen]),st=useAppStore(yt=>yt.setRelevanceSelected),[lt,ct]=reactExports.useState(0),ht=lt*pageSize+pageSize,dt=et.nodes.length-1>ht,pt=useIsMatchBreakpoint("sm","down"),mt=reactExports.useMemo(()=>et.nodes.slice(0,ht),[et.nodes,ht]),gt=reactExports.useCallback(yt=>{saveConsumedContent(yt),it(yt),st(!0),rt(yt),pt&&at(!1)},[rt,st,at,it,pt]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!tt&&ot&&jsxRuntimeExports.jsx(ErrorSection,{}),jsxRuntimeExports.jsxs(ScrollView,{ref:nt,id:"search-result-list",shrink:1,children:[tt,mt.map((yt,bt)=>{const{image_url:wt,description:vt,date:kt,boost:St,type:Tt,id:At,episode_title:Et,node_type:Mt,text:Lt,name:jt,profile_picture:Rt,verified:$t=!1,twitter_handle:xt}=yt||{};return jsxRuntimeExports.jsx(Episode,{boostCount:St||0,date:kt||0,description:formatDescription(vt),id:At,imageUrl:wt||"audio_default.svg",name:jt||"",onClick:()=>gt(yt),profilePicture:Rt,text:Lt||"",title:Et,twitterHandle:xt,type:Tt||Mt,verified:$t},bt.toString())}),jsxRuntimeExports.jsx(LoadMoreWrapper,{align:"center",background:"BG1",direction:"row",justify:"center",children:jsxRuntimeExports.jsx(Button$2,{disabled:!dt,onClick:()=>{var yt;dt&&(ct(lt+1),(yt=nt.current)==null||yt.scrollTo(0,0))},size:"medium",children:"Load More"})})]})]})},LoadMoreWrapper=styled$4(Flex)` +`,Relevance=({isSearchResult:tt})=>{const et=useGraphData(),nt=reactExports.useRef(null),rt=tt?80:10,it=useDataStore(yt=>yt.setSelectedNode),ot=useDataStore(yt=>yt.setSelectedTimestamp),[at]=useAppStore(yt=>[yt.setSidebarOpen]),st=useAppStore(yt=>yt.setRelevanceSelected),[lt,ct]=reactExports.useState(0),ht=lt*rt+rt,dt=et.nodes.length-1>ht,pt=useIsMatchBreakpoint("sm","down"),mt=reactExports.useMemo(()=>[...et.nodes].sort((yt,bt)=>(bt.date||0)-(yt.date||0)).slice(0,ht),[et.nodes,ht]),gt=reactExports.useCallback(yt=>{saveConsumedContent(yt),ot(yt),st(!0),it(yt),pt&&at(!1)},[it,st,at,ot,pt]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(ScrollView,{ref:nt,id:"search-result-list",shrink:1,children:[mt.map((yt,bt)=>{const{image_url:wt,description:vt,date:kt,boost:St,type:Tt,id:At,episode_title:Et,node_type:Mt,text:Lt,name:jt,profile_picture:Rt,verified:$t=!1,twitter_handle:xt}=yt||{};return jsxRuntimeExports.jsx(Episode,{boostCount:St||0,date:kt||0,description:formatDescription(vt),id:At,imageUrl:wt||"audio_default.svg",name:jt||"",onClick:()=>gt(yt),profilePicture:Rt,text:Lt||"",title:Et,twitterHandle:xt,type:Tt||Mt,verified:$t},bt.toString())}),jsxRuntimeExports.jsx(LoadMoreWrapper,{align:"center",background:"BG1",direction:"row",justify:"center",children:jsxRuntimeExports.jsx(Button$2,{disabled:!dt,onClick:()=>{var yt;dt&&(ct(lt+1),(yt=nt.current)==null||yt.scrollTo(0,0))},size:"medium",children:"Load More"})})]})})},LoadMoreWrapper=styled$4(Flex)` flex: 0 0 86px; -`,_View$1=({isSearchResult:tt})=>jsxRuntimeExports.jsxs(Wrapper$9,{children:[!tt&&jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Latest"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:jsxRuntimeExports.jsx(BrowseGalleryIcon,{})})]}),jsxRuntimeExports.jsx(Relevance,{})]}),LatestView=reactExports.memo(_View$1),Wrapper$9=styled$4(Flex)` +`,_View$1=({isSearchResult:tt})=>jsxRuntimeExports.jsxs(Wrapper$9,{children:[!tt&&jsxRuntimeExports.jsxs("div",{className:"heading",children:[jsxRuntimeExports.jsx("span",{className:"heading__title",children:"Latest"}),jsxRuntimeExports.jsx("span",{className:"heading__icon",children:jsxRuntimeExports.jsx(BrowseGalleryIcon,{})})]}),jsxRuntimeExports.jsx(Relevance,{isSearchResult:tt})]}),LatestView=reactExports.memo(_View$1),Wrapper$9=styled$4(Flex)` .heading { color: ${colors.GRAY6}; padding: 0 24px 16px 24px; @@ -7792,7 +7786,13 @@ ${({disabled:tt})=>tt&&Ae` background: ${colors.divider2}; height: 1px; margin: auto 22px; -`,getSelectedNodeTimestamps=(tt,et)=>{if(!et)return null;const nt=tt.filter(ot=>ot.show_title&&ot.link&&ot.show_title===et.show_title&&ot.episode_title===et.episode_title),rt=lodashExports.groupBy(nt,ot=>ot.timestamp),it=lodashExports.values(rt).reduce((ot,at)=>(at[0]&&ot.push(at[0]),ot),[]);return it.sort((ot,at)=>{var ht,dt;const[st]=((ht=ot.timestamp)==null?void 0:ht.split("-"))||[""],[lt]=((dt=at.timestamp)==null?void 0:dt.split("-"))||[""],ct=videoTimetoSeconds(st),ut=videoTimetoSeconds(lt);return ct-ut}),it},FlagError=styled$4(Flex)` +`,getSelectedNodeTimestamps=(tt,et)=>{if(!et)return null;const nt=tt.filter(ot=>ot.show_title&&ot.link&&ot.show_title===et.show_title&&ot.episode_title===et.episode_title),rt=lodashExports.groupBy(nt,ot=>ot.timestamp),it=lodashExports.values(rt).reduce((ot,at)=>(at[0]&&ot.push(at[0]),ot),[]);return it.sort((ot,at)=>{var ht,dt;const[st]=((ht=ot.timestamp)==null?void 0:ht.split("-"))||[""],[lt]=((dt=at.timestamp)==null?void 0:dt.split("-"))||[""],ct=videoTimetoSeconds(st),ut=videoTimetoSeconds(lt);return ct-ut}),it},ErrorWrapper=styled$4(Flex)` + padding: 10px; + border-bottom: 1px solid ${colors.divider2}; +`,ErrorMsgWrapper=styled$4.textarea` + resize: none; + margin-bottom: 5px; +`,ErrorSection=()=>{const tt=useSelectedNode(),[et,nt]=reactExports.useState(""),[rt,it]=reactExports.useState(""),ot=useAppStore(st=>st.setFlagErrorOpen),at=async()=>{const st={content_node_ref_id:tt==null?void 0:tt.ref_id,message:et};await distExports$2.enable(!0)||console.warn("Sphinx enable failed");try{const ct=await api$1.post("/prediction/feedback",JSON.stringify(st));if(ct.error){const{message:ut}=ct.error;throw new Error(ut)}nt(""),it("Sent successfully")}catch(ct){ct instanceof Error&&it(ct.message||"Failed to send")}};return reactExports.useEffect(()=>{et||it("")},[et]),jsxRuntimeExports.jsxs(ErrorWrapper,{children:[jsxRuntimeExports.jsx(Flex,{align:"center",justify:"center",p:6,children:jsxRuntimeExports.jsx(Text$3,{color:"white",kind:"medium",children:"Report Error"})}),jsxRuntimeExports.jsx(ErrorMsgWrapper,{cols:1,onChange:st=>{const{value:lt}=st.target;nt(lt)},placeholder:"flag incorrect information (misspelled words, etc)",rows:10,value:et}),jsxRuntimeExports.jsxs(Flex,{direction:"row",justify:"flex-end",p:8,children:[rt&&jsxRuntimeExports.jsx(Flex,{justify:"center",pb:3,style:{color:rt==="Sent successfully"?colors.green400:"#FF8F80",marginRight:"20px"},children:rt}),jsxRuntimeExports.jsx(Pill,{disabled:!et,onClick:at,children:"Send"}),jsxRuntimeExports.jsx(Pill,{onClick:()=>{ot(!1),nt("")},children:"Cancel"})]})]})},FlagError=styled$4(Flex)` color: ${({flagErrorIsOpen:tt})=>tt?colors.lightBlue200:colors.white}; padding: 0 0 0 8px; &:hover { diff --git a/build/index.html b/build/index.html index 81d839df8..17cf3a2e4 100644 --- a/build/index.html +++ b/build/index.html @@ -22,7 +22,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Second Brain - +