1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0cd88ae5-b1bb-4dfc-9e54-b1995a2060cc",e._sentryDebugIdIdentifier="sentry-dbid-0cd88ae5-b1bb-4dfc-9e54-b1995a2060cc")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69855,82116],{34303:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var i=s(66419),l=s(65696);let a={customAppEvent:"custom_app_event"};var r=s(64364);let c=()=>{let{asPath:e,query:t}=(0,i.useRouter)();return(0,l.useCallback)((s,i)=>{(0,r.g)(a.customAppEvent,{event_name:s,json_params:JSON.stringify(i),...t,fromUrl:e})},[e,t])}},37030:e=>{e.exports={"select-filter-name":"TopicFilterMenu_select-filter-name__ZW9vj","filter-button":"TopicFilterMenu_filter-button__Q1KWA"}},37934:(e,t,s)=>{"use strict";s.d(t,{Q:()=>h,a:()=>x});var i=s(79532),l=s(93570),a=s(93546),r=s(90737),c=s(63424),o=s(70532),n=s(65696),d=s(67843),p=s(49215),u=s(33248),m=s(22059);let x=(0,m.UG)(` 2 # eslint-disable-next-line @graphql-eslint/unique-fragment-name -- FIXME 3 fragment TopicCardFragment on PostTopic { 4 id 5 label 6 imageUrl 7 postCount 8 isPostable(communityId: $communityId) 9 } 10`),h=(0,n.memo)(function({data:e}){let{t}=(0,o.A)("features/topicCategory"),{id:s,label:n,postCount:h,imageUrl:f}=(0,m.Bk)(x,e);return(0,i.jsx)(p.N,{href:d.y.topics._topic_id(s).$url(),children:(0,i.jsx)(r.Q,{className:"group rounded-none",children:(0,i.jsxs)(c.a,{children:[(0,i.jsx)("div",{className:"flex size-48 shrink-0 items-center justify-center overflow-hidden rounded-md bg-object-neutral","aria-hidden":!0,children:f?(0,i.jsx)(u._,{alt:"",src:f,height:48,width:48}):(0,i.jsx)(a.f,{width:"24px",height:"24px"})}),(0,i.jsxs)("div",{className:"ml-16 truncate",children:[(0,i.jsx)(l.o,{variant:"bodyLg",className:"truncate group-hover:text-interactive",children:n}),(0,i.jsx)(l.o,{component:"span",variant:"bodySm",color:"tertiary",children:t("{{count}}æç¨¿",{count:h})})]})]})})})})},41062:e=>{e.exports={"filter-button":"TopicSortMenu_filter-button__Gn_ej"}},48530:(e,t,s)=>{"use strict";s.d(t,{p:()=>G});var i=s(79532),l=s(10670),a=s(18742),r=s(45615),c=s(46638),o=s(93570),n=s(10034),d=s(93546),p=s(1384),u=s(27500),m=s(90737),x=s(63424),h=s(94063),f=s(69387),j=s(91372),g=s(70532),b=s(65696),y=s(22059),v=s(83346),C=s(82925),N=s(98960),T=s(28294),I=s(51693),S=s.n(I);let k=({title:e,options:t,onSelect:s})=>{let[l,c]=(0,b.useState)([]),{onOpen:n,onClose:d,open:p,openConstant:u}=(0,T.s)(),{t:m}=(0,g.A)("features/productKit"),x=(0,N.s6)(),h=(0,b.useMemo)(()=>0===l.length?e:t.find(e=>e.id===l[0])?.name,[e,t,l]),j=(0,b.useCallback)(e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),y=(0,b.useCallback)(()=>{s(l),d()},[l,s,d]),I=(0,b.useCallback)(()=>{c([])},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$,{size:"xsmall",variant:"basic",rounded:!0,className:(0,f.A)(S()["filter-button"],l.length>0&&"bg-specific-blue-400/10 text-specific-blue-400"),onClick:n,endIcon:(0,i.jsx)(C.m,{size:"xsmall"}),children:(0,i.jsxs)("span",{className:"flex items-center",children:[(0,i.jsx)("span",{className:(0,f.A)("block truncate",S()["select-filter-name"]),children:h}),l.length>1&&(0,i.jsx)("span",{children:`+${l.length-1}`})]})}),u&&(0,i.jsxs)(a.aF,{open:p,onClose:d,...x?{type:"popup",size:"large"}:{type:"sheet",size:"medium"},fixedSize:!0,children:[(0,i.jsx)(a.rQ,{title:e,border:!1,startNode:(0,i.jsx)(r.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:d,children:m("ãã£ã³ã»ã«")})}),(0,i.jsx)(a.$m,{children:t.map(e=>(0,i.jsxs)("label",{className:"flex cursor-pointer items-center justify-between px-16 py-12",children:[(0,i.jsx)(o.o,{variant:"bodyLg",children:e.name}),(0,i.jsx)(v.S,{name:e.id,onChange:()=>j(e.id),checked:l.includes(e.id)})]},e.id))}),(0,i.jsx)("div",{className:"pb-safe",children:(0,i.jsxs)("div",{className:"flex flex-col gap-8 px-16 py-8",children:[(0,i.jsx)(r.$,{onClick:y,size:"medium",variant:"primary",fullWidth:!0,children:m("決å®")}),(0,i.jsx)(r.$,{onClick:I,size:"medium",variant:"plain",fullWidth:!0,children:m("ãªã»ãã")})]})})]})]})};var w=s(89162),A=s(54761),$=s.n(A);let F=["POPULARITY_DESC","SALE_DATE_DESC"],M=({value:e,onSelectSort:t})=>{let{t:s}=(0,g.A)("features/productKit"),{onOpen:l,onClose:c,open:o}=(0,T.s)(),n=(0,N.s6)(),[d,p]=(0,b.useState)(e),u=(0,b.useCallback)(e=>{p(e.target.value)},[]),m=(0,b.useCallback)(()=>{t(d),c()},[c,t,d]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$,{size:"xsmall",variant:"basic",rounded:!0,className:(0,f.A)($()["filter-button"],"POPULARITY_DESC"!==e&&"bg-specific-blue-400/10 text-specific-blue-400"),onClick:l,endIcon:(0,i.jsx)(C.m,{size:"xsmall"}),children:"SALE_DATE_DESC"===e?s("çºå£²æ¥ãæ°ããé "):s("ä¸¦ã³æ¿ã")}),(0,i.jsxs)(a.aF,{open:o,onClose:c,...n?{type:"popup",size:"medium"}:{type:"sheet",size:"small"},children:[(0,i.jsx)(a.rQ,{title:s("ä¸¦ã³æ¿ã"),border:!1,startNode:(0,i.jsx)(r.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:c,children:s("ãã£ã³ã»ã«")})}),(0,i.jsxs)("div",{className:"mx-auto w-full max-w-screen-md pb-safe",children:[F.map(e=>(0,i.jsxs)("label",{className:"flex cursor-pointer items-center justify-between px-16 py-12",children:[(0,i.jsx)("span",{className:"text-variant-bodyLg",children:"SALE_DATE_DESC"===e?s("çºå£²æ¥ãæ°ããé "):s("人æ°é ")}),(0,i.jsx)(w.s,{name:e,value:e,checked:e===d,onChange:u})]},e)),(0,i.jsx)("div",{className:"p-16",children:(0,i.jsx)(r.$,{variant:"primary",onClick:m,fullWidth:!0,children:s("決å®")})})]})]})]})};var _=s(85201),z=s(53377),D=s(33248),E=s(95889),P=s(61954),U=s(71629);let L=(0,U.y)(9),K=(0,y.UG)(` 11 query ProductKitSelectModalListQuery($first: Int, $after: String, $filter: ProductKitFilter) { 12 productKits(first: $first, after: $after, filter: $filter) { 13 edges { 14 cursor 15 node { 16 id 17 name 18 imageUrl 19 postCount 20 } 21 } 22 pageInfo { 23 hasNextPage 24 endCursor 25 } 26 } 27 } 28`),Q=(0,y.UG)(` 29 query ProductKitSelectModalFilterOptionsQuery { 30 productSeries { 31 id 32 name 33 } 34 productBrands { 35 id 36 name 37 } 38 } 39`),G=({open:e,initialSelected:t,onCommit:s,onClose:y,title:v,single:C=!1})=>{let{t:T}=(0,g.A)("features/productKit"),{ipName:I}=(0,P.o)(),S=(0,N.s6)(),[w,A]=(0,b.useState)(()=>new Map(t.map(e=>[e.id,e]))),$=(0,b.useRef)(!1);(0,b.useEffect)(()=>{e&&!$.current&&A(new Map(t.map(e=>[e.id,e]))),$.current=e},[e,t]);let F=(0,b.useCallback)(e=>{A(t=>{if(t.has(e.id)){let s=new Map(t);return s.delete(e.id),s}if(C)return new Map([[e.id,e]]);let s=new Map(t);return s.set(e.id,e),s})},[C]),G=(0,b.useCallback)(()=>{s([...w.values()]),y()},[w,s,y]),[B,O]=(0,b.useState)(""),R=(0,j.A)(async e=>{O(e.target.value)},300),[q,W]=(0,b.useState)([]),[V,X]=(0,b.useState)([]),[Y,Z]=(0,b.useState)([]),[H,J]=(0,b.useState)("POPULARITY_DESC"),{data:ee}=(0,l.IT)(Q,{skip:!e}),et=(0,b.useMemo)(()=>{let e=new Date().getFullYear()+1;return(0,U.y)(e-1980+1).map(t=>{let s=String(e-t);return{id:s,name:T("{{year}}å¹´",{year:s})}})},[T]),es=(0,b.useMemo)(()=>({sortOrder:H,...B?{nameContains:B}:{},...q.length>0?{seriesIds:q}:{},...V.length>0?{brandIds:V}:{},...Y.length>0?{years:Y}:{}}),[B,q,V,Y,H]),{data:ei,loading:el,fetchMore:ea}=(0,l.IT)(K,{variables:{first:20,filter:es},skip:!e}),er=ei?.productKits.pageInfo,ec=(0,b.useCallback)(async()=>{er?.hasNextPage&&er.endCursor&&await ea({variables:{first:20,after:er.endCursor,filter:es},updateQuery:(e,{fetchMoreResult:t})=>({...t,productKits:{...t.productKits,edges:[...e?.productKits.edges??[],...t.productKits.edges]}})})},[ea,er,es]);return(0,i.jsxs)(a.aF,{open:e,onClose:y,...S?{type:"popup",size:"large"}:{type:"sheet",size:"medium"},fixedSize:!0,children:[(0,i.jsx)(a.rQ,{title:v??T("{{ipName}}ã鏿",{ipName:I}),startNode:(0,i.jsx)(r.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:y,children:T("ãã£ã³ã»ã«")}),endNode:(0,i.jsx)(r.$,{type:"button",variant:"plain",size:"mini",disabled:C&&0===w.size,onClick:G,children:T("å®äº")})}),(0,i.jsxs)("div",{className:"py-12",children:[(0,i.jsx)("div",{className:"px-16",children:(0,i.jsx)(c.A,{size:"small",label:"",type:"text",placeholder:T("{{title}}ãæ¤ç´¢",{title:I}),"aria-label":T("{{title}}ãæ¤ç´¢",{title:I}),name:"searchProductKits",onChange:R,startAdornment:(0,i.jsx)(n.v,{size:"small"})})}),(0,i.jsxs)("div",{className:"flex gap-12 overflow-x-auto px-16 pt-12",children:[(0,i.jsx)(k,{title:T("ã·ãªã¼ãº"),options:ee?.productSeries??[],onSelect:W}),(0,i.jsx)(k,{title:T("ãã©ã³ã"),options:ee?.productBrands??[],onSelect:X}),(0,i.jsx)(k,{title:T("çºå£²å¹´ä»£"),options:et,onSelect:Z}),(0,i.jsx)(M,{value:H,onSelectSort:J})]})]}),(0,i.jsx)(a.$m,{children:(0,i.jsx)(E.Q,{onLoadMore:ec,isLoading:el,isLoadableMore:!!er?.hasNextPage,children:(0,i.jsxs)("li",{className:"list-none overflow-auto pb-80 lg:pb-40",children:[!el&&(ei?.productKits.edges.length??0)===0&&(0,i.jsx)("div",{className:"mt-96 flex flex-col items-center justify-center",children:(0,i.jsx)(_.w,{})}),el&&L.map(e=>(0,i.jsx)(z.X,{},e)),ei?.productKits.edges.map(({node:e})=>(0,i.jsx)("button",{type:"button",className:"w-full text-left","aria-pressed":w.has(e.id),onClick:()=>F({id:e.id,name:e.name,imageUrl:e.imageUrl}),children:(0,i.jsxs)(m.Q,{children:[(0,i.jsxs)(x.a,{children:[(0,i.jsx)("div",{className:"flex size-48 shrink-0 items-center justify-center overflow-hidden rounded-md bg-object-neutral",children:e.imageUrl?(0,i.jsx)(D._,{alt:e.name,src:e.imageUrl,height:48,width:48}):(0,i.jsx)(d.f,{width:"24px",height:"24px"})}),(0,i.jsxs)("div",{className:"ml-16 truncate",children:[(0,i.jsx)(o.o,{variant:"bodyLg",className:"truncate",children:e.name}),null!=e.postCount&&(0,i.jsx)(o.o,{component:"span",variant:"bodySm",color:"tertiary",children:T("{{count}}æç¨¿",{count:e.postCount})})]})]}),(0,i.jsx)(h.R,{className:"text-accent",children:w.has(e.id)&&(0,i.jsx)(p.l,{width:"20px",height:"20px"})})]})},e.id))]})})}),!C&&(0,i.jsx)("div",{className:"border-t border-border bg-surface-plain pb-safe",children:(0,i.jsxs)("div",{className:"min-h-80 px-16 pb-16 pt-8",children:[(0,i.jsxs)(o.o,{variant:"subtitleSm",color:"secondary",children:[T("鏿ä¸ã®{{ipName}}",{ipName:I}),(0,i.jsx)(o.o,{className:"ml-8",component:"span",variant:"subtitleSm",color:"secondary",children:w.size})]}),(0,i.jsx)("div",{className:"mt-8 overflow-x-auto",children:w.size>0&&(0,i.jsx)("ul",{className:"flex w-fit flex-row gap-8",children:[...w.values()].map(e=>(0,i.jsxs)("li",{className:(0,f.A)("flex w-fit items-center justify-between whitespace-nowrap rounded-lg bg-object-accent px-8 py-4","hover:bg-object-accent-hover"),children:[(0,i.jsx)("p",{className:"text-variant-bodySm text-on-accent",children:e.name}),(0,i.jsx)("button",{type:"button","aria-label":T("鏿ãè§£é¤"),onClick:()=>F(e),className:"ml-4 flex",children:(0,i.jsx)(u.Z,{size:"xsmall",className:"text-on-accent"})})]},e.id))})})]})})]})}},49412:(e,t,s)=>{"use strict";s.d(t,{Q:()=>r});var i=s(70532),l=s(65696),a=s(30658);let r=()=>{let{t:e}=(0,i.A)("shared"),[t,s]=(0,a.G)();return[t,(0,l.useCallback)(()=>
39{s({type:"message",title:e("ä¸é©åãªã¯ã¼ããå«ã¾ãã¦ãã¾ã"),subText:e("éä¿¡å 容ãå©ç¨è¦ç´ã«éåããå¯è½æ§ãããã¾ããã«ã¼ã«ãå®ã£ã¦æ¥½ãã¿ã¾ãããã"),actionLabel:"OK"})},[s,e])]}},51693:e=>{e.exports={"select-filter-name":"ProductKitFilterMenu_select-filter-name__NZFvL","filter-button":"ProductKitFilterMenu_filter-button__O9R_I"}},53377:(e,t,s)=>{"use strict";s.d(t,{X:()=>n,s:()=>d});var i=s(79532),l=s(90737),a=s(63424),r=s(26554),c=s(87278),o=s(91904);let n=()=>(0,i.jsx)(l.Q,{children:(0,i.jsxs)(a.a,{children:[(0,i.jsx)(c.u,{height:48,width:48,radius:"md"}),(0,i.jsxs)(r.i,{className:"w-full",isSecondary:!0,children:[(0,i.jsx)(o.r,{variant:"subtitleSm"}),(0,i.jsx)(o.r,{variant:"subtitleXs",width:"20%"})]})]})}),d=()=>(0,i.jsx)("li",{className:"list-none",children:(0,i.jsx)(l.Q,{children:(0,i.jsxs)(a.a,{children:[(0,i.jsx)(c.u,{height:48,width:48,radius:"md"}),(0,i.jsx)(r.i,{className:"w-full",isSecondary:!0,children:(0,i.jsx)(o.r,{variant:"subtitleMd"})})]})})})},54761:e=>{e.exports={"filter-button":"ProductKitSortMenu_filter-button__AdIjH"}},57581:(e,t,s)=>{"use strict";s.d(t,{R:()=>i});let i=10},61018:e=>{e.exports={tag:"TopicFormField_tag__Erj52"}},65871:(e,t,s)=>{"use strict";s.d(t,{b:()=>y,x:()=>j});var i=s(79532),l=s(45615),a=s(18742),r=s(89162),c=s(82925),o=s(69387),n=s(70532),d=s(65696),p=s(98960),u=s(22059),m=s(28294),x=s(34303),h=s(41062),f=s.n(h);let j=(0,u.UG)(` 40 fragment TopicSortMenuFragment on TopicCategory { 41 id 42 topicSortKeys 43 } 44`),g="POPULARITY_SCORE",b="RELEASED_AT",y=({data:e,onSelectSort:t})=>{let{t:s}=(0,n.A)("features/post"),h=(0,u.Bk)(j,e),{onOpen:y,onClose:v,open:C}=(0,m.s)(),[N,T]=(0,d.useState)({key:g,direction:"DESCENDING"}),I=(0,d.useCallback)(e=>{T({key:e.target.value,direction:"DESCENDING"})},[]),S=(0,x.A)(),k=(0,d.useCallback)(()=>{S("topic_sort_select",{topicSortKey:N.key}),t(N.key,N.direction),v()},[S,v,t,N.direction,N.key]),w=N.key!==g,A=(0,p.s6)();return 0===h.topicSortKeys.length?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.$,{size:"xsmall",variant:"basic",rounded:!0,className:(0,o.A)(f()["filter-button"],w&&"bg-specific-blue-400/10 text-specific-blue-400"),onClick:y,endIcon:(0,i.jsx)(c.m,{size:"xsmall"}),children:N.key===b?s("çºå£²æ¥ãæ°ããé "):s("ä¸¦ã³æ¿ã")}),(0,i.jsxs)(a.aF,{open:C,onClose:v,...A?{type:"popup",size:"medium"}:{type:"sheet",size:"small"},children:[(0,i.jsx)(a.rQ,{title:s("ä¸¦ã³æ¿ã"),border:!1,startNode:(0,i.jsx)(l.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:v,children:s("ãã£ã³ã»ã«")})}),(0,i.jsxs)("div",{className:"mx-auto w-full max-w-screen-md pb-safe",children:[h.topicSortKeys.map(e=>{let t=e===N.key;return(0,i.jsxs)("label",{className:"flex cursor-pointer items-center justify-between px-16 py-12",children:[(0,i.jsx)("span",{className:"text-variant-bodyLg",children:function(e,t){return t(e===b?"çºå£²æ¥ãæ°ããé ":"人æ°é ")}(e,s)}),(0,i.jsx)(r.s,{name:e,value:e,checked:t,onChange:I},e)]},e)}),(0,i.jsx)("div",{className:"p-16",children:(0,i.jsx)(l.$,{variant:"primary",onClick:k,fullWidth:!0,children:s("決å®")})})]})]})]})}},66561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{TopicFilterMenu:()=>b,TopicFilterMenuFragment:()=>g});var i=s(79532),l=s(45615),a=s(18742),r=s(93570),c=s(83346),o=s(82925),n=s(69387),d=s(70532),p=s(65696),u=s(34303),m=s(28294),x=s(22059),h=s(98960),f=s(37030),j=s.n(f);let g=(0,x.UG)(` 45 fragment TopicFilterMenuFragment on TopicFilterGroup { 46 id 47 title 48 topicFilters { 49 topicFilterId 50 value 51 } 52 } 53`),b=({data:e,onSelect:t})=>{let[s,c]=(0,p.useState)([]),f=(0,x.Bk)(g,e),b=(0,p.useMemo)(()=>0===s.length?f.title:f.topicFilters.find(e=>e.topicFilterId===s[0])?.value,[f.title,f.topicFilters,s]),{onOpen:v,onClose:C,open:N,openConstant:T}=(0,m.s)(),{t:I}=(0,d.A)("features/post"),S=(0,h.s6)(),k=(0,p.useCallback)(e=>{c(t=>[...t,e])},[]),w=(0,p.useCallback)(e=>{c(t=>t.filter(t=>t!==e))},[]),A=(0,u.A)(),$=(0,p.useCallback)(()=>{A("topic_filter_select",{topicFilterGroupId:f.id,topicFilterIds:s}),t(f.id,s),C()},[A,f.id,s,t,C]),F=(0,p.useCallback)(()=>{c([])},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.$,{size:"xsmall",variant:"basic",rounded:!0,className:(0,n.A)(j()["filter-button"],s.length>0&&"bg-specific-blue-400/10 text-specific-blue-400"),onClick:v,endIcon:(0,i.jsx)(o.m,{size:"xsmall"}),children:(0,i.jsxs)("span",{className:"flex items-center",children:[(0,i.jsx)("span",{className:(0,n.A)("block truncate",j()["select-filter-name"]),children:b}),s.length>1&&(0,i.jsx)("span",{children:`+${s.length-1}`})]})}),T&&(0,i.jsxs)(a.aF,{open:N,onClose:C,...S?{type:"popup",size:"large"}:{type:"sheet",size:"medium"},fixedSize:!0,children:[(0,i.jsx)(a.rQ,{title:f.title,border:!1,startNode:(0,i.jsx)(l.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:C,children:I("ãã£ã³ã»ã«")})}
53),(0,i.jsx)(a.$m,{children:f.topicFilters.map(e=>{let t=s.includes(e.topicFilterId);return(0,i.jsxs)("label",{className:"flex cursor-pointer items-center justify-between px-16 py-12",children:[(0,i.jsx)(r.o,{variant:"bodyLg",children:e.value}),(0,i.jsx)(y,{filterId:e.topicFilterId,onSelect:k,onDeleteSelect:w,isAlreadyChecked:t})]},e.topicFilterId)})}),(0,i.jsx)("div",{className:"pb-safe",children:(0,i.jsxs)("div",{className:"flex flex-col gap-8 px-16 py-8",children:[(0,i.jsx)(l.$,{onClick:$,size:"medium",variant:"primary",fullWidth:!0,children:I("決å®")}),(0,i.jsx)(l.$,{onClick:F,size:"medium",variant:"plain",fullWidth:!0,children:I("ãªã»ãã")})]})})]})]})},y=({filterId:e,onSelect:t,onDeleteSelect:s,isAlreadyChecked:l})=>{let[a,r]=(0,p.useState)(l);(0,p.useEffect)(()=>{r(l)},[l]);let o=(0,p.useCallback)(()=>{a?(r(!1),s(e)):(r(!0),t(e))},[a,s,e,t]);return(0,i.jsx)(c.S,{name:e,onChange:o,checked:a})}},69855:(e,t,s)=>{"use strict";s.r(t),s.d(t,{TopicSortMenu:()=>i.b});var i=s(65871)},81847:(e,t,s)=>{"use strict";s.d(t,{f:()=>d});var i=s(10670),l=s(65696),a=s(37934),r=s(79817),c=s(22059),o=s(91444);let n=(0,c.UG)(` 54 query TopicCategoryQuery( 55 $id: ID! 56 $after: String 57 $before: String 58 $first: Int 59 $last: Int 60 $communityId: String! 61 $search: String! 62 $topicCategoryId: String! 63 $topicFilterGroups: [TopicFilterGroupConditionInput!] 64 $topicSort: TopicSortInput 65 $userId: String 66 ) { 67 topicCategory(communityId: $communityId, id: $id) { 68 id 69 title 70 topics( 71 after: $after 72 before: $before 73 first: $first 74 last: $last 75 communityId: $communityId 76 search: $search 77 topicCategoryId: $topicCategoryId 78 topicFilterGroups: $topicFilterGroups 79 topicSort: $topicSort 80 userId: $userId 81 ) { 82 edges { 83 node { 84 id 85 ...TopicCardFragment 86 } 87 } 88 pageInfo { 89 hasNextPage 90 endCursor 91 } 92 } 93 } 94 } 95 `,[a.a]),d=({categoryId:e,keyword:t,topicFilterGroups:s,topicSort:a})=>{let{communityId:c}=(0,o.N)(),d=(0,r.wS)(),{data:p,fetchMore:u,loading:m}=(0,i.IT)(n,{variables:{id:e,communityId:c,first:30,search:t,topicCategoryId:e,topicFilterGroups:s||null,topicSort:a?{key:a.key,direction:a.direction}:null,after:null,before:null,last:null,userId:d??null},notifyOnNetworkStatusChange:!0}),x=(0,l.useMemo)(()=>p?.topicCategory.topics,[p]),h=(0,l.useMemo)(()=>p?.topicCategory.topics?.pageInfo.hasNextPage??!1,[p]),f=(0,l.useCallback)(()=>{h&&u({variables:{after:x?.pageInfo.endCursor},updateQuery:(e,{fetchMoreResult:t})=>t?.topicCategory.topics?{...t,topicCategory:{...t.topicCategory,topics:{pageInfo:t.topicCategory.topics.pageInfo,edges:[...e.topicCategory.topics?.edges??[],...t.topicCategory.topics.edges??[]]}}}:e})},[x,u,h]);return{data:p,loading:m,hasMore:h,handleMore:f}}},85201:(e,t,s)=>{"use strict";s.d(t,{w:()=>r});var i=s(79532),l=s(10034),a=s(70532);let r=()=>{let{t:e}=(0,a.A)("features/post");return(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,i.jsx)(l.v,{size:"xxxlarge",className:"text-object-primary"}),(0,i.jsx)("div",{className:"mt-16",children:(0,i.jsx)("h2",{className:"text-variant-subtitleLg text-secondary",children:e("該å½ããçµæã¯è¦ã¤ããã¾ããã§ãã")})}),(0,i.jsx)("p",{className:"text-variant-bodyMd text-tertiary",children:e("æ¡ä»¶ã夿´ãã¦ã¿ã¾ããã")})]})}},93148:(e,t,s)=>{"use strict";s.d(t,{AV:()=>J,Qe:()=>ei,ow:()=>ee});var i=s(79532),l=s(10670),a=s(45615),r=s(88990),c=s(93570),o=s(18742),n=s(46638),d=s(5055),p=s(23091),u=s(27500),m=s(10034),x=s(93546),h=s(1384),f=s(29713),j=s(90737),g=s(63424),b=s(94063),y=s(26554),v=s(69387),C=s(91372),N=s(70532),T=s(65696),I=s(32010),S=s(45054),k=s(22059),w=s(85201),A=s(53377),$=s(66561),F=s(69855),M=s(65871),_=s(81847),z=s(79817),D=s(98960),E=s(33248),P=s(95889),U=s(28294),L=s(34303),K=s(53265),Q=s(40324),G=s(91444),B=s(21688),O=s(71629),R=s(83654),q=s(57581),W=s(61018),V=s.n(W);let X="communityTopicIds",Y="categoryTopicIds",Z="disableCategoryTopicValidation",H=(0,k.UG)(` 96 query TopicFormFieldQuery($topicIds: [String!]!, $communityId: String!) { 97 postTopicsByIds(topicIds: $topicIds) { 98 id 99 label 100 imageUrl 101 categoryIds 102 isPostable(communityId: $communityId) 103 } 104 } 105`),J=(0,k.UG)(` 106 fragment RequiredCategoryTopicsFragment on TopicCategory { 107 id 108 topicFilterGroups { 109 id 110 title 111 topicFilters { 112 topicFilterId 113 value 114 } 115 ...TopicFilterMenuFragment 116 } 117 topicSortKeys 118 ...TopicSortMenuFragment 119 } 120 `,[$.TopicFilterMenuFragment,M.x]),ee=(0,k.UG)(`
121 fragment TopicFormFieldFragment on PostTemplate { 122 id 123 title 124 requiredPostTopics { 125 id 126 label 127 imageUrl 128 } 129 requiredTopicCategories { 130 id 131 title 132 ...RequiredCategoryTopicsFragment 133 } 134 } 135 `,[J]),et={mustTopics:[],selectedTopics:[],selectedCategoryTopicsDic:{},allTopics:[]},es=(e,t)=>{switch(t.type){case"initialize":{let{initialTopics:e,requiredTopics:s,requiredCategories:i}=t,l=i?.map(e=>e.id)??[];return{selectedTopics:e.filter(e=>(s??[]).every(t=>t.id!==e.id)).filter(e=>!e.categoryIds.some(e=>l.includes(e))),mustTopics:s??[],selectedCategoryTopicsDic:Object.fromEntries(i?.map(t=>[t.id,e.filter(e=>e.categoryIds.includes(t.id)).map(e=>({id:e.id,label:e.label,imageUrl:e.imageUrl}))??[]])??[]),allTopics:e}}case"select":{let{topicId:s,label:i,imageUrl:l,categoryId:a}=t;if(a)return{...e,selectedCategoryTopicsDic:{...e.selectedCategoryTopicsDic,[a]:[...e.selectedCategoryTopicsDic[a]??[],{id:s,label:i,imageUrl:l,isAdditional:!1}]},allTopics:[...e.allTopics,{id:s,label:i,imageUrl:l,isAdditional:!1}]};return{...e,selectedTopics:[...e.selectedTopics,{id:s,label:i,imageUrl:l,isAdditional:!1}],allTopics:[...e.allTopics,{id:s,label:i,imageUrl:l,isAdditional:!1}]}}case"add":{let{label:s}=t,i=(0,S.A)();return{...e,selectedTopics:[...e.selectedTopics,{id:i,label:s,imageUrl:"",isAdditional:!0}],allTopics:[...e.allTopics,{id:i,label:s,imageUrl:"",isAdditional:!0}]}}case"deselect":{let{topicId:s}=t;return{...e,selectedTopics:e.selectedTopics.filter(e=>e.id!==s),selectedCategoryTopicsDic:Object.fromEntries(Object.entries(e.selectedCategoryTopicsDic).map(([e,t])=>[e,t.filter(e=>e.id!==s)])),allTopics:e.allTopics.filter(e=>e.id!==s)}}case"allDeselect":return{...e,selectedTopics:[],selectedCategoryTopicsDic:Object.fromEntries(Object.entries(e.selectedCategoryTopicsDic).map(([e,t])=>[e,[]])),allTopics:[]};default:return(0,R.u)(t,e,`Unexpected action ${t} in selectedTopicStateReducer`)}},ei=({data:e,postId:t,defaultTopicIds:s})=>{let{handleTopicSelect:a,handleTopicDeselect:r,selectedTopicState:c,hasFormError:o,topicLimitErrorMessage:n,skipTopicValidation:d,handleSetSkipTopicValidation:p,handleTopicAdd:u,requiredTopicCategories:m}=(({templateData:e,defaultTopicIds:t})=>{let{t:s}=(0,N.A)("features/post"),i=(0,k.Bk)(ee,e),{productKitPostLinkReleaseFlag:a}=(0,K.D)(),r=a?void 0:i?.requiredTopicCategories,c=(0,Q.GA)(),{communityId:o}=(0,G.N)(),{field:{value:n}}=(0,I.as)({name:"communityTopicId"}),{formState:{errors:d}}=(0,I.as)({name:X}),{setValue:p,watch:u}=(0,I.xW)(),[m,x]=(0,T.useReducer)(es,et),h=(0,T.useMemo)(()=>n?[n,...t]:t,[t,n]),{data:f}=(0,l.IT)(H,{variables:{topicIds:h,communityId:o},skip:0===h.length}),j=(0,T.useMemo)(()=>f?.postTopicsByIds.filter(e=>e.isPostable)??[],[f?.postTopicsByIds]);(0,T.useEffect)(()=>{x({type:"initialize",initialTopics:j,requiredCategories:r,requiredTopics:i?.requiredPostTopics})},[i?.requiredPostTopics,r,j]);let g=(0,T.useCallback)(({categoryId:e,topicId:t,label:i,imageUrl:l})=>
135{if(eg(m)>q.R-1)return void c(s("鏿ã§ãããããã¯ã¯{{maximumNumberOfSelectableTopics}}åã¾ã§ã§ã",{maximumNumberOfSelectableTopics:q.R}),"info");x({type:"select",topicId:t,categoryId:e,label:i,imageUrl:l})},[c,s,m]),b=(0,T.useCallback)(({label:e})=>{if(eg(m)>q.R-1)return void c(s("鏿ã§ãããããã¯ã¯{{maximumNumberOfSelectableTopics}}åã¾ã§ã§ã",{maximumNumberOfSelectableTopics:q.R}),"info");x({type:"add",label:e})},[c,s,m]),y=(0,T.useCallback)(({topicId:e})=>x({type:"deselect",topicId:e}),[]),v=u(Z),C=(0,T.useCallback)(e=>p(Z,e,{shouldDirty:!0}),[p]);return(0,T.useEffect)(()=>{p("additionalTopics",m.allTopics.filter(e=>e.isAdditional).map(e=>e.label),{shouldDirty:!1,shouldValidate:!0}),p(X,[...m.mustTopics.filter(e=>!e.isAdditional).map(e=>e.id),...m.selectedTopics.filter(e=>!e.isAdditional).map(e=>e.id),...Object.values(m.selectedCategoryTopicsDic).flatMap(e=>e.filter(e=>!e.isAdditional).map(e=>e.id))],{shouldDirty:!1,shouldValidate:!0}),p(Y,Object.values(m.selectedCategoryTopicsDic).flatMap(e=>e.filter(e=>!e.isAdditional).map(e=>e.id)))},[p,m.allTopics,m.mustTopics,m.selectedCategoryTopicsDic,m.selectedTopics]),{selectedTopicState:m,handleTopicSelect:g,handleTopicDeselect:y,hasFormError:!v&&!!d[Y],topicLimitErrorMessage:d[X]?.type==="max"?d[X]?.message?.toString():void 0,skipTopicValidation:v,handleSetSkipTopicValidation:C,handleTopicAdd:b,requiredTopicCategories:r}})({postId:t,templateData:e,defaultTopicIds:s}),x=(0,k.Bk)(ee,e);return(0,i.jsxs)("div",{className:"grid gap-16 lg:gap-24",children:[m?.filter(Boolean)?.map(e=>(0,i.jsx)(el,{shouldShowError:o,data:e,categoryId:e.id,selectedTopicState:c,onSelect:a,onDeselect:r,skipTopicValidation:d,onClickSkipTopicValidation:p},e.id)),(0,i.jsx)(ea,{selectedTopicState:c,onSelect:a,onDeselect:r,templateId:x?.id,onAdd:u,errorMessage:n})]})},el=({data:e,categoryId:t,onSelect:s,onDeselect:l,selectedTopicState:m,shouldShowError:x,skipTopicValidation:h,onClickSkipTopicValidation:f})=>{let{t:j}=(0,N.A)("features/post"),{onOpen:g,onClose:b,open:y,openConstant:v}=(0,U.s)(),I=(0,D.s6)(),[S,M]=(0,T.useState)(""),z=(0,C.A)(async e=>{M(e.target.value)},300),[E,L]=(0,T.useState)([]),Q=(0,T.useCallback)((e,t)=>{L(s=>Array.isArray(s)?[...s.filter(t=>t.topicFilterGroupId!==e),{topicFilterGroupId:e,topicFilterIds:t}]:s)},[]),[G,B]=(0,T.useState)({key:"POPULARITY_SCORE",direction:"DESCENDING"}),O=(0,T.useCallback)((e,t)=>{B({key:e,direction:t})},[]),{data:R,loading:q,hasMore:W,handleMore:V}=(0,_.f)({categoryId:t,keyword:S,topicFilterGroups:E,topicSort:G}),X=(0,T.useMemo)(()=>!!(R?.topicCategory.topics&&R.topicCategory.topics.edges.length>0),[R?.topicCategory.topics]),Y=(0,T.useCallback)(({id:e,label:i,imageUrl:l})=>{s({categoryId:t,topicId:e,label:i,imageUrl:l})},[t,s]),Z=(0,T.useMemo)(()=>m.allTopics.filter(e=>m.mustTopics.every(t=>t.id!==e.id)),[m.allTopics,m.mustTopics]),H=m.selectedCategoryTopicsDic[t]??[],ee=(0,T.useCallback)(()=>{f(!0),b()},[b,f]),et=(0,T.useCallback)(()=>{M(""),g()},[g]),es=x&&0===H.length,{skipRequiredTopicCategoryActivationFlag:ei}=(0,K.D)(),el=(0,k.Bk)(J,e),ea=(0,T.useMemo)(()=>(0,i.jsx)(a.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:b,children:j("ãã£ã³ã»ã«")}),[b,j]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"truncate",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("label",{className:"inline-flex",children:[(0,i.jsx)("p",{className:"text-variant-subtitleMd text-primary",children:R?.topicCategory.title}),(0,i.jsx)("p",{className:"text-variant-subtitleSm text-dangerous",children:"*"})]}),H.length>0&&(0,i.jsxs)("button",{type:"button",className:"flex cursor-pointer items-center",onClick:et,children:[(0,i.jsx)("p",{className:"text-variant-bodyMd text-secondary",children:j("鏿")}),(0,i.jsx)(d.K,{})]})]}),h?(0,i.jsxs)("div",{className:"mt-8 flex w-full items-center justify-between whitespace-nowrap py-4",children:[(0,i.jsxs)("div",{className:"flex w-5/6 items-center",children:[(0,i.jsx)("div",{className:"flex size-48 items-center justify-center rounded-md bg-object-neutral",children:(0,i.jsx)(p.e,{className:"text-object-disable"})}),(0,i.jsx)("p",{className:"text-variant-bodyMd ml-16 truncate text-primary",children:j("鏿ãªã")})]}),(0,i.jsx)(r.K,{size:"medium","aria-label":j("éãã"),onClick:()=>f(!1),children:(0,i.jsx)(u.Z,{})})]}):H.length>0?(0,i.jsx)("div",{className:"mt-8",children:H.map((e,t)=>(0,i.jsxs)(T.Fragment,{children:[0!==t&&(0,i.jsx)("div",{className:"h-16"}),(0,i.jsx)(ej,{topic:e,onDeselect:l},e.id)]},e.id))}):(0,i.jsx)("div",{className:"mt-8",children:(0,i.jsx)(a.$,{onClick:et,loading:q,variant:"outlined",size:"small",fullWidth:!0,children:j("{{title}}ã鏿",{title:R?.topicCategory?.title})})}),es&&(0,i.jsx)(c.o,{variant:"bodyMd",className:"pt-8 text-specific-red-400",children:j("{{title}}ã鏿ãã¦ãã ãã",{title:R?.topicCategory?.title})})]}),v&&(0,i.jsxs)(o.aF,{open:y,onClose:b,...I?{type:"popup",size:"large"}:{type:"sheet",size:"medium"},fixedSize:!0,children:[(0,i.jsx)(o.rQ,{title:R?.topicCategory&&j("{{title}}ã鏿",{title:R.topicCategory.title}),startNode:ea,endNode:ec(b,j)}),(0,i.jsxs)("div",{className:"pt-12",children:[(0,i.jsx)("div",{className:"flex justify-between gap-12 px-16",children:(0,i.jsx)("div",{className:"w-full",children:(0,i.jsx)(n.A,{size:"small",label:"",type:"text",placeholder:j("{{title}}ãæ¤ç´¢",{title:R?.topicCategory.title}),"aria-label":j("{{title}}ãæ¤ç´¢",{title:R?.topicCategory.title}),name:"searchTopics",onChange:z,startAdornment:eu})})}),(0,i.jsxs)("div",{className:"flex gap-12 overflow-x-auto px-16 py-12",children:[el?.topicFilterGroups.map(e=>(0,i.jsx)($.TopicFilterMenu,{data:e,onSelect:Q},e.id)),(0,i.jsx)(F.TopicSortMenu,{data:el,onSelectSort:O})]})]}),(0,i.jsx)(o.$m,{children:(0,i.jsxs)("div",{children:[H.length>0&&!X&&!q&&(0,i.jsx)("div",{className:"mt-96 flex flex-col items-center justify-center",children:(0,i.jsx)(w.w,{})}),(0,i.jsxs)(P.Q,{onLoadMore:V,isLoading:q,isLoadableMore:W,className:"overflow-auto pb-80 lg:pb-40",children:[q&&ep.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)(A.X,{})},e)),R?.topicCategory.topics?.edges.map(e=>{let t=eb({state:m,topicId:e.node.id}),s=ey({state:m,topicId:e.node.id});return(0,i.jsx)("li",{children:(0,i.jsx)(em,{data:e.node,onSelect:Y,onDeselect:l,isSelected:t||s,isMust:s})},e.node.id)}),0===H.length&&!q&&!W&&ei&&(0,i.jsx)("li",{children:(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center px-16 py-40",children:[(0,i.jsx)(c.o,{variant:"subtitleMd",children:j("鏿ããã{{title}}ãè¦ã¤ããã¾ãããï¼",{title:R?.topicCategory.title})}),(0,i.jsx)(c.o,{variant:"bodySm",color:"secondary",className:"mt-4",children:j("{{title}}ã鏿ããã«æç¨¿ãããã¨ãã§ãã¾ã",{title:R?.topicCategory.title})}),(0,i.jsx)(a.$,{className:"mt-24",variant:"outlined",size:"small",onClick:ee,children:j("{{title}}ã鏿ããã«æç¨¿",{title:R?.topicCategory.title})})]})})]})]})}),(0,i.jsx)("div",{className:"border-t border-border bg-surface-plain pb-safe",children:(0,i.jsx)(eh,{topics:Z,onDeselect:l})})]})]})},ea=({selectedTopicState:e,onSelect:t,onAdd:s,onDeselect:l,templateId:a,errorMessage:r})=>{let{t:o}=(0,N.A)("features/post"),{onOpen:n,onClose:p,open:u,openConstant:m}=(0,U.s)(),x=(0,T.useMemo)(()=>e.allTopics.filter(t=>e.mustTopics.every(e=>e.id!==t.id)),[e.allTopics,e.mustTopics]);return(0,i.jsxs)("div",{className:"overflow-auto",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("p",{className:"text-variant-subtitleMd text-primary",children:o("ãããã¯")}),(0,i.jsxs)("button",{type:"button",className:"flex cursor-pointer items-center",onClick:n,children:[(0,i.jsx)("p",{className:"text-variant-bodyMd text-secondary",children:o("鏿")}),(0,i.jsx)(d.K,{className:"text-secondary"})]})]}),eg(e)?(0,i.jsx)("div",{className:"mt-8 overflow-auto",children:(0,i.jsxs)("ul",{className:"flex w-fit flex-wrap gap-8",children:[e.mustTopics.map(e=>(0,i.jsx)(ef,{topic:e,type:"view"},e.id)),e.selectedTopics.map(e=>(0,i.jsx)(ef,{onDeselect:l,topic:e,type:"view"},e.id))]})}):(0,i.jsx)("p",{className:"text-variant-bodyMd mt-8 text-tertiary",children:o("好ããªãããã¯ã追å ããã")}),r&&(0,i.jsx)(c.o,{variant:"bodyMd",role:"alert",className:"pt-8 text-specific-red-400",children:r}),m&&(0,i.jsx)(er,{topics:x,open:u,onClose:p,selectedTopicState:e,onSelect:t,onDeselect:l,templateId:a,onAdd:s})]})},er=({open:e,onClose:t,selectedTopicState:s,onSelect:l,onDeselect:r,templateId:c,topics:n,onAdd:d})=>{let{t:p}=(0,N.A)("features/post"),u=(0,D.s6)(),m=(0,T.useMemo)(()=>(0,i.jsx)(a.$,{type:"button",variant:"plain",className:"text-tertiary",size:"mini",onClick:t,children:p("ãã£ã³ã»ã«")}
135),[t,p]);return(0,i.jsxs)(o.aF,{open:e,onClose:t,...u?{type:"popup",size:"large"}:{type:"sheet",size:"medium"},fixedSize:!0,children:[(0,i.jsx)(o.rQ,{title:p("ãããã¯ã鏿"),startNode:m,endNode:ec(t,p)}),(0,i.jsx)(o.$m,{children:(0,i.jsx)(ed,{selectedTopicState:s,onSelect:l,onDeselect:r,templateId:c,onAdd:d})}),(0,i.jsx)("div",{className:"border-t border-border bg-surface-plain pb-safe",children:(0,i.jsx)(eh,{topics:n,onDeselect:r})})]})},ec=(e,t)=>(0,i.jsx)(a.$,{size:"xsmall",variant:"plain",onClick:e,children:t("å®äº")}),eo=(0,k.UG)(` 136 # eslint-disable-next-line @graphql-eslint/unique-fragment-name -- FIXME 137 fragment TopicCardFragment on PostTopic { 138 id 139 label 140 imageUrl 141 postCount 142 isPostable(communityId: $communityId) 143 } 144`),en=(0,k.UG)(` 145 query TopicListQuery( 146 $communityId: String! 147 $templateId: String 148 $keyword: String! 149 $after: String 150 $first: Int 151 $userId: String 152 ) { 153 postTopicsByTemplateId( 154 communityId: $communityId 155 templateId: $templateId 156 keyword: $keyword 157 after: $after 158 first: $first 159 userId: $userId 160 ) { 161 edges { 162 node { 163 id 164 label 165 ...TopicCardFragment 166 } 167 } 168 pageInfo { 169 hasNextPage 170 endCursor 171 } 172 } 173 } 174 `,[eo]),ed=({onSelect:e,onDeselect:t,selectedTopicState:s,templateId:a,onAdd:r})=>{let{t:c}=(0,N.A)("features/post"),{handleMore:o,handleSearch:d,loading:p,data:u,hasTopics:m,hasMore:x,hasSearchWord:h,searchWord:f}=(({templateId:e})=>{let{communityId:t}=(0,G.N)(),s=(0,z.wS)(),[i,a]=(0,T.useState)(""),r=(0,C.A)(async e=>{a(e.target.value)},300),{data:c,fetchMore:o,loading:n}=(0,l.IT)(en,{variables:{communityId:t??"",templateId:e??null,keyword:i,first:30,after:null,userId:s??null},skip:!t}),d=(0,T.useMemo)(()=>c?.postTopicsByTemplateId,[c]),p=(0,T.useMemo)(()=>!!(d&&d.edges.length>0),[d]),u=(0,T.useMemo)(()=>c?.postTopicsByTemplateId.pageInfo.hasNextPage??!1,[c]);return{handleMore:(0,T.useCallback)(()=>{o({variables:{after:d?.pageInfo.endCursor},updateQuery:(e,{fetchMoreResult:t})=>t?.postTopicsByTemplateId?{...t,postTopicsByTemplateId:{pageInfo:t.postTopicsByTemplateId.pageInfo,edges:[...e.postTopicsByTemplateId.edges??[],...t.postTopicsByTemplateId.edges??[]]}}:e})},[d,o]),handleSearch:r,loading:n,data:c,hasTopics:p,hasMore:u,hasSearchWord:!!i,searchWord:i}})({templateId:a}),{createLabelOnlyTopicActivationFlag:j}=(0,K.D)(),g=(0,T.useMemo)(()=>!(!j||!h||p||s.allTopics.some(e=>e.label===f))&&(u?.postTopicsByTemplateId?.edges?.every(e=>e.node.label!==f)??!1),[j,u?.postTopicsByTemplateId?.edges,h,p,f,s.allTopics]),b=(0,T.useCallback)(t=>e({topicId:t.id,label:t.label,imageUrl:t.imageUrl}),[e]),y=(0,T.useCallback)(e=>r({label:e}),[r]),v=(0,T.useMemo)(()=>s.selectedTopics.filter(e=>e.isAdditional&&(!f||e.label.includes(f))),[f,s.selectedTopics]);return(0,i.jsxs)("div",{className:"cursor-pointer pt-12",children:[(0,i.jsx)("div",{className:"px-16",children:(0,i.jsx)(n.A,{size:"small",label:"",type:"text",placeholder:c("ãããã¯ãæ¤ç´¢"),"aria-label":c("ãããã¯ãæ¤ç´¢"),name:"searchTopics",onChange:d,startAdornment:eu})}),!j&&!m&&!p&&(0,i.jsx)("div",{className:"mt-96",children:(0,i.jsx)(w.w,{})}),(0,i.jsx)("div",{className:"overflow-auto py-24 pb-80 lg:grid-cols-6 lg:pb-40",children:(0,i.jsxs)(P.Q,{onLoadMore:o,isLoading:p,isLoadableMore:x,children:[g&&(0,i.jsx)(ex,{data:(0,k.QK)([eo],{id:"additional",label:f,imageUrl:"",postCount:0,isPostable:!0}),onSelect:b,onDeselect:t,isSelected:!1,isMust:!1,onAdd:y,isAdditional:!0},"TopicListItem_additional"),v.map(e=>(0,i.jsx)(ex,{data:(0,k.QK)([eo],{id:e.id,label:e.label,imageUrl:"",postCount:0,isPostable:!0}),onSelect:b,onDeselect:t,isSelected:!0,isMust:!1},`TopicListItem_${e.id}`)),p&&ep.map(e=>(0,i.jsx)(A.s,{},e)),u?.postTopicsByTemplateId.edges.map(e=>{let l=eb({state:s,topicId:e.node.id}),a=ey({state:s,topicId:e.node.id});return(0,i.jsx)(ex,{data:e.node,onSelect:b,onDeselect:t,isSelected:l||a,isMust:a},`TopicListItem_${e.node.id}`)})]})})]})},ep=(0,O.y)(9),eu=(0,i.jsx)(m.v,{size:"small"}),em=({data:e,onSelect:t,onDeselect:s,isSelected:l,isMust:a})=>{let{t:r}=(0,N.A)("features/post"),{id:o,label:n,postCount:d,imageUrl:p,isPostable:u}=(0,k.Bk)(eo,e),m=(0,T.useCallback)(()=>{a||(l?s({topicId:o}):t({id:o,label:n,imageUrl:p}))},[a,l,s,o,t,n,p]);return u?(0,i.jsxs)(j.Q,{onClick:m,children:[(0,i.jsxs)(g.a,{children:[(0,i.jsx)("div",{className:"flex size-48 shrink-0 items-center justify-center overflow-hidden rounded-md bg-object-neutral",children:p?(0,i.jsx)(E._,{alt:r(`{{label}}ã®ãããã¯ç»å`,{label:n}),src:p,height:48,width:48}):(0,i.jsx)(x.f,{width:"24px",height:"24px"})}),(0,i.jsxs)("div",{className:"ml-16 truncate",children:[(0,i.jsx)(c.o,{variant:"bodyLg",className:"truncate",children:n}),(0,i.jsxs)(c.o,{component:"span",variant:"bodySm",color:"tertiary",children:[d,r("æç¨¿")]})]})]}),(0,i.jsx)(b.R,{className:"text-accent",children:l&&(0,i.jsx)(h.l,{width:"20px",height:"20px"})})]}):null},ex=({data:e,onSelect:t,onDeselect:s,isSelected:l,isMust:a,isAdditional:r,onAdd:o})=>{let{t:n}=(0,N.A)("features/post"),{id:d,label:p,imageUrl:u,postCount:m,isPostable:v}=(0,k.Bk)(eo,e),C=(0,T.useCallback)(()=>
174{if(!a){if(l)return void s({topicId:d});if(r){if(!o)return void B.v.error({error:"onAdd is not defined"});o?.(p)}else t({id:d,label:p,imageUrl:u})}},[a,l,r,s,d,o,p,t,u]);return v?(0,i.jsx)("li",{className:"list-none",children:(0,i.jsxs)(j.Q,{onClick:C,children:[(0,i.jsxs)(g.a,{children:[(0,i.jsx)("div",{className:"flex size-48 shrink-0 items-center justify-center overflow-hidden rounded-md bg-object-neutral",children:u?(0,i.jsx)(E._,{alt:n(`{{label}}ã®ãããã¯ç»å`,{label:p}),src:u,height:48,width:48}):(0,i.jsx)(x.f,{width:"24px",height:"24px"})}),(0,i.jsxs)(y.i,{isSecondary:!0,children:[(0,i.jsx)("p",{className:"text-variant-bodyMd truncate",children:p}),!r&&(0,i.jsxs)(c.o,{component:"span",variant:"bodySm",color:"tertiary",children:[m,n("æç¨¿")]})]}),r&&(0,i.jsx)(y.i,{isSecondary:!0,className:"text-accent",children:(0,i.jsx)(f._,{})})]}),(0,i.jsx)(b.R,{className:"text-accent",children:l&&(0,i.jsx)(h.l,{width:"20px",height:"20px"})})]})}):null},eh=({topics:e,onDeselect:t})=>{let{t:s}=(0,N.A)("features/post"),l=e.length;return(0,i.jsxs)("div",{className:"min-h-80 px-16 pb-16 pt-8",children:[(0,i.jsxs)(c.o,{variant:"subtitleSm",color:"secondary",children:[s("鏿ä¸ã®ãããã¯"),(0,i.jsx)(c.o,{className:"ml-8",component:"span",variant:"subtitleSm",color:"secondary",children:l})]}),(0,i.jsx)("div",{className:"mt-8 overflow-x-auto",children:e.length>0&&(0,i.jsx)("ul",{className:"flex w-fit flex-row gap-8",children:e.map(e=>(0,i.jsx)(ef,{topic:e,onDeselect:t,type:"create"},e.id))})})]})},ef=({topic:e,onDeselect:t,type:s})=>{let l=(0,L.A)(),a=(0,T.useCallback)(()=>{l("topic_tag_deselect_click",{topicId:e.id}),t?.({topicId:e.id})},[l,t,e.id]);return(0,i.jsxs)("li",{className:(0,v.A)(V().tag,"flex w-fit items-center justify-between whitespace-nowrap rounded-lg px-8 text-accent","view"===s?"bg-object-neutral hover:bg-object-neutral-hover":"bg-object-accent hover:bg-object-accent-hover"),children:[(0,i.jsx)("p",{className:(0,v.A)("text-variant-bodySm","view"===s?"text-primary":"text-on-accent"),children:e.label}),t&&(0,i.jsx)("button",{type:"button","aria-label":"Delete this tag",onClick:a,className:"ml-4 flex",children:(0,i.jsx)(u.Z,{size:"xsmall",className:"view"===s?"text-primary":"text-on-accent"})})]})},ej=({topic:e,onDeselect:t})=>{let{t:s}=(0,N.A)("features/post"),l=(0,T.useCallback)(()=>{t({topicId:e.id})},[t,e.id]);return(0,i.jsxs)("div",{className:"flex w-full items-center justify-between whitespace-nowrap py-4",children:[(0,i.jsxs)("div",{className:"flex w-5/6 items-center",children:[(0,i.jsx)(E._,{src:e.imageUrl??"",width:66,height:66,alt:s(`{{label}}ã®ãããã¯ç»å`,{label:e.label}),sizes:"80px",className:"rounded-sm object-cover"}),(0,i.jsx)("p",{className:"text-variant-bodyMd ml-8 truncate text-primary",children:e.label})]}),(0,i.jsx)(r.K,{size:"medium","aria-label":s("åé¤"),onClick:l,children:(0,i.jsx)(u.Z,{})})]})},eg=e=>e.mustTopics.length+e.selectedTopics.length+Object.values(e.selectedCategoryTopicsDic).reduce((e,t)=>e+t.length,0),eb=({state:e,topicId:t})=>e.allTopics.some(e=>e.id===t),ey=({state:e,topicId:t})=>e.mustTopics.some(e=>e.id===t)}}]);
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.