import{r as n,_ as W,u as ae,C as ie,a as Y,c as Z,b as q,d as ne,e as re,o as oe,f as X,g as F,h as U,i as le,m as se,t as ce,j as de,k as D,l as ue,n as me,p as he,q as i,s as h,F as ee,A as ge,v as ve,w as fe,x as pe,y as be,z as G,B as V,D as Se,E as Ce,H as we,S as ye,G as $e,L as xe,I as Ne}from"./index-e81753a9.js";import{P as _e}from"./PrivateIndicator-a8617a69.js";import{u as Me,R as L,T as Ie,C as Pe}from"./useTags-5af1cf65.js";import"./chat-service-9c87cc28.js";import{C as Ae}from"./ChatList-8b52d374.js";import{C as Oe}from"./CheckInPopupModal-00e430f0.js";import{T as Re}from"./index-38cad050.js";import{E as Ee,H as Te}from"./HeartFilled-cb588c9e.js";import{E as He}from"./EyeFilled-f3142fcd.js";import"./index-45b5d804.js";import"./ChatMessageQuotaEndModal-035853e3.js";import"./index-1d4d4f6c.js";var k=function(t,o){if(!t)return null;var a={left:t.offsetLeft,right:t.parentElement.clientWidth-t.clientWidth-t.offsetLeft,width:t.clientWidth,top:t.offsetTop,bottom:t.parentElement.clientHeight-t.clientHeight-t.offsetTop,height:t.clientHeight};return o?{left:0,right:0,width:0,top:a.top,bottom:a.bottom,height:a.height}:{left:a.left,right:a.right,width:a.width,top:0,bottom:0,height:0}},M=function(t){return t!==void 0?"".concat(t,"px"):void 0};function je(e){var t=e.prefixCls,o=e.containerRef,a=e.value,s=e.getValueIndex,l=e.motionName,b=e.onMotionStart,w=e.onMotionEnd,y=e.direction,C=e.vertical,m=C===void 0?!1:C,R=n.useRef(null),I=n.useState(a),v=W(I,2),f=v[0],x=v[1],S=function(H){var g,j=s(H),N=(g=o.current)===null||g===void 0?void 0:g.querySelectorAll(".".concat(t,"-item"))[j];return(N==null?void 0:N.offsetParent)&&N},B=n.useState(null),P=W(B,2),c=P[0],E=P[1],A=n.useState(null),$=W(A,2),d=$[0],p=$[1];ae(function(){if(f!==a){var u=S(f),H=S(a),g=k(u,m),j=k(H,m);x(a),E(g),p(j),u&&H?b():w()}},[a]);var _=n.useMemo(function(){if(m){var u;return M((u=c==null?void 0:c.top)!==null&&u!==void 0?u:0)}return M(y==="rtl"?-(c==null?void 0:c.right):c==null?void 0:c.left)},[m,y,c]),z=n.useMemo(function(){if(m){var u;return M((u=d==null?void 0:d.top)!==null&&u!==void 0?u:0)}return M(y==="rtl"?-(d==null?void 0:d.right):d==null?void 0:d.left)},[m,y,d]),r=function(){return m?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},T=function(){return m?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},O=function(){E(null),p(null),w()};return!c||!d?null:n.createElement(ie,{visible:!0,motionName:l,motionAppear:!0,onAppearStart:r,onAppearActive:T,onVisibleChanged:O},function(u,H){var g=u.className,j=u.style,N=Y(Y({},j),{},{"--thumb-start-left":_,"--thumb-start-width":M(c==null?void 0:c.width),"--thumb-active-left":z,"--thumb-active-width":M(d==null?void 0:d.width),"--thumb-start-top":_,"--thumb-start-height":M(c==null?void 0:c.height),"--thumb-active-top":z,"--thumb-active-height":M(d==null?void 0:d.height)}),te={ref:Z(R,H),style:N,className:q("".concat(t,"-thumb"),g)};return n.createElement("div",te)})}var De=["prefixCls","direction","vertical","options","disabled","defaultValue","value","onChange","className","motionName"];function Be(e){if(typeof e.title<"u")return e.title;if(U(e.label)!=="object"){var t;return(t=e.label)===null||t===void 0?void 0:t.toString()}}function ze(e){return e.map(function(t){if(U(t)==="object"&&t!==null){var o=Be(t);return Y(Y({},t),{},{title:o})}return{label:t==null?void 0:t.toString(),title:t==null?void 0:t.toString(),value:t}})}var Fe=function(t){var o=t.prefixCls,a=t.className,s=t.disabled,l=t.checked,b=t.label,w=t.title,y=t.value,C=t.onChange,m=function(I){s||C(I,y)};return n.createElement("label",{className:q(a,F({},"".concat(o,"-item-disabled"),s))},n.createElement("input",{className:"".concat(o,"-item-input"),type:"radio",disabled:s,checked:l,onChange:m}),n.createElement("div",{className:"".concat(o,"-item-label"),title:w,role:"option","aria-selected":l},b))},We=n.forwardRef(function(e,t){var o,a,s=e.prefixCls,l=s===void 0?"rc-segmented":s,b=e.direction,w=e.vertical,y=e.options,C=y===void 0?[]:y,m=e.disabled,R=e.defaultValue,I=e.value,v=e.onChange,f=e.className,x=f===void 0?"":f,S=e.motionName,B=S===void 0?"thumb-motion":S,P=ne(e,De),c=n.useRef(null),E=n.useMemo(function(){return Z(c,t)},[c,t]),A=n.useMemo(function(){return ze(C)},[C]),$=re((o=A[0])===null||o===void 0?void 0:o.value,{value:I,defaultValue:R}),d=W($,2),p=d[0],_=d[1],z=n.useState(!1),r=W(z,2),T=r[0],O=r[1],u=function(j,N){m||(_(N),v==null||v(N))},H=oe(P,["children"]);return n.createElement("div",X({role:"listbox","aria-label":"segmented control"},H,{className:q(l,(a={},F(a,"".concat(l,"-rtl"),b==="rtl"),F(a,"".concat(l,"-disabled"),m),F(a,"".concat(l,"-vertical"),w),a),x),ref:E}),n.createElement("div",{className:"".concat(l,"-group")},n.createElement(je,{vertical:w,prefixCls:l,value:p,containerRef:c,motionName:"".concat(l,"-").concat(B),direction:b,getValueIndex:function(j){return A.findIndex(function(N){return N.value===j})},onMotionStart:function(){O(!0)},onMotionEnd:function(){O(!1)}}),A.map(function(g){return n.createElement(Fe,X({},g,{key:g.value,prefixCls:l,className:q(g.className,"".concat(l,"-item"),F({},"".concat(l,"-item-selected"),g.value===p&&!T)),checked:g.value===p,onChange:u,disabled:!!m||!!g.disabled}))})))}),Ve=We;function J(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function K(e){return{backgroundColor:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}const Le=Object.assign({overflow:"hidden"},ce),Ye=e=>{const{componentCls:t}=e,o=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),a=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),s=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},de(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${D(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},K(e)),{color:e.itemSelectedColor}),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",transition:`background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{backgroundColor:e.itemHoverBg}},[`&:active:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:o,lineHeight:D(o),padding:`0 ${D(e.segmentedPaddingHorizontal)}`},Le),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:Object.assign(Object.assign({},K(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${D(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, height ${e.motionDurationSlow} ${e.motionEaseInOut}`,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:a,lineHeight:D(a),padding:`0 ${D(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:s,lineHeight:D(s),padding:`0 ${D(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),J(`&-disabled ${t}-item`,e)),J(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"}})}},qe=e=>{const{colorTextLabel:t,colorText:o,colorFillSecondary:a,colorBgElevated:s,colorFill:l,lineWidthBold:b,colorBgLayout:w}=e;return{trackPadding:b,trackBg:w,itemColor:t,itemHoverColor:o,itemHoverBg:a,itemSelectedBg:s,itemActiveBg:l,itemSelectedColor:o}},Xe=le("Segmented",e=>{const{lineWidth:t,calc:o}=e,a=se(e,{segmentedPaddingHorizontal:o(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:o(e.controlPaddingHorizontalSM).sub(t).equal()});return[Ye(a)]},qe);var Q=globalThis&&globalThis.__rest||function(e,t){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(o[a[s]]=e[a[s]]);return o};function Ge(e){return typeof e=="object"&&!!(e!=null&&e.icon)}const ke=n.forwardRef((e,t)=>{const{prefixCls:o,className:a,rootClassName:s,block:l,options:b=[],size:w="middle",style:y,vertical:C}=e,m=Q(e,["prefixCls","className","rootClassName","block","options","size","style","vertical"]),{getPrefixCls:R,direction:I,segmented:v}=n.useContext(ue),f=R("segmented",o),[x,S,B]=Xe(f),P=me(w),c=n.useMemo(()=>b.map($=>{if(Ge($)){const{icon:d,label:p}=$,_=Q($,["icon","label"]);return Object.assign(Object.assign({},_),{label:n.createElement(n.Fragment,null,n.createElement("span",{className:`${f}-item-icon`},d),p&&n.createElement("span",null,p))})}return $}),[b,f]),E=he(a,s,v==null?void 0:v.className,{[`${f}-block`]:l,[`${f}-sm`]:P==="small",[`${f}-lg`]:P==="large",[`${f}-vertical`]:C},S,B),A=Object.assign(Object.assign({},v==null?void 0:v.style),y);return x(n.createElement(Ve,Object.assign({},m,{className:E,style:A,options:c,ref:t,prefixCls:f,direction:I,vertical:C})))}),Je=ke,Ke=Je;function Qe(){window.gtag("consent","update",{ad_user_data:"granted",ad_personalization:"granted",ad_storage:"granted",analytics_storage:"granted"})}function Ze(){window.gtag("consent","update",{ad_user_data:"denied",ad_personalization:"denied",ad_storage:"denied",analytics_storage:"denied"})}const Ue=({open:e,onButtonClick:t,saveAllowCookies:o})=>{const[a,s]=n.useState(!1),[l,b]=n.useState(!0);return e?i("div",{children:i("div",{className:"age-warning-modal",children:i("div",{id:"age-cookie-modal",className:"age-cookie-modal",children:h("div",{className:"age-cookie-modal-content",children:[i("div",{className:"age-cookie-modal-header",children:i("h2",{children:"Welcome to NSFW Char AI!"})}),i("hr",{className:"vl"}),h("div",{className:"age-cookie-modal-body",children:[i("div",{style:{marginBottom:"0.8rem"},children:"Please note the following:"}),h("div",{style:{display:"flex",alignItems:"flex-start"},children:[i("div",{className:"numberCircle",children:"1"}),h("p",{children:["This site is intended for users who are ",i("span",{style:{color:"#ED6E43"},children:"18 and older"}),"."]})]}),h("div",{style:{display:"flex",alignItems:"flex-start"},children:[i("div",{className:"numberCircle",children:"2"}),h("div",{children:[i("p",{style:{marginBottom:"0.5rem"},children:"We utilize cookies to improve your experience on our site."}),a?h("div",{onClick:()=>{b(!l)},style:{display:"flex",alignItems:"flex-start",cursor:"pointer"},children:[l?i("div",{className:"checkedCircle",children:"✓"}):i("div",{className:"hollowCircle",children:" "}),i("p",{style:{padding:0},children:"Optional cookies allowed"})]}):i("p",{style:{borderBottom:"1px solid",padding:0,width:"fit-content",cursor:"pointer"},onClick:()=>s(!0),children:"Manage Cookies"})]})]})]}),i("div",{className:"age-cookie-modal-footer",children:i("button",{id:"age-cookie-modal-enterButton",onClick:()=>{t(),l?(o(!0),Qe()):(localStorage.setItem("consent","denied"),o(!1),Ze())},children:"Accept All"})})]})})})}):i(ee,{})},{Title:et}=Re,ht=()=>{const{profile:e,localData:t,updateLocalData:o}=n.useContext(ge),a=Me(),s="NSFW Character AI: Free and no Filter",{path:l}=ve(),[b,w]=n.useState(s);fe.useApp();const y=pe(),[C,m]=be({page:"1"}),[R,I]=n.useState(G(C.get("page"))),v={sfw_latest:"Character AI: Talk to AI for free and without filter",sfw_popular:"Character AI Alternative: Better than Beta Character AI",nsfw_latest:"Chat with Character AI NSFW for free",nsfw_trending:"Best Character AI NSFW alternative 2023"},f={sfw_latest:"character-ai",sfw_popular:"character-ai-alternative",nsfw_latest:"character-ai-nsfw",nsfw_trending:"character-ai-nsfw-alternative"},x=Object.entries(f).reduce((r,[T,O])=>(r[O]=T,r),{}),[S,B]=n.useState(x[l||""]?x[l||""].split("_")[1]:"popular"),[P,c]=n.useState(t.lastCheckDailyRewardDate!==V.utc().format("YYYY-MM-DD")),E=r=>{B(r),$(t.character_view,r)},A=r=>{$(r,S)},$=(r,T)=>{const O=r+"_"+T;if(T&&O in v){const u=f[O];y(`/${u}`)}else y("/");m({...C})};n.useEffect(()=>{x[l||""]&&x[l||""].split("_")[0]&&o({character_view:x[l||""].split("_")[0]})},[l]),n.useEffect(()=>{Se()},[]),n.useEffect(()=>{const r=t.character_view+"_"+S;r in v?w(v[r]):w(s)},[t,S]),n.useEffect(()=>{I(G(C.get("page")))},[C]);const d=r=>{m(r)},p=n.useMemo(()=>{const r={mode:t.character_view||"sfw"};switch(S){case"latest":return{sort:"latest",...r};case"trending":return{special_mode:S,...r};case"popular":return{sort:"popular",...r};case"female":return{tag_id:2,...r};case"male":return{tag_id:1,...r};case"anime":return{tag_id:9,...r};case"game":return{tag_id:8,...r}}},[S,t.character_view]),{data:_,isLoading:z}=Ce(["chats",e==null?void 0:e.id],async()=>(await Ne.get("/chats/m4chats")).data,{enabled:!!e});return h(_e,{align:"left",children:[h(we,{children:[i("title",{children:b}),i("meta",{name:"description",content:"Join in NSFW Character AI for a unique experience with AI sexting conversations and talk to nsfw ai chat for free. Create your dream ai grilfriend now!"}),i("meta",{property:"og:title",content:"NSFW Character AI: Free and no Filter"}),i("meta",{property:"og:description",content:"Join in NSFW Character AI for a unique experience with AI sexting conversations and talk to nsfw ai chat for free. Create your dream ai grilfriend now!"}),i("meta",{property:"og:type",content:"website"}),i("meta",{property:"og:url",content:"https://nsfwcharai.com"}),i("meta",{property:"og:image",content:"https://nsfwcharai.com/logo.png?sdf88"}),i("meta",{property:"og:locale",content:"en_EN"}),i("meta",{property:"og:site_name",content:"NSFW Character AI"}),i("link",{rel:"canonical",href:"https://nsfwcharai.com/"+(l||"")})]}),i("h1",{className:"mt-4",hidden:!0,children:b}),e&&h("div",{children:[z&&i($e,{}),_&&_.length>0&&h("div",{className:"mb-4",children:[h(et,{level:2,children:["Continue Chats ",i(xe,{to:"/my_chats",children:"(All Chats)"})]}),i(Ae,{size:"small",chats:_})]})]}),h(L.Group,{className:"mb-4",value:t.character_view||"sfw",onChange:r=>{o({character_view:r.target.value}),A(r.target.value)},children:[h(L.Button,{value:"all",children:[i(He,{})," All"]}),h(L.Button,{value:"sfw",children:[i(Ee,{})," SFW Only"]}),h(L.Button,{value:"nsfw",children:[i(Te,{})," NSFW Only"]})]}),i("div",{className:"segment-container",children:i(Ke,{value:S||"popular",onChange:r=>{E(r)},options:[{label:"🔥 Most Popular",value:"popular"},{label:"â Trending",value:"trending"},{label:"âš¡ï¸ Latest",value:"latest"},{label:"👩â€ðŸ¦° Female",value:"female"},{label:"👨â€ðŸ¦° Male",value:"male"},{label:"📺 Anime",value:"anime"},{label:"🎮 Game",value:"game"},{label:"🌠All Tags/Categories",value:"tags"}]})}),S==="tags"?i("div",{className:"tag-container",children:i(ye,{className:"mt-4 ",size:[2,8],wrap:!0,children:a==null?void 0:a.map(r=>i(Ie,{tag:r}))})}):h(ee,{children:[(p==null?void 0:p.special_mode)==="trending"&&h("p",{className:"mt-4",children:["â Trending shows ",i("strong",{children:"popular characters with the most chat"}),", created recently."]}),(p==null?void 0:p.special_mode)==="newcomer"&&h("p",{className:"mt-4",children:["â Recent his shows ",i("strong",{children:"popular characters with the most chat"}),", created daily."]}),i(Pe,{page:R,onPageChange:r=>{d({page:String(r)})},size:"small",cacheKey:"main_page",additionalParams:p})]}),i(Ue,{open:!t.consent&&!t.userOver18&&!e,onButtonClick:()=>o({userOver18:!0}),saveAllowCookies:r=>o({consent:r?"granted":"denied"})}),i(Oe,{enable:!!e&&P&&e.subscription_plan==="Free Trial"&&V.utc(e.created_at).format("YYYY-MM-DD")!==V.utc().format("YYYY-MM-DD"),close:async()=>c(!1),onOpen:async()=>o({lastCheckDailyRewardDate:V.utc().format("YYYY-MM-DD")})})]})};export{ht as Home};