1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1243],{5369:(e,t,n)=>{"use strict";n.d(t,{$v:()=>x,EO:()=>w,Lt:()=>o,Rx:()=>h,Zr:()=>g,ck:()=>m,r7:()=>p,wd:()=>u});var s=n(37876),a=n(84634),l=n(14232),i=n(5746),r=n(21257);let o=a.bL;a.l9;let c=a.ZL,d=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,s.jsx)(a.hJ,{className:(0,r.cn)("tw-fixed tw-inset-0 tw-z-[20000] tw-bg-black/60 data-[state=open]:tw-animate-in data-[state=open]:tw-fade-in-0",n),...l,ref:t})});d.displayName=a.hJ.displayName;let w=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(d,{}),(0,s.jsx)(a.UC,{ref:t,className:(0,r.cn)("tw-fixed tw-left-[50%] tw-top-[50%] tw-z-[20000] tw-grid tw-w-full tw-max-w-lg tw-translate-x-[-50%] tw-translate-y-[-50%] tw-gap-6 tw-rounded-2xl tw-border-none tw-bg-neutral-dark tw-p-8 tw-shadow-xl tw-duration-200 data-[state=closed]:tw-pointer-events-none data-[state=open]:tw-animate-in data-[state=closed]:tw-animate-out data-[state=closed]:tw-fade-out-0 data-[state=open]:tw-fade-in-0 data-[state=closed]:tw-zoom-out-95 data-[state=open]:tw-zoom-in-95 data-[state=closed]:tw-slide-out-to-left-1/2 data-[state=closed]:tw-slide-out-to-top-[48%] data-[state=open]:tw-slide-in-from-left-1/2 data-[state=open]:tw-slide-in-from-top-[48%] sp:tw-w-[calc(100vw-32px)] sp:tw-max-w-sm",n),...l})]})});w.displayName=a.UC.displayName;let u=e=>{let{className:t,...n}=e;return(0,s.jsx)("div",{className:(0,r.cn)("tw-flex tw-flex-col tw-space-y-2 tw-text-center sm:tw-text-left",t),...n})};u.displayName="AlertDialogHeader";let m=e=>{let{className:t,...n}=e;return(0,s.jsx)("div",{className:(0,r.cn)("tw-flex tw-flex-col-reverse tw-gap-2 sm:tw-flex-row",t),...n})};m.displayName="AlertDialogFooter";let p=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,s.jsx)(a.hE,{ref:t,className:(0,r.cn)("tw-text-lg tw-font-semibold tw-text-white",n),...l})});p.displayName=a.hE.displayName;let x=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,s.jsx)(a.VY,{ref:t,className:(0,r.cn)("tw-text-sm tw-text-neutral-pale",n),...l})});x.displayName=a.VY.displayName;let h=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,s.jsx)(a.rc,{ref:t,className:(0,r.cn)((0,i.r)(),n),...l})});h.displayName=a.rc.displayName;let g=l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,s.jsx)(a.ZD,{ref:t,className:(0,r.cn)((0,i.r)({variant:"light"}),n),...l})});g.displayName=a.ZD.displayName},5412:(e,t,n)=>{"use strict";n.d(t,{G:()=>i});var s=n(37876),a=n(21257);let l=e=>{let{fillRatio:t,index:n}=e,a="star-gradient-".concat(n);return(0,s.jsxs)("svg",{viewBox:"0 0 24 24",className:"tw-h-3.5 tw-w-3.5",children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,s.jsx)("stop",{offset:"".concat(100*t,"%"),stopColor:"#FFFFFF"}),(0,s.jsx)("stop",{offset:"".concat(100*t,"%"),stopColor:"transparent"})]})}),(0,s.jsx)("path",{d:"M12 17.27L18.18 21 16.54 13.97 22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",fill:"url(#".concat(a,")"),stroke:"#FFFFFF",strokeWidth:"1"})]})},i=e=>{let{ratingValue:t}=e,n=Math.max(0,Math.min(t,5)),i=Array.from({length:5}).map((e,t)=>{let a=n-t;return(0,s.jsx)(l,{fillRatio:a>=1?1:a>0?a:0,index:t},t)});return(0,s.jsx)("div",{className:(0,a.cn)("tw-flex tw-space-x-0"),children:i})}},27396:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/movie/[episodeId]",function(){return n(62960)}])},29864:e=>{e.exports={radioButton:"RadioButton_radioButton__obZG1",label:"RadioButton_label__zw_BA",label__disabled:"RadioButton_label__disabled__Ps0ct",label__pc:"RadioButton_label__pc__gHzQf",label__sp:"RadioButton_label__sp__Os4fD",input:"RadioButton_input__Mbyg9",icon:"RadioButton_icon__l4lQi",icon__checked:"RadioButton_icon__checked__bNaxm",icon__unckecked:"RadioButton_icon__unckecked__E_0xD",icon__disabled:"RadioButton_icon__disabled__tSOeB"}},31122:(e,t,n)=>{"use strict";n.d(t,{b:()=>d});
1var s=n(33146),a=n(86430),l=n(85736),i=n(28039),r=n(26703),o=n(87840);let c=async e=>{var t,n;let{count:o}=e,c=new URLSearchParams;void 0!==o&&c.append("count",String(o));let d=await (0,s.Jt)((0,s.VY)("/chapter/movie/recommended_episode?".concat(c.toString())),a.Xt.Response.Chapter.Movie.GetRecommendedEpisodeResponse.decode);if(d.error)throw Error(d.error.message);if(!d.data)throw Error("No data received");let w=d.data.episodes.map(e=>{var t;return null!=(t=e.id)?t:0}).filter(e=>e>0);if(0===w.length)return{hasMore:null!=(t=d.data.hasMoreContent)&&t,episodes:[]};let u=await (0,i.t)({episodeIds:w}).catch(e=>(console.warn("Failed to fetch episode metrics:",e),new Map)),m=d.data.episodes.map(e=>{var t,n,s,a,i,o,c,d,w,m,p;let x=null!=(n=e.id)?n:0,h=u.get(x);return{id:x,title:null!=(s=e.name)?s:"",description:null!=(a=e.description)?a:"",thumbnailUrl:null!=(i=e.thumbnailUrl)?i:"",publishTime:((0,r.e)(e.publishedAt),(0,l.k)(e.publishedAt)),durationSeconds:null!=(o=e.durationSeconds)?o:0,isArticleAvailable:!1,commentCount:null!=(c=null==h?void 0:h.commentCount)?c:0,ratingCount:null!=(d=null==h?void 0:h.ratingCount)?d:0,ratingAverage:null!=(w=null==h?void 0:h.ratingAverage)?w:0,viewCount:null!=(m=null==h?void 0:h.viewCount)?m:0,casts:null!=(p=null==(t=e.cast)?void 0:t.split(",").map(e=>e.trim()).filter(e=>e))?p:[]}});return{hasMore:null!=(n=d.data.hasMoreContent)&&n,episodes:m}},d=e=>(0,o.j)({queryKey:["getRecommendedEpisodeList",e],queryFn:()=>c(e)})},34795:(e,t,n)=>{"use strict";function s(e){if(!e)return 0;if("undefined"!=typeof Intl&&"Segmenter"in Intl)return Array.from(new Intl.Segmenter("ja",{granularity:"grapheme"}).segment(e)).length;let t=0;for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s>=55296&&s<=56319&&n+1<e.length){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&n++}t++}return t}function a(e){return e?s(e.replace(/[\r\n\t\u0020\u3000]/g,"")):0}function l(e,t){return!e||s(e)<=t?e:"undefined"!=typeof Intl&&"Segmenter"in Intl?Array.from(new Intl.Segmenter("ja",{granularity:"grapheme"}).segment(e)).slice(0,t).map(e=>e.segment).join(""):e.slice(0,t)}n.d(t,{Hd:()=>a,Js:()=>l,_J:()=>s})},35521:(e,t,n)=>{"use strict";n.d(t,{f:()=>o});var s=n(37876),a=n(60004),l=n(4292),i=n(34795),r=n(14232);let o=e=>{let{text:t,maxLength:n=100,onTimestampClick:o}=e,[c,d]=(0,r.useState)(!1),w=(0,i._J)(t)>n,u=w&&!c?(0,i.Js)(t,n):t;return(0,s.jsxs)("p",{className:"tw-whitespace-pre-wrap tw-break-all tw-text-[15px] tw-leading-[160%] tw-text-neutral-bright sp:tw-text-[13px] sp:tw-leading-[160%]",children:[(0,s.jsx)(a.S,{useRedirect:!0,onTimestampClick:o,children:u}),w&&!c&&"...",w&&(0,s.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),d(e=>!e)},className:"tw-ml-2 tw-inline-flex tw-items-center tw-gap-1 tw-text-sm tw-text-neutral-pale hover:tw-text-neutral-bright",children:[(0,s.jsx)(l.In,{icon:c?"ph:caret-up-fill":"ph:caret-down-fill",className:"tw-h-3 tw-w-3"}),(0,s.jsx)("span",{children:c?"ä¸é¨è¡¨ç¤ºã«æ»ã":"ãã£ã¨è¦ã"})]})]})}},38019:(e,t,n)=>{"use strict";n.d(t,{Du:()=>a,TE:()=>l,Vb:()=>i,sW:()=>s});let s="anchor-quiz",a={quiz:"quiz"},l={[a.quiz]:s},i=(e,t)=>"/movie/".concat(e,"?anchor=").concat(t)},39922:(e,t,n)=>{"use strict";n.d(t,{e:()=>a,m:()=>s});let s=e=>{var t;return(null!=(t=JSON.stringify(e))?t:"null").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")},a=e=>{if(!Number.isFinite(e)||e<=0)return;let t=Math.floor(e),n=Math.floor(t/3600),s=Math.floor(t%3600/60),a=t%60,l=[n>0?"".concat(n,"H"):"",s>0?"".concat(s,"M"):"",a>0?"".concat(a,"S"):""].join("");return"PT".concat(l)}},41889:(e,t,n)=>{"use strict";n.d(t,{$:()=>o,F:()=>r});var s=n(37876),a=n(21257),l=n(14258),i=n(14232);let r=i.forwardRef((e,t)=>{let{className:n,children:i,...r}=e;return(0,s.jsxs)(l.bL,{ref:t,className:(0,a.cn)("tw-relative tw-overflow-hidden",n),...r,children:[(0,s.jsx)(l.LM,{className:"tw-h-full tw-w-full tw-rounded-[inherit]",children:i}),(0,s.jsx)(o,{}),(0,s.jsx)(l.OK,{})]})});r.displayName=l.bL.displayName;let o=i.forwardRef((e,t)=>{let{className:n,orientation:i="vertical",...r}=e;return(0,s.jsx)(l.VM,{ref:t,orientation:i,className:(0,a.cn)("tw-flex tw-touch-none tw-select-none tw-transition-colors","vertical"===i&&"tw-h-full tw-w-2.5 tw-border-l tw-border-l-transparent tw-p-[1px]","horizontal"===i&&"tw-h-2.5 tw-flex-col tw-border-t tw-border-t-transparent tw-p-[1px]",n),...r,children:(0,s.jsx)(l.lr,{className:"tw-relative tw-flex-1 tw-rounded-full tw-bg-neutral-middle"})})});o.displayName=l.VM.displayName}
1,47193:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s,a,l=n(14232);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(null,arguments)}let r=function(e){return l.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),s||(s=l.createElement("circle",{cx:12,cy:12,r:9.5,stroke:"#CD1CF9"})),a||(a=l.createElement("circle",{cx:12,cy:12,r:5,fill:"#CD1CF9"})))}},56405:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var s=n(14232);let a="signupModalNextDisplayTimestamp",l=()=>{let[e,t]=(0,s.useState)(()=>{try{let e=window.localStorage.getItem(a);if(isNaN(Number(e)))return 0;return e?parseInt(e,10):0}catch(e){return console.error("Failed to get timestamp from localStorage",e),0}});return[e,e=>{try{t(e),window.localStorage.setItem(a,e.toString())}catch(e){console.error("Failed to set timestamp in localStorage",e)}}]}},61699:(e,t,n)=>{"use strict";n.d(t,{C:()=>a,g:()=>s});let s=e=>{let t=Math.floor(e/3600),n=Math.floor(e%3600/60).toString().padStart(2,"0"),s=(e%60).toString().padStart(2,"0");return t>0?"".concat(t,":").concat(n,":").concat(s):"".concat(n,":").concat(s)},a=e=>{var t;return null!=(t=e.trim().split("\n")[0])?t:""}},62960:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__N_SSP:()=>nL,default:()=>n_});var s=n(37876),a=n(86492),l=n(38019),i=n(89099),r=n(14232);let o=(0,r.createContext)(null),c=e=>{let{children:t}=e,n=(0,r.useRef)(new Map),a=(0,r.useCallback)((e,t)=>(n.current.set(e,t),()=>{n.current.get(e)===t&&n.current.delete(e)}),[]),l=(0,r.useCallback)(e=>{var t;null==(t=n.current.get(e))||t()},[]),i=(0,r.useMemo)(()=>({register:a,trigger:l}),[a,l]);return(0,s.jsx)(o.Provider,{value:i,children:t})},d=()=>{let e=(0,r.useContext)(o);if(!e)throw Error("useEpisodeDetailActions must be used within EpisodeDetailActionsProvider");return e},w=(e,t)=>{let{register:n}=d();(0,r.useEffect)(()=>n(e,t),[n,e,t])};var u=n(28793),m=n(85509),p=n(22788),x=n(73853),h=n(20300),g=n(77659);let b=(e,t)=>{var n;let s=e.findIndex(e=>e.id===t);return -1===s||s>=e.length-1?null:null!=(n=e[s+1])?n:null};var f=n(74359),j=n(71288),v=n(67267),y=n(83665),N=n(27022),k=n(81641),C=n(1343),S=n(74447),I=n(14070),E=n(49992),R=n(30510),T=n(29910),z=n(74859),M=n(33146),q=n(86430);let A=async e=>{var t,n;let{episodeId:s}=e,a=await (0,M.Jt)((0,M.VY)("/chapter/user_rating?episode_id=".concat(s)),q.Xt.Response.Chapter.GetUserRatingResponse.decode);if(a.error)throw Error(a.error.message);if(!a.data)throw Error("No data returned");return{episodeId:a.data.episodeId,ratingValue:null!=(n=null==(t=a.data.rating)?void 0:t.value)?n:void 0}},B=async e=>{let{episodeId:t,ratingValue:n,displayType:s}=e,a=new FormData;a.append("episode_id",String(t)),a.append("rating_value",String(n)),a.append("display_type",s);let l=await (0,M.YP)((0,M.VY)("/chapter/user_rating"),a,q.Xt.Response.Chapter.RegisterUserRatingResponse.decode);if(l.error)throw Error(l.error.message);if(!l.data)throw Error("No data received")};var L=n(95848),_=n(55770),P=n(63372),F=n(10213),U=n(79106),D=n(80634),O=n(26716),Q=n(67768),K=n(40097),V=n(59688),W=n(5746),X=n(36814),$=n(42555),Z=n(4292);let H=e=>{let{onSubmit:t,defaultValue:n,...a}=e,[l,i]=(0,r.useState)(n);(0,r.useEffect)(()=>{i(n)},[n]);let o=async()=>{void 0!==l&&(await t(l),a.close())};return(0,s.jsx)($.RF,{mode:"contextual",layer:$.Of.RATE,...a,onClose:()=>{var e;null==(e=a.onClose)||e.call(a),i(void 0)},children:(0,s.jsx)($.sL,{children:(0,s.jsxs)(T.B,{align:"center",spacing:"lg",className:"tw-w-full",children:[(0,s.jsx)($.N5,{className:"tw-text-base tw-font-bold tw-text-neutral-bright",children:"ã³ã³ãã³ããè©ä¾¡ãã"}),(0,s.jsxs)(T.B,{align:"center",spacing:"sm",children:[(0,s.jsx)(X.z,{align:"center",justify:"center",children:[1,2,3,4,5].map(e=>(0,s.jsx)(Z.In,{icon:"ic:baseline-star",role:"button",className:void 0!==l&&e<=l?"tw-h-12 tw-w-12 tw-text-accent-brand-main":"tw-h-12 tw-w-12 tw-text-[#505A67]",onClick:()=>{i(e)}},e))}),(0,s.jsx)($.Hq,{className:"tw-text-sm tw-text-neutral-pale",children:"ã¯ãªãã¯ãã¦è©ä¾¡ãã¦ãã ãã"})]}),(0,s.jsx)(W.$,{variant:"primary",onClick:o,disabled:void 0===l,children:"éä¿¡ãã"})]})})})};var G=n(90924),Y=n(21257);let J=e=>
1{let{variant:t,watchLater:n,rating:a,share:l,articleBackgroundMode:i,tocSummary:r,onShowInstallModal:o,onShowMembershipModal:c,spLeadingSlot:d}=e,w="sp"===t;if(w){let e=n.isSignedIn?n.onClick:n.onShowInstallModal,t=[{key:"rate",icon:a.isAlreadyRated?"material-symbols:star":"material-symbols:star-outline",label:"è©ä¾¡",onClick:a.isRatable?a.onOpen:void 0,disabled:!a.isRatable||!a.isAlreadyRated&&!a.isViewedEnoughToRate},{key:"save",icon:n.isInWatchLater?"material-symbols:bookmark":"material-symbols:bookmark-outline",label:"ä¿å",onClick:e},{key:"download",icon:"material-symbols:download-for-offline-outline",label:"ãã¦ã³ãã¼ã",onClick:o},{key:"share",icon:"material-symbols:ios-share",label:"å
±æ",onClick:l.showNative?l.onShare:l.onCopyUrl}];return(0,s.jsxs)("div",{className:"tw-flex tw-w-full tw-items-center tw-gap-2 tw-overflow-x-auto tw-px-3 [scrollbar-width:none]",children:[d&&(0,s.jsx)("div",{className:"tw-shrink-0",children:d}),t.map(e=>(0,s.jsxs)("button",{type:"button",onClick:e.onClick,disabled:e.disabled,className:"tw-flex tw-h-8 tw-shrink-0 tw-items-center tw-gap-1 tw-rounded-full tw-bg-neutral-night tw-pl-1.5 tw-pr-3 tw-text-[11px] tw-font-bold tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-80 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",children:[(0,s.jsx)(Z.In,{icon:e.icon,className:"tw-h-5 tw-w-5"}),e.label]},e.key))]})}return(0,s.jsxs)(X.z,{spacing:"sm",justify:"end",align:"center",children:[a.isAlreadyRated?(0,s.jsx)(ee,{icon:"ic:baseline-star",label:"è©ä¾¡",onClick:a.isRatable?a.onOpen:void 0,disabled:!a.isRatable,iconClassName:"tw-p-0.5"}):(0,s.jsxs)(G.m_,{children:[(0,s.jsx)(G.k$,{asChild:!0,children:(0,s.jsx)(et,{icon:"ic:baseline-star-border",label:"è©ä¾¡",onClick:a.isRatable&&a.isViewedEnoughToRate?a.onOpen:void 0,disabled:!a.isRatable||!a.isViewedEnoughToRate,iconClassName:"tw-p-0.5"})}),(0,s.jsx)(G.ZI,{children:a.isRatable&&!a.isViewedEnoughToRate?"åç»ãåçããã¨è©ä¾¡ãã§ããããã«ãªãã¾ã":"è©ä¾¡"})]}),(0,s.jsx)(ee,{icon:n.isInWatchLater?"ic:round-bookmark":"ic:round-bookmark-border",label:"ä¿å",onClick:n.isSignedIn?n.onClick:w?n.onShowInstallModal:n.onShowMembershipModal,iconClassName:"tw-p-0.5"}),l.showNative?(0,s.jsx)(ee,{icon:"ic:baseline-ios-share",label:"ã·ã§ã¢",onClick:l.onShare,iconClassName:"tw-p-0.5"}):(0,s.jsx)(ee,{icon:"ic:baseline-insert-link",label:"ãªã³ã¯ãã³ãã¼",onClick:l.onCopyUrl,iconClassName:"tw--rotate-45 tw-p-0.5"}),r&&(0,s.jsx)(ee,{icon:"ic:outline-edit-note",label:"ç« ãã¨ã®è¦ç¹",onClick:r.onClick,iconClassName:"tw-p-0.5"}),(0,O.gm)(i.displayType)&&(0,s.jsx)(ee,{icon:"light"===i.backgroundMode?"ic:baseline-dark-mode":"ic:baseline-light-mode",label:"light"===i.backgroundMode?"ãã¼ã¯":"ã©ã¤ã",onClick:i.onToggle,iconClassName:"tw-p-0.5"})]})},ee=e=>(0,s.jsxs)(G.m_,{children:[(0,s.jsx)(G.k$,{asChild:!0,children:(0,s.jsx)(et,{...e})}),(0,s.jsx)(G.ZI,{children:e.label})]}),et=(0,r.forwardRef)((e,t)=>{let{onClick:n,disabled:a,icon:l,label:i,iconClassName:r,labelClassName:o,...c}=e;return(0,s.jsxs)(X.z,{as:"button",type:"button",align:"center",spacing:"xs",width:"auto",className:(0,Y.cn)("tw-h-10 tw-shrink-0 tw-rounded-full tw-pl-2 tw-pr-4 tw-transition-colors focus-visible:tw-outline-none focus-visible:tw-ring-2 focus-visible:tw-ring-ring focus-visible:tw-ring-offset-2",a?"tw-cursor-not-allowed tw-bg-neutral-night/50":"tw-bg-neutral-night hover:tw-bg-neutral-middle/40"),onClick:a?void 0:n,"aria-disabled":a,"aria-label":i,ref:t,...c,children:[(0,s.jsx)(Z.In,{icon:l,className:(0,Y.cn)("tw-h-6 tw-w-6 tw-text-neutral-bright",r,{"tw-text-neutral-bright/50":a})}),(0,s.jsx)("span",{className:(0,Y.cn)("tw-whitespace-nowrap tw-text-xs tw-font-bold tw-text-neutral-bright",o,a&&"tw-text-neutral-bright/50"),children:i})]})});et.displayName="ActionButton";let en=e=>{var t,n;let{variant:a,displayType:l,episodeId:i,onClickAppInstallLink:o,articleBackgroundMode:c,onToggleArticleBackgroundMode:d,onShowInstallModal:w,spLeadingSlot:u}=e,{isSignedIn:h}=(0,y.Z2)(),g="sp"===a,b=(0,Q.jE)(),{currentTime:j,isPlayingAds:v}=(0,m.m)(),N=null!=c?c:"light",{data:C}=(0,f.I)((0,p.F)({episodeId:i})),{data:S}=(0,f.I)({queryKey:x.e.getUserEpisodeRating({episodeId:i}),queryFn:()=>A({episodeId:i}),enabled:h}),I=(0,r.useMemo)(()=>{let e="".concat(F.uP,"/app/movie/").concat(i);try{let t=new URL(e);
1return new URLSearchParams(window.location.search).forEach((e,n)=>{t.searchParams.set(n,e)}),t.toString()}catch(t){return e}},[i]),E=(0,r.useMemo)(()=>{var e,t;return{title:null!=(e=null==C?void 0:C.title)?e:"",text:null!=(t=null==C?void 0:C.description)?t:"",url:I}},[C,I]),T=(0,r.useMemo)(()=>!!E.url&&("localhost"===window.location.hostname||"undefined"!=typeof navigator&&void 0!==navigator.share&&void 0!==navigator.canShare&&navigator.canShare(E))&&g,[E,g]),z=(0,L.bP)(),M=(0,L.bP)(),q=(0,L.bP)(),W=(0,r.useCallback)(()=>{if(!C||!d)return;let e="dark"===N?"light":"dark";d(),k.h.sendChangeArticleBackground({to:e,episodeId:C.id,episodeName:C.title})},[d,N,C]),X=(0,r.useCallback)(()=>{q.open(),null==w||w()},[q,w]),$=(0,r.useCallback)(()=>{g&&X()},[g,X]),{isInWatchLater:Z,isTogglingWatchLater:G,isSaveDialogOpen:Y,onSaveDialogOpenChange:ee,handleToggleWatchLater:et,handleAddToPlaylist:en,handleRemoveFromPlaylist:es,handleCreatePlaylist:ea,handleToggleWatchLaterForDialog:el}=(0,D.M)({episodeId:i,episodeName:null!=(t=null==C?void 0:C.title)?t:"",fetchStatusOnMount:!0}),ei=(0,K.n)({mutationFn:e=>{if(!C)throw Error("episodeDetail not loaded");return B({episodeId:C.id,ratingValue:e,displayType:l})},onSuccess:async(e,t)=>{if(!C)return;let n=(0,O.I8)(j,C.durationSeconds);k.h.sendRateEpisode({episodeId:C.id,episodeName:C.title,value:t,type:l,episodeUserStateRatio:n,isPlayingAds:v}),V.oR.success("è©ä¾¡ãæ´æ°ãã¾ãã"),b.invalidateQueries({queryKey:["getEpisodeDetail"]})},onError:e=>{V.oR.error((0,P.Bf)(e,"è©ä¾¡ã®æ´æ°ã«å¤±æãã¾ãã"))}}),er=void 0!==S&&void 0!==S.ratingValue,eo=null!=(n=null==C?void 0:C.program.isSponsored)&&n,ec=!eo,ed="article"===l||j>=1,ew=async e=>{h&&await ei.mutateAsync(e)},eu=async()=>{if(T&&E.url&&C)try{await navigator.share(E),k.h.sendShareEpisode({episodeId:C.id,episodeName:C.title,displayType:l})}catch(e){console.error("Error sharing:",e)}},em=async()=>{if(!I)return void V.oR.error("å
±æå¯è½ãªURLãè¦ã¤ããã¾ããã§ãã");if("undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText){try{await navigator.clipboard.writeText(I),V.oR.success("URLãã³ãã¼ãã¾ãã")}catch(e){console.error("Failed to copy URL via clipboard API:",e),V.oR.error("URLã®ã³ãã¼ã«å¤±æãã¾ãã")}return}V.oR.error("URLã®ã³ãã¼ã«å¤±æãã¾ãã")};return C?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(J,{variant:a,watchLater:{isSignedIn:h,isInWatchLater:Z,onClick:()=>{if(eo&&!h)return void M.open();G||et()},onShowInstallModal:X,onShowMembershipModal:M.open},rating:{isRatable:ec,isAlreadyRated:er,isViewedEnoughToRate:ed,onOpen:()=>{if(ec){if(!h)return void M.open();z.open()}}},share:{showNative:T,onShare:eu,onCopyUrl:em},articleBackgroundMode:{displayType:l,backgroundMode:N,onToggle:W},tocSummary:g?{onClick:$}:void 0,onShowInstallModal:X,onShowMembershipModal:M.open,spLeadingSlot:u}),ec&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(H,{...z,onSubmit:ew,defaultValue:null==S?void 0:S.ratingValue}),g?(0,s.jsx)(_.t,{...M}):(0,s.jsx)(R.b,{...M})]}),(0,s.jsx)(_.t,{...q}),(0,s.jsx)(U.L,{isOpen:Y,onOpenChange:ee,episodeId:i,onToggleWatchLater:el,onAddToPlaylist:en,onRemoveFromPlaylist:es,onCreatePlaylist:ea})]}):null},es=async e=>{var t,n;let{episodeId:s}=e,a=await (0,M.Jt)((0,M.VY)("/chapter/rating_summary?episode_id=".concat(s)),q.Xt.Response.Chapter.GetRatingSummaryResponse.decode);if(a.error)throw Error(a.error.message);if(!a.data)throw Error("No data returned");return{episodeId:a.data.episodeId,averageRating:null!=(t=a.data.averageRating)?t:0,ratingCount:null!=(n=a.data.ratingCount)?n:0}};var ea=n(28039),el=n(85270),ei=n(33525),er=n(56075),eo=n(62914),ec=n(89055),ed=n(45868),ew=n(23678),eu=n(60004),em=n(5412);let ep=e=>{let{episodeRating:t}=e,{averageRating:n,ratingCount:a}=t;return(0,s.jsxs)(X.z,{spacing:"xs",width:"auto",align:"center",justify:"start",children:[(0,s.jsx)(em.G,{ratingValue:n}),(0,s.jsxs)(z.E,{size:"S",className:"tw-text-neutral-pale",children:["(",a,")"]})]})};var ex=n(82159),eh=n(76112),eg=n(54587),eb=n.n(eg),ef=n(48230),ej=n.n(ef);let ev=e=>
1{let{episodeDetail:t,viewCount:n,episodeRating:a,isRatableEpisode:l,onTimestampClick:i,isOpen:r,onOpenChange:o}=e;return(0,s.jsx)($.RF,{mode:"bottom-sheet",layer:$.Of.CONTEXT,isOpen:r,onOpenChange:o,open:()=>o(!0),close:()=>o(!1),children:(0,s.jsxs)($.sL,{children:[(0,s.jsx)($.N5,{className:"tw-text-center tw-text-base tw-font-bold tw-text-neutral-bright",children:"ãã®åç»ã«ã¤ãã¦"}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-pt-4",children:[(0,s.jsx)(z.E,{className:"tw-text-base tw-font-bold tw-text-neutral-bright",children:t.title}),(0,s.jsxs)("div",{className:"tw-flex tw-flex-wrap tw-items-center tw-gap-1 tw-text-xs tw-text-neutral-bright",children:[void 0!==n&&(0,s.jsxs)("span",{children:[(0,ex.S)(n),"åè¦è´"]}),l&&a&&(0,s.jsx)(ep,{episodeRating:a}),(0,s.jsx)("span",{children:(0,eh.Zq)(t.publishTime)})]}),(0,s.jsx)(z.E,{className:"tw-whitespace-pre-wrap tw-break-words tw-text-[14px] tw-leading-[1.6] tw-text-neutral-bright",children:(0,s.jsx)(eu.S,{onTimestampClick:i,children:t.description})}),t.casts.length>0&&(0,s.jsxs)(T.B,{spacing:"sm",children:[(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1 tw-text-sm tw-text-neutral-bright",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:person-outline",width:20}),"åºæ¼è
"]}),t.casts.map(e=>(0,s.jsx)(ej(),{href:"/episode/cast?cast_id=".concat(e.id),className:"tw-text-sm tw-font-bold tw-text-neutral-bright tw-no-underline hover:tw-underline",children:e.name},e.id))]}),t.mcs.length>0&&(0,s.jsxs)(T.B,{spacing:"sm",children:[(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1 tw-text-sm tw-text-neutral-bright",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:mic-outline",width:20}),"MC"]}),t.mcs.map(e=>(0,s.jsxs)(ej(),{href:"/mc/".concat(e.id),className:"tw-flex tw-items-center tw-gap-2 tw-no-underline hover:tw-opacity-80",children:[e.avatarUrl&&(0,s.jsx)(eb(),{src:e.avatarUrl,alt:e.name,width:32,height:32,unoptimized:!0,className:"tw-h-8 tw-w-8 tw-shrink-0 tw-rounded-full tw-object-cover"}),(0,s.jsx)("span",{className:"tw-text-sm tw-font-bold tw-text-neutral-bright",children:e.name})]},e.id))]})]})]})})},ey=e=>{var t;let{variant:n,episodeDetail:a,viewCount:l,episodeRating:i,isRatableEpisode:o,onClickAppInstallLink:c,onTimestampClick:d,screenName:w,titleSideActionsSlot:u,programRowSlot:m}=e,p="sp"===n,[x,h]=(0,r.useState)(!1),g=(0,s.jsxs)(X.z,{spacing:"xs",align:"center",children:[o&&i&&(0,s.jsx)(ep,{episodeRating:i}),void 0!==l&&(0,s.jsxs)(z.E,{size:"S",className:"tw-text-neutral-pale",children:[(0,ex.S)(l),"åè¦è´"]}),(0,s.jsx)(z.E,{size:"S",className:"tw-text-neutral-pale",children:(0,eh.Zq)(a.publishTime)})]}),b=(0,s.jsxs)(T.B,{spacing:"sm",children:[(0,s.jsxs)("div",{className:"tw-flex tw-w-full tw-min-w-0 tw-items-center tw-gap-2",children:[(0,s.jsxs)(X.z,{spacing:"xs",align:"center",className:"tw-shrink-0",width:"auto",children:[void 0!==l&&(0,s.jsxs)(z.E,{size:"S",className:"tw-whitespace-nowrap tw-text-neutral-pale",children:[(0,ex.S)(l),"åè¦è´"]}),o&&i&&(0,s.jsx)(ep,{episodeRating:i}),(0,s.jsx)(z.E,{size:"S",className:"tw-whitespace-nowrap tw-text-neutral-pale",children:(0,eh.VI)(a.publishTime)})]}),(0,s.jsxs)("div",{className:"tw-flex tw-min-w-0 tw-flex-1 tw-items-center tw-gap-0",children:[(0,s.jsx)(z.E,{className:"tw-min-w-0 tw-flex-1 tw-truncate tw-text-neutral-pale sp:tw-text-[14px]",children:(0,s.jsx)(eu.S,{onTimestampClick:d,children:a.description})}),(0,s.jsx)("button",{type:"button",onClick:()=>h(!0),className:"tw-flex tw-shrink-0 tw-items-center tw-text-neutral-pale tw-transition-colors hover:tw-text-neutral-bright sp:tw-text-[14px]","aria-label":"ãã£ã¨è¦ãï¼å
¨ã¦ã®æ¦è¦ã表示ï¼",children:"ãã£ã¨è¦ã"})]})]}),(0,s.jsx)(ev,{episodeDetail:a,viewCount:l,episodeRating:i,isRatableEpisode:o,onTimestampClick:d,isOpen:x,onOpenChange:h})]}),f=a.casts.length>0||a.mcs.length>0?(0,s.jsxs)("div",{className:"tw-flex tw-flex-wrap tw-items-center tw-gap-2",children:[a.casts.length>0&&(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:person-outline",className:"tw-text-neutral-pale",width:16,height:16}),(0,s.jsx)("div",{className:"tw-flex tw-flex-wrap tw-items-center",children:a.casts.map((e,t)=>(0,s.jsxs)("div",{className:"tw-flex tw-items-center",children:[t>0&&(0,s.jsx)(z.E,{size:"XS",className:"tw-mx-0.5 tw-select-none tw-leading-none tw-text-neutral-pale",children:"ï½"}),(0,s.jsx)(ej(),{href:"/episode/cast?cast_id=".concat(e.id),className:"tw-no-underline hover:tw-underline",children:(0,s.jsx)(z.E,{size:"S",className:"tw-leading-none tw-text-neutral-bright",children:e.name})})]},e.id))})]}),a.mcs.length>0&&(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:mic-outline",className:"tw-text-neutral-pale",width:16,height:16}),(0,s.jsx)("div",{className:"tw-flex tw-flex-wrap tw-items-center",children:a.mcs.map((e,t)=>(0,s.jsxs)("div",{className:"tw-flex tw-items-center",children:[t>0&&(0,s.jsx)(z.E,{size:"XS",className:"tw-mx-0.5 tw-select-none tw-leading-none tw-text-neutral-pale",children:"ï½"}),(0,s.jsx)(ej(),{href:"/mc/".concat(e.id),className:"tw-no-underline hover:tw-underline",children:(0,s.jsx)(z.E,{size:"S",className:"tw-leading-none tw-text-neutral-bright",children:e.name})})]},e.id))})]})]}):null,j=(0,s.jsx)(ec.N,{description:a.description,onTimestampClick:d});return(0,s.jsxs)(T.B,{spacing:p?"sm":"md",className:"tw-px-6 sp:tw-px-3",children:[(0,s.jsxs)(T.B,{spacing:"sm",children:[!p&&
1!m&&(0,s.jsx)(X.z,{className:"tw-h-5",spacing:"sm",align:"center",children:(0,s.jsx)(ej(),{href:"/program/".concat(a.program.id),onClick:()=>{k.h.sendSelectProgram({screenName:w,programId:a.program.id,programName:a.program.name,sectionName:"ã¨ãã½ã¼ãæ
å ±",index:0})},children:(0,s.jsx)(z.E,{size:"S",children:a.program.name})})}),m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ed.D,{as:"h1",className:"sp:tw-text-[16px]",children:a.title}),!p&&(0,s.jsxs)(X.z,{spacing:"lg",align:"center",justify:"between",className:"tw-w-full",children:[(0,s.jsx)("div",{className:"tw-min-w-0 tw-flex-1",children:m}),u&&(0,s.jsx)("div",{className:"tw-shrink-0",children:u})]})]}):u?(0,s.jsxs)(X.z,{spacing:"lg",align:"start",className:"tw-w-full sp:tw-flex-col sp:tw-items-stretch",children:[(0,s.jsx)(ed.D,{as:"h1",className:"tw-min-w-0 tw-flex-1 sp:tw-text-[16px]",children:a.title}),(0,s.jsx)("div",{className:"tw-shrink-0",children:u})]}):(0,s.jsx)(ed.D,{as:"h1",className:"sp:tw-text-[16px]",children:a.title}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(T.B,{spacing:"sm",children:b}),(a.casts.length>0||a.mcs.length>0)&&(0,s.jsxs)("nav",{"aria-label":"åºæ¼è
ã»MC",className:"tw-sr-only",children:[a.casts.map(e=>(0,s.jsx)(ej(),{href:"/episode/cast?cast_id=".concat(e.id),tabIndex:-1,children:e.name},"cast-".concat(e.id))),a.mcs.map(e=>(0,s.jsx)(ej(),{href:"/mc/".concat(e.id),tabIndex:-1,children:e.name},"mc-".concat(e.id)))]})]})]}),!p&&(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-rounded-lg tw-border tw-border-solid tw-border-neutral-night tw-bg-neutral-dark tw-p-4",children:[g,f,j]}),(null==(t=a.externalLink)?void 0:t.url)&&(0,s.jsx)(ew._,{color:"white",isExternal:!0,href:a.externalLink.url,children:(0,s.jsxs)(X.z,{spacing:"sm",width:"auto",align:"center",children:[(0,s.jsx)(Z.In,{icon:"ic:baseline-insert-link",className:"tw-shrink-0 tw--rotate-45 tw-transform tw-text-neutral-bright",width:20}),(0,s.jsx)(z.E,{className:"tw-break-words tw-text-current",children:a.externalLink.description?a.externalLink.description:"詳細ã¯ãã¡ã"})]})})]})};var eN=n(20844);let ek=e=>{let[t,...n]=e;return t&&t.title.replace(/[\s\u3000]/g,"").includes("ãã¤ã¸ã§ã¹ã")?{digest:t,chapters:n}:{chapters:e}},eC=e=>{var t;let{nextEpisode:n,onPlay:a,onCancel:l}=e,[i,o]=(0,r.useState)(5),c=!!(null==(t=n.thumbnailUrl)?void 0:t.trim());(0,r.useEffect)(()=>{if(i<=0)return void a("auto");let e=window.setTimeout(()=>{o(e=>e-1)},1e3);return()=>{window.clearTimeout(e)}},[i,a]);let d=(0,r.useCallback)(()=>{a("manual")},[a]);return(0,s.jsx)("div",{className:"tw-absolute tw-inset-0 tw-z-10 tw-flex tw-items-center tw-justify-center tw-bg-black/80 tw-p-6 sp:tw-p-4",children:(0,s.jsxs)("div",{className:"tw-flex tw-w-full tw-max-w-[480px] tw-flex-col tw-gap-4",children:[(0,s.jsxs)("p",{className:"tw-text-[13px] tw-text-neutral-pale",children:[i," ç§å¾ã«æ¬¡ã®åç»ãåç"]}),(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[c&&(0,s.jsx)(ei.V,{src:n.thumbnailUrl,alt:n.title,aspectRatio:"wide",className:"tw-w-[160px] tw-shrink-0 sp:tw-w-[120px]"}),(0,s.jsx)("p",{className:"tw-line-clamp-2 tw-text-sm tw-font-bold tw-leading-snug tw-text-neutral-bright",children:n.title})]}),(0,s.jsxs)("div",{className:"tw-flex tw-gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:l,className:"tw-flex-1 tw-rounded-full tw-border tw-border-neutral-middle tw-bg-transparent tw-px-4 tw-py-2.5 tw-text-[13px] tw-font-bold tw-text-neutral-bright hover:tw-opacity-80",children:"ãã£ã³ã»ã«"}),(0,s.jsx)("button",{type:"button",onClick:d,className:"tw-flex-1 tw-rounded-full tw-border-none tw-bg-white tw-px-4 tw-py-2.5 tw-text-[13px] tw-font-bold tw-text-[#0E1226] hover:tw-opacity-80",children:"ä»ããåç"})]})]})})};var eS=n(20039);let eI=e=>{let{onClick:t}=e,[n,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=requestAnimationFrame(()=>a(!0));return()=>cancelAnimationFrame(e)},[]),(0,s.jsxs)("button",{type:"button",onClick:t,className:"tw-relative tw-flex tw-items-center tw-gap-1 tw-overflow-hidden tw-rounded-full tw-bg-neutral-night/75 tw-py-2 tw-pl-4 tw-pr-3 tw-text-xs tw-font-bold tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-90",children:[(0,s.jsx)("span",{"aria-hidden":!0,
1className:"tw-absolute tw-inset-y-0 tw-left-0 tw-bg-neutral-bright/20 tw-transition-[width] tw-ease-linear",style:{width:n?"100%":"0%",transitionDuration:"".concat(8e3,"ms")}}),(0,s.jsx)("span",{className:"tw-relative",children:"ãã¤ã¸ã§ã¹ããã¹ããã"}),(0,s.jsx)(Z.In,{icon:"material-symbols:skip-next",width:20,className:"tw-relative tw-shrink-0"})]})};var eE=n(88709);let eR=e=>{let{onRateEpisode:t,onCancelRateEpisode:n}=e,[a,l]=(0,r.useState)(void 0),{isSp:i}=(0,I.P)(),o=async()=>{void 0!==a&&(await t(a),l(void 0))};return(0,s.jsx)(T.B,{className:(0,Y.cn)("tw-absolute tw-inset-0 tw-z-10 tw-h-full tw-w-full tw-bg-neutral-dark/90"),align:"center",justify:"center",children:(0,s.jsxs)(T.B,{className:"tw-max-w-[500px] tw-p-4",spacing:i?"md":"xl",align:"center",justify:"center",children:[(0,s.jsx)(X.z,{align:"center",justify:"center",children:[1,2,3,4,5].map(e=>(0,s.jsx)(Z.In,{icon:"ic:baseline-star",role:"button",className:(0,Y.cn)("tw-h-14 tw-w-14","sp:tw-h-10 sp:tw-w-10",void 0!==a&&e<=a?"tw-text-accent-brand-main":"tw-text-[#505A67]"),onClick:()=>l(e)},e))}),(0,s.jsx)(z.E,{size:i?"M":"L",align:"center",children:"ãã®ã³ã³ãã³ãã¯ãããã§ãããï¼"}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-w-full",children:[(0,s.jsx)(W.$,{variant:"primary",size:i?"small":"medium",onClick:o,disabled:void 0===a,children:"éä¿¡ãã"}),(0,s.jsx)(W.$,{variant:"link",size:i?"small":"medium",className:"tw-text-neutral-pale",onClick:()=>{l(void 0),n()},children:"ä»ã¯è©ä¾¡ããªã"})]})]})})},eT=e=>{let{episodeDetail:t,playbackPositionSeconds:n,isSignedIn:a,userId:l,isRatableEpisode:i,isAlreadyRated:o,onClickAppInstallLink:c,onShowInstallModal:d,onReachViewingThreshold:w,onRateEpisode:u,onAdPlayingStatusChange:p,seekToSeconds:h,onRequestSeek:g,nextEpisode:b,onPlayNext:j}=e,{isSp:v}=(0,I.P)(),{isDigestSkipVisible:y,handleDigestSkip:N}=(e=>{let{episodeId:t,episodeName:n,onSeek:s,externalSeekSeconds:a}=e,{currentTime:l,isPlayingAds:i}=(0,m.m)(),{data:o}=(0,f.I)({queryKey:x.e.listTocSummaries({episodeId:t}),queryFn:()=>(0,eN.b)({episodeId:t}),enabled:l>0}),c=(0,r.useMemo)(()=>(e=>{let{digest:t,chapters:n}=ek(e),s=n[0];if(t&&s)return{startSeconds:t.startSeconds,endSeconds:t.endSeconds,skipToSeconds:s.startSeconds}})(null!=o?o:[]),[o]),[d,w]=(0,r.useState)(!1),u=(0,r.useRef)(!1),p=(0,r.useRef)(!1),h=(0,r.useRef)(0),g=(0,r.useRef)(void 0),b=(0,r.useRef)([]);(0,r.useEffect)(()=>{void 0!==a&&b.current.push(a)},[a]);let j=(0,r.useCallback)(()=>{void 0!==g.current&&(clearTimeout(g.current),g.current=void 0),w(!1)},[]),v=(0,r.useCallback)(()=>{c&&(b.current.push(c.skipToSeconds),s(c.skipToSeconds),j())},[c,s,j]);return(0,r.useEffect)(()=>{let e=h.current;if(h.current=l,!p.current&&e>0&&(e=>{let{prevTime:t,currentTime:n,programmaticSeekTargets:s}=e;return!(3>=Math.abs(n-t))&&!s.some(e=>3>=Math.abs(n-e))})({prevTime:e,currentTime:l,programmaticSeekTargets:b.current})){p.current=!0,j();return}if(d){c&&((e,t)=>t<e.startSeconds||t>=e.endSeconds)(c,l)&&j();return}(e=>{let{info:t,currentTime:n,isPlayingAds:s,state:a}=e;return!!t&&!a.hasShown&&!a.hasUserSeeked&&!s&&!(n<=0)&&n>=t.startSeconds&&n<t.endSeconds})({info:c,currentTime:l,isPlayingAds:i,state:{hasShown:u.current,hasUserSeeked:p.current}})&&(u.current=!0,w(!0),g.current=setTimeout(()=>j(),8e3))},[l,i,c,d,j]),(0,r.useEffect)(()=>()=>{void 0!==g.current&&clearTimeout(g.current)},[]),{isDigestSkipVisible:d,handleDigestSkip:v}})({episodeId:t.id,episodeName:t.title,onSeek:null!=g?g:()=>{},externalSeekSeconds:h}),[k,C]=(0,r.useState)(!1),[S,E]=(0,r.useState)(!1),[R,z]=(0,r.useState)(!1),M=async e=>{await u(e),C(!1)},q=(0,r.useCallback)(()=>b&&j?void z(!0):v?void E(!0):a&&i?void(!o&&C(!0)):void 0,[b,j,v,a,i,o]),A=(0,r.useCallback)(()=>{c({positionName:"player_end"})},[c]),B=(0,r.useCallback)(()=>{E(!1)},[]);return(0,s.jsx)(T.B,{className:"tw-gap-4 tw-px-6 sp:tw-gap-2 sp:tw-px-0",children:(0,s.jsxs)(T.B,{className:"tw-relative tw-w-full tw-overflow-hidden tw-bg-neutral-dark tw-pt-[56.25%]",children:[(0,s.jsx)("div",{className:"tw-absolute tw-inset-0",children:(0,s.jsx)(eS.A,{episodeDetail
1:t,playbackPositionSeconds:n,isSignedIn:a,userId:l,displayType:"movie",seekToSeconds:h,onClickOverlayButton:()=>c({positionName:"player_overlay"}),onClickCastButton:()=>{d()},onReachViewingThreshold:w,onReachEnd:q,onAdPlayingStatusChange:p,isDisabled:!1})}),!v&&a&&i&&k&&(0,s.jsx)(eR,{onRateEpisode:M,onCancelRateEpisode:()=>C(!1)}),v&&S&&(0,s.jsx)(eE.so,{onClickOverlayButton:A,onClickCloseButton:B}),g&&y&&(0,s.jsx)("div",{className:"tw-absolute tw-bottom-14 tw-right-4 tw-z-10",children:(0,s.jsx)(eI,{onClick:N})}),R&&b&&j&&(0,s.jsx)(eC,{nextEpisode:b,onPlay:j,onCancel:()=>{z(!1),!v&&a&&i&&!o&&C(!0)}})]})})},ez=e=>{let{variant:t,episodeDetail:n,viewCount:a,isRatableEpisode:i,episodeRating:o,episodeUserStateMap:c,isSignedIn:d,userId:w,onReachViewingThreshold:u,onClickAppInstallLink:p,onRateEpisode:x,onTimestampClick:h,initialTimestamp:g,screenName:b,actionButtonsSlot:f,commentPreviewSlot:j,quizSlot:v,spTocSummaryCardSlot:y,titleSideActionsSlot:N,programRowSlot:k,isAlreadyRated:C,onShowInstallModal:S,nextEpisode:I,onPlayNext:E}=e,{currentTime:R,setIsPlayingAds:z}=(0,m.m)(),M="sp"===t,q=(0,r.useMemo)(()=>{var e,t;return null!=(t=null==(e=c.get(n.id))?void 0:e.playbackPositionSeconds)?t:0},[c,n.id]),[A,B]=(0,r.useState)(),L=(0,r.useMemo)(()=>1===n.seriesEpisodes.length&&n.id===n.seriesEpisodes[0].id,[n.id,n.seriesEpisodes]),_=async e=>{await x({ratingValue:e,episodeUserStateSeconds:R,isPlayingAds:!1})},P=(0,r.useCallback)(e=>{h(e),B(e)},[h]);return(0,r.useEffect)(()=>{void 0!==g?B(g):B(void 0)},[g]),(0,s.jsxs)(T.B,{spacing:"lg",className:"sp:tw-gap-4",children:[(0,s.jsx)(eT,{episodeDetail:n,playbackPositionSeconds:q,isSignedIn:d,userId:w,isRatableEpisode:i,isAlreadyRated:null!=C&&C,seekToSeconds:A,onRequestSeek:B,onClickAppInstallLink:p,onShowInstallModal:S,onReachViewingThreshold:u,onRateEpisode:_,onAdPlayingStatusChange:z,nextEpisode:I,onPlayNext:E}),(0,s.jsxs)(T.B,{spacing:"md",children:[(0,s.jsx)(ey,{variant:t,episodeDetail:n,viewCount:a,episodeRating:o,isRatableEpisode:i,onClickAppInstallLink:p,onTimestampClick:P,screenName:b,titleSideActionsSlot:N,programRowSlot:k}),f,M&&y&&(0,s.jsx)(T.B,{className:"tw-px-6 sp:tw-px-3",children:y}),M&&j&&(0,s.jsx)(T.B,{className:"tw-px-6 sp:tw-px-3",children:j}),M&&(0,s.jsx)(T.B,{className:"tw-px-6 sp:tw-px-3",children:(0,s.jsx)(W.$,{className:"tw-w-full",variant:"primary",onClick:()=>p({positionName:"description_area"}),children:"ã¢ããªã§è¦è´ãã"})}),v&&(0,s.jsx)("div",{id:l.sW,className:"tw-w-full tw-scroll-mt-16",children:(0,s.jsx)(T.B,{className:"tw-px-6 sp:tw-px-3",children:v})}),!L&&(0,s.jsx)(T.B,{className:"tw-px-6 sp:tw-px-3",children:(0,s.jsx)(eo._,{episodes:n.seriesEpisodes,episodeUserStateMap:c,playingEpisodeId:n.id,size:M?"XS":"S",withoutDescription:M,withoutRating:!M,showWatchLater:!M,spAppLayout:!0,spacing:M?"sm":"md",eventData:{screenName:"movie",sectionName:"ã¨ãã½ã¼ãä¸è¦§",srcEpisodeId:n.id,srcEpisodeName:n.title}})})]})]})},eM=e=>{let{variant:t,thumbnailUrl:n}=e;return(0,s.jsxs)(T.B,{spacing:"lg",className:"sp:tw-gap-4",children:[(0,s.jsx)("div",{className:"tw-w-full tw-px-6 sp:tw-px-0",children:(0,s.jsx)("div",{className:"tw-relative tw-w-full tw-overflow-hidden tw-bg-neutral-dark tw-pt-[56.25%]",children:n&&(0,s.jsx)("div",{className:"tw-absolute tw-inset-0 tw-z-[1] tw-flex tw-items-center tw-justify-center",children:(0,s.jsx)(ei.V,{src:n,alt:"",aspectRatio:"wide",priority:!0,rounded:!1,sizes:"(max-width: 768px) 100vw, 960px"})})})}),"sp"===t?(0,s.jsx)(eA,{}):(0,s.jsx)(eq,{})]})},eq=()=>(0,s.jsxs)(T.B,{spacing:"md",className:"tw-px-6",children:[(0,s.jsx)(er.E,{className:"tw-h-5 tw-w-32"}),(0,s.jsxs)(X.z,{spacing:"lg",align:"center",justify:"between",className:"tw-w-full",children:[(0,s.jsx)(er.E,{className:"tw-h-7 tw-min-w-0 tw-flex-1"}),(0,s.jsx)(X.z,{spacing:"sm",align:"center",className:"tw-shrink-0",children:Array.from({length:3},(e,t)=>(0,s.jsx)(er.E,{className:"tw-h-11 tw-w-11 tw-rounded-full"},t))})]}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-rounded-lg tw-border tw-border-solid tw-border-neutral-night tw-bg-neutral-dark tw-p-4",children:[(0,s.jsxs)(X.z,{spacing:"sm",align:"center",children:[(0,s.jsx)("div",{className:"tw-flex tw-gap-1",children:Array.from({length:5},(e,t)=>(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-4 tw-rounded-sm"},t))}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-24"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-20"})]}),(0,s.jsxs)(X.z,{spacing:"sm",align:"center",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-16"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-20"})]}),(0,s.jsxs)(T.B,{spacing:"xs",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-full"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-5/6"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-2/3"})]})]})]}),eA=()=>(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-px-3",children:[(0,s.jsx)(er.E,{className:"tw-h-6 tw-w-full"}),(0,s.jsxs)(X.z,{spacing:"sm",align:"center",children:[(0,s.jsx)("div",{className:"tw-flex tw-gap-1",children:Array.from({length:5},(e,t)=>(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-4 tw-rounded-sm"},t))}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-20"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-16"})]}),(0,s.jsxs)(X.z,{spacing:"sm",align:"center",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-16"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-20"})]}),(0,s.jsxs)(X.z,{spacing:"sm",align:"center",className:"tw-pt-1",children:[(0,s.jsx)(er.E,{className:"tw-h-8 tw-flex-1 tw-rounded-full"}),(0,s.jsx)(er.E,{className:"tw-h-8 tw-flex-1 tw-rounded-full"}),(0,s.jsx)(er.E,{className:"tw-h-8 tw-w-8 tw-rounded-full"})]}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-pt-1",children:[(0,s.jsxs)(X.z,{spacing:"sm",children:[(0,s.jsx)(er.E,{className:"tw-h-12 tw-flex-1 tw-rounded-lg"}),(0,s.jsx)(er.E,{className:"tw-h-12 tw-flex-1 tw-rounded-lg"})]}),(0,s.jsxs)(X.z,{spacing:"sm",children:[(0,s.jsx)(er.E,{className:"tw-h-12 tw-flex-1 tw-rounded-lg"}),(0,s.jsx)(er.E,{className:"tw-h-12 tw-flex-1 tw-rounded-lg"})]})]}),(0,s.jsxs)(T.B,{spacing:"xs",className:"tw-pt-1",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-full"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-5/6"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-2/3"})]})]}),eB=e=>{var t,n;let{variant:a,episodeId:l,thumbnailUrl:i,onClickAppInstallLink:o,onTimestampClick:c,initialTimestamp:d,screenName:w,actionButtonsSlot:u,commentPreviewSlot:m,quizSlot:h,spTocSummaryCardSlot:g,titleSideActionsSlot:b,programRowSlot:j,nextEpisode:v,onPlayNext:N}=e,{isSignedIn:C,userData:S}=(0,y.Z2)(),I=(0,Q.jE)(),E=(0,L.bP)(),R=(0,r.useCallback)(()=>{E.open()},[E]),{data:T}=(0,f.I)((0,p.F)({episodeId:l})),{data:z}=(0,f.I)((0,ea.R)({episodeIds:[l]})),M=null==z||null==(t=z.get(l))?void 0:t.viewCount,{data:q}=(0,f.I)({queryKey:x.e.getEpisodeRating({episodeId:l}),queryFn:()=>es({episodeId:l})}),{data:F}=(0,f.I)({queryKey:x.e.getUserEpisodeRating({episodeId:l}),queryFn:()=>A({episodeId:l}),enabled:C}),U=(0,r.useMemo)(()=>{var e;return Array.from(new Set([l,...(null!=(e=null==T?void 0:T.seriesEpisodes)?e:[]).map(e=>e.id)]))},[l,null==T?void 0:T.seriesEpisodes]),D=(null==S?void 0:S.userId)!=null,{data:W}=(0,f.I)({...(0,el.v)({episodeIds:U}),enabled:D,refetchOnMount:"always"}),X=(0,r.useCallback)(async()=>{},[]),$=(0,K.n)({mutationFn:e=>{if(!T)throw Error("episodeDetail not loaded");
1return B({episodeId:T.id,ratingValue:e.ratingValue,displayType:"movie"})},onSuccess:async(e,t)=>{if(!T)return;let n=(0,O.I8)(t.episodeUserStateSeconds,T.durationSeconds);k.h.sendRateEpisode({episodeId:T.id,episodeName:T.title,value:t.ratingValue,type:"movie",episodeUserStateRatio:n,isPlayingAds:t.isPlayingAds}),I.invalidateQueries({queryKey:["getEpisodeDetail"]}),V.oR.success("è©ä¾¡ãæ´æ°ãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"è©ä¾¡ã®æ´æ°ã«å¤±æãã¾ãã"))}}),Z=(0,r.useCallback)(async e=>{C&&(e.ratingValue<1||e.ratingValue>5||await $.mutateAsync(e))},[C,$]),H=void 0!==F&&void 0!==F.ratingValue;if(!T)return(0,s.jsx)(eM,{variant:a,thumbnailUrl:i});let G=!T.program.isSponsored;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ez,{variant:a,episodeDetail:T,viewCount:M,isRatableEpisode:G,episodeRating:q,episodeUserStateMap:null!=W?W:new Map,isSignedIn:C,userId:null!=(n=null==S?void 0:S.userId)?n:0,onReachViewingThreshold:X,onClickAppInstallLink:o,onRateEpisode:Z,onTimestampClick:c,initialTimestamp:d,screenName:w,actionButtonsSlot:u,commentPreviewSlot:m,quizSlot:h,spTocSummaryCardSlot:g,titleSideActionsSlot:b,programRowSlot:j,isAlreadyRated:H,onShowInstallModal:R,nextEpisode:v,onPlayNext:N}),(0,s.jsx)(_.t,{...E})]})};var eL=n(15612);let e_=e=>{if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable},eP=e=>{let{onSwitchToMemoTab:t,onSwitchToCommentTab:n}=e;return(e=>{let{enabled:t,onSwitchToMemoTab:n,onSwitchToCommentTab:s}=e,{trigger:a}=d();(0,r.useEffect)(()=>{if(!t)return;let e=e=>{e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.isComposing||e_(e.target)||("m"===e.key||"M"===e.key?(e.preventDefault(),n(),a("openCreateMemo")):("c"===e.key||"C"===e.key)&&(e.preventDefault(),s(),a("focusCommentComposer")))},l=e=>{if("Escape"!==e.key||e.isComposing)return;let t=document.activeElement;t instanceof HTMLElement&&e_(t)&&t.blur()};return document.addEventListener("keydown",e),document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keydown",l)}},[t,n,s,a])})({enabled:!0,onSwitchToMemoTab:t,onSwitchToCommentTab:n}),null};var eF=n(83258),eU=n(212),eD=n(56405),eO=n(18847),eQ=n.n(eO);let eK=eQ()(()=>Promise.all([n.e(4196),n.e(6188),n.e(7917),n.e(1471)]).then(n.bind(n,940)).then(e=>e.RecommendedPlaylistsContainer),{loadableGenerated:{webpack:()=>[940]},ssr:!1}),eV=eQ()(()=>Promise.all([n.e(4196),n.e(6188),n.e(9233),n.e(5172)]).then(n.bind(n,65172)).then(e=>e.OverallRankingAreaContainer),{loadableGenerated:{webpack:()=>[65172]},ssr:!1}),eW=e=>{let{leftColumnWidthCss:t}=e;return(0,s.jsxs)("div",{className:"sp:tw-w-full",style:t?{width:t}:void 0,children:[(0,s.jsx)(eK,{}),(0,s.jsx)(T.B,{children:(0,s.jsx)(eV,{eventData:{screenName:"movie",homeTab:"movie"},withoutBackground:!0})})]})};var eX=n(15870);let e$=e=>{let{...t}=e,n=(0,i.useRouter)();return(0,s.jsx)($.RF,{mode:"dialog",layer:$.Of.PROFILE_SUGGESTION,...t,children:(0,s.jsxs)($.sL,{children:[(0,s.jsx)($.N5,{children:(0,s.jsx)(eX.s,{children:"ãããã£ã¼ã«è¨å®ãå¿
è¦ã§ã"})}),(0,s.jsx)($.Hq,{children:(0,s.jsx)(eX.s,{children:"ã³ã¡ã³ããæç¨¿ããã«ã¯ãã¢ã«ã¦ã³ãåã®è¨å®ãå¿
è¦ã§ã"})}),(0,s.jsx)(T.B,{align:"center",children:(0,s.jsx)(T.B,{spacing:"lg",align:"center",className:"tw-max-w-100",children:(0,s.jsxs)(T.B,{spacing:"xl",align:"center",children:[(0,s.jsx)($.N5,{asChild:!0,children:(0,s.jsx)(ed.D,{size:"L",align:"center",children:"ãããã£ã¼ã«è¨å®ãå¿
è¦ã§ã"})}),(0,s.jsx)($.Hq,{className:"tw-text-center tw-text-neutral-bright",children:"ã³ã¡ã³ããæç¨¿ããã«ã¯ãã¢ã«ã¦ã³ãåã®è¨å®ãå¿
è¦ã§ãã ãããã£ã¼ã«è¨å®ç»é¢ã§è¨å®ãã¦ãã ããã"}),(0,s.jsxs)(T.B,{spacing:"md",align:"center",children:[(0,s.jsx)(W.$,{variant:"secondary",onClick:()=>{t.close();let e=n.asPath;n.push("/membership/profile?redirect_url=".concat(encodeURIComponent(e)))},children:"ãããã£ã¼ã«è¨å®ã¸"}),(0,s.jsx)(W.$,{variant:"dark",onClick:t.close,children:"ãã£ã³ã»ã«"})]})]})})})]})})};var eZ=n(19596),eH=n(5369);let eG=(e,t)=>{if("COLLAPSED"===e.displayStatus)return e.user.userId!==t;return!1},eY=(e,t)=>
1e.filter(e=>((e,t)=>{if("HIDDEN"===e.displayStatus)return e.user.userId===t;return!0})(e,t));var eJ=n(60568);let e0=e=>{let{comment:t,currentUserId:n,onReport:a,onEdit:l,onDelete:i,className:o}=e,[c,d]=(0,r.useState)(!1),w=n===t.user.userId;return w&&n>0||!w?(0,s.jsxs)(eJ.rI,{open:c,onOpenChange:d,children:[(0,s.jsx)(eJ.ty,{asChild:!0,children:(0,s.jsx)("button",{type:"button",className:(0,Y.cn)("focus:tw-ring-brand-main tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-rounded tw-text-white tw-transition-colors hover:tw-bg-neutral-middle/40 hover:tw-text-white focus:tw-outline-none focus:tw-ring-2",o),"aria-label":"ã³ã¡ã³ãã¡ãã¥ã¼",children:(0,s.jsx)(Z.In,{icon:"material-symbols:more-vert",className:"tw-h-5 tw-w-5"})})}),(0,s.jsx)(eJ.SQ,{align:"end",className:"tw-min-w-[120px]",children:w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eJ._2,{onClick:()=>{l(t),d(!1)},className:"tw-cursor-pointer",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:edit",className:"tw-mr-2 tw-h-4 tw-w-4"}),"ç·¨é"]}),(0,s.jsxs)(eJ._2,{onClick:()=>{i(t),d(!1)},className:"tw-cursor-pointer tw-text-red-400 focus:tw-text-red-400",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:delete",className:"tw-mr-2 tw-h-4 tw-w-4"}),"åé¤"]})]}):(0,s.jsxs)(eJ._2,{onClick:()=>{a(),d(!1)},className:"tw-cursor-pointer",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:flag",className:"tw-mr-2 tw-h-4 tw-w-4"}),"å ±å"]})})]}):null};var e1=n(34795),e2=n(13810),e4=n(88992),e3=n(60513);let e6=e3.z.object({text:e3.z.string().trim().refine(e=>(0,e1.Hd)(e)>=10,"ã³ã¡ã³ãã¯".concat(10,"æå以ä¸ã§å
¥åãã¦ãã ãã")).refine(e=>1e3>=(0,e1._J)(e),"ã³ã¡ã³ãã¯".concat(1e3,"æå以å
ã§å
¥åãã¦ãã ãã"))});var e5=n(6230);let e8=e=>{var t,n;let{variant:a,onSubmit:l,onFocus:i,onCancel:o,isSubmitting:c=!1,avatarUrl:d,displayName:w,placeholder:u,initialText:m,showAvatar:p=!0,submitLabel:x,currentTime:h,onInsertTimecode:g,onComposerReady:b}=e,{isSp:f}=(0,I.P)(),j={comment:{textareaClass:"tw-w-full tw-resize-none tw-rounded tw-border-0 tw-bg-neutral-night tw-p-4 tw-text-base tw-leading-[1.6] tw-text-neutral-bright placeholder:tw-text-neutral-middle tw-outline-none tw-transition tw-duration-150",buttonSize:"small",placeholder:"ã³ã¡ã³ãã追å ...",submitLabel:f?"ã³ã¡ã³ã":"ã³ã¡ã³ããã"},reply:{textareaClass:"tw-w-full tw-resize-none tw-rounded tw-border-0 tw-bg-neutral-night tw-p-3 tw-text-base tw-leading-[1.6] tw-text-neutral-bright placeholder:tw-text-neutral-middle tw-outline-none",buttonSize:"xsmall",placeholder:"è¿ä¿¡ã追å ...",submitLabel:"è¿ä¿¡"}}[a],[v,y]=(0,r.useState)(!1),[N,k]=(0,r.useState)(),C=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(b)return b({focus:()=>{let e=0,t=()=>{let n=C.current;if(n&&null!==n.offsetParent)return void n.focus();e++<10&&requestAnimationFrame(t)};requestAnimationFrame(t)}}),()=>b(null)},[b]);let{register:S,handleSubmit:E,reset:R,watch:M,setValue:q,formState:{errors:A,isSubmitting:B}}=(0,e4.mN)({defaultValues:{text:m||""},mode:v?"onChange":"onSubmit",resolver:(0,e2.u)(e6)}),L=S("text"),_=(0,r.useCallback)(()=>{if((!g||!1!==g())&&void 0!==h){var e,t,n;let s=C.current,a=null!=(e=M("text"))?e:"",l=null!=(t=null==s?void 0:s.selectionStart)?t:a.length,i=null!=(n=null==s?void 0:s.selectionEnd)?n:a.length,r=a.slice(0,l),o=a.slice(i),c=(0,eh.rW)(h),d=r.length>0&&!r.endsWith(" "),w=o.length>0&&!o.startsWith(" ");q("text","".concat(r).concat(d?" ":"").concat(c).concat(w?" ":"").concat(o),{shouldDirty:!0,shouldTouch:!0});let u=l+ +!!d+c.length+ +!!w;requestAnimationFrame(()=>{null==s||s.focus(),null==s||s.setSelectionRange(u,u)})}},[h,M,q,g]),P=(0,e1._J)(null!=(n=M("text"))?n:""),F=v?null==(t=A.text)?void 0:t.message:void 0,U=null!=u?u:j.placeholder,D=c||B,O=E((0,r.useCallback)(async e=>{let{text:t}=e;try{var n;if(null==(n=(await (0,eF.Qd)({text:t.trim()})).result)?void 0:n.containsProhibitedTerm)return void k("ä¸é©åãªã¯ã¼ããå«ã¾ãã¦ãã¾ã");k(void 0),await l(t),R(),y(!1)}catch(e){throw y(!0),e}},[l,R]),(0,r.useCallback)(()=>{y(!0)},[])),Q=(0,r.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),O())},[O]),K=(0,r.useCallback)(async()=>{let e=M("text");if(!e||0===e.trim().length)return void k(void 0);try{var t;(null==(t=(await (0,eF.Qd)({text:e.trim()}
1)).result)?void 0:t.containsProhibitedTerm)?k("ä¸é©åãªã¯ã¼ããå«ã¾ãã¦ãã¾ã"):k(void 0)}catch(e){console.warn("Prohibited terms check failed:",e),k(void 0)}},[M]);return(0,s.jsxs)(X.z,{align:"start",spacing:"sm",className:"tw-w-full",children:[p&&(0,s.jsx)(e5.y,{avatarUrl:d,displayName:w,size:"sm"}),(0,s.jsx)("form",{onSubmit:O,className:"tw-flex-1",children:(0,s.jsxs)(T.B,{spacing:"sm",children:[(0,s.jsx)("textarea",{...L,ref:e=>{L.ref(e),C.current=e},onFocus:i,onBlur:K,onKeyDown:Q,placeholder:U,disabled:D,rows:f?1:3,className:(0,Y.cn)(j.textareaClass,"focus:tw-border-accent-brand-secondary",D&&"tw-cursor-not-allowed tw-opacity-60",(F||N)&&"tw-border-functional-orange")}),F&&(0,s.jsx)(z.E,{size:"XS",className:"tw-text-functional-orange",children:F}),N&&(0,s.jsx)(z.E,{size:"XS",className:"tw-text-functional-orange",children:N}),(0,s.jsxs)(X.z,{align:"center",justify:"between",className:"tw-w-full",children:[(0,s.jsx)(z.E,{size:"XS",className:(0,Y.cn)("tw-shrink-0",P>1e3?"tw-text-functional-orange":"tw-text-neutral-pale"),children:"comment"===a?"".concat(P,"/").concat(1e3,"æå"):f?"".concat(P,"æå"):"".concat(P,"/").concat(1e3,"æå")}),(0,s.jsxs)(X.z,{spacing:"sm",justify:"end",align:"center",children:["comment"===a&&(0,s.jsxs)("button",{type:"button",onClick:_,disabled:D||void 0===h,className:"tw-flex tw-shrink-0 tw-items-center tw-gap-1 tw-whitespace-nowrap tw-text-sm tw-leading-tight tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-80 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:add",className:"tw-h-6 tw-w-6"}),"ã¿ã¤ã ã³ã¼ãæ¿å
¥"]}),"reply"===a&&(0,s.jsxs)("button",{type:"button",onClick:_,disabled:D||void 0===h,className:"tw-flex tw-shrink-0 tw-items-center tw-gap-0.5 tw-whitespace-nowrap tw-text-xs tw-leading-tight tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-80 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:add",className:"tw-h-5 tw-w-5"}),"ã¿ã¤ã ã³ã¼ã"]}),o&&(0,s.jsx)(W.$,{type:"button",variant:"dark",size:"xsmall",width:"auto",onClick:o,disabled:D,className:(0,Y.cn)("tw-shrink-0 tw-whitespace-nowrap tw-rounded-full","reply"===a&&"tw-h-7 tw-px-3 tw-text-xs"),children:"ãã£ã³ã»ã«"}),(0,s.jsx)(W.$,{type:"submit",variant:"secondary",size:"xsmall",width:"auto",disabled:D,loading:D,className:(0,Y.cn)("tw-shrink-0 tw-whitespace-nowrap tw-rounded-full","reply"===a&&"tw-h-7 tw-px-3 tw-text-xs"),children:null!=x?x:j.submitLabel})]})]})]})})]})};var e9=n(88212);let e7=e3.z.object({reportCode:e3.z.string().min(1,"å ±åçç±ã鏿ãã¦ãã ãã")}),te=e=>{let{comment:t,reportOptions:n,onSubmit:a,...l}=e,[i,o]=(0,r.useState)(!1),{register:c,handleSubmit:d,formState:{errors:w,isValid:u},watch:m}=(0,e4.mN)({resolver:(0,e2.u)(e7),defaultValues:{reportCode:""}}),p=m("reportCode"),x=async e=>{try{o(!0),await a(t,e.reportCode),l.close()}catch(e){console.error("Failed to report comment:",e),V.oR.error((0,P.Bf)(e,"éå ±ã®éä¿¡ã«å¤±æãã¾ãã"))}finally{o(!1)}};return(0,s.jsx)($.RF,{mode:"dialog",layer:$.Of.REPORT,...l,children:(0,s.jsx)($.sL,{children:(0,s.jsx)("form",{onSubmit:d(x),children:(0,s.jsxs)(T.B,{spacing:"lg",children:[(0,s.jsxs)(T.B,{spacing:"xs",className:"tw-pr-10",children:[(0,s.jsx)($.N5,{asChild:!0,children:(0,s.jsx)(ed.D,{as:"h2",size:"L",weight:"bold",className:"tw-text-white",children:"ã³ã¡ã³ãéåå ±å"})}),(0,s.jsx)($.Hq,{className:"tw-text-sm tw-leading-relaxed tw-text-neutral-pale",children:"ã³ã¡ã³ããããªã·ã¼ã«éåãã¦ããã¨æãçç±ã鏿ããåé¡ç¹ããç¥ãããã ããã"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.E,{size:"S",weight:"bold",className:"tw-mb-4 tw-text-white",children:"å ±åããçç±"}),(0,s.jsx)(T.B,{spacing:"md",children:n.map(e=>(0,s.jsx)(e9.A,{text:e.displayName,value:e.code,checked:p===e.code,registerProps:c("reportCode"),className:"tw-text-white"},e.code))}),w.reportCode&&(0,s.jsx)(z.E,{size:"XS",className:"tw-mt-2 tw-text-red-400",children:w.reportCode.message})]}),(0,s.jsx)(W.$,{type:"submit",variant:"secondary",size:"large",disabled:!u||i,loading:i,className:"tw-w-full",children:"å ±åãã"})]})})})})},tt=e=>{let{children:t}=e,[n,a]=(0,r.useState)(!1);return n?(0,s.jsx)(s.Fragment,{children:t}):(0,s.jsx)("div",{className:"tw-w-full tw-rounded tw-bg-neutral-middle/50 tw-p-3",children:(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-justify-between tw-gap-3",children:[(0,s.jsx)("p",{className:"tw-flex-1 tw-text-sm tw-text-neutral-pale",children:"ãã®ã³ã¡ã³ãã«ã¯ä¸é©åã
1ªå
容ãå«ã¾ãã¦ããå¯è½æ§ãããã¾ãã表示ãã¾ããï¼"}),(0,s.jsx)("button",{type:"button",onClick:()=>{a(!0)},className:"tw-shrink-0 tw-text-sm tw-text-white hover:tw-text-white/80",children:"表示ãã"})]})})};var tn=n(35521);let ts=e=>{let{replies:t,currentUserId:n,reportOptions:a,onRetry:l,isError:i,onToggleLike:r,onReportComment:o,onEditComment:c,onDeleteComment:d,showComposer:w,composer:u,onTimestampClick:m}=e,p=eY(t,n);return i?(0,s.jsxs)(T.B,{spacing:"sm",children:[(0,s.jsx)("p",{className:"tw-text-xs tw-text-functional-orange",children:"è¿ä¿¡ã®èªã¿è¾¼ã¿ã«å¤±æãã¾ããã"}),l&&(0,s.jsxs)(W.$,{variant:"dark",size:"xsmall",width:"auto",onClick:l,children:[(0,s.jsx)(Z.In,{icon:"material-symbols:refresh",className:"tw-mr-1 tw-h-4 tw-w-4"}),"åèªã¿è¾¼ã¿"]})]}):(0,s.jsxs)(T.B,{spacing:"md",children:[w&&u&&(0,s.jsx)(e8,{...u}),p.map(e=>(0,s.jsx)(ta,{reply:e,currentUserId:n,reportOptions:a,onToggleLike:r,onReportComment:o,onEditComment:c,onDeleteComment:d,onTimestampClick:m},e.ulid))]})},ta=e=>{let{reply:t,currentUserId:n,reportOptions:a,onToggleLike:l,onReportComment:i,onEditComment:o,onDeleteComment:c,onTimestampClick:d}=e,w=(0,r.useMemo)(()=>(0,eh.VI)(t.postTime),[t.postTime]),u=(0,L.bP)(),p=(0,L.bP)(),[x,h]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),f=eG(t,n),j=(0,r.useCallback)(()=>{u.open()},[u]),v=(0,r.useCallback)(async(e,t)=>{i(e,t)},[i]),y=(0,r.useCallback)(()=>{h(!0)},[]),N=(0,r.useCallback)(()=>{h(!1)},[]),k=(0,r.useCallback)(async e=>{if(!g){b(!0);try{await o(t,e),h(!1)}catch(e){throw e}finally{b(!1)}}},[o,t,g]),C=(0,r.useCallback)(()=>{p.open()},[p]),S=(0,r.useCallback)(()=>{c(t),p.close()},[c,t,p]),{getCurrentTime:I}=(0,m.m)(),E=I();return(0,s.jsxs)(X.z,{align:"start",spacing:"sm",className:"tw-w-full",children:[(0,s.jsx)(e5.y,{displayName:t.user.displayName,avatarUrl:t.user.avatarUrl,size:"sm"}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-min-w-0 tw-flex-1",children:[(0,s.jsxs)(X.z,{spacing:"sm",align:"center",className:"tw-min-w-0 tw-justify-between",children:[(0,s.jsx)("span",{className:"tw-min-w-0 tw-truncate tw-text-sm tw-font-semibold tw-text-neutral-bright",children:t.user.displayName||"ã²ã¹ã"}),(0,s.jsx)("span",{className:"tw-shrink-0 tw-text-xs tw-text-neutral-pale",children:w}),t.isEdited&&(0,s.jsx)("span",{className:"tw-shrink-0 tw-text-xs tw-text-neutral-pale",children:"(ç·¨éæ¸ã¿)"}),!x&&(0,s.jsx)("div",{className:"tw-ml-auto tw-shrink-0",children:(0,s.jsx)(e0,{comment:t,currentUserId:n,onReport:j,onEdit:y,onDelete:C})})]}),x?(0,s.jsx)(e8,{variant:"reply",initialText:t.text,onSubmit:k,onCancel:N,isSubmitting:g,avatarUrl:t.user.avatarUrl,displayName:t.user.displayName,showAvatar:!1,submitLabel:"ä¿å",currentTime:E}):f?(0,s.jsx)(tt,{children:(0,s.jsx)(tn.f,{text:t.text,onTimestampClick:d})}):(0,s.jsx)(tn.f,{text:t.text,onTimestampClick:d}),!x&&(0,s.jsx)(X.z,{spacing:"md",align:"center",className:"tw-flex-wrap",children:(0,s.jsxs)("button",{type:"button",onClick:()=>l(t),className:(0,Y.cn)("tw-flex tw-items-center tw-gap-1 tw-text-sm tw-transition-colors sp:tw-text-xs","tw-text-white hover:tw-text-white/80"),children:[(0,s.jsx)(Z.In,{icon:t.isLiked?"ph:thumbs-up-fill":"ph:thumbs-up",className:"tw-h-5 tw-w-5 sp:tw-h-4 sp:tw-w-4"}),(0,s.jsx)("span",{children:t.likesCount})]})})]}),(0,s.jsx)(te,{...u,comment:t,reportOptions:a,onSubmit:v}),(0,s.jsx)(eH.Lt,{open:p.isOpen,onOpenChange:e=>e?p.open():p.close(),children:(0,s.jsxs)(eH.EO,{children:[(0,s.jsxs)(eH.wd,{children:[(0,s.jsx)(eH.r7,{children:"è¿ä¿¡ãåé¤"}),(0,s.jsx)(eH.$v,{children:"ãã®è¿ä¿¡ãåé¤ãã¾ããï¼ãã®æä½ã¯åãæ¶ãã¾ããã"})]}),(0,s.jsxs)(eH.ck,{children:[(0,s.jsx)(eH.Zr,{children:"ãã£ã³ã»ã«"}),(0,s.jsx)(eH.Rx,{onClick:S,className:(0,Y.cn)((0,W.r)({variant:"danger"})),children:"åé¤ãã"})]})]})})]})},tl=()=>{},ti=async()=>{},tr="OLDEST",to=e=>{let{episodeId:t,parentCommentUlid:n,currentUserId:a,reportOptions:l,onRequireSignIn:i,showComposer:o,onCancelC
1omposer:c,onSubmitted:d,currentUserAvatarUrl:w,currentUserDisplayName:u,getCurrentTime:p,onTimestampClick:h}=e,{getCurrentTime:g}=(0,m.m)(),{isSignedIn:b}=(0,y.Z2)(),j=(0,Q.jE)(),v=(0,r.useMemo)(()=>x.e.getCommentReplies({parentCommentUlid:n,orderBy:tr}),[n]),{data:N,error:k,refetch:C}=(0,f.I)({queryKey:v,queryFn:()=>(0,eF.AC)({parentCommentUlid:n,orderBy:tr}),enabled:!!n}),S=!N&&!k,I=(0,r.useMemo)(()=>{var e;return null!=(e=null==N?void 0:N.comments)?e:[]},[N]),E=(0,r.useMemo)(()=>I.map(e=>e.ulid).slice(0,500),[I]),R=b&&E.length>0,T=(0,r.useMemo)(()=>x.e.batchGetEpisodeCommentUserStatuses({commentUlids:E}),[E]),{data:z}=(0,f.I)({queryKey:T,queryFn:()=>(0,eF.QO)({commentUlids:E}),enabled:R}),M=(0,r.useMemo)(()=>{let e=null!=z?z:new Map;return I.map(t=>{var n,s;return{...t,isLiked:null!=(s=null==(n=e.get(t.ulid))?void 0:n.isLiked)&&s}})},[I,z]),q=(0,r.useCallback)(e=>{j.setQueryData(v,t=>t?{...t,comments:t.comments.map(t=>e(t)).filter(e=>null!=e)}:t)},[j,v]),A=(0,K.n)({mutationFn:e=>(0,eF.Fb)({episodeId:t,text:e,parentCommentUlid:n}),onSuccess:e=>{j.setQueryData(v,t=>t?{...t,comments:[...t.comments,e]}:{comments:[e],lastCursor:void 0}),j.invalidateQueries({queryKey:["getEpisodeDetail"]}),d(),c()},onError:e=>{V.oR.error((0,P.Bf)(e,"è¿ä¿¡ã®æç¨¿ã«å¤±æãã¾ãã"))}}),B=(0,r.useCallback)(async e=>{if(!b)return void i();await A.mutateAsync(e)},[b,i,A]),L=(0,K.n)({mutationFn:async e=>{e.nextLiked?await (0,eF.GE)({commentUlid:e.reply.ulid}):await (0,eF.JT)({commentUlid:e.reply.ulid})},meta:{invalidates:[T]},onMutate:async e=>{let{reply:t,nextLiked:n}=e;await Promise.all([j.cancelQueries({queryKey:v}),j.cancelQueries({queryKey:T})]);let s=j.getQueryData(T),a=n?1:-1;return q(e=>e.ulid===t.ulid?{...e,isLiked:n,likesCount:Math.max(0,e.likesCount+a)}:e),j.setQueryData(T,e=>{var s;let a=e?new Map(e):new Map,l=a.get(t.ulid);return a.set(t.ulid,{commentUlid:t.ulid,isLiked:n,hasReported:null!=(s=null==l?void 0:l.hasReported)&&s}),a}),{previousStatuses:s,reply:t,nextLiked:n,likeDelta:a}},onError:(e,t,n)=>{if(n){let{reply:e,nextLiked:t,likeDelta:s,previousStatuses:a}=n;q(n=>n.ulid===e.ulid?{...n,isLiked:!t,likesCount:Math.max(0,n.likesCount-s)}:n),void 0!==a&&j.setQueryData(T,a)}V.oR.error((0,P.Bf)(e,"ãããã®æ´æ°ã«å¤±æãã¾ãã"))}}),_=(0,r.useCallback)(e=>{var t,n,s;if(!b)return void i();let a=null!=(s=null!=(n=null==z||null==(t=z.get(e.ulid))?void 0:t.isLiked)?n:e.isLiked)&&s;L.mutate({reply:e,nextLiked:!a})},[b,i,z,L]),F=(0,r.useCallback)(()=>{b||i()},[b,i]),U=(e=>{let{isSignedIn:t,onRequireSignIn:n,applyListUpdate:s}=e;(0,Q.jE)();let a=(0,K.n)({mutationFn:e=>(0,eF.lm)({commentUlid:e.comment.ulid,reportCode:e.reportCode}),onSuccess:()=>{V.oR.success("ã³ã¡ã³ããéå ±ãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"éå ±ã®éä¿¡ã«å¤±æãã¾ãã"))}}),l=(0,r.useCallback)((e,t)=>{a.mutate({comment:e,reportCode:t})},[a]),i=(0,K.n)({mutationFn:e=>(0,eF.If)({commentUlid:e.ulid}),onSuccess:(e,t)=>{s(e=>e.ulid===t.ulid?null:e),V.oR.success("ã³ã¡ã³ããåé¤ãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"ã³ã¡ã³ãã®åé¤ã«å¤±æãã¾ãã"))}}),o=(0,r.useCallback)(e=>{if(!t)return void n();i.mutate(e)},[t,n,i]),c=(0,K.n)({mutationFn:e=>(0,eF.aV)({commentUlid:e.comment.ulid,text:e.newText}),onSuccess:(e,t)=>{s(n=>n.ulid===t.comment.ulid?e:n),V.oR.success("ã³ã¡ã³ããç·¨éãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"ã³ã¡ã³ãã®ç·¨éã«å¤±æãã¾ãã"))}});return{handleReportComment:l,handleDeleteComment:o,handleUpdateComment:(0,r.useCallback)(async(e,s)=>{if(!t)return void n();await c.mutateAsync({comment:e,newText:s})},[t,n,c])}})({isSignedIn:b,onRequireSignIn:i,applyListUpdate:q}),D=U.handleReportComment,O=U.handleUpdateComment,W=U.handleDeleteComment;if(S)return(0,s.jsx)(ts,{replies:[],currentUserId:a,reportOptions:l,onToggleLike:tl,onReportComment:tl,onEditComment:ti,onDeleteComment:tl,showComposer:!1,onTimestampClick:h});let X=o?{variant:"reply",onSubmit:B,onFocus:F,onCancel:c,isSubmitting:A.isPending,avatarUrl:w,displayName:u,placeholder:"è¿ä¿¡ãå
¥å",currentTime:g()}:void 0;return k?(0,s.jsx)(ts,{replies:[],currentUserId:a,reportOptions:l,onRetry:()=>{C()},isError:!0,onToggleLike:_,onReportComment:D,onEditComment:O,onDeleteComment:W,showComposer:o,composer:X,onTimestampClick:h}):(0,s.jsx)(ts,{replies:M,currentUserId:a,reportOptions:l,onToggleLike:_,onReportComment:D,onEditComment:O,onDeleteComment:W,showComposer:o,composer:X,onTimestampClick:h})},tc=e=>{let{text:t,maxLength:n=100,className:a,onTimestampClick:l}=e,[i,o]=(0,r.useState)(!1),c=(0,e1._J)(t)>n,d=c&&!i?(0,e1.Js)(t,n):t;return(0,s.jsx)("div",{className:a,children:(0,s.jsxs)("p",{className:"tw-whitespace-pre-wrap tw-break-all tw-text-[16
1px] tw-leading-[160%] tw-text-neutral-bright sp:tw-text-[14px] sp:tw-leading-[160%]",children:[(0,s.jsx)(eu.S,{useRedirect:!0,onTimestampClick:l,children:d}),c&&!i&&"⦠",c&&(0,s.jsx)("button",{type:"button",onClick:()=>{o(!i)},className:"tw-inline tw-text-neutral-pale tw-transition-opacity hover:tw-opacity-80",children:i?"ä¸é¨è¡¨ç¤ºã«æ»ã":"ãã£ã¨è¦ã"})]})})},td=e=>{let{comment:t,currentUserId:n,reportOptions:a,onToggleLike:l,renderReplies:i,onClickReply:o,onReport:c,onEdit:d,onDelete:w,onTimestampClick:u}=e,p=(0,r.useMemo)(()=>(0,eh.VI)(t.postTime),[t.postTime]),[x,h]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),N=(0,L.bP)(),k=(0,L.bP)(),C=t.repliesCount>0,S=eG(t,n),I=(0,r.useCallback)(()=>{b(!1)},[]),E=async(e,t)=>{c(e,t)},R=(0,r.useCallback)(async e=>{if(!v){y(!0);try{await d(t,e),j(!1)}catch(e){throw e}finally{y(!1)}}},[d,t,v]),{getCurrentTime:z}=(0,m.m)(),M=z(),q=(0,r.useCallback)(()=>{w(t),k.close()},[w,t,k]);return(0,s.jsxs)(X.z,{align:"start",spacing:"sm",className:"tw-w-full",children:[(0,s.jsx)(e5.y,{size:"xs",displayName:t.user.displayName,avatarUrl:t.user.avatarUrl}),(0,s.jsxs)(T.B,{spacing:"md",className:"tw-min-w-0 tw-flex-1",children:[(0,s.jsxs)(X.z,{spacing:"sm",align:"center",className:"tw-h-6 tw-min-w-0 tw-justify-between",children:[(0,s.jsxs)(X.z,{spacing:"sm",align:"center",className:"tw-min-w-0 tw-flex-1 tw-overflow-hidden",children:[(0,s.jsx)("span",{className:"tw-min-w-0 tw-truncate tw-text-sm tw-font-bold tw-leading-tight tw-text-neutral-bright",children:t.user.displayName||"ã²ã¹ã"}),(0,s.jsx)("span",{className:"tw-shrink-0 tw-text-sm tw-leading-tight tw-text-neutral-pale",children:p}),t.isEdited&&(0,s.jsx)("span",{className:"tw-shrink-0 tw-text-sm tw-leading-tight tw-text-neutral-pale",children:"(ç·¨éæ¸ã¿)"})]}),!f&&(0,s.jsx)("div",{className:"tw-shrink-0",children:(0,s.jsx)(e0,{comment:t,currentUserId:n,onReport:()=>{N.open()},onEdit:()=>{j(!0)},onDelete:()=>{k.open()}})})]}),f?(0,s.jsx)(e8,{variant:"reply",initialText:t.text,onSubmit:R,onCancel:()=>{j(!1)},isSubmitting:v,avatarUrl:t.user.avatarUrl,displayName:t.user.displayName,showAvatar:!1,submitLabel:"ä¿å",currentTime:M}):S?(0,s.jsx)(tt,{children:(0,s.jsx)(tc,{text:t.text,onTimestampClick:u})}):(0,s.jsx)(tc,{text:t.text,onTimestampClick:u}),!f&&(0,s.jsxs)(X.z,{spacing:"md",align:"center",className:"tw-h-6 tw-flex-wrap",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{l(t)},className:"tw-flex tw-items-center tw-gap-2 tw-text-[15px] tw-leading-tight tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-80",children:[(0,s.jsx)(Z.In,{icon:t.isLiked?"ph:thumbs-up-fill":"ph:thumbs-up",className:"tw-h-6 tw-w-6"}),(0,s.jsx)("span",{children:t.likesCount})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{!1!==o(t)&&(h(!0),b(!0))},className:"tw-text-[15px] tw-leading-tight tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-80",children:"è¿ä¿¡"})]}),C&&!f&&(0,s.jsxs)("button",{type:"button",onClick:()=>{h(e=>!e)},className:"tw-flex tw-items-center tw-gap-1 tw-text-[15px] tw-leading-tight tw-text-neutral-bright tw-transition-opacity hover:tw-opacity-80",children:[(0,s.jsx)(Z.In,{icon:x?"material-symbols:arrow-drop-up":"material-symbols:arrow-drop-down",className:"tw-h-6 tw-w-6"}),(0,s.jsxs)("span",{children:[t.repliesCount," ä»¶ã®è¿ä¿¡"]})]}),x&&i(t.ulid,{isComposerOpen:g,onCancelComposer:I})]}),(0,s.jsx)(te,{...N,comment:t,reportOptions:a,onSubmit:E}),(0,s.jsx)(eH.Lt,{open:k.isOpen,onOpenChange:e=>e?k.open():k.close(),children:(0,s.jsxs)(eH.EO,{children:[(0,s.jsxs)(eH.wd,{children:[(0,s.jsx)(eH.r7,{children:"ã³ã¡ã³ããåé¤"}),(0,s.jsx)(eH.$v,{children:"ãã®ã³ã¡ã³ããåé¤ãã¾ããï¼ãã®æä½ã¯åãæ¶ãã¾ããã"})]}),(0,s.jsxs)(eH.ck,{children:[(0,s.jsx)(eH.Zr,{children:"ãã£ã³ã»ã«"}),(0,s.jsx)(eH.Rx,{onClick:q,className:(0,Y.cn)((0,W.r)({variant:"danger"})),children:"åé¤ãã"})]})]})})]})};var tw=n(96094);let tu=[{order:"RECOMMENDED",label:"人æ°é "},{order:"RECENT",label:"æ°çé "}],tm=e=>{let{order:t,onChange:n,className:a}=e;return(0,s.jsx)(X.z,{spacing:"xs",align:"center",justify:"start",className:(0,Y.cn)("tw-text-base",a),children:tu.map((e,a)=>{let l=t===e.order;return(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)("button",{type:"button",onClick:()=>n(e.order),className:(0,Y.cn)("tw-transition-colors tw-duration-150",l?"tw-text-neutral-bright":"tw-text-neutral-middle hover:tw-text-neutral-bright"),"aria-pressed":l,children:e.label}),a<tu.length-1&&(0,s.jsx)("span",{className:"tw-text-neutral-middle",children:"ï½"})]},e.order)})})},tp=e=>{let{comments:t,totalCount:n,order:a,currentUserId:l,reportOptions:i,onChangeOrder:r,onRetry:o,hasMore:c,isLoadingMore:d,isEmpty:w,error:u,renderReplies:m,onLoadMore:p,onToggleLike:x,onReplyClick:h,onReportComment:g,onEditComment:b,onDeleteComment:f,onTimestampClick:j,commentComposer:v,isLoggedIn:y,onClickAppInstallLink:N}=e,{isSp:k}=(0,I.P)(),C=eY(t,l),S=k&&!y&&N,{ref:E}=(0,tw.X)({hasMore:c&&!S,isLoading:d,onLoadMore:p});return(0,s.jsxs)(T.B,{spacing:"lg",className:"tw-p-6 sp:tw-px-3 sp:tw-py-4",children:[(0,s.jsx)(tm,{order:a,onChange:r,className:"tw-w-full"}),(0,s.jsxs)(z.E,{size:"XS",className:"tw-text-sm tw-text-neutral-pale",children:["ã³ã¡ã³ãã®éã¯",(0,s.jsx)(ew._,{href:"https://lp.pivotmedia.co.jp/comment-guideline",isExternal:!0,color:"white",className:"tw-no-underline",children:"ã¬ã¤ãã©ã¤ã³"}),"ãã確èªãã ããã"]}),w&&(0,s.jsx)(th,{}),(0,s.jsx)(e8,{...v}),u?(0,s.jsx)(tx,{onRetry:o}):!w&&(0,s.jsxs)(T.B,{spacing:"xl",children:[(0,s.jsx)(T.B,{spacing:"lg",children:C.map(e=>(0,s.jsx)(td,{comment:e,currentUserId:l,reportOptions:i,onToggleLike:x,onClickReply:h,onReport:g,onEdit:b,onDelete:f,onTimestampClick:j,renderReplies:(e,t)=>
1{let{isComposerOpen:n,onCancelComposer:s}=t;return m(e,{isComposerOpen:n,onCancelComposer:s})}},e.ulid))}),c&&S&&(0,s.jsxs)("button",{type:"button",onClick:N,className:"tw-flex tw-w-full tw-items-center tw-justify-center tw-py-3 tw-text-xs tw-text-neutral-pale tw-transition-colors hover:tw-bg-neutral-dark hover:tw-text-neutral-bright",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:add",className:"tw-mr-1.5 tw-h-3 tw-w-3"}),"ã¢ããªã§ãã£ã¨è¦ã"]}),c&&!S&&(0,s.jsx)("div",{ref:E,className:"tw-flex tw-w-full tw-items-center tw-justify-center tw-py-3",children:d&&(0,s.jsx)(Z.In,{icon:"line-md:loading-twotone-loop",className:"tw-h-6 tw-w-6 tw-text-neutral-pale"})})]})]})},tx=e=>{let{onRetry:t}=e;return(0,s.jsxs)(T.B,{spacing:"md",align:"center",children:[(0,s.jsx)("p",{className:"tw-text-sm tw-text-functional-orange",children:"ã³ã¡ã³ãã®èªã¿è¾¼ã¿ã«å¤±æãã¾ããã"}),(0,s.jsxs)(W.$,{variant:"dark",size:"xsmall",width:"auto",onClick:t,children:[(0,s.jsx)(Z.In,{icon:"material-symbols:refresh",className:"tw-mr-1 tw-h-4 tw-w-4"}),"åèªã¿è¾¼ã¿"]})]})},th=()=>(0,s.jsx)(T.B,{spacing:"sm",children:(0,s.jsx)("p",{className:"tw-text-sm tw-text-neutral-bright",children:"ã³ã¡ã³ãããã¦å¦ã³ãå
±æãã¾ããã"})}),tg=()=>(0,s.jsxs)(T.B,{spacing:"lg",className:"tw-rounded-xl tw-bg-neutral-dark tw-p-6 sp:tw-rounded-none sp:tw-px-3 sp:tw-py-4",children:[(0,s.jsxs)(X.z,{justify:"between",align:"center",children:[(0,s.jsxs)(T.B,{spacing:"xs",width:"auto",children:[(0,s.jsx)("div",{className:"tw-h-7 tw-w-24"}),(0,s.jsx)("div",{className:"tw-h-4 tw-w-16"})]}),(0,s.jsx)("div",{className:"tw-h-9 tw-w-48"})]}),(0,s.jsxs)(X.z,{align:"start",spacing:"md",children:[(0,s.jsx)(er.E,{className:"tw-h-10 tw-w-10 tw-rounded-full"}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-flex-1",children:[(0,s.jsx)(er.E,{className:"tw-h-20 tw-w-full"}),(0,s.jsxs)(X.z,{justify:"between",align:"center",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-48"}),(0,s.jsx)(er.E,{className:"tw-h-9 tw-w-24"})]})]})]}),(0,s.jsx)(T.B,{spacing:"lg",children:Array.from({length:3}).map((e,t)=>(0,s.jsxs)(X.z,{align:"start",spacing:"md",children:[(0,s.jsx)(er.E,{className:"tw-h-10 tw-w-10 tw-rounded-full"}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-flex-1",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-32"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-64"}),(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-48"})]})]},t))})]}),tb=(e,t,n)=>{var s,a;let l=e?new Map(e):new Map,i=l.get(t);return l.set(t,{commentUlid:t,isLiked:null!=(s=null==i?void 0:i.isLiked)&&s,hasReported:null!=(a=null==i?void 0:i.hasReported)&&a,...n}),l},tf=e=>!(null==e?void 0:e.displayName),tj=e=>{var t,n,a;let{episodeId:l,onTimestampClick:i,initialPageSize:o=5,pageSize:c=5,getCurrentTime:d,onClickAppInstallLink:u,isActive:p=!0}=e,{getCurrentTime:h}=(0,m.m)(),{isSignedIn:g,userData:b}=(0,y.Z2)(),{isSp:j}=(0,I.P)(),[v,N]=(0,r.useState)("RECOMMENDED"),k=(0,L.bP)(),C=(0,L.bP)(),S=(0,L.bP)(),E=(0,r.useCallback)(()=>k.open(),[k]),T=(0,r.useCallback)(()=>C.open(),[C]),z=(0,r.useCallback)(()=>S.open(),[S]),M=(0,Q.jE)(),{data:q}=(0,f.I)({queryKey:x.e.batchGetEpisodeCommentCounts({episodeIds:[l]}),queryFn:()=>(0,eF.XQ)({episodeIds:[l]})}),A=null!=(n=null==q||null==(t=q[0])?void 0:t.totalCount)?n:0,B=(0,r.useMemo)(()=>x.e.getEpisodeCommentsInfinite({episodeId:l,orderBy:v,initialPageSize:o,pageSize:c}),[l,v,o,c]),{data:F,error:U,fetchNextPage:D,refetch:O,hasNextPage:W,isFetching:X,isLoading:$}=(0,eZ.q)({queryKey:B,initialPageParam:void 0,queryFn:e=>{let{pageParam:t}=e;return(0,eF.Oi)({episodeId:l,orderBy:v,cursor:t,limit:void 0===t?o:c})},getNextPageParam:e=>{var t;return null!=(t=e.lastCursor)?t:void 0},enabled:p}),Z=(0,r.useMemo)(()=>{var e;return null!=(e=null==F?void 0:F.pages)?e:[]},[F]),H=(0,r.useCallback)(e=>{M.setQueryData(B,t=>{if(!t)return t;let n=t.pages.map(t=>({...t,comments:t.comments.map(t=>e(t)).filter(e=>null!=e)}));return{...t,pages:n}})},[M,B]),G=(0,r.useMemo)(()=>{let e=new Set;return Z.forEach(t=>{t.comments.forEach(t=>{e.add(t.ulid)})}),Array.from(e).slice(0,500)},[Z]),Y=g&&G.length>0,J=(0,r.useMemo)(()=>x.e.batchGetEpisodeCommentUserStatuses({commentUlids:G}),[G]),{data:ee}=(0,f.I)({queryKey:J,queryFn:()=>(0,eF.QO)({commentUlids:G}),enabled:Y}),et=(0,r.useMemo)(()=>{let e=null!=ee?ee:new Map;return Z.flatMap(t=>{var n,s;return null!=(s=null==t||null==(n=t.comments)?void 0:n.map(t=>{var n,s;return{...t,isLiked:null!=(s=null==(n=e.get(t.ulid))?void 0:n.isLiked)&&s}}))?s:[]})},[Z,ee]),en=!$&&0===et.length,es=!!W,ea=X&&!$,el=(0,r.useCallback)(()=>{!es||ea||$||D()},[es,ea,$,D]),{data:ei}=(0,f.I)({queryKey:x.e.getSocialProfile(),queryFn:()=>(0,eF.rn)(),enabled:g}),er=(0,r.useCallback)(()=>
1{if(!g)return void(j?T():E());tf(ei)&&z()},[g,j,ei,E,T,z]),{data:eo}=(0,f.I)({queryKey:x.e.listCommentReportOptions(),queryFn:()=>(0,eF.Am)(),enabled:p}),ec=null==ei?void 0:ei.avatarUrl,ed=null==ei?void 0:ei.displayName,ew=(0,K.n)({mutationFn:e=>(0,eF.Fb)({episodeId:l,text:e}),onSuccess:e=>{M.setQueryData(B,t=>{if(!t||0===t.pages.length)return{pages:[{comments:[e],lastCursor:void 0}],pageParams:[void 0]};let[n,...s]=t.pages;return{...t,pages:[{...n,comments:[e,...n.comments]},...s]}}),M.invalidateQueries({queryKey:["getEpisodeDetail"]}),V.oR.success("ã³ã¡ã³ããæç¨¿ãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"ã³ã¡ã³ãã®æç¨¿ã«å¤±æãã¾ãã"))}}),eu=(0,r.useCallback)(async e=>g?tf(ei)?void z():void await ew.mutateAsync(e):void(j?T():E()),[g,j,ei,ew,E,T,z]),em=(0,r.useCallback)(()=>g?!tf(ei)||(z(),!1):(j?T():E(),!1),[g,j,ei,E,T,z]),ep=(0,r.useRef)(null),ex=(0,r.useCallback)(e=>{ep.current=e},[]);w("focusCommentComposer",(0,r.useCallback)(()=>{var e;if(!g)return void er();null==(e=ep.current)||e.focus()},[g,er]));let eh=(0,r.useMemo)(()=>({variant:"comment",onSubmit:eu,onFocus:er,onInsertTimecode:em,onComposerReady:ex,isSubmitting:ew.isPending,avatarUrl:ec,displayName:ed,placeholder:g?"ã³ã¡ã³ããå
¥å":"ã¢ããªã§ã³ã¡ã³ããæç¨¿",currentTime:h()}),[eu,er,em,ex,ew.isPending,ec,ed,g,h]),eg=(0,r.useCallback)(e=>g?!tf(ei)||(z(),!1):(j?T():E(),!1),[g,j,ei,E,T,z]),eb=(0,r.useCallback)(e=>{H(t=>t.ulid===e?{...t,repliesCount:t.repliesCount+1}:t)},[H]),ef=(0,r.useCallback)(()=>{O()},[O]),ej=(0,r.useCallback)(e=>{N(e)},[]),ev=(0,r.useCallback)(()=>{j?T():E()},[j,T,E]),ey=(e=>{let{isSignedIn:t,onRequireSignIn:n,queryClient:s,listQueryKey:a,statusesQueryKey:l,applyListUpdate:i,commentStatuses:o}=e,c=(0,K.n)({mutationFn:async e=>{e.nextLiked?await (0,eF.GE)({commentUlid:e.comment.ulid}):await (0,eF.JT)({commentUlid:e.comment.ulid})},meta:{invalidates:[l]},onMutate:async e=>{let{comment:t,nextLiked:n}=e;await Promise.all([s.cancelQueries({queryKey:a}),s.cancelQueries({queryKey:l})]);let r=s.getQueryData(l),o=n?1:-1;return i(e=>e.ulid===t.ulid?{...e,isLiked:n,likesCount:Math.max(0,e.likesCount+o)}:e),s.setQueryData(l,e=>tb(e,t.ulid,{isLiked:n})),{previousStatuses:r,comment:t,nextLiked:n,likeDelta:o}},onError:(e,t,n)=>{if(n){let{comment:e,nextLiked:t,likeDelta:a,previousStatuses:r}=n;i(n=>n.ulid===e.ulid?{...n,isLiked:!t,likesCount:Math.max(0,n.likesCount-a)}:n),void 0!==r&&s.setQueryData(l,r)}V.oR.error((0,P.Bf)(e,"ãããã®æ´æ°ã«å¤±æãã¾ãã"))}}),d=(0,r.useCallback)(e=>{var s,a,l;if(!t)return void n();let i=null!=(l=null!=(a=null==o||null==(s=o.get(e.ulid))?void 0:s.isLiked)?a:e.isLiked)&&l;c.mutate({comment:e,nextLiked:!i})},[t,n,o,c]),w=(0,K.n)({mutationFn:e=>(0,eF.lm)({commentUlid:e.comment.ulid,reportCode:e.reportCode}),onSuccess:(e,t)=>{s.setQueryData(l,e=>tb(e,t.comment.ulid,{hasReported:!0})),V.oR.success("ã³ã¡ã³ããéå ±ãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"éå ±ã®éä¿¡ã«å¤±æãã¾ãã"))}}),u=(0,r.useCallback)((e,t)=>{w.mutate({comment:e,reportCode:t})},[w]),m=(0,K.n)({mutationFn:e=>(0,eF.If)({commentUlid:e.ulid}),onSuccess:(e,t)=>{i(e=>e.ulid===t.ulid?null:e),s.invalidateQueries({queryKey:["getEpisodeDetail"]}),V.oR.success("ã³ã¡ã³ããåé¤ãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"ã³ã¡ã³ãã®åé¤ã«å¤±æãã¾ãã"))}}),p=(0,r.useCallback)(e=>{if(!t)return void n();m.mutate(e)},[t,n,m]),x=(0,K.n)({mutationFn:e=>(0,eF.aV)({commentUlid:e.comment.ulid,text:e.newText}),onSuccess:(e,t)=>{i(n=>n.ulid===t.comment.ulid?e:n),V.oR.success("ã³ã¡ã³ããç·¨éãã¾ãã")},onError:e=>{V.oR.error((0,P.Bf)(e,"ã³ã¡ã³ãã®ç·¨éã«å¤±æãã¾ãã"))}});return{handleToggleLike:d,handleReportComment:u,handleDeleteComment:p,handleUpdateComment:(0,r.useCallback)(async(e,s)=>{if(!t)return void n();await x.mutateAsync({comment:e,newText:s})},[t,n,x])}})({isSignedIn:g,onRequireSignIn:ev,queryClient:M,listQueryKey:B,statusesQueryKey:J,applyListUpdate:H,commentStatuses:ee}),eN=ey.handleToggleLike,ek=ey.handleReportComment,eC=ey.handleDeleteComment,eS=ey.handleUpdate
1Comment;if($)return(0,s.jsx)(tg,{});let eI=g&&null!=(a=null==b?void 0:b.userId)?a:0;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tp,{comments:et,totalCount:A,order:v,currentUserId:eI,reportOptions:null!=eo?eo:[],onChangeOrder:ej,onRetry:ef,hasMore:es,isLoadingMore:ea,isEmpty:en,error:U instanceof Error?U:void 0,onTimestampClick:i,renderReplies:(e,t)=>{let{isComposerOpen:n,onCancelComposer:a}=t;return(0,s.jsx)(to,{episodeId:l,parentCommentUlid:e,currentUserId:eI,reportOptions:null!=eo?eo:[],onRequireSignIn:ev,showComposer:n,onCancelComposer:a,onSubmitted:()=>eb(e),currentUserAvatarUrl:ec,currentUserDisplayName:ed,getCurrentTime:d,onTimestampClick:i})},onLoadMore:el,onToggleLike:eN,onReplyClick:eg,onReportComment:ek,onEditComment:eS,onDeleteComment:eC,commentComposer:eh,isLoggedIn:g,onClickAppInstallLink:u}),(0,s.jsx)(_.t,{...C}),(0,s.jsx)(R.b,{...k}),(0,s.jsx)(e$,{...S})]})},tv=e=>{let{episodeId:t}=e;return(0,s.jsxs)(ej(),{href:"/movie/".concat(t,"/article"),target:"_blank",rel:"noopener noreferrer",className:"tw-flex tw-items-center tw-gap-1.5 tw-text-sm tw-text-neutral-pale tw-no-underline hover:tw-text-neutral-bright",children:[(0,s.jsx)("span",{children:"å°ç¨ãã¼ã¸ã§è¦ã"}),(0,s.jsx)(Z.In,{icon:"material-symbols:open-in-new",className:"tw-h-4 tw-w-4"})]})};var ty=n(65947),tN=n(86009);let tk=e=>{let{articleHtml:t,episodeId:n,episodeName:a,active:l=!0,headerRightSlot:i}=e,{value:o="light",set:c}=(0,ty.n)(),d=(0,r.useCallback)(()=>{let e="dark"===o?"light":"dark";c(e),k.h.sendChangeArticleBackground({to:e,episodeId:n,episodeName:a})},[o,c,n,a]),w=(0,r.useCallback)(e=>{k.h.sendArticleScrollDepth({episodeId:n,episodeName:a,value:e})},[n,a]);return(0,s.jsx)(tN.G,{articleHtml:t,backgroundColor:o,onScrollDepth:w,active:l,onToggleBackgroun
1dMode:d,headerRightSlot:i})};var tC=n(72936),tS=n(88793),tI=n(61699),tE=n(94661);let tR=e=>{let{variant:t,memos:n,isSignedIn:a,editingMemoId:l,isSubmitting:i,createSnapshotTimeSec:o,onClickCreate:c,onClickEdit:d,onCancelEdit:w,onSubmitCreate:u,onSubmitUpdate:m,onDelete:p,onSeek:x,onSignInRequired:h,onCreateEditorReady:g}=e,b="sp"===t,[f,j]=(0,r.useState)(()=>new Set),[v,y]=(0,r.useState)(null),N=()=>{if(!a)return void h();c()},k=(0,r.useMemo)(()=>null!==v?n.find(e=>e.id===v):void 0,[n,v]);return(0,s.jsxs)(T.B,{spacing:"lg",className:"tw-w-full tw-p-6",children:[null!==l&&!b&&(0,s.jsx)(X.z,{justify:"end",className:"tw-w-full",children:(0,s.jsxs)("button",{type:"button",onClick:N,className:"tw-flex tw-items-center tw-gap-1 tw-px-2 tw-text-white tw-transition-opacity hover:tw-opacity-80",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:add",className:"tw-h-6 tw-w-6"}),(0,s.jsx)("span",{className:"tw-text-base",children:"æ°è¦ã¡ã¢ã使"})]})}),null===l&&(0,s.jsx)(tM,{variant:t,title:"æ°è¦ä½æ",initialBody:"",timestampSec:o,isSubmitting:i,onCancel:w,onSubmit:u,onEditorReady:g}),(0,s.jsx)(T.B,{spacing:"sm",className:"tw-w-full",children:n.map(e=>{if(l===e.id)return(0,s.jsx)(tM,{variant:t,title:"ç·¨é",initialBody:e.body,timestampSec:e.timestampSec,isSubmitting:i,onCancel:w,onSubmit:(t,n)=>m(e.id,t,n)},e.id);let n=f.has(e.id);return(0,s.jsx)(tz,{memo:e,isExpanded:n,onToggleExpand:()=>(e=>{j(t=>{let n=new Set(t);return n.has(e)?(n.delete(e),n):b?new Set([e]):(n.add(e),n)})})(e.id),onSeek:()=>x(e.timestampSec),onRequestDelete:()=>y(e.id),onEdit:()=>d(e.id)},e.id)})}),void 0===l&&b&&(0,s.jsx)("div",{className:"tw-sticky tw-bottom-0 tw-w-full tw-bg-neutral-dark tw-py-2",children:(0,s.jsxs)("button",{type:"button",onClick:N,className:"tw-flex tw-h-12 tw-w-full tw-items-center tw-justify-center tw-gap-1 tw-rounded-full tw-bg-neutral-bright tw-text-sm tw-font-bold tw-text-neutral-dark tw-transition-opacity hover:tw-opacity-80",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:edit-outline",width:20}),"ã¡ã¢ãæ¸ã"]})}),(0,s.jsx)(eH.Lt,{open:null!==v,onOpenChange:e=>{e||y(null)},children:(0,s.jsxs)(eH.EO,{children:[(0,s.jsxs)(eH.wd,{children:[(0,s.jsx)(eH.r7,{children:"ã¡ã¢ãåé¤"}),(0,s.jsx)(eH.$v,{children:k?(0,s.jsxs)(s.Fragment,{children:["ã",tT(k.body,30),"ããåé¤ãã¾ããï¼",(0,s.jsx)("br",{}),"ãã®æä½ã¯åãæ¶ãã¾ããã"]}):"ãã®ã¡ã¢ãåé¤ãã¾ããï¼ãã®æä½ã¯åãæ¶ãã¾ããã"})]}),(0,s.jsxs)(eH.ck,{children:[(0,s.jsx)(eH.Zr,{children:"ãã£ã³ã»ã«"}),(0,s.jsx)(eH.Rx,{onClick:()=>{null!==v&&(p(v),y(null))},className:"tw-bg-functional-orange tw-text-neutral-dark hover:tw-bg-functional-orange-light",children:"åé¤ãã"})]})]})})]})},tT=(e,t)=>e.length>t?e.slice(0,t)+"â¦":e,tz=e=>{let{memo:t,isExpanded:n,onToggleExpand:a,onSeek:l,onRequestDelete:i,onEdit:r}=e;return(0,s.jsxs)(T.B,{spacing:0,className:"tw-w-full tw-overflow-hidden tw-rounded-lg",children:[(0,s.jsx)("button",{type:"button",onClick:a,className:"tw-w-full","aria-expanded":n,children:(0,s.jsx)(tC.$,{title:(0,tI.C)(t.body),timestampSec:t.timestampSec,trailing:(0,s.jsx)(Z.In,{icon:n?"material-symbols:remove":"material-symbols:add",className:"tw-h-6 tw-w-6 tw-shrink-0 tw-text-white"})})}),n&&(0,s.jsxs)("div",{className:"tw-flex tw-w-full tw-flex-col tw-gap-3 tw-bg-neutral-night tw-px-4 tw-pb-4",children:[(0,s.jsx)("p",{className:"tw-w-full tw-whitespace-pre-wrap tw-break-words tw-text-[15px] tw-leading-[1.6] tw-text-white",children:t.body}),(0,s.jsxs)(X.z,{spacing:"sm",justify:"end",className:"tw-w-full",children:[(0,s.jsx)(tS.K,{variant:"outline",onClick:i,children:"åé¤"}),(0,s.jsx)(tS.K,{variant:"solid",onClick:l,children:"ãã®ç« ãåç"}),(0,s.jsx)(tS.K,{variant:"solid",onClick:r,children:"ç·¨é"})]})]})]})},tM=e=>{let{variant:t,title:n,initialBody:a,timestampSec:l,isSubmitting:i,onCancel:o,onSubmit:c,onEditorReady:d}=e,[w,u]=(0,r.useState)(a),[m,p]=(0,r.useState)(()=>(0,tI.g)(l)),x=(0,r.useMemo)(()=>{try{let e=(0,tE.DP)(m);if(!Number.isFinite(e)||e<0)return null;return e}catch(e){return null}},[m]),h=null===x,g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=0,t=!1,n=()=>
1{if(t)return;let s=g.current;if(s&&null!==s.offsetParent)return void s.focus();e++<10&&requestAnimationFrame(n)};return requestAnimationFrame(n),()=>{t=!0}},[]),(0,r.useEffect)(()=>{if(d)return d({focus:()=>{let e=0,t=()=>{let n=g.current;if(n&&null!==n.offsetParent)return void n.focus();e++<10&&requestAnimationFrame(t)};requestAnimationFrame(t)}}),()=>d(null)},[d]);let b=0===w.trim().length,f=w.length>2e3,j=!b&&!f&&!i&&null!==x,v=()=>{j&&null!==x&&c(w,x).catch(()=>{})},y=e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key?(e.preventDefault(),v()):"Escape"!==e.key||e.nativeEvent.isComposing||(e.preventDefault(),o())};return(0,s.jsxs)(T.B,{spacing:"md",align:"center",className:"tw-w-full tw-rounded-lg tw-bg-neutral-night tw-p-4",children:["sp"!==t&&(0,s.jsx)("h3",{className:"tw-text-base tw-font-bold tw-leading-relaxed tw-text-white",children:n}),(0,s.jsxs)(T.B,{spacing:"md",className:"tw-w-full",children:[(0,s.jsxs)(X.z,{spacing:"md",align:"center",children:[(0,s.jsx)("label",{htmlFor:"memo-timecode",className:"tw-text-sm tw-font-bold tw-leading-snug tw-text-white",children:"ã¿ã¤ã ã³ã¼ã"}),(0,s.jsx)("input",{id:"memo-timecode",type:"text",value:m,onChange:e=>p(e.target.value),onKeyDown:y,placeholder:"MM:SS",inputMode:"numeric",className:(0,Y.cn)("tw-w-[8ch] tw-bg-transparent tw-text-center tw-text-base tw-leading-relaxed tw-text-white tw-placeholder-neutral-pale focus:tw-rounded focus:tw-outline-none focus:tw-ring-2",h?"tw-text-functional-orange focus:tw-ring-functional-orange":"focus:tw-ring-accent-brand-tertiary"),"aria-invalid":h}),h&&(0,s.jsx)("span",{className:"tw-text-xs tw-text-functional-orange",children:"MM:SS / HH:MM:SS å½¢å¼"})]}),(0,s.jsx)("textarea",{ref:g,value:w,onChange:e=>u(e.target.value),onKeyDown:y,placeholder:"ã¡ã¢ãå
¥å",rows:5,"aria-invalid":f,"aria-describedby":"memo-body-counter",className:(0,Y.cn)("tw-min-h-[160px] tw-w-full tw-resize-y tw-rounded-lg tw-border tw-bg-neutral-middle tw-px-4 tw-py-3 tw-text-base tw-leading-relaxed tw-text-white tw-placeholder-neutral-pale focus:tw-outline-none focus:tw-ring-2",f?"tw-border-functional-orange focus:tw-ring-functional-orange":"tw-border-neutral-pale focus:tw-ring-accent-brand-tertiary"),maxLength:2100}),f&&(0,s.jsxs)(z.E,{size:"XS",className:"tw-text-functional-orange",children:["ã¡ã¢ã¯",2e3,"æå以å
ã§å
¥åãã¦ãã ãã"]}),(0,s.jsx)(X.z,{align:"center",justify:"between",className:"tw-w-full",children:(0,s.jsxs)(z.E,{id:"memo-body-counter",size:"XS",className:(0,Y.cn)("tw-shrink-0",f?"tw-text-functional-orange":"tw-text-neutral-pale"),"aria-live":"polite",children:[w.length,"/",2e3,"æå"]})})]}),(0,s.jsxs)(X.z,{spacing:"md",align:"center",justify:"between",className:"tw-w-full",children:[(0,s.jsx)("button",{type:"button",onClick:o,className:"tw-text-base tw-font-bold tw-leading-snug tw-text-white tw-transition-opacity hover:tw-opacity-80",children:"ãã£ã³ã»ã«"}),(0,s.jsx)("button",{type:"button",onClick:v,disabled:!j,className:(0,Y.cn)("tw-flex tw-h-8 tw-items-center tw-justify-center tw-rounded-2xl tw-px-4 tw-text-sm tw-font-bold tw-leading-snug tw-transition-colors",j?"tw-bg-white tw-text-neutral-dark hover:tw-opacity-90":"tw-cursor-not-allowed tw-bg-accent-brand-general tw-text-white"),children:"ä¿å"})]})]})},tq=e=>{let{variant:t}=e,n="sp"===t;return(0,s.jsxs)(T.B,{spacing:"md",className:"tw-w-full tw-p-6",children:[!n&&(0,s.jsx)(X.z,{justify:"end",className:"tw-w-full",children:(0,s.jsx)(er.E,{className:"tw-h-6 tw-w-32"})}),(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-w-full",children:[(0,s.jsx)(er.E,{className:"tw-h-12 tw-w-full tw-rounded-lg"}),(0,s.jsx)(er.E,{className:"tw-h-12 tw-w-full tw-rounded-lg"}),(0,s.jsx)(er.E,{className:"tw-h-12 tw-w-full tw-rounded-lg"})]}),n&&(0,s.jsx)(er.E,{className:"tw-h-12 tw-w-full tw-rounded-full"})]})},tA=e=>{let{variant:t,episodeId:n,onTimestampClick:a,isActive:l=!0}=e,{isSignedIn:i}=(0,y.Z2)(),o="sp"===t,{getCurrentTime:c}=(0,m.m)(),d=(0,Q.jE)(),u=(0,L.bP)(),p=(0,L.bP)(),h=x.e.listEpisodeMemos({episodeId:n}),{data:g,error:b}=(0,f.I)({queryKey:h,queryFn:()=>(0,eF.h8)({episodeId:n}),enabled:i&&l}),[j,v]=(0,r.useState)(void 0),[N,k]=(0,r.useState)(0),C=(0,r.useCallback)(()=>{k(Math.floor(c())),v(null)},[c]),S=(0,r.useCallback)(()=>{o?p.open():u.open()},[o,p,u]),I=(0,r.useRef)(null),E=(0,r.useCallback)(e=>{I.current=e},[]);w("openCreateMemo",(0,r.useCallback)(()=>
1{if(!i)return void S();if(null===j){var e;null==(e=I.current)||e.focus();return}"number"!=typeof j&&C()},[i,j,C,S]));let z=(0,r.useCallback)(e=>{v(e)},[]),M=(0,r.useCallback)(()=>{v(void 0)},[]),q=(0,K.n)({mutationFn:e=>(0,eF.To)({episodeId:n,body:e.body,timestampSec:e.timestampSec}),onSuccess:e=>{d.setQueryData(h,t=>(t?[...t,e]:[e]).sort((e,t)=>e.timestampSec-t.timestampSec)),v(void 0),V.oR.success("ã¡ã¢ãä¿åãã¾ãã")},onError:()=>{V.oR.error("ã¡ã¢ã®ä¿åã«å¤±æãã¾ãã")}}),A=(0,K.n)({mutationFn:e=>(0,eF.UY)({memoId:e.memoId,body:e.body,timestampSec:e.timestampSec}),onSuccess:e=>{d.setQueryData(h,t=>t?t.map(t=>t.id===e.id?e:t).sort((e,t)=>e.timestampSec-t.timestampSec):t),v(void 0),V.oR.success("ã¡ã¢ãæ´æ°ãã¾ãã")},onError:()=>{V.oR.error("ã¡ã¢ã®æ´æ°ã«å¤±æãã¾ãã")}}),B=(0,K.n)({mutationFn:e=>(0,eF.cP)({memoId:e}),onSuccess:(e,t)=>{d.setQueryData(h,e=>e?e.filter(e=>e.id!==t):e),V.oR.success("ã¡ã¢ãåé¤ãã¾ãã")},onError:()=>{V.oR.error("ã¡ã¢ã®åé¤ã«å¤±æãã¾ãã")}}),P=(0,r.useCallback)(async(e,t)=>{await q.mutateAsync({body:e,timestampSec:t})},[q]),F=(0,r.useCallback)(async(e,t,n)=>{await A.mutateAsync({memoId:e,body:t,timestampSec:n})},[A]),U=(0,r.useCallback)(e=>{B.mutate(e)},[B]),D=(0,r.useCallback)(e=>{null==a||a(e)},[a]);return i?g||b?!g&&b?(0,s.jsxs)(T.B,{spacing:"sm",align:"center",justify:"center",className:"tw-w-full tw-p-6 tw-text-center tw-text-neutral-pale",children:[(0,s.jsx)("p",{children:"ã¡ã¢ã®åå¾ã«å¤±æãã¾ãã"}),(0,s.jsx)("button",{type:"button",onClick:()=>d.invalidateQueries({queryKey:h}),className:"tw-text-white tw-underline hover:tw-opacity-80",children:"åèªã¿è¾¼ã¿"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tR,{variant:t,memos:null!=g?g:[],isSignedIn:!0,editingMemoId:j,isSubmitting:q.isPending||A.isPending,createSnapshotTimeSec:N,onClickCreate:C,onClickEdit:z,onCancelEdit:M,onSubmitCreate:P,onSubmitUpdate:F,onDelete:U,onSeek:D,onSignInRequired:S,onCreateEditorReady:E}),(0,s.jsx)(_.t,{...p}),(0,s.jsx)(R.b,{...u})]}):(0,s.jsx)(tq,{variant:t}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(tR,{variant:t,memos:[],isSignedIn:!1,editingMemoId:void 0,isSubmitting:!1,createSnapshotTimeSec:0,onClickCreate:C,onClickEdit:z,onCancelEdit:M,onSubmitCreate:P,onSubmitUpdate:F,onDelete:U,onSeek:D,onSignInRequired:S}),(0,s.jsx)(_.t,{...p}),(0,s.jsx)(R.b,{...u})]})},tB=e=>{let{articleHtml:t,episodeId:n,episodeName:a}=e;return(0,s.jsx)(tk,{articleHtml:t,episodeId:n,episodeName:a,headerRightSlot:(0,s.jsx)(tv,{episodeId:n})})},tL=e=>{let{episodeId:t,onTimestampClick:n,onClickAppInstallLink:a,isActive:l}=e;return(0,s.jsx)(tj,{episodeId:t,onTimestampClick:n,initialPageSize:20,pageSize:20,onClickAppInstallLink:()=>a({positionName:"comment_section_bottom"}),isActive:l})},t_=e=>{let{variant:t,episodeId:n,onTimestampClick:a,isActive:l}=e;return(0,s.jsx)(tA,{variant:t,episodeId:n,onTimestampClick:a,isActive:l})};var tP=n(40035);let tF=e=>{let{title:t,episodeCount:n,episodes:a,episodeUserStateMap:l,currentEpisodeId:i,href:r,triggerIcon:o,linkQuery:c,eventData:d}=e,{isSp:w}=(0,I.P)();return w?(0,s.jsx)(tD,{title:t,episodeCount:n,episodes:a,episodeUserStateMap:l,currentEpisodeId:i,href:r,triggerIcon:o,linkQuery:c,eventData:d}):(0,s.jsx)(tU,{title:t,episodeCount:n,episodes:a,episodeUserStateMap:l,currentEpisodeId:i,href:r,triggerIcon:o,linkQuery:c,eventData:d})},tU=e=>{let{title:t,episodeCount:n,episodes:a,episodeUserStateMap:l,currentEpisodeId:i,href:o,linkQuery:c,eventData:d}=e,[w,u]=(0,r.useState)(!0);return(0,s.jsxs)(T.B,{spacing:0,className:"tw-w-full tw-min-w-0",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),"aria-expanded":w,"aria-label":w?"éãã":"éã",className:"tw-flex tw-w-full tw-min-w-0 tw-items-center tw-justify-between tw-gap-2 tw-px-4 tw-py-3 tw-text-left tw-transition-colors hover:tw-bg-neutral-middle/40",children:[(0,s.jsxs)(T.B,{spacing:"xs",className:"tw-min-w-0 tw-flex-1",children:[(0,s.jsx)(ed.D,{size:"S",className:"tw-truncate",children:t}),(0,s.jsxs)(z.E,{size:"Assistance",className:"tw-text-neutral-pale",children:[n,"ã
1¨ãã½ã¼ã"]})]}),(0,s.jsx)("span",{className:"tw-flex tw-h-8 tw-w-8 tw-shrink-0 tw-items-center tw-justify-center tw-rounded-full tw-text-neutral-bright",children:(0,s.jsx)(Z.In,{icon:"ic:round-keyboard-arrow-down",className:(0,Y.cn)("tw-h-6 tw-w-6 tw-transition-transform",w?"tw-rotate-180":"tw-rotate-0")})})]}),w&&(0,s.jsx)("div",{className:"tw-max-h-[400px] tw-overflow-y-auto tw-px-4 tw-pb-3",children:(0,s.jsx)(eo._,{episodes:a,episodeUserStateMap:l,playingEpisodeId:i,size:"XS",withoutDescription:!0,spacing:"sm",linkQuery:c,eventData:d})})]})},tD=e=>{let{title:t,episodeCount:n,episodes:a,episodeUserStateMap:l,currentEpisodeId:i,href:o,triggerIcon:c,linkQuery:d,eventData:w}=e,u=(0,L.bP)(),m=(0,r.useMemo)(()=>{var e,n;return null!=(n=null==(e=a.find(e=>e.id===i))?void 0:e.title)?n:t},[a,i,t]);return(0,s.jsxs)(s.Fragment,{children:[!u.isOpen&&(0,s.jsxs)("button",{type:"button",onClick:u.open,className:"tw-fixed tw-inset-x-2 tw-bottom-16 tw-z-40 tw-flex tw-items-center tw-gap-2 tw-overflow-hidden tw-rounded-2xl tw-border tw-border-neutral-pale tw-bg-neutral-dark tw-px-4 tw-py-3 tw-shadow-[0_1px_2px_rgba(0,0,0,0.3),0_2px_6px_2px_rgba(0,0,0,0.15)]",children:[(0,s.jsx)(Z.In,{icon:c,className:"tw-h-10 tw-w-10 tw-shrink-0 tw-text-neutral-bright"}),(0,s.jsxs)(T.B,{spacing:0,className:"tw-min-w-0 tw-flex-1 tw-overflow-hidden tw-text-left",children:[(0,s.jsx)(z.E,{size:"S",weight:"bold",className:"tw-block tw-w-full tw-truncate",children:m}),(0,s.jsx)(z.E,{size:"Assistance",className:"tw-block tw-w-full tw-truncate tw-text-neutral-pale",children:t})]}),(0,s.jsx)(Z.In,{icon:"ic:round-keyboard-arrow-up",className:"tw-h-6 tw-w-6 tw-shrink-0 tw-text-neutral-bright"})]}),(0,s.jsx)($.RF,{mode:"bottom-sheet",layer:$.Of.CONTEXT,...u,children:(0,s.jsx)($.sL,{bottomSheetPadding:"tw-p-0",children:(0,s.jsxs)(T.B,{spacing:"md",className:"tw-h-full tw-px-4 tw-pb-8 tw-pt-2",children:[(0,s.jsx)($.N5,{asChild:!0,children:(0,s.jsx)(ej(),{href:o,className:"tw-block tw-min-w-0 tw-pr-10 tw-no-underline hover:tw-opacity-80",children:(0,s.jsx)(ed.D,{size:"M",className:"tw-truncate",children:t})})}),(0,s.jsx)(eo._,{episodes:a,episodeUserStateMap:l,playingEpisodeId:i,size:"S",withoutDescription:!0,spacing:"sm",linkQuery:d,eventData:w})]})})})]})},tO=e=>{let{playlist:t,episodes:n,episodeUserStateMap:a,currentEpisodeId:l,playlistId:i}=e;return(0,s.jsx)(tF,{title:t.title,episodeCount:t.episodeCount,episodes:n,episodeUserStateMap:a,currentEpisodeId:l,href:"/playlist/".concat(i),triggerIcon:"ic:round-playlist-play",linkQuery:{playlistId:i},eventData:{screenName:"playlist_detail",sectionName:"ãã¬ã¤ãªã¹ãåçã³ã³ããã¹ã"}})},tQ=e=>{let{playlistId:t,currentEpisodeId:n}=e,{data:a}=(0,f.I)({queryKey:x.e.getPlaylist({playlistId:t}),queryFn:()=>(0,tP.b)({playlistId:t})}),{data:l}=(0,f.I)({queryKey:x.e.listPlaylistEpisodes({playlistId:t}),queryFn:()=>(0,h.Ze)({playlistId:t})}),i=(0,r.useMemo)(()=>{var e;return null!=(e=null==l?void 0:l.episodes)?e:[]},[null==l?void 0:l.episodes]),o=(0,r.useMemo)(()=>i.map(e=>e.id),[i]),{data:c}=(0,f.I)({...(0,el.v)({episodeIds:o}),enabled:o.length>0});return a&&l?(0,s.jsx)(tO,{playlist:a,episodes:i,episodeUserStateMap:null!=c?c:new Map,currentEpisodeId:n,playlistId:t}):null};var tK=n(87840),tV=n(65968),tW=n(99553);let tX=async e=>{let t=await tW.OW.getQuizProgress({quizId:BigInt(e.quizId)});return(0,tV.Ye)(t)},t$=async e=>{let t=await tW.OW.getQuizResult({quizId:BigInt(e.quizId)});return(0,tV.or)(t)},tZ=async e=>(await tW.OW.listQuizzesByEpisode({episodeId:e.episodeId})).quizzes.map(tV.eJ),tH=e=>(0,tK.j)({queryKey:["listQuizzesByEpisode",e],queryFn:()=>tZ(e),meta:{skipAutoInvalidate:!0}});var tG=n(51529);let tY=async e=>{var t;let n=null!=(t=e.attemptUlid)?t:(await tW.OW.openQuiz({quizId:BigInt(e.quizId)})).attemptUlid,s=await tW.OW.submitAnswer({attemptUlid:n,quizId:BigInt(e.quizId),questionId:BigInt(e.questionId),optionId:BigInt(e.optionId)});return(0,tV.iv)(s,n)},tJ=(e,t)=>{let n=new Map(t.map(e=>[e.questionId,e.isCorrect]));return e.map(e=>n.get(e.questionId))},t0=e=>{let t=(0,i.useRouter)();return(0,s.jsx)($.RF,{...e,mode:"contextual",layer:$.Of.CONTEXT,children:(0,s.jsx)($.sL,{children:(0,s.jsxs)(T.B,{spacing:"md",className:"tw-w-full",children:[(0,s.jsx)($.N5,{className:"tw-text-center tw-text-base tw-font-bold tw-text-white",children:"ç解度ãã§ãã¯ã«ã¤ãã¦"}),(0,s.jsx)($.Hq,{className:"tw-text-[14px] tw-leading-[1.6] tw-text-white",children:"ã¨ãã½ã¼ãã®ç解度ãã¯ã¤ãºå½¢å¼ã§ç¢ºèªã§ãã¾ãã"}),(0,s.jsx)("div",{className:"tw-h-px tw-w-full tw-bg-neutral-night"}),(0,s.jsx)("p",{className:"tw-text-[14px] tw-leading-[1.6] tw-text-neutral-pale",children:"ç解度ãã§ãã¯ã®
1å
容ã§ã誤ããæ°ã«ãªãç¹ãããã°ãç¥ãããã ããã"}),(0,s.jsx)(W.$,{variant:"light",size:"medium",shape:"pill",width:"full",className:"tw-border-0 tw-bg-white tw-font-bold tw-text-neutral-dark hover:tw-bg-gray-200",onClick:()=>{e.close(),t.push("/contact?form=1")},children:"åãåããã"})]})})})},t1=()=>{let e=(0,L.bP)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button","aria-label":"ç解度ãã§ãã¯ã«ã¤ãã¦","aria-haspopup":"dialog","aria-expanded":e.isOpen,onClick:e.open,className:"tw-flex tw-shrink-0 tw-items-center tw-justify-center tw-rounded-full tw-text-white/60 hover:tw-text-white focus-visible:tw-outline-none focus-visible:tw-ring-2 focus-visible:tw-ring-white",children:(0,s.jsx)(Z.In,{icon:"material-symbols:help-outline",className:"tw-size-5"})}),(0,s.jsx)(t0,{...e})]})},t2=e=>{let{variant:t,questionCount:n,answeredCount:a,answerResults:l,question:i,selectedOptionId:r,judgement:o,isSubmitting:c,onSelectOption:d,onSubmit:w,onNext:u,onShowResult:m}=e;return(0,s.jsxs)(t6,{variant:t,questionCount:n,answeredCount:a,answerResults:l,currentQuestionIndex:i.index,children:[(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-w-full",children:[(0,s.jsx)(t5,{index:i.index}),(0,s.jsx)("p",{className:"tw-text-[14px] tw-leading-[1.6] tw-text-white",children:i.stem})]}),(0,s.jsx)(T.B,{spacing:"sm",className:"tw-w-full",children:i.options.map(e=>{let t=e.optionId===r,n=void 0!==o&&e.optionId===o.correctOptionId,a=void 0!==o&&t&&!o.isCorrect;return(0,s.jsx)(t4,{text:e.text,state:n?"correct":a?"incorrect":void 0===o&&t?"selected":"normal",disabled:void 0!==o||c,onClick:()=>d(e.optionId)},e.optionId)})}),void 0!==o&&""!==i.explanation&&(0,s.jsx)(t3,{explanation:i.explanation}),void 0===o?(0,s.jsx)(W.$,{variant:"secondary",size:"small",shape:"pill",width:"full",className:"tw-text-[14px]",disabled:"pc"===t&&(void 0===r||c),loading:c,onClick:w,children:"åçãã"}):o.isCompleted?(0,s.jsx)(W.$,{variant:"secondary",size:"small",shape:"pill",width:"full",className:"tw-text-[14px]",onClick:m,children:"çµæãè¦ã"}):(0,s.jsx)(W.$,{variant:"secondary",size:"small",shape:"pill",width:"full",className:"tw-text-[14px]",onClick:u,children:"次ã®åé¡ã¸"})]})},t4=e=>{let{text:t,state:n,disabled:a,onClick:l}=e;return(0,s.jsx)("button",{type:"button","aria-pressed":"selected"===n,disabled:a,onClick:l,className:(0,Y.cn)("tw-w-full tw-rounded-lg tw-text-left tw-transition-colors","normal"===n&&"tw-border tw-border-solid tw-border-white tw-bg-transparent tw-p-2 enabled:hover:tw-bg-white/10","selected"===n&&"tw-border-2 tw-border-solid tw-border-white tw-bg-white tw-p-2","correct"===n&&"tw-border-2 tw-border-solid tw-border-accent-brand-link tw-bg-neutral-dark tw-px-3 tw-py-2","incorrect"===n&&"tw-border-2 tw-border-solid tw-border-functional-magenta t
1w-bg-neutral-dark tw-px-3 tw-py-2 tw-shadow-[0_4px_2px_rgba(0,0,0,0.25)]"),children:(0,s.jsxs)(T.B,{spacing:"xs",className:"tw-w-full",children:[("correct"===n||"incorrect"===n)&&(0,s.jsx)("span",{className:(0,Y.cn)("tw-flex tw-h-6 tw-w-fit tw-items-center tw-rounded-2xl tw-px-3 tw-text-[13px] tw-font-bold tw-text-neutral-dark","correct"===n&&"tw-bg-accent-brand-link","incorrect"===n&&"tw-bg-functional-magenta"),children:"correct"===n?"æ£è§£":"䏿£è§£"}),(0,s.jsx)("span",{className:(0,Y.cn)("tw-text-[13px] tw-leading-[1.6]","selected"===n?"tw-font-bold tw-text-neutral-dark":"tw-text-white"),children:t})]})})},t3=e=>{let{explanation:t}=e;return(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-w-full",children:[(0,s.jsx)("span",{className:"tw-text-[13px] tw-font-bold tw-text-white",children:"解説"}),(0,s.jsx)("p",{className:"tw-text-[13px] tw-leading-[1.6] tw-text-white",children:t})]})},t6=e=>{let{variant:t,questionCount:n,answeredCount:a,answerResults:l,currentQuestionIndex:i,children:r}=e;return(0,s.jsxs)(T.B,{className:(0,Y.cn)("tw-w-full tw-gap-3 tw-p-3","pc"===t?"tw-rounded-lg tw-border tw-border-solid tw-border-neutral-night tw-bg-neutral-dark tw-p-4":"tw-rounded-2xl tw-bg-neutral-night"),children:[(0,s.jsxs)(X.z,{align:"center",justify:"between",className:"tw-w-full",children:[(0,s.jsxs)(X.z,{spacing:"xs",align:"center",width:"auto",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:quiz-outline",className:"tw-size-5 tw-shrink-0 tw-text-white"}),(0,s.jsx)("span",{className:"tw-text-[14px] tw-font-bold tw-leading-none tw-text-white",children:"ç解度ãã§ãã¯"}),(0,s.jsx)(t1,{})]}),(0,s.jsx)(X.z,{spacing:"xs",align:"center",width:"auto",children:Array.from({length:n},(e,t)=>{let n=t+1,r=n<=a,o=n===i,c=r?null==l?void 0:l[t]:void 0;return(0,s.jsx)("div",{className:(0,Y.cn)("tw-flex tw-size-[18px] tw-items-center tw-justify-center tw-rounded-full",!0===c&&"tw-bg-accent-brand-link",!1===c&&"tw-bg-functional-magenta",r&&void 0===c&&"tw-bg-[#8078DE]/25",!r&&o&&"tw-bg-white",!r&&!o&&"tw-bg-white/15"),children:r?(0,s.jsx)(Z.In,{icon:!1===c?"material-symbols:close":"material-symbols:check",className:(0,Y.cn)("tw-size-3",void 0===c?"tw-text-white":"tw-text-neutral-dark")}):(0,s.jsx)("span",{className:(0,Y.cn)("tw-text-[11px] tw-leading-none",o?"tw-font-bold tw-text-neutral-middle":"tw-text-white"),children:n})},n)})})]}),r]})},t5=e=>{let{index:t,correctness:n}=e,a=void 0!==n;return(0,s.jsxs)("div",{className:(0,Y.cn)("tw-inline-flex tw-w-fit tw-items-center tw-gap-0.5 tw-rounded-full tw-px-2 tw-py-1",!0===n&&"tw-bg-accent-brand-link",!1===n&&"tw-bg-functional-magenta",!a&&"tw-bg-white"),children:[(0,s.jsxs)("span",{className:(0,Y.cn)("tw-text-[12px] tw-font-bold tw-leading-none",a?"tw-text-neutral-dark":"tw-text-neutral-middle"),children:["åé¡",t]}),a&&(0,s.jsx)(Z.In,{icon:n?"material-symbols:check":"material-symbols:close",className:"tw-size-3.5 tw-text-neutral-dark"})]})},t8=e=>{let{variant:t}=e;return(0,s.jsxs)("div",{className:(0,Y.cn)("tw-w-full tw-animate-pulse tw-p-3","pc"===t?"tw-rounded-lg tw-border tw-border-solid tw-border-neutral-night tw-bg-neutral-dark tw-p-4":"tw-rounded-2xl tw-bg-neutral-night"),children:[(0,s.jsx)("div",{className:"tw-h-5 tw-w-32 tw-rounded tw-bg-white/10"}),(0,s.jsx)("div",{className:"tw-mt-5 tw-h-4 tw-w-3/4 tw-rounded tw-bg-white/10"}),(0,s.jsxs)("div",{className:"tw-mt-3 tw-space-y-2",children:[(0,s.jsx)("div",{className:"tw-h-10 tw-w-full tw-rounded-lg tw-bg-white/10"}),(0,s.jsx)("div",{className:"tw-h-10 tw-w-full tw-rounded-lg tw-bg-white/10"}),(0,s.jsx)("div",{className:"tw-h-10 tw-w-full tw-rounded-lg tw-bg-white/10"})]})]})},t9=e=>{let{variant:t,questionCount:n,message:a,onRetry:l}=e;return(0,s.jsx)(t6,{variant:t,questionCount:n,answeredCount:0,children:(0,s.jsxs)(T.B,{spacing:"md",align:"center",className:"tw-w-full tw-py-4",children:[(0,s.jsx)("p",{className:"tw-text-[13px] tw-text-white",children:a}),(0,s.jsx)(W.$,{variant:"secondary",size:"small",shape:"pill",width:"auto",className:"tw-px-8 tw-text-[14px]",onClick:l,children:"å試è¡ãã"})]})})},t7=e=>{let{variant:t,result:n,questionCount:a,animatePercent:l=!1,onSeekToAnchor:i,shareUrl:o,onCopyShareUrl:c}=e,d=((e,t)=>
1{let[n,s]=(0,r.useState)(t?0:e);return(0,r.useEffect)(()=>{let n;if(!t)return void s(e);let a=performance.now(),l=t=>{let i=Math.min((t-a)/1e3,1);s(Math.round(e*(1-(1-i)**3))),i<1&&(n=requestAnimationFrame(l))};return n=requestAnimationFrame(l),()=>cancelAnimationFrame(n)},[e,t]),n})(n.percent,l),w=(0,r.useMemo)(()=>tJ(n.answers.flatMap(e=>e.question?[e.question]:[]),n.answers),[n.answers]),[u,m]=(0,r.useState)(new Set);return(0,s.jsxs)(t6,{variant:t,questionCount:a,answeredCount:a,answerResults:w,children:[(0,s.jsxs)(T.B,{spacing:"xs",align:"center",className:"tw-w-full",children:[(0,s.jsxs)(X.z,{align:"end",width:"auto",children:[(0,s.jsx)("span",{className:"tw-text-[80px] tw-font-bold tw-tabular-nums tw-leading-none tw-text-white",children:d}),(0,s.jsx)("span",{className:"tw-text-[40px] tw-font-bold tw-leading-none tw-text-white",children:"%"})]}),(0,s.jsxs)("p",{className:"tw-text-[14px] tw-font-bold tw-text-white",children:["平忣ççï¼",n.averageCorrectPercent,"%"]})]}),void 0!==o&&c&&(0,s.jsxs)("button",{type:"button",onClick:c,className:"tw-mx-auto tw-flex tw-w-fit tw-items-center tw-gap-2 tw-py-2 tw-text-white tw-transition-opacity hover:tw-opacity-70",children:[(0,s.jsx)(Z.In,{icon:"ic:baseline-insert-link",className:"tw-size-5 tw--rotate-45"}),(0,s.jsx)("span",{className:"tw-text-[14px] tw-font-bold",children:"ç解度ãã§ãã¯ã®ãªã³ã¯ãã³ãã¼"})]}),(0,s.jsx)(T.B,{className:"tw-w-full",children:n.answers.map(e=>{let t=e.question;if(!t)return null;let n=u.has(e.questionId);return(0,s.jsxs)("div",{className:"tw-w-full tw-border-0 tw-border-t tw-border-solid tw-border-white/10",children:[(0,s.jsxs)("button",{type:"button","aria-expanded":n,onClick:()=>(e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})(e.questionId),className:"tw-flex tw-w-full tw-items-center tw-gap-2 tw-py-3 tw-text-left",children:[(0,s.jsxs)(T.B,{spacing:"xs",className:"tw-min-w-0 tw-flex-1",children:[(0,s.jsx)(t5,{index:t.index,correctness:e.isCorrect}),(0,s.jsx)("span",{className:"tw-text-[14px] tw-leading-[1.6] tw-text-white",children:t.stem})]}),(0,s.jsx)(Z.In,{icon:n?"ic:baseline-remove":"ic:baseline-add",className:(0,Y.cn)("tw-size-5 tw-shrink-0",n?"tw-text-white":"tw-text-neutral-pale")})]}),n&&(0,s.jsxs)(T.B,{spacing:"sm",className:"tw-w-full tw-pb-3",children:[t.options.map(t=>(0,s.jsx)(t4,{text:t.text,state:t.optionId===e.correctOptionId?"correct":t.optionId!==e.selectedOptionId||e.isCorrect?"normal":"incorrect",disabled:!0},t.optionId)),""!==t.explanation&&(0,s.jsx)(t3,{explanation:t.explanation}),t.anchorStartSec>0&&i&&(0,s.jsxs)(W.$,{variant:"secondary",size:"small",shape:"pill",width:"full",className:"tw-text-[14px]",onClick:()=>i(t.anchorStartSec),children:["該å½ç®æ(",(0,eh.rW)(t.anchorStartSec),")ãåçãã"]})]})]},e.questionId)})})]})},ne={currentQuestionIndex:0,answeredCount:0,answerResults:[],showResult:!1,isResultFromAnswerFlow:!1},nt=e=>{var t;let{userData:n}=(0,y.Z2)();return(0,s.jsx)(nn,{...e},"".concat(e.episodeId,":").concat(null!=(t=null==n?void 0:n.userId)?t:"anonymous"))},nn=e=>{var t,n;let{episodeId:a,variant:l,onTimestampClick:i,onRequestSignUp:o}=e,c="pc"===l,{isInitialized:d,isSignedIn:w}=(0,y.Z2)(),{data:u,isError:m}=(0,f.I)(tH({episodeId:a})),p=null==u?void 0:u[0],x=(0,L.bP)(),h=c&&w&&void 0!==p,{data:g,isFetchedAfterMount:b,isPending:j,isError:v,refetch:N}=(0,f.I)({...(e=>(0,tK.j)({queryKey:["getQuizProgress",e],queryFn:()=>tX(e)}))({quizId:null!=(t=null==p?void 0:p.quizId)?t:0}),enabled:h,refetchOnMount:"always"}),[k,C]=(0,r.useState)(ne),[S,I]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(d&&void 0!==p&&(!c||!w||void 0!==g&&b)&&!S){if(c&&w&&void 0!==g){let e=p.questions.length-1,t=Math.min(Math.max(g.answeredCount,0),p.questions.length),n=p.questions.findIndex(e=>e.index===g.nextQuestionIndex),s=-1!==n?n:Math.min(t,e),a=tJ(p.questions,g.answeredQuestions);C({...ne,currentQuestionIndex:s,answeredCount:t,answerResults:a,attemptUlid:g.attemptUlid,showResult:g.isCompleted})}else C(ne);I(!0)}},[d,c,w,p,g,b,S]);let E=c&&w&&void 0!==p&&k.showResult,{data:R,isFetchedAfterMount:T,isError:z,refetch:M}=(0,f.I)({...(e=>(0,tK.j)({queryKey:["getQuizResult",e],queryFn:()=>t$(e)}))({quizId:null!=(n=null==p?void 0:p.quizId)?n:0}),enabled:E,refetchOnMount:"always"}),{mutate:q,isPending:A}=(0,K.n)((0,tG.I)({mutationFn:tY,meta:{invalidates:[["getQuizProgress"],["getQuizResult"],["listMyAnsweredQuizzes"]]}})),B=(0,r.useRef)(!1),U=null==p?void 0:p.questions[k.currentQuestionIndex],D=(0,r.useCallback)(e=>{C(t=>void 0===t.judgement?{...t,selectedOptionId:e}:t)},[]),O=(0,r.useCallback)(()=>
1{if(!c)return void x.open();if(!w){null==o||o();return}void 0===p||void 0===U||void 0===k.selectedOptionId||void 0!==k.judgement||B.current||(B.current=!0,q({quizId:p.quizId,questionId:U.questionId,optionId:k.selectedOptionId,attemptUlid:k.attemptUlid},{onSuccess:e=>{C(t=>{let n=[...t.answerResults];return n[U.index-1]=e.isCorrect,{...t,judgement:e,attemptUlid:e.attemptUlid,answeredCount:t.answeredCount+1,answerResults:n}}),B.current=!1},onError:e=>{V.oR.error((0,P.Bf)(e,"ã¯ã¤ãºã®åçéä¿¡ã«å¤±æãã¾ãã")),N().then(()=>I(!1)).finally(()=>{B.current=!1})}}))},[c,x,w,o,p,U,k.selectedOptionId,k.judgement,k.attemptUlid,q,N]),Q=(0,r.useCallback)(()=>{C(e=>{var t;if(void 0===e.judgement)return e;let n=(null!=(t=null==p?void 0:p.questions.length)?t:1)-1;return e.currentQuestionIndex>=n?e:{...e,currentQuestionIndex:e.currentQuestionIndex+1,selectedOptionId:void 0,judgement:void 0}})},[p]),W=(0,r.useCallback)(()=>{C(e=>{var t;return(null==(t=e.judgement)?void 0:t.isCompleted)===!0?{...e,showResult:!0,isResultFromAnswerFlow:!0}:e})},[]),X=void 0!==p?"".concat(F.uP,"/app/quiz/").concat(p.quizId):void 0,$=(0,r.useCallback)(async()=>{if(void 0!==X)try{await navigator.clipboard.writeText(X),V.oR.success("URLãã³ãã¼ãã¾ãã")}catch(e){V.oR.error("URLã®ã³ãã¼ã«å¤±æãã¾ãã")}},[X]);return m||void 0===p||void 0===U?null:c&&!d?(0,s.jsx)(t8,{variant:l}):c&&w&&v?(0,s.jsx)(t9,{variant:l,questionCount:p.questions.length,message:"ã¯ã¤ãºã®é²æã®åå¾ã«å¤±æãã¾ãã",onRetry:()=>void N()}):c&&!S&&w&&j?(0,s.jsx)(t8,{variant:l}):k.showResult?z?(0,s.jsx)(t9,{variant:l,questionCount:p.questions.length,message:"çµæã®åå¾ã«å¤±æãã¾ãã",onRetry:()=>void M()}):void 0!==R&&T?(0,s.jsx)(t7,{variant:l,result:R,questionCount:p.questions.length,animatePercent:k.isResultFromAnswerFlow,onSeekToAnchor:i,shareUrl:X,onCopyShareUrl:$}):(0,s.jsx)(t8,{variant:l}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t2,{variant:l,questionCount:p.questions.length,answeredCount:k.answeredCount,answerResults:k.answerResults,question:U,selectedOptionId:k.selectedOptionId,judgement:k.judgement,isSubmitting:A,onSelectOption:D,onSubmit:O,onNext:Q,onShowResult:W}),!c&&(0,s.jsx)(_.t,{...x})]})},ns=e=>{var t;let{data:n}=(0,f.I)(tH({episodeId:e}));return(null!=(t=null==n?void 0:n.length)?t:0)>0};var na=n(31122),nl=n(85736),ni=n(26703);let nr=async e=>{var t,n,s,a,l,i,r,o,c,d,w,u,m,p,x,h,g,b;let{tagCode:f,page:j=1,perPage:v=50,orderBy:y}=e;if(!f)throw Error("tagCode is required");let N={tag_code:f,page:j,per_page:v};void 0!==y&&(N.order_by=y);let k=(0,M.VY)("/chapter/list_by_tag",N),C=await (0,M.Jt)(k,q.Xt.Response.Chapter.ListEpisodesByTagResponse.decode);if(C.error)throw Error(C.error.message);if(!C.data)throw Error("No data received");let S=(null!=(l=C.data.episodes)?l:[]).map(e=>{var t;return null!=(t=e.id)?t:0}).filter(e=>e>0);if(0===S.length)return{episodes:[],pagination:{totalItems:null!=(d=null==(i=C.data.pagination)?void 0:i.totalItems)?d:0,totalPages:null!=(w=null==(r=C.data.pagination)?void 0:r.totalPages)?w:1,currentPage:null!=(u=null==(o=C.data.pagination)?void 0:o.currentPage)?u:j,perPage:null!=(m=null==(c=C.data.pagination)?void 0:c.perPage)?m:v}};let I=await (0,ea.t)({episodeIds:S}).catch(e=>(console.warn("Failed to fetch episode metrics:",e),new Map)),E=(null!=(p=C.data.episodes)?p:[]).map(e=>{var t,n,s,a,l,i,r,o,c,d,w;let u=null!=(n=e.id)?n:0,m=I.get(u);return{id:u,title:null!=(s=e.name)?s:"",description:null!=(a=e.description)?a:"",thumbnailUrl:null!=(l=e.thumbnailUrl)?l:"",publishTime:((0,ni.e)(e.publishedAt),(0,nl.k)(e.publishedAt)),durationSeconds:null!=(i=e.durationSeconds)?i:0,isArticleAvailable:!1,commentCount:null!=(r=null==m?void 0:m.commentCount)?r:0,ratingCount:null!=(o=null==m?void 0:m.ratingCount)?o:0,ratingAverage:null!=(c=null==m?void 0:m.ratingAverage)?c:0,viewCount:null!=(d=null==m?void 0:m.viewCount)?d:0,casts:null!=(w=null==(t=e.cast)?void 0:t.split(",").map(e=>e.trim()).filter(e=>e))?w:[]}}),R={totalItems:null!=(x=null==(t=C.data.pagination)?void 0:t.totalItems)?x:E.length,totalPages:null!=(h=null==(n=C.data.pagination)?void 0:n.totalPages)?h:1,
1currentPage:null!=(g=null==(s=C.data.pagination)?void 0:s.currentPage)?g:j,perPage:null!=(b=null==(a=C.data.pagination)?void 0:a.perPage)?b:v};return{episodes:E,pagination:R}};var no=n(41889);let nc=e=>{let{tags:t,selectedTag:n,onTagSelect:a,className:l,withoutRecommended:i=!1}=e,r=[...i?[]:[{label:"ãããã",value:"recommended"}],...t.map(e=>({label:e.name,value:e.code}))];return(0,s.jsx)("div",{className:(0,Y.cn)("tw-px-6 sp:tw-px-3",l),children:(0,s.jsxs)(no.F,{className:"tw-w-full tw-pb-2",children:[(0,s.jsx)("div",{className:"tw-flex tw-gap-2",children:r.map((e,t)=>(0,s.jsx)("button",{onClick:()=>a(e.value,t),className:(0,Y.cn)("tw-flex-shrink-0 tw-rounded-full tw-border tw-font-medium tw-transition-colors","tw-px-4 tw-py-2 tw-text-sm sp:tw-px-3 sp:tw-py-1 sp:tw-text-xs",n===e.value?"tw-border-neutral-bright tw-bg-neutral-bright tw-text-neutral-dark":"tw-border-neutral-middle tw-bg-transparent tw-text-neutral-bright hover:tw-border-neutral-bright"),children:e.label},e.value))}),(0,s.jsx)(no.$,{orientation:"horizontal"})]})})},nd=e=>{let{variant:t,episodes:n,episodeUserStateMap:a,eventData:l,onClickAppInstallLink:i}=e,r="sp"===t,o=r?n.slice(0,10):n;return(0,s.jsxs)(T.B,{spacing:"md",paddingX:"md",paddingY:r?"0":"sm",className:r?"tw-px-3":"",children:[(0,s.jsx)(eo._,{episodes:o,episodeUserStateMap:a,size:"S",titleSize:"S",withoutDescription:r,withoutRating:!r,showWatchLater:!r,spAppLayout:!0,spacing:r?"sm":"md",eventData:l}),r&&n.length>10&&i&&(0,s.jsx)(T.B,{className:"tw-mt-4",children:(0,s.jsx)(W.$,{variant:"primary",size:"medium",onClick:i,children:"ã¢ããªã§ãã£ã¨è¦ã"})})]})},nw=e=>{let{variant:t}=e,n="sp"===t;return(0,s.jsx)(T.B,{spacing:"md",paddingX:"md",paddingY:n?"0":"sm",className:n?"tw-px-3":"",children:Array.from({length:5},(e,t)=>(0,s.jsxs)("div",{className:"tw-flex tw-gap-4",children:[(0,s.jsx)(er.E,{className:"tw-h-16 tw-w-28 tw-shrink-0"}),(0,s.jsxs)(T.B,{spacing:"xs",className:"tw-flex-1",children:[(0,s.jsx)(er.E,{className:"tw-h-4 tw-w-3/4"}),(0,s.jsx)(er.E,{className:"tw-h-3 tw-w-1/2"}),(0,s.jsx)(er.E,{className:"tw-h-2 tw-w-1/3"})]})]},t))})},nu=[{key:"tags",label:"é¢é£ã¿ã°"},{key:"recommended",label:"ããªãã¸ã®ãããã"}],nm=e=>{var t;let{variant:n,tags:a,eventData:l,episodeId:i,onClickAppInstallLink:o}=e,[c,d]=(0,r.useState)(()=>(e=>{let t=e[0];return t?{mode:"tags",tagCode:t.code}:{mode:"recommended"}})(a)),w="recommended"===c.mode,u="tags"===c.mode?c.tagCode:void 0,{data:m}=(0,f.I)({...(0,na.b)({count:20}),enabled:w}),{data:p}=(0,f.I)({queryKey:x.e.listTagEpisodes({tagCode:null!=u?u:"",page:1,perPage:20}),queryFn:()=>nr({tagCode:null!=u?u:"",page:1,perPage:20}),enabled:!w}),h=w?m:p,g=null!=(t=null==h?void 0:h.episodes)?t:[],b=g.map(e=>e.id),{data:j}=(0,f.I)({...(0,el.v)({episodeIds:b}),enabled:b.length>0}),v=(e,t,n)=>{k.h.sendSelectFeatureTag({tagCode:"recommended"===e?"":e,tagName:t,screenName:"movie",index:n+1,episodeId:i})},y=a.length>0?nu:nu.filter(e=>"tags"!==e.key),N=(0,s.jsx)("div",{role:"tablist",className:"tw-flex tw-w-full tw-items-center tw-border-b-2 tw-border-solid tw-border-neutral-pale",children:y.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>(e=>{"recommended"===e&&v("recommended","ãããã",0),d(t=>((e,t,n)=>{var s,a;if("recommended"===t)return"tags"===e.mode?{mode:"recommended",lastTagCode:e.tagCode}:e;let l=null!=(a="recommended"===e.mode?e.lastTagCode:e.tagCode)?a:null==(s=n[0])?void 0:s.code;return void 0!==l?{mode:"tags",tagCode:l}:e})(t,e,a))})(e.key),"aria-selected":c.mode===e.key,role:"tab",className:(0,Y.cn)("tw-relative tw-flex tw-h-12 tw-flex-1 tw-items-center tw-justify-center","tw-text-sm tw-font-bold tw-leading-none tw-text-neutral-pale","tw-transition-colors hover:tw-text-white",c.mode===e.key&&"tw-text-white after:tw-absolute after:tw-inset-x-0 after:tw--bottom-[2px] after:tw-h-[3px] after:tw-bg-white"),children:e.label},e.key))}),C=h?(0,s.jsx)(nd,{variant:n,episodes:g,episodeUserStateMap:null!=j?j:new Map,eventData:l,onClickAppInstallLink:o?()=>o(null!=u?u:"recommended"):void 0}):(0,s.jsx)(nw,{variant:n});return(0,s.jsxs)(T.B,{spacing:"md",children:[N,"tags"===c.mode&&(0,s.jsx)(nc,{tags:a,selectedTag:c.tagCode,onTagSelect:(e,t)=>
1{var n,s;let l=null!=(s=null==(n=a.find(t=>t.code===e))?void 0:n.name)?s:e;v(e,l,t),d({mode:"tags",tagCode:e})},withoutRecommended:!0}),C]})};var np=n(65280);let nx=e=>{let{value:t,onValueChange:n,tocSummarySlot:a,articleSlot:l,commentsSlot:i,memosSlot:r,commentCount:o,memoCount:c}=e,d=[{key:"toc",label:"ç« ãã¨ã®è¦ç¹",content:a},{key:"article",label:"è¨äº",content:l,forceMount:!0},{key:"comments",label:"ã³ã¡ã³ã",content:i,count:o,forceMount:!0},{key:"memos",label:"ã¡ã¢",content:r,count:c,forceMount:!0}];return(0,s.jsxs)(np.bL,{value:t,onValueChange:e=>{(e=>"toc"===e||"article"===e||"comments"===e||"memos"===e)(e)&&n(e)},className:"tw-flex tw-min-h-full tw-w-full tw-shrink-0 tw-flex-col tw-pt-4",children:[(0,s.jsx)(np.B8,{className:"tw-sticky tw-top-0 tw-z-10 tw-flex tw-w-full tw-items-center tw-border-b-2 tw-border-solid tw-border-neutral-pale tw-bg-neutral-dark",children:d.map(e=>{let t;return(0,s.jsx)(np.l9,{value:e.key,className:(0,Y.cn)("tw-relative tw-flex tw-flex-1 tw-items-center tw-justify-center tw-gap-2 tw-py-3","tw-text-sm tw-font-bold tw-leading-none tw-text-neutral-pale","tw-transition-colors hover:tw-text-white","data-[state=active]:tw-text-white","data-[state=active]:after:tw-absolute data-[state=active]:after:tw-inset-x-0 data-[state=active]:after:tw--bottom-[2px] data-[state=active]:after:tw-h-[3px] data-[state=active]:after:tw-bg-white"),children:(0,s.jsxs)("span",{className:"tw-whitespace-nowrap",children:[e.label,void 0!==e.count&&e.count>0&&(t=e.count,"ï¼".concat((e=>e>99?"".concat(99,"+"):String(e))(t),"ï¼"))]})},e.key)})}),d.map(e=>(0,s.jsx)(np.UC,{value:e.key,forceMount:!!e.forceMount||void 0,className:(0,Y.cn)("tw-min-h-[calc(100vh-46px)] tw-w-full tw-shrink-0",e.forceMount&&"data-[state=inactive]:tw-hidden"),children:e.content},e.key))]})};var nh=n(51741);let ng=e=>{let{variant:t,tocSummaries:n,error:a,onRetry:l,onTimestampClick:i,initialTimeSeconds:o,displayType:c="movie",episodeId:d,episodeName:w}=e,u="sp"===t,[m,p]=(0,r.useState)(void 0),[x,h]=(0,r.useState)([]),[g,b]=(0,r.useState)(!1),f=e=>{let t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))},j=(0,r.useMemo)(()=>{if(!o||0===n.length)return;let e=n.find(e=>o>=e.startSeconds&&o<e.endSeconds);return null==e?void 0:e.id.toString()},[o,n]),v=(0,r.useMemo)(()=>j?[j]:[],[j]),y=g?m:j,N=g?x:v,C=(e,t)=>{if(t.includes(e))return;let s=n.findIndex(t=>t.id.toString()===e),a=n[s];a&&k.h.sendExpandAiSummary({episodeId:d,episodeName:w,index:s+1,summaryTitle:a.title})},S=e=>{p(e),b(!0),e&&e!==y&&C(e,y?[y]:[])},I=e=>{h(e),b(!0),e.filter(e=>!N.includes(e)).forEach(e=>C(e,N))};return(0,s.jsx)(T.B,{spacing:0,className:"tw-min-w-0",children:(0,s.jsxs)(T.B,{spacing:"md",className:"tw-p-6",children:[a&&(0,s.jsxs)(T.B,{spacing:"md",align:"center",paddingY:"xl",children:[(0,s.jsx)(Z.In,{icon:"ic:baseline-error-outline",className:"tw-h-6 tw-w-6 tw-text-functional-danger"}),(0,s.jsx)(z.E,{size:"S",className:"tw-text-neutral-bright",children:a}),(0,s.jsx)(W.$,{variant:"secondary",size:"small",onClick:l,children:"å試è¡"})]}),!a&&0===n.length&&(0,s.jsx)(T.B,{spacing:"md",align:"center",paddingY:"md",className:"tw-w-full",children:(0,s.jsx)(z.E,{size:"S",className:"tw-w-full tw-text-center tw-text-neutral-bright",children:"ãã®åç»ã«ã¯ç« ãã¨ã®è¦ç¹ãããã¾ãã"})}),!a&&n.length>0&&(()=>{let e=n.map(e=>(0,s.jsxs)(nh.As,{value:e.id.toString(),className:"tw-border-0 tw-bg-transparent",children:[(0,s.jsxs)(nh.$m,{className:"tw-flex tw-h-12 tw-w-full tw-items-center tw-justify-between tw-gap-2 tw-rounded-xl tw-bg-neutral-night tw-p-3 tw-transition-colors hover:tw-bg-neutral-middle/40 hover:tw-no-underline data-[state=open]:tw-rounded-b-none [&>svg]:tw-hidden [&[data-state=closed]_.minus-icon]:tw-hidden [&[data-state=open]_.plus-icon]:tw-hidden",children:[(0,s.jsx)("div",{className:"tw-min-w-0 tw-flex-1 tw-text-left",children:(0,s.jsx)(z.E,{size:"M",weight:"bold",className:"tw-truncate tw-text-neutral-bright",children:e.title})}),(0,s.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[(0,s.jsxs)(z.E,{size:"XS",className:"tw-text-neutral-light",children:[f(e.startSeconds)," -"," ",f(e.endSeconds)]}),(0,s.jsxs)("div",{className:"tw-h-6 tw-w-6",children:[(0,s.jsx)(Z.In,{icon:"ic:baseline-add",className:"plus-icon tw-h-6 tw-w-6 tw-text-neutral-bright"}),(0,s.jsx)(Z.In,{icon:"ic:baseline-remove",className:"minus-icon tw-h-6 tw-w-6 tw-text-neutral-bright"})]})]})]}
1),(0,s.jsx)(nh.ub,{className:"tw-w-full tw-overflow-hidden tw-rounded-b-xl tw-bg-neutral-night tw-p-0",children:(0,s.jsx)("div",{className:"tw-px-3 tw-pb-3",children:(0,s.jsx)("div",{className:"tw-pt-1",children:(0,s.jsxs)(T.B,{spacing:"md",align:"end",children:[(0,s.jsx)(z.E,{size:"S",className:"tw-w-full tw-whitespace-pre-wrap tw-break-words tw-leading-relaxed tw-text-neutral-bright",children:e.body}),"movie"===c&&(0,s.jsx)(W.$,{variant:"light",size:"xsmall",shape:"pill",width:"auto",className:"tw-border-0 tw-bg-neutral-bright tw-text-neutral-night hover:tw-bg-neutral-pale",onClick:()=>null==i?void 0:i(e.startSeconds),children:(0,s.jsx)(z.E,{size:"XS",weight:"bold",className:"tw-text-neutral-night",children:"ãã®ç« ãåç"})})]})})})})]},e.id));return u?(0,s.jsx)(nh.nD,{type:"single",collapsible:!0,className:"tw-w-full tw-space-y-2",value:y,onValueChange:S,children:e}):(0,s.jsx)(nh.nD,{type:"multiple",className:"tw-w-full tw-space-y-2",value:N,onValueChange:I,children:e})})()]})})},nb=()=>(0,s.jsx)(T.B,{spacing:0,paddingX:"sm",className:"tw-min-w-0",children:(0,s.jsx)(T.B,{spacing:"md",className:"tw-mb-6 tw-rounded-lg tw-bg-neutral-dark",padding:"md",children:(0,s.jsx)(T.B,{spacing:"sm",children:[1,2,3].map(e=>(0,s.jsx)(er.E,{className:"tw-h-12 tw-w-full tw-rounded-lg"},e))})})}),nf=e=>{let{variant:t,episodeId:n,onTimestampClick:a,initialTimestamp:l,displayType:i="movie",episodeName:o}=e,{data:c,error:d,refetch:w}=(0,f.I)({queryKey:x.e.listTocSummaries({episodeId:n}),queryFn:()=>(0,eN.b)({episodeId:n})}),{data:u}=(0,f.I)({...(0,el.v)({episodeIds:[n]})}),m=(0,r.useMemo)(()=>{if(void 0!==l)return l;let e=null==u?void 0:u.get(n);if(e&&e.playbackPositionSeconds>0)return e.playbackPositionSeconds},[l,u,n]),p=()=>{w()};return c||d?d?(0,s.jsx)(ng,{variant:t,tocSummaries:[],error:"ç« ãã¨ã®è¦ç¹ã®åå¾ã«å¤±æãã¾ãã",onRetry:p,onTimestampClick:a,initialTimeSeconds:m,displayType:i,episodeId:n,episodeName:o}):(0,s.jsx)(ng,{variant:t,tocSummaries:null!=c?c:[],error:null,onRetry:p,onTimestampClick:a,initialTimeSeconds:m,displayType:i,episodeId:n,episodeName:o}):(0,s.jsx)(nb,{})},nj=e=>{let{currentEpisodeId:t}=e,{data:n}=(0,f.I)({queryKey:x.e.listWatchLater(),queryFn:()=>(0,g.y)()}),a=(0,r.useMemo)(()=>{var e;return null!=(e=null==n?void 0:n.episodes)?e:[]},[null==n?void 0:n.episodes]),l=(0,r.useMemo)(()=>a.map(e=>e.id),[a]),{data:i}=(0,f.I)({...(0,el.v)({episodeIds:l}),enabled:l.length>0});return(0,s.jsx)(tF,{title:"ãã¨ã§è¦ã",episodeCount:a.length,episodes:a,episodeUserStateMap:null!=i?i:new Map,currentEpisodeId:t,href:"/watch-later",triggerIcon:"ic:round-bookmark-border",linkQuery:{watchLater:"true"},eventData:{screenName:"bookmark",sectionName:"ãã¨ã§è¦ãåçã³ã³ããã¹ã"}})},nv=e=>{let{episodeId:t,episodeDetail:n,articleHtml:a,defaultRightTab:l,core:o}=e,c=(e=>{var t;let{episodeId:n,defaultRightTab:s}=e,a=(0,i.useRouter)(),{isInitialized:l,isSignedIn:o}=(0,y.Z2)(),{width:c,commit:d,minWidth:w,maxWidth:u}=(0,eU.ay)(),{data:m}=(0,f.I)({queryKey:x.e.batchGetEpisodeCommentCounts({episodeIds:[n]}),queryFn:()=>(0,eF.XQ)({episodeIds:[n]})}),p=null==m||null==(t=m[0])?void 0:t.totalCount,{data:h}=(0,f.I)({queryKey:x.e.listEpisodeMemos({episodeId:n}),queryFn:()=>(0,eF.h8)({episodeId:n}),enabled:o}),g=o?null==h?void 0:h.length:void 0,b=(0,r.useMemo)(()=>{let e=a.query.tab;return"toc"===e||"article"===e||"comments"===e||"memos"===e?e:s},[a.query.tab,s]),j=(0,r.useCallback)(e=>{let{episodeId:t,display_type:s,...l}=a.query;a.replace({pathname:"/movie/".concat(n),query:{...l,tab:e}},void 0,{shallow:!0})},[a,n]),v=(0,r.useCallback)(()=>j("memos"),[j]),N=(0,r.useCallback)(()=>j("comments"),[j]),[k,C]=(0,eD.Y)(),S=(0,L.bP)();return(0,r.useEffect)(()=>{if(!l)return;let e=new Date;!o&&k<=e.getTime()&&(S.open(),C(e.getTime()+864e5))},[C,k,S,o,l]),{rightColumnWidth:c,rightColumnMinWidth:w,rightColumnMaxWidth:u,commitRightColumnWidth:d,rightColumnWidthCss:"".concat(c,"px"),leftColumnWidthCss:"calc(100% - ".concat(c,"px)"),activeRightTab:b,handleChangeRightTab:j,handleSwitchToMemoTab:v,handleSwitchToCommentTab:N,commentCount:p,memoCount:g,suggestionModalDisclosure:S}})({episodeId:t,defaultRightTab:l}),d=ns(t);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eP,{onSwitchToMemoTab:c.handleSwitchToMemoTab,onSwitchToCommentTab:c.handleSwitchToCommentTab}),(0,s.jsx)("div",{style:{width:c.leftColumnWidthCss},children:(0,s.jsxs)(T.B,{spacing:"lg",className:"tw-w-full tw-min-w-0 tw-py-8 tw-pb-10",children:[(0,s.jsx)(eB,{variant:"pc",episodeId:t,thumbnailUrl:n.thumbnailUrl,onClickAppInstallLink:o.handleClickAppInstallLink,onTimestampClick:o.handleTimestampClick,initialTimestamp:o.initialTimestamp,screenName:"movie",nextEpisode:o.nextEpisode,onPlayNext:o.onPlayNext,programRowSlot:(0,s.jsx)(eL.V,{variant:"pc",programId:n.program.id,programName:n.program.name,thumbnailSquareUrl:n.program.thumbnailSquareUrl?n.program.thumbnailSquareUrl:n.program.thumbnailUrl?n.program.thumbnailUrl:void 0,screenName:"movie"}),titleSideActionsSlot:(0,s.jsx)(en,{variant:"pc",displayType:"mov
1ie",episodeId:t,onClickAppInstallLink:o.handleClickAppInstallLink},"pc-".concat(t)),quizSlot:d?(0,s.jsx)(nt,{variant:"pc",episodeId:t,onTimestampClick:o.handleTimestampClick,onRequestSignUp:c.suggestionModalDisclosure.open},"quiz-".concat(t)):void 0},t),(0,s.jsx)(nm,{variant:"pc",tags:n.tags,episodeId:t,eventData:{screenName:"movie",sectionName:"ããããã®æ å",srcEpisodeId:t,srcEpisodeName:n.title}},t)]})}),(0,s.jsxs)("div",{className:"tw-fixed tw-bottom-0 tw-right-0 tw-top-14 tw-z-20 tw-border-l tw-border-solid tw-border-neutral-middle tw-bg-neutral-dark",style:{width:c.rightColumnWidthCss},children:[(0,s.jsx)(E.V,{currentWidth:c.rightColumnWidth,minWidth:c.rightColumnMinWidth,maxWidth:c.rightColumnMaxWidth,onResize:c.commitRightColumnWidth}),(0,s.jsxs)(T.B,{className:"tw-h-full tw-w-full tw-overflow-y-auto",children:[(o.playlistId||o.isWatchLaterContext)&&(0,s.jsxs)("div",{className:"tw-relative tw-w-full tw-shrink-0",children:[o.playlistId?(0,s.jsx)(tQ,{playlistId:o.playlistId,currentEpisodeId:t}):(0,s.jsx)(nj,{currentEpisodeId:t}),(0,s.jsx)("div",{"aria-hidden":!0,className:"tw-pointer-events-none tw-absolute tw-inset-x-0 tw-bottom-0 tw-h-16 tw-bg-gradient-to-b tw-from-transparent tw-to-[#0D1325]"})]}),(0,s.jsx)(nx,{value:c.activeRightTab,onValueChange:c.handleChangeRightTab,commentCount:c.commentCount,memoCount:c.memoCount,tocSummarySlot:(0,s.jsx)(nf,{variant:"pc",episodeId:t,onTimestampClick:o.handleTimestampClick,initialTimestamp:o.initialTimestamp,episodeName:n.title}),articleSlot:a?(0,s.jsx)(tB,{articleHtml:a,episodeId:n.id,episodeName:n.title}):(0,s.jsx)(T.B,{spacing:"md",align:"center",paddingY:"md",paddingX:"md",className:"tw-w-full",children:(0,s.jsx)(z.E,{size:"S",className:"tw-w-full tw-text-center tw-text-neutral-bright",children:"ãã®åç»ã«ã¯è¨äºãããã¾ãã"})}),commentsSlot:(0,s.jsx)(tL,{episodeId:t,onTimestampClick:o.handleTimestampClick,onClickAppInstallLink:o.handleClickAppInstallLink,isActive:"comments"===c.activeRightTab}),memosSlot:(0,s.jsx)(t_,{variant:"pc",episodeId:t,onTimestampClick:o.handleTimestampClick,isActive:"memos"===c.activeRightTab})})]})]}),(0,s.jsx)(eW,{leftColumnWidthCss:c.leftColumnWidthCss}),(0,s.jsx)(R.b,{...c.suggestionModalDisclosure})]})},ny=e=>{let{onClick:t,className:n,trailingIcon:a=!1}=e;return(0,s.jsxs)("button",{type:"button",onClick:t,className:(0,Y.cn)("tw-flex tw-h-11 tw-w-full tw-items-center tw-font-bold tw-transition-all",n),children:[(0,s.jsxs)("span",{className:"tw-flex tw-items-center tw-gap-1",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:article-outline",width:24}),"è¨äºã§èªã"]}),a&&(0,s.jsx)(Z.In,{icon:"material-symbols:keyboard-arrow-right",width:20})]})},nN=e=>{let{summary:t,className:n}=e;return(0,s.jsxs)("span",{className:n,children:[(0,eh.rW)(t.startSeconds),"-",(0,eh.rW)(t.endSeconds)]})},nk=e=>{let{tocSummaries:t,onTimestampClick:n,onClickArticle:a}=e,[l,i]=(0,r.useState)(!1),[o,c]=(0,r.useState)(),{digest:d,chapters:w}=ek(t);return 0===t.length?null:(0,s.jsxs)("div",{className:"tw-w-full tw-rounded-2xl tw-bg-neutral-night tw-px-3 tw-py-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":l,className:"tw-flex tw-h-11 tw-w-full tw-items-center tw-justify-between tw-border-b tw-border-solid tw-border-white/10 tw-text-neutral-bright",children:[(0,s.jsxs)("span",{className:"tw-flex tw-items-center tw-gap-2 tw-text-sm tw-font-bold",children:[(0,s.jsx)(Z.In,{icon:"material-symbols:auto-stories-outline",width:24}),"ç« ãã¨ã®è¦ç¹"]}),(0,s.jsx)(Z.In,{icon:l?"material-symbols:keyboard-arrow-up":"material-symbols:keyboard-arrow-down",width:20})]}),d&&(0,s.jsxs)("div",{className:"tw-py-2",children:[(0,s.jsxs)("div",{className:"tw-flex tw-h-11 tw-items-center tw-justify-between tw-py-2",children:[(0,s.jsx)("span",{className:"tw-min-w-0 tw-flex-1 tw-truncate tw-text-[13px] tw-font-bold tw-text-neutral-bright",children:d.title}),(0,s.jsx)(nN,{summary:d,className:"tw-shrink-0 tw-text-[13px] tw-text-neutral-pale"})]}),(0,s.jsx)("p",{className:"tw-whitespace-pre-wrap tw-break-words tw-text-[14px] tw-leading-[1.6] tw-text-neutral-bright",children:d.body})]}),l&&w.map(e=>
1{let t=o===e.id;return(0,s.jsxs)("div",{className:"tw-border-t tw-border-solid tw-border-white/10",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>c(t?void 0:e.id),"aria-expanded":t,className:"tw-flex tw-h-11 tw-w-full tw-items-center tw-justify-between tw-gap-2 tw-py-2",children:[(0,s.jsx)("span",{className:"tw-min-w-0 tw-flex-1 tw-truncate tw-text-left tw-text-[13px] tw-font-bold tw-text-neutral-bright",children:e.title}),(0,s.jsxs)("span",{className:"tw-flex tw-shrink-0 tw-items-center tw-gap-2",children:[(0,s.jsx)(nN,{summary:e,className:"tw-text-xs tw-text-neutral-pale"}),(0,s.jsx)(Z.In,{icon:t?"material-symbols:remove":"material-symbols:add",width:20,className:"tw-text-neutral-bright"})]})]}),t&&(0,s.jsxs)("div",{className:"tw-flex tw-flex-col tw-gap-2 tw-pb-4",children:[(0,s.jsx)("p",{className:"tw-whitespace-pre-wrap tw-break-words tw-text-[14px] tw-leading-[1.6] tw-text-neutral-bright",children:e.body}),n&&(0,s.jsx)("button",{type:"button",onClick:()=>n(e.startSeconds),className:"tw-h-8 tw-self-end tw-rounded-full tw-bg-neutral-bright tw-px-4 tw-text-[13px] tw-font-bold tw-text-neutral-dark tw-transition-opacity hover:tw-opacity-80",children:"ãã®ç« ãåç"})]})]},e.id)}),a&&(0,s.jsx)(ny,{onClick:a,className:"tw-justify-end tw-border-t tw-border-solid tw-border-white/10 tw-text-[13px] tw-text-neutral-pale hover:tw-text-neutral-bright"})]})},nC=e=>{let{onClickArticle:t}=e;return(0,s.jsx)("div",{className:"tw-w-full tw-rounded-2xl tw-bg-neutral-night tw-px-3 tw-py-1",children:(0,s.jsx)(ny,{onClick:t,className:"tw-justify-between tw-text-sm tw-text-neutral-bright hover:tw-opacity-80",trailingIcon:!0})})},nS=()=>(0,s.jsx)("div",{className:"tw-w-full tw-rounded-2xl tw-bg-neutral-night tw-px-3 tw-py-1",children:(0,s.jsxs)("div",{className:"tw-flex tw-h-11 tw-w-full tw-items-center tw-justify-between",children:[(0,s.jsx)(er.E,{className:"tw-h-5 tw-w-28"}),(0,s.jsx)(er.E,{className:"tw-h-5 tw-w-5"})]})});var nI=n(82431);let nE=e=>void 0===e?"":e>99?"ï¼99+ï¼":"ï¼".concat(e,"ï¼"),nR=e=>{let{commentCount:t,firstComment:n,memoCount:a,latestMemos:l,onOpenComments:i,onOpenMemos:o}=e,[c,d]=(0,r.useState)("comments"),w=[{key:"comments",label:"ã³ã¡ã³ã".concat(nE(t))},{key:"memos",label:"èªåã¡ã¢".concat(nE(a))}];return(0,s.jsxs)("div",{className:"tw-w-full tw-rounded-2xl tw-bg-neutral-night tw-px-3 tw-pb-3 tw-pt-1",children:[(0,s.jsx)("div",{role:"tablist",className:"tw-flex tw-w-full tw-items-center",children:w.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>
1d(e.key),"aria-selected":c===e.key,role:"tab",className:(0,Y.cn)("tw-flex tw-h-11 tw-flex-1 tw-items-center tw-justify-center tw-text-sm tw-font-bold tw-transition-colors",c===e.key?"tw-border-b-2 tw-border-solid tw-border-white tw-text-neutral-bright":"tw-border-b tw-border-solid tw-border-neutral-pale tw-text-neutral-pale hover:tw-text-neutral-bright"),children:e.label},e.key))}),(0,s.jsx)("button",{type:"button",onClick:()=>"comments"===c?i():o(),className:"tw-flex tw-w-full tw-items-center tw-gap-2 tw-pt-2 tw-text-left",children:"comments"===c?n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e5.y,{avatarUrl:n.user.avatarUrl,displayName:n.user.displayName,size:"sm"}),(0,s.jsx)("span",{className:"tw-min-w-0 tw-flex-1 tw-truncate tw-text-[14px] tw-leading-[1.6] tw-text-neutral-light",children:n.text})]}):(0,s.jsx)("span",{className:"tw-text-[14px] tw-text-neutral-pale",children:"ã³ã¡ã³ãããã¦å¦ã³ãå
±æãã¾ããã"}):l.length>0?(0,s.jsx)("span",{className:"tw-flex tw-w-full tw-flex-col tw-gap-2",children:l.map(e=>(0,s.jsxs)("span",{className:"tw-flex tw-w-full tw-items-center tw-gap-2 tw-rounded-lg tw-bg-neutral-derk tw-py-3 tw-pl-4 tw-pr-3",children:[(0,s.jsx)("span",{className:"tw-min-w-0 tw-flex-1 tw-truncate tw-text-[14px] tw-font-bold tw-leading-[1.6] tw-text-neutral-bright",children:e.body}),(0,s.jsx)("span",{className:"tw-shrink-0 tw-text-[13px] tw-text-neutral-light",children:(0,eh.rW)(e.timestampSec)})]},e.id))}):(0,s.jsx)("span",{className:"tw-text-[14px] tw-text-neutral-pale",children:"åç»ããå¾ãå¦ã³ãã¡ã¢ãã¾ãããï¼"})})]})},nT=e=>{var t,n;let{episodeId:a,onOpenComments:l,onOpenMemos:i}=e,{data:o}=(0,f.I)((0,nI.Zx)(a)),{data:c}=(0,f.I)({queryKey:x.e.batchGetEpisodeCommentCounts({episodeIds:[a]}),queryFn:()=>(0,eF.XQ)({episodeIds:[a]})}),{isSignedIn:d}=(0,y.Z2)(),{data:w}=(0,f.I)({queryKey:x.e.listEpisodeMemos({episodeId:a}),queryFn:()=>(0,eF.h8)({episodeId:a}),enabled:d}),u=(0,r.useMemo)(()=>[...null!=w?w:[]].sort((e,t)=>t.createTime.getTime()-e.createTime.getTime()).slice(0,2),[w]);return(0,s.jsx)(nR,{commentCount:null==c||null==(t=c[0])?void 0:t.totalCount,firstComment:null==o||null==(n=o.comments)?void 0:n[0],memoCount:null==w?void 0:w.length,latestMemos:u,onOpenComments:l,onOpenMemos:i})},nz=e=>{let{episodeId:t,episodeDetail:n,articleHtml:a,core:l}=e,o=(e=>{let{episodeId:t,hasArticle:n}=e,s=(0,i.useRouter)(),{data:a}=(0,f.I)({queryKey:x.e.listTocSummaries({episodeId:t}),queryFn:()=>(0,eN.b)({episodeId:t})}),l=(0,L.bP)(),o=(0,L.bP)(),c=(0,L.bP)(),{value:d="light"}=(0,ty.n)(),w=(0,r.useRef)(!1),u=l.open;return(0,r.useEffect)(()=>{!w.current&&"article"===(0,S.q)(s.query.display_type)&&n&&(w.current=!0,u())},[s.query.display_type,n,u]),{tocSummaries:a,spArticleSheet:l,spMemosSheet:o,spCommentsSheet:c,articleBackgroundMode:d}})({episodeId:t,hasArticle:l.hasArticle}),c=ns(t);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eB,{variant:"sp",episodeId:t,thumbnailUrl:n.thumbnailUrl,onClickAppInstallLink:l.handleClickAppInstallLink,onTimestampClick:l.handleTimestampClick,initialTimestamp:l.initialTimestamp,screenName:"movie",nextEpisode:l.nextEpisode,onPlayNext:l.onPlayNext,actionButtonsSlot:(0,s.jsx)(en,{variant:"sp",displayType:"movie",episodeId:t,onClickAppInstallLink:l.handleClickAppInstallLink,spLeadingSlot:(0,s.jsx)(eL.V,{programId:n.program.id,programName:n.program.name,thumbnailSquareUrl:n.program.thumbnailSquareUrl?n.program.thumbnailSquareUrl:n.program.thumbnailUrl?n.program.thumbnailUrl:void 0,screenName:"movie",variant:"sp"})},"sp-".concat(t)),quizSlot:c?(0,s.jsx)(nt,{variant:"sp",episodeId:t,onTimestampClick:l.handleTimestampClick},"quiz-".concat(t)):void 0,commentPreviewSlot:(0,s.jsx)(nT,{episodeId:t,onOpenComments:o.spCommentsSheet.open,onOpenMemos:o.spMemosSheet.open}),spTocSummaryCardSlot:void 0===o.tocSummaries?(0,s.jsx)(nS,{}):o.tocSummaries.length>0?(0,s.jsx)(nk,{tocSummaries:o.tocSummaries,onTimestampClick:l.handleTimestampClick,onClickArticle:l.hasArticle?o.spArticleSheet.open:void 0}):l.hasArticle?(0,s.jsx)(nC,{onClickArticle:o.spArticleSheet.open}):void 0},t),l.hasArticle&&a&&(0,s.jsx)($.RF,{mode:"bottom-sheet",layer:$.Of.CONTEXT,...o.spArticleSheet,children:(0,s.jsxs)($.sL,{bottomSheetPadding:"tw-p-0",bottomSheetColorScheme:o.articleBackgroun
1dMode,children:[(0,s.jsx)($.N5,{className:"tw-sr-only",children:"è¨äº"}),(0,s.jsx)(tB,{articleHtml:a,episodeId:n.id,episodeName:n.title})]})}),(0,s.jsx)($.RF,{mode:"bottom-sheet",layer:$.Of.CONTEXT,bottomSheetAvoidKeyboard:!0,...o.spMemosSheet,children:(0,s.jsxs)($.sL,{bottomSheetPadding:"tw-p-0",children:[(0,s.jsx)($.N5,{className:"tw-sr-only",children:"ã¡ã¢"}),(0,s.jsx)(t_,{variant:"sp",episodeId:t,onTimestampClick:l.handleTimestampClick})]})}),(0,s.jsx)($.RF,{mode:"bottom-sheet",layer:$.Of.CONTEXT,bottomSheetAvoidKeyboard:!0,...o.spCommentsSheet,children:(0,s.jsxs)($.sL,{bottomSheetPadding:"tw-p-0",children:[(0,s.jsx)($.N5,{className:"tw-sr-only",children:"ã³ã¡ã³ã"}),(0,s.jsx)(tL,{episodeId:t,onTimestampClick:l.handleTimestampClick,onClickAppInstallLink:l.handleClickAppInstallLink})]})}),(0,s.jsx)(nm,{variant:"sp",tags:n.tags,episodeId:t,eventData:{screenName:"movie",sectionName:"ããããã®æ å",srcEpisodeId:t,srcEpisodeName:n.title},onClickAppInstallLink:l.handleClickRecommendedAppInstallLink},t),l.playlistId?(0,s.jsx)(tQ,{playlistId:l.playlistId,currentEpisodeId:t}):l.isWatchLaterContext?(0,s.jsx)(nj,{currentEpisodeId:t}):null,(0,s.jsx)(eW,{})]})};var nM=n(39922),nq=n(77328),nA=n.n(nq);let nB=e=>{var t,n,a,l,i,r,o,c,d,w,u,m,p,x,h,g;let{metatag:b,episode:f}=e,j=f.publishTime.toISOString(),v=f.casts.map(e=>e.name).join(", ")||"PIVOT",y={"@type":"Organization",name:"PIVOT",url:"https://pivotmedia.co.jp/",logo:{"@type":"ImageObject",url:"https://pivotmedia.co.jp/assets/logo/logo_mark.png"}},N=[{"@context":"https://schema.org","@type":"VideoObject",name:null!=(t=b.title)?t:"",description:null!=(n=b.description)?n:"",thumbnailUrl:f.thumbnailUrl?[f.thumbnailUrl]:[],uploadDate:j,duration:(0,nM.e)(f.durationSeconds),embedUrl:"".concat(F.uP,"/movie/").concat(f.id,"/embed"),publisher:y},{"@context":"https://schema.org","@type":"Article",headline:null!=(a=b.title)?a:"",description:null!=(l=b.description)?l:"",image:null!=(i=b.image)?i:"",url:null!=(r=b.url)?r:"",dateModified:j,datePublished:j,author:{"@type":"Person",name:v},publisher:y,articleBody:null!=(o=f.description)?o:""},{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"PIVOT",item:"https://pivotmedia.co.jp/"},{"@type":"ListItem",position:2,name:f.program.name,item:"".concat(F.uP,"/program/").concat(f.program.id)},{"@type":"ListItem",position:3,name:null!=(c=b.title)?c:"",item:null!=(d=b.url)?d:""}]}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(nA(),{children:[(0,s.jsx)("link",{rel:"preconnect",href:"https://player-static.p.uliza.jp"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://player-api.p.uliza.jp"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://vms-api.p.uliza.jp"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://pubads.g.doubleclick.net"}),(0,s.jsx)("title",{children:"".concat(null!=(w=b.title)?w:""," - PIVOT")}),b.description&&(0,s.jsx)("meta",{name:"description",content:b.description},"description"),(0,s.jsx)("meta",{property:"og:title",content:null!=(u=b.title)?u:""},"og:title"),(0,s.jsx)("meta",{property:"og:url",content:null!=(m=b.url)?m:""},"og:url"),(0,s.jsx)("meta",{property:"og:image",content:null!=(p=b.image)?p:""},"og:image"),b.description&&(0,s.jsx)("meta",{property:"og:description",content:b.description},"og:description"),(0,s.jsx)("meta",{name:"twitter:image",content:null!=(x=b.image)?x:""},"twt:image"),(0,s.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,s.jsx)("meta",{name:"twitter:title",content:null!=(h=b.title)?h:""},"twt:title"),(0,s.jsx)("link",{rel:"canonical",href:null!=(g=b.url)?g:""},"canonical"),(0,s.jsx)("meta",{property:"og:type",content:"article"},"og:type"),b.noindex&&(0,s.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,s.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:(0,nM.m)(N)}})]})};var nL=!0;function n_(e){let{episodeId:t,articleHtml:n,defaultRightTab:o,metaTag:d}=e,w=(e=>{var t,n,s,a;let{episodeId:l,articleHtml:o}=e,{data:c}=(0,f.I)((0,p.F)({episodeId:l})),{isSp:d,isInitialized:w}=(0,I.P)(),u=(0,i.useRouter)(),{isInitialized:m,userData:E}=(0,y.Z2)(),R="string"==typeof u.query.playlistId?u.query.playlistId:void 0,T="string"==typeof u.query.watchLater&&["1","true"].includes(u.query.watchLater),z=(e=>{let{currentEpisodeId:t,playlistId:n,isWatchLaterContext:s,apiNextEpisode:a}=e,{data:l}=(0,f.I)({queryKey:x.e.listPlaylistEpisodes({playlistId:null!=n?n:""}),queryFn:()=>(0,h.Ze)({playlistId:n}),enabled:!!n}),{data:i}=(0,f.I)({queryKey:x.e.listWatchLater(),queryFn:()=>(0,g.y)(),enabled:!n&&s});return(0,r.useMemo)(()=>{var e,r,o,c;
1return n?null!=(r=b(null!=(e=null==l?void 0:l.episodes)?e:[],t))?r:void 0:s?null!=(c=b(null!=(o=null==i?void 0:i.episodes)?o:[],t))?c:void 0:a},[t,n,s,a,null==l?void 0:l.episodes,null==i?void 0:i.episodes])})({currentEpisodeId:l,playlistId:R,isWatchLaterContext:T,apiNextEpisode:null==c?void 0:c.nextEpisode}),M="pivot:continuousPlayCount",[q,A]=(0,r.useState)(0);(0,r.useEffect)(()=>{var e;A(Number(null!=(e=sessionStorage.getItem(M))?e:0))},[l]);let{generateEpisodePath:B}=(0,v.F)(),L=(0,r.useCallback)(e=>{if(!z)return;"manual"===e?sessionStorage.removeItem(M):sessionStorage.setItem(M,String(q+1));let t={};R&&(t.playlistId=R),T&&(t.watchLater="true"),u.push(B(z.id,{additionalQuery:t}))},[z,R,T,q,u,B]),_=R||T||q<10?L:void 0,P=(0,r.useMemo)(()=>{let e=(0,S.q)(u.query.t);if(e){let t=parseInt(e,10);return!isNaN(t)&&t>=0?t:void 0}},[u.query.t]),F=(0,j.P)(),U=(null==c?void 0:c.adjustDeeplinkToken)!==""&&c?c.adjustDeeplinkToken:void 0,D=(0,N.BZ)({episodeId:l,adjustDeeplinkToken:U,userId:null==E?void 0:E.userId,referer:null==(t=F.value)?void 0:t.referer,firstAccessTime:null==(n=F.value)?void 0:n.accessedAt,displayType:"movie"}),O=async e=>{(0,C.l)(D),k.h.sendClickAppInstallLink({screenName:"movie",positionName:e.positionName,episodeId:l})},Q=(0,r.useCallback)(e=>{var t,n;let s=(0,N.BZ)({episodeId:l,adjustDeeplinkToken:U,userId:null==E?void 0:E.userId,referer:null==(t=F.value)?void 0:t.referer,firstAccessTime:null==(n=F.value)?void 0:n.accessedAt,displayType:"movie",tab:"recommended",tagCode:e});k.h.sendClickAppInstallLink({screenName:"movie",positionName:"recommended_tab_bottom",episodeId:l}),(0,C.l)(s)},[l,U,null==E?void 0:E.userId,null==(s=F.value)?void 0:s.referer,null==(a=F.value)?void 0:a.accessedAt]);return(0,r.useEffect)(()=>{var e;c&&k.h.sendViewItemEpisode(null!=(e=null==E?void 0:E.userId)?e:0,c.id,c.title,"movie")},[l]),{episodeDetail:c,hasArticle:!!o,isSp:d,isInitializedAuth:m,isInitializedMediaQuery:w,initialTimestamp:P,nextEpisode:z,onPlayNext:_,playlistId:R,isWatchLaterContext:T,handleTimestampClick:e=>{let{episodeId:t,...n}=u.query,s={...n,t:e.toString()};u.replace({pathname:"/movie/".concat(l),query:s},void 0,{shallow:!0}),window.scrollTo({top:0})},viewInAppUrl:D,handleClickAppInstallLink:O,handleClickRecommendedAppInstallLink:Q}})({episodeId:t,articleHtml:n}),{episodeDetail:E}=w;return((e=>{let t=(0,i.useRouter)(),{asPath:n}=t,s="string"==typeof t.query.anchor?t.query.anchor:void 0,a=s?e[s]:void 0;(0,r.useEffect)(()=>{let e,t;if(!a)return;let n=!1,s=0,l=0,i=!1,r={passive:!0},o=()=>{i=!0},c=()=>{null==e||e.disconnect(),e=void 0,window.clearTimeout(l)},d=()=>{null==t||t.disconnect(),t=void 0,window.clearTimeout(s),window.removeEventListener("wheel",o,r),window.removeEventListener("touchmove",o,r),window.removeEventListener("keydown",o,r)},w=e=>{i||e.scrollIntoView({block:"start"})},u=()=>{if(n)return;let e=document.getElementById(a);e&&(n=!0,c(),window.addEventListener("wheel",o,r),window.addEventListener("touchmove",o,r),window.addEventListener("keydown",o,r),w(e),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(()=>w(e))).observe(document.body),s=window.setTimeout(d,2500))};return u(),n||"undefined"==typeof MutationObserver||((e=new MutationObserver(u)).observe(document.body,{childList:!0,subtree:!0}),l=window.setTimeout(c,3e4)),()=>{c(),d()}},[n,a])})(l.TE),E)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nB,{metatag:d,episode:E}),(0,s.jsx)(a.G,{viewInAppUrl:w.viewInAppUrl,eventData:{screenName:"movie",episodeId:t},children:(0,s.jsx)("main",{children:(0,s.jsx)(m.K,{children:(0,s.jsx)(c,{children:(0,s.jsx)(u.W,{playlistId:w.playlistId,watchLater:w.isWatchLaterContext,children:w.isSp?(0,s.jsx)(nz,{episodeId:t,episodeDetail:E,articleHtml:n,core:w}):(0,s.jsx)(nv,{episodeId:t,episodeDetail:E,articleHtml:n,defaultRightTab:o,core:w})})})},t)})})]}):null}},65947:(e,t,n)=>{"use strict";n.d(t,{n:()=>l});var s=n(80191),a=n(633);let l=()=>(0,a.t)(s.uk,{initializeWithValue:!1})},72936:(e,t,n)=>{"use strict";n.d(t,{$:()=>l});var s=n(37876),a=n(61699);let l=e=>{let{title:t,timestampSec:n,trailing:l}=e;return(0,s.jsxs)("div",{className:"tw-flex tw-w-full tw-items-center tw-gap-2 tw-bg-neutral-night tw-py-3 tw-pl-4 tw-pr-3 tw-text-left",children:[(0,s.jsx)("span",{className:"tw-min-w-0 tw-flex-1 tw-truncate tw-text-[15px] tw-font-bold tw-leading-tight tw-text-white",children:t}),(0,s.jsx)("span",{className:"tw-shrink-0 tw-text-[13px] tw-leading-tight tw-text-neutral-light",children:(0,a.g)(n)}),l]})}},74447:(e,t,n)=>{"use strict";n.d(t,{q:()=>s});let s=e=>{if(Array.isArray(e)){var t;return null!=(t=e[0])?t:void 0}return null!=e?e:void 0}},85736:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});let s=e=>
1null!=e.seconds?new Date(1e3*("number"==typeof e.seconds?e.seconds:e.seconds.toNumber())):new Date},86009:(e,t,n)=>{"use strict";n.d(t,{G:()=>m});var s=n(37876),a=n(36814),l=n(29910),i=n(70929);i.Ay.addHook("afterSanitizeAttributes",e=>{var t,n;if("P"!==e.tagName&&"FIGCAPTION"!==e.tagName||(null==(t=e.textContent)?void 0:t.trim())||e.remove(),"A"===e.tagName){e.setAttribute("target","_blank");let t=new Set((null!=(n=e.getAttribute("rel"))?n:"").split(/\s+/).filter(Boolean));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}});let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i.Ay.sanitize(e,{...t,FORBID_ATTR:["style"]})};var o=n(4292),c=n(21257),d=n(14232);let w=[0,20,40,60,80,100],u=e=>{let t=document.createElement("div");return Object.assign(t.style,{position:"absolute",top:"".concat(e,"%"),width:"100%",height:"1px",pointerEvents:"none"}),t},m=e=>{let{articleHtml:t,backgroundColor:n="light",onScrollDepth:i,active:m=!1,onToggleBackgroundMode:p,headerRightSlot:x}=e,h=(0,d.useRef)(null);(e=>{let{containerRef:t,onDepth:n,active:s}=e,a=(0,d.useRef)([]),l=(0,d.useRef)(-1),i=(0,d.useRef)(0),r=(0,d.useCallback)(e=>{let t=l.current;return s=>{let a=window.scrollY;s.forEach(n=>{let s=a>=i.current,l=e>t;n.isIntersecting&&s&&l&&(t=e)}),requestAnimationFrame(()=>{t>l.current&&(n(t),l.current=t),i.current=a})}},[n]);(0,d.useEffect)(()=>{let e=t.current;if(!e||!s)return;let n=w.map(u),l=n.map((t,n)=>{e.appendChild(t);let s=new IntersectionObserver(r(w[n]));return s.observe(t),s});return a.current=l,()=>{l.forEach(e=>e.disconnect()),n.forEach(t=>{e.contains(t)&&e.removeChild(t)})}},[t,r,s]),(0,d.useEffect)(()=>{l.current=-1,i.current=window.scrollY},[s])})({containerRef:h,onDepth:e=>null==i?void 0:i(e),active:m});let g=(0,d.useMemo)(()=>(e=>{try{let t=new DOMParser().parseFromString(e,"text/html");return t.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(e=>{e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1")}),t.body.innerHTML}catch(t){return e}})(r(t)),[t]);return(0,s.jsxs)(l.B,{className:(0,c.cn)("tw-min-h-full tw-w-full tw-flex-1 tw-transition-colors","dark"===n?"tw-bg-neutral-dark":"tw-bg-neutral-light"),children:[(!!p||!!x)&&(0,s.jsxs)(a.z,{justify:"between",align:"center",className:(0,c.cn)("tw-border-b tw-border-solid tw-px-6 tw-pb-3 tw-pt-6","dark"===n?"tw-border-neutral-night":"tw-border-neutral-middle/40"),children:[p?(0,s.jsxs)("button",{type:"button",onClick:p,className:(0,c.cn)("tw-flex tw-items-center tw-gap-1.5 tw-text-sm","dark"===n?"tw-text-neutral-pale":"tw-text-neutral-middle"),"aria-label":"表示ã¢ã¼ããåãæ¿ã",children:[(0,s.jsx)(o.In,{icon:"material-symbols:swap-vert",className:"tw-h-5 tw-w-5"}),(0,s.jsxs)("span",{children:["表示ã¢ã¼ã (","light"===n?"ã©ã¤ã":"ãã¼ã¯",")"]})]}):(0,s.jsx)("span",{}),x]}),(0,s.jsx)("div",{ref:h,className:(0,c.cn)("tw-w-full tw-px-6 tw-pb-12 tw-pt-6","tw-flex tw-flex-col tw-gap-6"),children:(0,s.jsx)("div",{className:(0,c.cn)("tw-mx-auto tw-flex tw-w-full tw-flex-col tw-gap-6","dark"===n?"tw-text-neutral-bright":"tw-text-black","[&>p]:tw-text-[16px] [&>p]:tw-leading-[200%]","[&>h3]:tw-text-[20px] [&>h3]:tw-font-semibold","[&>h4]:tw-text-[18px] [&>h4]:tw-font-semibold","[&>h5]:tw-text-[16px] [&>h5]:tw-font-semibold","[&>h3]:tw-mt-5","[&>h4]:tw-mt-4","[&>h5]:tw-mt-3","[&>ul]:tw-ml-7 [&>ul]:tw-list-disc [&>ul]:tw-text-[16px] [&>ul]:tw-leading-[200%]","[&>ol]:tw-ml-7 [&>ol]:tw-list-decimal [&>ol]:tw-text-[16px] [&>ol]:tw-leading-[200%]","[&>ol>li]:tw-mb-1 [&>ul>li]:tw-mb-1","[&>figure]:tw-my-6 [&>figure]:tw-flex [&>figure]:tw-flex-col [&>figure]:tw-items-center [&>figure]:tw-text-center","[&>figure>img]:tw-w-full [&>figure>img]:tw-max-w-[600px]","[&>figure>figcaption]:tw-mt-3 [&>figure>figcaption]:tw-text-[14px] [&>figure>figcaption]:tw-text-neutral-pale","dark"===n?"[&>p>a]:tw-text-accent-brand-link [&>p>a]:tw-no-underline":"[&>p>a]:tw-text-accent-brand-sub [&>p>a]:tw-no-underline"),dangerouslySetInnerHTML:{__html:g}})})]})}},88170:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s,a=n(14232);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(null,arguments)}let i=function(e){return a.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),s||(s=a.createElement("circle",{cx:12,cy:12,r:9.5,stroke:"#A9ABB8"})))}}
1,88212:(e,t,n)=>{"use strict";n.d(t,{A:()=>w});var s=n(37876),a=n(21257),l=n(47193),i=n(88170),r=n(14070),o=n(29864),c=n.n(o);let d={sp:{label:c().label__sp},pc:{label:c().label__pc}};function w(e){let{text:t,value:n,checked:o,registerProps:w,className:u}=e,{isSp:m}=(0,r.P)(),p=w.disabled||!1;return(0,s.jsx)("div",{className:c().radioButton,children:(0,s.jsxs)("label",{className:(0,a.cn)(" ".concat(c().label," ").concat(d[m?"sp":"pc"].label," ").concat(p?c().label__disabled:""," "),u),children:[(0,s.jsx)("input",{type:"radio",value:n,className:c().input,...w}),o?(0,s.jsx)(l.A,{className:" ".concat(c().icon," ").concat(p?c().icon__disabled:""," "),width:24,height:24,viewBox:"0 0 24 24"}):(0,s.jsx)(i.A,{className:" ".concat(c().icon," ").concat(p?c().icon__disabled:""," "),width:24,height:24,viewBox:"0 0 24 24"}),t]})})}},88793:(e,t,n)=>{"use strict";n.d(t,{K:()=>r});var s=n(37876),a=n(21257),l=n(48230),i=n.n(l);let r=e=>{let t=(0,a.cn)("tw-flex tw-h-8 tw-items-center tw-justify-center tw-whitespace-nowrap tw-rounded-full tw-px-4 tw-text-[13px] tw-font-bold tw-leading-tight tw-transition-opacity disabled:tw-opacity-50","outline"===e.variant?"tw-border tw-border-neutral-light tw-bg-transparent tw-text-white hover:tw-opacity-80":"tw-bg-neutral-light tw-text-neutral-dark hover:tw-opacity-90");return void 0!==e.href?(0,s.jsx)(i(),{href:e.href,className:t,children:e.children}):(0,s.jsx)("button",{type:"button",onClick:e.onClick,disabled:e.disabled,className:t,children:e.children})}},96094:(e,t,n)=>{"use strict";n.d(t,{X:()=>l});var s=n(14232),a=n(40625);let l=e=>{let{hasMore:t,isLoading:n,onLoadMore:l,threshold:i=.1,rootMargin:r="100px"}=e,o=(0,s.useCallback)(e=>{e&&t&&!n&&l()},[t,n,l]),{ref:c,inView:d}=(0,a.Wx)({threshold:i,rootMargin:r,onChange:o});return{ref:c,inView:d,shouldLoadMore:d&&t&&!n}}}},e=>{e.O(0,[513,9427,4367,8992,2382,5280,3310,7940,8103,6492,2914,9650,5243,3734,636,6593,8792],()=>e(e.s=27396)),_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.