PageSourceSearch

https://myfans.jp/_next/static/chunks/pages/account/coupons-07c1b503f73ddea9.js

js myfans.jp collected 2026-09-26 00:02:36 UTC 15,827 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];if(null!=t)for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:myfans-web":!0});var s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="bd8953a6-fc3f-4030-9a47-54bb33c1d991",e._sentryDebugIdIdentifier="sentry-dbid-bd8953a6-fc3f-4030-9a47-54bb33c1d991")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8545],{12743:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var a=t(15383),l=t(22143),n=t(35528);function i({planNames:e,postTargetType:s,postTargetsCount:t,postTargetsPreview:r,onOpenTargets:c}){let{t:d}=(0,n.Bd)(),x=r??[],o=s?"selected_posts"===s:x.length>0,p=t??x.length;return(0,a.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-[12px] text-[14px]",children:[(0,a.jsx)("div",{className:"shrink-0 font-semibold text-black",children:d("対象商品")}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col items-end gap-[4px] text-right font-light",children:[e&&(0,a.jsx)("div",{className:"w-full truncate text-black",children:e}),o?(0,a.jsx)("button",{type:"button",onClick:c,className:"border-none bg-transparent p-0 text-[#3B82F6]",children:d("{{count}}件の単品",{count:p})}):(0,a.jsx)("div",{className:"text-black",children:d("すべての単品")})]})]}),x.length>0&&(0,a.jsx)(l.j,{items:x.map(e=>({postId:e.post_id,thumbnailUrl:e.thumbnail_url})),size:64,linkToPost:!0})]})}},38875:(e,s,t)=>{"use strict";t.r(s),t.d(s,{__N_SSG:()=>B,default:()=>K});var a=t(15383),l=t(86449),n=t(51689),i=t(80747),r=t(68862),c=t(4964),d=t(99677),x=t.n(d),o=t(99689),p=t(23245),m=t(14343),u=t(2925),h=t(23244),g=t(72009),_=t(86968),f=t(81627),j=t(821),N=t(17506),b=t(99185),y=t(23523),v=t(84611),w=t(8397),k=t(12743),E=t(40525),A=t(95901),F=t(38327),O=t(35528);function C({creators:e,onOpenAll:s}){let{t}=(0,O.Bd)(),l=e.length>5,n=l?e.slice(0,4):e,i=e.length-n.length;return(0,a.jsxs)("div",{className:"ds flex flex-col gap-3",children:[(0,a.jsx)("div",{className:"text-[14px] font-semibold leading-5 text-black",children:t("対象クリエイター")}),(0,a.jsxs)("div",{className:"grid grid-cols-5 items-start gap-2",children:[n.map(e=>(0,a.jsxs)(N.muE,{href:F.y._username(e.username).$url(),className:"flex min-w-0 flex-col items-center gap-1 text-textblack hover:text-textblack",children:[(0,a.jsx)(N.euF,{src:e.avatar_url,alt:e.name,size:44,showApprovedBadge:e.has_approved_user_identification,showOfficialBadge:e.is_official,showPremiumCreatorBadge:e.can_display_premium_badge}),(0,a.jsx)("span",{className:"w-full truncate text-center text-[10px] font-semibold leading-4",children:e.name})]},e.id)),l&&(0,a.jsxs)(N.vJ3,{onClick:s,className:"flex min-w-0 flex-col items-center gap-1",children:[(0,a.jsx)("div",{className:"flex size-11 items-center justify-center rounded-full bg-textblack-bg text-[10px] font-semibold text-textblack",children:`+${i}`}),(0,a.jsx)("span",{className:"w-full truncate text-center text-[10px] font-semibold leading-4 text-textblack",children:t("その他のクリエイター")})]})]})]})}var M=t(17104),z=t(77834),P=t(33973),D=t(83788),I=t(76754);let $=({coupon:e,createdCouponId:s})=>{let{enqueueSnackbar:t}=(0,p.dh)(),{t:i}=(0,O.Bd)(),c=(0,o.useRouter)(),d="plans"===e.target||"plans_and_single_plans"===e.target?(e.target_plans??[]).map(e=>e.name).join(" "):"",[x,u]=(0,m.useState)(!1),[h,g]=(0,m.useState)(!1),[_,f]=(0,m.useState)(!1),j=e.admin_creator_coupon?.target_creators??[],$=async()=>{f(!0);try{if(e.issuer){let{data:s,error:a}=await v.fCV(e.issuer.id);if(a)return void t((0,P.u1)(a),{variant:"error"});if(s&&s.id)return void await c.push(F.y.messages._messageRoomId(s.id).$url())}await c.push(F.y.messages.$url())}finally{f(!1)}};return(0,a.jsxs)("div",{className:`w-full rounded-lg bg-white p-4 shadow-[0px_1px_12px_0px_#00000033] ${e.available_premium_only||"issuer"in e&&e.
1issuer?"border border-[#FFDE4D]":s===e.id?"border border-primary":""} flex flex-col gap-3`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsx)(A.A,{target:e.target,isNewPurchaserOnly:e.is_new_purchaser_only,isNewRegistrationOnly:e.is_new_registration_only,isPlanSubscribersOnly:"only_plan_subscribers"===e.single_plan_target,availablePremiumOnly:e.available_premium_only,isCreatorTargetedOnly:j.length>0}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.gc,{className:"shrink-0 cursor-pointer text-[12px]",icon:b.N_J}),(0,a.jsx)("span",{className:"text-[10px] font-light text-black",children:e.is_new_registration_only&&e.new_registration_expires_at?i("{{date, datetime}}まで利用可能",{date:new Date(e.new_registration_expires_at),formatParams:{date:D.pz}}):i("{{date, datetime}}で終了",{date:new Date(e.end_at),formatParams:{date:D.s2}})})]})]}),"issuer"in e&&e.issuer&&(0,a.jsxs)(M.A,{href:F.y._username(e.issuer.username).$url(),className:"flex min-w-0 items-center gap-2 text-black hover:text-black",children:[(0,a.jsx)(N.euF,{src:e.issuer.avatar_url,alt:e.issuer.name,showApprovedBadge:e.issuer.has_approved_user_identification,showOfficialBadge:e.issuer.is_official,showPremiumCreatorBadge:e.issuer.can_display_premium_badge,size:24}),(0,a.jsx)("span",{className:"flex-1 truncate text-[12px] font-semibold",children:e.issuer.name}),e.issuer.username&&(0,a.jsx)("span",{className:"text-[12px] font-light text-[#858585]",children:`@${e.issuer.username}`})]}),(0,a.jsx)("div",{className:"break-words text-[14px] font-semibold leading-5",children:e.name}),"single_plans"===e.target?(0,a.jsx)(k.A,{planNames:d,postTargetType:e.post_target_type,postTargetsCount:e.post_targets_count,postTargetsPreview:e.post_targets_preview,onOpenTargets:()=>u(!0)}):"plans_and_single_plans"===e.target?(0,a.jsx)(E.A,{label:i("対象商品"),value:i("プラン/単品販売(DM限定販売を含む)"),truncate:!0}):"unlimited_plans"===e.target?(0,a.jsx)(E.A,{label:i("対象商品"),value:i("見放題ch"),truncate:!0}):"plans_and_single_plans_and_unlimited_plans"===e.target?(0,a.jsx)(E.A,{label:i("対象商品"),value:[i("プラン"),i("単品販売(DM限定販売を含む)"),i("見放題ch")].join("/"),truncate:!0}):d?(0,a.jsx)(E.A,{label:i("対象商品"),value:d,truncate:!0}):null,j.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"h-px w-full bg-[#E0E0E0]"}),(0,a.jsx)(C,{creators:j,onOpenAll:()=>g(!0)})]}),(0,a.jsx)("div",{className:"h-px w-full bg-[#E0E0E0]"}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(r.gc,{className:"w-4 shrink-0 cursor-pointer text-primary",icon:n._2z,style:{height:"18px"}}),(0,a.jsx)("span",{className:"text-[12px]/[normal] font-semibold text-primary",children:(0,z.C)(e.kind)?i("割引額"):i("割引率")}),(0,a.jsx)("div",{className:"flex items-center gap-0.5",children:(0,z.C)(e.kind)?(0,a.jsx)("span",{className:"text-[12px]/[normal] font-bold text-primary",children:(0,a.jsx)(O.x6,{i18nKey:"{{price}} OFF",components:{price:(0,a.jsx)(w.S,{amount:e.amount,size:"2xl",bold:!0,className:"text-primary leading-normal"})}})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[24px]/[normal] font-semibold text-primary",children:e.amount.toString()}),(0,a.jsx)("span",{className:"text-[12px]/[normal] font-semibold text-primary",children:i("%OFF")})]})}),e.discount_limit_price&&(0,a.jsxs)("span",{className:"text-[10px] text-primary",children:[(0,a.jsx)("span",{children:"("}),(0,a.jsx)(O.x6,{i18nKey:"最大{{amount}}円引き",components:{price:(0,a.jsx)(w.S,{formattedAmount:(0,I.A)(e.discount_limit_price),size:"sm",className:"text-primary"})}}),(0,a.jsx)("span",{children:")"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-light leading-[140%] tracking-[0%] text-[#858585]",children:i("クーポンコード")}),(0,a.jsx)("span",{className:"text-[12px] font-semibold leading-[140%] tracking-[0px] text-black",children:e.code})]})]}),(0,a.jsxs)(N.$nd,{variant:"contained",color:"yellow",className:"h-10 w-full gap-2 text-[11px] shadow-none",onClick:()=>{var s;return s=e.code,void((0,y.A)(s),t(i("コピーしました"),{variant:"success"}))},children:[(0,a.jsx)(r.gc,{className:"h-4 w-3.5 shrink-0 cursor-pointer text-[16px]",icon:l.jPR}),(0,a.jsx)("div",{className:"text-[12px]/[normal] font-semibold",children:i("クーポンコードをコピーする")})]}),e.show_message_sale_cta&&(0,a.jsxs)(N.$nd,{variant:"outlined",color:"primary",className:"h-10 w-full gap-2 text-[11px]",loading:_,onClick:$,children:[(0,a.jsx)(r.gc,{className:"h-4 w-3.5 shrink-0 cursor-pointer text-[16px]",icon:l.gSF}),(0,a.jsx)("div",{className:"text-[12px]/[normal] font-semibold",children:i("DM限定販売を確認する")})]}),j.length>0&&(0,a.jsx)(N.LW0,{open:h,onClose:()=>g(!1),creators:j}
1),"single_plans"===e.target&&(0,a.jsx)(N.RSJ,{open:x,onClose:()=>u(!1),couponId:e.coupon_id,variant:"user"})]})};var S=t(89984),T=t(34251),B=!0;let K=(0,g.rN)(()=>{let{t:e}=(0,O.Bd)(),{enqueueSnackbar:s}=(0,p.dh)(),{query:t}=(0,o.useRouter)(),d=t.userCouponId,{data:g,isLoading:b,isError:y}=(0,_.o)(),{data:v}=(0,f._)(),{mutate:w}=(0,f.H)(),k=(0,m.useMemo)(()=>g?.map(e=>e.id)??[],[g]),E=(0,m.useMemo)(()=>g?.filter(e=>e.show_message_sale_cta).length??0,[g]);return((0,j.v)(T.i.COUPON_LIST_VIEWED,{coupons:k},!b&&!y&&!!g),(0,m.useEffect)(()=>{v?.has_unread&&w()},[v,w]),(0,m.useEffect)(()=>{y&&s(e("クーポンの取得に失敗しました。"),{variant:"error"})},[y,s,e]),b)?(0,a.jsx)(h.Ay,{headerTitle:e("クーポン一覧"),headerLeft:(0,a.jsx)(M.A,{href:F.y.account.settings.$url(),children:(0,a.jsx)("div",{className:"flex size-6 items-center p-2",children:(0,a.jsx)(r.gc,{icon:n.Wzs,color:S.w.palette.text.primary,className:"text-lg drop-shadow-lg"})})}),children:(0,a.jsx)("div",{className:"p-4",children:(0,a.jsx)("div",{className:"flex h-20 items-center justify-center",children:(0,a.jsx)(c.A,{size:20})})})}):(0,a.jsxs)(h.Ay,{headerTitle:e("クーポン一覧"),headerLeft:(0,a.jsx)(M.A,{href:F.y.account.settings.$url(),children:(0,a.jsx)("div",{className:"flex size-6 items-center p-2",children:(0,a.jsx)(r.gc,{icon:n.Wzs,color:S.w.palette.text.primary,className:"text-lg drop-shadow-lg"})})}),children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,a.jsx)(M.A,{href:u.w.coupon,target:"_blank",children:(0,a.jsxs)("div",{className:"flex w-full flex-col items-start gap-0.5 bg-[#EEF6FF] px-4 py-2 text-[#0587FF]",children:[(0,a.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,a.jsx)(r.gc,{icon:l.mEO,className:"shrink-0 text-[14px]"}),(0,a.jsx)("p",{className:"text-[12px] font-semibold leading-[16px]",children:e("クーポンについて")}),(0,a.jsx)(r.gc,{icon:l.XkK,className:"ml-auto shrink-0 text-[14px]"})]}),(0,a.jsx)("p",{className:"text-[10px] font-light leading-[14px]",children:e("運営から配布されるクーポンについてのご案内")})]})}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-error",children:[(0,a.jsx)(r.gc,{icon:l.lEd,className:"size-[14px] shrink-0"}),(0,a.jsx)("p",{className:"text-xs font-light",children:e("過去に加入したことがあるプランには使用できません。")})]}),(0,a.jsxs)("div",{className:"text-[10px]",children:[(0,a.jsx)(x(),{className:"-ml-px mr-1 inline-block object-contain align-middle",width:20,height:20,style:{minWidth:20,minHeight:20},src:"/images/logo/premium-creator-icon.svg",alt:""}),(0,a.jsx)("span",{className:"align-middle",children:e("はプレミアム/準プレミアムのクリエイターに付与されています")})]}),E>0&&(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(N.O6k,{className:"max-w-full whitespace-normal",children:e("DM限定販売で使えるクーポンが{{count}}件あります!",{count:E})})}),g&&0!==g.length?g.map(e=>(0,a.jsx)($,{coupon:e,createdCouponId:d},e.id)):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-5",style:{height:"236px"},children:[(0,a.jsx)(r.gc,{className:"shrink-0 text-[56px] text-primary",icon:i.Up0}),(0,a.jsx)("div",{className:"text-center text-[16px] font-semibold text-primary",children:e("クーポンがありません")})]})]}),(0,a.jsx)("div",{className:"fixed bottom-[68px] right-4 sm:right-[calc(50%_-_240px_+_1rem)]",children:(0,a.jsx)(M.A,{href:F.y.account.coupons.new.$url(),children:(0,a.jsx)(N.$nd,{size:"small",variant:"contained",startIcon:(0,a.jsx)(r.gc,{className:"text-white",icon:n.QLR}),sx:{height:"40px"},children:(0,a.jsx)("div",{className:"flex items-center gap-1",children:(0,a.jsx)("div",{className:"text-xs font-semibold",children:e("クーポン追加")})})})})})]})})},40525:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(15383);function l({label:e,value:s,truncate:t=!1}){return(0,a.jsxs)("div",{className:"flex items-center justify-between gap-[12px] text-[14px]",children:[(0,a.jsx)("div",{className:"shrink-0 font-semibold text-black",children:e}),(0,a.jsx)("div",{className:t?"min-w-0 truncate text-right font-light text-black":"font-light text-black",children:s})]})}},64095:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/coupons",function(){return t(38875)}])},81627:(e,s,t)=>{"use strict";t.d(s,{H:()=>x,_:()=>d});var a=t(7354),l=t(14539),n=t(38253),i=t(84611),r=t(11215);let c={all:["coupon_notifications"],hasUnread:()=>[...c.all,"has_unread"]},d=(e=!0)=>(0,a.I)({queryKey:c.hasUnread(),queryFn:()=>i.JcQ(),...r._$,enabled:e,refetchOnMount:!0,refetchOnWindowFocus:!0}),x=()=>{let e=(0,l.jE)();return(0,n.n)({mutationFn:()=>i.Jf(),onSuccess:()=>
1{e.invalidateQueries({queryKey:c.hasUnread()})}})}},86968:(e,s,t)=>{"use strict";t.d(s,{O:()=>x,o:()=>d});var a=t(7354),l=t(14539),n=t(38253),i=t(84611),r=t(11215);let c={all:["account_coupons"],list:()=>[...c.all,"list"]},d=()=>(0,a.I)({queryKey:c.list(),queryFn:()=>i.pGP(),...r._$,refetchOnMount:!0}),x=()=>{let e=(0,l.jE)();return(0,n.n)({mutationFn:e=>i.tAz(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.list()})}})}},95901:(e,s,t)=>{"use strict";t.d(s,{A:()=>x});var a=t(15383),l=t(35528);let n="rounded bg-[#FFE3DC] px-[8px] py-[2px] text-[10px] font-light text-primary",i="rounded-[3px] border-[0.5px] border-primary px-[8px] py-[2px] text-[10px] font-light text-primary",r=["plans","plans_and_single_plans","plans_and_single_plans_and_unlimited_plans"],c=["single_plans","plans_and_single_plans","plans_and_single_plans_and_unlimited_plans"],d=["unlimited_plans","plans_and_single_plans_and_unlimited_plans"];function x({target:e,isNewPurchaserOnly:s,isNewRegistrationOnly:t,isPlanSubscribersOnly:o,availablePremiumOnly:p,isCreatorTargetedOnly:m}){let{t:u}=(0,l.Bd)();return(0,a.jsxs)("div",{className:"flex flex-wrap gap-[6px]",children:[r.includes(e)&&(0,a.jsx)("span",{className:n,children:u("プラン")}),c.includes(e)&&(0,a.jsx)("span",{className:n,children:u("単品販売(DM限定販売を含む)")}),d.includes(e)&&(0,a.jsx)("span",{className:n,children:u("見放題ch")}),s&&(0,a.jsx)("span",{className:i,children:u("新規購入者限定")}),t&&(0,a.jsx)("span",{className:i,children:u("新規登録者限定")}),o&&(0,a.jsx)("span",{className:i,children:u("プラン加入者限定")}),p&&(0,a.jsx)("span",{className:i,children:u("プレミアムクリエイター限定")}),m&&(0,a.jsx)("span",{className:i,children:u("対象クリエイター限定")})]})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=64095)),_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.