1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92962,e=>{"use strict";var t=e.i(59381),o=e.i(83536);let r=(0,e.i(98453).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var a=e.i(99126),n=e.i(32137),l=e.i(18110);let s="https://api.playpeeps.app",i="peeps_voted_topics",d="peeps_my_topics";function c(e){localStorage.setItem(i,JSON.stringify(e))}function u(e){localStorage.setItem(d,JSON.stringify(e))}let m=["ð¥","ð¥","ð¥"];e.s(["default",0,function(){let{t:e}=(0,l.useLocale)(),[p,x]=(0,o.useState)([]),[h,f]=(0,o.useState)({}),[g,b]=(0,o.useState)({}),[v,w]=(0,o.useState)(""),[y,j]=(0,o.useState)(!1),[N,k]=(0,o.useState)(!0),[C,S]=(0,o.useState)(null),[E,$]=(0,o.useState)(null),T=p.find(e=>e.id===C)??null,V=(0,o.useCallback)(async()=>{try{let e=await fetch(`${s}/topics`);if(!e.ok)throw Error();x(await e.json())}catch{a.toast.error(e("Vote.error"))}finally{k(!1)}},[e]);async function O(){let t=v.trim();if(t&&!y){j(!0);try{let o=await fetch(`${s}/topics`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:t})});if(!o.ok)throw Error();let r=await o.json();w(""),r.submitterToken&&b(e=>{let t={...e,[r.id]:r.submitterToken};return u(t),t}),await V(),a.toast.success(`${e("Vote.success")} ð¡`)}catch{a.toast.error(e("Vote.error"))}finally{j(!1)}}}async function A(t,o){let r=h[t],n=null,l=null;r===o?n="up"===o?"unvote":"undownvote":(r&&(n="up"===r?"unvote":"undownvote"),l="up"===o?"vote":"downvote");try{let e=null;if(n){let o=await fetch(`${s}/topics/${t}/${n}`,{method:"POST"});if(!o.ok)throw Error();e=await o.json()}if(l){let o=await fetch(`${s}/topics/${t}/${l}`,{method:"POST"});if(!o.ok)throw Error();e=await o.json()}e&&x(o=>[...o.map(o=>o.id===t?{...o,...e}:o)].sort((e,t)=>t.upvoteCount-t.downvoteCount-(e.upvoteCount-e.downvoteCount)||new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()));let a={...h};r===o?delete a[t]:a[t]=o,f(a),c(a)}catch{a.toast.error("up"===o?e("Vote.voteError"):e("Vote.downvoteError"))}}async function P(t){let o=g[t];if(o){$(t),S(null);try{if(!(await fetch(`${s}/topics/${t}/by-token`,{method:"DELETE",headers:{"x-submitter-token":o}})).ok)throw Error();x(e=>e.filter(e=>e.id!==t));let r={...g};delete r[t],b(r),u(r);let n={...h};delete n[t],f(n),c(n),a.toast.success(e("Vote.deleteSuccess"))}catch{a.toast.error(e("Vote.deleteError"))}finally{$(null)}}}return(0,o.useEffect)(()=>{f(function(){try{let e=localStorage.getItem(i);if(!e)return{};let t=JSON.parse(e);if(Array.isArray(t)){let e={};for(let o of t)e[o]="up";return localStorage.setItem(i,JSON.stringify(e)),e}return t}catch{return{}}}()),b(function(){try{let e=localStorage.getItem(d);return e?JSON.parse(e):{}}catch{return{}}}()),V()},[V]),(0,t.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,t.jsxs)("div",{className:"mx-auto max-w-lg px-4 pb-28",children:[(0,t.jsx)("div",{className:"pt-16 pb-10",children:(0,t.jsx)("h1",{className:"text-3xl font-bold tracking-tight leading-tight",children:e("Vote.headline")})}),N?(0,t.jsx)("div",{className:"space-y-3",children:[void 0,void 0,void 0,void 0].map((e,o)=>(0,t.jsx)("div",{className:"h-20 rounded-2xl bg-muted/40 animate-pulse"},o))}):0===p.length?(0,t.jsx)("div",{className:"text-center py-20 text-muted-foreground text-base",children:e("Vote.empty")}):(0,t.jsx)("div",{className:"space-y-2.5",children:p.map((e,o)=>{let r=h[e.id],a=E===e.id,l=o<3?m[o]:null;return(0,t.jsxs)("div",{onClick:()=>S(e.id),className:(0,n.cn)("flex items-center gap-3 px-4 rounded-2xl bg-muted/30","h-20 cursor-pointer transition-colors duration-100","hover:bg-muted/50 active:bg-muted/60",a&&"opacity-40 pointer-events-none"),children:[l?(0,t.jsx)("span",{className:"text-xl shrink-0 w-7 text-center leading-none",children:l}):(0,t.jsx)("span",{className:"shrink-0 w-7 text-center text-sm font-semibold text-muted-foreground/30 tabular-nums",children:o+1}),(0,t.jsx)("p",{className:"flex-1 text-base font-medium leading-snug min-w-0 line-clamp-2",children:e.title}),(0,t.jsxs)("div",{className:"flex gap-1.5 shrink-0",children:[(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),A(e.id,"up")},className:(0,n.cn)("flex flex-col items-center gap-0.5 px-3 py-2 rounded-xl text-xs font-bold tabular-nums transition-all duration-100 active:scale-90 touch-manipulation","up"===r?"text-emerald-500 bg-emerald-500/12":"text-muted-foreground bg-muted/50 hover:text-emerald-500 hover:bg-emerald-500/10"),children:[(0,t.jsx)("span",{className:"text-base leading-none",children:"ð"}),(0,t.jsx)("span",{children:e.upvoteCount})]}),(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),A(e.id,"down")},className:(0,n.cn)("flex flex-col items-center gap-0.5 px-3 py-2 rounded-xl text-xs font-bold tabular-nums transition-all duration-100 active:scale-90 touch-manipulation","down"===r?"text-rose-500 bg-rose-500/12":"text-muted-foreground bg-muted/50 hover:text-rose-500 hover:bg-rose-500/10"),children:[(0,t.jsx)("span",{className:"text-base leading-none",children:"ð"}),(0,t.jsx)("span",{children:e.downvoteCount})]})]})]},e.id)})})]}),(0,t.jsx)("div",{className:"fixed bottom-0 inset-x-0 bg-background/80 backdrop-blur-xl border-t border-border/40",children:(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),O()},className:"mx-auto max-w-lg px-4 py-3 flex gap-2 items-center",children:[(0,t.jsx)("input",{value:v,onCh
1ange:e=>w(e.target.value),placeholder:e("Vote.placeholder"),maxLength:200,disabled:y,className:(0,n.cn)("flex-1 bg-muted/50 rounded-2xl px-4 py-3 text-base outline-none","placeholder:text-muted-foreground/50 focus:bg-muted/70 transition-colors","disabled:opacity-50 text-foreground")}),(0,t.jsx)("button",{type:"submit",disabled:y||!v.trim(),className:(0,n.cn)("h-12 w-12 shrink-0 rounded-2xl flex items-center justify-center transition-all","bg-primary text-primary-foreground active:scale-95 touch-manipulation","disabled:opacity-40 disabled:cursor-not-allowed"),children:(0,t.jsx)(r,{className:"h-4 w-4"})})]})}),C&&T&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/55 backdrop-blur-sm",onClick:()=>S(null),children:(0,t.jsxs)("div",{className:"w-full max-w-sm bg-card rounded-3xl p-6 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center mb-5 line-clamp-2 leading-snug",children:T.title}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{A(T.id,"up"),S(null)},className:(0,n.cn)("flex-1 flex flex-col items-center gap-2.5 py-6 rounded-2xl border transition-all duration-150 active:scale-95 touch-manipulation","up"===h[T.id]?"border-white/20 bg-white/10 text-foreground":"border-white/6 bg-muted/40 text-muted-foreground hover:bg-white/6 hover:text-foreground"),children:[(0,t.jsx)("span",{className:"text-3xl leading-none",children:"ð"}),(0,t.jsx)("span",{className:"text-xl font-bold tabular-nums",children:T.upvoteCount}),(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider",children:e("Vote.upvote")})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>{A(T.id,"down"),S(null)},className:(0,n.cn)("flex-1 flex flex-col items-center gap-2.5 py-6 rounded-2xl border transition-all duration-150 active:scale-95 touch-manipulation","down"===h[T.id]?"border-white/20 bg-white/10 text-foreground":"border-white/6 bg-muted/40 text-muted-foreground hover:bg-white/6 hover:text-foreground"),children:[(0,t.jsx)("span",{className:"text-3xl leading-none",children:"ð"}),(0,t.jsx)("span",{className:"text-xl font-bold tabular-nums",children:T.downvoteCount}),(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider",children:e("Vote.downvote")})]})]}),g[T.id]&&(0,t.jsx)("button",{type:"button",onClick:()=>P(T.id),className:"w-full mt-3 py-3.5 rounded-2xl text-sm font-semibold text-rose-500 bg-rose-500/8 hover:bg-rose-500/14 transition-colors",children:e("Vote.removeIdea")})]})})]})}],92962)},98453,e=>{"use strict";var t=e.i(83536);let o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,o)=>o?o.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},r=(...e)=>e.filter((e,t,o)=>!!e&&""!==e.trim()&&o.indexOf(e)===t).join(" ").trim();var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,t.forwardRef)(({color:e="currentColor",size:o=24,strokeWidth:n=2,absoluteStrokeWidth:l,className:s="",children:i,iconNode:d,...c},u)=>(0,t.createElement)("svg",{ref:u,...a,width:o,height:o,stroke:e,strokeWidth:l?24*Number(n)/Number(o):n,className:r("lucide",s),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,o])=>(0,t.createElement)(e,o)),...Array.isArray(i)?i:[i]]));e.s(["default",0,(e,a)=>{let l=(0,t.forwardRef)(({className:l,...s},i)=>(0,t.createElement)(n,{ref:i,iconNode:a,className:r(`lucide-${o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,l),...s}));return l.displayName=o(e),l}],98453)}]);
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.