PageSourceSearch

https://komiko.app/_next/static/chunks/pages/scenes/[scene_id]-288806ff87c68e2d.js

js komiko.app collected 2026-09-24 22:23:51 UTC 25,464 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60431],{808501:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/scenes/[scene_id]",function(){return a(584298)}])},942232:function(e,t,a){"use strict";a.d(t,{Z:function(){return o},h:function(){return u}});var r=a(785893),s=a(667294),l=a(425675),n=a.n(l),c=a(148938);let i={"ocs-world":{src:"/ads/worldos/ocs-world.webp",width:2048,height:768},"playable-world":{src:"/ads/worldos/playable-world.webp",width:2172,height:499},"enter-worldos":{src:"/ads/worldos/enter-worldos.webp",width:2172,height:724},"stop-making":{src:"/ads/worldos/stop-making.webp",width:1571,height:910},hogwarts:{src:"/ads/worldos/hogwarts.webp",width:2034,height:653,href:"https://worldos.cc/worlds/hogwarts"},"life-sim":{src:"/ads/worldos/life-sim.webp",width:2048,height:768,href:"https://worldos.cc/worlds/life-sim"}};function o(e){let{variant:t,placement:a,className:l=""}=e,o=i[t],d="href"in o?o.href:"https://worldos.cc/worlds",u="desktopSrc"in o?o:null,h=(0,s.useRef)(null),m=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{let e=h.current;if(!e||m.current)return;let r=new IntersectionObserver(e=>{var s;(null===(s=e[0])||void 0===s?void 0:s.isIntersecting)&&!m.current&&(m.current=!0,(0,c.safeCapture)("worldos_ad_viewed",{placement:a,variant:t}),r.disconnect())},{threshold:.5});return r.observe(e),()=>r.disconnect()},[a,t]),(0,r.jsxs)("a",{ref:h,href:d,target:"_blank",rel:"noopener noreferrer sponsored","aria-label":"WorldOS",onClick:()=>(0,c.safeCapture)("worldos_ad_clicked",{placement:a,variant:t}),className:"group relative block overflow-hidden rounded-2xl transition-transform duration-200 hover:scale-[1.01] ".concat(l),children:[(0,r.jsx)(n(),{src:o.src,width:o.width,height:o.height,alt:"WorldOS — turn your characters into a playable world",className:"h-auto w-full object-cover ".concat(u?"lg:hidden":""),sizes:"(max-width: 768px) 100vw, 1200px"}),u&&(0,r.jsx)(n(),{src:u.desktopSrc,width:u.desktopWidth,height:u.desktopHeight,alt:"WorldOS — turn your characters into a playable world",className:"hidden w-full object-fill lg:block lg:aspect-[6/1]",sizes:"1200px"})]})}let d=["enter-worldos","hogwarts","life-sim"];function u(e){let{placement:t,className:a}=e,[l,n]=(0,s.useState)(0);return(0,s.useEffect)(()=>{n(Math.floor(Math.random()*d.length))},[]),(0,r.jsx)(o,{variant:d[l],placement:t,className:a})}},914604:function(e,t,a){"use strict";a.d(t,{m:function(){return n}});var r=a(667294),s=a(248583),l=a(980232);function n(){let e=(0,s.Dv)(l.L4),[t,a]=(0,s.KO)(l.pX),[n,c]=(0,r.useState)(!1),[i,o]=(0,r.useState)(null),d=(0,r.useRef)(!1);return{sessions:t,loading:n,error:i,fetchSessions:(0,r.useCallback)(async()=>{if(e&&!d.current)try{d.current=!0,c(!0),o(null);let e=await fetch("/api/chat/sessions"),t=await e.json();1===t.code?a(t.data||[]):o(t.error||"Failed to load sessions")}catch(e){console.error("useChatSessions: fetch error",e),o("Failed to load sessions")}finally{c(!1),d.current=!1}},[e,a]),createSession:(0,r.useCallback)(async(e,t)=>{try{let a=await fetch("/api/chat/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify("number"==typeof e?{character_id:e,scene_id:t}:{character_uniqid:e,scene_id:t})}),r=await a.json();if(1===r.code)return r.data;return null}catch(e){return console.error("useChatSessions: create error",e),null}},[]),deleteSession:(0,r.useCallback)(async e=>{try{let t=await fetch("/api/chat/sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e})}),r=await t.json();if(1===r.code)return a(t=>t.filter(t=>t.id!==e)),(0,l.Mn)(e),!0;return console.error("useChatSessions: delete failed",r.error),!1}catch(e){return console.error("useChatSessions: delete error",e),!1}},[a])}}},584298:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return T}});var r=a(785893),s=a(667294),l=a(809008),n=a.n(l),c=a(741664),i=a.n(c),o=a(811163),d=a(942232),u=a(426325),h=a(474548),m=a(59178),p=a(659728),x=a(607894),f=a(385374),b=a(887740),w=a(886597),g=a(77854),y=a(567421),j=a(248583),v=a(612515),k=a(555346),_=a(286250),N=a(693967),S=a.n(N),C=a(980232),A=a(914604),E=a(972547),q=a(232341),O=a(28629),z=a(515731);function T(){var e,t,a,l;let{t:c,i18n:N}=(0,y.$G)("chat"),T=(0,o.useRouter)(),F=(0,j.Dv)(C.L4),[P,D]=(0,j.KO)(C.I3),[M,R]=(0,j.KO)(C.bE),{createSession:G}=(0,A.m)(),{scene_id:U}=T.query;(0,s.useEffect)(()=>{let e=document.body.style.overflow,t=document.documentElement.style.scrollbarGutter;return document.body.style.overflow="hidden",document.documentElement.style.scrollbarGutter="auto",()=>{document.body.style.overflow=e,document.documentElement.style.scrollbarGutter=t}},[]);let W=(0,E.j)();(0,s.useEffect)(()=>{W()},[W]),(0,s.useEffect)(()=>
1{if(!F){R("idle");return}"idle"===M&&(R("syncing"),(0,O.In)().then(e=>{e.error?R("error"):(D(t=>({...t,...e})),R("synced"))}).catch(()=>{R("error")}))},[F,M,D,R]);let[H,K]=(0,s.useState)(null),[B,Z]=(0,s.useState)(!0),[J,Q]=(0,s.useState)(!1),[X,Y]=(0,s.useState)(!1),[$,V]=(0,s.useState)(!1),[ee,et]=(0,s.useState)([]),[ea,er]=(0,s.useState)([]),[es,el]=(0,s.useState)(!1),[en,ec]=(0,s.useState)(null),[ei,eo]=(0,s.useState)(!1),[ed,eu]=(0,s.useState)("all"),[eh,em]=(0,s.useState)("popular"),[ep,ex]=(0,s.useState)(""),[ef,eb]=(0,s.useState)([]),[ew,eg]=(0,s.useState)(!1),[ey,ej]=(0,s.useState)(0),[ev,ek]=(0,s.useState)(0),e_=(0,s.useRef)(null),[eN,eS]=(0,s.useState)([]),[eC,eA]=(0,s.useState)(null),[eE,eq]=(0,s.useState)([]),[eO,ez]=(0,s.useState)(!1),[eT,eL]=(0,s.useState)([]),[eI,eF]=(0,s.useState)(!1),eP=!!(null==H?void 0:H.user_id)&&!!(null==P?void 0:P.authUserId)&&H.user_id===P.authUserId,eD=(()=>{let e=[],t=new Set,a=a=>{let r=a.character_uniqid||String(a.id);t.has(r)||(t.add(r),e.push(a))};return ee.forEach(e=>{a(e)}),ea.forEach(e=>{a(e)}),e})(),eM=(0,s.useCallback)(async e=>{Z(!0);try{let t=await fetch("/api/chat/scene-detail?id=".concat(e)),a=await t.json();(null==a?void 0:a.code)===1&&a.data&&K(a.data)}catch(e){}finally{Z(!1)}},[]),eR=(0,s.useCallback)(async()=>{el(!0);try{let e=await fetch("/api/characters?sort=popular&official=true&limit=20"),t=await e.json();er((e=>{var t;if(!e)return[];if(Array.isArray(e))return e;let a=null!==(t=e.data)&&void 0!==t?t:e;return a&&"object"==typeof a&&Array.isArray(a.characters)?a.characters:Array.isArray(a)?a:[]})(t).map(e=>({id:e.id,character_uniqid:e.character_uniqid,character_name:e.character_name,character_pfp:e.character_pfp,i18n:e.i18n})))}catch(e){}finally{el(!1)}},[]),eG=(0,s.useCallback)(async()=>{try{var e,t;let a=await fetch("/api/chat/sessions?limit=20"),r=await a.json(),s=null!==(e=null==r?void 0:r.data)&&void 0!==e?e:r;if(!Array.isArray(s))return;let l=new Set,n=[];for(let e of s){let a=e.character_id;!a||l.has(a)||e.character_deleted||(l.add(a),n.push({id:a,character_uniqid:String(a),character_name:e.character_name||"",character_pfp:e.character_pfp||"",i18n:null!==(t=e.character_i18n)&&void 0!==t?t:null}))}et(n)}catch(e){}},[]),eU=(0,s.useCallback)(async function(e,t,a){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"popular",s=arguments.length>4?arguments[4]:void 0;eg(!0);try{var l,n,c;let i=new URLSearchParams({sort:"new"===r?"recent":"collected",sfw:"true",limit:"20",offset:t.toString()});e.trim()&&i.set("search",e.trim()),"oc"===s?i.set("official","false"):s&&i.set("ip_collection",s);let o=await fetch("/api/characters?".concat(i)),d=await o.json(),u=[],h=0,m=null!==(l=null==d?void 0:d.data)&&void 0!==l?l:d;Array.isArray(m)?(u=m,h=m.length):(null==m?void 0:m.characters)?(u=m.characters,h=null!==(n=m.total)&&void 0!==n?n:m.characters.length):Array.isArray(null==m?void 0:m.data)&&(u=m.data,h=null!==(c=m.total)&&void 0!==c?c:m.data.length),a?eb(e=>[...e,...u]):eb(u),ej(h),ek(t+u.length)}catch(e){}finally{eg(!1)}},[]),eW=(0,s.useCallback)(async()=>{try{var e;let t=await fetch("/api/characters?collections=true"),a=await t.json(),r=null!==(e=null==a?void 0:a.data)&&void 0!==e?e:a;if(Array.isArray(r)){let e=r.filter(e=>e.count&&e.count>0&&"other"!==e.key&&"others"!==e.key).map(e=>({id:e.key,name:e.name||e.key,count:e.count}));eS(e)}}catch(e){}},[]),eH=(0,s.useCallback)(async()=>{ez(!0);try{var e;let t=await fetch("/api/getOwnedCharacters"),a=await t.json(),r=null!==(e=null==a?void 0:a.data)&&void 0!==e?e:a;Array.isArray(r)&&eq(r.filter(e=>e.is_owned).map(e=>({id:e.id,character_uniqid:e.character_uniqid,character_name:e.character_name,character_pfp:e.character_pfp,i18n:e.i18n})))}catch(e){}finally{ez(!1)}},[]),eK=(0,s.useCallback)(async()=>{eF(!0);try{var e;let t=await fetch("/api/getCollectedCharacters"),a=await t.json(),r=null!==(e=null==a?void 0:a.data)&&void 0!==e?e:a;Array.isArray(r)&&eL(r.map(e=>({id:e.id,character_uniqid:e.character_uniqid,character_name:e.character_name,character_pfp:e.character_pfp,i18n:e.i18n})))}catch(e){}finally{eF(!1)}},[]);(0,s.useEffect)(()=>
1{if(ei&&"all"===ed)return e_.current&&clearTimeout(e_.current),e_.current=setTimeout(()=>{eU(ep,0,!1,eh,eC)},300),()=>{e_.current&&clearTimeout(e_.current)}},[ep,ei,ed,eh,eC,eU]),(0,s.useEffect)(()=>{ei&&F&&("mine"!==ed||0!==eE.length||eO||eH(),"collected"!==ed||0!==eT.length||eI||eK())},[ei,ed,F,eE.length,eO,eT.length,eI,eH,eK]),(0,s.useEffect)(()=>{ei&&0===eN.length&&eW()},[ei,eN.length,eW]),(0,s.useEffect)(()=>{U&&"string"==typeof U&&eM(U)},[U,eM]),(0,s.useEffect)(()=>{eR()},[eR]),(0,s.useEffect)(()=>{F&&eG()},[F,eG]);let eB=async()=>{if(!F){T.push("/login");return}if(H&&!J){Q(!0);try{let e=await fetch("/api/chat/scene-collect",{method:H.is_collected?"DELETE":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scene_id:H.id})}),t=await e.json();(null==t?void 0:t.code)===1&&K(e=>e?{...e,is_collected:!e.is_collected,num_collected:(e.num_collected||0)+(e.is_collected?-1:1)}:e)}catch(e){}finally{Q(!1)}}},eZ=async()=>{if(H&&en){if(!F){T.push("/login");return}Y(!0);try{let e=en.character_uniqid||en.id,t=await G(e,H.id);t&&T.push("/chat/".concat(t.id))}catch(e){}finally{Y(!1)}}},eJ=e=>{ec(e),eo(!1)},eQ=e=>{if(e.i18n){let t=(0,q.E)({i18n:e.i18n,character_name:e.character_name},"character_name",N.language);if(t)return t}return e.character_name};return B?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n(),{children:(0,r.jsx)("title",{children:"Scene | KomikoAI"})}),(0,r.jsx)("div",{className:"fixed inset-0 bg-black flex items-center justify-center z-50",children:(0,r.jsx)(u.c,{size:"lg",color:"white"})})]}):H?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n(),{children:[(0,r.jsx)("title",{children:"".concat(H.name," | KomikoAI")}),(0,r.jsx)("meta",{name:"description",content:H.description||H.name}),(0,r.jsx)("meta",{property:"og:title",content:H.name}),(0,r.jsx)("meta",{property:"og:description",content:H.description||H.name}),H.cover_image&&(0,r.jsx)("meta",{property:"og:image",content:H.cover_image})]}),(0,r.jsxs)("div",{className:S()("fixed inset-0 flex flex-col overflow-hidden bg-black transition-opacity duration-150",$?"z-0 opacity-0 pointer-events-none":"z-50"),children:[H.cover_image?(0,r.jsx)("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:"url(".concat(H.cover_image,")")}}):(0,r.jsx)("div",{className:"absolute inset-0 z-0 bg-gradient-to-br from-violet-900 via-indigo-900 to-slate-900"}),(0,r.jsx)("div",{className:"absolute inset-0 z-0 bg-black/50"}),(0,r.jsx)("div",{className:"absolute inset-0 z-0 bg-gradient-to-t from-black/80 via-black/20 to-black/40"}),(0,r.jsxs)("div",{className:"relative z-10 flex flex-col h-full overflow-y-auto",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 sm:p-5 flex-shrink-0",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{V(!0),document.body.style.overflow="",document.documentElement.style.scrollbarGutter="",T.push("/characters?tab=scenes")},className:"flex items-center justify-center w-10 h-10 rounded-full bg-black/30 backdrop-blur-sm text-white/80 hover:text-white hover:bg-black/50 transition-colors","aria-label":c("back","Back"),children:(0,r.jsx)(v.Ao2,{className:"h-5 w-5"})}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:eP&&(0,r.jsx)("button",{type:"button",onClick:()=>T.push("/scenes/edit?id=".concat((null==H?void 0:H.id)||U)),className:"flex items-center justify-center w-10 h-10 rounded-full bg-black/30 backdrop-blur-sm text-white/80 hover:text-white hover:bg-black/50 transition-colors","aria-label":c("scene.editTitle","Edit Scene"),children:(0,r.jsx)(v.IYd,{className:"h-5 w-5"})})})]}),(0,r.jsxs)("div",{className:"flex-1 px-4 sm:px-8 max-w-3xl mx-auto w-full pb-4",children:[(0,r.jsx)("h1",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold text-white text-center mb-2",children:H.name}),H.author_name&&(0,r.jsxs)("p",{className:"text-sm text-white/50 text-center mb-2",children:["by ",H.author_uniqid?(0,r.jsxs)(i(),{href:"/user/".concat(H.author_uniqid),className:"text-white/70 hover:text-white hover:underline transition-colors",children:["@",H.author_name]}):(0,r.jsxs)("span",{children:["@",H.author_name]})]}),H.tags&&H.tags.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap justify-center gap-1.5 mb-3",children:H.tags.map(e=>(0,r.jsx)(i(),{href:"/tags/".concat(encodeURIComponent(e)),children:(0,r.jsxs)("span",{className:"rounded-full bg-white/10 px-2.5 py-0.5 text-[11px] text-white/60 backdrop-blur-sm cursor-pointer hover:bg-white/20 hover:text-white/80 transition-colors",children:["#",e]})},e))}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-3 mb-5",children:[(null!==(e=H.num_messages)&&void 0!==e?e:0)>0&&(0,r.jsx)(m.e,{content:c("scene.usesTooltip","Times played"),placement:"bottom",closeDelay:0,children:(0,r.jsxs)("div",{className:"flex items-center gap-1 rounded-full bg-white/10 px-3 py-1 text-xs text-white/60 backdrop-blur-sm",children:[(0,r.jsx)(_.P4D,{className:"h-3 w-3"}),(0,r.jsx)("span",{children:(l=null!==(t=H.num_messages)&&void 0!==t?t:0)>=1e6?"".concat((l/1e6).toFixed(1),"m"):l>=1e3?"".concat((l/1e3).toFixed(1),"k"):String(l)}
1)]})}),(0,r.jsx)(m.e,{content:H.is_collected?c("scene.unfavorite","Unfavorite"):c("scene.favorite","Favorite"),placement:"bottom",closeDelay:0,children:(0,r.jsxs)("button",{type:"button",onClick:eB,disabled:J,className:S()("flex items-center gap-1 rounded-full px-3 py-1 text-xs backdrop-blur-sm transition-colors cursor-pointer",H.is_collected?"bg-pink-500/30 text-pink-300 hover:bg-pink-500/40":"bg-white/10 text-white/60 hover:bg-white/20 hover:text-white/80"),children:[(0,r.jsx)(k.$0H,{className:S()("h-3 w-3",H.is_collected&&"text-pink-400")}),(0,r.jsx)("span",{children:null!==(a=H.num_collected)&&void 0!==a?a:0})]})})]}),H.description&&(0,r.jsx)("p",{className:"text-sm sm:text-base text-white/75 leading-relaxed text-center mb-6 whitespace-pre-wrap",children:H.description}),(H.goal||H.rules_physics)&&(0,r.jsxs)("div",{className:"space-y-3 mb-6",children:[H.goal&&(0,r.jsx)(I,{icon:(0,r.jsx)(v.xUG,{className:"h-3.5 w-3.5"}),title:c("scene.goal","Goal / Mission"),content:H.goal,moreLabel:c("scene.showMore","More"),lessLabel:c("scene.showLess","Less")}),H.rules_physics&&(0,r.jsx)(I,{icon:(0,r.jsx)(v.bfl,{className:"h-3.5 w-3.5"}),title:c("scene.rulesPhysics","Important Notes"),content:H.rules_physics,moreLabel:c("scene.showMore","More"),lessLabel:c("scene.showLess","Less")})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white/60 text-center mb-4",children:c("scene.selectCharacter","Select a Character")}),es&&0===eD.length?(0,r.jsx)("div",{className:"flex justify-center py-4",children:(0,r.jsx)(u.c,{size:"sm",color:"white"})}):(0,r.jsx)("div",{className:"overflow-x-auto pb-2 scrollbar-hide -mx-4 px-4 sm:-mx-8 sm:px-8",children:(0,r.jsxs)("div",{className:"flex items-start gap-3 sm:gap-4 w-max mx-auto",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>eo(!0),className:"flex flex-col items-center gap-1.5 flex-shrink-0 group",children:[(0,r.jsx)("div",{className:"w-14 h-14 sm:w-16 sm:h-16 rounded-full bg-white/15 backdrop-blur-sm flex items-center justify-center border-2 border-white/20 group-hover:border-white/40 transition-colors",children:(0,r.jsx)(v.jRj,{className:"h-5 w-5 text-white/70"})}),(0,r.jsx)("span",{className:"text-[11px] text-white/50 w-16 text-center truncate",children:c("scene.searchAll","Search All")})]}),eD.slice(0,5).map(e=>{let t=(null==en?void 0:en.character_uniqid)===e.character_uniqid||(null==en?void 0:en.id)===e.id;return(0,r.jsxs)("button",{type:"button",onClick:()=>ec(e),className:"flex flex-col items-center gap-1.5 flex-shrink-0 group",children:[(0,r.jsx)("div",{className:S()("rounded-full border-2 transition-all",t?"border-primary-500 scale-110 shadow-lg shadow-primary-500/30":"border-transparent hover:border-white/40"),children:(0,r.jsx)(p.h,{src:e.character_pfp,name:e.character_name,size:"lg",className:"w-14 h-14 sm:w-16 sm:h-16"})}),(0,r.jsx)("span",{className:S()("text-[11px] w-16 text-center truncate",t?"text-white font-medium":"text-white/50"),children:eQ(e)})]},e.character_uniqid||e.id)})]})})]})]}),(0,r.jsxs)("div",{className:"flex-shrink-0 px-4 pb-6 sm:pb-8 flex flex-col items-center gap-2",children:[(0,r.jsx)(h.A,{color:"primary",size:"lg",className:"font-semibold rounded-full px-12 text-base",isDisabled:!en,isLoading:X,onPress:eZ,children:c("scene.startScene","Start Scene")}),!en&&(0,r.jsx)("p",{className:"text-xs text-white/40",children:c("scene.selectCharacterHint","Pick a character to begin the adventure")}),(0,r.jsx)(d.Z,{variant:"ocs-world",placement:"scene_detail_start",className:"mt-3 w-full max-w-md"})]})]})]}),ei&&(0,r.jsx)(x.R,{isOpen:!0,onOpenChange:e=>{e||eo(!1)},size:"2xl",scrollBehavior:"inside",classNames:{base:"max-h-[85vh]"},children:(0,r.jsxs)(f.A,{children:[(0,r.jsx)(b.k,{className:"flex flex-col gap-1 pb-2",children:c("browseCharacters","Browse Characters")}),(0,r.jsxs)(w.I,{className:"pb-6",children:[(0,r.jsx)("div",{className:"flex gap-1 rounded-xl bg-default-100 dar
1k:bg-default-50/10 p-1",children:[{key:"all",label:c("scene.browseAll","All")},{key:"mine",label:c("myOCs","My OCs")},{key:"collected",label:c("adoptedCharacters","Adopted")}].map(e=>(0,r.jsx)("button",{type:"button",className:S()("flex-1 rounded-lg px-3 py-1.5 text-sm font-medium transition-all",ed===e.key?"bg-white text-foreground shadow-sm dark:bg-default-200":"text-default-500 hover:text-foreground"),onClick:()=>{eu(e.key)},children:e.label},e.key))}),"all"===ed&&(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:[{key:"popular",label:c("scene.sortPopular","Popular")},{key:"new",label:c("scene.sortNew","New")}].map(e=>(0,r.jsx)("button",{type:"button",className:S()("rounded-full px-3 py-1 text-xs font-medium transition-colors",eh===e.key?"bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-300":"bg-default-100 text-default-500 hover:bg-default-200 dark:bg-default-100/10 dark:hover:bg-default-100/20"),onClick:()=>{em(e.key)},children:e.label},e.key))}),(0,r.jsxs)("div",{className:"-mx-1 flex items-center gap-1.5 overflow-x-auto px-1 pb-1",children:[(0,r.jsx)("button",{type:"button",className:S()("whitespace-nowrap rounded-full px-3 py-1 text-xs font-medium transition-colors",eC?"bg-default-100 text-default-500 hover:bg-default-200 dark:bg-default-100/10 dark:hover:bg-default-100/20":"bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-300"),onClick:()=>{eA(null)},children:c("filter_all","All")}),(0,r.jsx)("button",{type:"button",className:S()("whitespace-nowrap rounded-full px-3 py-1 text-xs font-medium transition-colors","oc"===eC?"bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-300":"bg-default-100 text-default-500 hover:bg-default-200 dark:bg-default-100/10 dark:hover:bg-default-100/20"),onClick:()=>{eA("oc")},children:c("filter_ocs","OCs")}),eN.map(e=>{let t=c((0,z.O4)(e.id),"")||(0,z.wQ)(e.name);return(0,r.jsx)("button",{type:"button",className:S()("whitespace-nowrap rounded-full px-3 py-1 text-xs font-medium transition-colors",eC===e.id?"bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-300":"bg-default-100 text-default-500 hover:bg-default-200 dark:bg-default-100/10 dark:hover:bg-default-100/20"),onClick:()=>{eA(e.id)},children:t},e.id)})]}),(0,r.jsx)(g.Y,{placeholder:c("searchCharacters","Search characters..."),value:ep,onValueChange:ex,startContent:(0,r.jsx)(v.jRj,{className:"h-4 w-4 text-default-400"}),size:"sm",variant:"bordered",classNames:{inputWrapper:"border-default-200 dark:border-white/30"}}),(0,r.jsx)(L,{chars:ef,loading:ew,selectedChar:en,onSelect:eJ,charDisplayName:eQ,emptyText:c("noCharactersFound","No characters found.")}),ef.length>0&&ef.length<ey&&(0,r.jsx)("div",{className:"mt-3 flex justify-center",children:(0,r.jsx)(h.A,{size:"sm",variant:"flat",isLoading:ew,onPress:()=>eU(ep,ev,!0,eh,eC),children:c("loadMore","Load More")})})]}),"mine"===ed&&(0,r.jsx)(L,{chars:eE,loading:eO,selectedChar:en,onSelect:eJ,charDisplayName:eQ,emptyText:c("noOwnCharacters","You have not created any characters yet.")}),"collected"===ed&&(0,r.jsx)(L,{chars:eT,loading:eI,selectedChar:en,onSelect:eJ,charDisplayName:eQ,emptyText:c("noAdoptedCharacters","No adopted characters yet.")})]})]})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n(),{children:(0,r.jsx)("title",{children:"Scene Not Found | KomikoAI"})}),(0,r.jsx)("div",{className:"fixed inset-0 bg-black flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-lg text-white/60 mb-4",children:c("scene.notFound","Scene not found")}),(0,r.jsx)(h.A,{variant:"flat",className:"text-white",onPress:()=>T.push("/characters"),children:c("back","Back")})]})})]})}function L(e){let{chars:t,loading:a,selectedChar:s,onSelect:l,charDisplayName:n,emptyText:c}=e;return a&&0===t.length?(0,r.jsx)("div",{className:"flex justify-center py-8",children:(0,r.jsx)(u.c,{size:"sm"})}):a||0!==t.length?(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[t.map(e=>{let t=(null==s?void 0:s.character_uniqid)===e.character_uniqid||(null==s?void 0:s.id)===e.id;return(0,r.jsxs)("button",{type:"button",className:S()("flex items-center gap-3 rounded-xl border-2 p-3 text-left transition-all",t?"border-purple-500 bg-purple-50/50 dark:bg-purple-900/10":"border-default-200 hover:border-default-300 dark:border-white/30 dark:hover:border-white/60"),onClick:()=>l(e),children:[(0,r.jsx)(p.h,{src:e.character_pfp,name:e.character_name,className:"h-12 w-12 flex-shrink-0"}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)("h4",{className:"truncate text-sm font-semibold text-foreground",children:n(e)})})]},e.character_uniqid||e.id)}),a&&t.length>0&&(0,r.jsx)("div",{className:"mt-3 flex justify-center",children:(0,r.jsx)(u.c,{size:"sm"})})]}):(0,r.jsx)("p",{className:"py-6 text-center text-sm text-default-400",children:c})}
1function I(e){let{icon:t,title:a,content:l,muted:n,moreLabel:c,lessLabel:i}=e,[o,d]=(0,s.useState)(!1),u=(0,s.useRef)(null),[h,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=u.current;e&&m(e.scrollHeight>e.clientHeight+2)},[l]),(0,r.jsxs)("div",{className:S()("rounded-xl border p-3.5",n?"border-white/5 bg-white/5":"border-white/10 bg-white/10 backdrop-blur-sm"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,r.jsx)("span",{className:"text-white/40",children:t}),(0,r.jsx)("h3",{className:"text-xs font-semibold text-white/70",children:a})]}),(0,r.jsx)("p",{ref:u,className:S()("text-sm leading-relaxed whitespace-pre-wrap",n?"text-white/30":"text-white/60",!o&&"line-clamp-3"),children:l}),(h||o)&&(0,r.jsx)("button",{type:"button",onClick:()=>d(e=>!e),className:"flex items-center gap-1 mt-2 text-xs text-primary-400 hover:text-primary-300 transition-colors",children:o?(0,r.jsxs)(r.Fragment,{children:[i,(0,r.jsx)(v.rH8,{className:"h-3 w-3"})]}):(0,r.jsxs)(r.Fragment,{children:[c,(0,r.jsx)(v.bTu,{className:"h-3 w-3"})]})})]})}},515731:function(e,t,a){"use strict";a.d(t,{DQ:function(){return l},O4:function(){return i},SN:function(){return n},ZC:function(){return c},wQ:function(){return s}});let r=e=>e.replace(/\s+/g,"_"),s=e=>e!==e.toLowerCase()&&e.match(/[A-Z]/)?e:e.split("_").map((e,t)=>t>0&&("of"===e||"the"===e||"and"===e||"a"===e||"an"===e)?e:(e.includes("'"),e.charAt(0).toUpperCase()+e.slice(1))).join(" ").replace(/\s*\(\s*/g," (").replace(/\s*\)\s*/g,")").replace(/\s*:\s*/g,": "),l=e=>{var t;if(e.uniqid||e.character_uniqid){let t=e.uniqid||e.character_uniqid;return t.startsWith("@")?t:"@"+t}return(null===(t=e.name)||void 0===t?void 0:t.startsWith("@"))?e.name:"@"+r(e.name||"")},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.image||e.character_pfp||t},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(e||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"")},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.replace(/^worlds\./,"");return"create:worlds.".concat(c(t))}},232341:function(e,t,a){"use strict";function r(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";if(!e)return"";if(e.i18n&&e.i18n[t]){let r=e.i18n[t];if(r&&"object"==typeof r){let e=r[a]||r.en;if(e)return e}}let r=e[t];return"string"==typeof r?r:""}a.d(t,{E:function(){return r}})}},function(e){e.O(0,[92888,49774,40179],function(){return e(e.s=808501)}),_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.