PageSourceSearch

https://mirlo.space/assets/Index-CA1s8q6K.js

js mirlo.space collected 2026-10-02 03:32:49 UTC 10,009 bytes, 2 lines download raw bytes

1import{R as f,j as e,L as R,v as A}from"./vendor-DxTwiIr9.js";import{u as z,a as L,D,S as E,v as M,s as O,K as B,P as $,c as U,C as F}from"./sortable.esm-J-9aL2Gu.js";import{u as N,d as v,au as K,a8 as P,k as q,bi as w,z as p,bd as G,bO as S,bP as C,g as I,bQ as Q,B as W,aX as X}from"./index-B0cS9kiR.js";import{S as Y}from"./StripeStatusAndButton-ChqCQbJ-.js";import{T as _}from"./Toggle-C5ptGH6W.js";import{N as H}from"./NewAlbumButton-CnZR9WP4.js";import{A as J}from"./AutoComplete-D3-GSoOI.js";import{h as V}from"./ManageTags-BtH9WDTk.js";import{u as h,T as Z}from"./i18n-BmyL0TSe.js";import{P as k}from"./ProfileSection-DuleXpXM.js";import"./charts-DHrntohF.js";import"./markdown-CNkDHZ-E.js";import"./editor-Cm2fdcmq.js";import"./player-Dfxbckx2.js";import"./once-DE2Yxeba.js";import"./cloneDeep-DC0Hyq8x.js";import"./uniq-BGSYOx8e.js";const ee=({refresh:s})=>{const{user:i}=N(),{t:r}=h("translation",{keyPrefix:"label"}),n=f.useCallback(async l=>{try{i!=null&&i.id&&V(l)&&(typeof l.id=="string"||typeof l.id=="number")&&(await v.post("manage/artists/".concat(l.id,"/labels"),{labelUserId:i.id,isLabelApproved:!0}),s())}catch(m){s()}},[i==null?void 0:i.id,s]),t=f.useCallback(async l=>(await v.getMany("artists?name=".concat(l,"&includeUnpublished=true"))).results.map(o=>({id:o.id,name:"".concat(o.name," (").concat(o.name,")")})),[]);return e.jsxs("div",{className:"md:flex w-full flex-row items-start justify-between gap-6",children:[e.jsxs("form",{className:"md:w-1/2",children:[e.jsx("h3",{id:"label-existing-artist",children:r("addExistingArtistToRoster")}),e.jsx("p",{className:"mbs-1",id:"description-existing-artist",children:r("addExistingArtistExplanation")}),e.jsx(J,{ariaDescribedBy:"description-existing-artist",ariaLabelledBy:"label-existing-artist",className:"mbs-4",getOptions:t,id:"input-existing-artist",onSelect:n})]}),e.jsxs("div",{className:"md:w-1/2",children:[e.jsx("h3",{children:r("addNewArtistToRoster")}),e.jsx("p",{className:"mbs-1",children:r("addNewArtistExplanation")}),e.jsx(K,{wrap:!0,className:"mbs-4",variant:"outlined",to:"/manage/welcome",endIcon:e.jsx(P,{}),children:r("createNewArtist")})]})]})},se=({relationship:s,children:i})=>{var c;const{t:r}=h("translation",{keyPrefix:"label"}),{attributes:n,listeners:t,setActivatorNodeRef:l,setNodeRef:m,transform:o,transition:j,isDragging:d}=U({id:s.artist.id}),a={transform:F.Transform.toString(o),transition:j,opacity:d?.6:void 0,zIndex:d?1:void 0};return e.jsxs("div",{ref:m,style:a,...n,className:"flex flex-col md:flex-row md:items-center gap-4 p-3 md:p-1 md:px-3 bg-(--mi-normal-background-color)",children:[e.jsx("button",{ref:l,type:"button","aria-label":(c=r("reorderRoster"))!=null?c:"Drag to reorder roster",className:"cursor-grab touch-none p-1 self-start md:self-center text-(--mi-light-foreground-color)",...t,children:e.jsx(X,{})}),i]})},te=()=>{const{data:s,refetch:i}=A(S()),r=f.useMemo(()=>{var a;return(a=s==null?void 0:s.results)!=null?a:[]},[s==null?void 0:s.results]),{user:n}=N(),{t}=h("translation",{keyPrefix:"label"}),[l,m]=f.useState(r),o=z(L($),L(B,{coordinateGetter:O})),j=async(a,c)=>{n&&(await v.put("manage/label/artists/".concat(a),{isLabelApproved:c,labelUserId:n.id}),i())},d=async a=>{const{active:c,over:x}=a;if(!x||c.id===x.id)return;const g=l.findIndex(b=>b.artist.id===c.id),u=l.findIndex(b=>b.artist.id===x.id);if(g===-1||u===-1)return;const y=[...l],[T]=y.splice(g,1);y.splice(u,0,T),m(y),await v.put("manage/label/artistOrder",{artistIds:y.map(b=>b.artist.id)}),i()};return f.useEffect(()=>{r&&m(r)},[r]),e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:t("artistsOnYourRoster",{count:l.length})}),e.jsx("div",{className:"my-8 space-y-1 divide-y-1 divide-(--mi-darken-background-color)",children:l.length===0?e.jsx("div",{className:"text-center py-4 bg-(--mi-darken-background-color) rounded",children:t("noArtists")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex flex-col md:flex-row md:items-center gap-4 p-3 md:p-1 md:px-3 bg-(--mi-darken-background-color) text-xs",children:[e.jsx("div",{className:"w-6","aria-hidden":!0}),e.jsx("div",{className:"flex-1 col-span-2",children:t("artist")}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4 flex-3 items-center",children:[e.jsx("div",{children:t("manage")}),e.jsx("div",{children:t("canLabelAddReleases")}),e.jsx("div",{children:t("isArtistConfirmed")}),e.jsx("div",{children:t("showOnRoster")}),e.jsx("div",{className:"col-span-2 text-right",children:t("actions")})]})]}),e.jsx(D,{sensors:o,onDragEnd:d,children:e.jsx(E,{items:l.map(a=>a.artist.id),strategy:M,children:l.map(a=>{var c,x,g,u;return e.jsxs(se,{relationship:a,children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("img",{src:(x=(c=a.artist.avatar)==null?void 0:c.sizes)==null?void 0:x[120],className:"w-10 h-10 object-cover flex-shrink-0 rounded"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-semibold",children:a.artist.name}),e.jsx("p",{className:"text-sm opacity-70",children:t("releaseCount",{count:(u=(g=a.artist._count)==null?void 0:g.trackGroups)!=null?u:0})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4 flex-3",children:[e.jsxs("div",{className:"flex flex-col gap-1 justify-center",children:[e.jsx("label",{className:"md:sr-only text-sm opacity-70",children:t("manage")}),a.canLabelManageArtist?e.jsx(R,{to:w(a.artist.id),children:t("manage")}):e.jsx("span",{children:t("askArtist")})]}),e.jsxs("div",{className:"flex flex-col gap-1 justify-center",children:[e.jsx("label",{id:"canLabelAddReleases",className:"md:sr-only text-sm opacity-70",children:t("canLabelAddReleases")}
1),e.jsx("div",{"aria-labelledby":"canLabelAddReleases",children:a.canLabelAddReleases?e.jsx(C,{}):null})]}),e.jsxs("div",{className:"flex flex-col gap-1 justify-center",children:[e.jsx("label",{id:"isArtistConfirmed",className:"md:sr-only text-sm opacity-70",children:t("isArtistConfirmed")}),e.jsx("div",{"aria-labelledby":"isArtistConfirmed",children:a.isArtistApproved?e.jsx(C,{}):e.jsx("span",{className:"text-sm",children:t("askArtist")})})]}),e.jsxs("div",{className:"flex flex-col gap-1 justify-center",children:[e.jsx("label",{id:"isLabelConfirmed",className:"md:sr-only text-sm opacity-70",children:t("isLabelConfirmed")}),e.jsx(_,{id:"isLabelConfirmed",labelId:"isLabelConfirmed",toggled:a.isLabelApproved,onClick:()=>{j(a.artistId,!a.isLabelApproved)},labelClassName:"text-sm",label:t("showOnPage")})]}),e.jsxs("div",{className:"col-span-2 items-end md:items-center justify-end \n                 flex flex-col md:flex-row gap-2",children:[a.canLabelManageArtist&&e.jsx(H,{artist:a.artist}),e.jsx(p,{size:"compact",variant:"link",to:I(a.artist),children:t("viewPage")})]})]})]},a.artist.id)})})})]})}),e.jsx(ee,{refresh:i})]})},ae=()=>{const{t:s}=h("translation",{keyPrefix:"label"}),{user:i}=N(),{data:{results:r}={results:[]},refetch:n}=A(S()),{data:{results:t}={},isLoading:l,refetch:m}=A(Q()),o=f.useMemo(()=>t==null?void 0:t.filter(d=>d.isLabelProfile?!1:!(r==null?void 0:r.some(c=>c.artist.id===d.id))),[t,r]),j=f.useCallback(async d=>{try{i!=null&&i.id&&(await v.post("manage/artists/".concat(d,"/labels"),{labelUserId:i.id,isLabelApproved:!0}),m(),n())}catch(a){m(),n()}},[i==null?void 0:i.id]);return l||!o||(o==null?void 0:o.length)===0?null:e.jsxs(k,{children:[e.jsx("h3",{children:s("otherArtists")}),e.jsx("p",{children:s("otherArtistsDescription")}),e.jsxs("div",{className:"my-8 space-y-1 divide-y-1 divide-(--mi-darken-background-color)",children:[e.jsxs("div",{className:"flex text-sm flex-col md:flex-row md:items-center gap-4 p-1 bg-(--mi-darken-background-color) rounded",children:[e.jsx("div",{children:s("artist")}),e.jsx("div",{className:"text-end",children:s("actions")})]}),o.map((d,a)=>{var c,x;return e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-4 p-1 bg-(--mi-darken-background-color) rounded",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("img",{src:(x=(c=d.avatar)==null?void 0:c.sizes)==null?void 0:x[120],className:"w-10 h-10 object-cover flex-shrink-0 rounded"}),e.jsx("div",{className:"flex-1",children:e.jsx("p",{className:"font-semibold",children:d.name})})]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-2",children:[e.jsx(p,{size:"compact",to:I(d),children:s("viewPage")}),e.jsx(W,{size:"compact",onClick:()=>j(d.id),children:s("addToRoster")})]})]},d.id)})]})]})},ye=()=>{var t;const{t:s}=h("translation",{keyPrefix:"label"}),{t:i}=h("translation",{keyPrefix:"pageTitles"}),{user:r}=N();if(!r)return e.jsx("p",{children:s("notALabel")});const n=(t=r.artists)==null?void 0:t.find(l=>l.isLabelProfile);return n?e.jsx(q,{variant:"big",justify:"center",children:e.jsxs("div",{className:"flex gap-2 flex-col",children:[e.jsx("h1",{children:s("manageLabel")}),e.jsx("p",{children:s("manageLabelDescription")}),e.jsx("p",{children:e.jsx(Z,{t:s,i18nKey:"linkToProfile",components:{link:e.jsx(R,{to:w(n.id)})}})}),e.jsxs("div",{className:"flex flex-wrap justify-between gap-4 mt-4",children:[e.jsx(p,{to:w(n.id),startIcon:e.jsx(G,{}),size:"compact",variant:"dashed",children:s("editLabelProfile")}),e.jsx(p,{to:"/".concat(n==null?void 0:n.urlSlug),endIcon:e.jsx(P,{}),variant:"link",size:"compact",children:s("viewLabelPage")})]}),e.jsxs(k,{children:[e.jsx("h2",{children:s("manageArtists")}),e.jsx(te,{})]}),e.jsx(ae,{}),e.jsxs(k,{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"gap-2 flex flex-col md:flex-row justify-between md:items-center",children:[e.jsx("h2",{children:s("managePayment")}),e.jsxs("div",{className:"flex gap-2 ",children:[e.jsx(p,{wrap:!0,variant:"outlined",to:"/sales",size:"compact",children:s("viewSalesPage",{pageName:i("sales")})}),e.jsx(p,{wrap:!0,variant:"outlined",to:"/fulfillment",size:"compact",children:s("viewFulfillmentPage",{pageName:i("fulfillment")})})]})]}),e.jsx(Y,{})]})]})}):e.jsx("p",{children:s("notALabel")})};export{ye as default};
2//# sourceMappingURL=Index-CA1s8q6K.js.map

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.