PageSourceSearch

https://www.finantrix.com/_next/static/chunks/pages/vendor/edit/[slug]-cf2d5c6b94dd5b06.js

js finantrix.com collected 2026-10-06 15:08:24 UTC 12,563 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8111],{2208:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/vendor/edit/[slug]",function(){return n(98976)}])},98976:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var i=n(66352),a=n(95132),o=n(63485),l=n(13780),r=n.n(l),s=n(78750),d=n.n(s),c=n(55870);let u="#0B6E61",h=["","Enterprise License","Subscription (SaaS)","Freemium","Custom Quote","Usage-based"],p={none:"Not uploaded",pending:"With our editors",approved:"Live on your listing",rejected:"Not published"},g={none:"",pending:"Usually reviewed within two business days. Nothing appears on your listing until then.",approved:"Anyone reading your listing can download it.",rejected:"We could not publish this one. Reply to any email from us and we will tell you why — most often it is a file that is really a sales letter rather than a data sheet."};function y(){let e=(0,o.useRouter)(),t="string"==typeof e.query.slug?e.query.slug:"",[n,l]=(0,a.useState)("loading"),[s,y]=(0,a.useState)("none"),[C,z]=(0,a.useState)(null),[F,E]=(0,a.useState)(!1),[T,B]=(0,a.useState)(!1),[R,L]=(0,a.useState)(""),[W,N]=(0,a.useState)([]),[P,_]=(0,a.useState)(""),[A,D]=(0,a.useState)(null),[I,O]=(0,a.useState)(""),[M,q]=(0,a.useState)(!1),[U,H]=(0,a.useState)("");function J(e,t){z(n=>n?{...n,[e]:t}:n),B(!1)}function Y(e,t){J(e,t.split("\n").map(e=>e.trim()).filter(Boolean))}async function K(){if(C){E(!0),L("");try{var e,n;let i=await fetch("/api/vendor/edit-listing",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,fields:{tagline:C.tagline,description:C.description,logo:C.logo,headquarters:C.headquarters,founded:C.founded,companySize:C.companySize,pricingModel:C.pricingModel,deployment:C.deployment,idealFor:C.idealFor,keyFeatures:C.keyFeatures,integrations:C.integrations,tags:C.tags}})}),a=await i.json();if(!i.ok){L(a.error||"Couldn't save."),E(!1);return}B(!0),_((null==(e=a.held)?void 0:e.length)?a.message:""),(null==(n=a.heldLabels)?void 0:n.length)&&N(a.heldLabels.map(e=>({label:e,proposed:null})))}catch(e){L("Couldn't save. Please try again.")}E(!1)}}async function X(e){q(!0),H("");try{var n;let i=await new Promise((t,n)=>{let i=new FileReader;i.onload=()=>t(String(i.result||"")),i.onerror=()=>n(Error("read failed")),i.readAsDataURL(e)}),a=await fetch("/api/vendor/doc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,title:I.trim()||e.name.replace(/\.pdf$/i,""),data:i})}),o=await a.json();if(!a.ok){H(o.error||"That upload did not work."),q(!1);return}D(o.doc),O((null==(n=o.doc)?void 0:n.title)||"")}catch(e){H("That file could not be read. Try again, or email us and we will put it up for you.")}q(!1)}async function Q(){q(!0),H("");try{let e=await fetch("/api/vendor/doc",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t})}),n=await e.json();if(!e.ok){H(n.error||"Could not remove it."),q(!1);return}D(null),O("")}catch(e){H("Could not remove it. Please try again.")}q(!1)}return(0,a.useEffect)(()=>{if(!e.isReady||!t)return;let n=!0;return(async()=>{var e,i;let a=await fetch("/api/vendor/listing?slug=".concat(encodeURIComponent(t)));if(401===a.status){n&&l("denied");return}let o=await a.json();if(n){if(!a.ok){l("error"),L(o.error||"Couldn't load.");return}if(!o.canEdit)return l("denied");y(o.editMode||"live"),z(o.listing),l("ready"),D(o.doc||null),O((null==(e=o.doc)?void 0:e.title)||""),N(((null==(i=o.pendingEdit)?void 0:i.fields)||[]).map(e=>({label:e.label,proposed:e.proposed})))}})(),()=>{n=!1}},[e.isReady,t]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d(),{children:[(0,i.jsxs)("title",{children:["Edit your listing — ",c.j.name]}),(0,i.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,i.jsxs)("main",{style:{maxWidth:720,margin:"0 auto",padding:"48px 24px 100px"},children:["loading"===n&&(0,i.jsx)("p",{style:{color:"#5A6472"},children:"Loading…"}),"denied"===n&&(0,i.jsxs)("div",{style:b,children:[(0,i.jsx)("h1",{style:m,children:"This listing is not yours to edit yet"}),(0,i.jsx)("p",{style:x,children:"A listing becomes editable when you claim it, which is free. If you have already claimed it and are waiting on our review, sign in with the address you used for the claim — the claim is attached to that address, not to this one."}),(0,i.jsx)(r(),{href:"/directory/".concat(t),style:S,children:"Back to the listing →"})]}),"error"===n&&(0,i.jsxs)("div",{style:b,children:[(0,i.jsx)("h1",{style:m,children:"Something went wrong"}),(0,i.jsx)("p",{style:x,children:R})]}),"ready"===n&&C&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:20,flexWrap:"wrap"},children:[(0,i.jsxs)("h1",{style:{...m,margin:0},children:["Edit ",C.name]}),(0,i.jsx)(r(),{href:"/directory/".concat(t),style:{...k,marginLeft:"auto"},children:"View listing"})]}),"held"===s&&(0,i.jsxs)("div",{style:{background:"#eef5f4",border:"1px solid #cfe3e0",borderRadius:8,padding:"14px 16px",marginBottom:20},children:[(0,i.jsx)("p",{style:{...x,fontSize:".92rem",fontWeight:600,color:"#0B6E61",marginBottom:4},children:"Your claim is with our editors — and you can work on the listing now"}),(0,i.jsx)("p",{style:{...x,fontSize:".88rem",color:"#31544f"},children:"Everything you save here is kept against your claim and reviewed in the same pass, so it costs you no extra wait. Nothing appears on the public page until we approve the claim — which is also what stops anyone changing a live listing merely by paying for one. Your product data sheet unlocks once that is done."})]}),W.length>0&&(0,i.jsxs)("div",{style:{background:"#fff8ec",border:"1px solid #f0dfc0",borderRadius:8,padding:"14px 16px",marginBottom:20},children:[(0,i.jsxs)("p",{style:{...x,fontSize:".92rem",fontWeight:600,color:"#7a5a20",marginBottom:4},children:[1===W.length?"One change is":"".concat(W.length," changes are")," with our editors"]}),(0,i.jsxs)("p",{style:{...x,fontSize:".88rem",color:"#7a5a20"},children:[W.map(e=>e.label).join(", ")," — usually reviewed within two business days. Your listing stays exactly as it is until then, and we'll email you when it's published. Everything else you save here goes live immediately."]})]}),(0,i.jsx)(f,{label:"Tagline",children:(0,i.jsx)("input",{style:j,value:C.tagline,maxLength:140,onChange:e=>J("tagline",e.target.value)})}),(0,i.jsx)(f,{label:"Description",children:(0,i.jsx)("textarea",{style:{...j,minHeight:130,resize:"vertical"},value:C.description,onChange:e=>J("description",e.target.value)})}),(0,i.jsxs)("div",{style:w,children:[(0,i.jsx)(f,{label:"Headquarters",children:(0,i.jsx)("input",{style:j,value:C.headquarters,onChange:e=>J("headquarters",e.target.value)})}),(0,i.jsx)(f,{label:"Founded",children:(0,i.jsx)("input",{style:j,value:C.founded,onChange:e=>J("founded",e.target.value)})})]}),(0,i.jsxs)("div",{style:w,children:[(0,i.jsx)(f,{label:"Company size",children:(0,i.jsx)("input",{style:j,value:C.companySize,onChange:e=>J("companySize",e.target.value)})}),(0,i.jsx)(f,{label:"Pricing model",children:(0,i.jsx)("select",{style:j,value:C.pricingModel,onChange:e=>J("pricingModel",e.target.value),children:h.map(e=>(0,i.jsx)("option",{value:e,children:e||"—"},e))})})]}),(0,i.jsx)(f,{label:"Logo URL",children:(0,i.jsx)("input",{style:j,value:C.logo,onChange:e=>J("logo",e.target.value),placeholder:"https://…"})}),(0,i.jsx)("p",{style:{...x,marginTop:22,marginBottom:6,fontWeight:600,color:"#151A24"},children:"Lists — one item per line"}),(0,i.jsxs)("div",{style:w,children:[(0,i.jsx)(f,{label:"Key features",children:(0,i.jsx)("textarea",{style:v,value:C.keyFeatures.join("\n"),onChange:e=>Y("keyFeatures",e.target.value)})}),(0,i.jsx)(f,{label:"Integrations",children:(0,i.jsx)("textarea",{style:v,value:C.integrations.join("\n"),onChange:e=>Y("integrations",e.target.value)})})]}),(0,i.jsxs)("div",{style:w,children:[(0,i.jsx)(f,{label:"Ideal for",children:(0,i.jsx)("textarea",{style:v,value:C.idealFor.join("\n"),onChange:e=>Y("idealFor",e.target.value)})}),(0,i.jsx)(f,{label:"Deployment",children:(0,i.jsx)("textarea",{style:v,value:C.deployment.join("\n"),onChange:e=>Y("deployment",e.target.value)})})]}),(0,i.jsx)(f,{label:"Tags",children:(0,i.jsx)("textarea",{style:{...v,minHeight:70},value:C.tags.join("\n"),onChange:e=>Y("tags",e.target.value)})}),(0,i.jsx)("p",{style:{...x,marginTop:26,marginBottom:6,fontWeight:600,color:"#151A24"},children:"Product data sheet"}),(0,i.jsx)("p",{style:{...x,fontSize:".88rem",marginBottom:12},children:"One PDF — a data sheet, a brochure, whatever your sales team already sends. It appears as a download on your listing. PDF only, up to 4 MB, and a person reads it before it goes live."}),"held"===s?(0,i.jsx)("p",{style:{...x,fontSize:".88rem",borderLeft:"2px s
1olid #d6dae2",paddingLeft:14},children:"Available once your claim is approved. A data sheet is published on the page itself, so unlike the fields above it cannot be staged against a claim that has not been decided yet."}):A?(0,i.jsxs)("div",{style:{border:"1px solid #e4e7ec",borderRadius:8,padding:"14px 16px",marginBottom:8},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,i.jsx)("span",{style:{fontFamily:c.j.fonts.body,fontWeight:600,fontSize:".94rem"},children:A.title}),(0,i.jsxs)("span",{style:{...x,fontSize:".84rem"},children:[Math.max(1,Math.round(A.bytes/1024))," KB"]}),(0,i.jsx)("span",{style:{...function(e){let t="approved"===e?{c:"#0B6E61",b:"rgba(11,110,97,0.12)"}:"rejected"===e?{c:"#b23b3b",b:"rgba(178,59,59,0.12)"}:{c:"#7a5a20",b:"rgba(122,90,32,0.12)"};return{fontFamily:c.j.fonts.body,fontSize:".76rem",fontWeight:600,padding:"3px 9px",borderRadius:999,color:t.c,background:t.b}}(A.status),marginLeft:"auto"},children:p[A.status]})]}),(0,i.jsx)("p",{style:{...x,fontSize:".86rem",marginTop:8},children:g[A.status]}),(0,i.jsx)("button",{onClick:Q,disabled:M,style:{...k,marginTop:10},children:M?"Working…":"Remove it"})]}):(0,i.jsxs)("div",{style:{border:"1px dashed #d6dae2",borderRadius:8,padding:"16px",marginBottom:8},children:[(0,i.jsx)(f,{label:"What is it called?",children:(0,i.jsx)("input",{style:j,value:I,maxLength:120,placeholder:"For example, Platform overview 2026",onChange:e=>O(e.target.value)})}),(0,i.jsx)("input",{type:"file",accept:"application/pdf,.pdf",disabled:M,style:{...x,fontSize:".9rem",marginTop:10},onChange:e=>{var t;let n=null==(t=e.target.files)?void 0:t[0];n&&X(n)}})]}),M&&(0,i.jsx)("p",{style:{...x,fontSize:".88rem"},children:"Uploading…"}),U&&(0,i.jsx)("p",{style:{...x,fontSize:".88rem",color:"#b23b3b"},children:U}),(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:22,position:"sticky",bottom:0,background:"#fff",padding:"12px 0"},children:[(0,i.jsx)("button",{onClick:K,disabled:F,style:{...S,opacity:F?.7:1},children:F?"Saving…":"Save changes"}),T&&!P&&(0,i.jsx)("span",{style:{color:u,fontFamily:c.j.fonts.body,fontSize:".9rem"},children:"held"===s?"✓ Saved — kept with your claim for review.":"✓ Saved — live on your listing."}),T&&P&&(0,i.jsxs)("span",{style:{color:"#7a5a20",fontFamily:c.j.fonts.body,fontSize:".9rem"},children:["✓ ",P]}),R&&(0,i.jsx)("span",{style:{color:"#b23b3b",fontFamily:c.j.fonts.body,fontSize:".9rem"},children:R})]})]})]})]})}function f(e){let{label:t,children:n}=e;return(0,i.jsxs)("label",{style:{display:"block",marginBottom:14},children:[(0,i.jsx)("span",{style:{display:"block",fontFamily:c.j.fonts.body,fontSize:".8rem",fontWeight:600,color:"#5A6472",marginBottom:5},children:t}),n]})}let m={fontFamily:c.j.fonts.heading,fontSize:"1.7rem",color:"#151A24"},x={fontFamily:c.j.fonts.body,color:"#39424F",fontSize:"1rem",lineHeight:1.6,margin:0},b={display:"flex",flexDirection:"column",gap:12,alignItems:"flex-start",border:"1px solid #E2E7EE",borderRadius:12,padding:24,background:"#fff"},j={width:"100%",padding:"9px 12px",borderRadius:8,border:"1px solid #d6dbe2",fontFamily:c.j.fonts.body,fontSize:".92rem",background:"#fff"},v={...j,minHeight:100,resize:"vertical"},w={display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},S={fontFamily:c.j.fonts.body,fontWeight:600,background:u,color:"#fff",padding:"10px 20px",borderRadius:8,border:"none",cursor:"pointer",fontSize:".9rem",textDecoration:"none"},k={fontFamily:c.j.fonts.body,fontWeight:600,background:"transparent",color:u,padding:"7px 14px",borderRadius:8,border:"1px solid #cdd4dc",cursor:"pointer",fontSize:".84rem",textDecoration:"none"}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=2208)),_N_E=e.O()}]);

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.