PageSourceSearch

https://fastflip.ai/assets/DevMock-BBiyjJkS.js

js fastflip.ai collected 2026-09-24 14:30:58 UTC 4,675 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-osIn3ZU6.js";import{r as n}from"./vendor-D-BXCQ_1.js";import{r as P,l as j,v as d,w as u,x as m,z as f,b,L as x}from"./index-DXxNoNZz.js";import{S as w,a as k,b as v,c as _,d as I}from"./select-GQLYh9Ej.js";import{u as V}from"./useDocumentTitle-B19jTXsX.js";import{C as $}from"./circle-check-big-B4lpEVT8.js";import{C as F}from"./circle-x-C-SSHE8j.js";import"./supabase-D5RqX5cA.js";import"./locale-en-BZzENOpZ.js";import"./index-BISVhQFd.js";import"./chevron-up-B2OkpGIn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"9a639004464c7999f15f8ce9819a3c63d394a33a"};var c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="4bb93e42-3292-4869-8340-39b85ab6a3c3",t._sentryDebugIdIdentifier="sentry-dbid-4bb93e42-3292-4869-8340-39b85ab6a3c3")}catch{}})();function te(){V("Dev mock - FastFlip");const{user:t}=P(),[c,y]=n.useState([]),[L,E]=n.useState([]),[r,T]=n.useState(""),[o,D]=n.useState(""),[M,l]=n.useState(""),[h,a]=n.useState("idle"),[i,S]=n.useState(!1);n.useEffect(()=>{t&&(O(),N())},[t]);const O=async()=>{const{data:s}=await j.from("items").select("id, title").eq("user_id",t?.id).order("created_at",{ascending:!1});s&&y(s)},N=async()=>{const{data:s}=await j.from("channel_listings").select("id, external_id, item_id").eq("user_id",t?.id).eq("channel","mock_ebay").order("created_at",{ascending:!1});s&&E(s)},g=async(s,q)=>{S(!0),a("loading"),l("");try{const{data:p}=await j.auth.getSession(),R=p?.session?.access_token,C=await fetch(`https://vabgbuynqiuhuspsfusp.supabase.co/functions/v1/mock-ebay${s}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${R}`},body:JSON.stringify(q)}),A=await C.json();l(JSON.stringify(A,null,2)),C.ok?(a("success"),s.includes("listing")&&N()):a("error")}catch(p){l(JSON.stringify({error:p.message},null,2)),a("error")}finally{S(!1)}},B=()=>g("/connect",{}),z=()=>{if(!r){l(JSON.stringify({error:"Please select an item first"},null,2)),a("error");return}g("/listing/create",{item_id:r})},J=()=>{if(!o){l(JSON.stringify({error:"Please select a listing first"},null,2)),a("error");return}g("/listing/sync",{channel_listing_id:o})};return e.jsx("div",{className:"min-h-screen bg-background p-6",children:e.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Dev Mock eBay Test"}),e.jsx("p",{className:"text-muted-foreground",children:"Test the mock-ebay edge function endpoints"}),e.jsxs(d,{children:[e.jsx(u,{children:e.jsx(m,{children:"1. Connect Mock eBay"})}),e.jsx(f,{children:e.jsxs(b,{onClick:B,disabled:i,size:"lg",className:"w-full h-16 text-lg",children:[i?e.jsx(x,{className:"animate-spin mr-2"}):null,"Connect Mock eBay"]})})]}),e.jsxs(d,{children:[e.jsx(u,{children:e.jsx(m,{children:"2. Create Mock Listing"})}),e.jsxs(f,{className:"space-y-4",children:[e.jsxs(w,{value:r,onValueChange:T,children:[e.jsx(k,{className:"w-full",children:e.jsx(v,{placeholder:"Select an item..."})}),e.jsx(_,{children:c.map(s=>e.jsxs(I,{value:s.id,children:[s.title.substring(0,50),"..."]},s.id))})]}),e.jsxs(b,{onClick:z,disabled:i||!r,size:"lg",className:"w-full h-16 text-lg",children:[i?e.jsx(x,{className:"animate-spin mr-2"}):null,"Create Mock Listing"]})]})]}),e.jsxs(d,{children:[e.jsx(u,{children:e.jsx(m,{children:"3. Sync Mock Listing"})}),e.jsxs(f,{className:"space-y-4",children:[e.jsxs(w,{value:o,onValueChange:D,children:[e.jsx(k,{className:"w-full",children:e.jsx(v,{placeholder:"Select a listing..."})}),e.jsx(_,{children:L.map(s=>e.jsx(I,{value:s.id,children:s.external_id},s.id))})]}),e.jsxs(b,{onClick:J,disabled:i||!o,size:"lg",className:"w-full h-16 text-lg",children:[i?e.jsx(x,{className:"animate-spin mr-2"}):null,"Sync Mock Listing"]})]})]}),e.jsxs(d,{children:[e.jsxs(u,{className:"flex flex-row items-center justify-between",children:[e.jsx(m,{children:"Response Output"}),h==="success"&&e.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[e.jsx($,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Success"})]}),h==="error"&&e.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[e.jsx(F,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Error"})]}),h==="loading"&&e.jsx(x,{className:"w-5 h-5 animate-spin text-muted-foreground"})]}),e.jsx(f,{children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-96 text-sm font-mono text-foreground",children:M||"No response yet. Click a button above to test."})})]})]})})}export{te as default};

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.