@dcl/builder-site 7.5.2 → 7.5.3-14250105591.commit-7ff05e9

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 (83) hide show
  1. package/assets/{Back-Cy5tYzli.js → Back-BkpyoCAY.js} +1 -1
  2. package/assets/{CollectionProvider.container-CW_zWdaa.js → CollectionProvider.container-LOnmK4xH.js} +1 -1
  3. package/assets/{CollectionStatus.container-D08wunRo.js → CollectionStatus.container-FLYwKcou.js} +1 -1
  4. package/assets/{ConfirmDelete-Btz6sBc4.js → ConfirmDelete-D4mjWmik.js} +1 -1
  5. package/assets/{FileSaver.min-FVnLR7ir.js → FileSaver.min-lNGwbtcQ.js} +1 -1
  6. package/assets/{ItemProvider.container-hJXeDVSX.js → ItemProvider.container-DtX9kVCF.js} +1 -1
  7. package/assets/{JumpIn.container-COSosTsB.js → JumpIn.container-BmP0n4hi.js} +1 -1
  8. package/assets/{LandAction-CmyqKt3l.js → LandAction-Gum9D-m8.js} +1 -1
  9. package/assets/{LandProviderPage-xgVhzIjd.js → LandProviderPage-HLtQrg9M.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-B8TGqDoF.js → LoggedInDetailPage.container-CgFwp3V3.js} +1 -1
  11. package/assets/{Navigation-rBETZsPE.css → Navigation-X2na0dRV.css} +1 -1
  12. package/assets/{Navigation.container-DJtxfRRt.js → Navigation.container-BbpkLQDF.js} +1 -1
  13. package/assets/{NotFound-BQyWo_Im.js → NotFound-Ddv7NXtb.js} +1 -1
  14. package/assets/{OptionsDropdown-C2U5fMGS.js → OptionsDropdown-BzVjeqIv.js} +1 -1
  15. package/assets/{RentalPeriod-Dd_P2kg3.js → RentalPeriod-NweYyW08.js} +1 -1
  16. package/assets/{SDKTag-AgGLikSM.js → SDKTag-N7iMh6WZ.js} +1 -1
  17. package/assets/{SceneStats.container-JXQ_acYu.js → SceneStats.container-CX3fmQRJ.js} +1 -1
  18. package/assets/{SignInRequired-B3OGhAh6.js → SignInRequired-tDYtCZho.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-2hMuPTNv.js → ThirdPartyKindBadge-BV3iO92u.js} +1 -1
  20. package/assets/{dataReader-CQnBlEgj.js → dataReader-BspYqO8P.js} +1 -1
  21. package/assets/{date-COloroLQ.js → date-Clh6TJNW.js} +1 -1
  22. package/assets/{fortmatic-DcFa7fjx.js → fortmatic-B1fYROG-.js} +1 -1
  23. package/assets/index-2lVhOxDP.css +1 -0
  24. package/assets/{index-t67_y2Og.css → index-B92_8zaP.css} +1 -1
  25. package/assets/index-B9nEFvwI.css +1 -0
  26. package/assets/{index-DMkwjfoM.js → index-B9nGP-If.js} +1 -1
  27. package/assets/{index-CcH0aMtQ.js → index-BALQDIoy.js} +1 -1
  28. package/assets/index-BD2zPAsF.js +1 -0
  29. package/assets/{index-Rmd_FYyU.js → index-BIfgCtmO.js} +1 -1
  30. package/assets/{index-BvABHZ3M.js → index-BM7N3cSK.js} +1 -1
  31. package/assets/{index-CXF03ZAx.js → index-BMG02wFc.js} +1 -1
  32. package/assets/{index-m8sOrrZx.js → index-BRaPIKIQ.js} +1 -1
  33. package/assets/{index-D-tfJ7b5.js → index-BS1H25M7.js} +1 -1
  34. package/assets/{index-BDPSwEjb.js → index-BV7wg5QO.js} +1 -1
  35. package/assets/{index-DKJ6arzS.js → index-BWj-z7gk.js} +1 -1
  36. package/assets/{index-BcM1VhcW.js → index-BdqLiJL5.js} +1 -1
  37. package/assets/{index-c86AiX98.js → index-BiE1Oa5_.js} +1 -1
  38. package/assets/{index-C0BbzvHL.js → index-BiSb4akZ.js} +1 -1
  39. package/assets/{index-848Faqkk.js → index-Boh4Dsb1.js} +1 -1
  40. package/assets/{index-CzsFE3o2.js → index-ByKiiwBs.js} +1 -1
  41. package/assets/{index-gRMvZldM.js → index-BzFsEtM5.js} +1 -1
  42. package/assets/index-CT2XPmEx.js +1 -0
  43. package/assets/{index-BHncblxO.js → index-CX6JyA5T.js} +1 -1
  44. package/assets/{index-BfV1jqA7.js → index-CYHILoKZ.js} +1 -1
  45. package/assets/{index-yHh0Ailq.js → index-CaX7xtue.js} +1 -1
  46. package/assets/{index-Du3Z0zbT.js → index-ChNCtdhL.js} +1 -1
  47. package/assets/index-CufA4Xe2.css +1 -0
  48. package/assets/{index-CqmYafN2.js → index-D0-NguH5.js} +1 -1
  49. package/assets/{index-D9FKZ_Ef.js → index-D3IhGslQ.js} +1 -1
  50. package/assets/{index-BDja2b5_.css → index-D9KT4Xy9.css} +7 -7
  51. package/assets/{index-ym6V5xvP.js → index-DJIpay_B.js} +1 -1
  52. package/assets/{index-7OQTdULX.js → index-DRxV6eK3.js} +21 -21
  53. package/assets/{index-CSTUqF1E.js → index-Da2XufC5.js} +1 -1
  54. package/assets/{index-GLmroiMa.js → index-DapHvhQl.js} +1 -1
  55. package/assets/{index-DkDj8uyD.js → index-DcEhwfpR.js} +1 -1
  56. package/assets/{index-Dg4bePAB.js → index-De0a_cxD.js} +1 -1
  57. package/assets/index-DgqoOpvI.css +1 -0
  58. package/assets/{index-qM0u5G7G.js → index-Dld6HYq4.js} +1 -1
  59. package/assets/{index-R5Y02olF.js → index-Dn01HIaK.js} +1 -1
  60. package/assets/index-H1M-epz1.js +1 -0
  61. package/assets/{index-Do5NpGNH.js → index-I-GH2Tlh.js} +1 -1
  62. package/assets/{index-DQgFF3j-.js → index-SVs57u6y.js} +1 -1
  63. package/assets/{index-BV_Dk0B8.js → index-UfP1PBLP.js} +1 -1
  64. package/assets/{index-D44rl-dr.js → index-ZmWfIbZE.js} +1 -1
  65. package/assets/{index-CTR5lzkP.css → index-cfl36_qZ.css} +1 -1
  66. package/assets/{index-C5G1URRh.js → index-kOlivxH7.js} +1 -1
  67. package/assets/{index-PQtXhLaH.js → index-nnu0df3J.js} +1 -1
  68. package/assets/index-sw3UqHnb.js +2 -0
  69. package/assets/{index-DoBAd9V3.js → index-uuZsmUVW.js} +1 -1
  70. package/assets/{index-m8UzXM7S.js → index-vSoqzfe7.js} +1 -1
  71. package/assets/{index-tGLYwZfI.js → index-x6JW4sfB.js} +1 -1
  72. package/assets/{index.es-DJmfA6ef.js → index.es-6oeymiuR.js} +4 -4
  73. package/assets/{selectors-CB8Wwr1j.js → selectors-TZRj5wUD.js} +1 -1
  74. package/index.html +3 -3
  75. package/package.json +3 -3
  76. package/assets/index-B9dqNwcA.js +0 -1
  77. package/assets/index-BLtlqOnS.css +0 -1
  78. package/assets/index-BXAuemi3.css +0 -1
  79. package/assets/index-C24Zdu_J.css +0 -1
  80. package/assets/index-CR084NuM.js +0 -1
  81. package/assets/index-CWwTAgmm.css +0 -1
  82. package/assets/index-DpwaSpal.js +0 -1
  83. package/assets/index-gV4hINOc.js +0 -2
