PageSourceSearch

https://static.ranker.com/_next/static/chunks/1773.9e2e22a8abc01393.js

js ranker.com collected 2026-09-24 08:27:34 UTC 11,578 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1773],{14875:(e,t,r)=>{"use strict";r.d(t,{Jr:()=>l,eO:()=>a,tc:()=>o});var s=r(53502),n=r(80163);async function a(e,t,r){let a=(0,s.jl)();try{let o="lists/".concat(e,"/items/").concat(t),{data:l}=await n.Of.post(o,{node:{id:t},userId:r,showUser:!0});if(null==l?void 0:l.hasOwnProperty("listId"))return l;throw a.log("Unknown api response",s.Mk,l),Error("There was an error trying to add the node to the list.")}catch(e){throw a.log("There was an error trying to add the node to the list.",s.Mk,e),e}}async function o(e,t,r,a){let o=(0,s.jl)();try{let{data:l}=await n.Of.post("nodeedits",{authoredNode:!0,listId:e,userId:t,classId:a,name:r});if(null==l?void 0:l.hasOwnProperty("id"))return l;throw o.log("Unknown api response",s.Mk,l),Error("There was an error trying to create a node in the list.")}catch(e){throw o.log("There was an error trying to create a node in the list.",s.Mk,e),e}}async function l(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"ALL",a=(0,s.jl)();try{let o="/lists/".concat(e,"/items/").concat(t),{data:l}=await n.Of.get(o,{params:{include:"wikiText,votes,rankings,openListItemContributors,crowdRankedStats",propertyFetchType:r}});if(null==l?void 0:l.hasOwnProperty("node"))return l;throw a.log("Unknown api response",s.Mk,l),Error("Error fetching node data")}catch(e){throw a.log("Error fetching node data",s.Mk,e),e}}},31773:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>ee,C5:()=>$,BP:()=>Q});var s=r(85893),n=r(45697),a=r.n(n),o=r(23279),l=r.n(o),i=r(94184),c=r.n(i),d=r(67294),u=r(3262),h=r(24037),m=r(64976),_=r(53502),g=r(14875),p=r(73934),f=r(6669),N=r(5574),w=r(43948),R=r(52353),y=r.n(R),x=r(80163),I=r(50319),S=r.n(I),k=r(36082);async function v(e){try{let{data:t}=await x.Of.get("/nodes/".concat(e,"/wiki"));return t}catch(e){throw(0,_.jl)().log("Error looking for node wiki.",e),e}}function b(e){let{nodeId:t,position:r={top:0,left:0}}=e,[n,a]=(0,d.useState)({});return t&&(y()(n[t])&&v(t).then(e=>{let r=e.wikiText||null;(null==r?void 0:r.length)>560&&(r="".concat(r.substr(0,560),"...")),a({...n,[t]:r})}).catch(()=>{(0,k.U)("Error looking for node wiki.")}),n[t])?(0,s.jsx)("div",{className:S().nodeWiki,style:{top:r.top,left:r.left},children:n[t]}):null}b.propTypes={nodeId:n.number,position:n.shape({top:n.string,left:n.string})};var C=r(70819),j=r(58590),P=r(42470),T=r.n(P),E=r(15052),M=r(36354),O=r(41609),U=r.n(O),q=r(8142),L=r(23228),F=r.n(L),Z=r(9910);let A=e=>{let{searchString:t,nodeData:r,handleSelectClickFn:n,hoveredNodeRef:a,setHoveredNodeIdFn:o,alreadyPresent:l=!1,currentRanking:i}=e;return(0,s.jsxs)("li",{className:F().main,onMouseEnter:e=>{a.current=e.currentTarget,o(r.id)},onMouseLeave:()=>{a.current=null,o(null)},children:[r.imgixUrl?(0,s.jsx)(q.default,{src:r.imgixUrl,imgixParams:{w:46,h:46,crop:"faces"},alt:r.nameD,className:c()(F().nodeImg,{[F().alreadyPresent]:l})}):(0,s.jsx)(m.Z,{alt:r.nameD,className:c()(F().nodeImg,F().noImage,{[F().alreadyPresent]:l})}),(0,s.jsx)("span",{className:c()(F().nodeTitle,{[F().exactMatch]:t.toLowerCase()===r.nameD.toLowerCase(),[F().alreadyPresent]:l}),children:r.nameD}),l?(0,s.jsxs)("span",{className:F().searchResultAt,children:[(0,s.jsx)(C.default,{iconId:"rsvg__ive--check",className:F().icon}),"at #".concat(i)]}):(0,s.jsx)(Z.ZP,{variant:Z.iz.tertiary,className:F().actionButton,onClick:()=>n(r),rounded:!0,outline:!0,children:"+ add"})]},r.id)};A.propTypes={searchString:a().string.isRequired,nodeData:a().shape({id:a().number.isRequired,imgixUrl:a().string,nameD:a().string.isRequired}).isRequired,handleSelectClickFn:a().func.isRequired,hoveredNodeRef:a().object.isRequired,setHoveredNodeIdFn:a().func.isRequired,alreadyPresent:a().bool,currentRanking:a().number.isRequired};var B=r(20548),D=r.n(B);let W=e=>{let{searchString:t,results:r=[],listedNodes:n,selectFn:a,hoveredNodeRef:o,setHoveredNodeIdFn:l,showCreateMessage:i=!0}=e;return U()(r)?(0,s.jsxs)("div",{className:D().noResults,children:[(0,s.jsx)("p",{className:D().title,children:"That's Not In Our System"}),i&&(0,s.jsx)("p",{className:D().message,children:"but you can add it anyway by clicking 'create'"})]}):(0,s.jsx)("ul",{className:D().resultsList,children:r.map((e,r)=>
1(0,s.jsx)(A,{searchString:t,nodeData:e,handleSelectClickFn:()=>a(e,r+1),hoveredNodeRef:o,setHoveredNodeIdFn:l,alreadyPresent:!!n[e.id],currentRanking:n[e.id]},e.id))})};W.propTypes={searchString:a().string.isRequired,results:a().arrayOf(a().shape({id:a().number.isRequired,imgixUrl:a().string,nameD:a().string.isRequired})),listedNodes:a().object.isRequired,selectFn:a().func.isRequired,hoveredNodeRef:a().object.isRequired,setHoveredNodeIdFn:a().func.isRequired,showCreateMessage:a().bool};var z=r(24598),H=r(91387),G=r(5845),K=r(42888);let Y="USER_ACTION_CREATE_NODE",J="USER_ACTION_SELECT_NODE";async function Q(e){let t=(0,_.jl)();try{let t={...e,term:e.term.trim().replace(/'/g,"'").replace(/"/g,"'"),qualityNodesOnly:!1},{data:r}=await x.Of.get("/search/nodes",{params:t});return r}catch(e){throw t.log("Error searching nodes.",e),e}}let V=e=>{let t,r,n,a,{className:o="",searchInputClassName:i="",options:f={},listedNodes:N={},onFocus:w,userInfo:R,shouldUserSignIn:y,shouldUserSignInOnCreate:x,onSignIn:I,showCustomSearchPlaceholder:S=!1,isRerank:k=!1}=e;f=(0,j.Z)(f,{searchOptions:{listId:null,classId:null,defaultPropertyId:null,offset:0,resultLength:25,searchType:"open",wikiPosition:"left"},placeholder:S?"":"something missing? type it in here...",maxlength:500,showCreateNode:!0,listToAdd:null,createFn:()=>{},selectFn:()=>{}});let[v,P]=(0,d.useState)(""),[O,U]=(0,d.useState)([]),[q,L]=(0,d.useState)(!1),[F,A]=(0,d.useState)(!1),[B,D]=(0,d.useState)(!1),[V,X]=(0,d.useState)(null),[$,ee]=(0,d.useState)(null),[et,er]=(0,d.useState)(!1),[es,en]=(0,d.useState)(null),ea=(0,d.useRef)(null),eo=c()(o,T().main),el=c()(T().searchResultsContainer,{[T().active]:q||F}),ei=(0,d.useRef)(null),[ec,ed]=(0,d.useState)(null);ei.current&&(t=ei.current.getBoundingClientRect(),r="".concat(t.top,"px"),n="".concat(t.left+t.width,"px"),a="".concat(t.right-t.width-125,"px"));let eu=l()(e=>{let t=e>0?E.Be:E.a3;(0,u.ZP)(t)},1e3);(0,d.useEffect)(()=>{let e=!0;return v&&(ea.current&&clearTimeout(ea.current),ea.current=setTimeout(()=>{(0,u.ZP)(E.If),L(!0),Q({...f.searchOptions,term:v}).then(t=>{if(e&&t){var r;let e=(null==t?void 0:null===(r=t.primaryResponse)||void 0===r?void 0:r.results)||[];U(e),eu(e.length)}}).catch(()=>{U([])}).finally(()=>{A(!0),L(!1)})},1e3)),()=>{e=!1}},[v]);let eh=(0,d.useCallback)(()=>{P(""),U([]),A(!1),ei.current=null,ed(null)},[]),em=(0,d.useCallback)(()=>{let e=(0,_.jl)();return(0,g.tc)(f.listToAdd||f.searchOptions.listId,R.currentUserId,v,f.searchOptions.classId).then(e=>{k?f.createFn(e,et):f.createFn(e,!1,"search|authored")}).catch(t=>e.log("Could not create node",_.Mk,t)).finally(()=>eh())},[k,et,f,v,R.currentUserId]),e_=(0,d.useCallback)(async(e,t)=>{let r=(0,_.jl)();(0,u.ZP)(E.lU,{nodeId:e.id,position:t},{legacyLabel:"node_".concat(e.id,"|position_").concat(t)});try{await f.selectFn(e,!1,"search|system"),eh()}catch(e){r.log("Could not add node to list",_.Mk,e),eh()}},[f]),eg=async e=>{if("Enter"===e.key&&f.showCreateNode){if(ee(Y),!R.currentUserId&&x){D(!0);return}if(!(0,z.rO)(v)){(0,K.Z)("The node (id:".concat(v,") is invalid. Make sure to use only numbers"));return}let e={id:v};if(!R.currentUserId&&y){X(e),en(null),ee(J),D(!0);return}try{await (0,p.Jr)(v),e_(e,null)}catch(e){(0,G.default)("The node (id:".concat(v,') cannot be found. Try pressing on "Create" to add a node with that value as its name'))}}};(0,d.useEffect)(()=>()=>{ei.current=null,ed(null)},[O]),(0,d.useEffect)(()=>{if(R.currentUserId&&et&&$){switch($){case Y:em();break;case J:e_(V,es)}er(!1),ee(null)}},[et,es,V,$,R.currentUserId]);let ep=O.length>4&&window.navigator.platform.includes("Win");return(0,s.jsxs)("div",{className:eo,children:[B&&(0,s.jsx)(M.default,{style:{position:"relative"},setSignSuccess:()=>{er(!0),D(!1),I&&I()},location:H.EC,handleCloseModal:()=>{D(!B)}}),v&&(0,s.jsxs)("div",{className:el,children:[q?(0,s.jsx)(h.default,{}):F&&(0,s.jsx)(W,{results:O,selectFn:(e,t)=>{if(!R.currentUserId&&y){X(e),en(t),ee(J),D(!0);return}e_(e,t)},setHoveredNodeIdFn:ed,listedNodes:N,hoveredNodeRef:ei,searchString:v,showCreateMessage:f.showCreateNode}),f.showCreateNode&&(0,s.jsxs)("div",{className:T().createNode,children:[(0,s.jsx)(m.Z,{className:T().noImage}),(0,s.jsx)("span",{className:T().title,children:v}),(0,s.jsx)(Z.ZP,{className:c()(T().actionButton,{[T().addScrollbarMargin]:ep}),onClick:()=>(ee(Y),!R.currentUserId&&x)?D(!0):em(),rounded:!0,outline:!0,children:"create"})]})]}),(0,s.jsx)(b,{nodeId:ec,position:{top:r,left:"left"===f.searchOptions.wikiPosition?n:a}}),(0,s.jsx)("input",{className:c()(T().searchInput,i),onChange:e=>{if(""===e.target.value.trim()){eh();return}P(e.target.value)},onKeyDown:eg,placeholder:f.placeholder,onFocus:w,maxLength:f.maxlength,autoComplete:"off",value:v,id:"addListItem"}),(0,s.jsx)("label",{htmlFor:"addListItem",className:T().label,children:"Search for an item here and add it to the list!"}),S&&!v?(0,s.jsxs)("label",{htmlFor:"addListItem",className:T().customPlaceholderContainer,children:[(0,s.jsx)(C.default,{className:T().searchPlaceholder,iconId:"rsvg__ui--search"}),(0,s.jsx)("span",{className:T().customPlaceholderText,children:"search for an item"})]}):null,v&&(0,s.jsx)(C.default,{className:T().clearSearch,iconId:"rsvg__ui--close",onClick:eh})]})};
1V.propTypes={className:n.string,searchInputClassName:n.string,options:n.shape({searchOptions:n.shape({listId:n.number,classId:n.number,defaultPropertyId:n.number,offset:n.number,resultLength:n.number,searchType:n.string,wikiPosition:n.string}),showCreateNode:n.bool,selectFn:n.func,createFn:n.func,placeholder:n.string,maxlength:n.string,listToAdd:n.number}),listedNodes:n.object,onFocus:n.func,userInfo:N.zG.isRequired,shouldUserSignIn:n.bool.isRequired,shouldUserSignInOnCreate:n.bool.isRequired,onSignIn:n.func,showCustomSearchPlaceholder:n.bool,isRerank:n.bool};let X=[{context:f.Zv,mapStateToProps:e=>{let{userInfo:t}=e;return{userInfo:t}}}],$=e=>e.reduce((e,t)=>(e[t.node.id]=t.rank,e),{}),ee=(0,w.Z)({mapStateToProps:X})(V)},42470:e=>{e.exports={main:"NodeSearch_main__7xnwN",searchInput:"NodeSearch_searchInput__EY2M4",label:"NodeSearch_label__YZf7V",customPlaceholderContainer:"NodeSearch_customPlaceholderContainer__Gn_Ta",searchPlaceholder:"NodeSearch_searchPlaceholder__spAM0",customPlaceholderText:"NodeSearch_customPlaceholderText__5IB3I",clearSearch:"NodeSearch_clearSearch__Pp4mg",searchResultsContainer:"NodeSearch_searchResultsContainer__VG8qs",active:"NodeSearch_active__3noEM",createNode:"NodeSearch_createNode__uQdP5",actionButton:"NodeSearch_actionButton__T2KxZ",addScrollbarMargin:"NodeSearch_addScrollbarMargin___ORb1",title:"NodeSearch_title__g_WPq",noImage:"NodeSearch_noImage___iNf7"}},23228:e=>{e.exports={main:"ResultRow_main__yr2sM",nodeTitle:"ResultRow_nodeTitle__ScsU1",exactMatch:"ResultRow_exactMatch__uxqcE",alreadyPresent:"ResultRow_alreadyPresent__CpTuX",searchResultAt:"ResultRow_searchResultAt__1lpgm",icon:"ResultRow_icon__7zIUm",nodeWiki:"ResultRow_nodeWiki__7zdLy",actionButton:"ResultRow_actionButton__voc_x",nodeImg:"ResultRow_nodeImg__F2Mey",noImage:"ResultRow_noImage__W3d2r"}},20548:e=>{e.exports={noResults:"ResultsList_noResults__y3Kth",title:"ResultsList_title__u0T7f",message:"ResultsList_message__c5o1F",resultsList:"ResultsList_resultsList__pssqQ"}},50319:e=>{e.exports={nodeWiki:"WikiPopUp_nodeWiki__YPBAn"}}}]);
2//# sourceMappingURL=1773.9e2e22a8abc01393.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.