1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8247],{15321:function(t,e,n){"use strict";n(67294);var o=n(19521),r=n(85893),i=o.ZP.div.withConfig({displayName:"LoadingSpinner__LoadingWrapper",componentId:"sc-mc67j1-0"})(["box-sizing:border-box;position:absolute;top:50%;left:50%;width:",";height:",";margin-top:",";margin-left:",";border-radius:50%;border:3px solid transparent;border-top-color:white;border-bottom-color:",";animation:loading 0.8s ease infinite;@keyframes loading{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"],function(t){return t.web?"64px":"30px"},function(t){return t.web?"64px":"30px"},function(t){return t.web?"-32px":"-15px"},function(t){return t.web?"-32px":"-15px"},function(t){return t.color||"#ff4500"}),s=function(t){var e=t.web,n=t.color;return(0,r.jsx)(i,{web:void 0===e||e,color:void 0===n?"#ff4500":n})};e.Z=s},78191:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSP:function(){return tw},default:function(){return tv}});var o=n(27812),r=n(59499),i=n(50029),s=n(87794),a=n.n(s),c=n(67294),l=n(19521),p=n(9008),u=n.n(p),d=n(23095),f=n(11163),h=n(9669),g=n.n(h),x=n(65885),m=n(55042),b=n(66069),y=n(61729),w=n(9365),v=n(31567);n(96486);var k=n(15321),j=n(19872),S=n(85893),I=(0,c.forwardRef)(function(t,e){t.info;var n=t.story,o=t.chatList,r=t.pages,i=t.isLoading,s=t.isScroll,a=t.blockUser;(0,c.useContext)(b.WindowSizeContext);var l=(0,c.useContext)(b.UserLanguageContext),p=(0,v.$)("translation",{keyPrefix:"story"}).t,u=function(t,e){var n;return((n=t.contents)?n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"):"").replace(/<thinking>[\s\S]*?<\/thinking>/gi,"").replace(/^\s*\n+/,"").replace(/\n{2,}/g,"\n").replace(/\n/g,"<br />").split(/(?:\*([^*]+)\*)/g).map(function(n,o){var r,i;return o%2==1?n.trim()?(0,S.jsx)(P,{query:"query"===t.messageType,children:(0,S.jsx)("div",{children:n})},o):null:n.trim()?(0,S.jsxs)(C,{bgColor:"query"===t.messageType?null==e?void 0:e.mainColor:null==e?void 0:e.subColor,query:"query"===t.messageType,children:[(0,S.jsxs)(Z,{line:null==e?void 0:e.lineColor,onClick:function(){return setOpen("profile")},query:"query"===t.messageType,children:[(0,S.jsx)("img",{id:"profile",src:(null==e?void 0:e.assistantProfileImg)||"https://img.stipop.io/image/stipop/icon/chat/chat-create-profile-icon.png",alt:""}),(0,S.jsx)("div",{id:"name",children:(null===(r=e.assistantInfo)||void 0===r?void 0:null===(i=r.filter(function(t){return t.lang===l[0]})[0])||void 0===i?void 0:i.assistantName)||e.assistantName})]}),(0,S.jsxs)("div",{id:"query"===t.messageType?"query":"answer",children:[(0,S.jsx)("div",{dangerouslySetInnerHTML:{__html:n.replace(/^(<br\s*\/?>\s*)+/i,"")}}),!e.sticker&&(0,S.jsx)(z,{query:"query"===t.messageType,children:d(t.regDate)})]})]},o):null})},d=function(t){var e=new Date(t).getHours(),n=new Date(t).getMinutes(),o=e>=12?"PM":"AM";return e%=12,(e=e||12)+":"+(n=n<10?"0"+n:n)+" "+o},f=function(t,e){var n,r=new Date(t).toDateString(),i=e>0?new Date(o[e-1].regDate).toDateString():null,s=new Date,a=new Date(t).getFullYear()+"-"+(new Date(t).getMonth()+1)+"-"+new Date(t).getDate(),c=s.getFullYear()+"-"+(s.getMonth()+1)+"-"+s.getDate();return r!==i?(0,S.jsx)(N,{children:(0,S.jsx)("span",{children:a===c?"Today":(n=new Date(r),"".concat(["January","February","March","April","May","June","July","August","September","October","November","December"][new Date(n).getMonth()]," ").concat(new Date(n).getDate()))})}):null};return(0,S.jsxs)(_,{ref:e,color:null==n?void 0:n.mainColor,className:s?"":"scroll-display-none",blur:"Y"===n.artistBlockYn,children:["Y"===n.artistBlockYn&&(0,S.jsxs)(L,{children:[(0,S.jsx)("div",{children:p("menu.blur text")}),(0,S.jsx)("div",{onClick:function(){a("Y"===n.artistBlockYn?"unblock":"block")},style:{color:"#fff",fontSize:"14px",fontWeight:500,marginTop:"8px",cursor:"pointer",zIndex:4},children:p("menu.unblock")})]}),i?(0,S.jsx)(k.Z,{color:null==n?void 0:n.mainColor}):r.map(function(t,e){return(0,S.jsx)("div",{children:t.map(function(t,e){return(0,S.jsxs)("div",{id:"chatbox-".concat(e),children:[f(t.regDate,e),u(t,n)]},e)})},e)})]})}),_=l.ZP.div.withConfig({displayName:"StoryInfoChat__Wrapper",componentId:"sc-x0efpe-0"})(["width:100%;height:100%;overflow-x:hidden;overflow-y:",";padding:0px 9px 0 10px;box-sizing:border-box;position:relative;font-family:Poppins;::-webkit-scrollbar{width:5px;height:5px;background-color:transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb:vertical{background-color:",";}::-webkit-scrollbar-thumb:vertical:hover{background-color:",";}::-webkit-scrollbar-thumb:hover{background-color:",";}&.scroll-display-none::-webkit-scrollbar{width:5px;background:transparent;}&.scroll-display-none::-webkit-scrollbar-thumb{background-color:transparent;}@media (min-width:","){max-width:716px;}"],function(t){return t.blur?"hidden":"auto"},function(t){return t.color},function(t){return t.color},function(t){return t.color},function(t){return t.theme.bp.web}),C=l.ZP.div.withConfig({displayName:"StoryInfoChat__Chat",componentId:"sc-x0efpe-1"})(["margin-bottom:6px;border-radius:0 16px 16px 16px;font-size:14px;word-wrap:break-word;word-break:break-all;display:flex;justify-content:",";-webkit-user-select:text;-moz-user-select:text;
1-ms-use-select:text;user-select:text;#answer{width:auto;height:90%;min-height:40px;background-color:",";border-radius:0 16px 16px 16px;padding:8px 10px;box-sizing:border-box;text-align:left;max-width:calc(100% - 110px);position:relative;color:#000;display:flex;align-items:center;}#query{background-color:",";padding:8px 10px;box-sizing:border-box;border-radius:16px 0 16px 16px;max-width:calc(100% - 80px);position:relative;color:#fff;}@media (min-width:","){margin-bottom:8px;#answer{max-width:calc(100% - 138px);margin-top:28px;}}"],function(t){return t.query&&"end"},function(t){return t.bgColor},function(t){return t.bgColor},function(t){return t.theme.bp.web}),P=l.ZP.div.withConfig({displayName:"StoryInfoChat__Italic",componentId:"sc-x0efpe-2"})(["width:100%;display:flex;justify-content:",";margin-bottom:6px;@media (min-width:","){margin-bottom:8px;}div{max-width:calc(100% - 90px);min-height:29px;display:flex;justify-content:center;align-items:center;text-align:center;background-color:#efefef;padding:4px 10px;border-radius:6px;box-sizing:border-box;font-size:12px;color:#515151;border-color:#d9d9d9;word-break:break-word;}"],function(t){return t.query?"end":"center"},function(t){return t.theme.bp.web}),N=l.ZP.div.withConfig({displayName:"StoryInfoChat__ChatDate",componentId:"sc-x0efpe-3"})(["width:100%;display:flex;justify-content:center;margin:8px 0;span{font-size:10px;font-weight:500;font-family:Poppins;line-height:18px;padding:1px 5px;background-color:#eeeeee;border-radius:100px;}"]),Z=l.ZP.div.withConfig({displayName:"StoryInfoChat__Character",componentId:"sc-x0efpe-4"})(["width:40px;height:40px;border:0.5px solid ",";border-radius:50%;background-color:transparent;flex-shrink:0;margin-right:6px;box-sizing:border-box;position:relative;cursor:pointer;display:",";#profile{width:100%;height:100%;border-radius:50%;object-fit:cover;}#name{display:none;}@media (min-width:","){width:28px;height:28px;margin-bottom:2px;#name{display:block;position:absolute;bottom:3px;left:calc(100% + 6px);white-space:nowrap;font-size:13px;font-family:Poppins;font-weight:500;line-height:18px;}}"],function(t){return t.line||"#000"},function(t){return t.query&&"none"},function(t){return t.theme.bp.web}),z=l.ZP.div.withConfig({displayName:"StoryInfoChat__ChatTime",componentId:"sc-x0efpe-5"})(["font-size:10px;font-family:Poppins;font-weight:400;color:#a3a3a2;line-height:18px;position:absolute;right:",";left:",";bottom:0;text-align:",";white-space:nowrap;"],function(t){return t.query&&"calc(100% + 4px)"},function(t){return!t.query&&"calc(100% + 4px)"},function(t){return t.query?"right":"left"}),L=l.ZP.div.withConfig({displayName:"StoryInfoChat__BlurOverlay",componentId:"sc-x0efpe-6"})(["position:sticky;top:0;left:0;z-index:3;width:100%;height:100%;backdrop-filter:blur(15px);background-color:rgba(136,136,136,0.8);display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:16px;font-weight:700;color:#000;"]),D=function(t){t.token;var e=t.showEpisode,n=t.setShowEpisode,r=t.pageMap,i=t.isScroll,s=t.setShowPopup,a=t.episode,l=t.story,p=(0,v.$)("translation",{keyPrefix:"story"}).t;(0,c.useContext)(b.UserLanguageContext);var u=(0,f.useRouter)(),d=(0,c.useState)(!1),h=d[0],g=d[1],x=function(t){s(t),setTimeout(function(){s("")},2e3)};return(0,S.jsx)(E,{children:h?(0,S.jsxs)(B,{children:[(0,S.jsx)("div",{id:"box-header",children:(0,S.jsxs)(M,{children:[(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-story-episodes-icon.png",alt:""}),p("menu.episodes")]})}),(0,S.jsx)(O,{height:8}),(0,S.jsx)(R,{children:Array.from({length:Math.ceil(r.pageCount)},function(t,e){return(0,S.jsxs)(T,{onClick:function(){n(e+1),g(!1)},children:[p("menu.episode")," #",e+1]},e)})}),(0,S.jsx)("img",{id:"close",onClick:function(){g(!1)},src:"https://img.stipop.io/image/stipop/icon/close-icon.png",alt:""})]}):!i&&(e?(0,S.jsxs)(q,{children:[(0,S.jsx)(Y,{children:(0,S.jsxs)(M,{onClick:function(){return g(!h)},children:[(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-story-episodes-icon.png",alt:""}),p("menu.episodes")]})}),(0,S.jsx)(Y,{children:(0,S.jsxs)(M,{disabled:e<=1,onClick:function(){e<=1&&x("First Episode"),n(e>1?e-1:e)},children:[(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-story-prev".concat(1===e?"-gray":"","-icon.png"),alt:""}),p("menu.prev")]})}),(0,S.jsx)(Y,{children:(0,S.jsxs)(M,{disabled:e>=r.pageCount,onClick:function(){e>=r.pageCount&&x("Final Episode"),n(e<r.pageCount?e+1:e)},children:[(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-story-next".concat(e===r.pageCount?"-gray":"","-icon.png"),alt:""}),p("menu.next")]})}),(0,S.jsx)(Y,{children:(0,S.jsxs)(M,{disabled:e>=r.pageCount,onClick:function(){j.ZP.track("Button Click",{button_name:"story_chatview_to_chat_web",episode_url:"https://stipop.com/chat/story/".concat(null==l?void 0:l.storyId,"?assistantId=").concat(null==l?void 0:l.assistantId,"&chatId=").concat(null==l?void 0:l.chatId,"&limit=").concat(null==l?void 0:l.messagePerEpisode).concat(e>0?"&episode=".concat(e):""),episode_number:e,story_title:null==l?void 0:l.title,story_id:null==l?void 0:l.storyId}),u.push("/chat/".concat(btoa(l.assistantId)))},style:{rowGap:"2px",color:"#ff4500"},children:[(0,S.jsxs)("div",{style:{position:"relative",lineHeight:0},children:[(0,S.jsx)("img",{src:l.assistantProfileImg,alt:"",style:{position:"absolute",width:"24px",height:"24px",borderRadius:"50%",left:"2px",top:"2px"}}),(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-story-chat-icon.png",alt:"",style:{width:"28.843px",height:"28px"}})]}),p("menu.chat")]})})]}):(0,S.jsx)(V,{disabled:function(){if((0,o.Z)(a).sort(function(t,e){return e.episodeNumber-t.episodeNumber}).find(function(t){return"R"===t.status}))return!1;var t=new Set(a.map(function(t){return t.episodeNumber}));return!Array.from({length:r.pageCount},function(t,e){return e+1}).some(function(e){return!t.has(e)})}(),onClick:function(){var t,e;n((null==a?void 0:a.length)>0?(0,o.Z)(a).some(function(t){return"R"===t.status})?null!==(t=null===(e=(0,o.Z)(a).sort(function(t,e){return e.episodeNumber-t.episodeNumber}).find(function(t){return"R"===t.status}))||void 0===e?void 0:e.episodeNumber)&&void 0!==t?t:1:function(){for(var t=new Set(a.map(function(t){return t.episodeNumber})),e=Math.max.apply(Math,(0,o.Z)(a.map(function(t){return t.episodeNumber}))),n=e+1;n<=r.pageCount;n++)if(!t.has(n))return n;return 0}():1)},children:(null==a?void 0:a.length)>0?(0,o.Z)(a).some(function(t){return"R"===t.status})?p("menu.reading"):function(){for(var t=new Set(a.map(function(t){return t.episodeNumber})),e=Math.max.apply(Math,(0,o.Z)(a.map(function(t){return t.episodeNumber}))),n=e+1;n<=r.pageCount;n++)if(!t.has(n))return p("menu.start",{i:n});return p("menu.wait")}():p("menu.start",{i:1})}))})},E=l.ZP.div.withConfig({displayName:"StoryInfoBottom__Wrapper",componentId:"sc-qwzqrg-0"})(["width:100%;position:absolute;bottom:24px;background-color:transparent;display:flex;justify-content:center;"]),O=l.ZP.div.withConfig({displayName:"StoryInfoBottom__SpaceResponsive",componentId:"sc-qwzqrg-1"}
1)(["height:","px;flex-shrink:0;@media (max-width:","){height:","px;}"],function(t){return t.height},function(t){return t.theme.bp.web},function(t){return t.mHeight}),q=l.ZP.div.withConfig({displayName:"StoryInfoBottom__MenuBox",componentId:"sc-qwzqrg-2"})(["width:100%;max-width:288px;height:69px;border-radius:24px;background:rgba(255,255,255,0.86);box-shadow:0px 0px 8px 0px rgba(0,0,0,0.25);backdrop-filter:blur(4px);display:flex;align-items:center;z-index:2;"]),Y=l.ZP.div.withConfig({displayName:"StoryInfoBottom__MenuItem",componentId:"sc-qwzqrg-3"})(["height:100%;flex:1;min-width:0;font-size:10px;display:flex;align-items:center;justify-content:center;"]),M=l.ZP.div.withConfig({displayName:"StoryInfoBottom__MenuIcon",componentId:"sc-qwzqrg-4"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;row-gap:4px;font-size:10px;color:",";cursor:pointer;#icon{width:24px;height:24px;}"],function(t){return t.disabled?"#9d9d9d":"#000"}),B=l.ZP.div.withConfig({displayName:"StoryInfoBottom__EpisodeMenu",componentId:"sc-qwzqrg-5"})(["width:100%;max-width:288px;position:absolute;border-radius:24px;background:rgba(255,255,255,0.86);box-shadow:0px 0px 8px 0px rgba(0,0,0,0.25);backdrop-filter:blur(4px);bottom:calc(100% + 8px);display:flex;flex-direction:column;justify-content:center;align-items:center;box-sizing:border-box;#box-header{width:100%;height:62px;display:flex;justify-content:center;align-items:center;border-bottom:1px solid #a5a5a5;flex-shrink:0;box-sizing:border-box;}#box-mid{width:100%;padding:0 0 0 62px;box-sizing:border-box;}#close{width:20px;height:20px;position:absolute;top:12px;left:12px;cursor:pointer;}"]),R=l.ZP.div.withConfig({displayName:"StoryInfoBottom__EpisodeBoxWrapper",componentId:"sc-qwzqrg-6"})(["width:100%;max-height:360px;display:flex;flex-direction:column;row-gap:8px;padding:0 12px 8px 12px;box-sizing:border-box;overflow-y:auto;&::-webkit-scrollbar{display:none;}"]),T=l.ZP.div.withConfig({displayName:"StoryInfoBottom__EpisodeBox",componentId:"sc-qwzqrg-7"})(["width:100%;height:52px;background-color:#383838;padding:15px 16px;box-sizing:border-box;border-radius:16px;color:#fff;font-size:14px;font-weight:500;cursor:pointer;"]),V=l.ZP.div.withConfig({displayName:"StoryInfoBottom__StartButton",componentId:"sc-qwzqrg-8"})(["width:100%;max-width:271px;height:48px;border-radius:100px;background:",";box-shadow:0px 4px 12px 0px rgba(0,0,0,0.35);flex-shrink:0;display:flex;justify-content:center;align-items:center;color:#fff;font-size:16px;font-weight:500;cursor:",";"],function(t){return t.disabled?"#acacac":"linear-gradient(90deg, #ff4500 0%, #ff7242 54.78%, #fa57b6 100%)"},function(t){return t.disabled?"":"pointer"}),W=(0,c.forwardRef)(function(t,e){t.info;var n=t.story,o=t.chatList,r=t.pages,i=t.isLoading,s=t.isScroll,a=t.blockUser;(0,c.useContext)(b.WindowSizeContext),(0,c.useContext)(b.UserLanguageContext);var l=(0,v.$)("translation",{keyPrefix:"story"}).t;(0,c.useEffect)(function(){j.ZP.track("Link View",{link_name:"story_bookview"})},[]);var p=function(t,e){var n;return((n=t.contents)?n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"):"").replace(/<thinking>[\s\S]*?<\/thinking>/gi,"").replace(/^\s*\n+/,"").replace(/\n{2,}/g,"\n").replace(/\n/g,"<br />").split(/(?:\*([^*]+)\*)/g).map(function(e,n){return n%2==1?e.trim()?(0,S.jsx)(F,{query:"query"===t.messageType,children:"\xa0\xa0ââ ".concat(e)},n):null:e.trim()?(0,S.jsx)(F,{query:"query"===t.messageType,children:(0,S.jsx)("div",{dangerouslySetInnerHTML:{__html:'"'.concat(e,'"')}})},n):null})},u=function(t,e){var n,r=new Date(t).toDateString(),i=e>0?new Date(o[e-1].regDate).toDateString():null,s=new Date,a=new Date(t).getFullYear()+"-"+(new Date(t).getMonth()+1)+"-"+new Date(t).getDate(),c=s.getFullYear()+"-"+(s.getMonth()+1)+"-"+s.getDate();return r!==i?(0,S.jsx)(H,{children:(0,S.jsx)("span",{children:a===c?"Today":(n=new Date(r),"".concat(["January","February","March","April","May","June","July","August","September","October","November","December"][new Date(n).getMonth()]," ").concat(new Date(n).getDate()))})}):null};return(0,S.jsxs)(A,{ref:e,color:"#fff",className:s?"":"scroll-display-none",blur:"Y"===n.artistBlockYn,children:["Y"===n.artistBlockYn&&(0,S.jsxs)($,{children:[(0,S.jsx)("div",{children:l("menu.blur text")}),(0,S.jsx)("div",{onClick:function(){a("Y"===n.artistBlockYn?"unblock":"block")},style:{color:"#fff",fontSize:"14px",fontWeight:500,marginTop:"8px",cursor:"pointer",zIndex:4},children:l("menu.unblock")})]}),i?(0,S.jsx)(k.Z,{color:null==n?void 0:n.mainColor}):r.map(function(t,e){return(0,S.jsx)("div",{children:t.map(function(t,e){return(0,S.jsxs)("div",{id:"chatbox-".concat(e),children:[u(t.regDate,e),p(t,n)]},e)})},e)})]})}),A=l.ZP.div.withConfig({displayName:"StoryInfoNovel__Wrapper",componentId:"sc-1ac5o3l-0"})(["width:100%;height:100%;overflow-x:hidden;overflow-y:",";padding:0px 9px 0 10px;box-sizing:border-box;position:relative;font-family:Poppins;background-color:#000;::-webkit-scrollbar{width:5px;height:5px;background-color:transparent;}::-webkit-scrollbar-track{background-color:transparent;}::-webkit-scrollbar-thumb:vertical{background-color:",";}::-webkit-scrollbar-thumb:vertical:hover{background-color:",";}::-webkit-scrollbar-thumb:hover{background-color:",";}&.scroll-display-none::-webkit-scrollbar{width:5px;background:transparent;}&.scroll-display-none::-webkit-scrollbar-thumb{background-color:transparent;}@media (min-width:","){max-width:716px;}"],function(t){return t.blur?"hidden":"auto"},function(t){return t.color},function(t){return t.color},function(t){return t.color},function(t){return t.theme.bp.web}),F=l.ZP.div.withConfig({displayName:"StoryInfoNovel__Chat",componentId:"sc-1ac5o3l-1"})(["min-height:20px;font-size:14px;font-weight:500;color:",";margin-bottom:4px;word-wrap:break-word;"],function(t){return t.query?"#b6b6b6":"#fff"}),H=l.ZP.div.withConfig({displayName:"StoryInfoNovel__ChatDate",componentId:"sc-1ac5o3l-2"})(["width:100%;display:flex;justify-content:center;margin:8px 0;span{font-size:10px;font-weight:500;font-family:Poppins;line-height:18px;padding:1px 5px;background:rgba(238,238,238,0.7);border-radius:100px;}"]),$=l.ZP.div.withConfig({displayName:"StoryInfoNovel__BlurOverlay",componentId:"sc-1ac5o3l-3"})(["position:sticky;top:0;left:0;z-index:3;width:100%;height:100%;backdrop-filter:blur(15px);background-color:rgba(136,136,136,0.8);display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:16px;font-weight:700;color:#000;"]);function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function J(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
1e%2?U(Object(n),!0).forEach(function(e){(0,r.Z)(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var G=function(t){var e,n,o=t.info,i=(t.getInfo,t.token),s=(t.setMenu,t.deeplink,t.categories),a=t.story,l=t.episode,p=t.chatList,u=t.pageMap,d=t.showEpisode,h=t.setShowEpisode,g=t.pages,m=t.isLoading,y=t.updateStoryBookmark,w=t.category,k=t.sorted,j=t.reportStory,_=t.blockUser,C=t.showReportPopup,P=t.setShowReportPopup,N=t.updateEpisodeStatus,Z=t.clickCopy,z=(0,v.$)("translation",{keyPrefix:""}).t,L=(0,f.useRouter)(),E=(0,c.useContext)(b.UserLanguageContext),O=(0,c.useState)(!1),q=O[0],Y=O[1],M=(0,c.useState)(!1),B=M[0],R=M[1],T=(0,c.useState)(0),V=T[0],A=T[1],F=(0,c.useState)(!1),H=F[0],$=F[1],U=(0,c.useState)("chat"),G=U[0],tb=U[1],ty=(0,c.useState)(!1),tw=ty[0],tv=ty[1],tk=(0,c.useState)(""),tj=tk[0],tS=tk[1],tI=new x.Z,t_=(0,c.useRef)(),tC=(0,c.useRef)(),tP=(0,c.useRef)(),tN=(0,c.useRef)(),tZ=(0,c.useRef)(0),tz=(0,c.useRef)(0),tL=(0,c.useRef)(),tD=[{value:"Sexual content",name:z("story.menu.sexual")},{value:"Hate speech or symbols",name:z("story.menu.hate")},{value:"Copyright violation",name:z("story.menu.copyright")},{value:"Other - Violation of Terms",name:z("story.menu.other")}],tE=(0,c.useCallback)(function(){if(tC.current){tz.current=tC.current.scrollTop;var t,e=tC.current.scrollTop,n=tC.current.scrollHeight,o=tC.current.clientHeight;Y(!0),tS(""),e+o>=n-2&&"R"===(null===(t=l.find(function(t){return t.episodeNumber===d}))||void 0===t?void 0:t.status)&&N(d,"Y"),tP.current&&clearTimeout(tP.current),tP.current=setTimeout(function(){Y(!1)},100)}},[l,d,G]);return(0,c.useEffect)(function(){var t=tC.current;if(t)return t.addEventListener("scroll",tE),function(){t.removeEventListener("scroll",tE)}},[tE]),(0,c.useEffect)(function(){var t,e=tC.current;e&&e.scrollHeight<=e.clientHeight&&d>0&&"R"===(null===(t=l.find(function(t){return t.episodeNumber===d}))||void 0===t?void 0:t.status)&&N(d,"Y")},[d,l]),(0,c.useEffect)(function(){if(0!==tZ.current&&null!=a&&a.storyId&&null!=o&&o.userId){var t="episodeScroll_".concat(o.userId),e=tI.get(t),n="string"==typeof e?JSON.parse(e):e||{},i=a.storyId.toString(),s=tZ.current.toString(),c=J(J({},n),{},(0,r.Z)({},i,J(J({},n[i]||{}),{},(0,r.Z)({},s,tz.current))));tI.set(t,JSON.stringify(c))}tZ.current=d},[d]),(0,c.useEffect)(function(){var t,e=function(){if(d&&null!=a&&a.storyId&&null!=o&&o.userId){var t="episodeScroll_".concat(o.userId),e=tI.get(t),n="string"==typeof e?JSON.parse(e):e||{},i=a.storyId.toString(),s=d.toString(),c=J(J({},n),{},(0,r.Z)({},i,J(J({},n[i]||{}),{},(0,r.Z)({},s,tz.current))));tI.set(t,JSON.stringify(c))}};return window.addEventListener("beforeunload",e),null===(t=L.events)||void 0===t||t.on("routeChangeStart",e),function(){var t;window.removeEventListener("beforeunload",e),null===(t=L.events)||void 0===t||t.off("routeChangeStart",e)}},[d,null==a?void 0:a.storyId,null==o?void 0:o.userId]),(0,c.useEffect)(function(){if(!m&&d>0&&tC.current&&null!=a&&a.storyId&&null!=o&&o.userId){var t,e="episodeScroll_".concat(o.userId),n=tI.get(e),r="string"==typeof n?JSON.parse(n):n||{},i=null==r?void 0:null===(t=r[a.storyId])||void 0===t?void 0:t[d];void 0!==i&&setTimeout(function(){tC.current&&(tC.current.scrollTop=i)},50)}},[m,d,null==a?void 0:a.storyId,null==o?void 0:o.userId]),(0,c.useEffect)(function(){var t=t_.current;if(t){for(var e=Array.from(t.querySelectorAll("#tag")),n=0,o=0,r=0;r<e.length;r++)if((n+=e[r].offsetWidth+4)<t.offsetWidth-40)o++;else break;var i=e.length-o;A(i>0?i:0)}},[null==a?void 0:a.hashtags,B]),(0,c.useEffect)(function(){var t=function(t){tL.current&&!tL.current.contains(t.target)&&$(!1)};return H?document.addEventListener("mousedown",t):document.removeEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[H]),(0,S.jsxs)(X,{children:[(0,S.jsxs)(K,{children:[(0,S.jsx)(tn,{src:"https://img.stipop.io/image/stipop/icon/arrow-left-icon.png",onClick:function(){d?h(0):window.location.href="/chat/story?category=".concat(w,"&sorted=").concat(k)}}),d?(0,S.jsxs)(S.Fragment,{children:[z("story.menu.episode")," ",d]}):(0,S.jsx)(S.Fragment,{}),(0,S.jsxs)(tt,{children:[(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-".concat("Y"===a.bookmarkYn?"like":"unlike","-icon.png"),alt:"",onClick:function(){i?y():L.push("/".concat("ko"===E[0]?"ko":"en","/signin?aid=story"))}}),(0,S.jsx)("img",{id:"icon",src:"https://img.stipop.io/image/stipop/icon/chat/chat-menu-white-icon.png",alt:"",onClick:function(){return $(!H)}}),H&&(0,S.jsxs)(te,{ref:tL,children:[(0,S.jsx)("div",{id:"item",onClick:function(){$(!1),Z()},children:z("story.menu.share")}),i&&(null==o?void 0:o.userId)!==a.userId&&(0,S.jsx)("div",{id:"item",onClick:function(){$(!1),tv(!tw)},children:z("story.menu.report")}),i&&(null==o?void 0:o.userId)!==a.userId&&(0,S.jsx)("div",{id:"item",onClick:function(){_("Y"===a.artistBlockYn?"unblock":"block"),$(!1)},children:"Y"===a.artistBlockYn?z("story.menu.unblock"):z("story.menu.block")}),d?(0,S.jsx)("div",{id:"item",onClick:function(){tb("chat"===G?"novel":"chat"),$(!1)},children:z("story.menu.switch")}):(0,S.jsx)(S.Fragment,{})]})]})]}),(0,S.jsx)(to,{onClick:function(){},children:(0,S.jsx)("a",{href:"https://stipop.sng.link/Drrbp/ozfp?pcn=web2app_default&psn=stipop.com&pcrn=global_download_button&pscn=allpages",target:"_blank",style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:z("chat.discover.try on stipop")})}),tw?(0,S.jsx)(td,{onClick:function(){tN.current&&!tN.current.contains(event.target)&&tv(!1)},children:(0,S.jsxs)(tf,{ref:tN,children:[(0,S.jsx)("img",{className:"close",src:"https://img.stipop.io/image/studio/upload/close2.png",alt:"",onClick:function(){tv(!1)}}),(0,S.jsx)(Q,{height:21}),(0,S.jsx)(ts,{children:z("story.menu.report")}),(0,S.jsx)(Q,{height:12}),tD.map(function(t,e){return(0,S.jsx)(th,{onClick:function(){j(t.value),tv(!1)},children:t.name},e)}),(0,S.jsx)(Q,{height:16})]})}):(0,S.jsx)(S.Fragment,{}
1),C&&(0,S.jsx)(tx,{children:(0,S.jsxs)(tm,{children:[(0,S.jsx)("div",{id:"text",children:"report"===C?z("story.menu.report success"):"unblocked"===C?z("story.menu.blocked"):"blocked"===C?z("story.menu.unblocked"):""}),(0,S.jsx)(Q,{height:16}),(0,S.jsx)("div",{id:"button",onClick:function(){return P("")},children:z("story.menu.okay")})]})}),tj&&(0,S.jsx)(tg,{chat:"chat"===G,children:tj}),d?"chat"===G?(0,S.jsx)(I,{ref:tC,info:o,story:a,chatList:p,pages:g,setIsScroll:Y,isLoading:m,isScroll:q,blockUser:_}):"novel"===G&&(0,S.jsx)(W,{ref:tC,info:o,story:a,chatList:p,pages:g,setIsScroll:Y,isLoading:m,isScroll:q,blockUser:_}):(0,S.jsxs)(tr,{ref:tC,children:[(0,S.jsx)(Q,{height:d?0:110,mHeight:0}),(0,S.jsx)(Q,{height:12}),(0,S.jsx)(ti,{children:(0,S.jsx)("img",{id:a.thumbnailUrl?"thumbnail-uploaded":"thumbnail-none",src:a.thumbnailUrl?a.thumbnailUrl:"https://img.stipop.io/image/stipop/icon/chat/chat-story-default-img.png",alt:""})}),(0,S.jsx)(Q,{height:12}),(0,S.jsx)(ts,{children:a.title}),(0,S.jsx)(Q,{height:4}),(0,S.jsxs)(ta,{children:[function(t,e){var n,o=[{value:1,symbol:""},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"},{value:1e12,symbol:"T"},{value:1e15,symbol:"P"},{value:1e18,symbol:"E"}];for(n=o.length-1;n>0&&!(t>=o[n].value);n--);return(t/o[n].value).toFixed(1).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+o[n].symbol}(a.viewCount,0)," Views ⢠",a.userName]}),(0,S.jsx)(Q,{height:20}),(0,S.jsxs)(tc,{children:[(0,S.jsx)("div",{id:"category",children:(null===(n=s.filter(function(t){return t.category===a.category})[0].categoryLang.filter(function(t){return t.lang===E[0]})[0])||void 0===n?void 0:n.category)||a.category}),(0,S.jsx)(Q,{height:5}),(0,S.jsxs)(tl,{ref:t_,show:B,children:[a.hashtags.split(",").map(function(t,e){if(t.trim()){var n=!B&&e>=a.hashtags.split(",").length-V;return(0,S.jsx)("div",{id:"tag",style:{display:n?"none":"flex"},children:t.trim()},e)}}),!B&&V?(0,S.jsxs)("div",{id:"tag",style:{cursor:"pointer"},onClick:function(){return R(!0)},children:["+",V," more"]}):(0,S.jsx)(S.Fragment,{})]})]}),(0,S.jsx)(Q,{height:16}),(0,S.jsxs)(tp,{children:[Array.from({length:u.pageCount}).map(function(t,e){var n,o,r;return(0,S.jsxs)(tu,{onClick:function(){h(e+1)},status:null===(n=l.find(function(t){return t.episodeNumber===e+1}))||void 0===n?void 0:n.status,children:[z("story.menu.episode")," ",e+1,(0,S.jsx)("div",{id:"button",children:(null===(o=l.find(function(t){return t.episodeNumber===e+1}))||void 0===o?void 0:o.status)==="Y"?z("story.menu.read"):(null===(r=l.find(function(t){return t.episodeNumber===e+1}))||void 0===r?void 0:r.status)==="R"?z("story.menu.continue"):""})]},e)}),(e=new Set(l.map(function(t){return t.episodeNumber})),Array.from({length:u.pageCount},function(t,e){return e+1}).some(function(t){return!e.has(t)})?(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(tu,{style:{backgroundColor:"#656661",color:"#fff"},children:z("story.menu.coming",{i:u.pageCount+1})}))]}),(0,S.jsx)(Q,{height:90})]}),(0,S.jsx)(D,{token:i,showEpisode:d,setShowEpisode:h,pageMap:u,isScroll:q,setShowPopup:tS,episode:l,story:a})]})},X=l.ZP.div.withConfig({displayName:"StoryInfoView__Wrapper",componentId:"sc-19kp4vr-0"})(["width:100%;height:100%;display:flex;flex-direction:column;align-items:center;font-family:Poppins;position:relative;@media (max-width:","){box-sizing:border-box;}"],function(t){return t.theme.bp.web}),Q=l.ZP.div.withConfig({displayName:"StoryInfoView__SpaceResponsive",componentId:"sc-19kp4vr-1"})(["width:100%;height:","px;flex-shrink:0;@media (max-width:","){height:","px;}"],function(t){return t.height},function(t){return t.theme.bp.web},function(t){return t.mHeight}),K=l.ZP.div.withConfig({displayName:"StoryInfoView__Header",componentId:"sc-19kp4vr-2"})(["width:100%;max-width:686px;height:52px;font-size:14px;font-family:Poppins;font-weight:500;line-height:18px;display:flex;justify-content:center;align-items:center;color:#000;flex-shrink:0;position:relative;@media (max-width:","){width:100dvw;max-width:100dvw;height:44px;font-size:14px;font-weight:500;background-color:#f8f8f8;}"],function(t){return t.theme.bp.web}),tt=l.ZP.div.withConfig({displayName:"StoryInfoView__IconWrapper",componentId:"sc-19kp4vr-3"})(["height:100%;display:flex;align-items:center;column-gap:12px;position:absolute;right:16px;z-index:10;#icon{width:20px;height:20px;filter:brightness(0);cursor:pointer;}@media (min-width:","){right:0;}"],function(t){return t.theme.bp.web}),te=l.ZP.div.withConfig({displayName:"StoryInfoView__TopMenu",componentId:"sc-19kp4vr-4"})(["background-color:#fff;border-radius:16px;box-shadow:0px 0px 10px 0px rgba(0,0,0,0.25);
1border:0.5px solid #efefef;padding:6px;box-sizing:border-box;position:absolute;right:0;top:calc(100% + 6px);#item{width:100%;height:38px;border-radius:10px;display:flex;justify-content:center;align-items:center;font-size:12px;font-family:Poppins;font-weight:500;padding:0 10px;box-sizing:border-box;cursor:pointer;white-space:nowrap;&:hover{background-color:#efefef;}}"]),tn=l.ZP.img.withConfig({displayName:"StoryInfoView__MobileMenu",componentId:"sc-19kp4vr-5"})(["width:20px;height:20px;position:absolute;left:16px;cursor:pointer;@media (min-width:","){left:0;}"],function(t){return t.theme.bp.web}),to=l.ZP.div.withConfig({displayName:"StoryInfoView__Download",componentId:"sc-19kp4vr-6"})(["width:100dvw;height:30px;background-color:#444;color:#fff;font-size:14px;font-family:Poppins;line-height:18px;font-weight:500;display:flex;justify-content:center;align-items:center;flex-shrink:0;cursor:pointer;@media (min-width:","){display:none;}"],function(t){return t.theme.bp.web}),tr=l.ZP.div.withConfig({displayName:"StoryInfoView__StoryWrapper",componentId:"sc-19kp4vr-7"})(["width:100%;height:100%;display:flex;flex-direction:column;align-items:center;overflow-y:auto;overflow-x:hidden;&::-webkit-scrollbar{display:none;}"]),ti=l.ZP.div.withConfig({displayName:"StoryInfoView__StoryImage",componentId:"sc-19kp4vr-8"})(["width:209px;height:256px;flex-shrink:0;border-radius:8px;background-color:#eaeaea;display:flex;justify-content:center;align-items:center;box-sizing:border-box;#thumbnail-uploaded{width:100%;height:100%;border-radius:6px;object-fit:cover;}#thumbnail-none{width:65px;height:65px;}"]),ts=l.ZP.div.withConfig({displayName:"StoryInfoView__Title",componentId:"sc-19kp4vr-9"})(["width:100%;height:37px;display:flex;justify-content:center;align-items:center;font-size:20px;font-weight:600;"]),ta=l.ZP.div.withConfig({displayName:"StoryInfoView__ViewCount",componentId:"sc-19kp4vr-10"})(["width:100%;font-size:12px;text-align:center;font-weight:400;color:#6f6f6f;"]),tc=l.ZP.div.withConfig({displayName:"StoryInfoView__CategoryBox",componentId:"sc-19kp4vr-11"})(["width:100%;max-width:686px;padding:16px 36px;border-top:1px solid #cacaca;border-bottom:1px solid #cacaca;box-sizing:border-box;display:flex;flex-direction:column;#category{font-size:16px;font-weight:600;}#tags{width:100%;height:22px;}"]),tl=l.ZP.div.withConfig({displayName:"StoryInfoView__TagWrapper",componentId:"sc-19kp4vr-12"})(["width:100%;height:22px;display:flex;column-gap:4px;overflow-x:",";overflow-y:hidden;&::-webkit-scrollbar{display:none;}#tag{height:100%;background-color:#fdeaf4;padding:0 6px;font-size:12px;display:flex;align-items:center;color:#d95e8b;border-radius:7px;white-space:nowrap;}"],function(t){return t.show?"auto":"hidden"}),tp=l.ZP.div.withConfig({displayName:"StoryInfoView__EpisodeWrapper",componentId:"sc-19kp4vr-13"})(["width:100%;max-width:686px;display:flex;flex-direction:column;row-gap:4px;padding:0 20px;box-sizing:border-box;"]),tu=l.ZP.div.withConfig({displayName:"StoryInfoView__EpisodeBox",componentId:"sc-19kp4vr-14"})(["width:100%;height:56px;border-radius:16px;border:1px solid #e2e2e2;background-color:#f2f2f2;padding:0 16px 0 24px;box-sizing:border-box;display:flex;justify-content:space-between;align-items:center;flex-shrink:0;cursor:pointer;font-size:16px;font-weight:500;color:",";#button{background-color:",";border-radius:9px;color:",";padding:0 6px;font-size:12px;}"],function(t){return"R"===t.status?"#ff4500":"Y"===t.status?"#999":"#000"},function(t){return"R"===t.status?"#ff4500":"transparent"},function(t){return"R"===t.status?"#fff":"#8e8e8e"}),td=l.ZP.div.withConfig({displayName:"StoryInfoView__ReportWrapper",componentId:"sc-19kp4vr-15"})(["width:100dvw;height:100dvh;position:relative;background-color:rgba(0,0,0,0.5);position:fixed;top:0;left:0;z-index:99;"]),tf=l.ZP.div.withConfig({displayName:"StoryInfoView__Box",componentId:"sc-19kp4vr-16"})(["width:100%;max-width:375px;border-radius:8px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:start;justify-content:center;padding:0 18px;box-sizing:border-box;z-index:99;.close{width:12px;height:12px;position:absolute;top:18px;right:18px;
1cursor:pointer;}@media (max-width:","){top:auto;bottom:0%;transform:translate(-50%,0%);border-radius:8px 8px 0 0;}"],function(t){return t.theme.bp.web}),th=l.ZP.div.withConfig({displayName:"StoryInfoView__TextButton",componentId:"sc-19kp4vr-17"})(["width:100%;height:42px;display:flex;justify-content:center;align-items:center;color:#000;font-family:Poppins;font-weight:400;font-size:14px;line-height:16px;cursor:pointer;border-radius:10px;&:hover{background-color:#efefef;}"]),tg=l.ZP.div.withConfig({displayName:"StoryInfoView__PopupWrapper",componentId:"sc-19kp4vr-18"})(["width:100%;position:absolute;top:50%;background-color:",";color:",";padding:8px 16px;box-sizing:border-box;display:flex;justify-content:center;align-items:center;font-size:14px;font-weight:500;z-index:3;animation:fadeIn 0.3s ease-in-out;@keyframes fadeIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}"],function(t){return t.chat?"rgba(0, 0, 0, 0.7)":"rgba(255, 255, 255, 0.7)"},function(t){return t.chat?"#fff":"#000"}),tx=l.ZP.div.withConfig({displayName:"StoryInfoView__ReportPopupWrapper",componentId:"sc-19kp4vr-19"})(["width:100dvw;height:100dvh;position:fixed;top:0;left:0;background-color:transparent;display:flex;justify-content:center;align-items:center;z-index:9999;@media (min-width:","){width:calc(100dvw - 276px);left:276px;}"],function(t){return t.theme.bp.web}),tm=l.ZP.div.withConfig({displayName:"StoryInfoView__ReportPopup",componentId:"sc-19kp4vr-20"})(["width:343px;background-color:#fff;border-radius:42px;padding:25px 30px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;box-shadow:0px 0px 10px 0px rgba(0,0,0,0.25);#text{font-size:18px;font-weight:600;line-height:22px;letter-spacing:-0.288px;text-align:center;color:#000;}#button{width:100%;height:40px;background-color:#ff4500;color:#fff;border-radius:14px;cursor:pointer;display:flex;justify-content:center;align-items:center;font-size:16px;}"]);function tb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function ty(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tb(Object(n),!0).forEach(function(e){(0,r.Z)(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tb(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var tw=!0,tv=function(t){var e,n,r,s,l,p,h,v,k=t.info,I=t.getInfo,_=t.limit,C=t.storyId,P=t.chatId,N=t.categories,Z=t.roomList,z=t.category,L=t.sorted,D=t.episode,E=(0,c.useContext)(b.WindowSizeContext),O=new x.Z().get("stipop-token")||"",q=(0,f.useRouter)();(0,c.useContext)(b.UserLanguageContext);var Y=(0,c.useState)(Z),M=Y[0];Y[1];var B=(0,c.useState)(!1),R=B[0],T=B[1],V=(0,c.useState)(!1),W=V[0],A=V[1],F=(0,c.useState)(""),H=F[0];F[1];var $=(0,c.useState)(!1),U=($[0],$[1]),J=(0,c.useState)({chatList:null==ts?void 0:ts.chatList,pageMap:null==ts?void 0:ts.pageMap}),X=J[0],Q=J[1],K=(0,c.useState)(D>0?Number(D):0),tt=K[0],te=K[1],tn=(0,c.useState)(!0),to=tn[0],tr=tn[1],ti=(0,c.useState)(t.story),ts=ti[0],ta=ti[1],tc=(0,c.useState)(""),tl=tc[0],tp=tc[1],tu=(0,c.useRef)();(0,c.useEffect)(function(){window.history.replaceState(null,"",window.location.pathname),j.ZP.track("Link View",{link_name:"story_mainview"})},[]);var td=c.useMemo(function(){for(var t=(null==X?void 0:X.chatList)||[],e=[],n=0;n<t.length;n+=_)e.push(t.slice(n,n+_));return e},[X]);(0,c.useEffect)(function(){if(tt>0){var t,e;tx(tt),j.ZP.track("Link View",{link_name:"story_chatview",episode_url:"https://stipop.com/chat/story/".concat(C,"?assistantId=").concat(null==ts?void 0:ts.storyList.assistantId,"&chatId=").concat(null==ts?void 0:ts.storyList.chatId,"&limit=").concat(null==ts?void 0:ts.storyList.messagePerEpisode).concat(tt>0?"&episode=".concat(tt):""),episode_number:tt,story_title:null==ts?void 0:null===(t=ts.storyList)||void 0===t?void 0:t.title,story_id:null==ts?void 0:null===(e=ts.storyList)||void 0===e?void 0:e.storyId})}},[tt]);var tf=function(){(0,w.D)(),j.ZP.track("Button Click",{button_name:"link_discover_download-app"}),E.width>=m.Z.web?setQrCode(!0):window.open("https://stipop.sng.link/Drrbp/ozfp?pcn=web2app_default&psn=stipop.com&pcrn=global_download_button&pscn=allpages","_blank")},th=(e=(0,i.Z)(a().mark(function t(){var e;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=new x.Z,t.next=3,e.remove("stipop-token",d.pN);case 3:return t.next=5,localStorage.removeItem("stipop-login");case 5:return j.ZP.reset(),t.next=8,q.reload();case 8:case"end":return t.stop()}},t)})),function(){return e.apply(this,arguments)}),tg=(n=(0,i.Z)(a().mark(function t(e,n){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,g().put("".concat(d.H,"/v4/story/").concat(C,"/episode/").concat(P,"/view"),{episodeNumber:e,status:n},{headers:{apikey:d.$h,token:O}}).then(function(){ta(function(t){var r=t.episodeStatus.find(function(t){return t.episodeNumber===e});return ty(ty({},t),{},{episodeStatus:r?t.episodeStatus.map(function(t){return t.episodeNumber===e?ty(ty({},t),{},{status:n}):t}):[].concat((0,o.Z)(t.episodeStatus),[{episodeNumber:e,status:n}])})})});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),console.error("updateEpisodeStatus error:",t.t0);case 8:case"end":return t.stop()}},t,null,[[0,5]])})),function(t,e){return n.apply(this,arguments)}),tx=(r=(0,i.Z)(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return tr(!0),t.next=3,g().get("".concat(d.H,"/v4/story/chat-list/").concat(P,"?pageNumber=").concat(e,"&limit=").concat(_),{headers:{apikey:d.$h,token:O}}).then(function(){var t=(0,i.Z)(a().mark(function t(n){var o,r,i,s;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o=n.data).body.chatList){t.next=15;break}if((r=o.body.chatList)&&r.sort(function(t,e){return new Date(t.regDate)-new Date(e.regDate)}),Q(ty(ty({},o.body),{},{chatList:r})),ts.episodeStatus.find(function(t){return t.episodeNumber===e})){t.next=14;break}return s=null===(i=ts.episodeStatus)||void 0===i?void 0:i.filter(function(t){return"Y"!==t.status&&"N"!==t.status}).map(function(t){return tg(t.episodeNumber,"Y")}),t.next=9,Promise.all(s);case 9:return t.next=11,tg(e,"R");case 11:tr(!1),t.next=15;break;case 14:tr(!1);case 15:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}());case 3:case"end":return t.stop()}},t)})),function(t){return r.apply(this,arguments)}),tm=(s=(0,i.Z)(a().mark(function t(){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g().post("".concat(d.H,"/v4/story/bookmark/").concat(C),{},{headers:{apikey:d.$h,token:O}}).then(function(){ta(ty(ty({},ts),{},{storyList:ty(ty({},ts.storyList),{},{bookmarkYn:"Y"===ts.storyList.bookmarkYn?"N":"Y"})}))});case 2:case"end":return t.stop()}},t)})),function(){return s.apply(this,arguments)}),tb=(l=(0,i.Z)(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g().post("".concat(d.H,"/v4/story/report/").concat(C),{reason:e,contents:e},{headers:{apikey:d.$h,token:O}}).then(function(){tp("report")});case 2:case"end":return t.stop()}},t)})),function(t){return l.apply(this,arguments)}),tw=(p=(0,i.Z)(a().mark(function t(e){return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("unblock"!==e){t.next=5;break}return t.next=3,g().delete("".concat(d.H,"/v4/artist/block/").concat(ts.storyList.userId),{headers:{apikey:d.$h,token:O}}).then(function(){ta(ty(ty({},ts),{},{storyList:ty(ty({},ts.storyList),{},{artistBlockYn:"Y"===ts.storyList.artistBlockYn?"N":"Y"})})),tp("unblocked")});case 3:t.next=7;break;case 5:return t.next=7,g().post("".concat(d.H,"/v4/artist/block/").concat(ts.storyList.userId),{},{headers:{apikey:d.$h,token:O}}).then(function(){ta(ty(ty({},ts),{},{storyList:ty(ty({},ts.storyList),{},{artistBlockYn:"Y"===ts.storyList.artistBlockYn?"N":"Y"})})),tp("blocked")});case 7:case"end":return t.stop()}},t)})),function(t){return p.apply(this,arguments)}),tv=(h=(0,i.Z)(a().mark(function t(){var e,n;return a().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e="https://stipop.com/chat/story/".concat(C,"?assistantId=").concat(null==ts?void 0:ts.storyList.assistantId,"&chatId=").concat(null==ts?void 0:ts.storyList.chatId,"&limit=").concat(null==ts?void 0:ts.storyList.messagePerEpisode).concat(tt>0?"&episode=".concat(tt):""),!navigator.share){t.next=4;break}return t.next=4,navigator.share({title:null==ts?void 0:null===(n=ts.storyList)||void 0===n?void 0:n.title,url:e}).then(function(){}).catch(function(t){console.error("Error sharing:",t)});case 4:return t.next=6,navigator.clipboard.writeText(e).then(function(){alert("Link copied to clipboard!")});case 6:case"end":return t.stop()}},t)})),function(){return h.apply(this,arguments)});return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(u(),{children:[(0,S.jsx)("meta",{name:"theme-color",content:"#f8f8f8"}),(0,S.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, user-scalable=no"})]}),(0,S.jsxs)(tk,{children:[E.width>m.Z.web||R?(0,S.jsx)(y.Z,{ref:{menuRef:tu},token:O,roomList:M,signOut:th,setMenu:T,open:W,setOpen:A,downloadStipop:tf,type:"story",info:k,getInfo:I,setVipPopup:U}):null,(0,S.jsx)(G,{info:k,getInfo:I,token:O,setMenu:T,deeplink:H,categories:N,story:null==ts?void 0:ts.storyList,episode:null==ts?void 0:ts.episodeStatus,chatList:null==X?void 0:null===(v=X.chatList)||void 0===v?void 0:v.sort(function(t,e){return new Date(t.regDate)-new Date(e.regDate)}),pageMap:null==ts?void 0:ts.pageMap,showEpisode:tt,setShowEpisode:te,pages:td,isLoading:to,updateStoryBookmark:tm,category:z,sorted:L,reportStory:tb,blockUser:tw,showReportPopup:tl,setShowReportPopup:tp,updateEpisodeStatus:tg,clickCopy:tv})]})]})},tk=l.ZP.div.withConfig({displayName:"storyId__Wrapper",componentId:"sc-49flrv-0"})(["width:100dvw;height:100dvh;position:relative;@media (min-width:","){display:flex;}"],function(t){return t.theme.bp.web})},77363:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat/story/[storyId]",function(){return n(78191)}])},2859:function(t,e,n){"use strict";n.d(e,{J:function(){return g}});var o,r="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,s=function(){for(var t=document.querySelectorAll('script[src^="'.concat(r,'"]')),e=0;e<t.length;e++){var n=t[e];if(i.test(n.src))return n}return null},a=function(t){var e=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(e);var o=document.head||document.body;if(!o)throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n},c=function(t,e){t&&t._registerWrapper&&t._registerWrapper({name:"stripe-js",version:"4.2.0",startTime:e})},l=null,p=null,u=null,d=function(t,e,n){if(null===t)return null;
1var o=t.apply(void 0,e);return c(o,n),o},f=!1,h=function(){return o||(o=(null!==l?l:(l=new Promise(function(t,e){if("undefined"==typeof window||"undefined"==typeof document){t(null);return}if(window.Stripe,window.Stripe){t(window.Stripe);return}try{var n,o=s();o?o&&null!==u&&null!==p&&(o.removeEventListener("load",u),o.removeEventListener("error",p),null===(n=o.parentNode)||void 0===n||n.removeChild(o),o=a(null)):o=a(null),u=function(){window.Stripe?t(window.Stripe):e(Error("Stripe.js not available"))},p=function(){e(Error("Failed to load Stripe.js"))},o.addEventListener("load",u),o.addEventListener("error",p)}catch(r){e(r);return}})).catch(function(t){return l=null,Promise.reject(t)})).catch(function(t){return o=null,Promise.reject(t)}))};Promise.resolve().then(function(){return h()}).catch(function(t){f||console.warn(t)});var g=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];f=!0;var o=Date.now();return h().then(function(t){return d(t,e,o)})}},52587:function(t,e,n){"use strict";function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}n.d(e,{Z:function(){return o}})},27812:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var o=n(52587),r=n(2937);function i(t){return function(t){if(Array.isArray(t))return(0,o.Z)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||(0,r.Z)(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},2937:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});var o=n(52587);function r(t,e){if(t){if("string"==typeof t)return(0,o.Z)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return(0,o.Z)(t,e)}}}},function(t){t.O(0,[3662,1729,9774,2888,179],function(){return t(t.s=77363)}),_N_E=t.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.