1import{d as N,c as I,o as l,a as o,j as u,z as Y,t as b,l as v,n as _,s as G,r as E,q as U,F as H,Q as V,R as B,k as L,e as t,K as F,b5 as O,B as J,w as q,aQ as X,f as Z,az as ee,D as j,b as te,m as ae,ap as le,aq as ie}from"./-6Lls737.js";import se from"./B5spvOTL.js";import{u as P,A as re}from"./Bql101jB.js";import{u as oe}from"./CXnfTPfL.js";import{u as ne}from"./BFK2YFI3.js";import{_ as ue}from"./CJsD18ex.js";import{_ as de}from"./i-JovrxE.js";import"./DSV61gAW.js";import"./DlAUqK2U.js";import"./Bs_0MqsZ.js";import"./DTkNhqIJ.js";import"./BjifuwS5.js";import"./CI-50u4g.js";import"./C2j6UuSi.js";import"./BvfhP9bq.js";import"./CN6vTOWD.js";import"./CshW9Obe.js";import"./zufut4os.js";import"./Cp2PsELQ.js";import"./D8S3iv8N.js";import"./BUKqlUen.js";import"./S6owxtwa.js";import"./B0_0hzzP.js";import"./ETgmdoWB.js";import"./B6I36lQj.js";import"./CI1rb40-.js";const ce=["type","name","id","value","checked","disabled"],me=["for"],be={key:0,class:"label"},W=N({__name:"InputBox",props:{type:{type:String,default:"radio",validator:s=>["radio","checkbox"].includes(s)},name:String,id:String,value:[Boolean,String,Number,Object],label:String,labelClass:String,divClass:String,modelValue:[Boolean,String,Number,Array,Object],checkboxLimit:Number,hideLabel:Boolean,isDisabled:{type:Boolean,default:!1},styling:{type:String,default:"ai-input-default",validator:s=>["ai-input-default","ai-input-white-box"].includes(s)}},emits:["update:modelValue"],setup(s,{emit:c}){const a=s,m=c,h=I(()=>{var d,r;return a.type==="radio"?(((d=a.modelValue)==null?void 0:d.value)||a.modelValue)===(((r=a.value)==null?void 0:r.value)||a.value):Array.isArray(a.modelValue)&&a.modelValue.includes(a.value)}),p=d=>{if(a.type==="radio")m("update:modelValue",a.value);else{let r=Array.isArray(a.modelValue)?[...a.modelValue]:[];if(r.includes(a.value))r=r.filter(C=>C!==a.value);else if(!a.checkboxLimit||r.length<a.checkboxLimit)r.push(a.value);else{d.target.checked=!1;return}m("update:modelValue",r)}};return(d,r)=>(l(),o("div",{class:_(s.divClass)},[u("input",{type:s.type,class:"peer hidden",name:s.type==="radio"?s.name:void 0,id:s.id,value:s.value,checked:h.value,disabled:s.isDisabled,onChange:p},null,40,ce),u("label",{for:s.id,class:_([s.styling,s.labelClass])},[Y(d.$slots,"default"),s.label?(l(),o("span",be,b(s.label),1)):v("",!0)],10,me)],2))}});var $=(s=>(s.SMALL="small",s.LARGE="large",s))($||{});const pe={class:"flex flex-col items-center gap-4"},fe={class:"text-lg"},ve={key:0,class:"text-sm text-gray-500"},ge={class:"col-span-full mt-4 flex flex-row justify-center"},ye={class:"ai-button ai-button-secondary w-50"},he=["disabled"],xe=["alt","src"],Se={key:1,class:"flex flex-col gap-1 px-2"},Ae={class:"text-sm font-semibold"},ke={class:"text-sm"},we=N({__name:"AiAttributeSelection",props:{attribute:{}},setup(s){const{attribute:c}=s,a=P(),{selectedAttributes:m,createIsLoading:h}=G(a),p=I(()=>c.options.some(e=>!!e.image)),d=E(!1),r=E("");U(()=>{var e,n;typeof((n=(e=m.value)==null?void 0:e[c.id])==null?void 0:n.value)=="string"&&(r.value=m.value[c.id].value,d.value=!0)});function C(){m.value[c.id]="",d.value=!0}function A(e){if(c.maxSelections>1)return e.id;const n={value:e.id};return c.showOnResultsPage&&(n.resultsDisplayAttribute={label:c.label,value:e.label}),n}H(r,e=>{m.value[c.id]={value:e},k()});function x(){d.value=!1,k()}const k=oe(()=>{a.storeSelectedValuesToLocalStorage()},500),M=I(()=>!p.value&&c.displaySize===$.SMALL);function R(){return M.value?"aspect-square":""}function S(){return M.value?"flex-1 min-w-0":""}return(e,n)=>{const D=W;return l(),o("div",pe,[u("span",fe,b(e.attribute.label),1),e.attribute.maxSelections>1?(l(),o("span",ve,"select up to "+b(e.attribute.maxSelections),1)):v("",!0),u("div",{class:_(["w-screen px-1 md:w-full",{"grid gap-2 grid-cols-2":p.value&&e.attribute.displaySize===t($).LARGE,"grid gap-2 grid-cols-4":p.value&&e.attribute.displaySize===t($).SMALL,"flex flex-row gap-2 flex-wrap":!p.value&&e.attribute.displaySize===t($).LARGE,"inline-flex flex-row gap-2 flex-no-wrap":!p.value&&e.attribute.displaySize===t($).SMALL}])},[e.attribute.maxSelections>1?(l(!0),o(V,{key:0},B(e.attribute.options,i=>(l(),L(D,{checkboxLimit:e.attribute.maxSelections,value:A(i),key:`attribute-${e.attribute.id}-option-${i.id}`,styling:p.value?"ai-input-white-box":"ai-input-default",id:`attribute-${e.attribute.id}-option-${i.id}`,name:`attribute-${e.attribute.id}-option-${i.id}`,label:i.label,modelValue:t(m)[e.attribute.id],"onUpdate:modelValue":[n[0]||(n[0]=y=>t(m)[e.attribute.id]=y),n[1]||(n[1]=y=>x())],type:"checkbox",isDisabled:t(h),"label-class":R(),"div-class":S()},null,8,["checkboxLimit","value","styling","id","name","label","modelValue","isDisabled","label-class","div-class"]))),128)):(l(!0),o(V,{key:1},B(e.attribute.options,i=>(l(),o(V,{key:`attribute-${e.attribute.id}-option-${i.id}`},[i.isFreeText?(l(),o(V,{key:0},[d.value?F((l(),o("textarea",{key:0,rows:"4",class:"ai-textarea col-span-full","onUpdate:modelValue":n[2]||(n[2]=y=>r.value=y)},` 2 `,512)),[[O,r.value]]):v("",!0),u("div",ge,[u("div",ye,[u("button",{onClick:J(C,["prevent"]),disabled:t(h)},b(i.label),9,he)])])],64)):(l(),L(D,{key:1,value:A(i),styling:p.value?"ai-input-white-box":"ai-input-default",id:`attribute-${e.attribute.id}-option-${i.id}`,name:`attribute-${e.attribute.id}-option-${i.id}`,label:i.description?"":i.label,modelValue:t(m)[e.attribute.id],"onUpdate:modelValue":[n[3]||(n[3]=y=>t(m)[e.attribute.id]=y),n[4]||(n[4]=y=>x())],"label-class":R(),"div-class":S(),isDisabled:t(h)},{default:q(()=>[i.image?(l(),o("img",{key:0,class:_(["object-cover",{"aspect-square":!i.description,"aspect-[2/1]":i.description}]),alt:i.label,src:i.image},null,10,xe)):v("",!0),i.description?(l(),o("span",Se,[u("span",Ae,b(i.label),1),u("span",ke,b(i.description),1)])):v("",!0)]),_:2},1032,["value","styling","id","name","label","modelValue","label-class","div-class","isDisabled"]))],64))),128))],2)])}}}),$e={class:"bg-x-grey-3 create-ai-girl"},Ve={key:1,class:"container py-8 max-w-[500px]"},Le={key:0},_e={class:"text-xl mb-8"},Ce={class:"w-full grid grid-cols-2 gap-2"},Ie=["src","alt"],Me={for:"ai-girl-name",class:"w-full px-2"},Re=["placeholder"],De={class:"text-sm text-gray-400 ml-1 mt-1"},Te={class:"flex items-center gap-4 mt-8 max-md:w-screen max-md:left-0 max-md:mt-52 max-md:pb-2 max-md:px-2 max-md:pt-2 max-md:fixed max-md:bottom-0 max-md:z-10 bg-white"},Be=["disabled"],Ge=["disabled"],Ee={key:0,class:"mr-2 md:mr-4"},Ne={key:2,class:"ml-1 mt-4 mb-20"},ct=N({__name:"createCharacter",setup(s){const c=X(),{t:a}=Z(),m=ee(),h=ne(),{showLoginModal:p}
2=G(h),d=E(!0),r=P(),{aiRenderingModels:C,selectedAiRenderingModel:A,currentStep:x,currentStepAttributes:k,maximumSteps:M,selectedAttributes:R,selectedName:S,createIsLoading:e,fetchAttributesIsLoading:n}=G(r);U(async()=>{await r.fetchAiRenderingModels(),await r.setSelectedValuesFromLocalStorage(),d.value=!1});async function D(){!m.isLoggedIn&&!await h.openAuthModal()||(await r.saveAiCharacter(),le.removeItem(ie.CREATE_AI_GIRLFRIEND_DATA),await c.push(re.RESULTS))}const i=I(()=>{var T;return x.value===0?!!A.value&&y.value:(T=k.value)!=null&&T.length?k.value.every(g=>{const w=R.value[g.id.toString()];return w!==void 0&&w!==""&&(!Array.isArray(w)||w.length>0)}):!1}),y=I(()=>S.value.length<3?!1:S.value.includes(" "));return(T,g)=>{const w=W,K=se;return l(),o("div",$e,[d.value?(l(),L(de,{key:0,class:"min-h-[300px] bg-x-grey-3"})):(l(),o("div",Ve,[t(x)===0?(l(),o("div",Le,[u("h1",_e,b(t(a)("home.createAI.createMyDreamAI")),1),u("div",Ce,[(l(!0),o(V,null,B(t(C),(f,z)=>(l(),L(w,{styling:"ai-input-white-box",name:"type",value:f,key:`rendering-model-${z}`,id:`type-${z}`,label:f.label,modelValue:t(A),"onUpdate:modelValue":g[0]||(g[0]=Q=>j(A)?A.value=Q:null)},{default:q(()=>[u("img",{class:"aspect-[3/4] object-cover",src:f.image,alt:f.label},null,8,Ie)]),_:2},1032,["value","id","label","modelValue"]))),128))]),u("div",{class:_(["w-full flex flex-col justify-center items-start mt-5",{"max-md:mb-10":!t(e)}])},[u("label",Me,b(t(a)("home.createAI.nameYourGirl")),1),F(u("input",{type:"text",id:"ai-girl-name",class:"w-full shadow mt-1 h-12 rounded px-2 placeholder:text-sm",placeholder:t(a)("home.createAI.namePlaceholder"),"onUpdate:modelValue":g[1]||(g[1]=f=>j(S)?S.value=f:null)},null,8,Re),[[O,t(S),void 0,{trim:!0}]]),u("span",De,b(t(a)("home.createAI.nameShouldBeAtLeastTwoWords")),1)],2)])):v("",!0),t(x)>0?(l(),o("div",{key:1,class:_(["flex flex-col gap-4",{"max-md:mb-20":!t(e)}])},[(l(!0),o(V,null,B(t(k),f=>(l(),L(we,{key:`attribute-${f.id}`,attribute:f},null,8,["attribute"]))),128))],2)):v("",!0),u("div",Te,[t(x)!==0?(l(),o("button",{key:0,class:"w-full ai-button ai-button-secondary",onClick:g[2]||(g[2]=f=>t(r).previousStep())},b(t(a)("home.createAI.previousStep")),1)):v("",!0),t(x)<t(M)?(l(),o("button",{key:1,class:"w-full ai-button ai-button-primary disabled:opacity-50 disabled:bg-gray-400 disabled:border-gray-400",disabled:!i.value||t(n),onClick:g[3]||(g[3]=f=>t(r).nextStep())},b(t(a)("home.createAI.nextStep")),9,Be)):(l(),o("button",{key:2,class:"whitespace-nowrap w-full ai-button ai-button-primary disabled:opacity-50 disabled:bg-gray-400 disabled:border-gray-400",disabled:!i.value||t(e)||t(n),onClick:D},[t(e)?(l(),o("span",Ee,[te(K,{class:"animate-spin w-6 h-6",filled:"",fontControlled:!1})])):v("",!0),ae(" "+b(t(a)("home.createAI.createMyAI")),1)],8,Ge))]),t(e)?(l(),o("p",Ne,b(t(a)("home.createAI.thisMayTakeAWhile")),1)):v("",!0)])),t(p)?(l(),L(ue,{key:2})):v("",!0)])}}});export{ct 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.