@@ -1 +1 @@
1
- var _=Object.defineProperty;var E=(n,t,a)=>t in n?_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var j=(n,t,a)=>E(n,typeof t!="symbol"?t+"":t,a);import{D as v,H as e,bm as R,G as r,bA as T,M as s,K as k,bB as y,bC as D,bD as I,bE as f,bF as C,N as O,a_ as F,bG as H,bH as $,bI as h,bJ as g,aZ as S,bK as G,bL as B,bM as V}from"./index-7OQTdULX.js";import{N as M}from"./Navigation.container-DJtxfRRt.js";import{L as W}from"./LoggedInDetailPage.container-B8TGqDoF.js";import{R as K}from"./RentalPeriod-Dd_P2kg3.js";import"./selectors-CB8Wwr1j.js";import"./SignInRequired-B3OGhAh6.js";import"./index-DkDj8uyD.js";const Z=n=>n.ui.land,q=n=>Z(n).view;class A extends v.PureComponent{render(){const{list:t}=this.props;switch(t.length){case 0:return r("global.none");case 1:return t[0];case 2:return e.jsx(R,{id:"list.two",values:{first:t[0],second:t[1]}});default:return e.jsx(R,{id:"list.two",values:{first:t[0],second:r("list.more",{count:t.length-1})}})}}}const z=(n,t)=>f(n,C)?1:f(t,C)?-1:n>t?1:-1;let J=class extends v.PureComponent{render(){const{land:t,deployments:a,rental:l,history:o}=this.props,{x:d,y:p}=T(t);return e.jsxs(s.Table.Row,{className:"TableRow",onClick:()=>o.push(k.landDetail(t.id)),children:[e.jsx(s.Table.Cell,{children:e.jsxs(s.Row,{children:[e.jsx(s.Column,{width:67,grow:!1,shrink:!1,children:e.jsx(y,{landId:t.id,width:45,height:45,isDraggable:!1,size:9})}),e.jsx(s.Column,{className:"name",children:e.jsxs("div",{children:[t.name," ",e.jsx("span",{className:"secondary-text",children:D(d,p)})]})})]})}),e.jsx(s.Table.Cell,{children:e.jsxs("div",{children:[r(`roles.${t.role}`)," ",l?e.jsx(K,{land:t,rental:l}):null]})}),e.jsx(s.Table.Cell,{children:e.jsx(A,{list:t.operators.sort(z).map(c=>e.jsx(I,{address:c}))})}),e.jsx(s.Table.Cell,{children:e.jsx(A,{list:a.map(c=>c.name)})})]})}};const X=(n,t)=>{const{land:a}=t,o=H(n)[a.id]||[],d=$(n,a);return{deployments:o,rental:d}},Y=O(X)(F(J)),b=20;let Q=class extends v.PureComponent{constructor(){super(...arguments);j(this,"state",{showOwner:!0,showOperator:!0,showLessor:!0,showTenant:!0,page:1,selectedLand:0});j(this,"handleNext",()=>{const{selectedLand:a}=this.state,l=this.getFilteredLands();a===l.length-1?this.setState({selectedLand:0}):this.setState({selectedLand:a+1})});j(this,"handlePrev",()=>{const{selectedLand:a}=this.state;if(a===0){const l=this.getFilteredLands();this.setState({selectedLand:l.length-1})}else this.setState({selectedLand:a-1})})}componentWillReceiveProps(a){a.lands!==this.props.lands&&this.setState({page:1})}renderLand(){const{view:a,onSetView:l}=this.props,{page:o,showOwner:d,showOperator:p,showTenant:c,showLessor:u,selectedLand:N}=this.state,i=this.getFilteredLands(),P=Math.ceil(i.length/b);let w,L;if(i.length>1&&N<i.length){const{x:m,y:x}=T(i[N]);w=m,L=x}else if(i.length===1){const{x:m,y:x}=T(i[0]);w=m,L=x}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(s.Container,{children:e.jsxs(s.Row,{height:30,children:[e.jsx(s.Column,{children:e.jsxs(s.Row,{children:[e.jsx(s.Header,{sub:!0,children:r("land_page.results",{count:i.length.toLocaleString()})}),a===h.ATLAS&&i.length>1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"arrow prev",onClick:this.handlePrev}),e.jsx("div",{className:"arrow next",onClick:this.handleNext})]}):null]})}),e.jsx(s.Column,{align:"right",children:e.jsxs(s.Row,{children:[e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{value:"owner",checked:d,onClick:()=>this.setState({showOwner:!d}),label:r(`roles.${g.OWNER}`)}),content:r("land_page.owner_explanation")}),e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{className:"operator-checkbox",value:"operator",checked:p,onClick:()=>this.setState({showOperator:!p}),label:r(`roles.${g.OPERATOR}`)}),className:"radio-popup",content:e.jsx("div",{children:r("land_page.operator_explanation")})}),e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{className:"tenant-checkbox",value:"tentant",checked:c,onClick:()=>this.setState({showTenant:!c}),label:r(`roles.${g.TENANT}`)}),className:"radio-popup",content:e.jsx("div",{children:r("land_page.tenant_explanation")})}),e.jsx(S,{className:"grid",icon:"table",isActive:a===h.GRID,onClick:()=>l(h.GRID)}),e.jsx(S,{className:"atlas",icon:"pin",isActive:a===h.ATLAS,onClick:()=>l(h.ATLAS)})]})})]})})}),a===h.GRID?e.jsxs(s.Container,{children:[e.jsx(s.Section,{className:"table-section",children:i.length>0?e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"4",children:r("global.name")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("global.role")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("land_page.operated_by")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("land_page.online_scenes")})]})}),e.jsx(s.Table.Body,{children:i.slice((o-1)*b,o*b).map((m,x)=>e.jsx(Y,{land:m},x))})]}):null}),P>1?e.jsx(s.Section,{className:"pagination-section",children:e.jsx(s.Pagination,{firstItem:null,lastItem:null,activePage:o,onPageChange:(m,x)=>this.setState({page:+x.activePage}),totalPages:P})}):null]}):e.jsx("div",{className:"atlas-wrapper",children:e.jsx(y,{className:"main",x:w,y:L,showOperator:p,showOwner:d,showTenant:c,showLessor:u,hasPopup:!0})})]})}getFilteredLands(){const{lands:a}=this.props,{showOwner:l,showOperator:o,showLessor:d,showTenant:p}=this.state;return a.filter(u=>!!(l&&u.roles.includes(g.OWNER)||o&&u.roles.includes(g.OPERATOR)||p&&u.roles.includes(g.TENANT)||d&&u.roles.includes(g.LESSOR)))}render(){const{isLoading:a,view:l}=this.props;return e.jsx(W,{className:`LandPage ${l}-view`,activeTab:M.LAND,isLoading:a,isPageFullscreen:!0,isFooterFullscreen:l===h.ATLAS,isNavigationFullscreen:l===h.ATLAS,children:this.renderLand()})}};const U=n=>({lands:G(n),view:q(n),isLoading:B(n)}),ee=n=>({onSetView:t=>n(V(t))}),he=O(U,ee)(Q);export{he as default};
1
+ var _=Object.defineProperty;var E=(n,t,a)=>t in n?_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var j=(n,t,a)=>E(n,typeof t!="symbol"?t+"":t,a);import{D as v,H as e,bm as R,G as r,bA as T,M as s,K as k,bB as y,bC as D,bD as I,bE as f,bF as C,N as O,a_ as F,bG as H,bH as $,bI as h,bJ as g,aZ as S,bK as G,bL as B,bM as V}from"./index-DRxV6eK3.js";import{N as M}from"./Navigation.container-BbpkLQDF.js";import{L as W}from"./LoggedInDetailPage.container-CgFwp3V3.js";import{R as K}from"./RentalPeriod-NweYyW08.js";import"./selectors-TZRj5wUD.js";import"./SignInRequired-tDYtCZho.js";import"./index-DcEhwfpR.js";const Z=n=>n.ui.land,q=n=>Z(n).view;class A extends v.PureComponent{render(){const{list:t}=this.props;switch(t.length){case 0:return r("global.none");case 1:return t[0];case 2:return e.jsx(R,{id:"list.two",values:{first:t[0],second:t[1]}});default:return e.jsx(R,{id:"list.two",values:{first:t[0],second:r("list.more",{count:t.length-1})}})}}}const z=(n,t)=>f(n,C)?1:f(t,C)?-1:n>t?1:-1;let J=class extends v.PureComponent{render(){const{land:t,deployments:a,rental:l,history:o}=this.props,{x:d,y:p}=T(t);return e.jsxs(s.Table.Row,{className:"TableRow",onClick:()=>o.push(k.landDetail(t.id)),children:[e.jsx(s.Table.Cell,{children:e.jsxs(s.Row,{children:[e.jsx(s.Column,{width:67,grow:!1,shrink:!1,children:e.jsx(y,{landId:t.id,width:45,height:45,isDraggable:!1,size:9})}),e.jsx(s.Column,{className:"name",children:e.jsxs("div",{children:[t.name," ",e.jsx("span",{className:"secondary-text",children:D(d,p)})]})})]})}),e.jsx(s.Table.Cell,{children:e.jsxs("div",{children:[r(`roles.${t.role}`)," ",l?e.jsx(K,{land:t,rental:l}):null]})}),e.jsx(s.Table.Cell,{children:e.jsx(A,{list:t.operators.sort(z).map(c=>e.jsx(I,{address:c}))})}),e.jsx(s.Table.Cell,{children:e.jsx(A,{list:a.map(c=>c.name)})})]})}};const X=(n,t)=>{const{land:a}=t,o=H(n)[a.id]||[],d=$(n,a);return{deployments:o,rental:d}},Y=O(X)(F(J)),b=20;let Q=class extends v.PureComponent{constructor(){super(...arguments);j(this,"state",{showOwner:!0,showOperator:!0,showLessor:!0,showTenant:!0,page:1,selectedLand:0});j(this,"handleNext",()=>{const{selectedLand:a}=this.state,l=this.getFilteredLands();a===l.length-1?this.setState({selectedLand:0}):this.setState({selectedLand:a+1})});j(this,"handlePrev",()=>{const{selectedLand:a}=this.state;if(a===0){const l=this.getFilteredLands();this.setState({selectedLand:l.length-1})}else this.setState({selectedLand:a-1})})}componentWillReceiveProps(a){a.lands!==this.props.lands&&this.setState({page:1})}renderLand(){const{view:a,onSetView:l}=this.props,{page:o,showOwner:d,showOperator:p,showTenant:c,showLessor:u,selectedLand:N}=this.state,i=this.getFilteredLands(),P=Math.ceil(i.length/b);let w,L;if(i.length>1&&N<i.length){const{x:m,y:x}=T(i[N]);w=m,L=x}else if(i.length===1){const{x:m,y:x}=T(i[0]);w=m,L=x}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(s.Container,{children:e.jsxs(s.Row,{height:30,children:[e.jsx(s.Column,{children:e.jsxs(s.Row,{children:[e.jsx(s.Header,{sub:!0,children:r("land_page.results",{count:i.length.toLocaleString()})}),a===h.ATLAS&&i.length>1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"arrow prev",onClick:this.handlePrev}),e.jsx("div",{className:"arrow next",onClick:this.handleNext})]}):null]})}),e.jsx(s.Column,{align:"right",children:e.jsxs(s.Row,{children:[e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{value:"owner",checked:d,onClick:()=>this.setState({showOwner:!d}),label:r(`roles.${g.OWNER}`)}),content:r("land_page.owner_explanation")}),e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{className:"operator-checkbox",value:"operator",checked:p,onClick:()=>this.setState({showOperator:!p}),label:r(`roles.${g.OPERATOR}`)}),className:"radio-popup",content:e.jsx("div",{children:r("land_page.operator_explanation")})}),e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{className:"tenant-checkbox",value:"tentant",checked:c,onClick:()=>this.setState({showTenant:!c}),label:r(`roles.${g.TENANT}`)}),className:"radio-popup",content:e.jsx("div",{children:r("land_page.tenant_explanation")})}),e.jsx(S,{className:"grid",icon:"table",isActive:a===h.GRID,onClick:()=>l(h.GRID)}),e.jsx(S,{className:"atlas",icon:"pin",isActive:a===h.ATLAS,onClick:()=>l(h.ATLAS)})]})})]})})}),a===h.GRID?e.jsxs(s.Container,{children:[e.jsx(s.Section,{className:"table-section",children:i.length>0?e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"4",children:r("global.name")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("global.role")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("land_page.operated_by")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("land_page.online_scenes")})]})}),e.jsx(s.Table.Body,{children:i.slice((o-1)*b,o*b).map((m,x)=>e.jsx(Y,{land:m},x))})]}):null}),P>1?e.jsx(s.Section,{className:"pagination-section",children:e.jsx(s.Pagination,{firstItem:null,lastItem:null,activePage:o,onPageChange:(m,x)=>this.setState({page:+x.activePage}),totalPages:P})}):null]}):e.jsx("div",{className:"atlas-wrapper",children:e.jsx(y,{className:"main",x:w,y:L,showOperator:p,showOwner:d,showTenant:c,showLessor:u,hasPopup:!0})})]})}getFilteredLands(){const{lands:a}=this.props,{showOwner:l,showOperator:o,showLessor:d,showTenant:p}=this.state;return a.filter(u=>!!(l&&u.roles.includes(g.OWNER)||o&&u.roles.includes(g.OPERATOR)||p&&u.roles.includes(g.TENANT)||d&&u.roles.includes(g.LESSOR)))}render(){const{isLoading:a,view:l}=this.props;return e.jsx(W,{className:`LandPage ${l}-view`,activeTab:M.LAND,isLoading:a,isPageFullscreen:!0,isFooterFullscreen:l===h.ATLAS,isNavigationFullscreen:l===h.ATLAS,children:this.renderLand()})}};const U=n=>({lands:G(n),view:q(n),isLoading:B(n)}),ee=n=>({onSetView:t=>n(V(t))}),he=O(U,ee)(Q);export{he as default};
@@ -1 +1 @@
1
- import{a as g}from"./index-yHh0Ailq.js";import"./index-7OQTdULX.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-CaX7xtue.js";import"./index-DRxV6eK3.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};