PageSourceSearch

https://crystalheartradio.com/assets/TarotDeckBuilder-CwHx6sDT.js

js crystalheartradio.com collected 2026-10-04 07:49:40 UTC 40,681 bytes, 6 lines download raw bytes

1import{c as me,j as e,e as M,f as B,q as O,B as h,a_ as Z,L as D,r as l,d as ue,I as U,o as V,b as p,t as f,v as Y,a2 as W,D as X,l as ee,m as ne,n as ae,av as ge,h as q,g as pe,c3 as he,p as H}from"./index-N0wys5lg.js";import{l as xe}from"./index-BzddkrCy.js";import{C as re}from"./circle-check-brUdtkO3.js";import{P as fe}from"./pen-DBYhFkz0.js";import{E as _e}from"./eye-off-DKl5XKXv.js";import{E as ie}from"./eye-B7DMseVs.js";import{T as ye}from"./trash-2-C9LLEaRO.js";import{L as se}from"./lock-Cn-1m0KK.js";import{T as z}from"./textarea-CxO7Mvaz.js";import{T as ve,a as we,b as be,c as je}from"./tabs-BecNt_uV.js";import{C as ke}from"./chevron-up-C1laQmVo.js";import{U as te}from"./upload-CbeevNmB.js";import{S as Ne}from"./save-CAvNj8qP.js";import{L as Ce}from"./layers-MIZLId6x.js";import{P as Q}from"./plus-DdrBQJ9E.js";import"./index-CfnEu8Sg.js";/**
2 * @license lucide-react v0.475.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Se=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Pe=me("Printer",Se);function Te({deck:n,onEdit:s,onDelete:_,onTogglePublic:y,onDownload:v,onPrintPDF:x,isPurchased:t,isPDFGenerating:g}){const b=Math.round((n.cards_uploaded||0)/78*100),d=n.is_complete||(n.cards_uploaded||0)>=78;return e.jsx(M,{className:"bg-card border-border hover:border-primary/40 transition-all group",children:e.jsx(B,{className:"p-4",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-16 h-20 rounded-lg overflow-hidden shrink-0 bg-gradient-to-br from-purple-900/60 to-indigo-900/60 border border-border flex items-center justify-center",children:n.cover_image_url?e.jsx("img",{src:n.cover_image_url,alt:n.deck_name,className:"w-full h-full object-cover"}):e.jsx("span",{className:"text-2xl",children:"🃏"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-foreground truncate",children:n.deck_name}),d?e.jsxs(O,{className:"bg-green-500/10 text-green-400 border-green-500/30 border shrink-0 text-xs",children:[e.jsx(re,{className:"w-3 h-3 mr-1"}),"Complete"]}):e.jsxs(O,{className:"bg-yellow-500/10 text-yellow-400 border-yellow-500/30 border shrink-0 text-xs",children:[n.cards_uploaded||0,"/78"]})]}),n.description&&e.jsx("p",{className:"text-xs text-muted-foreground mb-2 line-clamp-1",children:n.description}),e.jsx("div",{className:"w-full bg-secondary/40 rounded-full h-1.5 mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full bg-primary transition-all",style:{width:`${b}%`}})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(h,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>s(n),children:[e.jsx(fe,{className:"w-3 h-3 mr-1"}),"Edit"]}),e.jsxs(h,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>y(n),children:[n.is_public?e.jsx(_e,{className:"w-3 h-3 mr-1"}):e.jsx(ie,{className:"w-3 h-3 mr-1"}),n.is_public?"Unpublish":"Publish"]}),e.jsx(h,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-destructive hover:text-destructive",onClick:()=>_(n),children:e.jsx(ye,{className:"w-3 h-3"})}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[v&&e.jsxs(h,{size:"sm",variant:"ghost",className:`h-7 px-2 text-xs ${t?"text-green-400 hover:text-green-300":"text-primary hover:text-primary/80"}`,onClick:()=>v(n),children:[t?e.jsx(Z,{className:"w-3 h-3 mr-1"}):e.jsx(se,{className:"w-3 h-3 mr-1"}),t?"ZIP":"£4.99"]}),t&&x&&e.jsxs(h,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-purple-400 hover:text-purple-300",onClick:()=>x(n),disabled:g,children:[g?e.jsx(D,{className:"w-3 h-3 mr-1 animate-spin"}):e.jsx(Pe,{className:"w-3 h-3 mr-1"}),g?"Generating…":"Print PDF"]})]})]})]})]})})})}const E=[{card_index:0,card_name:"The Fool",arcana:"major",suit:null,upright_meaning:"New beginnings, innocence, spontaneity, free spirit",reversed_meaning:"Recklessness, risk-taking, inconsideration",keywords:["beginnings","innocence","adventure"]},{card_index:1,card_name:"The Magician",arcana:"major",suit:null,upright_meaning:"Manifestation, resourcefulness, power, inspired action",reversed_meaning:"Manipulation, poor planning, untapped talents",keywords:["power","skill","manifestation"]},{card_index:2,card_name:"The High Priestess",arcana:"major",suit:null,upright_meaning:"Intuition, sacred knowledge, divine feminine, subconscious",reversed_meaning:"Secrets, disconnected from intuition, withdrawal",keywords:["intuition","mystery","inner knowledge"]},{card_index:3,card_name:"The Empress",arcana:"major",suit:null,upright_meaning:"Femininity, beauty, nature, nurturing, abundance",reversed_meaning:"Creative block, dependence on others",keywords:["fertility","abundance","nurturing"]},{card_index:4,card_name:"The Emperor",arcana:"major",suit:null,upright_meaning:"Authority, establishment, structure, father figure",reversed_meaning:"Domination, excessive control, rigidity",keywords:["authority","structure","stability"]},{card_index:5,card_name:"The Hierophant",arcana:"major",suit:null,upright_meaning:"Spiritual wisdom, tradition, conformity, morality",reversed_meaning:"Personal beliefs, freedom, challenging the status quo",keywords:["tradition","belief","guidance"]},{card_index:6,card_name:"The Lovers",arcana:"major",suit:null,upright_meaning:"Love, harmony, relationships, values alignment",reversed_meaning:"Self
6-love, disharmony, imbalance",keywords:["love","union","choice"]},{card_index:7,card_name:"The Chariot",arcana:"major",suit:null,upright_meaning:"Control, willpower, success, action, determination",reversed_meaning:"Self-discipline, opposition, lack of direction",keywords:["control","victory","determination"]},{card_index:8,card_name:"Strength",arcana:"major",suit:null,upright_meaning:"Strength, courage, patience, control, compassion",reversed_meaning:"Inner strength, self-doubt, low energy",keywords:["strength","courage","patience"]},{card_index:9,card_name:"The Hermit",arcana:"major",suit:null,upright_meaning:"Soul searching, introspection, being alone, inner guidance",reversed_meaning:"Isolation, loneliness, withdrawal",keywords:["introspection","solitude","guidance"]},{card_index:10,card_name:"Wheel of Fortune",arcana:"major",suit:null,upright_meaning:"Good luck, karma, life cycles, destiny, change",reversed_meaning:"Bad luck, resistance to change, breaking cycles",keywords:["fate","cycles","karma"]},{card_index:11,card_name:"Justice",arcana:"major",suit:null,upright_meaning:"Justice, fairness, truth, cause and effect, law",reversed_meaning:"Unfairness, lack of accountability, dishonesty",keywords:["justice","truth","balance"]},{card_index:12,card_name:"The Hanged Man",arcana:"major",suit:null,upright_meaning:"Pause, surrender, letting go, new perspectives",reversed_meaning:"Delays, resistance, stalling",keywords:["pause","surrender","perspective"]},{card_index:13,card_name:"Death",arcana:"major",suit:null,upright_meaning:"Endings, change, transformation, transition",reversed_meaning:"Resistance to change, personal transformation, inner purging",keywords:["transformation","endings","change"]},{card_index:14,card_name:"Temperance",arcana:"major",suit:null,upright_meaning:"Balance, moderation, patience, purpose, meaning",reversed_meaning:"Imbalance, excess, self-healing, re-alignment",keywords:["balance","moderation","patience"]},{card_index:15,card_name:"The Devil",arcana:"major",suit:null,upright_meaning:"Shadow self, attachment, addiction, restriction",reversed_meaning:"Releasing limiting beliefs, exploring dark thoughts, detachment",keywords:["shadow","bondage","materialism"]},{card_index:16,card_name:"The Tower",arcana:"major",suit:null,upright_meaning:"Sudden change, upheaval, chaos, revelation, awakening",reversed_meaning:"Personal transformation, fear of change, averting disaster",keywords:["upheaval","revelation","chaos"]},{card_index:17,card_name:"The Star",arcana:"major",suit:null,upright_meaning:"Hope, faith, purpose, renewal, spirituality",reversed_meaning:"Lack of faith, despair, self-trust, disconnection",keywords:["hope","faith","renewal"]},{card_index:18,card_name:"The Moon",arcana:"major",suit:null,upright_meaning:"Illusion, fear, the subconscious, intuition",reversed_meaning:"Release of fear, repressed emotion, inner confusion",keywords:["illusion","fear","subconscious"]},{card_index:19,card_name:"The Sun",arcana:"major",suit:null,upright_meaning:"Positivity, fun, warmth, success, vitality",reversed_meaning:"Inner child, feeling down, overly optimistic",keywords:["joy","success","vitality"]},{card_index:20,card_name:"Judgement",arcana:"major",suit:null,upright_meaning:"Judgement, rebirth, inner calling, absolution",reversed_meaning:"Self-doubt, inner critic, ignoring the call",keywords:["rebirth","awakening","absolution"]},{card_index:21,card_name:"The World",arcana:"major",suit:null,upright_meaning:"Completion, integration, accomplishment, travel",reversed_meaning:"Seeking personal closure, short-cuts, delays",keywords:["completion","wholeness","fulfillment"]},{card_index:22,card_name:"Ace of Wands",arcana:"minor",suit:"wands",upright_meaning:"Inspiration, new opportunities, growth, potential",reversed_meaning:"Delays, lack of motivation, weighed down",keywords:["inspiration","potential","spark"]},{card_index:23,card_name:"Two of Wands",arcana:"minor",suit:"wands",upright_meaning:"Future planning, progress, decisions, discovery",reversed_meaning:"Personal goals, inner alignment, fear of unknown",keywords:["planning","decisions","progress"]},{card_index:24,card_name:"Three of Wands",arcana:"minor",suit:"wands",upright_meaning:"Expansion, foresight, overseas opportunities",reversed_meaning:"Playing small, lack of foresight, unexpected delays",keywords:["expansion","foresight","growth"]},{card_index:25,card_name:"Four of Wands",arcana:"minor",suit:"wands",upright_meaning:"Celebration, joy, harmony, relaxation, homecoming",reversed_meaning:"Personal celebration, inner harmony, conflict with others",keywords:["celebration","harmony","homecoming"]},{card_index:26,card_name:"Five of Wands",arcana:"minor",suit:"wands",upright_meaning:"Conflict, disagreements, competition, tension",reversed_meaning:"Inner conflict, conflict avoidance, tension release",keywords:["conflict","competition","tension"]},{card_index:27,card_name:"Six of Wands",arcana:"minor",suit:"wands",upright_meaning:"Success, public re
6cognition, progress, self-confidence",reversed_meaning:"Private achievement, personal definition of success",keywords:["victory","recognition","success"]},{card_index:28,card_name:"Seven of Wands",arcana:"minor",suit:"wands",upright_meaning:"Challenge, competition, protection, perseverance",reversed_meaning:"Exhaustion, giving up, overwhelmed",keywords:["perseverance","challenge","defense"]},{card_index:29,card_name:"Eight of Wands",arcana:"minor",suit:"wands",upright_meaning:"Movement, fast paced change, action, alignment",reversed_meaning:"Delays, frustration, resisting change",keywords:["speed","movement","action"]},{card_index:30,card_name:"Nine of Wands",arcana:"minor",suit:"wands",upright_meaning:"Resilience, courage, persistence, test of faith",reversed_meaning:"Inner resources, struggle, overwhelm",keywords:["resilience","persistence","courage"]},{card_index:31,card_name:"Ten of Wands",arcana:"minor",suit:"wands",upright_meaning:"Burden, extra responsibility, hard work, completion",reversed_meaning:"Doing it all, carrying the burden, delegation",keywords:["burden","responsibility","hard work"]},{card_index:32,card_name:"Page of Wands",arcana:"minor",suit:"wands",upright_meaning:"Exploration, excitement, freedom, adventure",reversed_meaning:"Newly formed ideas, redirecting energy, setbacks",keywords:["adventure","exploration","enthusiasm"]},{card_index:33,card_name:"Knight of Wands",arcana:"minor",suit:"wands",upright_meaning:"Energy, passion, inspired action, adventure",reversed_meaning:"Passion project, haste, scattered energy",keywords:["energy","passion","action"]},{card_index:34,card_name:"Queen of Wands",arcana:"minor",suit:"wands",upright_meaning:"Courage, confidence, independence, social butterfly",reversed_meaning:"Self-respect, self-confidence, introverted",keywords:["confidence","independence","charisma"]},{card_index:35,card_name:"King of Wands",arcana:"minor",suit:"wands",upright_meaning:"Natural leader, vision, entrepreneur, honour",reversed_meaning:"Impulsiveness, haste, ruthless, high expectations",keywords:["leadership","vision","entrepreneur"]},{card_index:36,card_name:"Ace of Cups",arcana:"minor",suit:"cups",upright_meaning:"Love, new relationships, compassion, creativity",reversed_meaning:"Self-love, intuition, repressed emotions",keywords:["love","creativity","new feelings"]},{card_index:37,card_name:"Two of Cups",arcana:"minor",suit:"cups",upright_meaning:"Unified love, partnership, mutual attraction",reversed_meaning:"Self-love, break-ups, disharmony",keywords:["partnership","union","attraction"]},{card_index:38,card_name:"Three of Cups",arcana:"minor",suit:"cups",upright_meaning:"Celebration, friendship, creativity, community",reversed_meaning:"Independence, alone time, hardcore partying",keywords:["celebration","friendship","community"]},{card_index:39,card_name:"Four of Cups",arcana:"minor",suit:"cups",upright_meaning:"Meditation, contemplation, apathy, reevaluation",reversed_meaning:"Retreat, withdrawal, checking in for alignment",keywords:["contemplation","apathy","reevaluation"]},{card_index:40,card_name:"Five of Cups",arcana:"minor",suit:"cups",upright_meaning:"Loss, grief, self-pity, disappointment, regret",reversed_meaning:"Personal setbacks, self-forgiveness, moving on",keywords:["loss","grief","regret"]},{card_index:41,card_name:"Six of Cups",arcana:"minor",suit:"cups",upright_meaning:"Revisiting the past, childhood memories, innocence",reversed_meaning:"Living in the past, forgiveness, lacking playfulness",keywords:["nostalgia","memories","innocence"]},{card_index:42,card_name:"Seven of Cups",arcana:"minor",suit:"cups",upright_meaning:"Opportunities, choices, wishful thinking, illusion",reversed_meaning:"Alignment, personal values, overwhelmed by choices",keywords:["choices","fantasy","illusion"]},{card_index:43,card_name:"Eight of Cups",arcana:"minor",suit:"cups",upright_meaning:"Disappointment, abandonment, withdrawal, escapism",reversed_meaning:"Trying one more time, indecision, aimless drifting",keywords:["withdrawal","disappointment","moving on"]},{card_index:44,card_name:"Nine of Cups",arcana:"minor",suit:"cups",upright_meaning:"Contentment, satisfaction, gratitude, wish come true",reversed_meaning:"Inner happiness, materialism, dissatisfaction",keywords:["contentment","satisfaction","wishes"]},{card_index:45,card_name:"Ten of Cups",arcana:"minor",suit:"cups",upright_meaning:"Divine love, blissful relationships, harmony, alignment",reversed_meaning:"Disconnection, misaligned values, struggling relationships",keywords:["happiness","harmony","family"]},{card_index:46,card_name:"Page of Cups",arcana:"minor",suit:"cups",upright_meaning:"Creative opportunities, intuitive messages, curiosity",reversed_meaning:"New idea, doubting intuition, creative blocks",keywords:["creativity","intuition","messages"]},{card_index:47,card_name:"Knight of Cups",arcana:"minor",suit:"cups",upright_meaning:"Creativity, romance, charm, imagination, beauty",reversed_meaning:"Overactive imagination, unrealistic, jealous",keywords:["romance","charm","creativity"]},{card_index:48,card_name:"Queen of Cups",arcana:"minor",suit:"cups",upright_meaning:"Compassionate, caring, emotionally stable, intuitive",reversed_meaning:"Inner feelings, self
6-care, self-love",keywords:["compassion","intuition","emotional intelligence"]},{card_index:49,card_name:"King of Cups",arcana:"minor",suit:"cups",upright_meaning:"Emotionally balanced, compassionate, diplomatic",reversed_meaning:"Self-compassion, inner feelings, moodiness",keywords:["emotional balance","compassion","wisdom"]},{card_index:50,card_name:"Ace of Swords",arcana:"minor",suit:"swords",upright_meaning:"Breakthroughs, clarity, sharp mind, truth",reversed_meaning:"Inner clarity, re-thinking an idea, clouded judgement",keywords:["clarity","truth","breakthrough"]},{card_index:51,card_name:"Two of Swords",arcana:"minor",suit:"swords",upright_meaning:"Difficult decisions, weighing options, an impasse",reversed_meaning:"Indecision, confusion, information overload",keywords:["decisions","impasse","balance"]},{card_index:52,card_name:"Three of Swords",arcana:"minor",suit:"swords",upright_meaning:"Heartbreak, emotional pain, sorrow, grief",reversed_meaning:"Negative self-talk, releasing pain, optimism",keywords:["heartbreak","sorrow","grief"]},{card_index:53,card_name:"Four of Swords",arcana:"minor",suit:"swords",upright_meaning:"Rest, relaxation, meditation, contemplation",reversed_meaning:"Exhaustion, burnout, deep contemplation",keywords:["rest","recovery","contemplation"]},{card_index:54,card_name:"Five of Swords",arcana:"minor",suit:"swords",upright_meaning:"Conflict, tension, loss, defeat, win at all costs",reversed_meaning:"Reconciliation, making amends, past resentment",keywords:["conflict","defeat","tension"]},{card_index:55,card_name:"Six of Swords",arcana:"minor",suit:"swords",upright_meaning:"Transition, change, rite of passage, releasing baggage",reversed_meaning:"Personal transition, resistance to change, unfinished business",keywords:["transition","moving on","change"]},{card_index:56,card_name:"Seven of Swords",arcana:"minor",suit:"swords",upright_meaning:"Betrayal, deception, getting away with something",reversed_meaning:"Imposter syndrome, self-deceit, keeping secrets",keywords:["deception","strategy","betrayal"]},{card_index:57,card_name:"Eight of Swords",arcana:"minor",suit:"swords",upright_meaning:"Imprisonment, entrapment, self-victimization",reversed_meaning:"Self-limiting beliefs, inner critic, releasing restrictions",keywords:["restriction","imprisonment","limitation"]},{card_index:58,card_name:"Nine of Swords",arcana:"minor",suit:"swords",upright_meaning:"Anxiety, worry, fear, depression, nightmares",reversed_meaning:"Inner turmoil, deep-seated fears, secrets, releasing worry",keywords:["anxiety","worry","fear"]},{card_index:59,card_name:"Ten of Swords",arcana:"minor",suit:"swords",upright_meaning:"Painful endings, deep wounds, betrayal, loss",reversed_meaning:"Recovery, regeneration, resisting an inevitable end",keywords:["endings","painful loss","betrayal"]},{card_index:60,card_name:"Page of Swords",arcana:"minor",suit:"swords",upright_meaning:"New ideas, curiosity, thirst for knowledge, new ways",reversed_meaning:"Self-expression, all talk and no action, haphazard action",keywords:["curiosity","new ideas","communication"]},{card_index:61,card_name:"Knight of Swords",arcana:"minor",suit:"swords",upright_meaning:"Ambitious, action-oriented, driven, fast-thinking",reversed_meaning:"Restless, unfocused, impulsive, burn-out",keywords:["ambition","action","speed"]},{card_index:62,card_name:"Queen of Swords",arcana:"minor",suit:"swords",upright_meaning:"Independent, unbiased judgement, clear boundaries",reversed_meaning:"Overly emotional, easily influenced, bitchy",keywords:["independence","clarity","judgement"]},{card_index:63,card_name:"King of Swords",arcana:"minor",suit:"swords",upright_meaning:"Mental clarity, intellectual power, authority, truth",reversed_meaning:"Quiet power, inner truth, misuse of power",keywords:["authority","clarity","truth"]},{card_index:64,card_name:"Ace of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"New financial opportunity, manifestation, abundance",reversed_meaning:"Lost opportunity, lack of planning, poor financial management",keywords:["opportunity","manifestation","abundance"]},{card_index:65,card_name:"Two of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Multiple priorities, time management, prioritisation",reversed_meaning:"Over-committed, disorganisation, reprioritisation",keywords:["balance","priorities","adaptability"]},{card_index:66,card_name:"Three of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Teamwork, collaboration, learning, implementation",reversed_meaning:"Disharmony, misalignment, working alone",keywords:["teamwork","collaboration","skill"]},{card_index:67,card_name:"Four of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Saving money, security, conservatism, scarcity",reversed_meaning:"Over-spending, greed, self-protection",keywords:["security","savings","control"]},{card_index:68,card_name:"Five of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Financial loss, poverty, lack mindset, isolation",reversed_meaning:"Recovery from financial loss, spiritual poverty",keywords:["hardship","poverty","isolation"]},{card_index:69,card_name:"Six of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Giving, receiving, sharing wealth, generosity",reversed_meaning:"Self
6-care, unpaid debts, one-sided charity",keywords:["generosity","sharing","giving"]},{card_index:70,card_name:"Seven of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Long-term view, sustainable results, perseverance",reversed_meaning:"Lack of long-term vision, limited success, impatience",keywords:["patience","investment","long-term"]},{card_index:71,card_name:"Eight of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Apprenticeship, repetitive tasks, mastery, skill development",reversed_meaning:"Self-development, perfectionism, misdirected activity",keywords:["mastery","skill","dedication"]},{card_index:72,card_name:"Nine of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Abundance, luxury, self-sufficiency, financial independence",reversed_meaning:"Self-worth, over-investment in work, hustling",keywords:["abundance","independence","luxury"]},{card_index:73,card_name:"Ten of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Wealth, financial security, family, long-term success",reversed_meaning:"The dark side of wealth, financial failure or loss",keywords:["wealth","legacy","family"]},{card_index:74,card_name:"Page of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Manifestation, financial opportunity, skill development",reversed_meaning:"Lack of progress, procrastination, learn from failure",keywords:["opportunity","study","manifestation"]},{card_index:75,card_name:"Knight of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Hard work, productivity, routine, conservatism",reversed_meaning:"Self-discipline, boredom, feeling stuck",keywords:["hard work","routine","responsibility"]},{card_index:76,card_name:"Queen of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Nurturing, practical, providing financially, a working parent",reversed_meaning:"Financial independence, self-care, work-home conflict",keywords:["nurturing","practical","financial security"]},{card_index:77,card_name:"King of Pentacles",arcana:"minor",suit:"pentacles",upright_meaning:"Wealth, business, leadership, security, discipline",reversed_meaning:"Financially inept, obsessed with wealth, stubborn",keywords:["wealth","leadership","security"]}];function De({template:n,cardData:s,onUpdate:_}){const[y,v]=l.useState(!1),[x,t]=l.useState(!1),[g,b]=l.useState(!1),[d,C]=l.useState(""),[m,w]=l.useState({card_name:(s==null?void 0:s.card_name)||n.card_name,image_url:(s==null?void 0:s.image_url)||"",upright_meaning:(s==null?void 0:s.upright_meaning)||n.upright_meaning,reversed_meaning:(s==null?void 0:s.reversed_meaning)||n.reversed_meaning,keywords:(s==null?void 0:s.keywords)||n.keywords}),P=l.useRef(),j=!!m.image_url,R=async r=>{var F;const o=(F=r.target.files)==null?void 0:F[0];if(!o)return;t(!0);const{file_url:u}=await p.integrations.Core.UploadFile({file:o}),I={...m,image_url:u};w(I),_({...n,...I}),t(!1),f.success(`${n.card_name} image uploaded`)},T=async()=>{b(!0);try{const r=`A mystical tarot card illustration for "${m.card_name}". ${m.upright_meaning?`Symbolism: ${m.upright_meaning}.`:""} ${d?`Art style: ${d}.`:"Art style: detailed fantasy illustration, ornate border, dark mystical aesthetic, rich colors."} The card should feel magical and spiritual.`,{url:o}=await p.integrations.Core.GenerateImage({prompt:r}),u={...m,image_url:o};w(u),_({...n,...u}),f.success(`AI image generated for ${n.card_name}`)}catch(r){f.error("Image generation failed: "+r.message)}finally{b(!1)}},k=()=>{_({...n,...m})},a={wands:"text-orange-400",cups:"text-blue-400",swords:"text-slate-400",pentacles:"text-yellow-400"}[n.suit]||"text-primary";return e.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card/50",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-secondary/20 transition-colors",onClick:()=>v(r=>!r),children:[e.jsxs("div",{className:"w-8 h-11 rounded shrink-0 overflow-hidden bg-gradient-to-br from-purple-900/60 to-indigo-900/60 border border-purple-500/40 flex flex-col items-center justify-between py-0.5 relative",children:[e.jsx("span",{className:"text-[4px] text-purple-300 font-bold leading-none tracking-tight",children:"✦ CHR ✦"}),j?e.jsx("img",{src:m.image_url,alt:n.card_name,className:"w-full flex-1 object-cover"}):e.jsx("span",{className:"text-base flex-1 flex items-center justify-center",children:"🃏"}),e.jsx("span",{className:"text-[3px] text-purple-400 leading-none",children:"CRYSTAL HEART"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.card_name}),e.jsx("p",{className:`text-xs capitalize ${a}`,children:n.arcana==="major"?"Major Arcana":`${n.suit}`})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[j&&e.jsx(re,{className:"w-4 h-4 text-green-400"}),y?e.jsx(ke,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(ue,{className:"w-4 h-4 text-muted-foreground"})]})]}),y&&e.jsxs("div",{className:"p-4 pt-0 space-y-3 border-t border-border/50",children:[e.jsxs("div",{className:"space-y-2",children:[j&&e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:m.image_url,alt:"",className:"h-32 w-auto rounded-lg object-cover border border-border/50"})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"AI Art Style (optional)"}),e.jsx(U,{value:d,onChange:r=>C(r.target.value),placeholder:"e.g. watercolour, art deco, gothic, manga...",className:"bg-secondary/30 border-border h-8 text-xs"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:P,type:"file",accept:"image/*",className:"hidden",onChange:R}),e.jsxs(h,{size:"sm",variant:"outline",className:"flex-1 border-border text-xs h-9",onClick:()=>{var r;return(r=P.current)==null?void 0:r.click()},disabled:x||g,children:[x?e.jsx(D,{className:"w-4 h-4 animate-spin mr-1"}):e.jsx(te,{className:"w-4 h-4 mr-1"}),"Upload"]}),e.jsxs(h,{size:"sm",className:"flex-1 bg-primary text-primary-foreground hover:bg-primary/90 text-xs h-9",onClick:T,disabled:x||g,children:[g?e.jsx(D,{className:"w-4 h-4 animate-spin mr-1"}):e.jsx(V,{className:"w-4 h-4 mr-1"}),g?"Generating...":"Generate with AI"]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"Card Name"}),e.jsx(U,{value:m.card_name,onChange:r=>w(o=>({...o,card_name:r.target.value})),onBlur:k,className:"bg-secondary/30 border-border h-8 text-sm"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"↑ Upright Meaning"}),e.jsx(z,{value:m.upright_meaning,onChange:r=>w(o=>({...o,upright_meaning:r.target.value})),onBlur:k,rows:3,className:"bg-secondary/30 border-border text-xs resize-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"↓ Reversed Meaning"}),e.jsx(z,{value:m.reversed_meaning,onChange:r=>w(o=>({...o,reversed_meaning:r.target.value})),onBlur:k,rows:3,className:"bg-secondary/30 border-border text-xs resize-none"})]})]})]})]})}const G=["major","wands","cups","swords","pentacles"];function Ie({deck:n,open:s,onClose:_}){const y=Y(),v=l.useRef(),[x,t]=l.useState(!1),[g,b]=l.useState(!1),[d,C]=l.useState({deck_name:(n==null?void 0:n.deck_name)||"",description:(n==null?void 0:n.description)||"",cover_image_url:(n==null?void 0:n.cover_image_url)||"",price_gbp:(n==null?void 0:n.price_gbp)||0}),[m,w]=l.useState(()=>{const a={};
6return((n==null?void 0:n.cards)||[]).forEach(r=>{a[r.card_index]=r}),a});l.useEffect(()=>{if(n){C({deck_name:n.deck_name,description:n.description||"",cover_image_url:n.cover_image_url||"",price_gbp:n.price_gbp||0});const a={};(n.cards||[]).forEach(r=>{a[r.card_index]=r}),w(a)}},[n==null?void 0:n.id,n==null?void 0:n.deck_name]);const P=Object.values(m).filter(a=>a.image_url).length,j=l.useCallback(a=>{w(r=>({...r,[a.card_index]:a}))},[]),R=async a=>{var u;const r=(u=a.target.files)==null?void 0:u[0];if(!r)return;t(!0);const{file_url:o}=await p.integrations.Core.UploadFile({file:r});C(I=>({...I,cover_image_url:o})),t(!1)},T=W({mutationFn:async()=>{const a=E.map(u=>({...u,...m[u.card_index]||{}})),r=a.filter(u=>u.image_url).length,o=r>=78;return n!=null&&n.id?p.entities.CustomTarotDeck.update(n.id,{...d,cards:a,cards_uploaded:r,is_complete:o}):p.entities.CustomTarotDeck.create({...d,owner_email:(await p.auth.me()).email,cards:a,cards_uploaded:r,is_complete:o})},onSuccess:()=>{y.invalidateQueries({queryKey:["my-tarot-decks"]}),f.success("Deck saved!"),_()},onError:()=>f.error("Failed to save deck")}),k={major:E.filter(a=>a.arcana==="major"),wands:E.filter(a=>a.suit==="wands"),cups:E.filter(a=>a.suit==="cups"),swords:E.filter(a=>a.suit==="swords"),pentacles:E.filter(a=>a.suit==="pentacles")};return e.jsx(X,{open:s,onOpenChange:_,children:e.jsxs(ee,{className:"bg-card border-border max-w-2xl w-full h-[90vh] flex flex-col p-0",children:[e.jsx(ne,{className:"p-5 pb-3 border-b border-border shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ae,{className:"font-heading text-lg",children:n!=null&&n.id?"Edit Deck":"Create New Deck"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(O,{className:"bg-primary/10 text-primary border-primary/30 border text-xs",children:[P,"/78 cards"]}),e.jsxs(h,{size:"sm",onClick:()=>T.mutate(),disabled:T.isPending||!d.deck_name,className:"bg-primary text-primary-foreground hover:bg-primary/90 h-8",children:[T.isPending?e.jsx(D,{className:"w-3.5 h-3.5 mr-1 animate-spin"}):e.jsx(Ne,{className:"w-3.5 h-3.5 mr-1"}),"Save"]})]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5 space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-[80px_1fr] gap-4",children:[e.jsxs("div",{children:[e.jsx("input",{ref:v,type:"file",accept:"image/*",className:"hidden",onChange:R}),e.jsx("div",{onClick:()=>{var a;return(a=v.current)==null?void 0:a.click()},className:"w-20 h-24 rounded-lg border-2 border-dashed border-border hover:border-primary/50 cursor-pointer overflow-hidden bg-secondary/20 flex items-center justify-center transition-colors",children:x?e.jsx(D,{className:"w-5 h-5 animate-spin text-muted-foreground"}):d.cover_image_url?e.jsx("img",{src:d.cover_image_url,alt:"Cover",className:"w-full h-full object-cover"}):e.jsxs("div",{className:"text-center",children:[e.jsx(te,{className:"w-4 h-4 text-muted-foreground mx-auto"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Cover"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(U,{placeholder:"Deck name *",value:d.deck_name,onChange:a=>C(r=>({...r,deck_name:a.target.value})),className:"bg-secondary/30 border-border"}),e.jsx(z,{placeholder:"Description (optional)",value:d.description,onChange:a=>C(r=>({...r,description:a.target.value})),rows:2,className:"bg-secondary/30 border-border text-sm resize-none"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{type:"number",placeholder:"Price (£0 = free)",value:d.price_gbp,onChange:a=>C(r=>({...r,price_gbp:parseFloat(a.target.value)||0})),className:"bg-secondary/30 border-border h-8 text-sm w-40"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"GBP — set 0 for free in shop"})]})]})]}),e.jsxs(ve,{defaultValue:"major",children:[e.jsx(we,{className:"w-full grid grid-cols-5 h-8",children:G.map(a=>{const r=k[a].filter(o=>{var u;return(u=m[o.card_index])==null?void 0:u.image_url}).length;return e.jsxs(be,{value:a,className:"text-xs capitalize relative",children:[a==="major"?"Major":a.charAt(0).toUpperCase()+a.slice(1),r>0&&e.jsxs("span",{className:"ml-1 text-[10px] text-green-400",children:["(",r,")"]})]},a)})}),G.map(a=>e.jsx(je,{value:a,className:"mt-3 space-y-1.5",children:k[a].map(r=>e.jsx(De,{template:r,cardData:m[r.card_index],onUpdate:j},r.card_index))},a))]})]})]})})}xe("");console.error("VITE_STRIPE_PUBLISHABLE_KEY is not configured");const J=4.99;function Ge(){var K;const{user:n}=ge(),s=Y(),[_,y]=l.useState(null),[v,x]=l.useState(!1),[t,g]=l.useState(null),[b,d]=l.useState(!1),[C,m]=l.useState(null),[w,P]=l.useState(null),{data:j=[],isLoading:R}=q({queryKey:["my-tarot-decks"],queryFn:()=>p.entities.CustomTarotDeck.filter({owner_email:n==null?void 0:n.email},"-created_date",50),enabled:!!(n!=null&&n.email)}),{data:T=[]}=q({queryKey:["custom-deck-purchases",n==null?void 0:n.email],queryFn:()=>
6p.asServiceRole.entities.TarotDeckPurchase.filter({user_email:n.email,payment_status:"completed"}),enabled:!!(n!=null&&n.email)}),k=i=>T.some(c=>c.product_id===i),a=W({mutationFn:i=>p.entities.CustomTarotDeck.delete(i),onSuccess:()=>{s.invalidateQueries({queryKey:["my-tarot-decks"]}),f.success("Deck deleted")}}),r=W({mutationFn:({id:i,is_public:c})=>p.entities.CustomTarotDeck.update(i,{is_public:c}),onSuccess:(i,c)=>{s.invalidateQueries({queryKey:["my-tarot-decks"]}),f.success(c.is_public?"Deck published to shop":"Deck unpublished")}}),o=()=>{y(null),x(!0)},u=i=>{y(i),x(!0)},I=i=>{confirm(`Delete "${i.deck_name}"? This cannot be undone.`)&&a.mutate(i.id)},F=i=>{r.mutate({id:i.id,is_public:!i.is_public})},oe=async i=>{P(i.id);try{const c=await p.functions.invoke("generateCustomDeckPDF",{customDeckId:i.id}),N=new Blob([c.data],{type:"application/pdf"}),A=URL.createObjectURL(N),S=document.createElement("a");S.href=A,S.download=`${i.deck_name.replace(/\s+/g,"_")}_print.pdf`,document.body.appendChild(S),S.click(),document.body.removeChild(S),URL.revokeObjectURL(A),f.success("Print PDF downloaded!")}catch(c){f.error("PDF generation failed: "+c.message)}finally{P(null)}},ce=i=>{k(i.id)?$(i.id):g(i)},$=async i=>{try{d(!0);const c=await p.functions.invoke("generateTarotDeckZip",{customDeckId:i});f.success("Download starting...");const N=j.find(le=>le.id===i),A=new Blob([c.data],{type:"application/zip"}),S=URL.createObjectURL(A),L=document.createElement("a");L.href=S,L.download=`${(N==null?void 0:N.deck_name)||"tarot_deck"}.zip`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(S)}catch(c){f.error("Download failed: "+c.message)}finally{d(!1)}},de=async()=>{if(t){d(!0);try{const c=(await p.functions.invoke("createCustomDeckCheckout",{deckId:t.id})).data;if(c.already_purchased){s.invalidateQueries({queryKey:["custom-deck-purchases"]}),g(null),await $(t.id);return}window.location.href=`/checkout?clientSecret=${encodeURIComponent(c.clientSecret)}&amount=${c.amount}&type=custom_deck_download&returnTo=/tarot-deck-builder`}catch(i){f.error("Could not initiate payment: "+i.message)}finally{d(!1)}}};return n?e.jsxs("div",{className:"min-h-screen p-4 sm:p-6 md:p-8",children:[e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3 mb-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"font-heading text-2xl sm:text-3xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(Ce,{className:"w-7 h-7 text-primary"}),"Tarot Deck Builder"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create custom 78-card decks to use in live reading sessions"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{to:"/tarot-shop",children:e.jsxs(h,{variant:"outline",size:"sm",className:"border-border",children:[e.jsx(he,{className:"w-4 h-4 mr-1.5"}),"Shop"]})}),e.jsxs(h,{onClick:o,className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[e.jsx(Q,{className:"w-4 h-4 mr-1.5"}),"New Deck"]})]})]}),e.jsx(M,{className:"bg-gradient-to-r from-primary/10 to-accent/10 border-primary/30 mb-6",children:e.jsx(B,{className:"py-4 px-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(V,{className:"w-5 h-5 text-primary shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("p",{className:"font-medium text-foreground",children:["Build & preview your deck for free — download the full pack for £",J]}),e.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:"Upload all 78 cards, customise meanings, use in live readings, and purchase a ZIP download of your complete deck."})]})]})})}),R?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(D,{className:"w-8 h-8 text-primary animate-spin"})}):j.length===0?e.jsx(H.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:e.jsx(M,{className:"bg-card border-dashed border-border",children:e.jsxs(B,{className:"py-16 text-center",children:[e.jsx("div",{className:"text-5xl mb-4",children:"🃏"}),e.jsx("h3",{className:"font-heading text-xl font-semibold text-foreground mb-2",children:"No decks yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Create your first custom tarot deck and start uploading your artwork."}),e.jsxs(h,{onClick:o,className:"bg-primary text-primary-foreground hover:bg-primary/90",children:[e.jsx(Q,{className:"w-4 h-4 mr-2"}),"Create My First Deck"]})]})})}):e.jsx("div",{className:"space-y-3",children:j.map(i=>e.jsx(H.div,{initial:{opacity:0,y:6}
6,animate:{opacity:1,y:0},children:e.jsx(Te,{deck:i,onEdit:u,onDelete:I,onTogglePublic:F,onDownload:ce,onPrintPDF:oe,isPurchased:k(i.id),isPDFGenerating:w===i.id})},i.id))})]}),v&&e.jsx(Ie,{deck:_,open:v,onClose:()=>{x(!1),y(null)}}),e.jsx(X,{open:!!t,onOpenChange:()=>g(null),children:e.jsxs(ee,{className:"bg-card border-border max-w-md",children:[e.jsx(ne,{children:e.jsx(ae,{className:"font-heading",children:"Download Full Deck Pack"})}),t&&e.jsxs("div",{className:"space-y-4",children:[((K=t.cards)==null?void 0:K.filter(i=>i.image_url).length)>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-2 flex items-center gap-1",children:[e.jsx(ie,{className:"w-3 h-3"})," Preview (10 of ",t.cards_uploaded||0," cards)"]}),e.jsx("div",{className:"grid grid-cols-5 gap-1.5",children:t.cards.filter(i=>i.image_url).slice(0,10).map((i,c)=>e.jsxs("div",{className:"rounded overflow-hidden aspect-[3/4] bg-secondary relative",children:[e.jsx("img",{src:i.image_url,alt:i.card_name,className:"w-full h-full object-cover"}),c===9&&t.cards.filter(N=>N.image_url).length>10&&e.jsxs("div",{className:"absolute inset-0 bg-black/70 flex flex-col items-center justify-center",children:[e.jsx(se,{className:"w-4 h-4 text-white mb-0.5"}),e.jsxs("span",{className:"text-[9px] text-white",children:["+",t.cards.filter(N=>N.image_url).length-10," more"]})]})]},c))})]}),e.jsxs("div",{className:"p-4 rounded-lg bg-secondary/20 border border-border space-y-1",children:[e.jsx("p",{className:"font-medium text-foreground",children:t.deck_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.cards_uploaded||0," cards uploaded"]}),e.jsxs("p",{className:"text-2xl font-bold text-accent",children:["£",J]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"One-time purchase. You'll receive a ZIP file with your complete custom deck data."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(h,{variant:"outline",className:"flex-1 border-border",onClick:()=>g(null),disabled:b,children:"Cancel"}),e.jsxs(h,{className:"flex-1 bg-primary text-primary-foreground hover:bg-primary/90",onClick:de,disabled:b,children:[b?e.jsx(D,{className:"w-4 h-4 animate-spin mr-2"}):e.jsx(Z,{className:"w-4 h-4 mr-2"}),"Buy & Download"]})]})]})]})})]}):null}export{Ge 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.