PageSourceSearch

https://www.bibledecoder.sbs/assets/SimulatorHub-ChUoA2Pb.js

js bibledecoder.sbs collected 2026-10-09 22:00:55 UTC 10,694 bytes, 6 lines download raw bytes

1import{n as B,r as l,a as H,j as e,C as m,d as h,h as P,p as f,L as U,q as g,g as E,f as p,a8 as q,a9 as O,m as x,a3 as V,aa as R,a0 as F,ab as $,ac as D,s as G,k as y,D as W,ad as J,a1 as A,I as K,ae as M,e as Z}from"./index-DD-RFdji.js";/**
2 * @license lucide-react v0.462.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 z=B("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);function Q({verseReference:c,verseText:k}){const[i,C]=l.useState(null),[o,b]=l.useState(null),[n,j]=l.useState(!1),[N,v]=l.useState(!1),[s,u]=l.useState(!1),w=H(),S=async()=>{var a,t;v(!0),b(null),j(!1),u(!1);try{const{data:r,error:d}=await G.functions.invoke("generate-application-scenario",{body:{verseReference:c,verseText:k}});if(d){if(console.error("Scenario error:",d),(a=d.message)!=null&&a.includes("403")){u(!0);return}throw d}if(r!=null&&r.error){if(r.requiresUpgrade){u(!0);return}throw new Error(r.error)}C(r.scenario)}catch(r){console.error("Error loading scenario:",r),r.status===403||r.code===403||(t=r.message)!=null&&t.includes("Pro")?u(!0):y.error("Failed to load scenario. Please try again.")}finally{v(!1)}};l.useEffect(()=>{S()},[c]);const I=()=>{if(o===null){y.error("Please select a response");return}j(!0)};if(N)return e.jsx(m,{children:e.jsx(h,{className:"flex items-center justify-center py-12",children:e.jsx(P,{className:"h-8 w-8 animate-spin text-primary"})})});if(s)return e.jsxs(m,{className:"border-2 border-primary/20",children:[e.jsxs(f,{className:"text-center",children:[e.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mb-4",children:e.jsx(U,{className:"h-6 w-6 text-primary"})}),e.jsxs(g,{className:"flex items-center justify-center gap-2",children:["Pro Feature",e.jsx(E,{className:"h-5 w-5 text-yellow-500"})]})]}),e.jsxs(h,{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-muted-foreground",children:"Life Application Simulator requires a Pro or Premium subscription. Practice applying Scripture to real-life situations with AI-generated scenarios."}),e.jsxs("div",{className:"flex gap-2 justify-center",children:[e.jsxs(p,{onClick:()=>w("/billing"),children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]}),e.jsx(p,{variant:"outline",onClick:S,children:"Try Again"})]})]})]});if(!i)return e.jsx(m,{children:e.jsxs(h,{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[e.jsx("p",{className:"text-muted-foreground",children:"Failed to load scenario. Please try again."}),e.jsxs(p,{onClick:S,variant:"outline",children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Retry"]})]})});o!==null&&i.options[o];const T=i.options.reduce((a,t,r)=>{var d,L;return t.wisdomScore+t.graceScore>(((d=i.options[a])==null?void 0:d.wisdomScore)||0)+(((L=i.options[a])==null?void 0:L.graceScore)||0)?r:a},0);return e.jsxs(m,{children:[e.jsxs(f,{children:[e.jsxs(g,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-primary"}),"Life Application Simulator"]}),e.jsx(O,{variant:"secondary",children:i.category})]}),e.jsxs(h,{className:"space-y-6",children:[e.jsx("div",{className:"bg-muted/50 rounded-lg p-4",children:e.jsx("p",{className:"text-sm leading-relaxed",children:i.scenario})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm font-medium",children:"How would you respond?"}),i.options.map((a,t)=>e.jsx(x.div,{whileHover:{scale:1.01},whileTap:{scale:.99},children:e.jsxs("button",{onClick:()=>!n&&b(t),disabled:n,className:`w-full text-left p-4 rounded-lg border-2 transition-all ${o===t?"border-primary bg-primary/5":"border-border hover:border-primary/50"} ${n&&t===T?"ring-2 ring-green-500":""}`,children:[e.jsx("p",{className:"text-sm",children:a.text}),n&&e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-yellow-500"}),e.jsx("span",{className:"text-xs",children:"Wisdom:"}),e.jsx(R,{value:a.wisdomScore*10,className:"h-2 flex-1"}),e.jsxs("span",{className:"text-xs font-medium",children:[a.wisdomScore,"/10"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4 text-pink-500"}),e.jsx("span",{className:"text-xs",children:"Grace:"}),e.jsx(R,{value:a.graceScore*10,className:"h-2 flex-1"}),e.jsxs("span",{className:"text-xs font-medium",children:[a.graceScore,"/10"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground italic mt-2",children:["Principle: ",a.principle]})]})]})},t))]}),!n&&e.jsx(p,{onClick:I,className:"w-full",disabled:o===null,children:"Submit Response"}),e.jsx($,{children:n&&e.jsxs(x.div,{initial:{opacity:0,height:0}
6,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-4",children:[e.jsx("div",{className:"bg-primary/5 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(D,{className:"h-5 w-5 text-primary mt-1"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Analysis"}),e.jsx("p",{className:"text-sm mb-3",children:i.bestResponse}),e.jsx("p",{className:"text-sm text-muted-foreground",children:i.explanation})]})]})}),e.jsx(p,{onClick:S,variant:"outline",className:"w-full",children:"Try Another Scenario"})]})})]})]})}function Y(){const[c,k]=l.useState(""),[i,C]=l.useState(""),[o,b]=l.useState(!1),[n,j]=l.useState(!1),N=async()=>{if(!c.trim()){y.error("Please enter a verse reference");return}j(!0);try{const{data:s,error:u}=await G.functions.invoke("fetch-bible-passage",{body:{reference:c.trim(),translation:"KJV"}});if(!u&&(s!=null&&s.verses)){const w=s.verses[0];w&&C(w.text)}b(!0),y.success("Scenario generator ready!")}catch(s){console.error("Error:",s),y.error("Failed to load. Please try again.")}finally{j(!1)}},v=[{icon:F,title:"Personal Life",description:"Relationships, emotions, and personal growth",color:"biblical-gold",scenarios:12},{icon:z,title:"Work & Career",description:"Professional challenges and decisions",color:"biblical-blue",scenarios:8},{icon:M,title:"Family & Friends",description:"Family dynamics and friendships",color:"biblical-green",scenarios:10},{icon:Z,title:"Spiritual Growth",description:"Faith journey and discipleship",color:"biblical-purple",scenarios:15}];return e.jsx(W,{children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(J,{className:"h-8 w-8 text-biblical-purple"}),e.jsx("h1",{className:"font-display text-3xl font-black tracking-tight",children:"Life Application Simulator"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Practice applying Scripture to real-life situations"})]}),e.jsx(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},children:e.jsxs(m,{children:[e.jsxs(f,{children:[e.jsx(g,{children:"Generate New Scenario"}),e.jsx(A,{children:"Enter a verse to create realistic application scenarios"})]}),e.jsx(h,{className:"space-y-4",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx(K,{placeholder:"e.g., John 3:16 or Proverbs 3:5-6",value:c,onChange:s=>k(s.target.value),onKeyDown:s=>s.key==="Enter"&&N()}),e.jsx(p,{onClick:N,disabled:n,className:"min-w-[120px]",children:n?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):"Generate"})]})})]})}),o&&c&&e.jsx(x.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.3},children:e.jsx(Q,{verseReference:c,verseText:i})}),e.jsx(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},children:e.jsxs(m,{children:[e.jsxs(f,{children:[e.jsx(g,{children:"Browse Scenario Library"}),e.jsx(A,{children:"Explore scenarios by life category"})]}),e.jsx(h,{children:e.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:v.map(s=>e.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-lg bg-accent/50 hover:bg-accent transition-colors cursor-pointer group",children:[e.jsx("div",{className:`p-3 rounded-lg bg-${s.color}/20`,children:e.jsx(s.icon,{className:`h-6 w-6 text-${s.color}`})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-display font-black mb-1",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:s.description}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.scenarios," scenarios available"]})]})]},s.title))})})]})}),e.jsx(x.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.3},children:e.jsxs(m,{children:[e.jsx(f,{children:e.jsx(g,{children:"How It Works"})}),e.jsxs(h,{className:"space-y-3",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-biblical-blue/20 flex items-center justify-center text-biblical-blue font-bold",children:"1"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display font-black mb-1",children:"Enter a verse"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Provide any Scripture reference to base scenarios on"})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-biblical-gold/20 flex items-center justify-center text-biblical-gold font-bold",children:"2"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display font-black mb-1",children:"Read the scenario"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"AI generates realistic life situations that relate to the verse"})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-biblical-green/20 flex items-center justify-center text-biblical-green font-bold",children:"3"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display font-black mb-1",children:"Choose your response"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Select how you would apply the verse in that situation"})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-biblical-purple/20 flex items-center justify-center text-biblical-purple font-bold",children:"4"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display font-black mb-1",children:"Get feedback"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive biblical guidance on your choice"})]})]})]})]})})]})})}export{Y 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.