@dcl/builder-site 7.4.0 → 7.4.1

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 (77) hide show
  1. package/assets/{Back-CcOe2OPR.js → Back-By-4R-U1.js} +1 -1
  2. package/assets/{CollectionProvider.container-DxJ0CuEV.js → CollectionProvider.container-B55XxdNh.js} +1 -1
  3. package/assets/{CollectionStatus.container-LhIAY4M5.js → CollectionStatus.container-Bg3t2d-h.js} +1 -1
  4. package/assets/{ConfirmDelete-BQ__uX_D.js → ConfirmDelete-qdY8nP-O.js} +1 -1
  5. package/assets/{FileSaver.min-CEXB1dl2.js → FileSaver.min-6d0fq5Zo.js} +1 -1
  6. package/assets/{ItemProvider.container-ww0oFR41.js → ItemProvider.container-BRoayas-.js} +1 -1
  7. package/assets/{JumpIn.container-CXf3AQ6H.js → JumpIn.container-DH7vWxVG.js} +1 -1
  8. package/assets/{LandAction-C18UJMxQ.js → LandAction-VPDjrQkE.js} +1 -1
  9. package/assets/{LandProviderPage-Bri2NXzA.js → LandProviderPage-D8_roYWH.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-CP5QlkqP.js → LoggedInDetailPage.container-D9YzD5-u.js} +1 -1
  11. package/assets/{Navigation-CUd2LsLk.css → Navigation-CQYgeT0w.css} +1 -1
  12. package/assets/{Navigation.container-Caaq2HYh.js → Navigation.container-DNCp40XB.js} +1 -1
  13. package/assets/{NotFound-D8kFfF63.js → NotFound-CS8G9Pe7.js} +1 -1
  14. package/assets/{OptionsDropdown-CHYbz4e5.js → OptionsDropdown-C_I20F2W.js} +1 -1
  15. package/assets/{RentalPeriod-Cjj0jvtz.js → RentalPeriod-B_tZDHSz.js} +1 -1
  16. package/assets/{SDKTag-cIoqxMfH.js → SDKTag-DOrmnsZR.js} +1 -1
  17. package/assets/{SceneStats.container-DyOrKEMS.js → SceneStats.container-D6Wzk9ps.js} +1 -1
  18. package/assets/{SignInRequired-CqwdQCfU.js → SignInRequired-oPiM_HvB.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-B4U76UoB.js → ThirdPartyKindBadge-1EbBCupx.js} +1 -1
  20. package/assets/{dataReader-BuX1b3Ny.js → dataReader-DZpAk_6V.js} +1 -1
  21. package/assets/{date-B02RhrCV.js → date-B65jEeMH.js} +1 -1
  22. package/assets/{fortmatic-DhAJUIOS.js → fortmatic-D-731_dx.js} +1 -1
  23. package/assets/{index-flmdvOR7.js → index-41C5YwXr.js} +20 -20
  24. package/assets/{index-DOl-0L6l.js → index-5MY3U2K8.js} +1 -1
  25. package/assets/{index-DsBnGRYG.js → index-82f5YOSU.js} +1 -1
  26. package/assets/{index-H_1uXVAi.js → index-B-7_EPGZ.js} +1 -1
  27. package/assets/index-BDB8oimK.js +1 -0
  28. package/assets/{index-B2zK8wwN.js → index-BDU0HuvD.js} +1 -1
  29. package/assets/{index-BpnD9Cq5.css → index-BJpiO9hV.css} +1 -1
  30. package/assets/{index-yCcEzoJg.js → index-BRJz6R2g.js} +1 -1
  31. package/assets/{index-Bci_hXV6.js → index-BV-Nnza1.js} +1 -1
  32. package/assets/{index-6sjC13M9.js → index-BVPu4mBc.js} +1 -1
  33. package/assets/{index-B4Mr5D7W.js → index-BYrhuK3j.js} +1 -1
  34. package/assets/{index-Cmsh7MkI.js → index-BaEn8M8S.js} +1 -1
  35. package/assets/{index-BoBS0q_1.js → index-BdeFFxb_.js} +1 -1
  36. package/assets/{index-CSFa_hR0.js → index-BgVtl5Kb.js} +1 -1
  37. package/assets/{index-Cb2vmzVZ.js → index-BvpgC1C7.js} +1 -1
  38. package/assets/{index-DOCQHXB2.js → index-BylH3QQG.js} +2 -2
  39. package/assets/{index-Dn6w3jJc.js → index-C-P9CP2I.js} +1 -1
  40. package/assets/{index-C8o5EU9X.js → index-C322ZtLM.js} +1 -1
  41. package/assets/{index-orpOYTTy.css → index-C6BvwEoI.css} +1 -1
  42. package/assets/{index-Di1kuK40.js → index-C76j8aLR.js} +1 -1
  43. package/assets/{index-U5D3SBV3.css → index-CCw_mTG8.css} +1 -1
  44. package/assets/{index-CQA7Js80.js → index-CXfXhCAZ.js} +1 -1
  45. package/assets/{index-C3Dl6TUx.js → index-CY3zyJtP.js} +1 -1
  46. package/assets/{index-BunYit3g.js → index-CevTTMEC.js} +1 -1
  47. package/assets/{index-BadWll2h.js → index-CkRBTILh.js} +1 -1
  48. package/assets/{index-DKjqFrx1.js → index-Cq3OUMiL.js} +1 -1
  49. package/assets/{index-DPIVvhqF.js → index-Crpg26Cm.js} +1 -1
  50. package/assets/{index-DxvvKKI6.js → index-CtrKelMu.js} +1 -1
  51. package/assets/{index-9rEpBDga.js → index-D2Tg9A0P.js} +1 -1
  52. package/assets/{index-CJDrJNCG.js → index-D4N6UG21.js} +1 -1
  53. package/assets/{index-B4KJ6VbC.js → index-D5d4Ja9w.js} +1 -1
  54. package/assets/{index-DCIip8s_.js → index-DBSmcWBI.js} +1 -1
  55. package/assets/{index-BAVTO1wI.js → index-DEvjUSh6.js} +1 -1
  56. package/assets/{index-CZlWRrl9.js → index-DKdhp46t.js} +1 -1
  57. package/assets/{index-CC9X8xUj.js → index-DMjP9_6s.js} +1 -1
  58. package/assets/{index-DC4hYk1D.css → index-DWKsbmz4.css} +1 -1
  59. package/assets/{index-0CZpREZ9.js → index-DlHmKahn.js} +1 -1
  60. package/assets/{index-D0il6SHm.js → index-KsM5oCK9.js} +1 -1
  61. package/assets/{index-CZCaOitM.css → index-SYJEtIt5.css} +1 -1
  62. package/assets/{index-BmwS_YEa.js → index-X8HThZEv.js} +1 -1
  63. package/assets/{index-B-XgZWF5.js → index-Ydji3YUi.js} +1 -1
  64. package/assets/index-_fU_kOtI.js +1 -0
  65. package/assets/{index-C_fzrRU7.css → index-bgb_kBBP.css} +7 -7
  66. package/assets/{index-MB0aYlXA.css → index-buaXxN2s.css} +1 -1
  67. package/assets/{index-C7XqFyMe.js → index-i84hpsRQ.js} +1 -1
  68. package/assets/{index-COKMMOMy.js → index-iE_RFPFQ.js} +1 -1
  69. package/assets/{index-DxKCKO90.js → index-iQcJ-NCZ.js} +1 -1
  70. package/assets/{index-D0btPEiB.js → index-pbqI9Pqo.js} +1 -1
  71. package/assets/{index-BsPF3_nI.js → index-trPgNxCf.js} +1 -1
  72. package/assets/{index.es-CCZmgIK6.js → index.es-BtOP83dX.js} +4 -4
  73. package/assets/{selectors-DV14n6nm.js → selectors-B-FgaFOX.js} +1 -1
  74. package/index.html +3 -3
  75. package/package.json +3 -3
  76. package/assets/index-D4zuIMMk.js +0 -1
  77. package/assets/index-npp0LcxN.js +0 -1
