@dcl/builder-site 7.18.1-19715307871.commit-e4fe0b6 → 7.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/assets/{Back-DyJK54Hh.js → Back-BiiwRci0.js} +1 -1
  2. package/assets/{CollectionProvider.container-Dp2WLu4v.js → CollectionProvider.container-DflF1wDU.js} +1 -1
  3. package/assets/{CollectionStatus.container-BL0x_fwg.js → CollectionStatus.container-CB6NpIWJ.js} +1 -1
  4. package/assets/{ConfirmDelete-B91nXjkm.js → ConfirmDelete-DbOvRTAN.js} +1 -1
  5. package/assets/{FileSaver.min-B5DnlLFe.js → FileSaver.min-DxwzZUzB.js} +1 -1
  6. package/assets/{ItemProvider.container-C5AAbJB2.js → ItemProvider.container-CwXmjtiu.js} +2 -2
  7. package/assets/{JumpIn.container-DwwGSm07.js → JumpIn.container-9hoS9dDE.js} +1 -1
  8. package/assets/{LandAction-CfziiZBC.js → LandAction-CmPHqo26.js} +1 -1
  9. package/assets/{LandProviderPage-sSWU8Djz.js → LandProviderPage-XT-wuXx3.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-CQqfbb0m.js → LoggedInDetailPage.container-BKHHdpyw.js} +1 -1
  11. package/assets/{Navigation-DHrPIwmV.css → Navigation-BwVpKw2E.css} +1 -1
  12. package/assets/{Navigation.container-DSufh-bQ.js → Navigation.container-CXL1uNrk.js} +1 -1
  13. package/assets/{NotFound-DVAktJpL.js → NotFound-BRE3uxVB.js} +1 -1
  14. package/assets/{OptionsDropdown-DeQXB2g5.js → OptionsDropdown-w6mo4pkB.js} +1 -1
  15. package/assets/{RentalPeriod-eV9t6-pS.js → RentalPeriod-xaK2LedP.js} +1 -1
  16. package/assets/{SDKTag-iOabj9VM.js → SDKTag-_dtW9rV9.js} +1 -1
  17. package/assets/{SceneStats.container-BswYWYXO.js → SceneStats.container-DItMX74e.js} +1 -1
  18. package/assets/{SignInRequired-CBz9NAiT.js → SignInRequired-Dyg4CYup.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-U_gswt8U.js → ThirdPartyKindBadge-BbAezXzB.js} +1 -1
  20. package/assets/{dataReader-CyuGlqX0.js → dataReader-oLau9YkX.js} +1 -1
  21. package/assets/{date-D0HytY9R.js → date-BLHZs3cn.js} +1 -1
  22. package/assets/{fortmatic-CIFw-xHc.js → fortmatic-BaNuTnMs.js} +1 -1
  23. package/assets/{hooks-BcM8jB4I.js → hooks-CK_m9kX-.js} +1 -1
  24. package/assets/{index-YZpe0pJY.js → index-2C2g-LD3.js} +1 -1
  25. package/assets/{index-Ba9-zdr0.js → index-33VMjg0p.js} +1 -1
  26. package/assets/{index-nE9qMlnO.js → index-4x97-Awd.js} +1 -1
  27. package/assets/{index-Bq2oESeB.js → index-5k92toJ3.js} +1 -1
  28. package/assets/{index-CyXS7WrA.js → index-A_eO3nLl.js} +1 -1
  29. package/assets/{index-C0uGXLRx.js → index-B6--3Y0E.js} +1 -1
  30. package/assets/index-B7CTycpd.css +1 -0
  31. package/assets/index-BCE5l4gQ.css +1 -0
  32. package/assets/{index-BAeVfeI8.js → index-BJocszHZ.js} +1 -1
  33. package/assets/{index-DNwTr82W.js → index-BqfvJQtQ.js} +1 -1
  34. package/assets/{index-D0W7ynWj.js → index-BstTehS5.js} +1 -1
  35. package/assets/index-BxbT7FzG.js +1 -0
  36. package/assets/{index-D1mE7Pq2.js → index-C0PMGLnP.js} +1 -1
  37. package/assets/index-C0eW87D3.js +1 -0
  38. package/assets/{index-BZ1U1-43.js → index-C6Ljy0zW.js} +1 -1
  39. package/assets/index-C76G48D2.css +1 -0
  40. package/assets/{index-B6iOJJwv.js → index-C8nFTPFo.js} +1 -1
  41. package/assets/{index-DDKs-prG.js → index-CF41jN7I.js} +1 -1
  42. package/assets/{index-DEV-iJUJ.js → index-CHBa_6eD.js} +1 -1
  43. package/assets/{index-C0IZthTF.js → index-CHX-HRNW.js} +1 -1
  44. package/assets/{index-BTR4YjFG.css → index-CKsOZ7Nm.css} +7 -7
  45. package/assets/index-COWROTya.js +1 -0
  46. package/assets/{index-eolWCzJ-.css → index-COwAuGwJ.css} +1 -1
  47. package/assets/{index-5VE5GKgU.js → index-CULmIEsX.js} +1 -1
  48. package/assets/{index-piyXblfD.js → index-Ca55RDBU.js} +1 -1
  49. package/assets/{index-Cs3ChHQr.js → index-CcE2BXCw.js} +1 -1
  50. package/assets/{index-4bkCSYKm.js → index-CjkP9_4j.js} +1 -1
  51. package/assets/{index-DQemcoFl.js → index-CosF1ry6.js} +1 -1
  52. package/assets/{index-DVlGqsfN.css → index-CpWwd8y_.css} +1 -1
  53. package/assets/{index-p-00KYcu.js → index-CptCSL_w.js} +1 -1
  54. package/assets/{index-DzSoTcC1.js → index-D0_DiOgH.js} +1 -1
  55. package/assets/{index-BqEM9aAx.js → index-D1zilnkH.js} +1 -1
  56. package/assets/{index-D9h5MPU9.js → index-DDb0diH8.js} +1 -1
  57. package/assets/{index-BsEyA0ss.js → index-D_rU2i23.js} +1 -1
  58. package/assets/{index-CSWV1GRZ.js → index-DceABlEs.js} +1 -1
  59. package/assets/{index-DHMqe4Qk.js → index-DfhjTRKU.js} +1 -1
  60. package/assets/{index-B9IfCo27.js → index-DiBOcJQ7.js} +1 -1
  61. package/assets/{index-CCVrfwLB.js → index-DjBYc5DV.js} +1 -1
  62. package/assets/index-DpjYOTYz.css +1 -0
  63. package/assets/{index-DItlsJH8.js → index-DxTb4GUB.js} +1 -1
  64. package/assets/{index-BinDqk18.js → index-ILlHFLXJ.js} +1 -1
  65. package/assets/{index-F0X7eW43.js → index-Q9zr9nAD.js} +1 -1
  66. package/assets/index-SXAYJeSU.js +2 -0
  67. package/assets/{index-CWV9dZOh.js → index-TujGy-8_.js} +1 -1
  68. package/assets/{index-y7RTOsaO.js → index-UD374e2H.js} +19 -19
  69. package/assets/{index-QqOsJEZ5.js → index-hv4-U6Oe.js} +1 -1
  70. package/assets/{index-CnAIkeyj.js → index-mvJXOtfQ.js} +1 -1
  71. package/assets/{index-BiLRnDfw.js → index-p6KDqRJP.js} +1 -1
  72. package/assets/{index-3ogAbOTZ.js → index-rtv3ilhk.js} +2 -2
  73. package/assets/{index.es-CGpxIjWL.js → index.es-Cxq5abSy.js} +4 -4
  74. package/assets/{selectors-DQU7U9ba.js → selectors-A-tGldC4.js} +1 -1
  75. package/index.html +3 -3
  76. package/package.json +2 -2
  77. package/assets/index-3DeQnkvR.js +0 -1
  78. package/assets/index-BLtsujYh.css +0 -1
  79. package/assets/index-BWB2HVas.js +0 -1
  80. package/assets/index-Bz8n66ul.css +0 -1
  81. package/assets/index-DJHlhaqt.css +0 -1
  82. package/assets/index-DlZ8c2DG.css +0 -1
  83. package/assets/index-nwQeEOoJ.js +0 -1
  84. package/assets/index-odho0NAb.js +0 -2
