import{z as x,r as h,j as e,aw as g,q as s,b6 as p,b7 as u,T as b,S as f,x as y,b8 as j,v as N}from"./index-oAPVDf-r.js";import{u as v}from"./useQuery-BxfmyRLz.js";import{S as k}from"./shield-BWGzcrms.js";import{H as w}from"./heart-BjLemQnU.js";import{E as C}from"./eye-G89nJUb2.js";import{N as S,B as E}from"./network-DAH-TQsi.js";import{K as P}from"./key-BAzZqC6d.js";import{G as A}from"./graduation-cap-Bk5l1TQx.js";import{C as I}from"./chevron-down-QDDHZwZg.js";import{A as K}from"./index-B-MEeiYV.js";import{A as M}from"./arrow-left-m6EiMbb-.js";const q=()=>v({queryKey:["principles"],queryFn:async()=>{const{data:r,error:a}=await x.from("principles").select("*").order("order_index",{ascending:!0});if(a)throw a;return r}}),z={target:b,"graduation-cap":A,wallet:u,key:P,brain:E,users:p,network:S,eye:C,heart:w,shield:k},c=["from-primary/20 to-primary/5 border-primary/30","from-blue-500/20 to-blue-500/5 border-blue-500/30","from-amber-500/20 to-amber-500/5 border-amber-500/30","from-emerald-500/20 to-emerald-500/5 border-emerald-500/30","from-violet-500/20 to-violet-500/5 border-violet-500/30","from-rose-500/20 to-rose-500/5 border-rose-500/30","from-cyan-500/20 to-cyan-500/5 border-cyan-500/30","from-orange-500/20 to-orange-500/5 border-orange-500/30","from-indigo-500/20 to-indigo-500/5 border-indigo-500/30","from-teal-500/20 to-teal-500/5 border-teal-500/30"],m=["text-primary bg-primary/20","text-blue-500 bg-blue-500/20","text-amber-500 bg-amber-500/20","text-emerald-500 bg-emerald-500/20","text-violet-500 bg-violet-500/20","text-rose-500 bg-rose-500/20","text-cyan-500 bg-cyan-500/20","text-orange-500 bg-orange-500/20","text-indigo-500 bg-indigo-500/20","text-teal-500 bg-teal-500/20"],B=({principle:r,index:a,isExpanded:i,onToggle:d})=>{const n=r.icon?z[r.icon]:f,l=c[a%c.length],t=m[a%m.length];return e.jsx(s.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:a*.08},children:e.jsx(y,{className:`overflow-hidden cursor-pointer transition-all duration-300 bg-gradient-to-br ${l} hover:shadow-lg border`,onClick:d,children:e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center shrink-0 ${t}`,children:n&&e.jsx(n,{className:"w-6 h-6"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx("span",{className:"text-xs font-bold text-muted-foreground opacity-60",children:String(r.order_index).padStart(2,"0")})}),e.jsx("h3",{className:"font-semibold text-lg text-foreground leading-tight",children:r.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2 leading-relaxed",children:r.summary})]}),e.jsx(s.div,{animate:{rotate:i?180:0},transition:{duration:.2},className:"shrink-0 mt-1",children:e.jsx(I,{className:"w-5 h-5 text-muted-foreground"})})]}),e.jsx(K,{children:i&&e.jsx(s.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden",children:e.jsx("div",{className:"pt-4 mt-4 border-t border-border/50",children:e.jsx("p",{className:"text-foreground/90 leading-relaxed whitespace-pre-line",children:r.content})})})})]})})})},L=()=>{const{data:r,isLoading:a,error:i}=q(),[d,n]=h.useState(null),l=t=>{n(o=>o===t?null:t)};return a?e.jsx("div",{className:"space-y-4 p-4",children:[...Array(4)].map((t,o)=>e.jsx(g,{className:"h-32 w-full rounded-xl"},o))}):i?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"Kunde inte ladda principer"}):e.jsxs("div",{className:"space-y-6 p-4",children:[e.jsxs(s.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"text-center space-y-3 pb-4",children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Master Prompt"}),e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto text-sm leading-relaxed",children:"Etisk, teknisk och samhällsbärande ram för utbildning, kompetens och systembyggande."})]}),e.jsx("div",{className:"space-y-3",children:r==null?void 0:r.map((t,o)=>e.jsx(B,{principle:t,index:o,isExpanded:d===t.id,onToggle:()=>l(t.id)},t.id))}),e.jsx(s.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.8},className:"text-center pt-6 pb-2",children:e.jsx("p",{className:"text-xs text-muted-foreground italic max-w-sm mx-auto",children:'"Vi tar ansvar för framtiden genom att bygga öppna, etiska och tekniskt korrekta system som låter människor arbeta, lära och utvecklas i takt med verkligheten."'})})]})},V=()=>e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(s.header,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"sticky top-0 z-50 bg-background/80 backdrop-blur-md border-b border-border",children:e.jsxs("div",{className:"container flex items-center gap-4 h-14 px-4",children:[e.jsx(j,{to:"/",children:e.jsx(N,{variant:"ghost",size:"icon",className:"shrink-0",children:e.jsx(M,{className:"w-5 h-5"})})}),e.jsx("h1",{className:"font-semibold truncate",children:"Manifest"})]})}),e.jsx("main",{className:"container max-w-2xl pb-20",children:e.jsx(L,{})})]});export{V as default};