1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5329],{43618:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>j});var r=a(37876),s=a(14232),i=a(48230),l=a.n(i),n=a(54587),o=a.n(n),c=a(70200),d=a(59435),p=a(35739),x=a(93704),u=a(61680),m=a(69461),h=a(83020);function f(e){return{...e,name:e.routineName||e.id,title:e.title,image_url:e.imageUrl||null,rating:0,users:0}}var g=a(36854);let b=["linear-gradient(135deg, #e0f2fe 0%, #e0e7ff 100%)","linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%)","linear-gradient(135deg, #d1fae5 0%, #ccfbf1 100%)","linear-gradient(135deg, #fef3c7 0%, #ffedd5 100%)","linear-gradient(135deg, #ffe4e6 0%, #fee2e2 100%)"];function y(e){let{type:t}=e;return"subscription"===t?(0,r.jsx)("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-indigo-100 text-indigo-700 border border-indigo-200",children:"Subscription"}):(0,r.jsx)("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-emerald-100 text-emerald-700 border border-emerald-200",children:"Free"})}function v(e){var t,a;let{app:s}=e,i=b[(null!=(a=null==(t=s.id)?void 0:t.charCodeAt(0))?a:0)%b.length],l=s.title||(0,x.Q)(s.name),n=()=>window.open("/share/".concat(encodeURIComponent(s.name)),"_blank","noopener,noreferrer");return(0,r.jsxs)("div",{onClick:n,className:"flex flex-col rounded-2xl overflow-hidden cursor-pointer transition-all duration-200 hover:shadow-xl hover:-translate-y-1 border border-[#E5E3D5] bg-white",children:[(0,r.jsx)(u.A,{appName:s.name,imageUrl:s.image_url,height:160,fallbackGradient:i}),(0,r.jsxs)("div",{className:"p-4 flex flex-col flex-1",style:{background:i},children:[(0,r.jsxs)("div",{className:"flex items-start gap-2.5 mb-2.5",children:[s.image_url?(0,r.jsx)(o(),{src:s.image_url,alt:l,width:32,height:32,style:{borderRadius:8,objectFit:"cover",flexShrink:0}}):(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg bg-white shadow flex items-center justify-center text-base font-bold text-[#78716C] shrink-0",children:null==l?void 0:l.charAt(0).toUpperCase()}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h3",{className:"font-semibold text-[14px] leading-snug text-[#1C1917] truncate",children:l}),(0,r.jsx)(y,{type:s.monetizationType})]})]}),(0,r.jsx)("p",{className:"text-[12px] text-[#78716C] leading-[1.5] flex-1 mb-3",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:s.description}),(0,r.jsx)("div",{className:"flex items-center justify-end",children:(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"text-[11px] font-semibold px-3 py-1 rounded-lg text-white",style:{background:"linear-gradient(to right, #615FFF, #00B8DB)"},children:"subscription"===s.monetizationType?"Subscribe":"Open App"})})]})]})}function j(){let{apps:e,allApps:t,categories:a,loading:i,error:n,search:o,setSearch:x,category:u,setCategory:b}=function(){let[e,t]=(0,s.useState)([]),[a,r]=(0,s.useState)(!0),[i,l]=(0,s.useState)(null),[n,o]=(0,s.useState)(""),[c,d]=(0,s.useState)("All");(0,s.useEffect)(()=>{let e=!1;return r(!0),(0,h.Bo)().then(a=>{var r,s,i;let l=null!=(i=null!=(s=null==(r=a.data)?void 0:r.listings)?s:a.data)?i:[];e||t(Array.isArray(l)?l.map(f):[])}).catch(t=>{(null==t?void 0:t.status)!==401&&(null==t?void 0:t.code)!=="UNAUTHORIZED"&&(e||l("Failed to load marketplace apps."))}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]);let p=(0,s.useMemo)(()=>["All",...Array.from(new Set(e.map(e=>e.category).filter(Boolean))).sort()],[e]);return{apps:(0,s.useMemo)(()=>{let t=n.trim().toLowerCase();return e.filter(e=>{var a,r,s;let i=!t||(null==(a=e.title)?void 0:a.toLowerCase().includes(t))||(null==(r=e.name)?void 0:r.toLowerCase().includes(t))||(null==(s=e.description)?void 0:s.toLowerCase().includes(t)),l="All"===c||e.category===c;return i&&l})},[e,n,c]),allApps:e,categories:p,loading:a,error:i,search:n,setSearch:o,category:c,setCategory:d}}(),y=(0,s.useRef)(null);return(0,r.jsx)("div",{className:"min-h-screen bg-white",children:(0,r.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,r.jsx)(l(),{href:"/",children:(0,r.jsx)("img",{src:"/logo4rthai.png",alt:"4rth.ai",style:{width:120}})}),(0,r.jsx)(l(),{href:"/login",children:(0,r.jsx)("button",{className:"text-sm font-medium px-4 py-2 rounded-lg bg-[#1C1917] text-white hover:bg-black transition-colors",children:"Sign in"})})]}),(0,r.jsxs)("div",{className:"text-center mb-10",children:[(0,r.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-indigo-50 border border-indigo-200 text-indigo-600 text-[12px] font-medium mb-4",children:[(0,r.jsx)(c.A,{size:12}
1)," App Marketplace"]}),(0,r.jsx)("h1",{className:"text-4xl font-bold text-[#1C1917] mb-3",children:"Discover AI-powered apps"}),(0,r.jsx)("p",{className:"text-[#78716C] text-lg max-w-xl mx-auto",children:"Browse and subscribe to apps built by the community â free and premium."})]}),(0,r.jsxs)("div",{className:"relative max-w-xl mx-auto mb-6",children:[(0,r.jsx)(d.A,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-[#A8A29E]"}),(0,r.jsx)("input",{type:"text",placeholder:"Search appsâ¦",value:o,onChange:e=>{let t=e.target.value;x(t),y.current&&clearTimeout(y.current),t.trim().length>=3&&(y.current=setTimeout(()=>{g.Ay.capture("search_intent",{query:t.trim(),page:"marketplace"})},800))},className:"w-full pl-10 pr-4 py-3 rounded-xl border border-[#E5E3D5] text-sm bg-white focus:outline-none focus:ring-2 focus:ring-indigo-200 shadow-sm"})]}),a.length>1&&(0,r.jsx)("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:a.map(e=>(0,r.jsx)("button",{onClick:()=>b(e),className:"px-3 py-1 rounded-full text-[12px] font-medium transition-colors border ".concat(u===e?"bg-[#1C1917] text-white border-[#1C1917]":"bg-white text-[#78716C] border-[#E5E3D5] hover:border-[#1C1917] hover:text-[#1C1917]"),children:e},e))}),i?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-[#A8A29E] gap-3",children:[(0,r.jsx)(p.A,{size:24,className:"animate-spin"}),(0,r.jsx)("span",{className:"text-sm",children:"Loading appsâ¦"})]}):n?(0,r.jsx)("div",{className:"text-center py-20 text-red-500 text-sm",children:n}):0===e.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 gap-2 text-[#A8A29E]",children:[(0,r.jsx)(c.A,{size:32}),(0,r.jsx)("p",{className:"text-sm",children:0===t.length?"No apps available yet.":"No apps match your search."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-[12px] text-[#A8A29E] mb-4 text-center",children:[e.length," app",1!==e.length?"s":""]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 pb-12",children:e.map(e=>(0,r.jsx)(v,{app:e},e.id))})]}),(0,r.jsx)(m.A,{})]})})}},61680:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});var r=a(37876),s=a(54587),i=a.n(s);let l=(0,a(17963).A)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),n=e=>{let{appName:t,height:a=160,imageUrl:s,fallbackGradient:n="linear-gradient(135deg, #e0f2fe 0%, #e0e7ff 100%)",className:o="",...c}=e,d={height:a,borderTopLeftRadius:8,borderTopRightRadius:8};return s?(0,r.jsx)("div",{className:"relative overflow-hidden bg-[#f5f5f5] ".concat(o),style:d,children:(0,r.jsx)(i(),{src:s,alt:"".concat(t," preview"),fill:!0,style:{objectFit:"cover"},onError:()=>console.error("Failed to load screenshot for ".concat(t)),...c})}):(0,r.jsx)("div",{className:"relative flex items-center justify-center overflow-hidden bg-[#f5f5f5] ".concat(o),style:{...d,background:n},children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center text-gray-400 w-full h-full",children:[(0,r.jsx)(l,{size:40,className:"mb-1 opacity-50"}),(0,r.jsx)("span",{className:"text-xs opacity-70",children:"Preview not available"})]})})}},62258:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/marketplace",function(){return a(43618)}])},69461:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var r=a(37876);a(14232);let s=()=>(0,r.jsxs)("footer",{className:"footer",style:{background:"#ffffff",color:"#1C1917"},children:[(0,r.jsx)("div",{className:"footer__container"}),(0,r.jsx)("hr",{className:"footer__divider"}),(0,r.jsxs)("div",{className:"footer__bottom-section",children:[(0,r.jsx)("p",{children:"\xa9 2025 4rth.ai"}),(0,r.jsxs)("div",{className:"footer__bottom-links",children:[(0,r.jsx)("a",{href:"/contact",children:"Contact Us"}),(0,r.jsx)("a",{href:"/terms-of-service",children:"Terms of Service"}),(0,r.jsx)("a",{href:"/termsofprivacy",children:"Privacy Policy"})]})]})]})},70200:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});
1let r=(0,a(17963).A)("store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]])},83020:(e,t,a)=>{"use strict";a.d(t,{Bo:()=>n,PN:()=>d,YF:()=>x,gr:()=>c,kH:()=>m,ot:()=>o,tQ:()=>p,wM:()=>l,z0:()=>u});var r=a(81521);async function s(e,t){let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await a.json();if(!a.ok)throw Error(r.error||"Request failed: ".concat(e));return{data:r}}async function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=new URLSearchParams(t).toString(),r=a?"".concat(e,"?").concat(a):e,s=await fetch(r),i=await s.json();if(!s.ok)throw Error(i.error||"Request failed: ".concat(e));return{data:i}}let l=async()=>await r.A.get("/trending_apps"),n=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await i("/api/marketplace-browse",{limit:50,...e})},o=async e=>await s("/api/marketplace-submit",e),c=async e=>await i("/api/marketplace-listing-status",{routineId:e}),d=async e=>await s("/api/marketplace-request-review",{routineId:e}),p=async e=>await s("/api/marketplace-subscribe",{listingId:e}),x=async(e,t,a,r,s)=>{let i=await fetch("/api/marketplace-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({listingId:e,appName:t,priceId:a,customerEmail:r,...s?{routineId:s}:{}})}),l=await i.json();if(!i.ok)throw Error(l.error||"Failed to create checkout session.");return{data:l}},u=async e=>await i("/api/apps/".concat(e,"/reviews")),m=async(e,t,a)=>await s("/api/apps/".concat(e,"/reviews"),{rating:t,comment:a})},93704:(e,t,a)=>{"use strict";a.d(t,{Q:()=>l,cn:()=>i});var r=a(69241),s=a(29573);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}let l=(e,t)=>"saved"===t||"published"===t||"saved_since_publish"===t?e||"":(null==e?void 0:e.replace(/-[a-zA-Z0-9]{6}$/,""))||e}},e=>{e.O(0,[8230,9573,6025,636,6593,8792],()=>e(e.s=62258)),_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.