@@ -1 +1 @@
1
- var I=Object.defineProperty;var R=(l,o,s)=>o in l?I(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s;var x=(l,o,s)=>R(l,typeof o!="symbol"?o+"":o,s);import{D as g,K as m,H as e,aZ as B,M as t,N,a_ as O,bR as z,bS as H,aA as P,bC as _,bT as A,bU as F,bJ as j,bV as C,G as a,bN as $,bB as X,bD as E,bW as Y,bX as W,bY as U,bZ as J,b_ as V,b$ as Z,aW as G,c0 as K,X as q}from"./index-flmdvOR7.js";import{L as Q}from"./LandProviderPage-Bri2NXzA.js";import{B as ee}from"./Back-CcOe2OPR.js";import{J as se}from"./JumpIn.container-CXf3AQ6H.js";import{R as te}from"./RentalPeriod-Cjj0jvtz.js";import{S as oe}from"./SceneStats.container-DyOrKEMS.js";import"./NotFound-D8kFfF63.js";import"./index-DOl-0L6l.js";import"./date-B02RhrCV.js";let ie=class extends g.PureComponent{constructor(){super(...arguments);x(this,"handleOnClick",()=>{const{isLoading:s,history:i}=this.props;s&&i.push(m.activity())})}render(){const{ens:s,isLoading:i,onIconClick:n}=this.props;return e.jsx(B,{className:"ENSChip",text:i?e.jsxs(e.Fragment,{children:[s.subdomain,e.jsx(t.Loader,{active:!0,size:"tiny"})]}):s.subdomain,isActive:i,icon:i?"":"minus",onClick:this.handleOnClick,onIconClick:n})}};const ne=(l,o)=>{const{ens:s}=o;return{isLoading:z(l)[s.subdomain]||H(l)[s.subdomain]}},le=N(ne)(O(ie)),ae=l=>{const{deployment:o,onMouseEnter:s,onMouseLeave:i,onNavigate:n,onOpenModal:u,projects:c,disabled:r}=l,d=o.projectId&&o.projectId in c?c[o.projectId]:null,p=g.useCallback(()=>{r||s(o)},[s,r,o]),h=g.useCallback(()=>{r||i(o)},[i,r,o]),v=g.useCallback(()=>{d&&!r&&n(m.sceneDetail(d.id))},[n,d,r]),S=g.useCallback(()=>{u("DeployModal",{view:P.CLEAR_DEPLOYMENT,deploymentId:o.id})},[u,o]);return e.jsxs("div",{className:`Scene ${d&&!r?"clickable":""}`,onClick:v,onMouseEnter:p,onMouseLeave:h,children:[o.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${o.thumbnail})`}}):e.jsx("div",{className:"no-thumbnail"}),e.jsxs("div",{className:"stat",children:[e.jsx("div",{className:"title",title:o.name,children:o.name}),o.layout?e.jsxs("div",{className:"secondary-text",children:[o.layout.rows,"x",o.layout.cols]}):null]}),e.jsx(oe,{deployment:o}),e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,disabled:r,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:"Unpublish",onClick:S})})})]})},L=({children:l,land:o})=>{const s=g.Children.map(l,i=>g.isValidElement(i)?g.cloneElement(i,{disabled:o.roles.includes(j.LESSOR)}):i);return e.jsx(t.Popup,{content:a("land_detail_page.land_is_locked"),position:"top left",disabled:!o.roles.includes(j.LESSOR),trigger:e.jsx("span",{children:s})})};let re=class extends g.PureComponent{constructor(){super(...arguments);x(this,"state",{hovered:null,mouseX:0,mouseY:0,showTooltip:!1});x(this,"handleMouseEnter",s=>{this.setState({hovered:s,showTooltip:!1})});x(this,"handleMouseLeave",()=>{this.setState({hovered:null,showTooltip:!1})});x(this,"handleMouseMove",s=>{this.setState({mouseX:s.clientX,mouseY:s.clientY})});x(this,"handleHover",s=>(i,n)=>{const{deploymentsByCoord:u}=this.props,c=u[_(i,n)];c&&s.some(r=>r.id===c.id)?this.setState({hovered:c,showTooltip:!0}):this.setState({hovered:null,showTooltip:!1})});x(this,"handleClick",(s,i)=>{const{deploymentsByCoord:n,projects:u,onNavigate:c,onReplace:r,landTiles:d}=this.props,p=_(s,i),h=n[p];h&&h.projectId&&h.projectId in u?c(m.sceneDetail(h.projectId)):p in d&&r(m.landDetail(d[p].land.id))});x(this,"isHovered",(s,i)=>{const{deploymentsByCoord:n}=this.props,{hovered:u}=this.state,c=_(s,i),r=n[c];return!!r&&!!u&&u.id===r.id});x(this,"getHoverStrokeLayer",s=>(i,n)=>this.isHovered(i,n)?{color:A[s.role],scale:1.4}:null);x(this,"getHoverFillLayer",s=>(i,n)=>this.isHovered(i,n)?{color:F[s.role],scale:1.2}:null)}computeOccupiedLand(s,i){const{landTiles:n}=this.props;return i.reduce((c,r)=>c+r.parcels.filter(d=>{const p=n[d];return!!p&&p.land.id===s.id}).length,0)}renderDetail(s,i,n){const{ensList:u,parcelsAvailableToBuildEstates:c,projects:r,onNavigate:d,onOpenModal:p}=this.props,{hovered:h,mouseX:v,mouseY:S,showTooltip:y}=this.state,D=this.computeOccupiedLand(s,i),w=n&&(s.roles.includes(j.LESSOR)||s.roles.includes(j.TENANT))?n.lessor:s.owner,k=s.roles.includes(j.LESSOR),M=c[s.id],T=y&&h&&h.projectId&&h.projectId in r;return e.jsxs(e.Fragment,{children:[h&&y?e.jsxs("div",{className:"tooltip",style:{top:S,left:v},children:[h.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${h.thumbnail})`}}):null,e.jsx("div",{className:"name",children:h.name})]}):null,e.jsx(t.Section,{size:"large",children:e.jsxs(t.Row,{children:[e.jsx(ee,{absolute:!0,onClick:()=>d(m.land())}),e.jsx(t.Narrow,{children:e.jsxs(t.Row,{children:[e.jsx(t.Column,{children:e.jsxs(t.Row,{children:[e.jsx(t.Header,{size:"huge",children:s.name}),s.type===C.PARCEL?e.jsx(e.Fragment,{children:e.jsxs(t.Badge,{color:"#37333D",children:[e.jsx("i",{className:"pin"}),s.id]})}):e.jsxs(t.Badge,{color:"#37333D",children:[s.size," LAND"]}),e.jsx(se,{land:s})]})}),s.role===j.OWNER||s.role===j.LESSOR?e.jsx(t.Column,{className:"actions",align:"right",children:e.jsxs(t.Row,{children:[e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landTransfer(s.id)),children:a("land_detail_page.transfer")})}),e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landEdit(s.id)),children:a("global.edit")})}),e.jsx(L,{land:s,children:e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[M?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.build_estate"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.add_or_remove_parcels"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.dissolve_estate"),onClick:()=>p("DissolveModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.assign_name"),onClick:()=>d(m.landSelectENS(s.id))}),e.jsx(t.Dropdown.Divider,{})]}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})]})})})]})}):s.roles.includes(j.TENANT)&&n&&!$(n)?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})})}):null]})})]})}),e.jsxs(t.Narrow,{children:[e.jsx(t.Section,{size:"large",children:e.jsx("div",{className:`atlas-wrapper ${T?"clickable":""}`,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,children:e.jsx(X,{landId:s.id,layers:[this.getHoverStrokeLayer(s),this.getHoverFillLayer(s)],isDraggable:!0,zoom:s.size&&s.size>=1e3?.5:1,onHover:this.handleHover(i),onClick:this.handleClick})})}),e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.online_scenes")}),i.length===0?e.jsx(t.Empty,{height:100,children:a("global.none")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:i.map(b=>e.jsx(ae,{disabled:k,deployment:b,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onNavigate:d,onOpenModal:p,projects:r},b.id))}),e.jsx("div",{className:"notice",children:a("analytics.notice")})]})]}),u.length>0?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:e.jsx(t.Row,{children:e.jsx(t.Column,{children:a("land_detail_page.assigned_names")})})}),e.jsx("div",{className:"ens-list",children:u.map(b=>e.jsx(le,{ens:b,onIconClick:()=>p("UnsetENSContentModal",{ens:b,land:s})},b.subdomain))})]}):null,s.description?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.description")}),e.jsx("p",{children:s.description})]}):null,e.jsxs(t.Section,{className:"data",children:[e.jsxs(t.Stats,{title:a("global.role"),className:"role",children:[e.jsx(t.Header,{children:a(`roles.${s.role}`)}),n?e.jsx(te,{land:s,rental:n}):null]}),e.jsx(t.Stats,{title:a("land_detail_page.owner"),children:e.jsx(E,{address:w,size:"large"})}),n&&s.roles.includes(j.LESSOR)?e.jsx(t.Stats,{title:a("land_detail_page.tenant"),children:e.jsx(E,{address:n.tenant,size:"large"})}):null,s.operators.length>0?e.jsx(t.Stats,{title:a("land_detail_page.operated_by"),className:"operators",children:e.jsx(t.Row,{children:s.operators.map((b,f)=>e.jsx(E,{address:b,size:"large"},f))})}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Stats,{title:a("land_detail_page.total_land"),children:e.jsx(t.Header,{children:s.size})}),e.jsx(t.Stats,{title:a("land_detail_page.empty_land"),children:e.jsx(t.Header,{children:s.size-D})})]}):null]})]})]})}render(){return e.jsx(Q,{className:"LandDetailPage",children:(s,{deployments:i,rental:n})=>this.renderDetail(s,i,n)})}};const de=l=>{const o=Y(l)||"";return{ensList:W(l,o),parcelsAvailableToBuildEstates:U(l),deploymentsByCoord:J(l),landTiles:V(l),projects:Z(l)}},ce=l=>({onNavigate:o=>l(G(o)),onReplace:o=>l(K(o)),onOpenModal:(o,s)=>l(q(o,s))}),Ee=N(de,ce)(re);export{Ee as default};
1
+ var I=Object.defineProperty;var R=(l,o,s)=>o in l?I(l,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[o]=s;var x=(l,o,s)=>R(l,typeof o!="symbol"?o+"":o,s);import{D as g,K as m,H as e,aZ as B,M as t,N,a_ as O,bR as z,bS as H,aA as P,bC as _,bT as A,bU as F,bJ as j,bV as C,G as a,bN as $,bB as X,bD as E,bW as Y,bX as W,bY as U,bZ as J,b_ as V,b$ as Z,aW as G,c0 as K,X as q}from"./index-41C5YwXr.js";import{L as Q}from"./LandProviderPage-D8_roYWH.js";import{B as ee}from"./Back-By-4R-U1.js";import{J as se}from"./JumpIn.container-DH7vWxVG.js";import{R as te}from"./RentalPeriod-B_tZDHSz.js";import{S as oe}from"./SceneStats.container-D6Wzk9ps.js";import"./NotFound-CS8G9Pe7.js";import"./index-5MY3U2K8.js";import"./date-B65jEeMH.js";let ie=class extends g.PureComponent{constructor(){super(...arguments);x(this,"handleOnClick",()=>{const{isLoading:s,history:i}=this.props;s&&i.push(m.activity())})}render(){const{ens:s,isLoading:i,onIconClick:n}=this.props;return e.jsx(B,{className:"ENSChip",text:i?e.jsxs(e.Fragment,{children:[s.subdomain,e.jsx(t.Loader,{active:!0,size:"tiny"})]}):s.subdomain,isActive:i,icon:i?"":"minus",onClick:this.handleOnClick,onIconClick:n})}};const ne=(l,o)=>{const{ens:s}=o;return{isLoading:z(l)[s.subdomain]||H(l)[s.subdomain]}},le=N(ne)(O(ie)),ae=l=>{const{deployment:o,onMouseEnter:s,onMouseLeave:i,onNavigate:n,onOpenModal:u,projects:c,disabled:r}=l,d=o.projectId&&o.projectId in c?c[o.projectId]:null,p=g.useCallback(()=>{r||s(o)},[s,r,o]),h=g.useCallback(()=>{r||i(o)},[i,r,o]),v=g.useCallback(()=>{d&&!r&&n(m.sceneDetail(d.id))},[n,d,r]),S=g.useCallback(()=>{u("DeployModal",{view:P.CLEAR_DEPLOYMENT,deploymentId:o.id})},[u,o]);return e.jsxs("div",{className:`Scene ${d&&!r?"clickable":""}`,onClick:v,onMouseEnter:p,onMouseLeave:h,children:[o.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${o.thumbnail})`}}):e.jsx("div",{className:"no-thumbnail"}),e.jsxs("div",{className:"stat",children:[e.jsx("div",{className:"title",title:o.name,children:o.name}),o.layout?e.jsxs("div",{className:"secondary-text",children:[o.layout.rows,"x",o.layout.cols]}):null]}),e.jsx(oe,{deployment:o}),e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,disabled:r,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:"Unpublish",onClick:S})})})]})},L=({children:l,land:o})=>{const s=g.Children.map(l,i=>g.isValidElement(i)?g.cloneElement(i,{disabled:o.roles.includes(j.LESSOR)}):i);return e.jsx(t.Popup,{content:a("land_detail_page.land_is_locked"),position:"top left",disabled:!o.roles.includes(j.LESSOR),trigger:e.jsx("span",{children:s})})};let re=class extends g.PureComponent{constructor(){super(...arguments);x(this,"state",{hovered:null,mouseX:0,mouseY:0,showTooltip:!1});x(this,"handleMouseEnter",s=>{this.setState({hovered:s,showTooltip:!1})});x(this,"handleMouseLeave",()=>{this.setState({hovered:null,showTooltip:!1})});x(this,"handleMouseMove",s=>{this.setState({mouseX:s.clientX,mouseY:s.clientY})});x(this,"handleHover",s=>(i,n)=>{const{deploymentsByCoord:u}=this.props,c=u[_(i,n)];c&&s.some(r=>r.id===c.id)?this.setState({hovered:c,showTooltip:!0}):this.setState({hovered:null,showTooltip:!1})});x(this,"handleClick",(s,i)=>{const{deploymentsByCoord:n,projects:u,onNavigate:c,onReplace:r,landTiles:d}=this.props,p=_(s,i),h=n[p];h&&h.projectId&&h.projectId in u?c(m.sceneDetail(h.projectId)):p in d&&r(m.landDetail(d[p].land.id))});x(this,"isHovered",(s,i)=>{const{deploymentsByCoord:n}=this.props,{hovered:u}=this.state,c=_(s,i),r=n[c];return!!r&&!!u&&u.id===r.id});x(this,"getHoverStrokeLayer",s=>(i,n)=>this.isHovered(i,n)?{color:A[s.role],scale:1.4}:null);x(this,"getHoverFillLayer",s=>(i,n)=>this.isHovered(i,n)?{color:F[s.role],scale:1.2}:null)}computeOccupiedLand(s,i){const{landTiles:n}=this.props;return i.reduce((c,r)=>c+r.parcels.filter(d=>{const p=n[d];return!!p&&p.land.id===s.id}).length,0)}renderDetail(s,i,n){const{ensList:u,parcelsAvailableToBuildEstates:c,projects:r,onNavigate:d,onOpenModal:p}=this.props,{hovered:h,mouseX:v,mouseY:S,showTooltip:y}=this.state,D=this.computeOccupiedLand(s,i),w=n&&(s.roles.includes(j.LESSOR)||s.roles.includes(j.TENANT))?n.lessor:s.owner,k=s.roles.includes(j.LESSOR),M=c[s.id],T=y&&h&&h.projectId&&h.projectId in r;return e.jsxs(e.Fragment,{children:[h&&y?e.jsxs("div",{className:"tooltip",style:{top:S,left:v},children:[h.thumbnail?e.jsx("div",{className:"thumbnail",style:{backgroundImage:`url(${h.thumbnail})`}}):null,e.jsx("div",{className:"name",children:h.name})]}):null,e.jsx(t.Section,{size:"large",children:e.jsxs(t.Row,{children:[e.jsx(ee,{absolute:!0,onClick:()=>d(m.land())}),e.jsx(t.Narrow,{children:e.jsxs(t.Row,{children:[e.jsx(t.Column,{children:e.jsxs(t.Row,{children:[e.jsx(t.Header,{size:"huge",children:s.name}),s.type===C.PARCEL?e.jsx(e.Fragment,{children:e.jsxs(t.Badge,{color:"#37333D",children:[e.jsx("i",{className:"pin"}),s.id]})}):e.jsxs(t.Badge,{color:"#37333D",children:[s.size," LAND"]}),e.jsx(se,{land:s})]})}),s.role===j.OWNER||s.role===j.LESSOR?e.jsx(t.Column,{className:"actions",align:"right",children:e.jsxs(t.Row,{children:[e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landTransfer(s.id)),children:a("land_detail_page.transfer")})}),e.jsx(L,{land:s,children:e.jsx(t.Button,{basic:!0,onClick:()=>d(m.landEdit(s.id)),children:a("global.edit")})}),e.jsx(L,{land:s,children:e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[M?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.build_estate"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.add_or_remove_parcels"),onClick:()=>p("EstateEditorModal",{land:s})}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.dissolve_estate"),onClick:()=>p("DissolveModal",{land:s})}),e.jsx(t.Dropdown.Divider,{})]}):null,e.jsxs(e.Fragment,{children:[e.jsx(t.Dropdown.Item,{text:a("land_detail_page.assign_name"),onClick:()=>d(m.landSelectENS(s.id))}),e.jsx(t.Dropdown.Divider,{})]}),e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})]})})})]})}):s.roles.includes(j.TENANT)&&n&&!$(n)?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(t.Dropdown.Menu,{children:e.jsx(t.Dropdown.Item,{text:a("land_detail_page.set_operator"),onClick:()=>d(m.landOperator(s.id))})})}):null]})})]})}),e.jsxs(t.Narrow,{children:[e.jsx(t.Section,{size:"large",children:e.jsx("div",{className:`atlas-wrapper ${T?"clickable":""}`,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,children:e.jsx(X,{landId:s.id,layers:[this.getHoverStrokeLayer(s),this.getHoverFillLayer(s)],isDraggable:!0,zoom:s.size&&s.size>=1e3?.5:1,onHover:this.handleHover(i),onClick:this.handleClick})})}),e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.online_scenes")}),i.length===0?e.jsx(t.Empty,{height:100,children:a("global.none")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:i.map(b=>e.jsx(ae,{disabled:k,deployment:b,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onNavigate:d,onOpenModal:p,projects:r},b.id))}),e.jsx("div",{className:"notice",children:a("analytics.notice")})]})]}),u.length>0?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:e.jsx(t.Row,{children:e.jsx(t.Column,{children:a("land_detail_page.assigned_names")})})}),e.jsx("div",{className:"ens-list",children:u.map(b=>e.jsx(le,{ens:b,onIconClick:()=>p("UnsetENSContentModal",{ens:b,land:s})},b.subdomain))})]}):null,s.description?e.jsxs(t.Section,{size:"large",children:[e.jsx(t.Header,{sub:!0,children:a("land_detail_page.description")}),e.jsx("p",{children:s.description})]}):null,e.jsxs(t.Section,{className:"data",children:[e.jsxs(t.Stats,{title:a("global.role"),className:"role",children:[e.jsx(t.Header,{children:a(`roles.${s.role}`)}),n?e.jsx(te,{land:s,rental:n}):null]}),e.jsx(t.Stats,{title:a("land_detail_page.owner"),children:e.jsx(E,{address:w,size:"large"})}),n&&s.roles.includes(j.LESSOR)?e.jsx(t.Stats,{title:a("land_detail_page.tenant"),children:e.jsx(E,{address:n.tenant,size:"large"})}):null,s.operators.length>0?e.jsx(t.Stats,{title:a("land_detail_page.operated_by"),className:"operators",children:e.jsx(t.Row,{children:s.operators.map((b,f)=>e.jsx(E,{address:b,size:"large"},f))})}):null,s.type===C.ESTATE?e.jsxs(e.Fragment,{children:[e.jsx(t.Stats,{title:a("land_detail_page.total_land"),children:e.jsx(t.Header,{children:s.size})}),e.jsx(t.Stats,{title:a("land_detail_page.empty_land"),children:e.jsx(t.Header,{children:s.size-D})})]}):null]})]})]})}render(){return e.jsx(Q,{className:"LandDetailPage",children:(s,{deployments:i,rental:n})=>this.renderDetail(s,i,n)})}};const de=l=>{const o=Y(l)||"";return{ensList:W(l,o),parcelsAvailableToBuildEstates:U(l),deploymentsByCoord:J(l),landTiles:V(l),projects:Z(l)}},ce=l=>({onNavigate:o=>l(G(o)),onReplace:o=>l(K(o)),onOpenModal:(o,s)=>l(q(o,s))}),Ee=N(de,ce)(re);export{Ee as default};
@@ -1 +1 @@
1
- import{a as g}from"./index-0CZpREZ9.js";import"./index-flmdvOR7.js";var m=Object.defineProperty,v=Object.defineProperties,y=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))w.call(r,t)&&d(e,t,r[t]);if(c)for(var t of c(r))f.call(r,t)&&d(e,t,r[t]);return e},_=(e,r)=>v(e,y(r)),u=(e,r,t)=>new Promise((n,s)=>{var l=i=>{try{o(t.next(i))}catch(p){s(p)}},a=i=>{try{o(t.throw(i))}catch(p){s(p)}},o=i=>i.done?n(i.value):Promise.resolve(i.value).then(l,a);o((t=t.apply(e,r)).next())}),b=(e=>(e.Start="magic_oauth_login_with_redirect_start",e.Verify="magic_oauth_login_with_redirect_verify",e.Popup="magic_oauth_login_with_popup",e.VerifyTelegramData="magic_oauth_verify_telegram_data",e))(b||{}),R=(e=>(e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidScope="invalid_scope",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedGrantType="unsupported_grant_type",e.UnsupportedTokenType="unsupported_token_type",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e))(R||{}),I=class extends g.Internal{constructor(){super(),this.name="oauth2",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1},this.seamlessTelegramLogin()}loginWithRedirect(e){return this.utils.createPromiEvent((r,t)=>u(this,null,function*(){var n;let s=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]),l=yield this.request(s),a=l,o=l;if(o.error&&t(this.createError(o.error,(n=o.error_description)!=null?n:"An error occurred.",{errorURI:o.error_uri,provider:o.provider})),a!=null&&a.oauthAuthoriationURI){let i=a.useMagicServerCallback?new URL(a.oauthAuthoriationURI,this.sdk.endpoint).href:a.oauthAuthoriationURI;a!=null&&a.shouldReturnURI?r(i):window.location.href=i}r(null)}))}getRedirectResult(e,r){let t=r||window.location.search,n=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",n),P.call(this,t,e)}loginWithPopup(e){let r=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]);return this.request(r)}seamlessTelegramLogin(){try{if(!window.location.hash.toString().includes("#tgWebAppData"))return;let e=document.createElement("script");e.src="https://telegram.org/js/telegram-web-app.js",document.head.prepend(e),e.onload=()=>u(this,null,function*(){var r;try{let t=(r=window.Telegram)==null?void 0:r.WebApp.initData,n=this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data",[{userData:t,isMiniApp:!0}]);yield this.request(n)}catch(t){console.log("Error while verifying telegram data",t)}})}catch(e){console.log("Error while loading telegram-web-app script",e)}}};function P(e,r){return this.utils.createPromiEvent((t,n)=>u(this,null,function*(){var s;let l=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify",[{authorizationResponseParams:e,magicApiKey:this.sdk.apiKey,platform:"web",lifespan:r}]),a=yield this.request(l),o=a,i=a;i.error&&n(this.createError(i.error,(s=i.error_description)!=null?s:"An error occurred.",{errorURI:i.error_uri,provider:i.provider})),t(o)}))}export{R as OAuthErrorCode,I as OAuthExtension,b as OAuthPayloadMethods};
1
+ import{a as g}from"./index-DlHmKahn.js";import"./index-41C5YwXr.js";var m=Object.defineProperty,v=Object.defineProperties,y=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,d=(e,r,t)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))w.call(r,t)&&d(e,t,r[t]);if(c)for(var t of c(r))f.call(r,t)&&d(e,t,r[t]);return e},_=(e,r)=>v(e,y(r)),u=(e,r,t)=>new Promise((n,s)=>{var l=i=>{try{o(t.next(i))}catch(p){s(p)}},a=i=>{try{o(t.throw(i))}catch(p){s(p)}},o=i=>i.done?n(i.value):Promise.resolve(i.value).then(l,a);o((t=t.apply(e,r)).next())}),b=(e=>(e.Start="magic_oauth_login_with_redirect_start",e.Verify="magic_oauth_login_with_redirect_verify",e.Popup="magic_oauth_login_with_popup",e.VerifyTelegramData="magic_oauth_verify_telegram_data",e))(b||{}),R=(e=>(e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidScope="invalid_scope",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedGrantType="unsupported_grant_type",e.UnsupportedTokenType="unsupported_token_type",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e))(R||{}),I=class extends g.Internal{constructor(){super(),this.name="oauth2",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1},this.seamlessTelegramLogin()}loginWithRedirect(e){return this.utils.createPromiEvent((r,t)=>u(this,null,function*(){var n;let s=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_start",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]),l=yield this.request(s),a=l,o=l;if(o.error&&t(this.createError(o.error,(n=o.error_description)!=null?n:"An error occurred.",{errorURI:o.error_uri,provider:o.provider})),a!=null&&a.oauthAuthoriationURI){let i=a.useMagicServerCallback?new URL(a.oauthAuthoriationURI,this.sdk.endpoint).href:a.oauthAuthoriationURI;a!=null&&a.shouldReturnURI?r(i):window.location.href=i}r(null)}))}getRedirectResult(e,r){let t=r||window.location.search,n=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",n),P.call(this,t,e)}loginWithPopup(e){let r=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_popup",[_(h({},e),{apiKey:this.sdk.apiKey,platform:"web"})]);return this.request(r)}seamlessTelegramLogin(){try{if(!window.location.hash.toString().includes("#tgWebAppData"))return;let e=document.createElement("script");e.src="https://telegram.org/js/telegram-web-app.js",document.head.prepend(e),e.onload=()=>u(this,null,function*(){var r;try{let t=(r=window.Telegram)==null?void 0:r.WebApp.initData,n=this.utils.createJsonRpcRequestPayload("magic_oauth_verify_telegram_data",[{userData:t,isMiniApp:!0}]);yield this.request(n)}catch(t){console.log("Error while verifying telegram data",t)}})}catch(e){console.log("Error while loading telegram-web-app script",e)}}};function P(e,r){return this.utils.createPromiEvent((t,n)=>u(this,null,function*(){var s;let l=this.utils.createJsonRpcRequestPayload("magic_oauth_login_with_redirect_verify",[{authorizationResponseParams:e,magicApiKey:this.sdk.apiKey,platform:"web",lifespan:r}]),a=yield this.request(l),o=a,i=a;i.error&&n(this.createError(i.error,(s=i.error_description)!=null?s:"An error occurred.",{errorURI:i.error_uri,provider:i.provider})),t(o)}))}export{R as OAuthErrorCode,I as OAuthExtension,b as OAuthPayloadMethods};
@@ -1 +1 @@
1
- var ue=Object.defineProperty;var he=(n,t,e)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var v=(n,t,e)=>he(n,typeof t!="symbol"?t+"":t,e);import{bP as x,bQ as _,cb as j,hD as ge,gt as T,gF as fe,Z as me,D as A,hE as K,K as ve,H as o,G as c,M as l,dC as pe,eQ as J,bD as V,N as re,aH as we,et as Ce,X as Te,ev as xe,af as be,ew as O,bm as _e,hF as ye,ey as Ee,eB as De,e9 as Oe,bt as Se,hG as Pe,a6 as je,bw as q,hH as Me,eD as Ne,gu as Le,eG as Ue,eK as ke,hI as Re,eM as Ye,hJ as Ae}from"./index-flmdvOR7.js";import{d as Ie,e as We,c as Fe}from"./selectors-DV14n6nm.js";import{N as Be}from"./NotFound-D8kFfF63.js";import{L as He}from"./LoggedInDetailPage.container-CP5QlkqP.js";import{N as $e}from"./Navigation.container-Caaq2HYh.js";import{C as qe}from"./CollectionStatus.container-LhIAY4M5.js";import{C as Ge,T as Qe}from"./ThirdPartyKindBadge-B4U76UoB.js";import{s as I,a as Ve}from"./date-B02RhrCV.js";import{g as X,e as Xe,l as Ke}from"./index-DOl-0L6l.js";import"./SignInRequired-CqwdQCfU.js";function Je(n,t){x(2,arguments);var e=_(n).getTime(),a=j(t);return new Date(e+a)}function Ze(n){return x(1,arguments),n instanceof Date||ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ze(n){if(x(1,arguments),!Ze(n)&&typeof n!="number")return!1;var t=_(n);return!isNaN(Number(t))}function et(n,t){x(2,arguments);var e=j(t);return Je(n,-e)}var tt=864e5;function at(n){x(1,arguments);var t=_(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),r=e-a;return Math.floor(r/tt)+1}function W(n){x(1,arguments);var t=1,e=_(n),a=e.getUTCDay(),r=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function ne(n){x(1,arguments);var t=_(n),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var r=W(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=W(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function rt(n){x(1,arguments);var t=ne(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=W(e);return a}var nt=6048e5;function it(n){x(1,arguments);var t=_(n),e=W(t).getTime()-rt(t).getTime();return Math.round(e/nt)+1}function ie(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=_(n),w=p.getUTCFullYear(),g=X(),m=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:g.firstWeekContainsDate)!==null&&a!==void 0?a:(f=g.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(w+1,0,m),b.setUTCHours(0,0,0,0);var M=I(b,t),D=new Date(0);D.setUTCFullYear(w,0,m),D.setUTCHours(0,0,0,0);var B=I(D,t);return p.getTime()>=M.getTime()?w+1:p.getTime()>=B.getTime()?w:w-1}function ot(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=X(),w=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:p.firstWeekContainsDate)!==null&&a!==void 0?a:(f=p.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1),g=ie(n,t),m=new Date(0);m.setUTCFullYear(g,0,w),m.setUTCHours(0,0,0,0);var b=I(m,t);return b}var st=6048e5;function lt(n,t){x(1,arguments);var e=_(n),a=I(e,t).getTime()-ot(e,t).getTime();return Math.round(a/st)+1}function d(n,t){for(var e=n<0?"-":"",a=Math.abs(n).toString();a.length<t;)a="0"+a;return e+a}var E={y:function(t,e){var a=t.getUTCFullYear(),r=a>0?a:1-a;return d(e==="yy"?r%100:r,e.length)},M:function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):d(a+1,2)},d:function(t,e){return d(t.getUTCDate(),e.length)},a:function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(t,e){return d(t.getUTCHours()%12||12,e.length)},H:function(t,e){return d(t.getUTCHours(),e.length)},m:function(t,e){return d(t.getUTCMinutes(),e.length)},s:function(t,e){return d(t.getUTCSeconds(),e.length)},S:function(t,e){var a=e.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,a-3));return d(i,e.length)}},P={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ct={G:function(t,e,a){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(r,{width:"abbreviated"});case"GGGGG":return a.era(r,{width:"narrow"});case"GGGG":default:return a.era(r,{width:"wide"})}},y:function(t,e,a){if(e==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return a.ordinalNumber(i,{unit:"year"})}return E.y(t,e)},Y:function(t,e,a,r){var i=ie(t,r),s=i>0?i:1-i;if(e==="YY"){var u=s%100;return d(u,2)}return e==="Yo"?a.ordinalNumber(s,{unit:"year"}):d(s,e.length)},R:function(t,e){var a=ne(t);return d(a,e.length)},u:function(t,e){var a=t.getUTCFullYear();return d(a,e.length)},Q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return d(r,2);case"Qo":return a.ordinalNumber(r,{unit:"quarter"});case"QQQ":return a.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return d(r,2);case"qo":return a.ordinalNumber(r,{unit:"quarter"});case"qqq":return a.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,a){var r=t.getUTCMonth();switch(e){case"M":case"MM":return E.M(t,e);case"Mo":return a.ordinalNumber(r+1,{unit:"month"});case"MMM":return a.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,a){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return d(r+1,2);case"Lo":return a.ordinalNumber(r+1,{unit:"month"});case"LLL":return a.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,a,r){var i=lt(t,r);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):d(i,e.length)},I:function(t,e,a){var r=it(t);return e==="Io"?a.ordinalNumber(r,{unit:"week"}):d(r,e.length)},d:function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):E.d(t,e)},D:function(t,e,a){var r=at(t);return e==="Do"?a.ordinalNumber(r,{unit:"dayOfYear"}):d(r,e.length)},E:function(t,e,a){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return a.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(r,{width:"short",context:"formatting"});case"EEEE":default:return a.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return d(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return d(s,e.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,a){var r=t.getUTCDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return d(i,e.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(r,{width:"short",context:"formatting"});case"iiii":default:return a.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,a){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,a){var r=t.getUTCHours(),i;switch(r===12?i=P.noon:r===0?i=P.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,a){var r=t.getUTCHours(),i;switch(r>=17?i=P.evening:r>=12?i=P.afternoon:r>=4?i=P.morning:i=P.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,a){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),a.ordinalNumber(r,{unit:"hour"})}return E.h(t,e)},H:function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):E.H(t,e)},K:function(t,e,a){var r=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},k:function(t,e,a){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},m:function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E.m(t,e)},s:function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E.s(t,e)},S:function(t,e){return E.S(t,e)},X:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return z(s);case"XXXX":case"XX":return S(s);case"XXXXX":case"XXX":default:return S(s,":")}},x:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"x":return z(s);case"xxxx":case"xx":return S(s);case"xxxxx":case"xxx":default:return S(s,":")}},O:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Z(s,":");case"OOOO":default:return"GMT"+S(s,":")}},z:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Z(s,":");case"zzzz":default:return"GMT"+S(s,":")}},t:function(t,e,a,r){var i=r._originalDate||t,s=Math.floor(i.getTime()/1e3);return d(s,e.length)},T:function(t,e,a,r){var i=r._originalDate||t,s=i.getTime();return d(s,e.length)}};function Z(n,t){var e=n>0?"-":"+",a=Math.abs(n),r=Math.floor(a/60),i=a%60;if(i===0)return e+String(r);var s=t;return e+String(r)+s+d(i,2)}function z(n,t){if(n%60===0){var e=n>0?"-":"+";return e+d(Math.abs(n)/60,2)}return S(n,t)}function S(n,t){var e=t||"",a=n>0?"-":"+",r=Math.abs(n),i=d(Math.floor(r/60),2),s=d(r%60,2);return a+i+e+s}var ee=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},oe=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},dt=function(t,e){var a=t.match(/(P+)(p+)?/)||[],r=a[1],i=a[2];if(!i)return ee(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ee(r,e)).replace("{{time}}",oe(i,e))},ut={p:oe,P:dt},ht=["D","DD"],gt=["YY","YYYY"];function ft(n){return ht.indexOf(n)!==-1}function mt(n){return gt.indexOf(n)!==-1}function te(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wt=/^'([^]*?)'?$/,Ct=/''/g,Tt=/[a-zA-Z]/;function xt(n,t,e){var a,r,i,s,u,f,h,p,w,g,m,b,M,D;x(2,arguments);var B=String(t),N=X(),L=(a=(r=void 0)!==null&&r!==void 0?r:N.locale)!==null&&a!==void 0?a:Ke,H=j((i=(s=(u=(f=void 0)!==null&&f!==void 0?f:void 0)!==null&&u!==void 0?u:N.firstWeekContainsDate)!==null&&s!==void 0?s:(h=N.locale)===null||h===void 0||(p=h.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(H>=1&&H<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=j((w=(g=(m=(b=void 0)!==null&&b!==void 0?b:void 0)!==null&&m!==void 0?m:N.weekStartsOn)!==null&&g!==void 0?g:(M=N.locale)===null||M===void 0||(D=M.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&w!==void 0?w:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!L.localize)throw new RangeError("locale must contain localize property");if(!L.formatLong)throw new RangeError("locale must contain formatLong property");var R=_(n);if(!ze(R))throw new RangeError("Invalid time value");var se=Xe(R),le=et(R,se),ce={firstWeekContainsDate:H,weekStartsOn:$,locale:L,_originalDate:R},de=B.match(pt).map(function(C){var y=C[0];if(y==="p"||y==="P"){var Y=ut[y];return Y(C,L.formatLong)}return C}).join("").match(vt).map(function(C){if(C==="''")return"'";var y=C[0];if(y==="'")return bt(C);var Y=ct[y];if(Y)return mt(C)&&te(C,t,String(n)),ft(C)&&te(C,t,String(n)),Y(le,C,L.localize,ce);if(y.match(Tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return C}).join("");return de}function bt(n){var t=n.match(wt);return t?t[1].replace(Ct,"'"):n}const _t=(n,t)=>{if(n.isApproved){if(!t||t.status==="approved")return T.APPROVED;if(t.status==="rejected")return T.REJECTED}else{if(!t&&fe(n))return T.DISABLED;if(t&&t.status==="rejected")return T.REJECTED}return t&&t.status==="pending"&&t.assignee?T.UNDER_REVIEW:T.TO_REVIEW};function yt(n){const{collection:t,curation:e,address:a,itemCount:r,onOpenModal:i}=n,s=me(),u=A.useCallback(g=>{window.open(t.forumLink,"_blank"),g.preventDefault(),g.stopPropagation()},[t]),f=A.useCallback((g,m=K.SELF_ASSIGN)=>{i("EditCurationAssigneeModal",{collectionId:t.id,type:m}),g.preventDefault(),g.stopPropagation()},[i,t]),h=A.useCallback(()=>{s.push(ve.itemEditor({collectionId:t.id,isReviewing:"true"}))},[s,t]),p=A.useCallback(()=>{switch(_t(t,e)){case T.APPROVED:return o.jsxs("div",{className:"approved action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.approved")})," ",o.jsx(l.Icon,{name:"check"})]});case T.REJECTED:return o.jsxs("div",{className:"rejected action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.rejected")})," ",o.jsx(l.Icon,{name:"close"})]});case T.DISABLED:return o.jsxs("div",{className:"disabled action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.disabled")})," ",o.jsx(l.Icon,{name:"close"})]});case T.UNDER_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.under_review")]});case T.TO_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]});default:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]})}},[t,e]),w=new Date((e==null?void 0:e.createdAt)||t.createdAt);return o.jsxs(l.Table.Row,{className:"CollectionRow",onClick:h,children:[o.jsx(l.Table.Cell,{width:5,children:o.jsxs("div",{className:"image-column",children:[o.jsx(pe,{collectionId:t.id}),o.jsxs("div",{className:"info",children:[o.jsxs("div",{className:"title",children:[o.jsx(qe,{collection:t}),t.name]}),o.jsx("div",{className:"subtitle name",children:c("collection_row.items",{count:r})})]})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Ge,{isThirdParty:J(t)})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Qe,{isProgrammatic:t.isProgrammatic})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{children:J(t)?"-":o.jsx(V,{textOnly:!0,address:t.owner})})}),o.jsx(l.Table.Cell,{width:3,children:o.jsxs("div",{title:xt(w,"d MMMM yyyy HH:mm"),children:[o.jsx("span",{children:c(e?"collection_row.review_request":"collection_row.published")})," ",Ve(w,{addSuffix:!0})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"actions text-centered",children:p()})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"edit-container",children:e!=null&&e.assignee?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"curator-name",children:[o.jsx(V,{textOnly:!0,address:e.assignee}),a===e.assignee?o.jsxs(o.Fragment,{children:[" (",c("collection_row.you"),")"]}):null," "]}),e.status!==T.APPROVED||!t.isApproved?o.jsx(l.Icon,{name:"pencil",onClick:g=>f(g,K.REASSIGN)}):null]}):o.jsxs("div",{className:"assignee-container",children:[c("collection_row.unassigned"),o.jsx("span",{className:"link",onClick:f,children:c("collection_row.assign_to_me")})]})})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"text-centered",children:t.forumLink?o.jsx("span",{className:"link",onClick:u,children:c("collection_row.link")}):c("collection_row.no_forum_post")})})]},t.id)}const Et=(n,t)=>({address:we(n),itemCount:Ce(n,t.collection.id)}),Dt=n=>({onOpenModal:(t,e)=>n(Te(t,e))}),Ot=re(Et,Dt)(yt);var F=(n=>(n.ALL_STATUS="ALL_STATUS",n))(F||{}),k=(n=>(n.ALL_TYPES="ALL_TYPES",n))(k||{});const U={...T,...F},ae={...xe,...k},G=12,Q="all";let St=class extends be.PureComponent{constructor(){super(...arguments);v(this,"state",{sortBy:O.CREATED_AT_DESC,filterByStatus:F.ALL_STATUS,filterByTags:[],filterByType:k.ALL_TYPES,assignee:Q,searchText:"",page:1});v(this,"getFetchParams",e=>{const{assignee:a,filterByStatus:r,filterByType:i,page:s,searchText:u,sortBy:f,filterByTags:h}=this.state;return{page:s,limit:G,assignee:a!==Q?a:void 0,status:r!==F.ALL_STATUS?r:void 0,type:i!==k.ALL_TYPES?i:void 0,q:u||void 0,sort:f,tag:h.length>0?h:void 0,isPublished:!0,...e}});v(this,"fetchCollections",()=>{const{onFetchCollections:e}=this.props;e(this.getFetchParams())});v(this,"updateParam",e=>{this.setState(e,this.fetchCollections)});v(this,"handleSortChange",(e,{value:a})=>{this.updateParam({sortBy:a,page:1})});v(this,"handleStatusChange",(e,{value:a})=>{this.updateParam({filterByStatus:`${a}`,page:1})});v(this,"handleTypeChange",(e,{value:a})=>{this.updateParam({filterByType:`${a}`,page:1})});v(this,"handleAssigneeChange",(e,{value:a})=>{this.updateParam({assignee:`${a}`,page:1})});v(this,"handleSearchChange",e=>{const{searchText:a}=this.state;e!==a&&this.updateParam({searchText:e,page:1})});v(this,"handlePageChange",(e,a)=>{this.updateParam({page:+a.activePage})});v(this,"handleOnCampaignToggleChange",(e,a)=>{const{campaignTag:r}=this.props,{checked:i}=a;r&&(i?this.updateParam({filterByTags:[...this.state.filterByTags,r]}):this.updateParam({filterByTags:[...this.state.filterByTags.filter(s=>s!==r)]}))});v(this,"renderSortDropdown",()=>{const{sortBy:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:O.MOST_RELEVANT,text:c("curation_page.order.most_relevant")},{value:O.CREATED_AT_DESC,text:c("global.order.newest")},{value:O.NAME_ASC,text:c("global.order.name_asc")},{value:O.NAME_DESC,text:c("global.order.name_desc")}],onChange:this.handleSortChange})});v(this,"renderTypesFilterDropdown",()=>{const{filterByType:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:k.ALL_TYPES,text:c("curation_page.filter.all_types")},{value:ae.STANDARD,text:c("curation_page.filter.standard")},{value:ae.THIRD_PARTY,text:c("curation_page.filter.third_party")}],onChange:this.handleTypeChange})});v(this,"renderStatusFilterDropdown",()=>{const{filterByStatus:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:U.ALL_STATUS,text:c("curation_page.filter.all_status")},{value:U.UNDER_REVIEW,text:c("curation_page.filter.under_review")},{value:U.TO_REVIEW,text:c("curation_page.filter.to_review")},{value:U.APPROVED,text:c("curation_page.filter.approved")},{value:U.REJECTED,text:c("curation_page.filter.rejected")}],onChange:this.handleStatusChange})});v(this,"renderAssigneeFilterDropdown",()=>{const{committeeMembers:e,wallet:a}=this.props,{assignee:r}=this.state;return o.jsx(l.Dropdown,{className:"assignees",direction:"left",value:r,options:[{value:Q,text:c("curation_page.filter.all_assignees")},...e.reduce((i,s)=>(s===a.address?i.unshift(s):i.push(s),i),[]).map(i=>({value:i,text:o.jsx(V,{textOnly:!0,address:i})}))],onChange:this.handleAssigneeChange})});v(this,"renderCampaignFilterToggle",()=>{const{isCampaignEnabled:e,campaignName:a,campaignTag:r}=this.props,{filterByTags:i}=this.state;return e&&a&&r?o.jsx(l.Radio,{toggle:!0,className:"filterByCampaignTag",checked:i.includes(r),onChange:this.handleOnCampaignToggleChange,label:a}):null})}componentDidMount(){const{onFetchCollections:e,wallet:a,isLoadingCommittee:r,isCommitteeMember:i}=this.props;a&&!r&&i&&e({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}componentDidUpdate(e){const{onFetchCollections:a,wallet:r,isLoadingCommittee:i,isCommitteeMember:s}=this.props;r&&!i&&s&&e.isCommitteeMember!==s&&a({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}renderPage(){const{isLoadingCollectionsData:e,isLoadingCommittee:a,collections:r,curationsByCollectionId:i,paginationData:s}=this.props,{page:u,searchText:f}=this.state,h=s==null?void 0:s.total,p=s==null?void 0:s.totalPages,w=r,g=e||a||!s;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"filters",children:o.jsxs(l.Container,{children:[s?o.jsx(l.Row,{className:"text-filter-row",children:o.jsx(l.TextFilter,{placeholder:c("curation_page.search_placeholder"),value:f,onChange:this.handleSearchChange})}):null,o.jsxs(l.Row,{children:[o.jsx(l.Column,{grow:!1,shrink:!1,children:o.jsx(l.Row,{children:!e&&!!h&&h>0&&o.jsx(l.Header,{sub:!0,children:c("collections_page.results",{count:h})})})}),o.jsx(l.Column,{align:"right",shrink:!1,children:o.jsxs(l.Row,{children:[this.renderCampaignFilterToggle(),this.renderAssigneeFilterDropdown(),this.renderTypesFilterDropdown(),this.renderStatusFilterDropdown(),this.renderSortDropdown()]})})]})]})}),g?o.jsx(l.Loader,{active:!0,size:"large"}):o.jsxs(l.Container,{children:[o.jsxs(l.Section,{children:[o.jsx(l.Table,{basic:"very",children:r.length>0?o.jsxs(o.Fragment,{children:[o.jsx(l.Table.Header,{children:o.jsxs(l.Table.Row,{children:[o.jsx(l.Table.HeaderCell,{children:c("collection_row.collection")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.type")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.kind")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.owner")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.date")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.status")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.assignee")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.discussion")})]})}),o.jsx(l.Table.Body,{children:w.map(m=>o.jsx(Ot,{collection:m,curation:i[m.id]||null},m.id))})]}):null}),r.length===0?o.jsx(l.Empty,{height:200,children:o.jsx("div",{children:o.jsx(_e,{id:"curation_page.empty_collections"})})}):null]}),!!p&&p>1&&o.jsx(l.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:p,activePage:u,onPageChange:this.handlePageChange})]})]})}render(){const{isCommitteeMember:e,isConnecting:a,isLoadingCommittee:r}=this.props,i=a||r;return o.jsx(He,{className:"CurationPage",activeTab:$e.CURATION,isLoading:i,children:e?this.renderPage():o.jsx(Be,{})})}};const Pt=n=>{var r;const t=ye(n),e=Ee(n),a=De(n);return{wallet:Oe(n),collections:e,paginationData:a,curationsByCollectionId:t,isCommitteeMember:Se(n),committeeMembers:Pe(n),isConnecting:je(n),isLoadingCommittee:q(Me(n),Re),isLoadingCollectionsData:q(Ne(n),Ye)||q(Le(n),Ae),isCampaignEnabled:Ue(n),campaignTag:Ie(n),campaignName:(r=We(n))==null?void 0:r[Fe(n)]}},jt=n=>({onFetchCollections:t=>n(ke(void 0,t))}),Ht=re(Pt,jt)(St);export{Ht as default};
1
+ var ue=Object.defineProperty;var he=(n,t,e)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var v=(n,t,e)=>he(n,typeof t!="symbol"?t+"":t,e);import{bP as x,bQ as _,cb as j,hD as ge,gt as T,gF as fe,Z as me,D as A,hE as K,K as ve,H as o,G as c,M as l,dC as pe,eQ as J,bD as V,N as re,aH as we,et as Ce,X as Te,ev as xe,af as be,ew as O,bm as _e,hF as ye,ey as Ee,eB as De,e9 as Oe,bt as Se,hG as Pe,a6 as je,bw as q,hH as Me,eD as Ne,gu as Le,eG as Ue,eK as ke,hI as Re,eM as Ye,hJ as Ae}from"./index-41C5YwXr.js";import{d as Ie,e as We,c as Fe}from"./selectors-B-FgaFOX.js";import{N as Be}from"./NotFound-CS8G9Pe7.js";import{L as He}from"./LoggedInDetailPage.container-D9YzD5-u.js";import{N as $e}from"./Navigation.container-DNCp40XB.js";import{C as qe}from"./CollectionStatus.container-Bg3t2d-h.js";import{C as Ge,T as Qe}from"./ThirdPartyKindBadge-1EbBCupx.js";import{s as I,a as Ve}from"./date-B65jEeMH.js";import{g as X,e as Xe,l as Ke}from"./index-5MY3U2K8.js";import"./SignInRequired-oPiM_HvB.js";function Je(n,t){x(2,arguments);var e=_(n).getTime(),a=j(t);return new Date(e+a)}function Ze(n){return x(1,arguments),n instanceof Date||ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ze(n){if(x(1,arguments),!Ze(n)&&typeof n!="number")return!1;var t=_(n);return!isNaN(Number(t))}function et(n,t){x(2,arguments);var e=j(t);return Je(n,-e)}var tt=864e5;function at(n){x(1,arguments);var t=_(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),r=e-a;return Math.floor(r/tt)+1}function W(n){x(1,arguments);var t=1,e=_(n),a=e.getUTCDay(),r=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function ne(n){x(1,arguments);var t=_(n),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var r=W(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=W(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function rt(n){x(1,arguments);var t=ne(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=W(e);return a}var nt=6048e5;function it(n){x(1,arguments);var t=_(n),e=W(t).getTime()-rt(t).getTime();return Math.round(e/nt)+1}function ie(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=_(n),w=p.getUTCFullYear(),g=X(),m=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:g.firstWeekContainsDate)!==null&&a!==void 0?a:(f=g.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(w+1,0,m),b.setUTCHours(0,0,0,0);var M=I(b,t),D=new Date(0);D.setUTCFullYear(w,0,m),D.setUTCHours(0,0,0,0);var B=I(D,t);return p.getTime()>=M.getTime()?w+1:p.getTime()>=B.getTime()?w:w-1}function ot(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=X(),w=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:p.firstWeekContainsDate)!==null&&a!==void 0?a:(f=p.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1),g=ie(n,t),m=new Date(0);m.setUTCFullYear(g,0,w),m.setUTCHours(0,0,0,0);var b=I(m,t);return b}var st=6048e5;function lt(n,t){x(1,arguments);var e=_(n),a=I(e,t).getTime()-ot(e,t).getTime();return Math.round(a/st)+1}function d(n,t){for(var e=n<0?"-":"",a=Math.abs(n).toString();a.length<t;)a="0"+a;return e+a}var E={y:function(t,e){var a=t.getUTCFullYear(),r=a>0?a:1-a;return d(e==="yy"?r%100:r,e.length)},M:function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):d(a+1,2)},d:function(t,e){return d(t.getUTCDate(),e.length)},a:function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(t,e){return d(t.getUTCHours()%12||12,e.length)},H:function(t,e){return d(t.getUTCHours(),e.length)},m:function(t,e){return d(t.getUTCMinutes(),e.length)},s:function(t,e){return d(t.getUTCSeconds(),e.length)},S:function(t,e){var a=e.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,a-3));return d(i,e.length)}},P={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ct={G:function(t,e,a){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(r,{width:"abbreviated"});case"GGGGG":return a.era(r,{width:"narrow"});case"GGGG":default:return a.era(r,{width:"wide"})}},y:function(t,e,a){if(e==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return a.ordinalNumber(i,{unit:"year"})}return E.y(t,e)},Y:function(t,e,a,r){var i=ie(t,r),s=i>0?i:1-i;if(e==="YY"){var u=s%100;return d(u,2)}return e==="Yo"?a.ordinalNumber(s,{unit:"year"}):d(s,e.length)},R:function(t,e){var a=ne(t);return d(a,e.length)},u:function(t,e){var a=t.getUTCFullYear();return d(a,e.length)},Q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return d(r,2);case"Qo":return a.ordinalNumber(r,{unit:"quarter"});case"QQQ":return a.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return d(r,2);case"qo":return a.ordinalNumber(r,{unit:"quarter"});case"qqq":return a.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,a){var r=t.getUTCMonth();switch(e){case"M":case"MM":return E.M(t,e);case"Mo":return a.ordinalNumber(r+1,{unit:"month"});case"MMM":return a.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,a){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return d(r+1,2);case"Lo":return a.ordinalNumber(r+1,{unit:"month"});case"LLL":return a.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,a,r){var i=lt(t,r);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):d(i,e.length)},I:function(t,e,a){var r=it(t);return e==="Io"?a.ordinalNumber(r,{unit:"week"}):d(r,e.length)},d:function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):E.d(t,e)},D:function(t,e,a){var r=at(t);return e==="Do"?a.ordinalNumber(r,{unit:"dayOfYear"}):d(r,e.length)},E:function(t,e,a){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return a.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(r,{width:"short",context:"formatting"});case"EEEE":default:return a.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return d(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return d(s,e.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,a){var r=t.getUTCDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return d(i,e.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(r,{width:"short",context:"formatting"});case"iiii":default:return a.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,a){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,a){var r=t.getUTCHours(),i;switch(r===12?i=P.noon:r===0?i=P.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,a){var r=t.getUTCHours(),i;switch(r>=17?i=P.evening:r>=12?i=P.afternoon:r>=4?i=P.morning:i=P.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,a){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),a.ordinalNumber(r,{unit:"hour"})}return E.h(t,e)},H:function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):E.H(t,e)},K:function(t,e,a){var r=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},k:function(t,e,a){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},m:function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E.m(t,e)},s:function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E.s(t,e)},S:function(t,e){return E.S(t,e)},X:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return z(s);case"XXXX":case"XX":return S(s);case"XXXXX":case"XXX":default:return S(s,":")}},x:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"x":return z(s);case"xxxx":case"xx":return S(s);case"xxxxx":case"xxx":default:return S(s,":")}},O:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Z(s,":");case"OOOO":default:return"GMT"+S(s,":")}},z:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Z(s,":");case"zzzz":default:return"GMT"+S(s,":")}},t:function(t,e,a,r){var i=r._originalDate||t,s=Math.floor(i.getTime()/1e3);return d(s,e.length)},T:function(t,e,a,r){var i=r._originalDate||t,s=i.getTime();return d(s,e.length)}};function Z(n,t){var e=n>0?"-":"+",a=Math.abs(n),r=Math.floor(a/60),i=a%60;if(i===0)return e+String(r);var s=t;return e+String(r)+s+d(i,2)}function z(n,t){if(n%60===0){var e=n>0?"-":"+";return e+d(Math.abs(n)/60,2)}return S(n,t)}function S(n,t){var e=t||"",a=n>0?"-":"+",r=Math.abs(n),i=d(Math.floor(r/60),2),s=d(r%60,2);return a+i+e+s}var ee=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},oe=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},dt=function(t,e){var a=t.match(/(P+)(p+)?/)||[],r=a[1],i=a[2];if(!i)return ee(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ee(r,e)).replace("{{time}}",oe(i,e))},ut={p:oe,P:dt},ht=["D","DD"],gt=["YY","YYYY"];function ft(n){return ht.indexOf(n)!==-1}function mt(n){return gt.indexOf(n)!==-1}function te(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wt=/^'([^]*?)'?$/,Ct=/''/g,Tt=/[a-zA-Z]/;function xt(n,t,e){var a,r,i,s,u,f,h,p,w,g,m,b,M,D;x(2,arguments);var B=String(t),N=X(),L=(a=(r=void 0)!==null&&r!==void 0?r:N.locale)!==null&&a!==void 0?a:Ke,H=j((i=(s=(u=(f=void 0)!==null&&f!==void 0?f:void 0)!==null&&u!==void 0?u:N.firstWeekContainsDate)!==null&&s!==void 0?s:(h=N.locale)===null||h===void 0||(p=h.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(H>=1&&H<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=j((w=(g=(m=(b=void 0)!==null&&b!==void 0?b:void 0)!==null&&m!==void 0?m:N.weekStartsOn)!==null&&g!==void 0?g:(M=N.locale)===null||M===void 0||(D=M.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&w!==void 0?w:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!L.localize)throw new RangeError("locale must contain localize property");if(!L.formatLong)throw new RangeError("locale must contain formatLong property");var R=_(n);if(!ze(R))throw new RangeError("Invalid time value");var se=Xe(R),le=et(R,se),ce={firstWeekContainsDate:H,weekStartsOn:$,locale:L,_originalDate:R},de=B.match(pt).map(function(C){var y=C[0];if(y==="p"||y==="P"){var Y=ut[y];return Y(C,L.formatLong)}return C}).join("").match(vt).map(function(C){if(C==="''")return"'";var y=C[0];if(y==="'")return bt(C);var Y=ct[y];if(Y)return mt(C)&&te(C,t,String(n)),ft(C)&&te(C,t,String(n)),Y(le,C,L.localize,ce);if(y.match(Tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return C}).join("");return de}function bt(n){var t=n.match(wt);return t?t[1].replace(Ct,"'"):n}const _t=(n,t)=>{if(n.isApproved){if(!t||t.status==="approved")return T.APPROVED;if(t.status==="rejected")return T.REJECTED}else{if(!t&&fe(n))return T.DISABLED;if(t&&t.status==="rejected")return T.REJECTED}return t&&t.status==="pending"&&t.assignee?T.UNDER_REVIEW:T.TO_REVIEW};function yt(n){const{collection:t,curation:e,address:a,itemCount:r,onOpenModal:i}=n,s=me(),u=A.useCallback(g=>{window.open(t.forumLink,"_blank"),g.preventDefault(),g.stopPropagation()},[t]),f=A.useCallback((g,m=K.SELF_ASSIGN)=>{i("EditCurationAssigneeModal",{collectionId:t.id,type:m}),g.preventDefault(),g.stopPropagation()},[i,t]),h=A.useCallback(()=>{s.push(ve.itemEditor({collectionId:t.id,isReviewing:"true"}))},[s,t]),p=A.useCallback(()=>{switch(_t(t,e)){case T.APPROVED:return o.jsxs("div",{className:"approved action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.approved")})," ",o.jsx(l.Icon,{name:"check"})]});case T.REJECTED:return o.jsxs("div",{className:"rejected action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.rejected")})," ",o.jsx(l.Icon,{name:"close"})]});case T.DISABLED:return o.jsxs("div",{className:"disabled action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.disabled")})," ",o.jsx(l.Icon,{name:"close"})]});case T.UNDER_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.under_review")]});case T.TO_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]});default:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]})}},[t,e]),w=new Date((e==null?void 0:e.createdAt)||t.createdAt);return o.jsxs(l.Table.Row,{className:"CollectionRow",onClick:h,children:[o.jsx(l.Table.Cell,{width:5,children:o.jsxs("div",{className:"image-column",children:[o.jsx(pe,{collectionId:t.id}),o.jsxs("div",{className:"info",children:[o.jsxs("div",{className:"title",children:[o.jsx(qe,{collection:t}),t.name]}),o.jsx("div",{className:"subtitle name",children:c("collection_row.items",{count:r})})]})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Ge,{isThirdParty:J(t)})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Qe,{isProgrammatic:t.isProgrammatic})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{children:J(t)?"-":o.jsx(V,{textOnly:!0,address:t.owner})})}),o.jsx(l.Table.Cell,{width:3,children:o.jsxs("div",{title:xt(w,"d MMMM yyyy HH:mm"),children:[o.jsx("span",{children:c(e?"collection_row.review_request":"collection_row.published")})," ",Ve(w,{addSuffix:!0})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"actions text-centered",children:p()})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"edit-container",children:e!=null&&e.assignee?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"curator-name",children:[o.jsx(V,{textOnly:!0,address:e.assignee}),a===e.assignee?o.jsxs(o.Fragment,{children:[" (",c("collection_row.you"),")"]}):null," "]}),e.status!==T.APPROVED||!t.isApproved?o.jsx(l.Icon,{name:"pencil",onClick:g=>f(g,K.REASSIGN)}):null]}):o.jsxs("div",{className:"assignee-container",children:[c("collection_row.unassigned"),o.jsx("span",{className:"link",onClick:f,children:c("collection_row.assign_to_me")})]})})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"text-centered",children:t.forumLink?o.jsx("span",{className:"link",onClick:u,children:c("collection_row.link")}):c("collection_row.no_forum_post")})})]},t.id)}const Et=(n,t)=>({address:we(n),itemCount:Ce(n,t.collection.id)}),Dt=n=>({onOpenModal:(t,e)=>n(Te(t,e))}),Ot=re(Et,Dt)(yt);var F=(n=>(n.ALL_STATUS="ALL_STATUS",n))(F||{}),k=(n=>(n.ALL_TYPES="ALL_TYPES",n))(k||{});const U={...T,...F},ae={...xe,...k},G=12,Q="all";let St=class extends be.PureComponent{constructor(){super(...arguments);v(this,"state",{sortBy:O.CREATED_AT_DESC,filterByStatus:F.ALL_STATUS,filterByTags:[],filterByType:k.ALL_TYPES,assignee:Q,searchText:"",page:1});v(this,"getFetchParams",e=>{const{assignee:a,filterByStatus:r,filterByType:i,page:s,searchText:u,sortBy:f,filterByTags:h}=this.state;return{page:s,limit:G,assignee:a!==Q?a:void 0,status:r!==F.ALL_STATUS?r:void 0,type:i!==k.ALL_TYPES?i:void 0,q:u||void 0,sort:f,tag:h.length>0?h:void 0,isPublished:!0,...e}});v(this,"fetchCollections",()=>{const{onFetchCollections:e}=this.props;e(this.getFetchParams())});v(this,"updateParam",e=>{this.setState(e,this.fetchCollections)});v(this,"handleSortChange",(e,{value:a})=>{this.updateParam({sortBy:a,page:1})});v(this,"handleStatusChange",(e,{value:a})=>{this.updateParam({filterByStatus:`${a}`,page:1})});v(this,"handleTypeChange",(e,{value:a})=>{this.updateParam({filterByType:`${a}`,page:1})});v(this,"handleAssigneeChange",(e,{value:a})=>{this.updateParam({assignee:`${a}`,page:1})});v(this,"handleSearchChange",e=>{const{searchText:a}=this.state;e!==a&&this.updateParam({searchText:e,page:1})});v(this,"handlePageChange",(e,a)=>{this.updateParam({page:+a.activePage})});v(this,"handleOnCampaignToggleChange",(e,a)=>{const{campaignTag:r}=this.props,{checked:i}=a;r&&(i?this.updateParam({filterByTags:[...this.state.filterByTags,r]}):this.updateParam({filterByTags:[...this.state.filterByTags.filter(s=>s!==r)]}))});v(this,"renderSortDropdown",()=>{const{sortBy:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:O.MOST_RELEVANT,text:c("curation_page.order.most_relevant")},{value:O.CREATED_AT_DESC,text:c("global.order.newest")},{value:O.NAME_ASC,text:c("global.order.name_asc")},{value:O.NAME_DESC,text:c("global.order.name_desc")}],onChange:this.handleSortChange})});v(this,"renderTypesFilterDropdown",()=>{const{filterByType:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:k.ALL_TYPES,text:c("curation_page.filter.all_types")},{value:ae.STANDARD,text:c("curation_page.filter.standard")},{value:ae.THIRD_PARTY,text:c("curation_page.filter.third_party")}],onChange:this.handleTypeChange})});v(this,"renderStatusFilterDropdown",()=>{const{filterByStatus:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:U.ALL_STATUS,text:c("curation_page.filter.all_status")},{value:U.UNDER_REVIEW,text:c("curation_page.filter.under_review")},{value:U.TO_REVIEW,text:c("curation_page.filter.to_review")},{value:U.APPROVED,text:c("curation_page.filter.approved")},{value:U.REJECTED,text:c("curation_page.filter.rejected")}],onChange:this.handleStatusChange})});v(this,"renderAssigneeFilterDropdown",()=>{const{committeeMembers:e,wallet:a}=this.props,{assignee:r}=this.state;return o.jsx(l.Dropdown,{className:"assignees",direction:"left",value:r,options:[{value:Q,text:c("curation_page.filter.all_assignees")},...e.reduce((i,s)=>(s===a.address?i.unshift(s):i.push(s),i),[]).map(i=>({value:i,text:o.jsx(V,{textOnly:!0,address:i})}))],onChange:this.handleAssigneeChange})});v(this,"renderCampaignFilterToggle",()=>{const{isCampaignEnabled:e,campaignName:a,campaignTag:r}=this.props,{filterByTags:i}=this.state;return e&&a&&r?o.jsx(l.Radio,{toggle:!0,className:"filterByCampaignTag",checked:i.includes(r),onChange:this.handleOnCampaignToggleChange,label:a}):null})}componentDidMount(){const{onFetchCollections:e,wallet:a,isLoadingCommittee:r,isCommitteeMember:i}=this.props;a&&!r&&i&&e({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}componentDidUpdate(e){const{onFetchCollections:a,wallet:r,isLoadingCommittee:i,isCommitteeMember:s}=this.props;r&&!i&&s&&e.isCommitteeMember!==s&&a({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}renderPage(){const{isLoadingCollectionsData:e,isLoadingCommittee:a,collections:r,curationsByCollectionId:i,paginationData:s}=this.props,{page:u,searchText:f}=this.state,h=s==null?void 0:s.total,p=s==null?void 0:s.totalPages,w=r,g=e||a||!s;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"filters",children:o.jsxs(l.Container,{children:[s?o.jsx(l.Row,{className:"text-filter-row",children:o.jsx(l.TextFilter,{placeholder:c("curation_page.search_placeholder"),value:f,onChange:this.handleSearchChange})}):null,o.jsxs(l.Row,{children:[o.jsx(l.Column,{grow:!1,shrink:!1,children:o.jsx(l.Row,{children:!e&&!!h&&h>0&&o.jsx(l.Header,{sub:!0,children:c("collections_page.results",{count:h})})})}),o.jsx(l.Column,{align:"right",shrink:!1,children:o.jsxs(l.Row,{children:[this.renderCampaignFilterToggle(),this.renderAssigneeFilterDropdown(),this.renderTypesFilterDropdown(),this.renderStatusFilterDropdown(),this.renderSortDropdown()]})})]})]})}),g?o.jsx(l.Loader,{active:!0,size:"large"}):o.jsxs(l.Container,{children:[o.jsxs(l.Section,{children:[o.jsx(l.Table,{basic:"very",children:r.length>0?o.jsxs(o.Fragment,{children:[o.jsx(l.Table.Header,{children:o.jsxs(l.Table.Row,{children:[o.jsx(l.Table.HeaderCell,{children:c("collection_row.collection")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.type")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.kind")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.owner")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.date")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.status")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.assignee")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.discussion")})]})}),o.jsx(l.Table.Body,{children:w.map(m=>o.jsx(Ot,{collection:m,curation:i[m.id]||null},m.id))})]}):null}),r.length===0?o.jsx(l.Empty,{height:200,children:o.jsx("div",{children:o.jsx(_e,{id:"curation_page.empty_collections"})})}):null]}),!!p&&p>1&&o.jsx(l.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:p,activePage:u,onPageChange:this.handlePageChange})]})]})}render(){const{isCommitteeMember:e,isConnecting:a,isLoadingCommittee:r}=this.props,i=a||r;return o.jsx(He,{className:"CurationPage",activeTab:$e.CURATION,isLoading:i,children:e?this.renderPage():o.jsx(Be,{})})}};const Pt=n=>{var r;const t=ye(n),e=Ee(n),a=De(n);return{wallet:Oe(n),collections:e,paginationData:a,curationsByCollectionId:t,isCommitteeMember:Se(n),committeeMembers:Pe(n),isConnecting:je(n),isLoadingCommittee:q(Me(n),Re),isLoadingCollectionsData:q(Ne(n),Ye)||q(Le(n),Ae),isCampaignEnabled:Ue(n),campaignTag:Ie(n),campaignName:(r=We(n))==null?void 0:r[Fe(n)]}},jt=n=>({onFetchCollections:t=>n(ke(void 0,t))}),Ht=re(Pt,jt)(St);export{Ht as default};
@@ -1 +1 @@
1
- var U=Object.defineProperty;var A=(t,n,s)=>n in t?U(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var d=(t,n,s)=>A(t,typeof n!="symbol"?n+"":n,s);import{D as p,E as H,F as W,G as a,H as e,I as q,J as v,L,K as _,M as o,N as w,O as z,P as J,Q as I,R as K,S as V,T as Z,U as G,V as Q,W as X,X as B,Y,Z as ee,$ as se,a0 as te,a1 as ne,a2 as b,a3 as oe,a4 as ae,a5 as ce,a6 as re,a7 as le,a8 as ie,a9 as de,aa as pe,ab as je,ac as he,ad as me}from"./index-flmdvOR7.js";import{O as ge}from"./OptionsDropdown-CHYbz4e5.js";import{S as ue}from"./SDKTag-cIoqxMfH.js";import{L as xe}from"./LoggedInDetailPage.container-CP5QlkqP.js";import{N as Pe,S as Ce}from"./Navigation.container-Caaq2HYh.js";import"./SignInRequired-CqwdQCfU.js";import"./selectors-DV14n6nm.js";var E;let Se=(E=class extends p.PureComponent{constructor(){super(...arguments);d(this,"state",{isDeleting:!1});d(this,"handleOnClick",()=>{const{onClick:s,project:c}=this.props;s&&s(c)});d(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});d(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});d(this,"handleDeleteProject",()=>{const{project:s,onDeleteProject:c}=this.props;c(s),this.setState({isDeleting:!1})});d(this,"handleDuplicateProject",()=>{const{project:s,onDuplicateProject:c}=this.props;c(s)});d(this,"handleExportScene",()=>{this.props.onOpenModal("ExportModal",{project:this.props.project})})}componentDidMount(){this.props.onLoadProjectScene(this.props.project,this.props.type)}render(){const{project:s,parcels:c,items:l,onClick:j,isUploading:m,hasError:f,scene:g}=this.props,{isDeleting:i}=this.state,u="likes"in s;let P={},x="ProjectCard",h=H(s,g);h&&(h&&W(h)&&(h+=`?updated_at=${+new Date(s.updatedAt)}`),P={backgroundImage:`url(${h})`},x+=" has-thumbnail");const N=[{text:a("scenes_page.project_actions.duplicate_project"),handler:this.handleDuplicateProject},{text:a("scenes_page.project_actions.export_project"),handler:this.handleExportScene},{text:a("scenes_page.project_actions.delete_project"),handler:this.handleConfirmDeleteProject}],C=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"project-thumbnail",style:P}),u?null:e.jsxs(e.Fragment,{children:[e.jsx(q,{projectId:s.id,className:"deployment-status"}),e.jsxs("div",{className:"options-container",children:[e.jsx(ue,{scene:g}),e.jsx(ge,{className:"options-dropdown",options:N})]})]}),e.jsxs("div",{className:"project-data",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx("div",{className:"title",children:s.title}),m?e.jsx(v,{name:"cloud-upload",className:"is-uploading"}):null,!m&&f?e.jsx("div",{className:"error-indicator"}):null]}),e.jsxs("div",{className:"description",title:s.description,children:[e.jsx(v,{name:"scene-parcel"})," ",a("public_page.parcel_count",{parcels:c}),e.jsx(v,{name:"scene-object"})," ",a("project_card.item_count",{items:l})]})]})]});return e.jsxs(e.Fragment,{children:[j?e.jsx("div",{className:x,onClick:this.handleOnClick,children:C}):e.jsx(L,{to:u?_.poolView(s.id,"pool"):_.sceneDetail(s.id),className:x,children:C}),e.jsx(o.Confirm,{size:"tiny",open:i,header:a("project_card.confirm_delete_header",{title:s.title}),content:a("project_card.confirm_delete_content",{title:s.title}),confirmButton:e.jsx(o.Button,{primary:!0,children:a("global.confirm")}),cancelButton:e.jsx(o.Button,{secondary:!0,children:a("global.cancel")}),onCancel:this.handleCancelDeleteProject,onConfirm:this.handleDeleteProject})]})}},d(E,"defaultProps",{items:0,parcels:0}),E);const _e=(t,n)=>{const{project:s}=n,c=s.layout.cols*s.layout.rows,l=z(t)[s.sceneId],j=l&&l.sdk6?Object.keys(l.sdk6.entities).length-c:0,m=J(t)[s.id]?I.POOL:I.PROJECT;return{parcels:c,items:j,scene:l,deploymentStatus:K(t)[n.project.id],deployments:V(t)[n.project.id],isUploading:Z(t).has(s.id),hasError:G(t).has(s.id),type:m}},fe=t=>({onDeleteProject:n=>t(Q(n)),onDuplicateProject:n=>t(X(n)),onOpenModal:(n,s)=>t(B(n,s)),onLoadProjectScene:(n,s)=>t(Y(n,s))}),O=w(_e,fe)(Se),M=t=>{const{page:n,poolList:s,projects:c,sortBy:l,totalPages:j,isFetching:m,isLoggingIn:f,onLoadFromScenePool:g,onOpenModal:i}=t,u=ee();p.useEffect(()=>{g({sortBy:"updated_at",sortOrder:"desc"})},[g,i]),p.useEffect(()=>{se()&&i("WorldsForENSOwnersAnnouncementModal")},[i]);const P=p.useCallback(()=>{i("ImportModal")},[i]),x=p.useCallback(()=>{i("SceneCreationModal")},[i]),h=()=>e.jsx(o.Button,{inverted:!0,className:"import-scene",onClick:P,children:a("scenes_page.upload_scene")}),N=()=>e.jsx(o.Button,{primary:!0,className:"create-scene",onClick:x,children:a("scenes_page.create_scene")}),C=()=>e.jsx(o.Dropdown,{direction:"left",value:l,options:[{value:b.NEWEST,text:a("scenes_page.sort.newest")},{value:b.NAME,text:a("scenes_page.sort.name")},{value:b.SIZE,text:a("scenes_page.sort.size")}],onChange:R}),F=()=>c.length>0?e.jsx("div",{className:"CardList",children:c.map(r=>e.jsx(O,{project:r},r.id))}):e.jsxs("div",{className:"no-scenes-container",children:[e.jsx("h3",{className:"no-scenes-title",children:a("scenes_page.no_scenes.title")}),e.jsx("span",{className:"no-scenes-description",children:a("scenes_page.no_scenes.description",{a:r=>e.jsx("a",{rel:"noreferrer",target:"_blank",href:"https://docs.decentraland.org/creator/development-guide/sdk-101/",children:r})})}),e.jsx(oe,{})]}),S=p.useCallback((r={})=>{u.push(_.scenes({page:n,sortBy:l,...r}))},[n,l,u]),R=p.useCallback((r,{value:y})=>S({sortBy:y}),[S]),T=p.useCallback((r,{activePage:y})=>S({page:y}),[S]);if(f||m)return e.jsx(te,{});const k=j>1,D={firstItem:null,lastItem:null};n===1&&(D.prevItem=null),n===j&&(D.nextItem=null);const $=()=>e.jsxs(e.Fragment,{children:[e.jsx(Ce,{}),e.jsxs(o.Container,{children:[e.jsxs(o.Section,{className:"projects-menu",children:[e.jsxs(o.Row,{children:[e.jsx(o.Column,{children:e.jsx(o.Header,{children:a("scenes_page.my_scenes")})}),e.jsx(o.Column,{align:"right",children:e.jsxs("div",{className:"actions",children:[h(),N()]})})]}),e.jsxs(o.Row,{className:"actions",children:[e.jsx(o.Column,{children:e.jsx("div",{className:"items-count",children:a("scenes_page.results",{count:c.length})})}),e.jsx(o.Column,{align:"right",children:c.length>1?C():null})]})]}),e.jsxs(o.Section,{className:ne("project-cards",{"has-pagination":k}),children:[F(),k?e.jsx(o.Pagination,{...D,activePage:n,totalPages:j,onPageChange:T}):null]}),s?e.jsxs(e.Fragment,{children:[e.jsxs(o.Row,{children:[e.jsx(o.Row,{className:"scene-pool-menu",children:e.jsx(o.Header,{sub:!0,children:a("scenes_page.from_scene_pool")})}),e.jsx(o.Row,{align:"right",children:e.jsx(L,{to:_.poolSearch(),children:e.jsxs(o.Button,{basic:!0,children:[a("global.view_more")," ",e.jsx(o.Icon,{name:"chevron right"})]})})})]}),e.jsx("div",{className:"scene-pool-projects",children:s.map(r=>e.jsx(O,{project:r},r.id))})]}):null]})]});return e.jsx(xe,{className:"ScenesPage",activeTab:Pe.SCENES,children:$()})};M.defaultProps={projects:[]};const Ne=M,De=t=>({projects:ae(t),isLoggingIn:ce(t)||re(t),isFetching:le(t),page:ie(t),sortBy:de(t),totalPages:pe(t),didCreate:je(t),poolList:he(t)}),ye=t=>({onOpenModal:(n,s)=>t(B(n,s)),onLoadFromScenePool:n=>t(me(n))}),Me=w(De,ye)(Ne);export{Me as default};
1
+ var U=Object.defineProperty;var A=(t,n,s)=>n in t?U(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var d=(t,n,s)=>A(t,typeof n!="symbol"?n+"":n,s);import{D as p,E as H,F as W,G as a,H as e,I as q,J as v,L,K as _,M as o,N as w,O as z,P as J,Q as I,R as K,S as V,T as Z,U as G,V as Q,W as X,X as B,Y,Z as ee,$ as se,a0 as te,a1 as ne,a2 as b,a3 as oe,a4 as ae,a5 as ce,a6 as re,a7 as le,a8 as ie,a9 as de,aa as pe,ab as je,ac as he,ad as me}from"./index-41C5YwXr.js";import{O as ge}from"./OptionsDropdown-C_I20F2W.js";import{S as ue}from"./SDKTag-DOrmnsZR.js";import{L as xe}from"./LoggedInDetailPage.container-D9YzD5-u.js";import{N as Pe,S as Ce}from"./Navigation.container-DNCp40XB.js";import"./SignInRequired-oPiM_HvB.js";import"./selectors-B-FgaFOX.js";var E;let Se=(E=class extends p.PureComponent{constructor(){super(...arguments);d(this,"state",{isDeleting:!1});d(this,"handleOnClick",()=>{const{onClick:s,project:c}=this.props;s&&s(c)});d(this,"handleConfirmDeleteProject",()=>{this.setState({isDeleting:!0})});d(this,"handleCancelDeleteProject",()=>{this.setState({isDeleting:!1})});d(this,"handleDeleteProject",()=>{const{project:s,onDeleteProject:c}=this.props;c(s),this.setState({isDeleting:!1})});d(this,"handleDuplicateProject",()=>{const{project:s,onDuplicateProject:c}=this.props;c(s)});d(this,"handleExportScene",()=>{this.props.onOpenModal("ExportModal",{project:this.props.project})})}componentDidMount(){this.props.onLoadProjectScene(this.props.project,this.props.type)}render(){const{project:s,parcels:c,items:l,onClick:j,isUploading:m,hasError:f,scene:g}=this.props,{isDeleting:i}=this.state,u="likes"in s;let P={},x="ProjectCard",h=H(s,g);h&&(h&&W(h)&&(h+=`?updated_at=${+new Date(s.updatedAt)}`),P={backgroundImage:`url(${h})`},x+=" has-thumbnail");const N=[{text:a("scenes_page.project_actions.duplicate_project"),handler:this.handleDuplicateProject},{text:a("scenes_page.project_actions.export_project"),handler:this.handleExportScene},{text:a("scenes_page.project_actions.delete_project"),handler:this.handleConfirmDeleteProject}],C=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"project-thumbnail",style:P}),u?null:e.jsxs(e.Fragment,{children:[e.jsx(q,{projectId:s.id,className:"deployment-status"}),e.jsxs("div",{className:"options-container",children:[e.jsx(ue,{scene:g}),e.jsx(ge,{className:"options-dropdown",options:N})]})]}),e.jsxs("div",{className:"project-data",children:[e.jsxs("div",{className:"title-wrapper",children:[e.jsx("div",{className:"title",children:s.title}),m?e.jsx(v,{name:"cloud-upload",className:"is-uploading"}):null,!m&&f?e.jsx("div",{className:"error-indicator"}):null]}),e.jsxs("div",{className:"description",title:s.description,children:[e.jsx(v,{name:"scene-parcel"})," ",a("public_page.parcel_count",{parcels:c}),e.jsx(v,{name:"scene-object"})," ",a("project_card.item_count",{items:l})]})]})]});return e.jsxs(e.Fragment,{children:[j?e.jsx("div",{className:x,onClick:this.handleOnClick,children:C}):e.jsx(L,{to:u?_.poolView(s.id,"pool"):_.sceneDetail(s.id),className:x,children:C}),e.jsx(o.Confirm,{size:"tiny",open:i,header:a("project_card.confirm_delete_header",{title:s.title}),content:a("project_card.confirm_delete_content",{title:s.title}),confirmButton:e.jsx(o.Button,{primary:!0,children:a("global.confirm")}),cancelButton:e.jsx(o.Button,{secondary:!0,children:a("global.cancel")}),onCancel:this.handleCancelDeleteProject,onConfirm:this.handleDeleteProject})]})}},d(E,"defaultProps",{items:0,parcels:0}),E);const _e=(t,n)=>{const{project:s}=n,c=s.layout.cols*s.layout.rows,l=z(t)[s.sceneId],j=l&&l.sdk6?Object.keys(l.sdk6.entities).length-c:0,m=J(t)[s.id]?I.POOL:I.PROJECT;return{parcels:c,items:j,scene:l,deploymentStatus:K(t)[n.project.id],deployments:V(t)[n.project.id],isUploading:Z(t).has(s.id),hasError:G(t).has(s.id),type:m}},fe=t=>({onDeleteProject:n=>t(Q(n)),onDuplicateProject:n=>t(X(n)),onOpenModal:(n,s)=>t(B(n,s)),onLoadProjectScene:(n,s)=>t(Y(n,s))}),O=w(_e,fe)(Se),M=t=>{const{page:n,poolList:s,projects:c,sortBy:l,totalPages:j,isFetching:m,isLoggingIn:f,onLoadFromScenePool:g,onOpenModal:i}=t,u=ee();p.useEffect(()=>{g({sortBy:"updated_at",sortOrder:"desc"})},[g,i]),p.useEffect(()=>{se()&&i("WorldsForENSOwnersAnnouncementModal")},[i]);const P=p.useCallback(()=>{i("ImportModal")},[i]),x=p.useCallback(()=>{i("SceneCreationModal")},[i]),h=()=>e.jsx(o.Button,{inverted:!0,className:"import-scene",onClick:P,children:a("scenes_page.upload_scene")}),N=()=>e.jsx(o.Button,{primary:!0,className:"create-scene",onClick:x,children:a("scenes_page.create_scene")}),C=()=>e.jsx(o.Dropdown,{direction:"left",value:l,options:[{value:b.NEWEST,text:a("scenes_page.sort.newest")},{value:b.NAME,text:a("scenes_page.sort.name")},{value:b.SIZE,text:a("scenes_page.sort.size")}],onChange:R}),F=()=>c.length>0?e.jsx("div",{className:"CardList",children:c.map(r=>e.jsx(O,{project:r},r.id))}):e.jsxs("div",{className:"no-scenes-container",children:[e.jsx("h3",{className:"no-scenes-title",children:a("scenes_page.no_scenes.title")}),e.jsx("span",{className:"no-scenes-description",children:a("scenes_page.no_scenes.description",{a:r=>e.jsx("a",{rel:"noreferrer",target:"_blank",href:"https://docs.decentraland.org/creator/development-guide/sdk-101/",children:r})})}),e.jsx(oe,{})]}),S=p.useCallback((r={})=>{u.push(_.scenes({page:n,sortBy:l,...r}))},[n,l,u]),R=p.useCallback((r,{value:y})=>S({sortBy:y}),[S]),T=p.useCallback((r,{activePage:y})=>S({page:y}),[S]);if(f||m)return e.jsx(te,{});const k=j>1,D={firstItem:null,lastItem:null};n===1&&(D.prevItem=null),n===j&&(D.nextItem=null);const $=()=>e.jsxs(e.Fragment,{children:[e.jsx(Ce,{}),e.jsxs(o.Container,{children:[e.jsxs(o.Section,{className:"projects-menu",children:[e.jsxs(o.Row,{children:[e.jsx(o.Column,{children:e.jsx(o.Header,{children:a("scenes_page.my_scenes")})}),e.jsx(o.Column,{align:"right",children:e.jsxs("div",{className:"actions",children:[h(),N()]})})]}),e.jsxs(o.Row,{className:"actions",children:[e.jsx(o.Column,{children:e.jsx("div",{className:"items-count",children:a("scenes_page.results",{count:c.length})})}),e.jsx(o.Column,{align:"right",children:c.length>1?C():null})]})]}),e.jsxs(o.Section,{className:ne("project-cards",{"has-pagination":k}),children:[F(),k?e.jsx(o.Pagination,{...D,activePage:n,totalPages:j,onPageChange:T}):null]}),s?e.jsxs(e.Fragment,{children:[e.jsxs(o.Row,{children:[e.jsx(o.Row,{className:"scene-pool-menu",children:e.jsx(o.Header,{sub:!0,children:a("scenes_page.from_scene_pool")})}),e.jsx(o.Row,{align:"right",children:e.jsx(L,{to:_.poolSearch(),children:e.jsxs(o.Button,{basic:!0,children:[a("global.view_more")," ",e.jsx(o.Icon,{name:"chevron right"})]})})})]}),e.jsx("div",{className:"scene-pool-projects",children:s.map(r=>e.jsx(O,{project:r},r.id))})]}):null]})]});return e.jsx(xe,{className:"ScenesPage",activeTab:Pe.SCENES,children:$()})};M.defaultProps={projects:[]};const Ne=M,De=t=>({projects:ae(t),isLoggingIn:ce(t)||re(t),isFetching:le(t),page:ie(t),sortBy:de(t),totalPages:pe(t),didCreate:je(t),poolList:he(t)}),ye=t=>({onOpenModal:(n,s)=>t(B(n,s)),onLoadFromScenePool:n=>t(me(n))}),Me=w(De,ye)(Ne);export{Me as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Di1kuK40.js","assets/index-flmdvOR7.js","assets/index-C_fzrRU7.css"])))=>i.map(i=>d[i]);
2
- import{B as pe,_ as me}from"./index-flmdvOR7.js";const he=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,ge=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ye=e=>ge(e)&&e[he]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.4.0",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.4.0",VITE_REACT_APP_WEBSITE_VERSION:"7.4.0"},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),k})=>[W,C,x,e,t,s,n,l,c,d,f],[be]=ve();function P(e={}){return be(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=pe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),_e={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;_e.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))We.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const S={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await S.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await S.getMobileListings(d):await S.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))je.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=P({themeMode:Te()?"dark":"light"}),ce={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},M=P({open:!1,message:"",variant:"success"}),Ve={state:M,subscribe(e){return D(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class $e{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await me(()=>import("./index-Di1kuK40.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const xe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:$e},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,J as M,w as O,de as R,ce as T,Ve as a,_e as b,$ as c,xe as i};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C76j8aLR.js","assets/index-41C5YwXr.js","assets/index-bgb_kBBP.css"])))=>i.map(i=>d[i]);
2
+ import{B as pe,_ as me}from"./index-41C5YwXr.js";const he=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,ge=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ye=e=>ge(e)&&e[he]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.4.1",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.4.1",VITE_REACT_APP_WEBSITE_VERSION:"7.4.1"},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),k})=>[W,C,x,e,t,s,n,l,c,d,f],[be]=ve();function P(e={}){return be(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=pe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),_e={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;_e.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))We.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const S={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await S.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await S.getMobileListings(d):await S.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))je.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=P({themeMode:Te()?"dark":"light"}),ce={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},M=P({open:!1,message:"",variant:"success"}),Ve={state:M,subscribe(e){return D(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class $e{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await me(()=>import("./index-C76j8aLR.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const xe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:$e},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,J as M,w as O,de as R,ce as T,Ve as a,_e as b,$ as c,xe as i};