@@ -1 +1 @@
1
- import{b1 as ye,ak as te,a4 as ae,N as e,c$ as z,M as a,T as Re,d0 as me,a7 as ne,d1 as G,S as s,d2 as Y,d3 as Pe,d4 as M,cN as De,J as l,R as k,aG as le,bQ as Ae,aa as ge,ab as _,d5 as We,d6 as pe,d7 as Oe,bq as L,d8 as Ue,cT as xe,d9 as se,da as Ce,db as je,dc as de,dd as ue,de as K,df as Q,P as be,a5 as he,cP as Be,dg as Me,dh as Ie,cQ as He,di as $e,cc as Fe,dj as ze,ac as Ke,aj as Qe,dk as Ge,dl as Ye,cU as Ve,a2 as X,dm as qe,cV as Je,cW as Xe,cd as Ze,dn as es}from"./index-y7RTOsaO.js";import{a as we,N as ss}from"./Navigation.container-DSufh-bQ.js";import{L as ts}from"./LoggedInDetailPage.container-CQqfbb0m.js";import"./selectors-DQU7U9ba.js";import"./SignInRequired-CBz9NAiT.js";var B=(t=>(t.DESC="DESC",t.ASC="ASC",t))(B||{});const Ne="tab";var b=(t=>(t.DCL="dcl",t.ENS="ens",t.CONTRIBUTOR="contributor",t))(b||{});const Ee=()=>{const t=ye(),n=new URLSearchParams(t.search),d=n.get(Ne),m={urlSearchParams:n,pathname:t.pathname};switch(d){case"dcl":m.tab="dcl";break;case"ens":m.tab="ens";break;case"contributor":m.tab="contributor";break}return m},as=({isWorldContributorEnabled:t})=>{const{tab:n,pathname:d,urlSearchParams:m}=Ee(),c=ae(),g=o=>{const i=new URLSearchParams(m);i.set(Ne,o),c.push(`${d}?${i.toString()}`)};return!n||n===b.CONTRIBUTOR&&!t?(g(b.DCL),null):e.jsxs(z,{children:[e.jsx(z.Tab,{active:n===b.DCL,onClick:()=>g(b.DCL),children:a("worlds_list_page.name_tabs.dcl_names")}),e.jsx(z.Tab,{active:n===b.ENS,onClick:()=>g(b.ENS),children:a("worlds_list_page.name_tabs.ens_names")}),t&&e.jsx(z.Tab,{active:n===b.CONTRIBUTOR,onClick:()=>g(b.CONTRIBUTOR),children:a("worlds_list_page.name_tabs.contributor_names")})]})},ns=te.memo(as),ls=t=>({isWorldContributorEnabled:me(t)}),rs=Re(ls)(ns),os="_container_12bci_1",is="_used_12bci_7",cs="_description_12bci_13",ds="_link_12bci_20",us="_space_12bci_27",bs="_current_12bci_33",hs="_bar_12bci_38",S={container:os,used:is,description:cs,link:ds,space:us,current:bs,bar:hs},_s="worlds-storage-current-mbs",ms="worlds-storage-bar-front",gs="worlds-storage",ps=({maxBytes:t,currentBytes:n,className:d,onViewDetails:m})=>{const c=Y(t),g=Y(n),o=g*100/c;return e.jsxs("div",{"data-testid":gs,className:ne(S.container,d),children:[e.jsx("span",{className:S.used,children:a("worlds_list_page.worlds_storage.used")}),e.jsxs("div",{className:S.description,children:[e.jsx("span",{children:a("worlds_list_page.worlds_storage.description")})," ",e.jsx("span",{className:S.link,onClick:m,children:a("worlds_list_page.worlds_storage.link")})]}),e.jsxs("div",{className:S.space,children:[e.jsxs("div",{"data-testid":_s,children:[e.jsx("span",{className:S.current,children:G(g)})," / ",G(c)," Mb"]}),e.jsx(s.Progress,{"data-testid":ms,percent:Math.trunc(o),className:S.bar,size:"small"})]})]})},xs=te.memo(ps),Cs="_worldUrl_1sb6i_1",js="_rightContainer_1sb6i_7",ws="_copyUrn_1sb6i_13",Z={worldUrl:Cs,rightContainer:js,copyUrn:ws};function Te({ens:t,deploymentsByWorlds:n}){const d=Pe(t.subdomain);return M(n,t)?e.jsxs("div",{className:Z.worldUrl,children:[e.jsx("span",{children:d}),e.jsxs("div",{className:Z.rightContainer,children:[e.jsx(De,{role:"button",text:d,showPopup:!0,children:e.jsx(s.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:ne("copy",Z.copyUrn),name:"copy outline"})}),e.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:e.jsx(s.Icon,{name:"external alternate"})})]})]}):e.jsx("span",{className:"empty-url",children:a("worlds_list_page.table.empty_url")})}function Se({deploymentsByWorlds:t,ens:n,projects:d,onEditScene:m,onUnpublishScene:c,onPublishScene:g}){const o=t[n.subdomain];return M(t,n)?e.jsxs("div",{className:"publish-scene",children:[e.jsx(s.Popup,{content:o==null?void 0:o.name,on:"hover",trigger:e.jsx("span",{children:o==null?void 0:o.name})}),d.find(i=>i.id===(o==null?void 0:o.projectId))?m&&e.jsx(s.Button,{inverted:!0,size:"small",onClick:()=>m(n),children:a("worlds_list_page.table.edit_scene")}):c&&e.jsx(s.Popup,{content:a("worlds_list_page.table.scene_published_outside_builder"),on:"hover",position:"top center",trigger:e.jsx(s.Button,{inverted:!0,size:"small",onClick:()=>c(n),children:a("worlds_list_page.table.unpublish_scene")})})]}):e.jsxs("div",{className:"publish-scene",children:[e.jsx("span",{children:"-"}),g&&e.jsx(s.Button,{primary:!0,size:"small",onClick:g,children:a("worlds_list_page.table.publish_scene")})]})}function Ns({items:t,deploymentsByWorlds:n,projects:d,loading:m,error:c,onUnpublishWorld:g}){const o=ae(),i=l.useCallback(()=>{o.push(k.scenes())},[o]),N=l.useCallback(p=>{const{projectId:x}=n[p.subdomain];o.push(k.sceneDetail(x))},[n,k,o]),E=l.useCallback(p=>{var C;const x=(C=n[p.subdomain])==null?void 0:C.id;x&&g(x)},[n,g]);return c?e.jsx(s.Message,{error:!0,size:"tiny",visible:!0,content:c.message,header:a("worlds_list_page.error_title")}):m?e.jsx(s.Loader,{active:!0,size:"big"}):t.length?e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.name")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.owner")}),e.jsx(s.Table.HeaderCell,{width:"2",children:a("worlds_list_page.table.url")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.published_scene")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.size")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.permissions")})]})}),e.jsx(s.Table.Body,{children:t.map((p,x)=>{var v,y;const C=(v=p.userPermissions)==null?void 0:v.includes("deployment"),f=(y=p.userPermissions)==null?void 0:y.map(R=>a(`worlds_list_page.table.user_permissions.${R}`)).join("/");return e.jsxs(s.Table.Row,{className:"TableRow",children:[e.jsx(s.Table.Cell,{width:1,children:p.name}),e.jsx(s.Table.Cell,{width:1,children:e.jsx(Ae,{address:p.nftOwnerAddress||""})}),e.jsx(s.Table.Cell,{width:2,children:e.jsx(Te,{deploymentsByWorlds:n,ens:p})}),e.jsx(s.Table.Cell,{width:1,children:e.jsx(Se,{deploymentsByWorlds:n,ens:p,projects:d,onEditScene:C?N:void 0,onPublishScene:C?i:void 0,onUnpublishScene:C?E:void 0})}),e.jsx(s.Table.Cell,{width:1,children:G(Y(Number(p.size)||0))}),e.jsx(s.Table.Cell,{width:1,children:f})]},x)})})]}):e.jsxs(s.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:"empty-icon dcl-icon"}),e.jsx("div",{className:"empty-title",children:a("worlds_list_page.empty_contributor_list.title")}),e.jsx("div",{className:"empty-description",children:a("worlds_list_page.empty_contributor_list.description",{b:p=>e.jsx("b",{children:p})})}),e.jsx(s.Button,{as:"a",href:`${le.get("MARKETPLACE_WEB_URL")}/names/claim`,target:"_blank",className:"empty-action",primary:!0,children:a("worlds_list_page.empty_list.cta")})]})}const Es=()=>{const t=ge(),n=we(),d=_(We),m=_(pe),c=_(Oe),g=_(i=>L(xe(i),Ue)||L(Ce(i),se)),o=l.useCallback(i=>t(je(i)),[t]);return e.jsx(Ns,{items:d,deploymentsByWorlds:m,projects:n,loading:g,error:c,onUnpublishWorld:o})},_e="Worlds List Page Action",Ts=le.get("ENS_DOMAINS_URL",""),Ss=le.get("MARKETPLACE_WEB_URL"),ee=12,Ls=t=>{const{ensList:n,externalNames:d,error:m,deploymentsByWorlds:c,isLoading:g,projects:o,worldsWalletStats:i,isConnected:N,isWorldContributorEnabled:E,ensTotal:p,onOpenYourStorageModal:x,onOpenWorldsForENSOwnersAnnouncementModal:C,onUnpublishWorld:f,onOpenPermissionsModal:v,onFetchContributableNames:y,onFetchENSList:R}=t,[I,P]=l.useState(B.DESC),[O,U]=l.useState(1),{tab:h}=Ee(),D=ae();l.useEffect(()=>{N&&E&&y()},[N,E]),l.useEffect(()=>{h===b.DCL&&R(ee,(O-1)*ee)},[R,O]);const A=l.useCallback(()=>{h===b.DCL?(de(_e,{action:"Click Claim NAME"}),window.open(`${Ss}/names/claim`,"_blank","noopener,noreferrer")):(de(_e,{action:"Click Claim ENS Domain"}),window.open(Ts,"_blank","noopener,noreferrer"))},[h]),V=l.useCallback(()=>{D.push(k.scenes())},[k,D]),q=l.useCallback(u=>{const{projectId:r}=c[u.subdomain];D.push(k.sceneDetail(r))},[c,k,D]),w=l.useCallback(u=>{var j;const r=(j=c[u.subdomain])==null?void 0:j.id;r&&f(r)},[c,f]),W=l.useCallback((u,r)=>{U(+r.activePage)},[]),re=l.useCallback(()=>e.jsx(s.Dropdown,{direction:"left",value:I,options:[{value:B.ASC,text:a("global.order.name_asc")},{value:B.DESC,text:a("global.order.name_desc")}],onChange:(u,{value:r})=>P(r)}),[I,P]),oe=l.useCallback(u=>{let r=M(c,u)?"active":"inactive";if(r==="active"&&i&&!ue(u.subdomain))switch(K(i).status){case Q.BLOCKED:{r="blocked";break}case Q.TO_BE_BLOCKED:r="warning"}return e.jsx("span",{className:`world-status ${r}`,children:a(`worlds_list_page.table.status_${r}`)})},[c,K,ue,M]),ie=l.useCallback((u,r)=>{var F;const j=h===b.DCL?r==null?void 0:r.dclNames:r==null?void 0:r.ensNames;if(!M(c,u)||!j)return"-";const T=(F=j.find(ve=>ve.name===u.subdomain))==null?void 0:F.size,J=h===b.ENS?" / 25":"";return G(Y(Number(T)))+J},[h]),Le=l.useCallback((u,r)=>{v(r)},[]),H=l.useCallback(()=>{const u=h===b.DCL?p:d.length,r=Math.ceil(u/ee),j=h===b.DCL?n:d;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(s.Container,{children:e.jsxs(s.Row,{children:[e.jsx(s.Column,{children:e.jsx(s.Row,{children:e.jsx(s.Header,{sub:!0,className:"items-count",children:a("ens_list_page.items",{count:t.ensTotal.toLocaleString()})})})}),e.jsx(s.Column,{align:"right",children:e.jsx(s.Row,{children:re()})}),e.jsx(s.Column,{align:"right",grow:!1,shrink:!0,children:e.jsx(s.Row,{children:e.jsx("div",{className:"actions",children:e.jsx(s.Button,{basic:!0,onClick:A,children:e.jsx(be,{name:"add-active"})})})})})]})})}),e.jsx(s.Container,{children:e.jsxs(s.Section,{className:"table-section",children:[e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"2",children:a("worlds_list_page.table.name")}),e.jsx(s.Table.HeaderCell,{width:"2",children:a("worlds_list_page.table.url")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.published_scene")}),e.jsx(s.Table.HeaderCell,{width:"1",textAlign:"center",children:a("worlds_list_page.table.size")}),e.jsx(s.Table.HeaderCell,{width:"1",textAlign:"center",children:a("worlds_list_page.table.status")}),e.jsx(s.Table.HeaderCell,{width:"1",textAlign:"center"})]})}),e.jsx(s.Table.Body,{children:j.map((T,J)=>e.jsxs(s.Table.Row,{className:"TableRow",children:[e.jsx(s.Table.Cell,{width:2,children:T.name}),e.jsx(s.Table.Cell,{width:2,children:e.jsx(Te,{deploymentsByWorlds:c,ens:T})}),e.jsx(s.Table.Cell,{width:1,children:e.jsx(Se,{deploymentsByWorlds:c,ens:T,projects:o,onEditScene:q,onPublishScene:V,onUnpublishScene:w})}),e.jsx(s.Table.Cell,{width:1,textAlign:"center",children:ie(T,i)}),e.jsx(s.Table.Cell,{width:1,textAlign:"center",children:oe(T)}),e.jsx(s.Table.Cell,{width:1,textAlign:"center",children:e.jsx(s.Button,{basic:!0,onClick:F=>Le(F,T.subdomain),children:a("worlds_list_page.table.permissions")})})]},J))})]}),r>1&&e.jsx(s.Pagination,{firstItem:null,lastItem:null,totalPages:r,activePage:O,onPageChange:W})]})})]})},[h,n,d,A,re,ie,oe,W,p]),$=l.useCallback(()=>e.jsxs(s.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:ne("empty-icon",h===b.DCL?"dcl-icon":"ens-icon")}),e.jsx("div",{className:"empty-title",children:h===b.DCL?a("worlds_list_page.empty_list.title"):a("worlds_list_page.empty_list.title_ens")}),e.jsx("div",{className:"empty-description",children:h===b.DCL?a("worlds_list_page.empty_list.description",{b:u=>e.jsx("b",{children:u})}):a("worlds_list_page.empty_list.description_ens",{b:u=>e.jsx("b",{children:u})})}),e.jsx(s.Button,{className:"empty-action",primary:!0,onClick:A,children:h===b.DCL?a("worlds_list_page.empty_list.cta"):a("worlds_list_page.empty_list.cta_ens")})]}),[h,A]),ce=l.useCallback(()=>{if(!i)return null;const u=K(i);if(u.status===Q.OK)return null;let r;return u.status===Q.TO_BE_BLOCKED?r=a("worlds_list_page.worlds_warning_message.to_be_blocked",{toBeBlockedAt:u.toBeBlockedAt.toLocaleDateString(),b:j=>e.jsx("b",{children:j})}):r=a("worlds_list_page.worlds_warning_message.blocked",{blockedAt:u.blockedAt.toLocaleDateString(),b:j=>e.jsx("b",{children:j})}),e.jsxs("div",{className:"insufficient-storage-message",children:[e.jsx("div",{children:e.jsx(be,{name:"alert-warning"})}),e.jsx("div",{children:r})]})},[i,K]),ke=l.useCallback(()=>n.length?e.jsxs("div",{children:[i?e.jsx(xs,{maxBytes:Number(i.maxAllowedSpace),currentBytes:Number(i.usedSpace),className:"worlds-storage",onViewDetails:()=>{x({stats:i})}}):null,ce(),H()]}):e.jsx("div",{children:$()}),[n,i,H,$,ce,x]),fe=l.useCallback(()=>e.jsx("div",{children:d.length>0?H():$()}),[d,$,H]);return l.useEffect(()=>{P(B.ASC),U(1)},[h,U,P]),l.useEffect(()=>{he()&&C()},[he,C]),e.jsx(ts,{className:"WorldListPage view",error:m,activeTab:ss.WORLDS,isLoading:g,isPageFullscreen:!0,children:e.jsxs(s.Container,{children:[e.jsx("h1",{children:a("worlds_list_page.title")}),e.jsx(rs,{}),h===b.DCL&&ke(),h===b.ENS&&fe(),h===b.CONTRIBUTOR&&E&&e.jsx(Es,{})]})})},ks=te.memo(Ls),fs=()=>{const t=ge(),n=we(),d=_(Be),m=_(Me),c=_(pe),g=_(Ie),o=_(He),i=_($e),N=_(xe),E=_(Ce),p=_(Fe),x=_(ze),C=_(Ke),f=_(Qe),v=_(Ge),y=_(Ye),R=_(me),I=_(Ve),P=(o==null?void 0:o.message)??i??void 0,O=l.useMemo(()=>L(N,Xe)||L(E,se)||L(p,Ze)||L(x,se)||L(N,es)||C,[N,E,p,x,C]),U=l.useCallback(w=>t(X("WorldsYourStorageModal",w)),[t]),h=l.useCallback((w,W)=>t(X("WorldPermissionsModal",{worldName:w,isCollaboratorsTabShown:W})),[t]),D=l.useCallback(()=>t(X("WorldsForENSOwnersAnnouncementModal")),[t]),A=l.useCallback(w=>t(je(w)),[t]),V=l.useCallback(()=>t(qe()),[t]),q=l.useCallback((w,W)=>t(Je(w,W)),[t]);return e.jsx(ks,{ensList:d,externalNames:m,deploymentsByWorlds:c,projects:n,worldsPermissions:g,error:P,isLoading:O,isLoggedIn:f,worldsWalletStats:v,isConnected:y,isWorldContributorEnabled:R,ensTotal:I,onOpenYourStorageModal:U,onOpenPermissionsModal:h,onOpenWorldsForENSOwnersAnnouncementModal:D,onUnpublishWorld:A,onFetchContributableNames:V,onFetchENSList:q})},As=fs;export{As as default};
1
+ import{b1 as ye,ak as te,a4 as ae,N as e,c$ as z,M as a,T as Re,d0 as me,a7 as ne,d1 as G,S as s,d2 as Y,d3 as Pe,d4 as M,cN as De,J as l,R as k,aG as le,bQ as Ae,aa as ge,ab as _,d5 as We,d6 as pe,d7 as Oe,bq as L,d8 as Ue,cT as xe,d9 as se,da as Ce,db as je,dc as de,dd as ue,de as K,df as Q,P as be,a5 as he,cP as Be,dg as Me,dh as Ie,cQ as He,di as $e,cc as Fe,dj as ze,ac as Ke,aj as Qe,dk as Ge,dl as Ye,cU as Ve,a2 as X,dm as qe,cV as Je,cW as Xe,cd as Ze,dn as es}from"./index-UD374e2H.js";import{a as we,N as ss}from"./Navigation.container-CXL1uNrk.js";import{L as ts}from"./LoggedInDetailPage.container-BKHHdpyw.js";import"./selectors-A-tGldC4.js";import"./SignInRequired-Dyg4CYup.js";var B=(t=>(t.DESC="DESC",t.ASC="ASC",t))(B||{});const Ne="tab";var b=(t=>(t.DCL="dcl",t.ENS="ens",t.CONTRIBUTOR="contributor",t))(b||{});const Ee=()=>{const t=ye(),n=new URLSearchParams(t.search),d=n.get(Ne),m={urlSearchParams:n,pathname:t.pathname};switch(d){case"dcl":m.tab="dcl";break;case"ens":m.tab="ens";break;case"contributor":m.tab="contributor";break}return m},as=({isWorldContributorEnabled:t})=>{const{tab:n,pathname:d,urlSearchParams:m}=Ee(),c=ae(),g=o=>{const i=new URLSearchParams(m);i.set(Ne,o),c.push(`${d}?${i.toString()}`)};return!n||n===b.CONTRIBUTOR&&!t?(g(b.DCL),null):e.jsxs(z,{children:[e.jsx(z.Tab,{active:n===b.DCL,onClick:()=>g(b.DCL),children:a("worlds_list_page.name_tabs.dcl_names")}),e.jsx(z.Tab,{active:n===b.ENS,onClick:()=>g(b.ENS),children:a("worlds_list_page.name_tabs.ens_names")}),t&&e.jsx(z.Tab,{active:n===b.CONTRIBUTOR,onClick:()=>g(b.CONTRIBUTOR),children:a("worlds_list_page.name_tabs.contributor_names")})]})},ns=te.memo(as),ls=t=>({isWorldContributorEnabled:me(t)}),rs=Re(ls)(ns),os="_container_12bci_1",is="_used_12bci_7",cs="_description_12bci_13",ds="_link_12bci_20",us="_space_12bci_27",bs="_current_12bci_33",hs="_bar_12bci_38",S={container:os,used:is,description:cs,link:ds,space:us,current:bs,bar:hs},_s="worlds-storage-current-mbs",ms="worlds-storage-bar-front",gs="worlds-storage",ps=({maxBytes:t,currentBytes:n,className:d,onViewDetails:m})=>{const c=Y(t),g=Y(n),o=g*100/c;return e.jsxs("div",{"data-testid":gs,className:ne(S.container,d),children:[e.jsx("span",{className:S.used,children:a("worlds_list_page.worlds_storage.used")}),e.jsxs("div",{className:S.description,children:[e.jsx("span",{children:a("worlds_list_page.worlds_storage.description")})," ",e.jsx("span",{className:S.link,onClick:m,children:a("worlds_list_page.worlds_storage.link")})]}),e.jsxs("div",{className:S.space,children:[e.jsxs("div",{"data-testid":_s,children:[e.jsx("span",{className:S.current,children:G(g)})," / ",G(c)," Mb"]}),e.jsx(s.Progress,{"data-testid":ms,percent:Math.trunc(o),className:S.bar,size:"small"})]})]})},xs=te.memo(ps),Cs="_worldUrl_1sb6i_1",js="_rightContainer_1sb6i_7",ws="_copyUrn_1sb6i_13",Z={worldUrl:Cs,rightContainer:js,copyUrn:ws};function Te({ens:t,deploymentsByWorlds:n}){const d=Pe(t.subdomain);return M(n,t)?e.jsxs("div",{className:Z.worldUrl,children:[e.jsx("span",{children:d}),e.jsxs("div",{className:Z.rightContainer,children:[e.jsx(De,{role:"button",text:d,showPopup:!0,children:e.jsx(s.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:ne("copy",Z.copyUrn),name:"copy outline"})}),e.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",children:e.jsx(s.Icon,{name:"external alternate"})})]})]}):e.jsx("span",{className:"empty-url",children:a("worlds_list_page.table.empty_url")})}function Se({deploymentsByWorlds:t,ens:n,projects:d,onEditScene:m,onUnpublishScene:c,onPublishScene:g}){const o=t[n.subdomain];return M(t,n)?e.jsxs("div",{className:"publish-scene",children:[e.jsx(s.Popup,{content:o==null?void 0:o.name,on:"hover",trigger:e.jsx("span",{children:o==null?void 0:o.name})}),d.find(i=>i.id===(o==null?void 0:o.projectId))?m&&e.jsx(s.Button,{inverted:!0,size:"small",onClick:()=>m(n),children:a("worlds_list_page.table.edit_scene")}):c&&e.jsx(s.Popup,{content:a("worlds_list_page.table.scene_published_outside_builder"),on:"hover",position:"top center",trigger:e.jsx(s.Button,{inverted:!0,size:"small",onClick:()=>c(n),children:a("worlds_list_page.table.unpublish_scene")})})]}):e.jsxs("div",{className:"publish-scene",children:[e.jsx("span",{children:"-"}),g&&e.jsx(s.Button,{primary:!0,size:"small",onClick:g,children:a("worlds_list_page.table.publish_scene")})]})}function Ns({items:t,deploymentsByWorlds:n,projects:d,loading:m,error:c,onUnpublishWorld:g}){const o=ae(),i=l.useCallback(()=>{o.push(k.scenes())},[o]),N=l.useCallback(p=>{const{projectId:x}=n[p.subdomain];o.push(k.sceneDetail(x))},[n,k,o]),E=l.useCallback(p=>{var C;const x=(C=n[p.subdomain])==null?void 0:C.id;x&&g(x)},[n,g]);return c?e.jsx(s.Message,{error:!0,size:"tiny",visible:!0,content:c.message,header:a("worlds_list_page.error_title")}):m?e.jsx(s.Loader,{active:!0,size:"big"}):t.length?e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.name")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.owner")}),e.jsx(s.Table.HeaderCell,{width:"2",children:a("worlds_list_page.table.url")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.published_scene")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.size")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.permissions")})]})}),e.jsx(s.Table.Body,{children:t.map((p,x)=>{var v,y;const C=(v=p.userPermissions)==null?void 0:v.includes("deployment"),f=(y=p.userPermissions)==null?void 0:y.map(R=>a(`worlds_list_page.table.user_permissions.${R}`)).join("/");return e.jsxs(s.Table.Row,{className:"TableRow",children:[e.jsx(s.Table.Cell,{width:1,children:p.name}),e.jsx(s.Table.Cell,{width:1,children:e.jsx(Ae,{address:p.nftOwnerAddress||""})}),e.jsx(s.Table.Cell,{width:2,children:e.jsx(Te,{deploymentsByWorlds:n,ens:p})}),e.jsx(s.Table.Cell,{width:1,children:e.jsx(Se,{deploymentsByWorlds:n,ens:p,projects:d,onEditScene:C?N:void 0,onPublishScene:C?i:void 0,onUnpublishScene:C?E:void 0})}),e.jsx(s.Table.Cell,{width:1,children:G(Y(Number(p.size)||0))}),e.jsx(s.Table.Cell,{width:1,children:f})]},x)})})]}):e.jsxs(s.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:"empty-icon dcl-icon"}),e.jsx("div",{className:"empty-title",children:a("worlds_list_page.empty_contributor_list.title")}),e.jsx("div",{className:"empty-description",children:a("worlds_list_page.empty_contributor_list.description",{b:p=>e.jsx("b",{children:p})})}),e.jsx(s.Button,{as:"a",href:`${le.get("MARKETPLACE_WEB_URL")}/names/claim`,target:"_blank",className:"empty-action",primary:!0,children:a("worlds_list_page.empty_list.cta")})]})}const Es=()=>{const t=ge(),n=we(),d=_(We),m=_(pe),c=_(Oe),g=_(i=>L(xe(i),Ue)||L(Ce(i),se)),o=l.useCallback(i=>t(je(i)),[t]);return e.jsx(Ns,{items:d,deploymentsByWorlds:m,projects:n,loading:g,error:c,onUnpublishWorld:o})},_e="Worlds List Page Action",Ts=le.get("ENS_DOMAINS_URL",""),Ss=le.get("MARKETPLACE_WEB_URL"),ee=12,Ls=t=>{const{ensList:n,externalNames:d,error:m,deploymentsByWorlds:c,isLoading:g,projects:o,worldsWalletStats:i,isConnected:N,isWorldContributorEnabled:E,ensTotal:p,onOpenYourStorageModal:x,onOpenWorldsForENSOwnersAnnouncementModal:C,onUnpublishWorld:f,onOpenPermissionsModal:v,onFetchContributableNames:y,onFetchENSList:R}=t,[I,P]=l.useState(B.DESC),[O,U]=l.useState(1),{tab:h}=Ee(),D=ae();l.useEffect(()=>{N&&E&&y()},[N,E]),l.useEffect(()=>{h===b.DCL&&R(ee,(O-1)*ee)},[R,O]);const A=l.useCallback(()=>{h===b.DCL?(de(_e,{action:"Click Claim NAME"}),window.open(`${Ss}/names/claim`,"_blank","noopener,noreferrer")):(de(_e,{action:"Click Claim ENS Domain"}),window.open(Ts,"_blank","noopener,noreferrer"))},[h]),V=l.useCallback(()=>{D.push(k.scenes())},[k,D]),q=l.useCallback(u=>{const{projectId:r}=c[u.subdomain];D.push(k.sceneDetail(r))},[c,k,D]),w=l.useCallback(u=>{var j;const r=(j=c[u.subdomain])==null?void 0:j.id;r&&f(r)},[c,f]),W=l.useCallback((u,r)=>{U(+r.activePage)},[]),re=l.useCallback(()=>e.jsx(s.Dropdown,{direction:"left",value:I,options:[{value:B.ASC,text:a("global.order.name_asc")},{value:B.DESC,text:a("global.order.name_desc")}],onChange:(u,{value:r})=>P(r)}),[I,P]),oe=l.useCallback(u=>{let r=M(c,u)?"active":"inactive";if(r==="active"&&i&&!ue(u.subdomain))switch(K(i).status){case Q.BLOCKED:{r="blocked";break}case Q.TO_BE_BLOCKED:r="warning"}return e.jsx("span",{className:`world-status ${r}`,children:a(`worlds_list_page.table.status_${r}`)})},[c,K,ue,M]),ie=l.useCallback((u,r)=>{var F;const j=h===b.DCL?r==null?void 0:r.dclNames:r==null?void 0:r.ensNames;if(!M(c,u)||!j)return"-";const T=(F=j.find(ve=>ve.name===u.subdomain))==null?void 0:F.size,J=h===b.ENS?" / 25":"";return G(Y(Number(T)))+J},[h]),Le=l.useCallback((u,r)=>{v(r)},[]),H=l.useCallback(()=>{const u=h===b.DCL?p:d.length,r=Math.ceil(u/ee),j=h===b.DCL?n:d;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(s.Container,{children:e.jsxs(s.Row,{children:[e.jsx(s.Column,{children:e.jsx(s.Row,{children:e.jsx(s.Header,{sub:!0,className:"items-count",children:a("ens_list_page.items",{count:t.ensTotal.toLocaleString()})})})}),e.jsx(s.Column,{align:"right",children:e.jsx(s.Row,{children:re()})}),e.jsx(s.Column,{align:"right",grow:!1,shrink:!0,children:e.jsx(s.Row,{children:e.jsx("div",{className:"actions",children:e.jsx(s.Button,{basic:!0,onClick:A,children:e.jsx(be,{name:"add-active"})})})})})]})})}),e.jsx(s.Container,{children:e.jsxs(s.Section,{className:"table-section",children:[e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"2",children:a("worlds_list_page.table.name")}),e.jsx(s.Table.HeaderCell,{width:"2",children:a("worlds_list_page.table.url")}),e.jsx(s.Table.HeaderCell,{width:"1",children:a("worlds_list_page.table.published_scene")}),e.jsx(s.Table.HeaderCell,{width:"1",textAlign:"center",children:a("worlds_list_page.table.size")}),e.jsx(s.Table.HeaderCell,{width:"1",textAlign:"center",children:a("worlds_list_page.table.status")}),e.jsx(s.Table.HeaderCell,{width:"1",textAlign:"center"})]})}),e.jsx(s.Table.Body,{children:j.map((T,J)=>e.jsxs(s.Table.Row,{className:"TableRow",children:[e.jsx(s.Table.Cell,{width:2,children:T.name}),e.jsx(s.Table.Cell,{width:2,children:e.jsx(Te,{deploymentsByWorlds:c,ens:T})}),e.jsx(s.Table.Cell,{width:1,children:e.jsx(Se,{deploymentsByWorlds:c,ens:T,projects:o,onEditScene:q,onPublishScene:V,onUnpublishScene:w})}),e.jsx(s.Table.Cell,{width:1,textAlign:"center",children:ie(T,i)}),e.jsx(s.Table.Cell,{width:1,textAlign:"center",children:oe(T)}),e.jsx(s.Table.Cell,{width:1,textAlign:"center",children:e.jsx(s.Button,{basic:!0,onClick:F=>Le(F,T.subdomain),children:a("worlds_list_page.table.permissions")})})]},J))})]}),r>1&&e.jsx(s.Pagination,{firstItem:null,lastItem:null,totalPages:r,activePage:O,onPageChange:W})]})})]})},[h,n,d,A,re,ie,oe,W,p]),$=l.useCallback(()=>e.jsxs(s.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:ne("empty-icon",h===b.DCL?"dcl-icon":"ens-icon")}),e.jsx("div",{className:"empty-title",children:h===b.DCL?a("worlds_list_page.empty_list.title"):a("worlds_list_page.empty_list.title_ens")}),e.jsx("div",{className:"empty-description",children:h===b.DCL?a("worlds_list_page.empty_list.description",{b:u=>e.jsx("b",{children:u})}):a("worlds_list_page.empty_list.description_ens",{b:u=>e.jsx("b",{children:u})})}),e.jsx(s.Button,{className:"empty-action",primary:!0,onClick:A,children:h===b.DCL?a("worlds_list_page.empty_list.cta"):a("worlds_list_page.empty_list.cta_ens")})]}),[h,A]),ce=l.useCallback(()=>{if(!i)return null;const u=K(i);if(u.status===Q.OK)return null;let r;return u.status===Q.TO_BE_BLOCKED?r=a("worlds_list_page.worlds_warning_message.to_be_blocked",{toBeBlockedAt:u.toBeBlockedAt.toLocaleDateString(),b:j=>e.jsx("b",{children:j})}):r=a("worlds_list_page.worlds_warning_message.blocked",{blockedAt:u.blockedAt.toLocaleDateString(),b:j=>e.jsx("b",{children:j})}),e.jsxs("div",{className:"insufficient-storage-message",children:[e.jsx("div",{children:e.jsx(be,{name:"alert-warning"})}),e.jsx("div",{children:r})]})},[i,K]),ke=l.useCallback(()=>n.length?e.jsxs("div",{children:[i?e.jsx(xs,{maxBytes:Number(i.maxAllowedSpace),currentBytes:Number(i.usedSpace),className:"worlds-storage",onViewDetails:()=>{x({stats:i})}}):null,ce(),H()]}):e.jsx("div",{children:$()}),[n,i,H,$,ce,x]),fe=l.useCallback(()=>e.jsx("div",{children:d.length>0?H():$()}),[d,$,H]);return l.useEffect(()=>{P(B.ASC),U(1)},[h,U,P]),l.useEffect(()=>{he()&&C()},[he,C]),e.jsx(ts,{className:"WorldListPage view",error:m,activeTab:ss.WORLDS,isLoading:g,isPageFullscreen:!0,children:e.jsxs(s.Container,{children:[e.jsx("h1",{children:a("worlds_list_page.title")}),e.jsx(rs,{}),h===b.DCL&&ke(),h===b.ENS&&fe(),h===b.CONTRIBUTOR&&E&&e.jsx(Es,{})]})})},ks=te.memo(Ls),fs=()=>{const t=ge(),n=we(),d=_(Be),m=_(Me),c=_(pe),g=_(Ie),o=_(He),i=_($e),N=_(xe),E=_(Ce),p=_(Fe),x=_(ze),C=_(Ke),f=_(Qe),v=_(Ge),y=_(Ye),R=_(me),I=_(Ve),P=(o==null?void 0:o.message)??i??void 0,O=l.useMemo(()=>L(N,Xe)||L(E,se)||L(p,Ze)||L(x,se)||L(N,es)||C,[N,E,p,x,C]),U=l.useCallback(w=>t(X("WorldsYourStorageModal",w)),[t]),h=l.useCallback((w,W)=>t(X("WorldPermissionsModal",{worldName:w,isCollaboratorsTabShown:W})),[t]),D=l.useCallback(()=>t(X("WorldsForENSOwnersAnnouncementModal")),[t]),A=l.useCallback(w=>t(je(w)),[t]),V=l.useCallback(()=>t(qe()),[t]),q=l.useCallback((w,W)=>t(Je(w,W)),[t]);return e.jsx(ks,{ensList:d,externalNames:m,deploymentsByWorlds:c,projects:n,worldsPermissions:g,error:P,isLoading:O,isLoggedIn:f,worldsWalletStats:v,isConnected:y,isWorldContributorEnabled:R,ensTotal:I,onOpenYourStorageModal:U,onOpenPermissionsModal:h,onOpenWorldsForENSOwnersAnnouncementModal:D,onUnpublishWorld:A,onFetchContributableNames:V,onFetchENSList:q})},As=fs;export{As as default};
@@ -1 +1 @@
1
- var _t=Object.defineProperty;var xt=(o,m,e)=>m in o?_t(o,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[m]=e;var c=(o,m,e)=>xt(o,typeof m!="symbol"?m+"":m,e);import{ak as ae,N as t,S as h,M as r,b6 as Q,bQ as Et,J as b,gB as oe,Q as re,R as $,cq as Xe,aR as f,T as Ze,bq as X,gC as vt,eM as jt,gD as St,gE as ft,gF as yt,gG as At,gH as wt,gI as Tt,gJ as Pt,gK as Nt,gL as q,eA as Rt,gM as ie,gN as Fe,aa as de,a4 as Ae,ab as _,aM as ce,gO as Mt,dl as we,bd as et,fl as Te,fB as Dt,g2 as Ot,g3 as Lt,eJ as Ee,gu as kt,gP as Bt,gQ as Ft,g5 as Wt,eN as tt,gR as Ht,gS as Vt,gT as $t,gU as Ut,fw as Gt,g4 as Yt,g6 as zt,b1 as Pe,gV as qt,gW as Jt,e$ as We,bR as Kt,aj as Qt,eQ as Ne,gX as st,a2 as at,eD as Xt,ey as nt,fO as le,dN as ve,ez as Zt,f2 as je,gY as it,b4 as Re,g1 as ot,f5 as k,eB as se,fK as lt,fL as Se,P as G,fg as fe,dM as es,eZ as ts,ft as ss,gZ as as,g_ as rt,g$ as dt,h0 as ct,fk as Me,eK as ns,h1 as is,h2 as os,fS as ht,eT as ls,eS as mt,eU as rs,eW as ds,eX as cs,h3 as hs,h4 as ms,h5 as ps,h6 as He,h7 as be,h8 as us,en as gs,h9 as Cs,ha as Is,hb as bs,hc as _s,hd as xs,he as Es,hf as vs,hg as js,hh as Ss,hi as fs,hj as ys,hk as As,fu as ws,hl as Ts,hm as Ps,hn as Ns,ho as Rs,hp as Ms,hq as Ds,hr as Os,hs as Ls,g7 as ks,a7 as Bs,b$ as Ce,ht as Fs,hu as Ve,hv as Ws,hw as Hs,f1 as $e,fP as _e,hx as U,f0 as Vs,eY as Ue,f3 as $s,f4 as Ge,f6 as Ye,f7 as ze,hy as qe,hz as Us,hA as Gs,hB as Ys,hC as zs,f8 as qs,f9 as Je,fa as Ke,hD as Js,fj as Ks,hE as Qs,hF as Xs,hG as Zs,hH as pt,hI as ea,hJ as ta,hK as sa,hL as aa,hM as Qe,hN as na,hO as ia,hP as oa,eP as la,hQ as ra,fn as da,fm as ca,fp as ha,hR as ma}from"./index-y7RTOsaO.js";import{g as Ie,h as De,i as Oe}from"./hooks-BcM8jB4I.js";import{J as pa}from"./JumpIn.container-DwwGSm07.js";import{C as ua}from"./CollectionProvider.container-Dp2WLu4v.js";import{C as ut}from"./ConfirmDelete-B91nXjkm.js";import{C as gt}from"./CollectionStatus.container-BL0x_fwg.js";import{d as ga,e as Ca,c as Ia}from"./selectors-DQU7U9ba.js";import{I as ba}from"./ItemProvider.container-C5AAbJB2.js";const _a=({open:o,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(h.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:o,children:[t.jsx(h.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(Et,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:s,children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),xa=ae.memo(_a);var L=(o=>(o.REJECT_COLLECTION="REJECT_COLLECTION",o.REJECT_CURATION="REJECT_CURATION",o.DISABLE_COLLECTION="DISABLE_COLLECTION",o.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",o))(L||{});const J="item_editor.top_panel.rejection_modal",Ea=({open:o,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:i,curation:l,onReject:d,onRejectCuration:p,onClose:u})=>{const E=b.useMemo(()=>{switch(m){case L.DISABLE_COLLECTION:return J+".disable_collection";case L.REJECT_CURATION:return J+".reject_curation";case L.DISABLE_THIRD_PARTY:return J+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case L.DISABLE_COLLECTION:d(i);break;case L.REJECT_CURATION:p(l.collectionId);break;case L.DISABLE_THIRD_PARTY:s&&n(s.id);break}},A=m===L.DISABLE_COLLECTION&&!i.isApproved||m===L.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===L.REJECT_COLLECTION&&!i.isApproved||m===L.REJECT_CURATION&&(l==null?void 0:l.status)===oe.REJECTED;return t.jsx(h.Modal,{size:"tiny",className:"RejectionModal",open:o,children:a?t.jsx(va,{i18nKey:E}):A?t.jsx(ja,{link:i.forumLink,onClose:u}):t.jsx(Sa,{i18nKey:E,isLoading:e,onClose:u,onConfirm:w})})},va=({i18nKey:o})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${o}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(Q,{id:J+".visit_activity",values:{activity_link:t.jsx(re,{to:$.activity(),children:r("global.activity")})}})}),t.jsx(h.Loader,{active:!0,size:"large"})]})]}),ja=({link:o,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(J+".veredict_explanation")}),t.jsx(h.Modal.Content,{children:r(J+".go_to_forum")}),t.jsxs(h.Modal.Actions,{children:[t.jsx("a",{href:o,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(h.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(J+".forum_link")}),t.jsx("div",{className:"discussion",children:r(J+".discussion")}),t.jsx(h.Icon,{name:"chevron right"})]})}),t.jsx(h.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),Sa=({i18nKey:o,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsx(h.Modal.Content,{children:r(`${o}.subtitle`)}),t.jsxs(h.Modal.Actions,{children:[t.jsx(Xe,{primary:!0,onClick:e,disabled:m,loading:m,network:f.Network.MATIC,children:r(`${o}.action`)}),t.jsx(h.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),fa=ae.memo(Ea),ya=(o,m)=>({isLoading:X(jt(o),vt)||X(ft(o),St)||yt(o),hasPendingTransaction:At(o)||!!(m.thirdParty&&wt(o,m.thirdParty.id))}),Aa=o=>({onReject:m=>o(Tt(m)),onRejectCuration:m=>o(Pt(m)),onDisableThirdParty:m=>o(Nt(m))}),wa=Ze(ya,Aa)(fa);var P=(o=>(o[o.APPROVE=0]="APPROVE",o[o.REJECT=1]="REJECT",o[o.ENABLE=2]="ENABLE",o[o.DISABLE=3]="DISABLE",o[o.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",o))(P||{});let Ta=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push($.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:i,onSetAssignee:l}=this.props;this.setState({showApproveConfirmModal:!1}),a&&l(e.id,a,s),q(e)?i(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:i,thirdParty:l}=this.props,{showRejectionModal:d,showApproveConfirmModal:p}=this.state,{chainId:u}=this.props,E=Rt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",r(`collection.type.${E}`),t.jsx(pa,{size:"small",active:!0,collection:e,chainId:u,items:q(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:q(e)&&i!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),d&&t.jsx(wa,{type:d,open:!0,collection:e,curation:n,thirdParty:l,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&p&&t.jsx(xa,{open:!0,assignee:n.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,n),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});c(this,"renderButton",(e,s,a)=>{const{address:n,thirdParty:i,onInitiateApprovalFlow:l,onInitiateTPApprovalFlow:d,onDeployMissingEntities:p,reviewedItems:u,totalItems:E}=this.props,w={[P.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):q(s)?d(s):l(s),[P.ENABLE]:()=>l(s),[P.DISABLE]:()=>this.setShowRejectionModal(i?L.DISABLE_THIRD_PARTY:L.DISABLE_COLLECTION),[P.REJECT]:()=>{(a==null?void 0:a.status)===oe.PENDING?this.setShowRejectionModal(L.REJECT_CURATION):this.setShowRejectionModal(L.REJECT_COLLECTION)},[P.DEPLOY_MISSING_ENTITIES]:()=>p(s)},A={[P.APPROVE]:"approve",[P.ENABLE]:"enable",[P.DISABLE]:"disable",[P.REJECT]:"reject",[P.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===P.APPROVE||e===P.ENABLE||e===P.DEPLOY_MISSING_ENTITIES,I=!q(s)||!!E&&u.length>=ie(E);return t.jsx(h.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:I,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(h.Button,{primary:j,onClick:()=>w[e](),disabled:q(s)&&e===P.APPROVE&&!!E&&u.length<ie(E),children:r(`item_editor.top_panel.${A[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:i,thirdParty:l}=this.props,d=a==null?void 0:a.some(p=>p.status===oe.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(h.Header,{sub:!0,children:[d?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:ie(i)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=ie(i)?t.jsx(h.Icon,{name:"check circle"}):null]}),d&&this.renderButton(P.APPROVE,e,s),d&&this.renderButton(P.REJECT,e,s),!d&&(l==null?void 0:l.isApproved)&&this.renderButton(P.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)?this.renderButton(P.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:i,isLoading:l}=this.props,d=!e||l&&!s.length;return a&&n&&i?t.jsx("div",{className:"TopPanel",children:d?t.jsx(h.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const Pa=({reviewedItems:o})=>{const m=de(),e=Ae(),s=Ie(),a=De(),n=_(ce),i=_(Mt),l=_(we),d=_(et),p=_(C=>s?Te(C,s):null),u=_(C=>p?Dt(C,p.id):[]),E=_(C=>p?Ot(C,p.id):[]),w=_(C=>s?Lt(C,s):null),A=_(C=>s?Ee(C,s):void 0),j=_(C=>p&&q(p)?kt(C,p):null),I=_(C=>s?Bt(C,s):!1),y=_(C=>X(Ft(C),Gt)||X(Wt(C),Yt)||X(tt(C),zt)),N=b.useCallback((C,x,R)=>{m(Ht(C,x,R))},[m]),D=b.useCallback(C=>{m(Vt(C))},[m]),T=b.useCallback(C=>{m($t(C))},[m]),g=b.useCallback(C=>{m(Ut(C))},[m]);return t.jsx(Ta,{address:n,items:u,totalItems:(A==null?void 0:A.total)||null,collection:p,itemCurations:E,thirdParty:j,curation:w,chainId:i,isConnected:l,isReviewing:a,isCommitteeMember:d,selectedCollectionId:s,hasCollectionMissingEntities:I,isLoading:y,reviewedItems:o,onSetAssignee:N,onInitiateTPApprovalFlow:D,onInitiateApprovalFlow:T,onDeployMissingEntities:g,history:e})},Na=Pa,Ct=()=>{const{search:o}=Pe();return _(e=>qt(e,o))},Ra="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.22722%2012.7164C4.07574%2012.5731%204%2012.3582%204%2012.2149C4%2012.0716%204.07574%2011.8567%204.22722%2011.7134L5.28757%2010.7104C5.59053%2010.4239%206.04497%2010.4239%206.34793%2010.7104L9.35858%2013.8448C9.51006%2013.9881%209.73728%2013.9881%209.88876%2013.8448L17.6521%206.21493C17.955%205.92836%2018.4095%205.92836%2018.7124%206.21493L19.7728%207.21791C20.0757%207.50448%2020.0757%207.93433%2019.7728%208.2209L10.116%2017.7851C9.9645%2017.9284%209.81302%2018%209.5858%2018C9.35858%2018%209.2071%2017.9284%209.05562%2017.7851L4.22722%2012.7164Z'%20fill='white'/%3e%3c/svg%3e",Ma=o=>{const{collectionId:m}=o,[e,s]=b.useState(!1),[a,n]=b.useState(null),i=Ae(),l=Pe(),d=b.useMemo(()=>Jt(l.search),[l.search]);b.useEffect(()=>{d&&(s(!0),n(d))},[d]);function p(){s(!1);const u=new URLSearchParams(l.search);u.delete("newItem"),i.replace({search:u.toString()})}return e&&a&&m?t.jsx(h.Toast,{type:h.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:Ra,alt:r("sagas.item.item_added_toast.title")})}),onClose:p,body:t.jsx(Q,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:u=>t.jsx("strong",{children:u}),"collection-link":u=>t.jsx(re,{to:$.collectionDetail(m),children:t.jsx(h.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:u})})}})}):null},Da=ae.memo(Ma),Oa=({collection:o,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:i})=>{var g,C;const l=Pe(),d=Ae(),p=((g=l.state)==null?void 0:g.fromParam)===We.COLLECTIONS,u=((C=l.state)==null?void 0:C.fromParam)===We.TP_COLLECTIONS,E=b.useCallback(()=>{d.push($.collections())},[d]),w=b.useCallback(()=>{if(o&&(p||u)){const x=p?$.collectionDetail:$.thirdPartyCollectionDetail;d.push(x(o.id))}else d.push($.itemEditor())},[p,u,d,o]),A=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{o&&n("CreateSingleItemModal",{collectionId:o.id})},[o,n]),I=b.useCallback(()=>{o&&n("AddExistingItemModal",{collectionId:o.id})},[o,n]),y=b.useCallback(()=>{o&&n("EditCollectionNameModal",{collection:o})},[o,n]),N=b.useCallback(()=>{o&&i(o)},[o,i]),D=b.useCallback(()=>{const x=o&&Kt(o.owner,m||"");return o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${p||u?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(re,{to:$.collectionDetail(o.id),children:o.name}),t.jsx(gt,{collection:o})]}),x&&!o.isPublished?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[t.jsx(h.Dropdown.Item,{onClick:y,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(h.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(h.Dropdown.Item,{onClick:I,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(ut,{name:o.name,onDelete:N,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[o,m,e,p,u]),T=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(h.Dropdown.Menu,{children:t.jsx(h.Dropdown.Item,{onClick:A,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(h.Row,{grow:!1,shrink:!1,className:"Header",children:o?D():T()})},La=()=>{const o=Ie();return _(m=>o?Te(m,o):null)},ka=()=>{const o=de(),m=_(ce),e=_(Qt),s=De(),a=_(Ne),n=La(),i=_(u=>!!(n&&m&&st(u,m,n))),l=b.useCallback((u,E)=>o(at(u,E)),[o]),d=b.useCallback(u=>o(Xt(u)),[o]),p=b.useCallback(u=>o(nt(u)),[o]);return t.jsx(Oa,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:l,onDeleteCollection:d,onDeleteItem:p,hasEditRights:i,hasUserOrphanItems:a})},V=10;class H extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:n?s:null})]})}}class Ba extends b.PureComponent{constructor(){super(...arguments);c(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return le(e)?t.jsx(h.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ve,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Zt,{item:e}),e.name]}),t.jsx(h.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${je(e)}`).toLowerCase()})}),disabled:it(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var M=(o=>(o.TO_REVIEW="to-review",o.REVIEWED="reviewed",o.ALL_ITEMS="all-items",o))(M||{});const Fa={[M.TO_REVIEW]:1,[M.REVIEWED]:1,[M.ALL_ITEMS]:1};class Wa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:M.TO_REVIEW,currentPages:Fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Re());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===M.TO_REVIEW&&!ot(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var p;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:i,onSetItems:l}=this.props;if(!it(e,s))return;let d=a.filter(u=>u.id!==e.id);if(le(e))if(this.isVisible(e)){i?n==null||n.emote.pause():n==null||n.emote.play();return}else d=d.filter(u=>u.type!==k.EMOTE);this.isVisible(e)||(d.push(e),(p=this.analytics)==null||p.track("Preview Item",{ITEM_ID:e!=null&&e.urn?se(e.urn)?lt(e.urn):Se(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:se(e.urn)})),l(d)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:i}=this.state;e===M.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(i[M.ALL_ITEMS])}):e===M.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(i=>({currentPages:{...i.currentPages,[a]:+s.activePage}})),a!==M.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(M.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?se(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:i}=this.props;return t.jsx(Ba,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:i,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(fe),a=e.filter(le);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(H,{label:this.renderCollapsableLabel(k.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(H,{label:this.renderCollapsableLabel(k.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],i=Math.ceil(e/V);return i>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:i,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],i=(n-1)*V,l=n*V;return t.jsx(h.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:i,pageEnd:l>e?e:l,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:i,currentPages:l}=this.state,d=this.getIsReviewingTPItems(),p=l[i];if(s)return t.jsx(h.Loader,{size:"large",active:!0});switch(i){case M.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!d&&a?this.renderTabPagination(a):null]});case M.REVIEWED:{const u=n.slice((p-1)*V,p*V);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(u),n.length?this.renderTabPagination(n.length):null]})}case M.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let i;const l=!s||s<V||a.length===s;switch(n){case M.TO_REVIEW:i=t.jsx(h.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!l,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(h.Button,{disabled:e||l,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(h.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case M.REVIEWED:i=t.jsx(Q,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:ie(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",i," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(h.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx(Q,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:M.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(h.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(h.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(h.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:()=>this.handleTabChange(M.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:e===M.TO_REVIEW,onClick:()=>this.handleTabChange(M.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(h.Tabs.Tab,{active:e===M.REVIEWED,onClick:()=>this.handleTabChange(M.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(h.Tabs.Tab,{active:e===M.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(G,{name:e}),t.jsx(Q,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(h.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ha extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({collectionId:m.id}),children:[t.jsx(es,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(gt,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class Va extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentPage:1});c(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:n,totalCollections:i}=this.props,{currentPage:l}=this.state;if(e.length===0)return null;const d=Math.ceil(i/V);return s?t.jsx(h.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(h.Section,{className:"Collections",children:[e.map(p=>t.jsx(Ha,{collection:p,items:a,isSelected:p.id===n},p.id)),d>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:d,activePage:l,onPageChange:this.handlePageChange}):null]})})}}var te=(o=>(o.COLLECTIONS="collections",o.ORPHAN_ITEMS="orphanItems",o))(te||{});const ee=1;let $a=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",this.getInitialState());c(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});c(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:n,selectedCollectionId:i}=this.props,{pages:l}=this.state;if(e&&!n&&!i){const d=l[l.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:V,page:d})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:i}=this.props,l=this.isCollectionTabActive()?n:a,d=Math.ceil(l/V);if(d>s.length){const p=[...Array(d).keys()].map(u=>u+1).filter(u=>!s.includes(u));if(p.length>0){const u=p[Math.floor(Math.random()*p.length)];this.setState(E=>({pages:[...E.pages,u]}),this.fetchResource)}}i(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[ee]},this.fetchResource)});c(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===te.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=te.COLLECTIONS;return!e&&s&&(a=te.ORPHAN_ITEMS),{pages:[ee],currentTab:a,initialPage:ee,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:i}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&i([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:i,selectedItemId:l,selectedItem:d,orphanItems:p,totalItems:u,visibleItems:E,hasUserOrphanItems:w,onSetItems:A,onFetchOrphanItem:j}=this.props,{initialPage:I,pages:y}=this.state;if(!i&&n&&l&&u&&(I===ee||s.initialPage<I)){if(!p.find(N=>N.id===l)){const N=Math.ceil(u/V),D=y[y.length-1],T=Math.min(N,D+1);y.includes(T)||this.setState({pages:[T],initialPage:T},this.fetchResource)}}else if(e.selectedItemId&&l&&e.selectedItemId!==l){const N=E.filter(D=>D.type!==k.EMOTE);A(N)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!i)&&this.setState({pages:[ee]},this.fetchResource),e.selectedCollectionId!==i&&this.setState({pages:[ee]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&d&&d.type!==k.EMOTE&&A([d]),e.selectedCollectionId!==i&&A([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:i,isReviewing:l}=this.props;return n&&e?ts(e)&&l?s.filter(d=>!!(a!=null&&a.find(p=>p.itemId===d.id&&p.status===oe.PENDING))):s:i}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:i,selectedCollectionId:l,visibleItems:d,bodyShape:p,reviewedItems:u,isReviewing:E,isPlayingEmote:w,isConnected:A,wearableController:j,isLoading:I,hasUserOrphanItems:y,onSetItems:N,onSetReviewedItems:D,onResetReviewedItems:T}=this.props,{pages:g,showSamplesModalAgain:C}=this.state,x=!l&&y,R=this.isCollectionTabActive()&&!l,S=!this.isCollectionTabActive()||l;return t.jsx("div",{className:"LeftPanel",children:A?t.jsx(ua,{id:l,itemSelected:i,itemsPage:g,itemsPageSize:V,fetchCollectionItemsOptions:{status:E?oe.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:F,paginatedItems:Z,initialPage:he,isLoadingCollection:me,isLoadingCollectionItems:pe,itemCurations:ue})=>{const Y=this.getItems(F,Z,ue),ne=this.isCollectionTabActive(),O=l&&F?he:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(ka,{}),x?t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:ne,onClick:()=>this.handleTabChange(te.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(h.Tabs.Tab,{active:!ne,onClick:()=>this.handleTabChange(te.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,R?t.jsx(Va,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Y.length>0,selectedCollectionId:l,onLoadPage:this.loadPage,isLoading:me}):null,S?t.jsxs(t.Fragment,{children:[t.jsx(Wa,{items:Y,totalItems:s||Y.length,hasHeader:!l&&n.length>0,selectedItemId:i,collection:F,isReviewing:E,isPlayingEmote:w,visibleItems:d,bodyShape:p,onResetReviewedItems:T,reviewedItems:u,onSetItems:N,wearableController:j,initialPage:O,isLoading:pe||I,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:C,onReviewItems:()=>D(Y),onLoadRandomPage:()=>this.loadRandomPage(Y),onLoadPage:this.loadPage}),t.jsx(Da,{collectionId:l})]}):null]})}}):null})}};const Ua=o=>{const m=de(),e=Ie(),s=Oe(),a=De(),n=Ct(),i=_(S=>ce(S)),l=_(S=>we(S)),d=_(S=>ss(S)),p=_(S=>as(S)),u=_(S=>rt(S)),E=_(S=>dt(S)),w=_(S=>ct(S)),A=_(S=>Ne(S)),j=_(S=>tt(S)),I=_(S=>s?Me(S,s):null),y=_(S=>{if(e)return Ee(S,e);if(i)return Ee(S,i)}),N=_(S=>e?void 0:ns(S)),D=_(S=>i&&!e?is(S,i,y==null?void 0:y.limit):os(S)),T=b.useMemo(()=>X(j,ds)||X(j,cs),[j]),g=b.useCallback(S=>m(ht(S)),[m]),C=b.useCallback((S,v)=>m(ls(S,v)),[m]),x=b.useCallback((S,v)=>m(mt(S,v)),[m]),R=b.useCallback(S=>m(rs(S)),[m]);return t.jsx($a,{...o,address:i,isConnected:l,items:d,totalItems:(y==null?void 0:y.total)||null,totalCollections:(N==null?void 0:N.total)||null,orphanItems:D,collections:p,selectedItemId:s,selectedItem:I,selectedCollectionId:e,visibleItems:n,bodyShape:u,wearableController:E,isReviewing:a,isLoading:T,isPlayingEmote:w,hasUserOrphanItems:A,onSetItems:g,onFetchCollections:C,onFetchOrphanItems:x,onFetchOrphanItem:R})},Ga=Ua;class xe extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:i}=this.props;if(a.toHexString()!==s.value){const l=n.find(d=>d.toHexString()===s.value);i(l)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(h.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,n=e.toHexString();return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(h.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ya=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:i,onChange:l,baseWearables:d}=this.props,p=s.value?d.find(u=>u.id===s.value):null;a!==p&&l(n,i,p??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:i,baseWearables:l}=this.props,d=hs(l,a,s).map(u=>({value:u.id,text:ms(u)}));i&&d.push({value:"",text:r("global.none")});const p=e?d.find(u=>u.value===e.id):null;return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:d,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:p?p.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const za=o=>({baseWearables:ps(o)}),ge=Ze(za)(Ya);let qa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1,socialEmote:void 0});c(this,"analytics",Re());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:i,onSetItems:l}=this.props,d=a.find(u=>u.id===s),p=n.filter(u=>u.type!==k.EMOTE);p.forEach(u=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!d,EMOTE_PLAYED_ITEM_ID:d!=null&&d.urn?Se(d.urn):null,EMOTE_PLAYED_NAME:d?d.name:s,PREVIEWED_WEARABLE_ITEM_ID:u!=null&&u.urn?se(u.urn)?lt(u.urn):Se(u.urn):null,PREVIEWED_WEARABLE_NAME:u.name})}),d?p.push(d):i(s),l(p)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(He.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:i}=this.props,l=a.filter(d=>d.type!==k.EMOTE);s?(n(f.PreviewEmote.IDLE),i(l)):e==null||e.emote.play()});c(this,"handleSocialEmoteSelect",e=>{this.setState({socialEmote:e})});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(h.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(h.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,i=s.length>0;return a?null:t.jsx(h.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(h.Dropdown.Menu,{children:[i&&t.jsxs(t.Fragment,{children:[t.jsx(h.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(h.Dropdown.Divider,{}),s.map(l=>t.jsx(h.Dropdown.Item,{value:l.id,text:l.name,onClick:this.handleAnimationChange},l.id)),t.jsx(h.Dropdown.Divider,{}),t.jsx(h.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(h.Dropdown.Divider,{})]}),f.PreviewEmote.schema.enum.map(l=>t.jsx(h.Dropdown.Item,{value:l,text:r(`emotes.${l}`),onClick:this.handleAnimationChange},l))]})})});c(this,"renderEmoteSelector",()=>t.jsx(h.Popup,{content:r("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(h.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:i,onFetchBaseWearables:l,onFetchOrphanItems:d,onFetchCollectionItems:p}=this.props,u=a.length>0;n||l(),u||(s&&!q(s)?p(s.id):e&&i&&d(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const n=s.find(i=>i.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,n?n.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:n,emote:i,selectedBaseWearables:l,selectedItem:d,visibleItems:p,isImportFilesModalOpen:u,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:A,isLoading:j,socialEmote:I}=this.state,y=p.some(le)&&(d==null?void 0:d.type)===k.EMOTE,N=i===f.PreviewEmote.JUMP?1:void 0;let D;return!I&&(d==null?void 0:d.type)===k.EMOTE&&d.data.startAnimation&&(D={title:"Start Animation",...d.data.startAnimation,loop:!0}),t.jsxs("div",{className:`CenterPanel ${u?"import-files-modal-is-open":""}`,children:[t.jsx(He,{id:"wearable-editor",profile:"default",bodyShape:e,emote:i,zoom:N,skin:be(s),eyes:be(a),hair:be(n),urns:l?Object.values(l).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:p.map(us),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:gs,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:y,showSceneBoundaries:A,socialEmote:I||D}),y&&!j&&E?t.jsx(Cs,{className:"zoom-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E}):null,j&&t.jsx(h.Center,{children:t.jsx(h.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[y&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(h.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(h.Icon,{name:"user"})}),y?!j&&E?t.jsx(Is,{className:"animation-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E,selectedAnimation:I,onSelectAnimation:this.handleSocialEmoteSelect}):null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${A?"active":""}`,children:t.jsx(G,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:f.BodyShape.MALE,text:r("body_shapes.male")},{value:f.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:s,colors:bs(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:a,colors:_s(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:n,colors:xs(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.HAIR],category:f.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.FACIAL_HAIR],category:f.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.UPPER_BODY],category:f.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.LOWER_BODY],category:f.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const Ja=()=>{const o=de(),m=_(ce),e=_(rt),s=_(Es),a=_(vs),n=_(js),i=_(Ss),l=_(fs),d=Ct(),p=_(dt),u=_(ys),E=_(ct),w=_(As),A=_(Ne),j=_(ws),I=Ie(),y=Oe(),N=_(v=>y?Me(v,y):null),D=b.useMemo(()=>I?j.find(v=>v.id===I):void 0,[j,I]),T=b.useMemo(()=>I?u.filter(v=>v.collectionId===I):u.filter(v=>!v.collectionId),[u,I]),g=l?l[e]:null,x=b.useMemo(()=>!d.some(le)&&i===f.PreviewEmote.IDLE,[d,i])?!1:E,R="CreateSingleItemModal"in w,S=b.useMemo(()=>({onSetBodyShape:v=>{o(Ts(v))},onSetAvatarAnimation:v=>{o(Ps(v))},onSetSkinColor:v=>{o(Ns(v))},onSetEyeColor:v=>{o(Rs(v))},onSetHairColor:v=>{o(Ms(v))},onSetBaseWearable:(v,F,Z)=>{o(Ds(v,F,Z))},onFetchBaseWearables:()=>{o(Os())},onSetWearablePreviewController:v=>{o(Ls(v))},onSetItems:v=>{o(ht(v))},onFetchOrphanItems:(v,F)=>{o(mt(v,F))},onFetchCollectionItems:(v,F)=>{o(ks(v,F))}}),[o]);return t.jsx(qa,{address:m,bodyShape:e,collection:D,selectedItem:N,selectedBaseWearables:g,skinColor:s,eyeColor:a,hairColor:n,emote:i,visibleItems:d,wearableController:p,emotes:T,isPlayingEmote:x,isImportFilesModalOpen:R,hasUserOrphanItems:A,...S})},Ka=Ja,Qa="_dynamicInput_ljtxw_1",Xa="_dynamicInputField_ljtxw_8",Za="_noTransition_ljtxw_26",en="_isEditing_ljtxw_41",tn="_dynamicInputEditButton_ljtxw_48",sn="_mirrorSpan_ljtxw_60",K={dynamicInput:Qa,dynamicInputField:Xa,noTransition:Za,isEditing:en,dynamicInputEditButton:tn,mirrorSpan:sn},an=6,It="a-zA-Z0-9\\s_-",nn=new RegExp(`^[${It}]*$`),on=new RegExp(`[^${It}]`,"g"),ln=({value:o,disabled:m=!1,placeholder:e="",editable:s=!1,className:a="",maxLength:n,onChange:i})=>{const[l,d]=b.useState(!1),p=b.useRef(null),u=b.useRef(null),E=b.useRef(null),w=b.useRef(!1),A=b.useCallback(()=>{const x=p.current;x&&(x.classList.add(K.noTransition),E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{x.classList.remove(K.noTransition),E.current=null},120))},[]),j=b.useCallback(()=>{const x=u.current,R=p.current;if(!x||!R||w.current)return;x.textContent=o&&o.length>0?o:e||"​";const v=x.getBoundingClientRect().width+an;R.style.width=`${v}px`},[o,e]);b.useLayoutEffect(()=>{j()},[j]);const I=b.useCallback(x=>{let R=x.target.value;R=R.replace(on,""),o!==R&&i&&i(n?R.slice(0,n):R),A(),requestAnimationFrame(j)},[o,n,i,A,j]),y=b.useCallback(x=>{w.current=!0},[]),N=b.useCallback(x=>{w.current=!1,requestAnimationFrame(j)},[j]),D=b.useCallback(x=>{if(x.key==="Enter"){d(!1);return}x.key.length>1||x.ctrlKey||x.metaKey||x.altKey||nn.test(x.key)||x.preventDefault()},[]),T=b.useCallback(()=>d(!1),[]),g=b.useCallback(()=>{d(!0),setTimeout(()=>{var x;return(x=p.current)==null?void 0:x.focus()},0)},[]),C=s&&!m;return t.jsxs("div",{className:Bs(K.dynamicInput,{[K.isEditing]:l},a),children:[t.jsx("input",{ref:p,value:o,onChange:I,onKeyDown:D,onBlur:T,onCompositionStart:y,onCompositionEnd:N,disabled:m||!l,placeholder:e,maxLength:n,className:K.dynamicInputField}),t.jsx("span",{ref:u,className:K.mirrorSpan,"aria-hidden":"true"}),C&&t.jsx(h.Button,{className:K.dynamicInputEditButton,icon:"pencil alternate",size:"tiny",basic:!0,onClick:g,disabled:m})]})},rn=b.memo(ln);class dn extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,i=e.target.value;s!==i&&n(a?i.slice(0,a):i)})}render(){const{label:e,disabled:s,value:a}=this.props;return t.jsxs("div",{className:`Input ${s?"is-disabled":""}`.trim(),children:[t.jsx("div",{className:"label",children:e}),t.jsx("input",{value:a||"",onChange:this.handleChange,disabled:s})]})}}class B extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{value:a,onChange:n}=this.props,i=s.value;i!==a&&(this.setState({value:i}),n(i))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,n=s.find(i=>i.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:n?n.text:r("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}c(B,"defaultProps",{disabled:!1});class ye extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,i=s.value,l=[...n];for(const d of i)n.includes(d)||l.push(d);l.length!==n.length&&(this.setState({value:l}),a(l))});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:n}=this.state,i=a.reduce((l,d)=>(l[d.value]=d.text,l),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(Ce,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(l=>t.jsxs("div",{className:"value",children:[i[l],t.jsx("div",{className:"remove",onClick:d=>{this.handleRemove(l),d.stopPropagation()}})]},l)):t.jsx("div",{className:"placeholder",children:r("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(ye,"defaultProps",{disabled:!1});class bt extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{draft:"",value:this.props.value});c(this,"handleChange",e=>{this.setState({draft:e.target.value})});c(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,n=s.trim();if(n!=="")if(a.includes(n))this.setState({draft:""});else{const i=[...a,n];this.setState({value:i,draft:""}),e(i)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===Fs||e.keyCode===Ve||e.keyCode===Ws)this.handleAdd();else if(e.keyCode===Hs||e.keyCode===Ve){const{draft:s,value:a}=this.state,n=a[a.length-1];n&&s===""&&this.handleRemove(n)}});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(n=>t.jsxs("div",{className:"value",children:[n,t.jsx("div",{className:"remove",onClick:i=>{this.handleRemove(n),i.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(bt,"defaultProps",{isDisabled:!1});const cn=3;let hn=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Re());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[$e]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;_e(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===f.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===U.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleStartAnimationArmatureAnimationChange",(e,s)=>{const a=this.state.data,n={...a.startAnimation||{}};s===""&&e===f.ArmatureId.Armature_Prop?delete n[e]:n[e]={animation:s},this.setState({data:{...a,startAnimation:n},isDirty:this.isDirty({data:{...a,startAnimation:n}})})});c(this,"handleStartAnimationAudioClipChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.audio=e||void 0,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleStartAnimationPlayModeChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.loop=e,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleRandomizeOutcomesChange",e=>{const s={...this.state.data,randomizeOutcomes:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOutcomeChange",(e,s,a)=>{const n=this.state.data,i=[...n.outcomes];i[e]={...i[e],[s]:a},this.setState({data:{...n,outcomes:i},isDirty:this.isDirty({data:{...n,outcomes:i}})})});c(this,"handleOutcomeClipChange",(e,s,a,n)=>{const i=this.state.data,l=[...i.outcomes||[]],d={...l[e].clips};n===""?delete d[s]:(d[s]||(d[s]={animation:""}),d[s]={...d[s],[a]:n}),l[e]={...l[e],clips:d},this.setState({data:{...i,outcomes:l},isDirty:this.isDirty({data:{...i,outcomes:l}})})});c(this,"handleOutcomeAudioClipChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].audio=s||void 0,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleOutcomePlayModeChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].loop=s,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleAddOutcome",()=>{const e=this.state.data;(!e||!e.outcomes)&&(e.outcomes=[]);const s={title:`Outcome ${e.outcomes.length+1}`,clips:{},loop:!1},a=[...e.outcomes,s];this.setState({data:{...e,outcomes:a},isDirty:this.isDirty({data:{...e,outcomes:a}})})});c(this,"handleRemoveOutcome",e=>{const s=this.state.data,a=s.outcomes.filter((n,i)=>i!==e);this.setState({data:{...s,outcomes:a},isDirty:this.isDirty({data:{...s,outcomes:a}})})});c(this,"handleEditOutcomeTitle",(e,s)=>{this.handleOutcomeChange(e,"title",s)});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(l=>!f.WearableCategory.schema.enum.includes(l)),...e]:n=[...a.filter(l=>!f.BodyPartCategory.schema.enum.includes(l)),...e];const i=this.setHides(this.state.data,n);this.setState({data:i,isDirty:this.isDirty({data:i})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,A;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:i,utility:l,rarity:d,contents:p,data:u,isDirty:E}=this.state;if(E&&e){let j=u;j&&!_e(j)&&(j={...j,removesDefaultHiding:j.category===f.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(f.WearableCategory.UPPER_BODY)?[f.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const I={...e.contents,...await Vs(p)},y={...e,name:n,description:i,rarity:d,data:j,contents:I,utility:l??void 0};s&&[Ue.UNPUBLISHED,Ue.UNDER_REVIEW].includes(s)&&(y.video=I[$e]),a(y,p),se(y.urn)&&((A=this.analytics)==null||A.track("Edit Item",{contents:p})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===k.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=$s(e);this.setState({thumbnail:e,contents:{[Ge]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Ye(a),i=await Ye(a,1024,1024),l=URL.createObjectURL(n);this.setState({thumbnail:l,contents:{[Ge]:i},isDirty:!0})}});c(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;fe(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&ze(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===f.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!ot(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}getAnimationOptions(e,s=!1,a){if(!e.isLoaded)return[];if(e.error)return console.warn("Animation data error:",e.error),[];let n=e.animations;if(a){const l=qe(`dummy${a}`);n=e.animations.filter(d=>{const p=qe(d.name),E=Us(d.name)===d.name;return p===l||E})}const i=n.map(l=>({value:l.name,text:l.name}));return s?[{value:"",text:"--"},...i]:i}getAudioOptions(e){const s=new Set,a=Object.keys(e).map(n=>{if(Gs(n)){const i=n.replace(/^(male|female)\//,"");if(!s.has(i))return s.add(i),{value:i,text:i}}return null}).filter(Boolean);return[{value:"",text:"--"},...a]}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||_e(a))return null;const n=Ys(e.contents,a.category),i=zs(e.contents),l=a.hides.filter(p=>n.includes(p)),d=a.hides.filter(p=>i.includes(p));return t.jsxs(t.Fragment,{children:[t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:d,options:this.asCategorySelect(e.type,i),disabled:!s,onChange:p=>this.handleChangeHides(p,"bodypart")}),t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:l,options:this.asCategorySelect(e.type,l.some(p=>p===f.WearableCategory.BODY_SHAPE)?n:n.filter(p=>p!==f.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:p=>this.handleChangeHides(p,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),i=s?t.jsx(h.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(G,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(G,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),i,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ve,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(G,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[i,t.jsx(ve,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(qs,{item:e})]})}renderVideoDetails(e){if(!Je(e))return null;const s=this.canEditItemMetadata(e),a=s?()=>this.handleOpenVideoDialog():()=>this.handleOpenVideoDialog({viewOnly:!0});return t.jsx("div",{className:"details",children:s?t.jsxs(t.Fragment,{children:[t.jsx(G,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Js(e)&&t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Ks,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:i,isCampaignEnabled:l,isVrmOptOutEnabled:d,campaignName:p,campaignTag:u}=this.props,{name:E,description:w,utility:A,rarity:j,data:I,isDirty:y,hasItem:N}=this.state,D=f.Rarity.getRarities(),T=Qs();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(ba,{id:e,children:(g,C,x,R)=>{var Z,he,me,pe,ue,Y,ne;const S=C&&ze(C),v=this.canEditItemMetadata(g),F=g?fe(g)?Xs(g.contents):Zs():[];return x?t.jsx(h.Loader,{size:"massive",active:!0}):N||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),g&&pt(g,s)&&!g.isPublished&&!S?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[je(g)!==null?t.jsx(h.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${je(g)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(ut,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(H,{label:r("item_editor.right_panel.details"),children:g?t.jsxs(t.Fragment,{children:[this.renderModelDetails(g),this.renderVideoDetails(g)]}):null}),t.jsx(H,{label:r("item_editor.right_panel.basics"),children:g?t.jsxs(t.Fragment,{children:[t.jsx(dn,{label:r("global.name"),value:E,disabled:!v,maxLength:ea,onChange:this.handleChangeName}),t.jsx(h.TextAreaField,{maxLength:ta,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!v,value:w,rows:"2",cols:"12"}),a?t.jsx(h.TextAreaField,{maxLength:sa,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!v,value:A,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(B,{itemId:g.id,label:r("global.category"),value:I.category,options:this.asCategorySelect(g.type,F),disabled:!v,onChange:this.handleChangeCategory}),!(g.urn&&se(g.urn))&&t.jsx(B,{itemId:g.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(D),disabled:g.isPublished||!v,onChange:this.handleChangeRarity})]}):null}),(g==null?void 0:g.type)===k.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(Ce,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(g)}),(g==null?void 0:g.type)===k.EMOTE&&(g!=null&&g.metrics)&&aa(g.metrics)&&g.metrics.additionalArmatures?t.jsx(H,{label:r("item_editor.right_panel.animations"),children:t.jsxs("div",{className:"animations-section",children:[t.jsxs(h.Box,{className:"emote-request-state-box",header:t.jsx(h.Header,{className:"emote-start-header",children:"Emote Start"}),children:[t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(he=(Z=I==null?void 0:I.startAnimation)==null?void 0:Z[f.ArmatureId.Armature])==null?void 0:he.animation,options:this.getAnimationOptions(R,!1),disabled:x,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature,O)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(pe=(me=I==null?void 0:I.startAnimation)==null?void 0:me[f.ArmatureId.Armature_Prop])==null?void 0:pe.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature_Prop,O)}),Object.values(g.contents).length>0&&Qe(g)?t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(ue=I==null?void 0:I.startAnimation)==null?void 0:ue.audio,options:this.getAudioOptions(g.contents),onChange:O=>this.handleStartAnimationAudioClipChange(O)}):null,t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:(Y=I==null?void 0:I.startAnimation)!=null&&Y.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),onChange:O=>this.handleStartAnimationPlayModeChange(O===U.LOOP),disabled:!0})]}),I!=null&&I.outcomes&&I.outcomes.length>1?t.jsx(B,{itemId:g.id,label:r("item_editor.right_panel.social_emote.randomize_outcomes"),value:I!=null&&I.randomizeOutcomes?"true":"false",options:[{value:"true",text:"True"},{value:"false",text:"False"}],disabled:x,onChange:O=>this.handleRandomizeOutcomesChange(O==="true")}):null,(I==null?void 0:I.outcomes)&&I.outcomes.length>0&&I.outcomes.map((O,z)=>{var Le,ke,Be;return t.jsxs(h.Box,{className:"outcome-box",header:t.jsxs("div",{className:"outcome-header",children:[t.jsx(rn,{className:"outcome-title-input",value:O.title,editable:!0,maxLength:na,onChange:W=>this.handleEditOutcomeTitle(z,W)}),I.outcomes.length>1?t.jsx(h.Button,{className:"outcome-remove-button",icon:"trash",size:"tiny",basic:!0,onClick:()=>this.handleRemoveOutcome(z),disabled:x,style:{float:"right",marginTop:"-2px"}}):null]}),children:[t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(Le=O.clips[f.ArmatureId.Armature])==null?void 0:Le.animation,options:this.getAnimationOptions(R,!1),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature,"animation",W)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 2 (${r("item_editor.right_panel.social_emote.optional")})`,value:(ke=O.clips[f.ArmatureId.Armature_Other])==null?void 0:ke.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Other,"animation",W)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(Be=O.clips[f.ArmatureId.Armature_Prop])==null?void 0:Be.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Prop,"animation",W)}),Object.values(g.contents).length>0&&Qe(g)?t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:O.audio,options:this.getAudioOptions(g.contents),onChange:W=>this.handleOutcomeAudioClipChange(z,W)}):null,t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:O!=null&&O.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:x,onChange:W=>this.handleOutcomePlayModeChange(z,W===U.LOOP)})]},z)}),((I==null?void 0:I.outcomes)??[]).length<cn?t.jsx(h.Row,{className:"add-outcome-button",align:"left",children:t.jsxs(h.Button,{secondary:!0,size:"small",disabled:x,onClick:this.handleAddOutcome,children:[t.jsx(G,{name:"add"})," ",r("item_editor.right_panel.social_emote.add_outcome")]})}):null]})}):(g==null?void 0:g.type)===k.EMOTE?t.jsx(H,{label:r("item_editor.right_panel.animation"),children:g?t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:I.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:!v,onChange:this.handlePlayModeChange}):null}):null,g&&Je(g)&&((ne=g.data.requiredPermissions)!=null&&ne.length)?t.jsx(H,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(g)}):null,t.jsx(H,{label:r("item_editor.right_panel.tags"),children:g?t.jsxs(t.Fragment,{children:[t.jsx(bt,{itemId:g.id,value:I.tags,onChange:this.handleChangeTags,isDisabled:!v}),l&&p&&u&&v&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:u}),event_name:t.jsx("span",{children:p})})})]}):null}),(g==null?void 0:g.type)===k.WEARABLE&&d&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(h.Checkbox,{toggle:!0,label:I!=null&&I.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(I!=null&&I.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(g==null?void 0:g.type)===k.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(h.Checkbox,{toggle:!0,label:(I==null?void 0:I.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(I==null?void 0:I.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),t.jsx("div",{className:"edit-buttons-container",children:t.jsxs("div",{className:"edit-buttons",children:[t.jsx(h.Button,{secondary:!0,onClick:this.handleOnResetItem,disabled:!y||x,loading:x,children:r("global.revert")}),t.jsx(Xe,{primary:!0,onClick:this.handleOnSaveItem,network:f.Network.MATIC,disabled:!y||x,loading:x,children:r("global.save")})]})}),i&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",i]}):null]})]}):null}}):null})}};const mn=()=>{const o=de(),m=Oe(),e=_(C=>ce(C)),s=_(C=>we(C)),a=_(C=>ia(C)),n=_(C=>oa(C)),i=_(C=>et(C)),l=_(C=>la(C)),d=_(C=>ga(C)),p=_(C=>ra(C)),u=_(C=>da(C)),E=_(C=>m?Me(C,m):null),w=_(C=>m&&E&&E.collectionId?Te(C,E.collectionId):null),A=_(C=>{const x=Ca(C),R=Ia(C);return x==null?void 0:x[R]}),j=_(C=>ca(C)),I=_(C=>!E||!e?!1:w?st(C,e,w):pt(E,e)),y=b.useMemo(()=>m?j[m]:null,[m,j]),N=b.useCallback((C,x)=>o(ha(C,x)),[o]),D=b.useCallback(C=>o(nt(C)),[o]),T=b.useCallback((C,x)=>o(at(C,x)),[o]),g=b.useCallback(C=>o(ma(C)),[o]);return t.jsx(hn,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:I,itemStatus:y,error:a,isConnected:s,isDownloading:n,isCommitteeMember:i,isCampaignEnabled:l,campaignTag:d,campaignName:A,isVrmOptOutEnabled:p,isWearableUtilityEnabled:u,onSaveItem:N,onDeleteItem:D,onOpenModal:T,onDownload:g})},pn=mn;class wn extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{reviewedItems:[]});c(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(n=>n.id===a.id))]}))});c(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(Na,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Ga,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Ka,{}),t.jsx(pn,{})]})]})})}}export{wn as default};
1
+ var _t=Object.defineProperty;var xt=(o,m,e)=>m in o?_t(o,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[m]=e;var c=(o,m,e)=>xt(o,typeof m!="symbol"?m+"":m,e);import{ak as ae,N as t,S as h,M as r,b6 as Q,bQ as Et,J as b,gB as oe,Q as re,R as $,cq as Xe,aR as f,T as Ze,bq as X,gC as vt,eM as jt,gD as St,gE as ft,gF as yt,gG as At,gH as wt,gI as Tt,gJ as Pt,gK as Nt,gL as q,eA as Rt,gM as ie,gN as Fe,aa as de,a4 as Ae,ab as _,aM as ce,gO as Mt,dl as we,bd as et,fl as Te,fB as Dt,g2 as Ot,g3 as Lt,eJ as Ee,gu as kt,gP as Bt,gQ as Ft,g5 as Wt,eN as tt,gR as Ht,gS as Vt,gT as $t,gU as Ut,fw as Gt,g4 as Yt,g6 as zt,b1 as Pe,gV as qt,gW as Jt,e$ as We,bR as Kt,aj as Qt,eQ as Ne,gX as st,a2 as at,eD as Xt,ey as nt,fO as le,dN as ve,ez as Zt,f2 as je,gY as it,b4 as Re,g1 as ot,f5 as k,eB as se,fK as lt,fL as Se,P as G,fg as fe,dM as es,eZ as ts,ft as ss,gZ as as,g_ as rt,g$ as dt,h0 as ct,fk as Me,eK as ns,h1 as is,h2 as os,fS as ht,eT as ls,eS as mt,eU as rs,eW as ds,eX as cs,h3 as hs,h4 as ms,h5 as ps,h6 as He,h7 as be,h8 as us,en as gs,h9 as Cs,ha as Is,hb as bs,hc as _s,hd as xs,he as Es,hf as vs,hg as js,hh as Ss,hi as fs,hj as ys,hk as As,fu as ws,hl as Ts,hm as Ps,hn as Ns,ho as Rs,hp as Ms,hq as Ds,hr as Os,hs as Ls,g7 as ks,a7 as Bs,b$ as Ce,ht as Fs,hu as Ve,hv as Ws,hw as Hs,f1 as $e,fP as _e,hx as U,f0 as Vs,eY as Ue,f3 as $s,f4 as Ge,f6 as Ye,f7 as ze,hy as qe,hz as Us,hA as Gs,hB as Ys,hC as zs,f8 as qs,f9 as Je,fa as Ke,hD as Js,fj as Ks,hE as Qs,hF as Xs,hG as Zs,hH as pt,hI as ea,hJ as ta,hK as sa,hL as aa,hM as Qe,hN as na,hO as ia,hP as oa,eP as la,hQ as ra,fn as da,fm as ca,fp as ha,hR as ma}from"./index-UD374e2H.js";import{g as Ie,h as De,i as Oe}from"./hooks-CK_m9kX-.js";import{J as pa}from"./JumpIn.container-9hoS9dDE.js";import{C as ua}from"./CollectionProvider.container-DflF1wDU.js";import{C as ut}from"./ConfirmDelete-DbOvRTAN.js";import{C as gt}from"./CollectionStatus.container-CB6NpIWJ.js";import{d as ga,e as Ca,c as Ia}from"./selectors-A-tGldC4.js";import{I as ba}from"./ItemProvider.container-CwXmjtiu.js";const _a=({open:o,assignee:m,onConfirm:e,onClose:s})=>t.jsxs(h.Modal,{size:"tiny",className:"ConfirmApprovalModal",open:o,children:[t.jsx(h.Modal.Header,{children:r("curation_page.confirm_not_assigned_curation_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx("div",{className:"message-container",children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.body",values:{assignee:t.jsx("strong",{children:t.jsx(Et,{textOnly:!0,address:m})})}})}),t.jsx("span",{children:t.jsx(Q,{id:"curation_page.confirm_not_assigned_curation_modal.confirm_footer"})})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:s,children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:e,children:r("curation_page.confirm_not_assigned_curation_modal.confirm_button")})]})]}),xa=ae.memo(_a);var L=(o=>(o.REJECT_COLLECTION="REJECT_COLLECTION",o.REJECT_CURATION="REJECT_CURATION",o.DISABLE_COLLECTION="DISABLE_COLLECTION",o.DISABLE_THIRD_PARTY="DISABLE_THIRD_PARTY",o))(L||{});const J="item_editor.top_panel.rejection_modal",Ea=({open:o,type:m,isLoading:e,thirdParty:s,hasPendingTransaction:a,onDisableThirdParty:n,collection:i,curation:l,onReject:d,onRejectCuration:p,onClose:u})=>{const E=b.useMemo(()=>{switch(m){case L.DISABLE_COLLECTION:return J+".disable_collection";case L.REJECT_CURATION:return J+".reject_curation";case L.DISABLE_THIRD_PARTY:return J+".disable_third_party";default:return""}},[m]),w=()=>{switch(m){case L.DISABLE_COLLECTION:d(i);break;case L.REJECT_CURATION:p(l.collectionId);break;case L.DISABLE_THIRD_PARTY:s&&n(s.id);break}},A=m===L.DISABLE_COLLECTION&&!i.isApproved||m===L.DISABLE_THIRD_PARTY&&!(s!=null&&s.isApproved)||m===L.REJECT_COLLECTION&&!i.isApproved||m===L.REJECT_CURATION&&(l==null?void 0:l.status)===oe.REJECTED;return t.jsx(h.Modal,{size:"tiny",className:"RejectionModal",open:o,children:a?t.jsx(va,{i18nKey:E}):A?t.jsx(ja,{link:i.forumLink,onClose:u}):t.jsx(Sa,{i18nKey:E,isLoading:e,onClose:u,onConfirm:w})})},va=({i18nKey:o})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsxs("div",{className:"loading-transaction",children:[t.jsx("div",{className:"danger-text",children:r(`${o}.tx_pending`)}),t.jsx("small",{className:"danger-text",children:t.jsx(Q,{id:J+".visit_activity",values:{activity_link:t.jsx(re,{to:$.activity(),children:r("global.activity")})}})}),t.jsx(h.Loader,{active:!0,size:"large"})]})]}),ja=({link:o,onClose:m})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(J+".veredict_explanation")}),t.jsx(h.Modal.Content,{children:r(J+".go_to_forum")}),t.jsxs(h.Modal.Actions,{children:[t.jsx("a",{href:o,className:"forum-link",target:"_blank",rel:"noopener noreferrer",children:t.jsxs(h.Button,{secondary:!0,icon:!0,labelPosition:"right",children:[t.jsx("div",{children:r(J+".forum_link")}),t.jsx("div",{className:"discussion",children:r(J+".discussion")}),t.jsx(h.Icon,{name:"chevron right"})]})}),t.jsx(h.Button,{basic:!0,onClick:m,children:r("global.done")})]})]}),Sa=({i18nKey:o,isLoading:m,onConfirm:e,onClose:s})=>t.jsxs(t.Fragment,{children:[t.jsx(h.Modal.Header,{children:r(`${o}.title`)}),t.jsx(h.Modal.Content,{children:r(`${o}.subtitle`)}),t.jsxs(h.Modal.Actions,{children:[t.jsx(Xe,{primary:!0,onClick:e,disabled:m,loading:m,network:f.Network.MATIC,children:r(`${o}.action`)}),t.jsx(h.Button,{disabled:m,onClick:s,children:r("global.cancel")})]})]}),fa=ae.memo(Ea),ya=(o,m)=>({isLoading:X(jt(o),vt)||X(ft(o),St)||yt(o),hasPendingTransaction:At(o)||!!(m.thirdParty&&wt(o,m.thirdParty.id))}),Aa=o=>({onReject:m=>o(Tt(m)),onRejectCuration:m=>o(Pt(m)),onDisableThirdParty:m=>o(Nt(m))}),wa=Ze(ya,Aa)(fa);var P=(o=>(o[o.APPROVE=0]="APPROVE",o[o.REJECT=1]="REJECT",o[o.ENABLE=2]="ENABLE",o[o.DISABLE=3]="DISABLE",o[o.DEPLOY_MISSING_ENTITIES=4]="DEPLOY_MISSING_ENTITIES",o))(P||{});let Ta=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"state",{currentVeredict:void 0,showRejectionModal:null,showApproveConfirmModal:!1});c(this,"handleBack",()=>{const{history:e}=this.props;e.push($.curation())});c(this,"handleConfirmApprovalModal",(e,s)=>{const{address:a,onInitiateApprovalFlow:n,onInitiateTPApprovalFlow:i,onSetAssignee:l}=this.props;this.setState({showApproveConfirmModal:!1}),a&&l(e.id,a,s),q(e)?i(e):n(e)});c(this,"setShowRejectionModal",e=>this.setState({showRejectionModal:e}));c(this,"renderPage",e=>{const{items:s,itemCurations:a,curation:n,totalItems:i,thirdParty:l}=this.props,{showRejectionModal:d,showApproveConfirmModal:p}=this.state,{chainId:u}=this.props,E=Rt(e);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"actions",children:t.jsx("div",{className:"back",onClick:this.handleBack})}),t.jsxs("div",{className:"title",children:[e.name," · ",r(`collection.type.${E}`),t.jsx(pa,{size:"small",active:!0,collection:e,chainId:u,items:q(e)?s:void 0,text:r("global.see_in_decentraland")})]}),t.jsx("div",{className:"actions",children:t.jsx("span",{className:"button-container",children:q(e)&&i!==void 0?this.renderTPButtons(e,n,a):this.renderButtons(e,n)})}),d&&t.jsx(wa,{type:d,open:!0,collection:e,curation:n,thirdParty:l,onClose:()=>this.setShowRejectionModal(null)}),(n==null?void 0:n.assignee)&&p&&t.jsx(xa,{open:!0,assignee:n.assignee,onConfirm:()=>this.handleConfirmApprovalModal(e,n),onClose:()=>this.setState({showApproveConfirmModal:!1})})]})});c(this,"renderButton",(e,s,a)=>{const{address:n,thirdParty:i,onInitiateApprovalFlow:l,onInitiateTPApprovalFlow:d,onDeployMissingEntities:p,reviewedItems:u,totalItems:E}=this.props,w={[P.APPROVE]:()=>a!=null&&a.assignee&&n!==(a==null?void 0:a.assignee)?this.setState({showApproveConfirmModal:!0}):q(s)?d(s):l(s),[P.ENABLE]:()=>l(s),[P.DISABLE]:()=>this.setShowRejectionModal(i?L.DISABLE_THIRD_PARTY:L.DISABLE_COLLECTION),[P.REJECT]:()=>{(a==null?void 0:a.status)===oe.PENDING?this.setShowRejectionModal(L.REJECT_CURATION):this.setShowRejectionModal(L.REJECT_COLLECTION)},[P.DEPLOY_MISSING_ENTITIES]:()=>p(s)},A={[P.APPROVE]:"approve",[P.ENABLE]:"enable",[P.DISABLE]:"disable",[P.REJECT]:"reject",[P.DEPLOY_MISSING_ENTITIES]:"deploy_missing_entities"},j=e===P.APPROVE||e===P.ENABLE||e===P.DEPLOY_MISSING_ENTITIES,I=!q(s)||!!E&&u.length>=ie(E);return t.jsx(h.Popup,{content:r("item_editor.top_panel.items_pending_to_review"),disabled:I,position:"bottom center",trigger:t.jsx("div",{children:t.jsx(h.Button,{primary:j,onClick:()=>w[e](),disabled:q(s)&&e===P.APPROVE&&!!E&&u.length<ie(E),children:r(`item_editor.top_panel.${A[e]}`)})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0})});c(this,"renderTPButtons",(e,s,a)=>{const{reviewedItems:n,totalItems:i,thirdParty:l}=this.props,d=a==null?void 0:a.some(p=>p.status===oe.PENDING);return t.jsxs(t.Fragment,{children:[t.jsxs(h.Header,{sub:!0,children:[d?r("item_editor.top_panel.reviewed_counter",{count:n.length,threshold:ie(i)}):r("item_editor.top_panel.not_enough_items_to_curate_more"),n.length>=ie(i)?t.jsx(h.Icon,{name:"check circle"}):null]}),d&&this.renderButton(P.APPROVE,e,s),d&&this.renderButton(P.REJECT,e,s),!d&&(l==null?void 0:l.isApproved)&&this.renderButton(P.DISABLE,e,null)]})});c(this,"renderButtons",(e,s)=>s&&e.isApproved&&s.status==="pending"?t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}):s&&e.isApproved&&(s.status==="approved"||s.status==="rejected")?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)&&e.isApproved?t.jsxs(t.Fragment,{children:[this.renderButton(P.DISABLE,e,s),this.props.hasCollectionMissingEntities&&this.renderButton(P.DEPLOY_MISSING_ENTITIES,e,s)]}):Fe(e)?this.renderButton(P.ENABLE,e,s):t.jsxs(t.Fragment,{children:[this.renderButton(P.APPROVE,e,s),this.renderButton(P.REJECT,e,s)]}))}render(){const{collection:e,items:s,isCommitteeMember:a,isReviewing:n,isConnected:i,isLoading:l}=this.props,d=!e||l&&!s.length;return a&&n&&i?t.jsx("div",{className:"TopPanel",children:d?t.jsx(h.Loader,{size:"small",active:!0}):this.renderPage(e)}):null}};const Pa=({reviewedItems:o})=>{const m=de(),e=Ae(),s=Ie(),a=De(),n=_(ce),i=_(Mt),l=_(we),d=_(et),p=_(C=>s?Te(C,s):null),u=_(C=>p?Dt(C,p.id):[]),E=_(C=>p?Ot(C,p.id):[]),w=_(C=>s?Lt(C,s):null),A=_(C=>s?Ee(C,s):void 0),j=_(C=>p&&q(p)?kt(C,p):null),I=_(C=>s?Bt(C,s):!1),y=_(C=>X(Ft(C),Gt)||X(Wt(C),Yt)||X(tt(C),zt)),N=b.useCallback((C,x,R)=>{m(Ht(C,x,R))},[m]),D=b.useCallback(C=>{m(Vt(C))},[m]),T=b.useCallback(C=>{m($t(C))},[m]),g=b.useCallback(C=>{m(Ut(C))},[m]);return t.jsx(Ta,{address:n,items:u,totalItems:(A==null?void 0:A.total)||null,collection:p,itemCurations:E,thirdParty:j,curation:w,chainId:i,isConnected:l,isReviewing:a,isCommitteeMember:d,selectedCollectionId:s,hasCollectionMissingEntities:I,isLoading:y,reviewedItems:o,onSetAssignee:N,onInitiateTPApprovalFlow:D,onInitiateApprovalFlow:T,onDeployMissingEntities:g,history:e})},Na=Pa,Ct=()=>{const{search:o}=Pe();return _(e=>qt(e,o))},Ra="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.22722%2012.7164C4.07574%2012.5731%204%2012.3582%204%2012.2149C4%2012.0716%204.07574%2011.8567%204.22722%2011.7134L5.28757%2010.7104C5.59053%2010.4239%206.04497%2010.4239%206.34793%2010.7104L9.35858%2013.8448C9.51006%2013.9881%209.73728%2013.9881%209.88876%2013.8448L17.6521%206.21493C17.955%205.92836%2018.4095%205.92836%2018.7124%206.21493L19.7728%207.21791C20.0757%207.50448%2020.0757%207.93433%2019.7728%208.2209L10.116%2017.7851C9.9645%2017.9284%209.81302%2018%209.5858%2018C9.35858%2018%209.2071%2017.9284%209.05562%2017.7851L4.22722%2012.7164Z'%20fill='white'/%3e%3c/svg%3e",Ma=o=>{const{collectionId:m}=o,[e,s]=b.useState(!1),[a,n]=b.useState(null),i=Ae(),l=Pe(),d=b.useMemo(()=>Jt(l.search),[l.search]);b.useEffect(()=>{d&&(s(!0),n(d))},[d]);function p(){s(!1);const u=new URLSearchParams(l.search);u.delete("newItem"),i.replace({search:u.toString()})}return e&&a&&m?t.jsx(h.Toast,{type:h.ToastType.INFO,title:r("sagas.item.item_added_toast.title"),closable:!0,icon:t.jsx("div",{className:"ItemAddedToast icon-container",children:t.jsx("img",{src:Ra,alt:r("sagas.item.item_added_toast.title")})}),onClose:p,body:t.jsx(Q,{id:"sagas.item.item_added_toast.body",values:{name:a,br:()=>t.jsx("br",{}),b:u=>t.jsx("strong",{children:u}),"collection-link":u=>t.jsx(re,{to:$.collectionDetail(m),children:t.jsx(h.Button,{className:"ItemAddedToast view-collection-link",basic:!0,children:u})})}})}):null},Da=ae.memo(Ma),Oa=({collection:o,address:m,hasUserOrphanItems:e,isLoggedIn:s,isReviewing:a,onOpenModal:n,onDeleteCollection:i})=>{var g,C;const l=Pe(),d=Ae(),p=((g=l.state)==null?void 0:g.fromParam)===We.COLLECTIONS,u=((C=l.state)==null?void 0:C.fromParam)===We.TP_COLLECTIONS,E=b.useCallback(()=>{d.push($.collections())},[d]),w=b.useCallback(()=>{if(o&&(p||u)){const x=p?$.collectionDetail:$.thirdPartyCollectionDetail;d.push(x(o.id))}else d.push($.itemEditor())},[p,u,d,o]),A=b.useCallback(()=>{n("CreateCollectionModal")},[n]),j=b.useCallback(()=>{o&&n("CreateSingleItemModal",{collectionId:o.id})},[o,n]),I=b.useCallback(()=>{o&&n("AddExistingItemModal",{collectionId:o.id})},[o,n]),y=b.useCallback(()=>{o&&n("EditCollectionNameModal",{collection:o})},[o,n]),N=b.useCallback(()=>{o&&i(o)},[o,i]),D=b.useCallback(()=>{const x=o&&Kt(o.owner,m||"");return o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`block ${p||u?"close":"back"}`,onClick:w}),t.jsxs("div",{className:"title",children:[t.jsx(re,{to:$.collectionDetail(o.id),children:o.name}),t.jsx(gt,{collection:o})]}),x&&!o.isPublished?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[t.jsx(h.Dropdown.Item,{onClick:y,children:r("item_editor.left_panel.actions.edit_name")}),t.jsx(h.Dropdown.Item,{onClick:j,children:r("item_editor.left_panel.actions.new_item")}),e&&t.jsx(h.Dropdown.Item,{onClick:I,children:r("item_editor.left_panel.actions.add_existing_item")}),t.jsx(ut,{name:o.name,onDelete:N,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}):null},[o,m,e,p,u]),T=b.useCallback(()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"block close",onClick:E}),t.jsx("div",{className:"title",children:e?r("item_editor.left_panel.title"):r("item_editor.left_panel.title_alternative")}),s?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"block add"}),inline:!0,direction:"left",children:t.jsx(h.Dropdown.Menu,{children:t.jsx(h.Dropdown.Item,{onClick:A,children:r("item_editor.left_panel.actions.new_collection")})})}):t.jsx("div",{className:"block"})]}),[e,s]);return a?null:t.jsx(h.Row,{grow:!1,shrink:!1,className:"Header",children:o?D():T()})},La=()=>{const o=Ie();return _(m=>o?Te(m,o):null)},ka=()=>{const o=de(),m=_(ce),e=_(Qt),s=De(),a=_(Ne),n=La(),i=_(u=>!!(n&&m&&st(u,m,n))),l=b.useCallback((u,E)=>o(at(u,E)),[o]),d=b.useCallback(u=>o(Xt(u)),[o]),p=b.useCallback(u=>o(nt(u)),[o]);return t.jsx(Oa,{address:m,collection:n??void 0,isLoggedIn:e,isReviewing:s,onOpenModal:l,onDeleteCollection:d,onDeleteItem:p,hasEditRights:i,hasUserOrphanItems:a})},V=10;class H extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{isCollapsed:!1});c(this,"handleToggle",()=>{this.setState({isCollapsed:!this.state.isCollapsed})})}render(){const{label:e,children:s}=this.props,{isCollapsed:a}=this.state,n=!a;return t.jsxs("div",{className:`Collapsable ${n?"is-open":""}`.trim(),children:[t.jsxs("div",{className:"header",onClick:this.handleToggle,children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"handle"})]}),t.jsx("div",{className:"content",children:n?s:null})]})}}class Ba extends b.PureComponent{constructor(){super(...arguments);c(this,"handleClick",()=>{const{item:e,onClick:s}=this.props;s(e)})}renderToggleItem(){const{item:e,isVisible:s,isPlayingEmote:a}=this.props;return le(e)?t.jsx(h.Icon,{className:"toggle-emote",name:s&&a?"pause":"play",onClick:this.handleClick}):t.jsx("div",{className:`toggle ${s?"is-visible":"is-hidden"}`,onClick:this.handleClick})}render(){const{item:e,isSelected:s,selectedCollectionId:a,bodyShape:n}=this.props;return t.jsx("div",{className:`SidebarItem ${s?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({itemId:e.id,collectionId:a||void 0,newItem:void 0}),children:[t.jsx(ve,{item:e}),t.jsxs("div",{className:"name",children:[t.jsx(Zt,{item:e}),e.name]}),t.jsx(h.Popup,{content:r("item_editor.left_panel.invalid_representation_tooltip",{bodyShape:t.jsx("b",{children:r(`body_shapes.${je(e)}`).toLowerCase()})}),disabled:it(e,n),position:"top center",trigger:this.renderToggleItem()})]})})}}var M=(o=>(o.TO_REVIEW="to-review",o.REVIEWED="reviewed",o.ALL_ITEMS="all-items",o))(M||{});const Fa={[M.TO_REVIEW]:1,[M.REVIEWED]:1,[M.ALL_ITEMS]:1};class Wa extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentTab:M.TO_REVIEW,currentPages:Fa,reviewedTabPage:1,showGetMoreSamplesModal:!1,showAllItemsTabChangeModal:!1});c(this,"analytics",Re());c(this,"handleReviewItemsTrigger",e=>{const{items:s,onReviewItems:a}=this.props,{currentTab:n}=this.state;this.getIsReviewingTPItems()&&n===M.TO_REVIEW&&!ot(s,e==null?void 0:e.items)&&a()});c(this,"isVisible",e=>{const{visibleItems:s}=this.props;return s.some(a=>a.id===e.id)});c(this,"handleClick",e=>{var p;const{bodyShape:s,visibleItems:a,wearableController:n,isPlayingEmote:i,onSetItems:l}=this.props;if(!it(e,s))return;let d=a.filter(u=>u.id!==e.id);if(le(e))if(this.isVisible(e)){i?n==null||n.emote.pause():n==null||n.emote.play();return}else d=d.filter(u=>u.type!==k.EMOTE);this.isVisible(e)||(d.push(e),(p=this.analytics)==null||p.track("Preview Item",{ITEM_ID:e!=null&&e.urn?se(e.urn)?lt(e.urn):Se(e.urn):null,ITEM_TYPE:e.type,ITEM_NAME:e.name,ITEM_IS_THIRD_PARTY:se(e.urn)})),l(d)});c(this,"handleTabChange",e=>{const{onLoadPage:s,onReviewItems:a,onResetReviewedItems:n}=this.props,{currentPages:i}=this.state;e===M.ALL_ITEMS?this.setState({showAllItemsTabChangeModal:!1},()=>{n(),s(i[M.ALL_ITEMS])}):e===M.TO_REVIEW&&a(),this.setState({currentTab:e})});c(this,"handleGetRandomSampleClick",()=>{const{showSamplesModalAgain:e,onLoadRandomPage:s}=this.props;e?this.setState({showGetMoreSamplesModal:!0}):s()});c(this,"handleModalProceed",()=>{const{onLoadRandomPage:e}=this.props;e(),this.setState({showGetMoreSamplesModal:!1})});c(this,"handlePageChange",(e,s)=>{const{currentTab:a}=this.state,{onLoadPage:n}=this.props;this.setState(i=>({currentPages:{...i.currentPages,[a]:+s.activePage}})),a!==M.REVIEWED&&n(+s.activePage)});c(this,"handleSwitchToAllItemsTab",()=>{const{reviewedItems:e}=this.props;e.length>0?this.setState({showAllItemsTabChangeModal:!0}):this.handleTabChange(M.ALL_ITEMS)});c(this,"getIsReviewingTPItems",()=>{const{collection:e,isReviewing:s}=this.props;return e?se(e.urn)&&s:!1});c(this,"renderSidebarItem",e=>{const{collection:s,selectedItemId:a,bodyShape:n,isPlayingEmote:i}=this.props;return t.jsx(Ba,{item:e,isSelected:a===e.id,isVisible:this.isVisible(e),isPlayingEmote:i,selectedCollectionId:(s==null?void 0:s.id)??null,bodyShape:n,onClick:this.handleClick},e.id)});c(this,"renderSidebarCategory",e=>{const s=e.filter(fe),a=e.filter(le);return e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("item_editor.left_panel.empty_collection")})}):s.length===0||a.length===0?e.map(this.renderSidebarItem):t.jsxs(t.Fragment,{children:[t.jsx(H,{label:this.renderCollapsableLabel(k.WEARABLE),children:s.map(this.renderSidebarItem)}),t.jsx(H,{label:this.renderCollapsableLabel(k.EMOTE),children:a.map(this.renderSidebarItem)})]})});c(this,"renderTabPagination",e=>{const{currentTab:s,currentPages:a}=this.state,n=a[s],i=Math.ceil(e/V);return i>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:i,activePage:n,onPageChange:this.handlePageChange}):null});c(this,"renderPaginationStats",e=>{const{currentPages:s,currentTab:a}=this.state,n=s[a],i=(n-1)*V,l=n*V;return t.jsx(h.Header,{sub:!0,children:r("item_editor.left_panel.reviewed_tab.page_counter",{pageStart:i,pageEnd:l>e?e:l,total:e})})});c(this,"renderTabContent",()=>{const{items:e,isLoading:s,totalItems:a,reviewedItems:n}=this.props,{currentTab:i,currentPages:l}=this.state,d=this.getIsReviewingTPItems(),p=l[i];if(s)return t.jsx(h.Loader,{size:"large",active:!0});switch(i){case M.TO_REVIEW:return t.jsxs(t.Fragment,{children:[this.renderSidebarCategory(e),!d&&a?this.renderTabPagination(a):null]});case M.REVIEWED:{const u=n.slice((p-1)*V,p*V);return t.jsxs(t.Fragment,{children:[n.length?this.renderPaginationStats(n.length):null,this.renderSidebarCategory(u),n.length?this.renderTabPagination(n.length):null]})}case M.ALL_ITEMS:return t.jsxs(t.Fragment,{children:[e.length&&a?this.renderPaginationStats(a):null,this.renderSidebarCategory(e),e.length&&a?this.renderTabPagination(a):null]});default:return null}});c(this,"renderTabHeader",()=>{const{isLoading:e,totalItems:s,reviewedItems:a}=this.props,{currentTab:n}=this.state;let i;const l=!s||s<V||a.length===s;switch(n){case M.TO_REVIEW:i=t.jsx(h.Popup,{content:r("item_editor.top_panel.not_enough_items_to_curate_more"),disabled:!l,position:"bottom center",trigger:t.jsx("div",{children:t.jsxs(h.Button,{disabled:e||l,primary:!0,className:"random-sample-button",onClick:this.handleGetRandomSampleClick,children:[t.jsx(h.Icon,{name:"random"}),r("item_editor.left_panel.get_random_sample")]})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0});break;case M.REVIEWED:i=t.jsx(Q,{id:"item_editor.left_panel.reviewed_samples",values:{reviewed_samples_bold:t.jsx("b",{children:r("item_editor.left_panel.reviewed_samples_bold",{count:a.length})}),total:ie(s??1)}});break;default:return null}return t.jsxs("div",{className:"tab-header",children:[" ",i," "]})});c(this,"renderModal",()=>{const{onToggleShowSamplesModalAgain:e,showSamplesModalAgain:s}=this.props,{showGetMoreSamplesModal:a}=this.state;return t.jsxs(h.Modal,{open:a,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.get_more_samples_modal.title")}),t.jsxs(h.Modal.Content,{children:[t.jsx(Q,{id:"item_editor.left_panel.get_more_samples_modal.content",values:{count:10,tabName:t.jsx("b",{children:M.REVIEWED})}}),t.jsxs("div",{className:"checkbox-container",onClick:e,children:[t.jsx(h.Checkbox,{checked:!s}),r("item_editor.left_panel.get_more_samples_modal.dont_show_again")]})]}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showGetMoreSamplesModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:this.handleModalProceed,children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderAllItemsTabChangeModal",()=>{const{showAllItemsTabChangeModal:e}=this.state;return t.jsxs(h.Modal,{open:e,size:"small",className:"ConfirmNewSampleModal",children:[t.jsx(h.Modal.Header,{children:r("item_editor.left_panel.all_items_check.title")}),t.jsx(h.Modal.Content,{children:r("item_editor.left_panel.all_items_check.content")}),t.jsxs(h.Modal.Actions,{children:[t.jsx(h.Button,{onClick:()=>this.setState({showAllItemsTabChangeModal:!1}),children:r("global.cancel")}),t.jsx(h.Button,{primary:!0,onClick:()=>this.handleTabChange(M.ALL_ITEMS),children:r("item_editor.left_panel.get_more_samples_modal.understood")})]})]})});c(this,"renderTabs",()=>{const{currentTab:e}=this.state;return t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:e===M.TO_REVIEW,onClick:()=>this.handleTabChange(M.TO_REVIEW),children:r("item_editor.left_panel.to_review")}),t.jsx(h.Tabs.Tab,{active:e===M.REVIEWED,onClick:()=>this.handleTabChange(M.REVIEWED),children:r("item_editor.left_panel.reviewed")}),t.jsx(h.Tabs.Tab,{active:e===M.ALL_ITEMS,onClick:this.handleSwitchToAllItemsTab,children:r("item_editor.left_panel.all_items")})]})})}componentDidMount(){this.handleReviewItemsTrigger()}componentDidUpdate(e){this.handleReviewItemsTrigger(e)}renderCollapsableLabel(e){return t.jsxs(t.Fragment,{children:[t.jsx(G,{name:e}),t.jsx(Q,{id:`item_editor.left_panel.${e}`})]})}render(){return t.jsxs(h.Section,{className:"Items",children:[this.getIsReviewingTPItems()?t.jsxs(t.Fragment,{children:[this.renderTabs(),this.renderTabHeader()]}):null,this.renderTabContent(),this.renderModal(),this.renderAllItemsTabChangeModal()]})}}class Ha extends b.PureComponent{render(){const{collection:m,isSelected:e}=this.props;return t.jsx("div",{className:`SidebarCollection ${e?"is-selected":""}`,children:t.jsxs(re,{to:$.itemEditor({collectionId:m.id}),children:[t.jsx(es,{collectionId:m.id}),t.jsxs("div",{className:"wrapper",children:[t.jsxs("div",{className:"name",children:[t.jsx(gt,{collection:m}),m.name]}),t.jsx("div",{className:"count",children:r("item_editor.left_panel.items_count",{count:m.itemCount})})]})]})})}}class Va extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{currentPage:1});c(this,"handlePageChange",(e,s)=>{const{onLoadPage:a}=this.props;this.setState({currentPage:+s.activePage}),a(+s.activePage)})}render(){const{collections:e,isLoading:s,items:a,selectedCollectionId:n,totalCollections:i}=this.props,{currentPage:l}=this.state;if(e.length===0)return null;const d=Math.ceil(i/V);return s?t.jsx(h.Loader,{size:"small",active:!0}):!s&&a.length===0&&e.length===0?t.jsx("div",{className:"empty",children:t.jsx("div",{className:"subtitle",children:r("collections_page.empty_description")})}):t.jsx(t.Fragment,{children:t.jsxs(h.Section,{className:"Collections",children:[e.map(p=>t.jsx(Ha,{collection:p,items:a,isSelected:p.id===n},p.id)),d>1?t.jsx(h.Pagination,{siblingRange:0,firstItem:null,lastItem:null,totalPages:d,activePage:l,onPageChange:this.handlePageChange}):null]})})}}var te=(o=>(o.COLLECTIONS="collections",o.ORPHAN_ITEMS="orphanItems",o))(te||{});const ee=1;let $a=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",this.getInitialState());c(this,"handleToggleShowSamplesModalAgain",()=>{this.setState(e=>({showSamplesModalAgain:!e.showSamplesModalAgain}))});c(this,"fetchResource",()=>{const{address:e,onFetchCollections:s,onFetchOrphanItems:a,isReviewing:n,selectedCollectionId:i}=this.props,{pages:l}=this.state;if(e&&!n&&!i){const d=l[l.length-1];(this.isCollectionTabActive()?s:a)(e,{limit:V,page:d})}});c(this,"loadPage",e=>{this.setState({pages:[e]},()=>this.fetchResource())});c(this,"getRandomPage",(e,s)=>Math.floor(Math.random()*(s-e+1)+e));c(this,"loadRandomPage",e=>{const{pages:s}=this.state,{totalItems:a,totalCollections:n,onSetReviewedItems:i}=this.props,l=this.isCollectionTabActive()?n:a,d=Math.ceil(l/V);if(d>s.length){const p=[...Array(d).keys()].map(u=>u+1).filter(u=>!s.includes(u));if(p.length>0){const u=p[Math.floor(Math.random()*p.length)];this.setState(E=>({pages:[...E.pages,u]}),this.fetchResource)}}i(e)});c(this,"handleTabChange",e=>{this.setState({currentTab:e,pages:[ee]},this.fetchResource)});c(this,"isCollectionTabActive",()=>{const{selectedCollectionId:e}=this.props,{currentTab:s}=this.state;return s===te.COLLECTIONS&&!e})}getInitialState(){const{selectedCollectionId:e,selectedItemId:s}=this.props;let a=te.COLLECTIONS;return!e&&s&&(a=te.ORPHAN_ITEMS),{pages:[ee],currentTab:a,initialPage:ee,showSamplesModalAgain:!0}}componentDidMount(){const{address:e,hasUserOrphanItems:s,selectedItem:a,onFetchOrphanItem:n,onSetItems:i}=this.props;this.fetchResource(),e&&s===void 0&&n(e),a&&i([a])}componentDidUpdate(e,s){const{isConnected:a,address:n,selectedCollectionId:i,selectedItemId:l,selectedItem:d,orphanItems:p,totalItems:u,visibleItems:E,hasUserOrphanItems:w,onSetItems:A,onFetchOrphanItem:j}=this.props,{initialPage:I,pages:y}=this.state;if(!i&&n&&l&&u&&(I===ee||s.initialPage<I)){if(!p.find(N=>N.id===l)){const N=Math.ceil(u/V),D=y[y.length-1],T=Math.min(N,D+1);y.includes(T)||this.setState({pages:[T],initialPage:T},this.fetchResource)}}else if(e.selectedItemId&&l&&e.selectedItemId!==l){const N=E.filter(D=>D.type!==k.EMOTE);A(N)}else n&&a&&(a!==e.isConnected||e.selectedCollectionId&&!i)&&this.setState({pages:[ee]},this.fetchResource),e.selectedCollectionId!==i&&this.setState({pages:[ee]}),n&&n!==e.address&&w===void 0&&j(n);!e.selectedItem&&d&&d.type!==k.EMOTE&&A([d]),e.selectedCollectionId!==i&&A([])}componentWillUnmount(){const{onSetItems:e}=this.props;e([])}getItems(e,s,a){const{selectedCollectionId:n,orphanItems:i,isReviewing:l}=this.props;return n&&e?ts(e)&&l?s.filter(d=>!!(a!=null&&a.find(p=>p.itemId===d.id&&p.status===oe.PENDING))):s:i}render(){const{items:e,totalItems:s,totalCollections:a,collections:n,selectedItemId:i,selectedCollectionId:l,visibleItems:d,bodyShape:p,reviewedItems:u,isReviewing:E,isPlayingEmote:w,isConnected:A,wearableController:j,isLoading:I,hasUserOrphanItems:y,onSetItems:N,onSetReviewedItems:D,onResetReviewedItems:T}=this.props,{pages:g,showSamplesModalAgain:C}=this.state,x=!l&&y,R=this.isCollectionTabActive()&&!l,S=!this.isCollectionTabActive()||l;return t.jsx("div",{className:"LeftPanel",children:A?t.jsx(ua,{id:l,itemSelected:i,itemsPage:g,itemsPageSize:V,fetchCollectionItemsOptions:{status:E?oe.PENDING:void 0},onChangePage:v=>this.setState({pages:[v]}),children:({paginatedCollections:v,collection:F,paginatedItems:Z,initialPage:he,isLoadingCollection:me,isLoadingCollectionItems:pe,itemCurations:ue})=>{const Y=this.getItems(F,Z,ue),ne=this.isCollectionTabActive(),O=l&&F?he:this.state.initialPage;return t.jsxs(t.Fragment,{children:[t.jsx(ka,{}),x?t.jsxs(h.Tabs,{isFullscreen:!0,children:[t.jsx(h.Tabs.Tab,{active:ne,onClick:()=>this.handleTabChange(te.COLLECTIONS),children:r("collections_page.collections")}),t.jsx(h.Tabs.Tab,{active:!ne,onClick:()=>this.handleTabChange(te.ORPHAN_ITEMS),children:r("item_editor.left_panel.items")})]}):null,R?t.jsx(Va,{collections:v,totalCollections:a||n.length,items:e,hasHeader:Y.length>0,selectedCollectionId:l,onLoadPage:this.loadPage,isLoading:me}):null,S?t.jsxs(t.Fragment,{children:[t.jsx(Wa,{items:Y,totalItems:s||Y.length,hasHeader:!l&&n.length>0,selectedItemId:i,collection:F,isReviewing:E,isPlayingEmote:w,visibleItems:d,bodyShape:p,onResetReviewedItems:T,reviewedItems:u,onSetItems:N,wearableController:j,initialPage:O,isLoading:pe||I,onToggleShowSamplesModalAgain:this.handleToggleShowSamplesModalAgain,showSamplesModalAgain:C,onReviewItems:()=>D(Y),onLoadRandomPage:()=>this.loadRandomPage(Y),onLoadPage:this.loadPage}),t.jsx(Da,{collectionId:l})]}):null]})}}):null})}};const Ua=o=>{const m=de(),e=Ie(),s=Oe(),a=De(),n=Ct(),i=_(S=>ce(S)),l=_(S=>we(S)),d=_(S=>ss(S)),p=_(S=>as(S)),u=_(S=>rt(S)),E=_(S=>dt(S)),w=_(S=>ct(S)),A=_(S=>Ne(S)),j=_(S=>tt(S)),I=_(S=>s?Me(S,s):null),y=_(S=>{if(e)return Ee(S,e);if(i)return Ee(S,i)}),N=_(S=>e?void 0:ns(S)),D=_(S=>i&&!e?is(S,i,y==null?void 0:y.limit):os(S)),T=b.useMemo(()=>X(j,ds)||X(j,cs),[j]),g=b.useCallback(S=>m(ht(S)),[m]),C=b.useCallback((S,v)=>m(ls(S,v)),[m]),x=b.useCallback((S,v)=>m(mt(S,v)),[m]),R=b.useCallback(S=>m(rs(S)),[m]);return t.jsx($a,{...o,address:i,isConnected:l,items:d,totalItems:(y==null?void 0:y.total)||null,totalCollections:(N==null?void 0:N.total)||null,orphanItems:D,collections:p,selectedItemId:s,selectedItem:I,selectedCollectionId:e,visibleItems:n,bodyShape:u,wearableController:E,isReviewing:a,isLoading:T,isPlayingEmote:w,hasUserOrphanItems:A,onSetItems:g,onFetchCollections:C,onFetchOrphanItems:x,onFetchOrphanItem:R})},Ga=Ua;class xe extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarColorChange",(e,s)=>{const{currentColor:a,colors:n,onChange:i}=this.props;if(a.toHexString()!==s.value){const l=n.find(d=>d.toHexString()===s.value);i(l)}});c(this,"renderItem",(e,s)=>{const a=e.toHexString();return t.jsx(h.Dropdown.Item,{value:a,onClick:this.handleAvatarColorChange,children:t.jsx("i",{className:"color",style:{background:a}})},s)})}render(){const{currentColor:e,colors:s,label:a}=this.props,n=e.toHexString();return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarColorDropdown Select",value:n,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:a}),t.jsx("div",{className:"value",children:t.jsx("i",{className:"color",style:{background:n}})}),t.jsx("div",{className:"handle"})]}),children:t.jsx(h.Dropdown.Menu,{className:"colors-menu",children:s.map(this.renderItem)})})}}let Ya=class extends ae.PureComponent{constructor(){super(...arguments);c(this,"handleAvatarChangeWearable",(e,s)=>{const{wearable:a,category:n,bodyShape:i,onChange:l,baseWearables:d}=this.props,p=s.value?d.find(u=>u.id===s.value):null;a!==p&&l(n,i,p??null)})}render(){const{wearable:e,bodyShape:s,category:a,label:n,isNullable:i,baseWearables:l}=this.props,d=hs(l,a,s).map(u=>({value:u.id,text:ms(u)}));i&&d.push({value:"",text:r("global.none")});const p=e?d.find(u=>u.value===e.id):null;return t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"AvatarWearableDropdown Select",value:e?e.id:"",options:d,scrolling:!0,onChange:this.handleAvatarChangeWearable,trigger:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:n}),t.jsx("div",{className:"value",children:p?p.text:r("global.none")}),t.jsx("div",{className:"handle"})]})})}};const za=o=>({baseWearables:ps(o)}),ge=Ze(za)(Ya);let qa=class extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{showSceneBoundaries:!1,isShowingAvatarAttributes:!1,isLoading:!1,socialEmote:void 0});c(this,"analytics",Re());c(this,"handleToggleShowingAvatarAttributes",()=>{this.setState({isShowingAvatarAttributes:!this.state.isShowingAvatarAttributes})});c(this,"handleBodyShapeChange",(e,{value:s})=>{const{onSetBodyShape:a}=this.props;a(s)});c(this,"handleAnimationChange",(e,{value:s})=>{const{emotes:a,visibleItems:n,onSetAvatarAnimation:i,onSetItems:l}=this.props,d=a.find(u=>u.id===s),p=n.filter(u=>u.type!==k.EMOTE);p.forEach(u=>{var E;(E=this.analytics)==null||E.track("Play Emote",{EMOTE_PLAYED_BASE:!d,EMOTE_PLAYED_ITEM_ID:d!=null&&d.urn?Se(d.urn):null,EMOTE_PLAYED_NAME:d?d.name:s,PREVIEWED_WEARABLE_ITEM_ID:u!=null&&u.urn?se(u.urn)?lt(u.urn):Se(u.urn):null,PREVIEWED_WEARABLE_NAME:u.name})}),d?p.push(d):i(s),l(p)});c(this,"handleSkinColorChange",e=>{const{onSetSkinColor:s}=this.props;s(e)});c(this,"handleEyeColorChange",e=>{const{onSetEyeColor:s}=this.props;s(e)});c(this,"handleHairColorChange",e=>{const{onSetHairColor:s}=this.props;s(e)});c(this,"handleWearableChange",(e,s,a)=>{const{onSetBaseWearable:n}=this.props;n(e,s,a)});c(this,"handleWearablePreviewLoad",()=>{const{wearableController:e,onSetWearablePreviewController:s}=this.props;e||s(He.createController("wearable-editor")),this.setState({isLoading:!1})});c(this,"handlePlayEmote",()=>{const{wearableController:e,isPlayingEmote:s,visibleItems:a,onSetAvatarAnimation:n,onSetItems:i}=this.props,l=a.filter(d=>d.type!==k.EMOTE);s?(n(f.PreviewEmote.IDLE),i(l)):e==null||e.emote.play()});c(this,"handleSocialEmoteSelect",e=>{this.setState({socialEmote:e})});c(this,"renderEmotePlayButton",()=>{const{isPlayingEmote:e}=this.props,s=e?"stop":"play",a=e?r("item_editor.center_panel.stop"):r("item_editor.center_panel.play_emote");return t.jsxs(h.Button,{icon:!0,onClick:this.handlePlayEmote,children:[t.jsx(h.Icon,{name:s}),t.jsx("span",{children:a})]})});c(this,"renderEmoteDropdownButton",()=>{const{collection:e,emotes:s,isPlayingEmote:a}=this.props,n=!!e,i=s.length>0;return a?null:t.jsx(h.Dropdown,{className:"avatar-animation button icon",floating:!0,scrolling:!0,children:t.jsxs(h.Dropdown.Menu,{children:[i&&t.jsxs(t.Fragment,{children:[t.jsx(h.Dropdown.Header,{content:n?r("item_editor.center_panel.from_collection"):r("item_editor.center_panel.from_items")}),t.jsx(h.Dropdown.Divider,{}),s.map(l=>t.jsx(h.Dropdown.Item,{value:l.id,text:l.name,onClick:this.handleAnimationChange},l.id)),t.jsx(h.Dropdown.Divider,{}),t.jsx(h.Dropdown.Header,{content:r("item_editor.center_panel.default")}),t.jsx(h.Dropdown.Divider,{})]}),f.PreviewEmote.schema.enum.map(l=>t.jsx(h.Dropdown.Item,{value:l,text:r(`emotes.${l}`),onClick:this.handleAnimationChange},l))]})})});c(this,"renderEmoteSelector",()=>t.jsx(h.Popup,{content:r("item_editor.center_panel.disabled_animation_dropdown"),disabled:!0,position:"top center",trigger:t.jsx("div",{className:"avatar-animation-dropdown-wrapper option",children:t.jsxs(h.Button.Group,{children:[this.renderEmotePlayButton(),this.renderEmoteDropdownButton()]})})}))}componentDidMount(){const{address:e,collection:s,emotes:a,selectedBaseWearables:n,hasUserOrphanItems:i,onFetchBaseWearables:l,onFetchOrphanItems:d,onFetchCollectionItems:p}=this.props,u=a.length>0;n||l(),u||(s&&!q(s)?p(s.id):e&&i&&d(e)),this.setState({isLoading:!0})}componentWillUnmount(){const{onSetWearablePreviewController:e}=this.props;e(null)}renderSelectTrigger(e,s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:s}),t.jsx("div",{className:"handle"})]})}getDropdownAttributes(e,s,a){const n=s.find(i=>i.value===e);return{value:e,options:s,trigger:this.renderSelectTrigger(a,n?n.text:"")}}render(){const{bodyShape:e,skinColor:s,eyeColor:a,hairColor:n,emote:i,selectedBaseWearables:l,selectedItem:d,visibleItems:p,isImportFilesModalOpen:u,wearableController:E}=this.props,{isShowingAvatarAttributes:w,showSceneBoundaries:A,isLoading:j,socialEmote:I}=this.state,y=p.some(le)&&(d==null?void 0:d.type)===k.EMOTE,N=i===f.PreviewEmote.JUMP?1:void 0;let D;return!I&&(d==null?void 0:d.type)===k.EMOTE&&d.data.startAnimation&&(D={title:"Start Animation",...d.data.startAnimation,loop:!0}),t.jsxs("div",{className:`CenterPanel ${u?"import-files-modal-is-open":""}`,children:[t.jsx(He,{id:"wearable-editor",profile:"default",bodyShape:e,emote:i,zoom:N,skin:be(s),eyes:be(a),hair:be(n),urns:l?Object.values(l).map(T=>T?T.id:null).filter(T=>T!==null):[],base64s:p.map(us),disableAutoRotate:!0,disableBackground:!0,wheelZoom:1.5,wheelStart:100,dev:gs,onUpdate:()=>this.setState({isLoading:!0}),onLoad:this.handleWearablePreviewLoad,disableDefaultEmotes:y,showSceneBoundaries:A,socialEmote:I||D}),y&&!j&&E?t.jsx(Cs,{className:"zoom-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E}):null,j&&t.jsx(h.Center,{children:t.jsx(h.Loader,{active:!0})}),t.jsxs("div",{className:"footer",children:[y&&!j&&E?t.jsx("div",{className:"emote-controls-container",children:t.jsx(h.EmoteControls,{className:"emote-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E})}):null,t.jsxs("div",{className:"options",children:[t.jsx("div",{className:`option ${w?"active":""}`,onClick:this.handleToggleShowingAvatarAttributes,children:t.jsx(h.Icon,{name:"user"})}),y?!j&&E?t.jsx(Is,{className:"animation-controls",wearablePreviewId:"wearable-editor",wearablePreviewController:E,selectedAnimation:I,onSelectAnimation:this.handleSocialEmoteSelect}):null:this.renderEmoteSelector(),t.jsx("div",{className:`option ${A?"active":""}`,children:t.jsx(G,{name:"cylinder",onClick:()=>this.setState(T=>({showSceneBoundaries:!T.showSceneBoundaries}))})})]}),t.jsxs("div",{className:`avatar-attributes ${w?"active":""}`,children:[t.jsx("div",{className:"dropdown-container",children:t.jsx(h.Dropdown,{inline:!0,direction:"right",className:"Select",onChange:this.handleBodyShapeChange,...this.getDropdownAttributes(e,[{value:f.BodyShape.MALE,text:r("body_shapes.male")},{value:f.BodyShape.FEMALE,text:r("body_shapes.female")}],r("wearable.category.body_shape"))})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:s,colors:bs(),label:r("wearable.color.skin"),onChange:this.handleSkinColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:a,colors:_s(),label:r("wearable.color.eye"),onChange:this.handleEyeColorChange})}),t.jsx("div",{className:"dropdown-container",children:t.jsx(xe,{currentColor:n,colors:xs(),label:r("wearable.color.hair"),onChange:this.handleHairColorChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.HAIR],category:f.WearableCategory.HAIR,bodyShape:e,label:r("wearable.category.hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.FACIAL_HAIR],category:f.WearableCategory.FACIAL_HAIR,bodyShape:e,label:r("wearable.category.facial_hair"),onChange:this.handleWearableChange,isNullable:!0})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.UPPER_BODY],category:f.WearableCategory.UPPER_BODY,bodyShape:e,label:r("wearable.category.upper_body"),onChange:this.handleWearableChange})}),t.jsx("div",{className:"dropdown-container",children:l&&t.jsx(ge,{wearable:l[f.WearableCategory.LOWER_BODY],category:f.WearableCategory.LOWER_BODY,bodyShape:e,label:r("wearable.category.lower_body"),onChange:this.handleWearableChange})})]})]})]})}};const Ja=()=>{const o=de(),m=_(ce),e=_(rt),s=_(Es),a=_(vs),n=_(js),i=_(Ss),l=_(fs),d=Ct(),p=_(dt),u=_(ys),E=_(ct),w=_(As),A=_(Ne),j=_(ws),I=Ie(),y=Oe(),N=_(v=>y?Me(v,y):null),D=b.useMemo(()=>I?j.find(v=>v.id===I):void 0,[j,I]),T=b.useMemo(()=>I?u.filter(v=>v.collectionId===I):u.filter(v=>!v.collectionId),[u,I]),g=l?l[e]:null,x=b.useMemo(()=>!d.some(le)&&i===f.PreviewEmote.IDLE,[d,i])?!1:E,R="CreateSingleItemModal"in w,S=b.useMemo(()=>({onSetBodyShape:v=>{o(Ts(v))},onSetAvatarAnimation:v=>{o(Ps(v))},onSetSkinColor:v=>{o(Ns(v))},onSetEyeColor:v=>{o(Rs(v))},onSetHairColor:v=>{o(Ms(v))},onSetBaseWearable:(v,F,Z)=>{o(Ds(v,F,Z))},onFetchBaseWearables:()=>{o(Os())},onSetWearablePreviewController:v=>{o(Ls(v))},onSetItems:v=>{o(ht(v))},onFetchOrphanItems:(v,F)=>{o(mt(v,F))},onFetchCollectionItems:(v,F)=>{o(ks(v,F))}}),[o]);return t.jsx(qa,{address:m,bodyShape:e,collection:D,selectedItem:N,selectedBaseWearables:g,skinColor:s,eyeColor:a,hairColor:n,emote:i,visibleItems:d,wearableController:p,emotes:T,isPlayingEmote:x,isImportFilesModalOpen:R,hasUserOrphanItems:A,...S})},Ka=Ja,Qa="_dynamicInput_ljtxw_1",Xa="_dynamicInputField_ljtxw_8",Za="_noTransition_ljtxw_26",en="_isEditing_ljtxw_41",tn="_dynamicInputEditButton_ljtxw_48",sn="_mirrorSpan_ljtxw_60",K={dynamicInput:Qa,dynamicInputField:Xa,noTransition:Za,isEditing:en,dynamicInputEditButton:tn,mirrorSpan:sn},an=6,It="a-zA-Z0-9\\s_-",nn=new RegExp(`^[${It}]*$`),on=new RegExp(`[^${It}]`,"g"),ln=({value:o,disabled:m=!1,placeholder:e="",editable:s=!1,className:a="",maxLength:n,onChange:i})=>{const[l,d]=b.useState(!1),p=b.useRef(null),u=b.useRef(null),E=b.useRef(null),w=b.useRef(!1),A=b.useCallback(()=>{const x=p.current;x&&(x.classList.add(K.noTransition),E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{x.classList.remove(K.noTransition),E.current=null},120))},[]),j=b.useCallback(()=>{const x=u.current,R=p.current;if(!x||!R||w.current)return;x.textContent=o&&o.length>0?o:e||"​";const v=x.getBoundingClientRect().width+an;R.style.width=`${v}px`},[o,e]);b.useLayoutEffect(()=>{j()},[j]);const I=b.useCallback(x=>{let R=x.target.value;R=R.replace(on,""),o!==R&&i&&i(n?R.slice(0,n):R),A(),requestAnimationFrame(j)},[o,n,i,A,j]),y=b.useCallback(x=>{w.current=!0},[]),N=b.useCallback(x=>{w.current=!1,requestAnimationFrame(j)},[j]),D=b.useCallback(x=>{if(x.key==="Enter"){d(!1);return}x.key.length>1||x.ctrlKey||x.metaKey||x.altKey||nn.test(x.key)||x.preventDefault()},[]),T=b.useCallback(()=>d(!1),[]),g=b.useCallback(()=>{d(!0),setTimeout(()=>{var x;return(x=p.current)==null?void 0:x.focus()},0)},[]),C=s&&!m;return t.jsxs("div",{className:Bs(K.dynamicInput,{[K.isEditing]:l},a),children:[t.jsx("input",{ref:p,value:o,onChange:I,onKeyDown:D,onBlur:T,onCompositionStart:y,onCompositionEnd:N,disabled:m||!l,placeholder:e,maxLength:n,className:K.dynamicInputField}),t.jsx("span",{ref:u,className:K.mirrorSpan,"aria-hidden":"true"}),C&&t.jsx(h.Button,{className:K.dynamicInputEditButton,icon:"pencil alternate",size:"tiny",basic:!0,onClick:g,disabled:m})]})},rn=b.memo(ln);class dn extends b.PureComponent{constructor(){super(...arguments);c(this,"handleChange",e=>{const{value:s,maxLength:a,onChange:n}=this.props,i=e.target.value;s!==i&&n(a?i.slice(0,a):i)})}render(){const{label:e,disabled:s,value:a}=this.props;return t.jsxs("div",{className:`Input ${s?"is-disabled":""}`.trim(),children:[t.jsx("div",{className:"label",children:e}),t.jsx("input",{value:a||"",onChange:this.handleChange,disabled:s})]})}}class B extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{value:a,onChange:n}=this.props,i=s.value;i!==a&&(this.setState({value:i}),n(i))})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,options:s}=this.props,{value:a}=this.state,n=s.find(i=>i.value===a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"label",children:e}),t.jsx("div",{className:"value",children:n?n.text:r("item_editor.right_panel.select_placeholder")}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{className:`Select ${a?"":"blank"}`.trim(),trigger:this.renderTrigger(),inline:!0,direction:"right",scrolling:e.length>4,value:a||void 0,options:e,disabled:s,onChange:this.handleChange})}}c(B,"defaultProps",{disabled:!1});class ye extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{value:this.props.value});c(this,"handleChange",(e,s)=>{const{onChange:a}=this.props,{value:n}=this.state,i=s.value,l=[...n];for(const d of i)n.includes(d)||l.push(d);l.length!==n.length&&(this.setState({value:l}),a(l))});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}renderTrigger(){const{label:e,info:s,options:a}=this.props,{value:n}=this.state,i=a.reduce((l,d)=>(l[d.value]=d.text,l),{});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"label",children:[e,s?t.jsx(Ce,{content:s,className:"info"}):null]}),t.jsx("div",{className:"values",children:n.length>0?n.map(l=>t.jsxs("div",{className:"value",children:[i[l],t.jsx("div",{className:"remove",onClick:d=>{this.handleRemove(l),d.stopPropagation()}})]},l)):t.jsx("div",{className:"placeholder",children:r("item_editor.right_panel.select_placeholder")})}),t.jsx("div",{className:"handle"})]})}render(){const{options:e,disabled:s}=this.props,{value:a}=this.state;return t.jsx(h.Dropdown,{inline:!0,multiple:!0,className:`MultiSelect ${a.length>0?"":"blank"}`.trim(),trigger:this.renderTrigger(),direction:"right",value:a,scrolling:!1,options:e.filter(n=>!a.includes(n.value)),disabled:s,onChange:this.handleChange,closeOnChange:!0})}}c(ye,"defaultProps",{disabled:!1});class bt extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{draft:"",value:this.props.value});c(this,"handleChange",e=>{this.setState({draft:e.target.value})});c(this,"handleAdd",()=>{const{onChange:e}=this.props,{draft:s,value:a}=this.state,n=s.trim();if(n!=="")if(a.includes(n))this.setState({draft:""});else{const i=[...a,n];this.setState({value:i,draft:""}),e(i)}});c(this,"handleKeyDown",e=>{if(e.key==="#"){e.preventDefault();return}else if(e.keyCode===Fs||e.keyCode===Ve||e.keyCode===Ws)this.handleAdd();else if(e.keyCode===Hs||e.keyCode===Ve){const{draft:s,value:a}=this.state,n=a[a.length-1];n&&s===""&&this.handleRemove(n)}});c(this,"handleRemove",e=>{const{onChange:s}=this.props,a=this.state.value.filter(n=>n!==e);this.setState({value:a}),s(a)})}componentWillReceiveProps(e){const{itemId:s,value:a}=e;(s!==this.props.itemId||a!==this.state.value)&&this.setState({value:a})}render(){const{isDisabled:e}=this.props,{draft:s,value:a}=this.state;return t.jsx("div",{className:`Tags ${a.length>0?"":"blank"} ${e?"is-disabled":""}`.trim(),children:t.jsxs("div",{className:"values",children:[a.map(n=>t.jsxs("div",{className:"value",children:[n,t.jsx("div",{className:"remove",onClick:i=>{this.handleRemove(n),i.stopPropagation()}})]},n)),t.jsx("input",{value:s,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleAdd,disabled:e})]})})}}c(bt,"defaultProps",{isDisabled:!1});const cn=3;let hn=class extends b.PureComponent{constructor(){super(...arguments);c(this,"analytics",Re());c(this,"state",this.getInitialState());c(this,"thumbnailInput",b.createRef());c(this,"handleDeleteItem",()=>{const{onDeleteItem:e}=this.props,{selectedItem:s}=this.props;e(s)});c(this,"handleAddRepresentationToItem",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,addRepresentation:!0})});c(this,"handleChangeItemFile",()=>{const{selectedItem:e,onOpenModal:s}=this.props;s("CreateSingleItemModal",{item:e,changeItemFile:!0})});c(this,"handleOpenVideoDialog",(e={})=>{const{selectedItem:s,onOpenModal:a}=this.props;a("EditVideoModal",{item:s,onSaveVideo:this.handleSaveVideo,...e})});c(this,"handleSaveVideo",e=>{this.setState({video:URL.createObjectURL(e),contents:{...this.state.contents,[$e]:e},isDirty:!0})});c(this,"handleChangeName",e=>{this.setState({name:e,isDirty:this.isDirty({name:e})})});c(this,"handleChangeDescription",(e,s)=>{const a=s.value??"";this.setState({description:a,isDirty:this.isDirty({description:a})})});c(this,"handleChangeUtility",(e,s)=>{const a=s.value??"";this.setState({utility:a,isDirty:this.isDirty({utility:a})})});c(this,"handleChangeRarity",e=>{this.setState({rarity:e,isDirty:this.isDirty({rarity:e})})});c(this,"handleAllowVrmExport",(e,{checked:s})=>{const a={...this.state.data,blockVrmExport:!s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleAllowOutlineCompatible",(e,{checked:s})=>{const a={...this.state.data,outlineCompatible:s};this.setState({data:a,isDirty:this.isDirty({data:a})})});c(this,"handleChangeCategory",e=>{let s;_e(this.state.data)?s={...this.state.data,category:e}:(s={...this.state.data,category:e},e===f.WearableCategory.SKIN&&(s=this.setReplaces(s,[]),s=this.setHides(s,[]))),this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handlePlayModeChange",e=>{const s={...this.state.data,loop:e===U.LOOP};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleStartAnimationArmatureAnimationChange",(e,s)=>{const a=this.state.data,n={...a.startAnimation||{}};s===""&&e===f.ArmatureId.Armature_Prop?delete n[e]:n[e]={animation:s},this.setState({data:{...a,startAnimation:n},isDirty:this.isDirty({data:{...a,startAnimation:n}})})});c(this,"handleStartAnimationAudioClipChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.audio=e||void 0,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleStartAnimationPlayModeChange",e=>{const s=this.state.data,a={...s.startAnimation||{}};a.loop=e,this.setState({data:{...s,startAnimation:a},isDirty:this.isDirty({data:{...s,startAnimation:a}})})});c(this,"handleRandomizeOutcomesChange",e=>{const s={...this.state.data,randomizeOutcomes:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOutcomeChange",(e,s,a)=>{const n=this.state.data,i=[...n.outcomes];i[e]={...i[e],[s]:a},this.setState({data:{...n,outcomes:i},isDirty:this.isDirty({data:{...n,outcomes:i}})})});c(this,"handleOutcomeClipChange",(e,s,a,n)=>{const i=this.state.data,l=[...i.outcomes||[]],d={...l[e].clips};n===""?delete d[s]:(d[s]||(d[s]={animation:""}),d[s]={...d[s],[a]:n}),l[e]={...l[e],clips:d},this.setState({data:{...i,outcomes:l},isDirty:this.isDirty({data:{...i,outcomes:l}})})});c(this,"handleOutcomeAudioClipChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].audio=s||void 0,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleOutcomePlayModeChange",(e,s)=>{const a=this.state.data,n=[...a.outcomes||[]];n[e].loop=s,this.setState({data:{...a,outcomes:n},isDirty:this.isDirty({data:{...a,outcomes:n}})})});c(this,"handleAddOutcome",()=>{const e=this.state.data;(!e||!e.outcomes)&&(e.outcomes=[]);const s={title:`Outcome ${e.outcomes.length+1}`,clips:{},loop:!1},a=[...e.outcomes,s];this.setState({data:{...e,outcomes:a},isDirty:this.isDirty({data:{...e,outcomes:a}})})});c(this,"handleRemoveOutcome",e=>{const s=this.state.data,a=s.outcomes.filter((n,i)=>i!==e);this.setState({data:{...s,outcomes:a},isDirty:this.isDirty({data:{...s,outcomes:a}})})});c(this,"handleEditOutcomeTitle",(e,s)=>{this.handleOutcomeChange(e,"title",s)});c(this,"handleChangeReplaces",e=>{const s=this.setReplaces(this.state.data,e);this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleChangeHides",(e,s)=>{const a=this.state.data.hides;let n=[];s==="wearable"?n=[...a.filter(l=>!f.WearableCategory.schema.enum.includes(l)),...e]:n=[...a.filter(l=>!f.BodyPartCategory.schema.enum.includes(l)),...e];const i=this.setHides(this.state.data,n);this.setState({data:i,isDirty:this.isDirty({data:i})})});c(this,"handleChangeTags",e=>{const s={...this.state.data,tags:e};this.setState({data:s,isDirty:this.isDirty({data:s})})});c(this,"handleOnSaveItem",async()=>{var w,A;const{selectedItem:e,itemStatus:s,onSaveItem:a}=this.props,{name:n,description:i,utility:l,rarity:d,contents:p,data:u,isDirty:E}=this.state;if(E&&e){let j=u;j&&!_e(j)&&(j={...j,removesDefaultHiding:j.category===f.WearableCategory.UPPER_BODY||(w=j.hides)!=null&&w.includes(f.WearableCategory.UPPER_BODY)?[f.BodyPartCategory.HANDS]:[],..."blockVrmExport"in j?{blockVrmExport:j.blockVrmExport}:{},..."outlineCompatible"in j?{outlineCompatible:j.outlineCompatible}:{}});const I={...e.contents,...await Vs(p)},y={...e,name:n,description:i,rarity:d,data:j,contents:I,utility:l??void 0};s&&[Ue.UNPUBLISHED,Ue.UNDER_REVIEW].includes(s)&&(y.video=I[$e]),a(y,p),se(y.urn)&&((A=this.analytics)==null||A.track("Edit Item",{contents:p})),this.setState({isDirty:!1}),this.handleOnResetItem()}});c(this,"handleOnResetItem",()=>{const{selectedItem:e}=this.props;e&&this.setItem(e)});c(this,"handleOpenThumbnailDialog",()=>{const{selectedItem:e,onOpenModal:s}=this.props;(e==null?void 0:e.type)===k.EMOTE?s("EditThumbnailModal",{onSaveThumbnail:this.handleEmoteThumbnailChange,item:e}):this.thumbnailInput.current&&this.thumbnailInput.current.click()});c(this,"handleEmoteThumbnailChange",e=>{const s=$s(e);this.setState({thumbnail:e,contents:{[Ge]:s},isDirty:!0})});c(this,"handleThumbnailChange",async e=>{const{files:s}=e.target;if(s&&s.length>0){const a=s[0],n=await Ye(a),i=await Ye(a,1024,1024),l=URL.createObjectURL(n);this.setState({thumbnail:l,contents:{[Ge]:i},isDirty:!0})}});c(this,"handleDownloadItem",()=>{const{selectedItemId:e,onDownload:s}=this.props;e&&s(e)})}componentDidMount(){const{selectedItem:e}=this.props;e&&this.setItem(e)}componentDidUpdate(e){const{selectedItemId:s,selectedItem:a}=this.props;e.selectedItemId!==s?a?this.setItem(a):this.setState(this.getInitialState()):a&&(!e.selectedItem||this.hasSavedItem())&&this.setItem(a)}setItem(e){var a;const s=e.data;fe(e)&&((a=s.replaces)!=null&&a.length)&&(s.hides=s.hides.concat(s.replaces),s.replaces=[]),this.setState({thumbnail:"",video:"",name:e.name,description:e.description,utility:e.utility||"",rarity:e.rarity,data:e.data,hasItem:!0,isDirty:!1})}getInitialState(){return{name:"",description:"",utility:"",thumbnail:"",video:"",rarity:void 0,contents:{},data:void 0,hasItem:!1,isDirty:!1}}setReplaces(e,s){return{...e,replaces:s,representations:e.representations.map(a=>({...a,overrideReplaces:s}))}}setHides(e,s){return{...e,hides:s,representations:e.representations.map(a=>({...a,overrideHides:s}))}}canEditItemMetadata(e){const{collection:s,canEditSelectedItem:a}=this.props;return!e||s&&ze(s)?!1:a}isSkin(){const{data:e}=this.state;return(e==null?void 0:e.category)===f.WearableCategory.SKIN}isDirty(e={}){const{selectedItem:s}=this.props,{hasItem:a}=this.state;return a?this.hasStateItemChanged({...this.state,...e},s):!1}hasSavedItem(){const{selectedItem:e}=this.props,{isDirty:s}=this.state;return e&&!s&&this.hasStateItemChanged(this.state,e)}hasStateItemChanged(e,s){return e.name!==s.name||e.description!==s.description||e.utility!==s.utility||e.rarity!==s.rarity||!ot(e.data,s.data)}asCategorySelect(e,s){return s.map(a=>({value:a,text:r(`${e}.category.${a}`)}))}asRaritySelect(e){return e.map(s=>({value:s,text:r(`wearable.rarity.${s}`)}))}asPlayModeSelect(e){return e.map(s=>({value:s,text:r(`emote.play_mode.${s}.text`),description:r(`emote.play_mode.${s}.description`)}))}getAnimationOptions(e,s=!1,a){if(!e.isLoaded)return[];if(e.error)return console.warn("Animation data error:",e.error),[];let n=e.animations;if(a){const l=qe(`dummy${a}`);n=e.animations.filter(d=>{const p=qe(d.name),E=Us(d.name)===d.name;return p===l||E})}const i=n.map(l=>({value:l.name,text:l.name}));return s?[{value:"",text:"--"},...i]:i}getAudioOptions(e){const s=new Set,a=Object.keys(e).map(n=>{if(Gs(n)){const i=n.replace(/^(male|female)\//,"");if(!s.has(i))return s.add(i),{value:i,text:i}}return null}).filter(Boolean);return[{value:"",text:"--"},...a]}renderOverrides(e){const s=this.canEditItemMetadata(e),a=this.state.data;if(!e||_e(a))return null;const n=Ys(e.contents,a.category),i=zs(e.contents),l=a.hides.filter(p=>n.includes(p)),d=a.hides.filter(p=>i.includes(p));return t.jsxs(t.Fragment,{children:[t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.base_body"),info:r("item_editor.right_panel.base_body_info"),value:d,options:this.asCategorySelect(e.type,i),disabled:!s,onChange:p=>this.handleChangeHides(p,"bodypart")}),t.jsx(ye,{itemId:e.id,label:r("item_editor.right_panel.wearables"),info:r("item_editor.right_panel.wearables_info"),value:l,options:this.asCategorySelect(e.type,l.some(p=>p===f.WearableCategory.BODY_SHAPE)?n:n.filter(p=>p!==f.WearableCategory.BODY_SHAPE)),disabled:!s,onChange:p=>this.handleChangeHides(p,"wearable")})]})}renderModelDetails(e){const{isDownloading:s}=this.props,{thumbnail:a}=this.state,n=this.canEditItemMetadata(e),i=s?t.jsx(h.Loader,{active:!0,size:"tiny",className:"donwload-item-loader"}):t.jsx(G,{name:"export",className:"download-item-button",onClick:this.handleDownloadItem});return t.jsxs("div",{className:"details",children:[n?t.jsxs(t.Fragment,{children:[t.jsx(G,{name:"edit",className:"edit-item-file",onClick:this.handleChangeItemFile}),i,t.jsxs("div",{className:"thumbnail-container",children:[t.jsx(ve,{item:e,src:a,hasBadge:!0,badgeSize:"small"}),t.jsxs("div",{className:"thumbnail-edit-container",children:[t.jsx("input",{type:"file",ref:this.thumbnailInput,onChange:this.handleThumbnailChange,accept:"image/png"}),t.jsx("div",{className:"thumbnail-edit-background"}),t.jsx(G,{name:"camera",onClick:this.handleOpenThumbnailDialog})]})]})]}):t.jsxs(t.Fragment,{children:[i,t.jsx(ve,{item:e,src:a,hasBadge:!0,badgeSize:"small"})]}),t.jsx(qs,{item:e})]})}renderVideoDetails(e){if(!Je(e))return null;const s=this.canEditItemMetadata(e),a=s?()=>this.handleOpenVideoDialog():()=>this.handleOpenVideoDialog({viewOnly:!0});return t.jsx("div",{className:"details",children:s?t.jsxs(t.Fragment,{children:[t.jsx(G,{name:"edit",className:"edit-item-file",onClick:a}),t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0,onClick:a})]}):t.jsxs(t.Fragment,{children:[Js(e)&&t.jsx(G,{name:"play",className:"play-video-button",onClick:a}),t.jsx(Ke,{item:e,src:this.state.video,showMetrics:!0})]})})}renderPermissions(e){return t.jsx(Ks,{requiredPermissions:e.data.requiredPermissions})}render(){const{selectedItemId:e,address:s,isWearableUtilityEnabled:a,isConnected:n,error:i,isCampaignEnabled:l,isVrmOptOutEnabled:d,campaignName:p,campaignTag:u}=this.props,{name:E,description:w,utility:A,rarity:j,data:I,isDirty:y,hasItem:N}=this.state,D=f.Rarity.getRarities(),T=Qs();return t.jsx("div",{className:"RightPanel",children:n?t.jsx(ba,{id:e,children:(g,C,x,R)=>{var Z,he,me,pe,ue,Y,ne;const S=C&&ze(C),v=this.canEditItemMetadata(g),F=g?fe(g)?Xs(g.contents):Zs():[];return x?t.jsx(h.Loader,{size:"massive",active:!0}):N||!e?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"header",children:[t.jsx("div",{className:"title",children:r("item_editor.right_panel.properties")}),g&&pt(g,s)&&!g.isPublished&&!S?t.jsx(h.Dropdown,{trigger:t.jsx("div",{className:"actions"}),inline:!0,direction:"left",children:t.jsxs(h.Dropdown.Menu,{children:[je(g)!==null?t.jsx(h.Dropdown.Item,{text:r("item_detail_page.add_representation",{bodyShape:r(`body_shapes.${je(g)}`).toLowerCase()}),onClick:this.handleAddRepresentationToItem}):null,t.jsx(ut,{name:E,onDelete:this.handleDeleteItem,trigger:t.jsx(h.Dropdown.Item,{text:r("global.delete")})})]})}):null]}),t.jsxs("div",{className:"container",children:[t.jsx(H,{label:r("item_editor.right_panel.details"),children:g?t.jsxs(t.Fragment,{children:[this.renderModelDetails(g),this.renderVideoDetails(g)]}):null}),t.jsx(H,{label:r("item_editor.right_panel.basics"),children:g?t.jsxs(t.Fragment,{children:[t.jsx(dn,{label:r("global.name"),value:E,disabled:!v,maxLength:ea,onChange:this.handleChangeName}),t.jsx(h.TextAreaField,{maxLength:ta,onChange:this.handleChangeDescription,label:r("global.description"),placeholder:r("item_editor.right_panel.description_placeholder"),disabled:!v,value:w,rows:"2",cols:"12"}),a?t.jsx(h.TextAreaField,{maxLength:sa,onChange:this.handleChangeUtility,label:r("global.utility"),placeholder:r("item_editor.right_panel.utility_placeholder"),disabled:!v,value:A,tooltip:{content:r("item_editor.right_panel.utility_tooltip")},rows:"2",cols:"12"}):null,t.jsx(B,{itemId:g.id,label:r("global.category"),value:I.category,options:this.asCategorySelect(g.type,F),disabled:!v,onChange:this.handleChangeCategory}),!(g.urn&&se(g.urn))&&t.jsx(B,{itemId:g.id,label:r("global.rarity"),value:j,options:this.asRaritySelect(D),disabled:g.isPublished||!v,onChange:this.handleChangeRarity})]}):null}),(g==null?void 0:g.type)===k.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.overrides")}),t.jsx(Ce,{content:r("item_editor.right_panel.overrides_info"),className:"info"})]}),children:this.renderOverrides(g)}),(g==null?void 0:g.type)===k.EMOTE&&(g!=null&&g.metrics)&&aa(g.metrics)&&g.metrics.additionalArmatures?t.jsx(H,{label:r("item_editor.right_panel.animations"),children:t.jsxs("div",{className:"animations-section",children:[t.jsxs(h.Box,{className:"emote-request-state-box",header:t.jsx(h.Header,{className:"emote-start-header",children:"Emote Start"}),children:[t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(he=(Z=I==null?void 0:I.startAnimation)==null?void 0:Z[f.ArmatureId.Armature])==null?void 0:he.animation,options:this.getAnimationOptions(R,!1),disabled:x,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature,O)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(pe=(me=I==null?void 0:I.startAnimation)==null?void 0:me[f.ArmatureId.Armature_Prop])==null?void 0:pe.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:O=>this.handleStartAnimationArmatureAnimationChange(f.ArmatureId.Armature_Prop,O)}),Object.values(g.contents).length>0&&Qe(g)?t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(ue=I==null?void 0:I.startAnimation)==null?void 0:ue.audio,options:this.getAudioOptions(g.contents),onChange:O=>this.handleStartAnimationAudioClipChange(O)}):null,t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:(Y=I==null?void 0:I.startAnimation)!=null&&Y.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),onChange:O=>this.handleStartAnimationPlayModeChange(O===U.LOOP),disabled:!0})]}),I!=null&&I.outcomes&&I.outcomes.length>1?t.jsx(B,{itemId:g.id,label:r("item_editor.right_panel.social_emote.randomize_outcomes"),value:I!=null&&I.randomizeOutcomes?"true":"false",options:[{value:"true",text:"True"},{value:"false",text:"False"}],disabled:x,onChange:O=>this.handleRandomizeOutcomesChange(O==="true")}):null,(I==null?void 0:I.outcomes)&&I.outcomes.length>0&&I.outcomes.map((O,z)=>{var Le,ke,Be;return t.jsxs(h.Box,{className:"outcome-box",header:t.jsxs("div",{className:"outcome-header",children:[t.jsx(rn,{className:"outcome-title-input",value:O.title,editable:!0,maxLength:na,onChange:W=>this.handleEditOutcomeTitle(z,W)}),I.outcomes.length>1?t.jsx(h.Button,{className:"outcome-remove-button",icon:"trash",size:"tiny",basic:!0,onClick:()=>this.handleRemoveOutcome(z),disabled:x,style:{float:"right",marginTop:"-2px"}}):null]}),children:[t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 1`,value:(Le=O.clips[f.ArmatureId.Armature])==null?void 0:Le.animation,options:this.getAnimationOptions(R,!1),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature,"animation",W)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.avatar")} 2 (${r("item_editor.right_panel.social_emote.optional")})`,value:(ke=O.clips[f.ArmatureId.Armature_Other])==null?void 0:ke.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Other,"animation",W)}),t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.props")} (${r("item_editor.right_panel.social_emote.optional")})`,value:(Be=O.clips[f.ArmatureId.Armature_Prop])==null?void 0:Be.animation,options:this.getAnimationOptions(R,!0),disabled:x,onChange:W=>this.handleOutcomeClipChange(z,f.ArmatureId.Armature_Prop,"animation",W)}),Object.values(g.contents).length>0&&Qe(g)?t.jsx(B,{itemId:g.id,label:`${r("item_editor.right_panel.social_emote.audio")} (${r("item_editor.right_panel.social_emote.optional")})`,value:O.audio,options:this.getAudioOptions(g.contents),onChange:W=>this.handleOutcomeAudioClipChange(z,W)}):null,t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:O!=null&&O.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:x,onChange:W=>this.handleOutcomePlayModeChange(z,W===U.LOOP)})]},z)}),((I==null?void 0:I.outcomes)??[]).length<cn?t.jsx(h.Row,{className:"add-outcome-button",align:"left",children:t.jsxs(h.Button,{secondary:!0,size:"small",disabled:x,onClick:this.handleAddOutcome,children:[t.jsx(G,{name:"add"})," ",r("item_editor.right_panel.social_emote.add_outcome")]})}):null]})}):(g==null?void 0:g.type)===k.EMOTE?t.jsx(H,{label:r("item_editor.right_panel.animation"),children:g?t.jsx(B,{itemId:g.id,label:r("create_single_item_modal.play_mode_label"),value:I.loop?U.LOOP:U.SIMPLE,options:this.asPlayModeSelect(T),disabled:!v,onChange:this.handlePlayModeChange}):null}):null,g&&Je(g)&&((ne=g.data.requiredPermissions)!=null&&ne.length)?t.jsx(H,{label:r("item_editor.right_panel.required_permissions"),children:this.renderPermissions(g)}):null,t.jsx(H,{label:r("item_editor.right_panel.tags"),children:g?t.jsxs(t.Fragment,{children:[t.jsx(bt,{itemId:g.id,value:I.tags,onChange:this.handleChangeTags,isDisabled:!v}),l&&p&&u&&v&&t.jsx("p",{className:"event-tag",children:r("item_editor.right_panel.event_tag",{event_tag:t.jsx("span",{children:u}),event_name:t.jsx("span",{children:p})})})]}):null}),(g==null?void 0:g.type)===k.WEARABLE&&d&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.copyright.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.copyright.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.copyright.vrm_export")}),t.jsx(h.Checkbox,{toggle:!0,label:I!=null&&I.blockVrmExport?r("item_editor.right_panel.copyright.disabled"):r("item_editor.right_panel.copyright.enabled"),checked:!(I!=null&&I.blockVrmExport),onChange:this.handleAllowVrmExport,"aria-label":r("item_editor.right_panel.copyright.vrm_export")})]})})}),(g==null?void 0:g.type)===k.WEARABLE&&t.jsx(H,{label:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"overrides-label-panel",children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(Ce,{content:r("item_editor.right_panel.outline_compatible.info"),className:"info"})]}),children:t.jsx("div",{className:"right-panel-copyright-section",children:t.jsxs("div",{className:"right-panel-export-protection",children:[t.jsx("span",{children:r("item_editor.right_panel.outline_compatible.title")}),t.jsx(h.Checkbox,{toggle:!0,label:(I==null?void 0:I.outlineCompatible)!==!1?r("item_editor.right_panel.copyright.enabled"):r("item_editor.right_panel.copyright.disabled"),checked:(I==null?void 0:I.outlineCompatible)!==!1,onChange:this.handleAllowOutlineCompatible,"aria-label":r("item_editor.right_panel.outline_compatible.title")})]})})}),t.jsx("div",{className:"edit-buttons-container",children:t.jsxs("div",{className:"edit-buttons",children:[t.jsx(h.Button,{secondary:!0,onClick:this.handleOnResetItem,disabled:!y||x,loading:x,children:r("global.revert")}),t.jsx(Xe,{primary:!0,onClick:this.handleOnSaveItem,network:f.Network.MATIC,disabled:!y||x,loading:x,children:r("global.save")})]})}),i&&e?t.jsxs("p",{className:"danger-text",children:[r("global.error_ocurred"),": ",i]}):null]})]}):null}}):null})}};const mn=()=>{const o=de(),m=Oe(),e=_(C=>ce(C)),s=_(C=>we(C)),a=_(C=>ia(C)),n=_(C=>oa(C)),i=_(C=>et(C)),l=_(C=>la(C)),d=_(C=>ga(C)),p=_(C=>ra(C)),u=_(C=>da(C)),E=_(C=>m?Me(C,m):null),w=_(C=>m&&E&&E.collectionId?Te(C,E.collectionId):null),A=_(C=>{const x=Ca(C),R=Ia(C);return x==null?void 0:x[R]}),j=_(C=>ca(C)),I=_(C=>!E||!e?!1:w?st(C,e,w):pt(E,e)),y=b.useMemo(()=>m?j[m]:null,[m,j]),N=b.useCallback((C,x)=>o(ha(C,x)),[o]),D=b.useCallback(C=>o(nt(C)),[o]),T=b.useCallback((C,x)=>o(at(C,x)),[o]),g=b.useCallback(C=>o(ma(C)),[o]);return t.jsx(hn,{address:e,collection:w,selectedItem:E,selectedItemId:m,canEditSelectedItem:I,itemStatus:y,error:a,isConnected:s,isDownloading:n,isCommitteeMember:i,isCampaignEnabled:l,campaignTag:d,campaignName:A,isVrmOptOutEnabled:p,isWearableUtilityEnabled:u,onSaveItem:N,onDeleteItem:D,onOpenModal:T,onDownload:g})},pn=mn;class wn extends b.PureComponent{constructor(){super(...arguments);c(this,"state",{reviewedItems:[]});c(this,"handleOnSetReviewedItems",e=>{this.setState(s=>({reviewedItems:[...s.reviewedItems,...e.filter(a=>!s.reviewedItems.some(n=>n.id===a.id))]}))});c(this,"handleResetReviewedItems",()=>{this.setState({reviewedItems:[]})})}render(){const{reviewedItems:e}=this.state;return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"ItemEditorPage",children:[t.jsx(Na,{reviewedItems:e}),t.jsxs("div",{className:"content",children:[t.jsx(Ga,{reviewedItems:e,onResetReviewedItems:this.handleResetReviewedItems,onSetReviewedItems:this.handleOnSetReviewedItems}),t.jsx(Ka,{}),t.jsx(pn,{})]})]})})}}export{wn as default};
@@ -0,0 +1 @@
1
+ ._container_12bci_1{background-color:var(--dark-two);border-radius:10px;padding:22px}._container_12bci_1 ._used_12bci_7{font-weight:600;font-size:16px;margin-bottom:8px}._container_12bci_1 ._description_12bci_13{color:#cfcdd4;font-size:14px;font-weight:400;margin-bottom:12px}._container_12bci_1 ._description_12bci_13 ._link_12bci_20{color:#fff;cursor:pointer;text-decoration:underline;font-weight:700}._container_12bci_1 ._space_12bci_27{display:flex;align-items:center;gap:1rem}._container_12bci_1 ._space_12bci_27 ._current_12bci_33{flex:1;font-size:1.5rem}._container_12bci_1 ._space_12bci_27 ._bar_12bci_38{flex:1;margin-bottom:0!important;background-color:#a09ba8!important}._container_12bci_1 ._space_12bci_27 ._bar_12bci_38.ui.progress .bar{background-color:#ff2d55}._worldUrl_1sb6i_1{display:flex;width:100%;justify-content:space-between}._rightContainer_1sb6i_7{display:flex;align-items:center;margin-right:20px}._rightContainer_1sb6i_7 ._copyUrn_1sb6i_13{color:var(--text)}.WorldListPage .filters{margin-bottom:16px}.WorldListPage .filters .ui.header.items-count,.WorldListPage .ui.table>thead>tr th{color:var(--text)}.WorldListPage .TableRow{cursor:default}.WorldListPage .empty-names-container{display:flex;flex-direction:column;text-align:center}.WorldListPage .empty-names-container .empty-icon{margin-bottom:30px;height:87px;width:87px}.WorldListPage .empty-names-container .empty-icon.dcl-icon{background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.19.0/assets/dcl-empty-state-icon-BDDqmD-V.svg)}.WorldListPage .empty-names-container .empty-icon.ens-icon{background-image:url("data:image/svg+xml,%3csvg%20width='87'%20height='87'%20viewBox='0%200%2087%2087'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='43.5'%20cy='43.5'%20r='43.5'%20fill='white'/%3e%3cg%20clip-path='url(%23clip0_119_22392)'%3e%3cpath%20d='M22.9004%2037.517C23.5096%2038.8466%2025.0327%2041.5058%2025.0327%2041.5058L42.4718%2011.8638L25.4896%2024.0647C24.4996%2024.7686%2023.6619%2025.7071%2023.0527%2026.8021C21.4534%2030.1652%2021.4534%2034.0757%2022.9004%2037.517Z'%20fill='url(%23paint0_linear_119_22392)'/%3e%3cpath%20d='M16.0466%2047.215C16.4274%2052.9244%2019.2451%2058.2427%2023.662%2061.684L42.4719%2075.1363C42.4719%2075.1363%2030.6681%2057.6952%2020.7681%2040.3324C19.7781%2038.5335%2019.0928%2036.5%2018.7881%2034.3884C18.6358%2033.4498%2018.6358%2032.5113%2018.7881%2031.5728C18.5597%2032.042%2018.0266%2033.0588%2018.0266%2033.0588C17.0366%2035.1705%2016.3512%2037.4386%2015.9705%2039.7849C15.742%2042.2877%2015.742%2044.7904%2016.0466%2047.215Z'%20fill='%23A0A8D4'/%3e%3cpath%20d='M64.0234%2049.5615C63.4141%2048.2319%2061.8911%2045.5728%2061.8911%2045.5728L44.4519%2075.1365L61.5103%2063.0138C62.5003%2062.3099%2063.338%2061.3714%2063.9472%2060.2764C65.4703%2056.9134%2065.5464%2053.0028%2064.0234%2049.5615Z'%20fill='url(%23paint1_linear_119_22392)'/%3e%3cpath%20d='M70.9534%2039.7851C70.5726%2034.0757%2067.7549%2028.7574%2063.338%2025.3161L44.5281%2011.8638C44.5281%2011.8638%2056.3319%2029.3048%2066.2318%2046.6677C67.2218%2048.4665%2067.9072%2050.5%2068.2118%2052.6117C68.3641%2053.5503%2068.3641%2054.4888%2068.2118%2055.4273C68.4403%2054.9581%2068.9734%2053.9413%2068.9734%2053.9413C69.9634%2051.8296%2070.6487%2049.5615%2071.0295%2047.2934C71.1818%2044.7124%2071.1818%2042.2879%2070.9534%2039.7851Z'%20fill='%23A0A8D4'/%3e%3cpath%20d='M23.0535%2026.8021C23.6627%2025.7071%2024.4242%2024.7686%2025.4904%2024.0647L42.4726%2011.8638L25.0335%2041.4275C25.0335%2041.4275%2023.5104%2038.7684%2022.9012%2037.4388C21.4543%2034.0757%2021.4543%2030.1652%2023.0535%2026.8021ZM16.0474%2047.2152C16.4281%2052.9246%2019.2458%2058.2429%2023.6627%2061.6842L42.4726%2075.1365C42.4726%2075.1365%2030.6688%2057.6954%2020.7689%2040.3326C19.7789%2038.5337%2019.0935%2036.5002%2018.7889%2034.3885C18.6366%2033.45%2018.6366%2032.5115%2018.7889%2031.573C18.5604%2032.0422%2018.0273%2033.059%2018.0273%2033.059C17.0373%2035.1707%2016.352%2037.4388%2015.9712%2039.7851C15.7427%2042.2879%2015.7427%2044.7906%2016.0474%2047.2152ZM64.0241%2049.5615C63.4149%2048.2319%2061.8918%2045.5727%2061.8918%2045.5727L44.4526%2075.1365L61.511%2063.0138C62.501%2062.3099%2063.3387%2061.3714%2063.9479%2060.2764C65.471%2056.9133%2065.5472%2053.0028%2064.0241%2049.5615ZM70.8779%2039.8633C70.4972%2034.1539%2067.6795%2028.8356%2063.2626%2025.3943L44.5288%2011.8638C44.5288%2011.8638%2056.3326%2029.3048%2066.2325%2046.6677C67.2225%2048.4665%2067.9079%2050.5%2068.2125%2052.6117C68.3649%2053.5503%2068.3649%2054.4888%2068.2125%2055.4273C68.441%2054.958%2068.9741%2053.9413%2068.9741%2053.9413C69.9641%2051.8296%2070.6495%2049.5615%2071.0302%2047.2934C71.1825%2044.7124%2071.1825%2042.2879%2070.8779%2039.8633Z'%20fill='url(%23paint2_linear_119_22392)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_119_22392'%20x1='43.265'%20y1='12.6053'%20x2='20.2441'%20y2='36.9051'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.58'%20stop-color='%23A0A8D4'/%3e%3cstop%20offset='0.73'%20stop-color='%238791C7'/%3e%3cstop%20offset='0.91'%20stop-color='%236470B4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_119_22392'%20x1='43.735'%20y1='74.4471'%20x2='66.7471'%20y2='50.1648'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.58'%20stop-color='%23A0A8D4'/%3e%3cstop%20offset='0.73'%20stop-color='%238791C7'/%3e%3cstop%20offset='0.91'%20stop-color='%236470B4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_119_22392'%20x1='43.4798'%20y1='11.551'%20x2='43.4798'%20y2='75.3711'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23513EFF'/%3e%3cstop%20offset='0.18'%20stop-color='%235157FF'/%3e%3cstop%20offset='0.57'%20stop-color='%235298FF'/%3e%3cstop%20offset='1'%20stop-color='%2352E5FF'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_119_22392'%3e%3crect%20width='55.3636'%20height='63.2727'%20fill='white'%20transform='translate(15.8181%2011.8638)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")}.WorldListPage .empty-names-container .empty-title{font-size:24px;font-weight:600;line-height:29px;color:var(--text)}.WorldListPage .empty-names-container .empty-description{font-size:14px;font-weight:500;line-height:24px;color:var(--text);max-width:612px}.WorldListPage .empty-names-container .empty-action{margin-top:40px;width:372px}.WorldListPage .Icon.right-round-arrow{margin-bottom:-2px}.WorldListPage .TableRow .dcl.column.subdomain-wrapper{display:flex;flex:none;flex-direction:row}.WorldListPage .TableRow .empty-url{color:#fffc;font-style:italic}.WorldListPage .TableRow .publish-scene{display:flex;width:100%;justify-content:space-between;align-items:center}.WorldListPage .TableRow .publish-scene span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100px}.WorldListPage .TableRow .publish-scene button{margin-right:20px;width:168px}.WorldListPage .TableRow .world-status.active{color:#34ce76}.WorldListPage .TableRow .world-status.inactive{color:#cfcdd4}.WorldListPage .TableRow .world-status.warning{color:var(--danger)}.WorldListPage .TableRow .world-status.blocked{color:var(--error)}.WorldListPage .ui.pagination{width:100%;display:flex;justify-content:center}.WorldListPage .ui.pagination .item[type=nextItem],.WorldListPage .ui.pagination .item[type=prevItem]{position:absolute;background-color:var(--secondary)}.WorldListPage .ui.pagination .item[type=prevItem]{left:0}.WorldListPage .ui.pagination .item[type=nextItem]{right:0}.WorldListPage .pagination-section{width:100%}.WorldListPage .ui.sub.header.items-count{flex:1 0 auto;text-transform:uppercase;font-size:13px;line-height:18px;font-weight:500}.WorldListPage .actions{display:flex;flex:1 0 auto;align-items:center;justify-content:flex-end;font-size:13px;line-height:18px;text-transform:uppercase}.WorldListPage .actions .ui.button.basic{width:16px;height:16px;box-sizing:content-box;padding:5px 10px;border-radius:4px;border:solid 1px var(--gray)}.WorldListPage .claim-name .Icon{display:block}.WorldListPage .ui.dropdown{margin-right:20px}.WorldListPage .worlds-storage{margin-bottom:24px}.WorldListPage .insufficient-storage-message{display:flex;align-items:center;gap:1rem;background-color:var(--dark-two);border-radius:10px;padding:22px;margin-bottom:24px}
@@ -0,0 +1 @@
1
+ .ItemCard .image-wrapper{display:flex;align-items:center;text-align:center}.ItemCard .content{background:none;margin-top:16px;text-align:center}.ItemCard .content .text{font-size:17px;max-width:248px;overflow:hidden;text-overflow:ellipsis}.ItemCard .subtitle{margin-top:5px;color:var(--secondary-text)}.ui.cards>.ui.card.link.ItemCard.is-dragging{transform:translateY(0);border:1px solid var(--primary)!important}.ItemCard.is-dragging .ItemImage{border:1px solid var(--primary)}.ItemCard:hover .options-dropdown.ui.dropdown>.dropdown.icon{visibility:visible}.ItemCard .options-dropdown.ui.dropdown>.dropdown.icon{visibility:hidden}@media (max-width: 1200px){.ItemCard .content .text{max-width:215px}}._ItemRow_xmdia_1:hover{background-color:#24212966;color:var(--text);cursor:pointer}._image_xmdia_7{width:64px;height:64px;margin-right:10px;border-radius:8px;overflow:hidden;flex:none}._image_xmdia_7 img{width:100%;height:100%}._name_xmdia_21{display:inline-block;margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._title_xmdia_29,._imageColumn_xmdia_30{display:flex;align-items:center}._published_xmdia_35{color:var(--light-blue-raw)}.CollectionCard .content{margin-top:16px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}.CollectionCard .content .text{font-size:17px;max-width:248px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CollectionCard .subtitle{margin-top:5px;max-width:248px;color:var(--secondary-text)}.CollectionCard .CollectionBadge{margin-left:5px}.CollectionCard .sparkles{width:54px;height:56px;margin-bottom:5px;background-image:url(https://cdn.decentraland.org/@dcl/builder-site/7.19.0/assets/sparkles-C-WJN0Gh.svg);background-repeat:no-repeat}.CollectionCard.is-over .CollectionImage{border:1px solid var(--primary)!important}.CollectionCard .empty-collection-options .icon:before{color:var(--text)!important}.CollectionCard:hover .options-dropdown.ui.dropdown>.dropdown.icon{visibility:visible}.CollectionCard .options-dropdown.ui.dropdown>.dropdown.icon{visibility:hidden}.CollectionCard .pending-migration{text-transform:uppercase;padding:4px 8px;border-radius:32px;display:inline-flex;align-items:center;gap:4px;color:#ffbc5b;background-color:#ffbc5b33;margin-top:16px}.CollectionCard .pending-migration .icon{height:18px}@media (max-width: 1200px){.CollectionCard .content .text{max-width:215px}}.delete-collection-confirm .header{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._CollectionRow_k7d4q_1:hover{background-color:#24212966;color:var(--text);cursor:pointer}._image_k7d4q_7{width:64px;height:64px;margin-right:10px;border-radius:8px;overflow:hidden;flex:none}._name_k7d4q_16{display:inline-block;margin-left:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._title_k7d4q_24,._imageColumn_k7d4q_25{display:flex;align-items:center}._published_k7d4q_30{color:var(--light-blue-raw)}.CollectionsPage .ui.cards{margin:0}.CollectionsPage .empty{margin-top:28px;padding:112px 0;width:100%;border-radius:8px;border:1px solid var(--divider);justify-content:center;color:var(--secondary-text);text-align:center;line-height:28px;font-size:17px}.CollectionsPage .empty .header.title{margin:0}.CollectionsPage .empty .empty-description{margin:8px auto 34px;width:500px}.CollectionsPage .empty .create-new-wrapper{display:flex;justify-content:center}.CollectionsPage .empty .create-new{width:240px;height:204px;position:relative;background-color:rgba(var(--bluish-steel-raw),.16);border-radius:8px;background-position:50% 35%;cursor:pointer}.CollectionsPage .empty .create-new:first-child{margin-right:24px}.CollectionsPage .empty .create-new>.text{position:absolute;flex:1 1;color:#fff;bottom:31px;width:100%}.CollectionsPage .empty .create-new-item{background-image:url("data:image/svg+xml,%3csvg%20width='96'%20height='70'%20viewBox='0%200%2096%2070'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M94.7941%2054.5156H74.6855L79.6698%205.31259C79.6698%203.69125%2077.9661%202.41876%2069.6516%201.4775C64.084%200.847025%2056.4659%200.5%2048.201%200.5C39.9361%200.5%2032.318%200.847025%2026.7498%201.4775C18.4353%202.41876%2016.7316%203.69125%2016.7316%205.31259L21.7303%2054.5156H1.20588C0.53989%2054.5156%200%2055.0595%200%2055.7304C0%2057.5657%201.48584%2059.3693%204.41633%2061.0912C6.95671%2062.5838%2010.6085%2064.027%2014.9768%2065.2659C24.4687%2067.9566%2036.5783%2069.5%2048.201%2069.5C59.8068%2069.5%2071.8444%2067.9562%2081.2276%2065.2648C85.5422%2064.0272%2089.1474%2062.5826%2091.6534%2061.087C94.5377%2059.366%2096%2057.5641%2096%2055.7304C96%2055.0595%2095.4601%2054.5156%2094.7941%2054.5156ZM28.2371%203.76191C33.5781%203.22518%2040.6681%202.92958%2048.201%202.92958C55.7339%202.92958%2062.8239%203.22518%2068.1649%203.76191C73.4374%204.29176%2075.7292%204.92365%2076.6979%205.31239C75.7296%205.70071%2073.4378%206.3324%2068.1637%206.86185C62.8231%207.39818%2055.7335%207.69357%2048.201%207.69357C40.6685%207.69357%2033.5799%207.39798%2028.2375%206.86124C22.9668%206.3318%2020.6744%205.70051%2019.7047%205.31218C20.6738%204.92325%2022.9656%204.29176%2028.2371%203.76191ZM20.2817%208.04769C19.9589%207.96103%2019.6639%207.87195%2019.3895%207.78023L22.8556%2041.7797C25.5439%2042.0648%2028.2326%2042.3092%2030.8623%2042.5027C31.5103%2042.549%2032.0054%2043.104%2031.9822%2043.758C31.9589%2044.4121%2031.4255%2044.9299%2030.7758%2044.9293C30.7469%2044.9293%2030.7165%2044.9281%2030.6866%2044.9258C28.1961%2044.7424%2025.6531%2044.5138%2023.1074%2044.2492L24.1662%2054.633C40.9818%2056.5169%2055.4425%2056.5169%2072.2488%2054.633L73.3112%2044.2097C64.9039%2045.1073%2056.4558%2045.5605%2048.0014%2045.5676C44.0282%2045.5676%2040.0619%2045.4656%2036.0803%2045.2619C35.4151%2045.2279%2034.9033%2044.6572%2034.937%2043.9871C34.9708%2043.317%2035.5373%2042.8014%2036.2025%2042.8354C48.6658%2043.465%2061.159%2043.0979%2073.5646%2041.7374L77.0249%207.77658C76.75%207.86891%2076.4539%207.9588%2076.1301%208.04586C74.5092%208.48157%2072.236%208.8624%2069.3734%209.17744C63.8348%209.78726%2056.3155%2010.1232%2048.201%2010.1232C40.0939%2010.1232%2032.5784%209.78747%2027.0392%209.17805C24.1777%208.86321%2021.9042%208.48278%2020.2817%208.04769ZM80.5678%2062.928C71.3902%2065.56%2059.5933%2067.0704%2048.2016%2067.0704C36.7904%2067.0704%2024.9189%2065.5602%2015.6308%2062.9272C7.79601%2060.7059%204.28067%2058.4424%203.01068%2056.9452H22.9981L23.2493%2056.9737C40.7442%2058.9781%2055.669%2058.9781%2073.1554%2056.9757L73.4183%2056.9452H93.0339C91.6488%2058.6329%2087.6232%2060.9042%2080.5672%2062.928H80.5678ZM42.7852%2028.6841L41.9678%2033.4888C41.8902%2033.9446%2042.0762%2034.4052%2042.4475%2034.677C42.8189%2034.9488%2043.3112%2034.9846%2043.7175%2034.7694L48%2032.5014L52.2825%2034.769C52.6888%2034.9842%2053.1811%2034.9484%2053.5525%2034.6766C53.9238%2034.4048%2054.1098%2033.9442%2054.0322%2033.4884L53.2148%2028.6837L56.6799%2025.2817C57.0087%2024.9589%2057.1271%2024.4761%2056.9852%2024.0362C56.8433%2023.5964%2056.4658%2023.2759%2056.0115%2023.2095L51.2225%2022.5095L49.0815%2018.1383C48.8784%2017.7235%2048.4591%2017.4609%2048%2017.4609C47.5409%2017.4609%2047.1216%2017.7235%2046.9185%2018.1383L44.7775%2022.5095L39.9885%2023.2095C39.5342%2023.2759%2039.1567%2023.5964%2039.0148%2024.0362C38.8729%2024.4761%2038.9913%2024.9589%2039.3201%2025.2817L42.7852%2028.6841ZM45.7514%2024.8217C46.1443%2024.7642%2046.484%2024.5157%2046.6597%2024.157L48%2021.4205L49.3403%2024.157C49.516%2024.5157%2049.8557%2024.7642%2050.2486%2024.8217L53.2466%2025.2598L51.0774%2027.3902C50.7932%2027.6692%2050.6635%2028.0712%2050.7305%2028.4652L51.2424%2031.4737L48.5611%2030.0536C48.2098%2029.8675%2047.7902%2029.8675%2047.4389%2030.0536L44.7576%2031.4737L45.2695%2028.4652C45.3365%2028.0712%2045.2068%2027.6692%2044.9226%2027.3902L42.7544%2025.2598L45.7514%2024.8217Z'%20fill='white'/%3e%3c/svg%3e");background-repeat:no-repeat}.CollectionsPage .empty .create-new-collection{background-image:url("data:image/svg+xml,%3csvg%20width='80'%20height='68'%20viewBox='0%200%2080%2068'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M41.0076%2012.269L41.0075%2012.2691L41.0168%2012.2788C41.9992%2013.2997%2043.3962%2013.8831%2044.8227%2013.8831H70.143C74.7432%2013.8831%2078.4998%2017.6467%2078.4998%2022.2832L78.4998%2058.0694L78.4998%2058.0761C78.5204%2062.6953%2074.7818%2066.4778%2070.1849%2066.5H70.1792H9.85685C5.25666%2066.5%201.5%2062.7363%201.5%2058.0997V9.90034C1.5%205.26392%205.25664%201.50022%209.85681%201.50036H9.85685L27.0684%201.50038L27.077%201.50033C29.3256%201.48732%2031.5245%202.33413%2033.1219%203.92557L41.0076%2012.269Z'%20stroke='white'%20stroke-width='3'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M58.5227%2046.9194H50.563L52.536%2026.9529C52.536%2026.295%2051.8616%2025.7786%2048.5704%2025.3967C46.3666%2025.1408%2043.3511%2025%2040.0796%2025C36.808%2025%2033.7925%2025.1408%2031.5885%2025.3967C28.2973%2025.7786%2027.6229%2026.295%2027.6229%2026.9529L29.6016%2046.9194H21.4773C21.2137%2046.9194%2021%2047.1401%2021%2047.4123C21%2048.1571%2021.5881%2048.889%2022.7481%2049.5877C23.7537%2050.1934%2025.1992%2050.7791%2026.9283%2051.2818C30.6855%2052.3737%2035.4789%2053%2040.0796%2053C44.6735%2053%2049.4384%2052.3735%2053.1526%2051.2814C54.8605%2050.7791%2056.2875%2050.1929%2057.2795%2049.586C58.4212%2048.8877%2059%2048.1564%2059%2047.4123C59%2047.1401%2058.7863%2046.9194%2058.5227%2046.9194ZM32.1772%2026.3237C34.2913%2026.1059%2037.0978%2025.9859%2040.0796%2025.9859C43.0613%2025.9859%2045.8678%2026.1059%2047.9819%2026.3237C50.069%2026.5387%2050.9761%2026.7951%2051.3596%2026.9529C50.9763%2027.1104%2050.0691%2027.3668%2047.9815%2027.5816C45.8675%2027.7993%2043.0612%2027.9191%2040.0796%2027.9191C37.0979%2027.9191%2034.292%2027.7992%2032.1773%2027.5814C30.091%2027.3665%2029.1836%2027.1104%2028.7998%2026.9528C29.1834%2026.7949%2030.0905%2026.5387%2032.1772%2026.3237ZM29.0282%2028.0628C28.9004%2028.0277%2028.7836%2027.9915%2028.675%2027.9543L30.047%2041.7512C31.1111%2041.8669%2032.1754%2041.966%2033.2163%2042.0446C33.4728%2042.0634%2033.6688%2042.2886%2033.6596%2042.554C33.6504%2042.8194%2033.4392%2043.0295%2033.1821%2043.0293C33.1706%2043.0293%2033.1586%2043.0288%2033.1468%2043.0279C32.1609%2042.9534%2031.1543%2042.8607%2030.1467%2042.7533L30.5658%2046.967C37.222%2047.7315%2042.946%2047.7315%2049.5985%2046.967L50.019%2042.7373C46.6911%2043.1015%2043.3471%2043.2854%2040.0006%2043.2883C38.4278%2043.2883%2036.8578%2043.2469%2035.2818%2043.1643C35.0185%2043.1505%2034.8159%2042.9189%2034.8292%2042.6469C34.8426%2042.375%2035.0669%2042.1658%2035.3302%2042.1796C40.2635%2042.4351%2045.2088%2042.2861%2050.1193%2041.734L51.489%2027.9528C51.3802%2027.9903%2051.263%2028.0268%2051.1348%2028.0621C50.4932%2028.2389%2049.5934%2028.3934%2048.4603%2028.5213C46.2679%2028.7687%2043.2916%2028.905%2040.0796%2028.905C36.8705%2028.905%2033.8956%2028.7688%2031.703%2028.5215C30.5703%2028.3938%2029.6704%2028.2394%2029.0282%2028.0628ZM52.8914%2050.3331C49.2586%2051.4012%2044.589%2052.0141%2040.0798%2052.0141C35.5628%2052.0141%2030.8637%2051.4013%2027.1872%2050.3328C24.0859%2049.4314%2022.6944%2048.5129%2022.1917%2047.9053H30.1034L30.2029%2047.9169C37.1279%2048.7302%2043.0356%2048.7302%2049.9574%2047.9177L50.0614%2047.9053H57.8259C57.2776%2048.5902%2055.6842%2049.5118%2052.8912%2050.3331H52.8914ZM37.9358%2036.437L37.6123%2038.3868C37.5815%2038.5717%2037.6552%2038.7586%2037.8021%2038.8689C37.9491%2038.9792%2038.144%2038.9938%2038.3049%2038.9064L40%2037.9861L41.6951%2038.9063C41.856%2038.9936%2042.0508%2038.979%2042.1978%2038.8688C42.3448%2038.7585%2042.4185%2038.5715%2042.3877%2038.3866L42.0642%2036.4369L43.4358%2035.0563C43.5659%2034.9254%2043.6128%2034.7294%2043.5566%2034.5509C43.5005%2034.3724%2043.351%2034.2424%2043.1712%2034.2154L41.2756%2033.9314L40.4281%2032.1576C40.3477%2031.9893%2040.1817%2031.8827%2040%2031.8827C39.8183%2031.8827%2039.6523%2031.9893%2039.5719%2032.1576L38.7244%2033.9314L36.8288%2034.2154C36.649%2034.2424%2036.4995%2034.3724%2036.4434%2034.5509C36.3872%2034.7294%2036.4341%2034.9254%2036.5642%2035.0563L37.9358%2036.437ZM39.1099%2034.8697C39.2655%2034.8464%2039.3999%2034.7455%2039.4694%2034.5999L40%2033.4895L40.5305%2034.5999C40.6001%2034.7455%2040.7345%2034.8464%2040.8901%2034.8697L42.0768%2035.0475L41.2181%2035.9119C41.1056%2036.0252%2041.0543%2036.1883%2041.0808%2036.3482L41.2835%2037.569L40.2221%2036.9928C40.0831%2036.9173%2039.9169%2036.9173%2039.7779%2036.9928L38.7165%2037.569L38.9192%2036.3482C38.9457%2036.1883%2038.8944%2036.0252%2038.7819%2035.9119L37.9236%2035.0475L39.1099%2034.8697Z'%20fill='white'/%3e%3c/svg%3e");background-repeat:no-repeat}.CollectionsPage .ui.cards .ui.card{width:248px;background-color:transparent;box-shadow:none}.CollectionsPage .card .image-wrapper{height:248px;padding:15px}.CollectionsPage .filters{margin-bottom:20px}.dcl.page.LoggedInDetailPage.CollectionsPage{padding:0 24px}.CollectionsPage .filters .dcl.row.actions .ui.dropdown .ui.button{width:16px;height:16px;box-sizing:content-box;padding:5px 10px;border-radius:4px;border:solid 1px var(--gray)}.CollectionsPage .filters .dcl.row.actions .ui.button.open-editor{display:flex;align-items:center}.CollectionsPage .filters .dcl.row.actions .ui.button.open-editor .Icon{margin-right:6px}.CollectionsPage .filters .dcl.row.actions .ui.button.open-editor:hover{transform:translateY(0)}.CollectionsPage .Chip{padding:4px;height:28px;width:32px}.CollectionsPage .Chip.grid{border-radius:4px 0 0 4px;margin-left:16px}.CollectionsPage .Chip.list{border-radius:0 4px 4px 0}.CollectionsPage .is-card{transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;box-shadow:none;transform:translateY(0)}.CollectionsPage .is-card:nth-child(4n){margin-right:0}.CollectionsPage .is-card:hover{transform:translateY(-4px)}.CollectionsPage .is-card .is-image{aspect-ratio:1 / 1;transition:box-shadow .2s ease-in-out;width:100%;overflow:hidden;border-radius:8px!important}.CollectionsPage .is-card:hover .is-image{box-shadow:var(--shadow-2)}.CollectionsPage .is-card .is-image .is-image{border-radius:0!important;box-shadow:none}.dcl.page.CollectionsPage .ui.container{width:100%;max-width:100%!important}.CollectionsPage .ui.container .ui.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:20px}.CollectionsPage .dcl.tabs.fullscreen .dcl.column.right{float:right;padding:19px 0}.CollectionsPage .pagination{width:100%;display:flex;justify-content:center;margin-top:16px}.CollectionsPage .ui.pagination.menu{margin-top:16px}.CollectionsPage .dcl.tabs .ui.container{margin-bottom:20px}.CollectionsPage .collections-main-actions{display:flex;justify-content:end;gap:20px;min-height:74px}.CollectionsPage .collections-main-actions>:first-child{flex:1}.CollectionsPage .dcl.field .collections-search-field.ui.input input{padding:8px;background:var(--shadows);border-radius:10px;border:none;font-size:16px}.CollectionsPage .collections-main-actions>.actions{align-self:baseline;justify-self:end;flex:none}.CollectionsPage .collections-icon{width:32px;height:32px;margin-bottom:20px}.CollectionsPage .action-tabs-container{display:flex;align-items:center;flex-direction:row;gap:8px}.CollectionsPage .banner-container{margin-bottom:24px}
@@ -1 +1 @@
1
- import{b1 as be,a4 as F,J as n,ak as je,N as e,M as s,Q as de,R as E,dN as me,S as t,T as U,ey as Ie,a2 as he,ez as Se,eA as Z,a7 as Ne,dM as Ce,eB as fe,eC as ue,eD as Re,eE as ce,P as ve,eF as f,bD as oe,eG as w,aM as we,eH as Le,eI as De,eJ as Ee,eK as Ae,eL as Oe,bq as G,eM as Pe,eN as ie,eO as ye,eP as ke,eQ as Me,eR as He,eS as $e,eT as Be,eU as Fe,eV as Ue,eW as Ve,eX as ze}from"./index-y7RTOsaO.js";import{B as qe,c as Ge,N as Ye}from"./Navigation.container-DSufh-bQ.js";import{L as Ze}from"./LoggedInDetailPage.container-CQqfbb0m.js";import{O as ge}from"./OptionsDropdown-DeQXB2g5.js";import{a as B}from"./date-D0HytY9R.js";import{C as _e}from"./CollectionStatus.container-BL0x_fwg.js";import"./selectors-DQU7U9ba.js";import"./SignInRequired-CBz9NAiT.js";import"./index-Bq2oESeB.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:a,pathname:c}=be(),d=F(),r=d.push.bind(d),o=n.useMemo(()=>{var i;return((i=l==null?void 0:l.pageSize)==null?void 0:i.toString())??re.toString()},[l==null?void 0:l.pageSize]),x=n.useMemo(()=>{const i=new URLSearchParams(a);return i.delete("page"),i.delete("first"),i.delete("offset"),i.delete("sortBy"),Object.fromEntries(i.entries())},[a]),u=n.useMemo(()=>new URLSearchParams(a).get("sortBy"),[a])??void 0,[g,b,A]=n.useMemo(()=>{const i=new URLSearchParams(a),_=parseInt(i.get("page")??"1"),p=parseInt(i.get("first")??o),I=(_-1)*p;return[_,p,I]},[o,a]),j=n.useCallback(()=>{const i=new URLSearchParams(a);i.set("page",(g+1).toString()),r(`${c}?${i.toString()}`)},[a,g,r,c]),S=n.useCallback(i=>{const _=new URLSearchParams(a);_.set("page",i.toString()),r(`${c}?${_.toString()}`)},[a,r,c]),O=n.useCallback(i=>{const _=new URLSearchParams(a);_.set("page","1"),_.set("sortBy",i),r(`${c}?${_.toString()}`)},[c,r,a]),V=n.useCallback((i,_,p={clearOldFilters:!1})=>{const I=new URLSearchParams(p.clearOldFilters?{}:a);I.set("page","1"),p.clearOldFilters&&u&&I.set("sortBy",u),I.set(i,_),r(`${c}?${I.toString()}`)},[c,r,a,u]),R=l!=null&&l.count?Math.ceil((l==null?void 0:l.count)/((l==null?void 0:l.pageSize)??re)):void 0,N=R?g<R:void 0;return{page:g,pages:R,hasMorePages:N,first:b,offset:A,sortBy:u,filters:x,goToNextPage:j,goToPage:S,changeSorting:O,changeFilter:V}}const Ke="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%2018H28V28H18V18Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%204H14V14H4V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M18%204H28V14H18V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%2018H14V28H4V18Z'%20fill='%23A09BA8'/%3e%3c/svg%3e",Xe=l=>{const{item:a,onDeleteItem:c,onOpenModal:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{o(!1),c()},[o,c]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ItemCard is-card",children:[e.jsx(ge,{className:"options-dropdown",options:[{text:s("item_card.move_to_collection"),handler:g},{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.itemDetail(a.id),children:[e.jsx(me,{item:a}),e.jsxs(t.Card.Content,{children:[e.jsx("div",{className:"text",title:a.name,children:a.name}),e.jsx("div",{className:"subtitle",children:s(`item.type.${a.type}`)})]})]})]}),e.jsx(t.Confirm,{size:"tiny",open:r,header:s("item_card.confirm_delete_header",{name:a.name}),content:s("item_card.confirm_delete_content",{name:a.name}),confirmButton:e.jsx(t.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(t.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:b})]})},ea=je.memo(Xe),aa=(l,a)=>({onDeleteItem:()=>l(Ie(a.item)),onOpenModal:c=>l(he(c,{item:a.item}))}),ta=U(void 0,aa)(ea),la="_ItemRow_xmdia_1",sa="_image_xmdia_7",na="_name_xmdia_21",ca="_title_xmdia_29",oa="_imageColumn_xmdia_30",ia="_published_xmdia_35",D={ItemRow:la,image:sa,name:na,title:ca,imageColumn:oa,published:ia};function ra(l){const{item:a}=l,c=F(),d=n.useCallback(()=>{c.push(E.itemDetail(a.id))},[c]);return e.jsxs(t.Table.Row,{className:D.ItemRow,onClick:d,children:[e.jsx(t.Table.Cell,{width:4,children:e.jsxs("div",{className:D.imageColumn,children:[e.jsx(me,{className:D.image,item:a}),e.jsxs("div",{className:D.title,children:[e.jsx(Se,{item:a}),e.jsx("div",{className:D.name,children:a.name})]})]})}),e.jsx(t.Table.Cell,{width:3,children:B(a.createdAt,{addSuffix:!0})}),e.jsx(t.Table.Cell,{width:3,children:B(a.updatedAt,{addSuffix:!0})})]})}const da=l=>{const{collection:a,onDeleteCollection:c,itemCount:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>{o(!1),c()},[o,c]),b=Z(a);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"CollectionCard is-card",children:[!a.isPublished&&e.jsx(ge,{className:Ne({"empty-collection-options":d===0},"options-dropdown"),options:[{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.collectionDetail(a.id,b),children:[e.jsx(Ce,{collectionId:a.id}),e.jsxs(t.Card.Content,{children:[e.jsxs("div",{className:"text",title:a.name,children:[e.jsx(_e,{collection:a})," ",a.name]}),e.jsxs("div",{className:"subtitle",children:[s(`collection.type.${b}`)," · ",s("collection_card.item_count",{count:d})]}),!a.isMappingComplete&&fe(a.urn)&&e.jsxs("div",{className:"pending-migration",children:[e.jsx(t.Icon,{name:"warning circle"})," ",s("item_status.pending_migration")]})]})]})]}),e.jsx(t.Confirm,{size:"tiny",open:r,header:s("collection_card.confirm_delete_header",{name:a.name}),content:s("collection_card.confirm_delete_content",{name:a.name}),confirmButton:e.jsx(t.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(t.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:g,className:"delete-collection-confirm"})]})},ma=n.memo(da),ha=(l,a)=>({itemCount:ue(l,a.collection.id)}),Ca=(l,a)=>({onDeleteCollection:()=>l(Re(a.collection))}),ua=U(ha,Ca)(ma),ga="_CollectionRow_k7d4q_1",_a="_image_k7d4q_7",xa="_name_k7d4q_16",pa="_title_k7d4q_24",Ta="_imageColumn_k7d4q_25",ba="_published_k7d4q_30",L={CollectionRow:ga,image:_a,name:xa,title:pa,imageColumn:Ta,published:ba};function ja(l){const{collection:a,itemCount:c}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(a.id,Z(a)))},[d]),o=Z(a);return e.jsxs(t.Table.Row,{className:L.CollectionRow,onClick:r,children:[e.jsx(t.Table.Cell,{width:3,children:e.jsxs("div",{className:L.imageColumn,children:[e.jsx(Ce,{className:L.image,collectionId:a.id}),e.jsxs("div",{className:L.title,children:[e.jsx(_e,{collection:a}),e.jsx("div",{className:L.name,children:a.name})]})]})}),e.jsx(t.Table.Cell,{width:3,children:s(`collection.type.${o}`)}),e.jsx(t.Table.Cell,{width:2,children:c}),e.jsx(t.Table.Cell,{width:3,children:B(a.createdAt,{addSuffix:!0})}),e.jsx(t.Table.Cell,{width:3,children:B(a.updatedAt,{addSuffix:!0})}),e.jsx(t.Table.Cell,{width:3,children:a.isPublished?e.jsxs("div",{className:L.published,children:[s("global.published")," ",e.jsx(t.Icon,{name:"check"})]}):null})]})}const Ia=(l,a)=>({itemCount:ue(l,a.collection.id)}),Sa=U(Ia)(ja);var m=(l=>(l.STANDARD_COLLECTIONS="standard_collections",l.THIRD_PARTY_COLLECTIONS="third_party_collections",l.ITEMS="orphan_items",l))(m||{});const Y=20;function Na(l){const{address:a,items:c,collections:d,view:r,collectionsPaginationData:o,itemsPaginationData:x,hasUserOrphanItems:u,isLoadingItems:g,isLoadingCollections:b,isLoadingOrphanItem:A,isLinkedWearablesPaymentsEnabled:j,isThirdPartyManager:S,onFetchCollections:O,onFetchOrphanItem:V,onFetchOrphanItems:R,onOpenModal:N,onSetView:i}=l,_=F(),{page:p,pages:I,goToPage:Q,filters:P,changeFilter:y,sortBy:k,changeSorting:W}=Je({pageSize:Y,count:o==null?void 0:o.total}),h=P.section??m.STANDARD_COLLECTIONS,M=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS,[J,xe]=n.useState(P.search??""),H=n.useRef(null);n.useEffect(()=>{u===void 0&&a&&V(a)},[a,u]),n.useEffect(()=>{a&&(h===m.ITEMS?R(a,{page:p,limit:Y}):O(a,{page:p,limit:Y,q:P.search??void 0,type:h===m.STANDARD_COLLECTIONS?ce.STANDARD:ce.THIRD_PARTY,sort:k}))},[a,p,h,P.search,k,R,O]);const pe=n.useCallback(()=>{N("CreateThirdPartyCollectionModal")},[N]),$=n.useCallback(()=>{N(j?"CreateCollectionSelectorModal":"CreateCollectionModal")},[N,j]),K=n.useCallback((C,T)=>{xe(T.value),H.current&&(clearTimeout(H.current),H.current=null),H.current=setTimeout(()=>{y("search",T.value)},500)},[y]),X=n.useCallback(()=>{_.push(E.itemEditor())},[_]),ee=n.useCallback((C,{value:T})=>{W(T)},[W]),z=n.useCallback(C=>{h!==C&&y("section",C)},[a,h,y]),ae=n.useCallback(()=>e.jsx(t.Card.Group,{children:M?d.map((C,T)=>e.jsx(ua,{collection:C},T)):g?e.jsx(t.Loader,{size:"large",active:!0}):c.map((C,T)=>e.jsx(ta,{item:C},T))}),[c,d,g,M,h]),te=n.useCallback(()=>M?e.jsx(t.Section,{children:e.jsxs(t.Table,{basic:"very",children:[e.jsx(t.Table.Header,{children:e.jsxs(t.Table.Row,{children:[e.jsx(t.Table.HeaderCell,{children:s("collections_page.collection")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.type")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.items")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.last_modified")}),e.jsx(t.Table.HeaderCell,{})]})}),e.jsx(t.Table.Body,{children:d.map(C=>e.jsx(Sa,{collection:C},C.id))})]})}):e.jsx(t.Section,{children:e.jsxs(t.Table,{basic:"very",children:[e.jsx(t.Table.Header,{children:e.jsxs(t.Table.Row,{children:[e.jsx(t.Table.HeaderCell,{children:s("global.item")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.last_modified")})]})}),e.jsx(t.Table.Body,{children:c.map(C=>e.jsx(ra,{item:C},C.id))})]})}),[c,d,M]),le=n.useCallback((C,T)=>{p!==T.activePage&&Q(Number(T.activePage))},[p,Q]),se=n.useCallback(()=>e.jsxs("div",{className:"collections-main-actions",children:[h!==m.ITEMS&&e.jsx(t.Field,{placeholder:s("itemdrawer.search_items"),className:"collections-search-field",input:{icon:"search"},onChange:K,icon:e.jsx(t.Icon,{name:"search",className:"searchIcon"}),iconPosition:"left",value:J,isClearable:!0}),e.jsxs(t.Row,{className:"actions",grow:!1,children:[S&&!j&&e.jsx(t.Button,{className:"action-button",size:"small",basic:!0,onClick:pe,children:s("collections_page.new_third_party_collection")}),e.jsxs(t.Button,{className:"action-button open-editor",size:"small",basic:!0,onClick:X,children:[e.jsx(ve,{name:"cube"}),s("item_editor.open")]}),e.jsxs(t.Button,{className:"action-button",size:"small",primary:!0,onClick:$,children:[e.jsx(t.Icon,{name:"plus square"})," ",s("collections_page.new_collection")]})]})]}),[J,S,j,K,X,$]),ne=n.useCallback(()=>e.jsx(t.Column,{align:"right",children:e.jsxs(t.Row,{className:"actions",children:[h===m.STANDARD_COLLECTIONS||m.THIRD_PARTY_COLLECTIONS&&e.jsx(t.Dropdown,{direction:"left",value:k,options:[{value:f.MOST_RELEVANT,text:s("curation_page.order.most_relevant")},{value:f.CREATED_AT_DESC,text:s("global.order.newest")},{value:f.CREATED_AT_ASC,text:s("global.order.oldest")},{value:f.UPDATED_AT_DESC,text:s("global.order.updated_at_desc")},{value:f.UPDATED_AT_ASC,text:s("global.order.updated_at_asc")},{value:f.NAME_DESC,text:s("global.order.name_desc")},{value:f.NAME_ASC,text:s("global.order.name_asc")}],onChange:ee}),e.jsx(oe,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(oe,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=o==null?void 0:o.total,T=x==null?void 0:x.total,v=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?C:T,q=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?I:x==null?void 0:x.totalPages;return A?e.jsx(t.Loader,{active:!0,size:"large"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"banner-container",children:e.jsx(qe,{id:Ge})}),e.jsx("div",{className:"filters",children:e.jsxs(t.Container,{children:[(u||S||j)&&e.jsxs("div",{className:"action-tabs-container",children:[e.jsx("img",{src:Ke,className:"collections-icon"}),e.jsxs(t.Tabs,{isFullscreen:!0,children:[e.jsx(t.Tabs.Tab,{active:h===m.STANDARD_COLLECTIONS,onClick:()=>z(m.STANDARD_COLLECTIONS),children:s("collections_page.collections")}),(S||j)&&e.jsx(t.Tabs.Tab,{active:h===m.THIRD_PARTY_COLLECTIONS,onClick:()=>z(m.THIRD_PARTY_COLLECTIONS),children:s("collections_page.third_party_collections")}),u&&e.jsx(t.Tabs.Tab,{active:h===m.ITEMS,onClick:()=>z(m.ITEMS),children:s("collections_page.single_items")})]})]}),se(),e.jsxs(t.Row,{height:30,children:[e.jsx(t.Column,{children:e.jsx(t.Row,{children:!g&&!b&&!!v&&v>0&&e.jsx(t.Header,{sub:!0,children:s("collections_page.results",{count:v})})})}),ne()]})]})}),g||b||v===void 0?e.jsx(t.Loader,{active:!0,size:"large"}):v>0?e.jsxs(e.Fragment,{children:[r===w.GRID?ae():r===w.LIST?te():null,!!q&&q>1&&e.jsx(t.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:q,activePage:p,onPageChange:le})]}):e.jsxs("div",{className:"empty",children:[e.jsx(t.Header,{className:"title",size:"large",children:s("collections_page.no_items")}),e.jsx("div",{className:"empty-description",children:s("collections_page.empty_description")}),e.jsx("div",{className:"create-new-wrapper",children:e.jsx("div",{className:"create-new create-new-collection",onClick:$,children:e.jsx("div",{className:"text",children:s("collections_page.new_collection")})})})]})]})},[p,I,o,x,r,u,g,b,A,j,S,le,$,ae,te,ne,se]);return e.jsx(Ze,{className:"CollectionsPage",activeTab:Ye.COLLECTIONS,children:Te()})}const fa=l=>{const a=we(l),c=Le(l),d=a?De(l,a):[],r=a?Ee(l,a):null,o=Ae(l);return{items:d,address:a,collections:c,collectionsPaginationData:o,itemsPaginationData:r,view:We(l),isThirdPartyManager:Oe(l),isLoadingCollections:G(Pe(l),Ue),isLoadingItems:G(ie(l),Ve),isLoadingOrphanItem:G(ie(l),ze),isLinkedWearablesPaymentsEnabled:ye(l),isCampaignEnabled:ke(l),hasUserOrphanItems:Me(l)}},Ra=l=>({onSetView:a=>l(He(a)),onOpenModal:(a,c)=>l(he(a,c)),onFetchOrphanItems:(a,c)=>l($e(a,c)),onFetchCollections:(a,c)=>l(Be(a,c)),onFetchOrphanItem:a=>l(Fe(a))}),ka=U(fa,Ra)(Na);export{ka as default};
1
+ import{b1 as be,a4 as F,J as n,ak as je,N as e,M as s,Q as de,R as E,dN as me,S as t,T as U,ey as Ie,a2 as he,ez as Se,eA as Z,a7 as Ne,dM as Ce,eB as fe,eC as ue,eD as Re,eE as ce,P as ve,eF as f,bD as oe,eG as w,aM as we,eH as Le,eI as De,eJ as Ee,eK as Ae,eL as Oe,bq as G,eM as Pe,eN as ie,eO as ye,eP as ke,eQ as Me,eR as He,eS as $e,eT as Be,eU as Fe,eV as Ue,eW as Ve,eX as ze}from"./index-UD374e2H.js";import{B as qe,c as Ge,N as Ye}from"./Navigation.container-CXL1uNrk.js";import{L as Ze}from"./LoggedInDetailPage.container-BKHHdpyw.js";import{O as ge}from"./OptionsDropdown-w6mo4pkB.js";import{a as B}from"./date-BLHZs3cn.js";import{C as _e}from"./CollectionStatus.container-CB6NpIWJ.js";import"./selectors-A-tGldC4.js";import"./SignInRequired-Dyg4CYup.js";import"./index-5k92toJ3.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:a,pathname:c}=be(),d=F(),r=d.push.bind(d),o=n.useMemo(()=>{var i;return((i=l==null?void 0:l.pageSize)==null?void 0:i.toString())??re.toString()},[l==null?void 0:l.pageSize]),x=n.useMemo(()=>{const i=new URLSearchParams(a);return i.delete("page"),i.delete("first"),i.delete("offset"),i.delete("sortBy"),Object.fromEntries(i.entries())},[a]),u=n.useMemo(()=>new URLSearchParams(a).get("sortBy"),[a])??void 0,[g,b,A]=n.useMemo(()=>{const i=new URLSearchParams(a),_=parseInt(i.get("page")??"1"),p=parseInt(i.get("first")??o),I=(_-1)*p;return[_,p,I]},[o,a]),j=n.useCallback(()=>{const i=new URLSearchParams(a);i.set("page",(g+1).toString()),r(`${c}?${i.toString()}`)},[a,g,r,c]),S=n.useCallback(i=>{const _=new URLSearchParams(a);_.set("page",i.toString()),r(`${c}?${_.toString()}`)},[a,r,c]),O=n.useCallback(i=>{const _=new URLSearchParams(a);_.set("page","1"),_.set("sortBy",i),r(`${c}?${_.toString()}`)},[c,r,a]),V=n.useCallback((i,_,p={clearOldFilters:!1})=>{const I=new URLSearchParams(p.clearOldFilters?{}:a);I.set("page","1"),p.clearOldFilters&&u&&I.set("sortBy",u),I.set(i,_),r(`${c}?${I.toString()}`)},[c,r,a,u]),R=l!=null&&l.count?Math.ceil((l==null?void 0:l.count)/((l==null?void 0:l.pageSize)??re)):void 0,N=R?g<R:void 0;return{page:g,pages:R,hasMorePages:N,first:b,offset:A,sortBy:u,filters:x,goToNextPage:j,goToPage:S,changeSorting:O,changeFilter:V}}const Ke="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%2018H28V28H18V18Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%204H14V14H4V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M18%204H28V14H18V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%2018H14V28H4V18Z'%20fill='%23A09BA8'/%3e%3c/svg%3e",Xe=l=>{const{item:a,onDeleteItem:c,onOpenModal:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{o(!1),c()},[o,c]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ItemCard is-card",children:[e.jsx(ge,{className:"options-dropdown",options:[{text:s("item_card.move_to_collection"),handler:g},{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.itemDetail(a.id),children:[e.jsx(me,{item:a}),e.jsxs(t.Card.Content,{children:[e.jsx("div",{className:"text",title:a.name,children:a.name}),e.jsx("div",{className:"subtitle",children:s(`item.type.${a.type}`)})]})]})]}),e.jsx(t.Confirm,{size:"tiny",open:r,header:s("item_card.confirm_delete_header",{name:a.name}),content:s("item_card.confirm_delete_content",{name:a.name}),confirmButton:e.jsx(t.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(t.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:b})]})},ea=je.memo(Xe),aa=(l,a)=>({onDeleteItem:()=>l(Ie(a.item)),onOpenModal:c=>l(he(c,{item:a.item}))}),ta=U(void 0,aa)(ea),la="_ItemRow_xmdia_1",sa="_image_xmdia_7",na="_name_xmdia_21",ca="_title_xmdia_29",oa="_imageColumn_xmdia_30",ia="_published_xmdia_35",D={ItemRow:la,image:sa,name:na,title:ca,imageColumn:oa,published:ia};function ra(l){const{item:a}=l,c=F(),d=n.useCallback(()=>{c.push(E.itemDetail(a.id))},[c]);return e.jsxs(t.Table.Row,{className:D.ItemRow,onClick:d,children:[e.jsx(t.Table.Cell,{width:4,children:e.jsxs("div",{className:D.imageColumn,children:[e.jsx(me,{className:D.image,item:a}),e.jsxs("div",{className:D.title,children:[e.jsx(Se,{item:a}),e.jsx("div",{className:D.name,children:a.name})]})]})}),e.jsx(t.Table.Cell,{width:3,children:B(a.createdAt,{addSuffix:!0})}),e.jsx(t.Table.Cell,{width:3,children:B(a.updatedAt,{addSuffix:!0})})]})}const da=l=>{const{collection:a,onDeleteCollection:c,itemCount:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>{o(!1),c()},[o,c]),b=Z(a);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"CollectionCard is-card",children:[!a.isPublished&&e.jsx(ge,{className:Ne({"empty-collection-options":d===0},"options-dropdown"),options:[{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.collectionDetail(a.id,b),children:[e.jsx(Ce,{collectionId:a.id}),e.jsxs(t.Card.Content,{children:[e.jsxs("div",{className:"text",title:a.name,children:[e.jsx(_e,{collection:a})," ",a.name]}),e.jsxs("div",{className:"subtitle",children:[s(`collection.type.${b}`)," · ",s("collection_card.item_count",{count:d})]}),!a.isMappingComplete&&fe(a.urn)&&e.jsxs("div",{className:"pending-migration",children:[e.jsx(t.Icon,{name:"warning circle"})," ",s("item_status.pending_migration")]})]})]})]}),e.jsx(t.Confirm,{size:"tiny",open:r,header:s("collection_card.confirm_delete_header",{name:a.name}),content:s("collection_card.confirm_delete_content",{name:a.name}),confirmButton:e.jsx(t.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(t.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:g,className:"delete-collection-confirm"})]})},ma=n.memo(da),ha=(l,a)=>({itemCount:ue(l,a.collection.id)}),Ca=(l,a)=>({onDeleteCollection:()=>l(Re(a.collection))}),ua=U(ha,Ca)(ma),ga="_CollectionRow_k7d4q_1",_a="_image_k7d4q_7",xa="_name_k7d4q_16",pa="_title_k7d4q_24",Ta="_imageColumn_k7d4q_25",ba="_published_k7d4q_30",L={CollectionRow:ga,image:_a,name:xa,title:pa,imageColumn:Ta,published:ba};function ja(l){const{collection:a,itemCount:c}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(a.id,Z(a)))},[d]),o=Z(a);return e.jsxs(t.Table.Row,{className:L.CollectionRow,onClick:r,children:[e.jsx(t.Table.Cell,{width:3,children:e.jsxs("div",{className:L.imageColumn,children:[e.jsx(Ce,{className:L.image,collectionId:a.id}),e.jsxs("div",{className:L.title,children:[e.jsx(_e,{collection:a}),e.jsx("div",{className:L.name,children:a.name})]})]})}),e.jsx(t.Table.Cell,{width:3,children:s(`collection.type.${o}`)}),e.jsx(t.Table.Cell,{width:2,children:c}),e.jsx(t.Table.Cell,{width:3,children:B(a.createdAt,{addSuffix:!0})}),e.jsx(t.Table.Cell,{width:3,children:B(a.updatedAt,{addSuffix:!0})}),e.jsx(t.Table.Cell,{width:3,children:a.isPublished?e.jsxs("div",{className:L.published,children:[s("global.published")," ",e.jsx(t.Icon,{name:"check"})]}):null})]})}const Ia=(l,a)=>({itemCount:ue(l,a.collection.id)}),Sa=U(Ia)(ja);var m=(l=>(l.STANDARD_COLLECTIONS="standard_collections",l.THIRD_PARTY_COLLECTIONS="third_party_collections",l.ITEMS="orphan_items",l))(m||{});const Y=20;function Na(l){const{address:a,items:c,collections:d,view:r,collectionsPaginationData:o,itemsPaginationData:x,hasUserOrphanItems:u,isLoadingItems:g,isLoadingCollections:b,isLoadingOrphanItem:A,isLinkedWearablesPaymentsEnabled:j,isThirdPartyManager:S,onFetchCollections:O,onFetchOrphanItem:V,onFetchOrphanItems:R,onOpenModal:N,onSetView:i}=l,_=F(),{page:p,pages:I,goToPage:Q,filters:P,changeFilter:y,sortBy:k,changeSorting:W}=Je({pageSize:Y,count:o==null?void 0:o.total}),h=P.section??m.STANDARD_COLLECTIONS,M=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS,[J,xe]=n.useState(P.search??""),H=n.useRef(null);n.useEffect(()=>{u===void 0&&a&&V(a)},[a,u]),n.useEffect(()=>{a&&(h===m.ITEMS?R(a,{page:p,limit:Y}):O(a,{page:p,limit:Y,q:P.search??void 0,type:h===m.STANDARD_COLLECTIONS?ce.STANDARD:ce.THIRD_PARTY,sort:k}))},[a,p,h,P.search,k,R,O]);const pe=n.useCallback(()=>{N("CreateThirdPartyCollectionModal")},[N]),$=n.useCallback(()=>{N(j?"CreateCollectionSelectorModal":"CreateCollectionModal")},[N,j]),K=n.useCallback((C,T)=>{xe(T.value),H.current&&(clearTimeout(H.current),H.current=null),H.current=setTimeout(()=>{y("search",T.value)},500)},[y]),X=n.useCallback(()=>{_.push(E.itemEditor())},[_]),ee=n.useCallback((C,{value:T})=>{W(T)},[W]),z=n.useCallback(C=>{h!==C&&y("section",C)},[a,h,y]),ae=n.useCallback(()=>e.jsx(t.Card.Group,{children:M?d.map((C,T)=>e.jsx(ua,{collection:C},T)):g?e.jsx(t.Loader,{size:"large",active:!0}):c.map((C,T)=>e.jsx(ta,{item:C},T))}),[c,d,g,M,h]),te=n.useCallback(()=>M?e.jsx(t.Section,{children:e.jsxs(t.Table,{basic:"very",children:[e.jsx(t.Table.Header,{children:e.jsxs(t.Table.Row,{children:[e.jsx(t.Table.HeaderCell,{children:s("collections_page.collection")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.type")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.items")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.last_modified")}),e.jsx(t.Table.HeaderCell,{})]})}),e.jsx(t.Table.Body,{children:d.map(C=>e.jsx(Sa,{collection:C},C.id))})]})}):e.jsx(t.Section,{children:e.jsxs(t.Table,{basic:"very",children:[e.jsx(t.Table.Header,{children:e.jsxs(t.Table.Row,{children:[e.jsx(t.Table.HeaderCell,{children:s("global.item")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(t.Table.HeaderCell,{children:s("collections_page.last_modified")})]})}),e.jsx(t.Table.Body,{children:c.map(C=>e.jsx(ra,{item:C},C.id))})]})}),[c,d,M]),le=n.useCallback((C,T)=>{p!==T.activePage&&Q(Number(T.activePage))},[p,Q]),se=n.useCallback(()=>e.jsxs("div",{className:"collections-main-actions",children:[h!==m.ITEMS&&e.jsx(t.Field,{placeholder:s("itemdrawer.search_items"),className:"collections-search-field",input:{icon:"search"},onChange:K,icon:e.jsx(t.Icon,{name:"search",className:"searchIcon"}),iconPosition:"left",value:J,isClearable:!0}),e.jsxs(t.Row,{className:"actions",grow:!1,children:[S&&!j&&e.jsx(t.Button,{className:"action-button",size:"small",basic:!0,onClick:pe,children:s("collections_page.new_third_party_collection")}),e.jsxs(t.Button,{className:"action-button open-editor",size:"small",basic:!0,onClick:X,children:[e.jsx(ve,{name:"cube"}),s("item_editor.open")]}),e.jsxs(t.Button,{className:"action-button",size:"small",primary:!0,onClick:$,children:[e.jsx(t.Icon,{name:"plus square"})," ",s("collections_page.new_collection")]})]})]}),[J,S,j,K,X,$]),ne=n.useCallback(()=>e.jsx(t.Column,{align:"right",children:e.jsxs(t.Row,{className:"actions",children:[h===m.STANDARD_COLLECTIONS||m.THIRD_PARTY_COLLECTIONS&&e.jsx(t.Dropdown,{direction:"left",value:k,options:[{value:f.MOST_RELEVANT,text:s("curation_page.order.most_relevant")},{value:f.CREATED_AT_DESC,text:s("global.order.newest")},{value:f.CREATED_AT_ASC,text:s("global.order.oldest")},{value:f.UPDATED_AT_DESC,text:s("global.order.updated_at_desc")},{value:f.UPDATED_AT_ASC,text:s("global.order.updated_at_asc")},{value:f.NAME_DESC,text:s("global.order.name_desc")},{value:f.NAME_ASC,text:s("global.order.name_asc")}],onChange:ee}),e.jsx(oe,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(oe,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=o==null?void 0:o.total,T=x==null?void 0:x.total,v=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?C:T,q=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?I:x==null?void 0:x.totalPages;return A?e.jsx(t.Loader,{active:!0,size:"large"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"banner-container",children:e.jsx(qe,{id:Ge})}),e.jsx("div",{className:"filters",children:e.jsxs(t.Container,{children:[(u||S||j)&&e.jsxs("div",{className:"action-tabs-container",children:[e.jsx("img",{src:Ke,className:"collections-icon"}),e.jsxs(t.Tabs,{isFullscreen:!0,children:[e.jsx(t.Tabs.Tab,{active:h===m.STANDARD_COLLECTIONS,onClick:()=>z(m.STANDARD_COLLECTIONS),children:s("collections_page.collections")}),(S||j)&&e.jsx(t.Tabs.Tab,{active:h===m.THIRD_PARTY_COLLECTIONS,onClick:()=>z(m.THIRD_PARTY_COLLECTIONS),children:s("collections_page.third_party_collections")}),u&&e.jsx(t.Tabs.Tab,{active:h===m.ITEMS,onClick:()=>z(m.ITEMS),children:s("collections_page.single_items")})]})]}),se(),e.jsxs(t.Row,{height:30,children:[e.jsx(t.Column,{children:e.jsx(t.Row,{children:!g&&!b&&!!v&&v>0&&e.jsx(t.Header,{sub:!0,children:s("collections_page.results",{count:v})})})}),ne()]})]})}),g||b||v===void 0?e.jsx(t.Loader,{active:!0,size:"large"}):v>0?e.jsxs(e.Fragment,{children:[r===w.GRID?ae():r===w.LIST?te():null,!!q&&q>1&&e.jsx(t.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:q,activePage:p,onPageChange:le})]}):e.jsxs("div",{className:"empty",children:[e.jsx(t.Header,{className:"title",size:"large",children:s("collections_page.no_items")}),e.jsx("div",{className:"empty-description",children:s("collections_page.empty_description")}),e.jsx("div",{className:"create-new-wrapper",children:e.jsx("div",{className:"create-new create-new-collection",onClick:$,children:e.jsx("div",{className:"text",children:s("collections_page.new_collection")})})})]})]})},[p,I,o,x,r,u,g,b,A,j,S,le,$,ae,te,ne,se]);return e.jsx(Ze,{className:"CollectionsPage",activeTab:Ye.COLLECTIONS,children:Te()})}const fa=l=>{const a=we(l),c=Le(l),d=a?De(l,a):[],r=a?Ee(l,a):null,o=Ae(l);return{items:d,address:a,collections:c,collectionsPaginationData:o,itemsPaginationData:r,view:We(l),isThirdPartyManager:Oe(l),isLoadingCollections:G(Pe(l),Ue),isLoadingItems:G(ie(l),Ve),isLoadingOrphanItem:G(ie(l),ze),isLinkedWearablesPaymentsEnabled:ye(l),isCampaignEnabled:ke(l),hasUserOrphanItems:Me(l)}},Ra=l=>({onSetView:a=>l(He(a)),onOpenModal:(a,c)=>l(he(a,c)),onFetchOrphanItems:(a,c)=>l($e(a,c)),onFetchCollections:(a,c)=>l(Be(a,c)),onFetchOrphanItem:a=>l(Fe(a))}),ka=U(fa,Ra)(Na);export{ka as default};