/*! For license information please see ar.bundle.js.LICENSE.txt */
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[850],{6504:function(e,t,n){n.d(t,{f2:function(){return d}});var o=n(8665),r=n(1580),a=n(5538),i=n(660),l=n(2297),s=n(2367),c=function(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))};const d=o.Z.createInstance();t.ZP={init:({language:e})=>c(void 0,void 0,void 0,(function*(){const t=s.Z.customer.language,n=(s.Z.customer.slug,e||t||"en"),o=(0,l.Bv)(),c=["translation"];return new Promise(((e,t)=>{d.use(r.Z).init({debug:!1,react:{useSuspense:!1},lng:n,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:c,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[n],interpolation:{escapeValue:!1},backend:{backends:[i.Z,a.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${o}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(n=>{n&&t(new Error("R2U - Translation init failed")),e()}))}))}))}},8814:function(e,t,n){n.r(t),n.d(t,{default:function(){return Pe}});var o=n(7294),r=n(3935),a=n(5865),i=n(2367);function l(e){const t=`r2u-webxr-seen-${e}`;return Boolean(JSON.parse(localStorage.getItem(t)||"false"))}function s(e){const t=`r2u-webxr-seen-${e}`;localStorage.setItem(t,JSON.stringify(!0))}function c(e){const t=`r2u-ar-opened-${e}`;return Boolean(JSON.parse(localStorage.getItem(t)||"false"))}function d(e){const t=`r2u-ar-opened-${e}`;localStorage.setItem(t,JSON.stringify(!0))}var m=n(7523),p=n(7374),u=n(2297),f=n(6339),h=n(6504);const g=(0,o.createContext)({}),b=({children:e,openerElement:t,openerEvent:n,onClose:r=(()=>{})})=>{const[a,i]=(0,o.useState)(!1),l=()=>{i(!0)};return t&&n&&t.addEventListener(n,l),o.createElement(g.Provider,{value:{isOpen:a,openModal:l,closeModal:()=>{r(),i(!1)},toggleModal:()=>{i(!a)}}},o.createElement(f.a,{i18n:h.f2},a?e:null))};var v=n(6793),x=n(1841),w=n.n(x),E=n(9163);const y=E.default.div`
  .text {
    margin: auto;
    padding: 10px;
    font-family: proxima-nova, sans-serif;
    font-size: 16px;
    font-weight: 300;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.25;
    letter-spacing: normal;
    text-align: center;
    color: #222222;
    b {
      font-weight: bold;
    }
  }

  .error {
    margin-top: 100px;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.21;
    color: #d45b5b;
  }

  .top {
    width: 250px;
  }

  .bottom {
    width: 250px;
  }

  .fallback-viewer-container {
    width: 324px;
    height: 324px;
    margin: auto;
    margin-top: 10px;
    margin-bottom: 10px;
    background-image: linear-gradient(to bottom, #e9eaeb, #e4e5e7);

    model-viewer {
      width: 100%;
      height: 100%;
    }
  }

  .watermark {
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 22px;
  }
`;var k=n(5060),O=n(3026);const N=E.default.div`
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: ${({color:e})=>e};
  z-index: 9999999;
  overflow: auto;

  .exit {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999;
    margin: 12px;
    padding: 3px;
    background: none;
    border: none;
    outline: none;
  }
`,j=E.createGlobalStyle`
  html {
    overflow: hidden;
  }
  body {
    overflow: hidden;
  }
`;var S=n(9429);var C=({children:e,color:t="white"})=>o.createElement(S.ZP.div,null,o.createElement(N,{color:t},o.createElement(j,null),e));var L=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(g),{t:n}=(0,v.$)();return o.createElement(C,null,o.createElement(y,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:()=>{t()}}),o.createElement("div",{className:"text error"},n("fallback.viewer.title")),o.createElement("div",{className:"text top"},n("fallback.viewer.topText")),o.createElement("div",{className:"fallback-viewer-container"},o.createElement(w(),{glbSrc:e})),o.createElement("div",{className:"text bottom"},n("fallback.viewer.bottomText")),o.createElement("div",{className:"watermark"},o.createElement(k.Z,{position:"centerAbsolute"}))))};const P=E.default.div`
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to bottom, #e9eaeb, #e4e5e7);

  model-viewer {
    width: 100%;
    height: 100%;
  }
`;var z=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(g);return o.createElement(C,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:t}),o.createElement(P,null,o.createElement(w(),{glbSrc:e})))};var R=({openerElement:e,openerEvent:t,fallbackOptions:{alertMessage:n,fallback:r},glb:a})=>(n&&e.addEventListener(t,(()=>{alert(n)})),"viewer"===r&&a?o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(L,{glb:a})):"full"===r&&a?o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(z,{glb:a})):null);const A=E.default.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;

  .powered {
    display: flex;
    text-decoration: unset;
    flex-direction: row;
    align-items: center;
    margin-top: 2%;

    img {
      width: 32.9px;
      height: 17px;
      object-fit: contain;
      margin: 5px;
      filter: brightness(85%);
    }
    h1 {
      width: 90px;
      height: 20px;
      font-family: proxima-Nova, sans-serif;
      font-size: 16px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.25;
      letter-spacing: normal;
      text-align: center;
      color: #d8d8d8;
    }
  }

  .instructions {
    width: min(90vw, 50vh);
    height: min(90vw, 50vh);
    border: solid 20px #f2f2f2;
    margin: 12px;

    .border {
      border-radius: 20px;
      box-shadow: 0 0 0 20px #f2f2f2;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }

    .example {
      height: 100%;
      object-fit: contain;
      border-radius: 20px;
    }

    .instructionsColumn {
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      align-items: center;
      width: 50%;
      span {
        font-family: proxima-Nova, sans-serif;
        font-size: 14px;
        font-weight: bold;
        font-stretch: normal;
        font-style: normal;
        line-height: 1.22;
        letter-spacing: normal;
        text-align: center;
        color: #000000;
      }
      .icon {
        width: 50%;
        object-fit: contain;
      }
    }
  }

  .no-watermark {
    margin-top: 60px;
  }

  .text {
    h1 {
      font-family: proxima-Nova, sans-serif;
      font-size: 26px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.23;
      letter-spacing: normal;
      text-align: center;
      color: #000000;
    }
    h3 {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: 300;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #707070;
      margin: 5px 20px 30px 20px;
    }
  }

  .ar-button {
    width: calc(100vw - 40px);
    height: 50px;
    border: none;
    margin: auto;
    border-radius: 23px;
    background-color: #000000;
    &:disabled {
      background-color: gray;
    }

    span {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #ffffff;
    }
  }
`;var M=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var I=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=M(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),{t:l}=(0,v.$)(),[s,c]=(0,o.useState)(!1);return(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0}),o.createElement(C,null,o.createElement(A,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,l("poweredBy")),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-cover.jpg",alt:"",className:"example"}),o.createElement("div",{className:"instructionsColumn"},o.createElement("span",null,l("instructions.handMove")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,l("instructions.handRotate")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"})))),o.createElement("div",{className:"text"},o.createElement("h3",null,l("instructions.text"))),o.createElement("button",{type:"button",className:"ar-button",disabled:s,onClick:()=>{r(a),c(!0)}},s?o.createElement("span",null,l("instructions.loading")):o.createElement("span",null,l("instructions.button")))))};const T=E.default.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100vh;

  .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f80032;
    width: 100%;
    border-radius: 0px 0px 16px 16px;
    padding: 28px 0px;
  }

  .instructions {
    overflow: hidden;
    width: 100%;
    margin: 29px 0;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;

    .example {
      width: 25vh;
      height: auto;
      border-radius: 16px;
    }

    @media screen and (max-width: 359px) {
      .example {
        width: 20vh;
      }
    }

    .instructions-column {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-evenly;

      .instruction-unit {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        .icon {
          width: 50px;
          height: auto;
        }

        span {
          font-family: 'Roboto', sans-serif;
          font-weight: 400;
          margin-top: 12px;
          color: #333333;
          width: 140px;
          font-size: 14px;
          text-align: center;
        }

        @media screen and (max-width: 359px) {
          span {
            width: 130px;
          }
        }
      }
    }
  }

  .footer {
    padding-top: 32px;
    margin-top: 28px;
    border-radius: 16px 16px 0px 0px;
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;

    span {
      font-family: 'Roboto', sans-serif;
      font-weight: 400;
      width: 280px;
      font-size: 16px;
      color: #333333;
      text-align: center;
    }

    @media screen and (max-width: 359px) {
      span {
        width: 200px;
      }
    }

    .ar-button {
      margin: 24px;
      width: 90%;
      border: none;
      height: 54px;
      border-radius: 12px;
      background-color: #f80032;
      span {
        font-family: 'Roboto', sans-serif;
        font-weight: 700;
        color: #ffffff;
        font-size: 17px;
      }
    }
  }
`;var W=n.p+"fonts/Roboto.ttf",H=E.createGlobalStyle`
  @font-face {
    font-family: 'Roboto';
    src: url(${W}) format('truetype');
  }
`,X=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var Z=e=>{var{onOpen:t,activateAR:n}=e,r=X(e,["onOpen","activateAR"]);const{closeModal:a}=(0,o.useContext)(g),[i,l]=(0,o.useState)(!1);return(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>a()),{once:!0}),window.addEventListener("hashchange",(()=>a()),{once:!0}),o.createElement(C,{color:"#F1F1F1"},o.createElement(H,null),o.createElement(T,null,o.createElement("div",{className:"logo"},o.createElement(O.yY,null)),o.createElement("div",{className:"instructions"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-cover.jpg",alt:"",className:"example"}),o.createElement("div",{className:"instructions-column"},o.createElement("div",{className:"instruction-unit"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,"segure e arraste o produto para mover")),o.createElement("div",{className:"instruction-unit"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"}),o.createElement("span",null,"segure o produto com dois dedos para girar")))),o.createElement("div",{className:"footer"},o.createElement("span",null,"coloque o produto em seu espaço para verificar todas as dimensões"),o.createElement("button",{type:"button",className:"ar-button",disabled:i,onClick:()=>{n(r),l(!0)}},i?o.createElement("span",null,"carregando ..."):o.createElement("span",null,"veja como fica no seu espaço")))))},$=n.p+"82702c4b09713a8e6a2429734fd2d0f5.png",_=n.p+"a084c0aa29ee4c4dac200f2842cfe66e.png";const U=E.default.div`
  position: fixed;
  z-index: 1000;
  top: 0px;
  left: 0px;
  height: 100vh;
  width: 100vw;
  background-size: cover;
  background-position: center;
  background-image: url(${({background:e})=>e});

  img {
    object-fit: contain;
  }

  .slide {
    height: 100vh;
    position: relative;

    img {
      width: 90vw;
      max-width: 500px;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  }

  .red-button {
    background-color: rgb(227, 7, 24);
    border: none;
    border-radius: 2.5vw;
    padding: 1.2vh 5vw;
    color: #fff;
    margin: 0 auto;
    display: block;
    font-size: 2.3vh;
    width: 50vw;
    box-shadow: 0 0 20px #00000030;

    &.next {
      position: absolute;
      left: 50%;
      bottom: 17vh;
      transform: translatex(-50%);
    }
  }

  .red-button:disabled {
    opacity: 0.6;
  }

  .slick-dots {
    position: absolute;
    bottom: 13vh;
  }

  li {
    background-image: url(${$});
    background-size: 100% 100%;
    width: 1.5vh !important;
    height: 1.5vh !important;

    &.slick-active {
      background-image: url(${_});
    }

    button:before {
      content: '' !important;
    }
  }
`;var F=n(6066),J=n.p+"83f0399669efdba15c656d7c17423195.png",D=n.p+"ad55b6672b7bd0340ba4780a05326dc5.png",B=n.p+"d620f91e28306433451f02b1daba365a.png",V=n.p+"b51da9ff8634426464c8c961e247a5ad.png",q=n.p+"1efd7d6f1d3140590592827519a99ae0.png",Y=n.p+"14d30dedf2d3ff75f65eac0bfea1cd79.jpg",G=n.p+"f3338f821a8950fe14196747564ad00c.png",K=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var Q=e=>{var{onOpen:t,activateAR:n}=e,r=K(e,["onOpen","activateAR"]);const{closeModal:a}=(0,o.useContext)(g),[i,l]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1);let d;(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>a()),{once:!0}),window.addEventListener("hashchange",(()=>a()),{once:!0});const m=()=>{null==d||d.slickNext(),console.log(d)};return o.createElement(o.Fragment,null,o.createElement("link",{rel:"stylesheet",type:"text/css",href:"https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"}),o.createElement("link",{rel:"stylesheet",type:"text/css",href:"https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"}),o.createElement(U,{background:i?G:Y},o.createElement("div",{style:{width:"100vw",position:"absolute",top:"6vh"}},!i&&o.createElement("img",{src:D,alt:"Realidade Aumentada",style:{width:"60vw",display:"block",margin:"auto",maxHeight:"12vh"}})),i&&o.createElement(F.Z,Object.assign({ref:e=>{d=e}},{dots:!0,infinite:!1,speed:500,slidesToShow:1,slidesToScroll:1,arrows:!1,style:{position:"relative",margin:"auto",top:"50%",msTransform:"translateY(-50%)",transform:"translateY(-50%)"}}),o.createElement("div",{className:"slide"},o.createElement("img",{src:B,alt:"Tutorial 1"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:V,alt:"Tutorial 2"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:q,alt:"Tutorial 3"}),o.createElement("button",{className:"red-button next",disabled:s,onClick:()=>{c(!0),n(r)}},s?"Carregando...":"Começar!"))),!i&&o.createElement("button",{className:"red-button",style:{msTransform:"translateY(-50%)",transform:"translateY(-50%)",position:"absolute",bottom:"22vh",left:"25vw",display:i?"hidden":"auto"},onClick:()=>{l(!0)}},"Veja como usar"),o.createElement("div",{style:{width:"100vw",position:"absolute",bottom:"14vh"}},!i&&o.createElement("img",{src:J,alt:"Logo",style:{width:"50vw",display:"block",margin:"auto",maxHeight:"9vh"}})),o.createElement(O.Ao,{width:40,height:40,color:"#505050",cursor:"pointer",className:"exit",onClick:a,style:{position:"absolute",top:"10px",left:"10px"}})))};const ee=E.default.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;

  .powered {
    display: flex;
    text-decoration: unset;
    flex-direction: row;
    align-items: center;
    margin-top: 2%;

    img {
      width: 32.9px;
      height: 17px;
      object-fit: contain;
      margin: 5px;
      filter: brightness(85%);
    }
    h1 {
      width: 90px;
      height: 20px;
      font-family: proxima-Nova, sans-serif;
      font-size: 16px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.25;
      letter-spacing: normal;
      text-align: center;
      color: #d8d8d8;
    }
  }

  .instructions {
    width: min(90vw, 50vh);
    height: min(90vw, 50vh);
    border: solid 20px #f2f2f2;
    margin: 12px;

    .border {
      border-radius: 20px;
      box-shadow: 0 0 0 20px #f2f2f2;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }

    .example {
      height: 100%;
      object-fit: contain;
      border-radius: 20px;
    }

    .instructionsColumn {
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      align-items: center;
      width: 50%;
      span {
        font-family: proxima-Nova, sans-serif;
        font-size: 14px;
        font-weight: bold;
        font-stretch: normal;
        font-style: normal;
        line-height: 1.22;
        letter-spacing: normal;
        text-align: center;
        color: #000000;
      }
      .icon {
        width: 50%;
        object-fit: contain;
      }
    }
  }

  .no-watermark {
    margin-top: 60px;
  }

  .text {
    h1 {
      font-family: proxima-Nova, sans-serif;
      font-size: 26px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.23;
      letter-spacing: normal;
      text-align: center;
      color: #000000;
    }
    h3 {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: 300;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #707070;
      margin: 5px 20px 30px 20px;
    }
  }

  .ar-button {
    width: calc(100vw - 40px);
    height: 50px;
    border: none;
    margin: auto;
    border-radius: 23px;
    background-color: #000000;
    &:disabled {
      background-color: gray;
    }

    span {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #ffffff;
    }
  }
`;var te=n.p+"f91bfc6bd31271563d950a9321ba989b.jpg",ne=JSON.parse('{"NE":{"fu":"Hold and drag the product to move","SS":"Hold the product with two fingers to rotate","fL":"Place the product in your surroundings to check all dimensions","LI":"Check this product in your space!","V_":"Loading ..."},"Pn":"powered by"}'),oe=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var re=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=oe(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),[l,s]=(0,o.useState)(!1);return(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0}),o.createElement(C,null,o.createElement(ee,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,ne.Pn),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("img",{src:te,alt:"",className:"example"}),o.createElement("div",{className:"instructionsColumn"},o.createElement("span",null,ne.NE.fu),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,ne.NE.SS),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"})))),o.createElement("div",{className:"text"},o.createElement("h3",null,ne.NE.fL)),o.createElement("button",{type:"button",className:"ar-button",disabled:l,onClick:()=>{r(a),s(!0)}},l?o.createElement("span",null,ne.NE.V_):o.createElement("span",null,ne.NE.LI))))};const ae=E.default.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;

  .powered {
    display: flex;
    text-decoration: unset;
    flex-direction: row;
    align-items: center;
    margin-top: 2%;

    img {
      width: 32.9px;
      height: 17px;
      object-fit: contain;
      margin: 5px;
      filter: brightness(85%);
    }
    h1 {
      width: 90px;
      height: 20px;
      font-family: proxima-Nova, sans-serif;
      font-size: 16px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.25;
      letter-spacing: normal;
      text-align: center;
      color: #d8d8d8;
    }
  }

  .instructions {
    width: min(90vw, 50vh);
    height: min(90vw, 50vh);
    border: solid 20px #f2f2f2;
    margin: 12px;

    .border {
      border-radius: 20px;
      box-shadow: 0 0 0 20px #f2f2f2;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }

    .example {
      height: 100%;
      object-fit: contain;
      border-radius: 20px;
    }

    .instructionsColumn {
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      align-items: center;
      width: 50%;
      span {
        font-family: proxima-Nova, sans-serif;
        font-size: 14px;
        font-weight: bold;
        font-stretch: normal;
        font-style: normal;
        line-height: 1.22;
        letter-spacing: normal;
        text-align: center;
        color: #000000;
      }
      .icon {
        width: 50%;
        object-fit: contain;
      }
    }
  }

  .no-watermark {
    margin-top: 60px;
  }

  .text {
    h1 {
      font-family: proxima-Nova, sans-serif;
      font-size: 26px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.23;
      letter-spacing: normal;
      text-align: center;
      color: #000000;
    }
    h3 {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: 300;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #707070;
      margin: 5px 20px 30px 20px;
    }
  }

  .ar-button {
    width: calc(100vw - 40px);
    height: 50px;
    border: none;
    margin: auto;
    border-radius: 23px;
    background-color: #000000;
    &:disabled {
      background-color: gray;
    }

    span {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #ffffff;
    }
  }
`;var ie=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var le=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=ie(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),[l,s]=(0,o.useState)(!1);(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0});return o.createElement(C,null,o.createElement(ae,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,ne.Pn),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{width:"100%",height:"auto"}},o.createElement("source",{src:"https://storage.googleapis.com/r2u-integrations-bucket/y-digital/V-UP.mp4",type:"video/mp4"})))),o.createElement("button",{type:"button",className:"ar-button",disabled:l,onClick:()=>{r(a),s(!0)}},l?o.createElement("span",null,ne.NE.V_):o.createElement("span",null,"Start the experience"))))},se=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const ce=({customerId:e,sku:t})=>{switch(e){case"89e502ed-f9ae-4147-82e1-f0868d2bb74b":switch(t){case"rav4":return re;case"vodacom-portal":return le;default:return I}case"701ba5cb-152f-4724-9a5f-bb5b1c42d81c":return Z;case"60f02fd9ff756f00088eb928":return Q;default:return I}};var de=e=>{var{openerElement:t,openerEvent:n,customerId:r,sku:a}=e,i=se(e,["openerElement","openerEvent","customerId","sku"]);const l=ce({customerId:r,sku:a});return o.createElement(b,{openerElement:t,openerEvent:n},o.createElement(l,Object.assign({},i,"89e502ed-f9ae-4147-82e1-f0868d2bb74b"===r||"c46943ac-ac1a-4170-8f52-c8705b963538"===r?{hasWaterMark:!1}:{})))};const me=E.default.div`
  display: grid;
  place-content: center;
  margin-top: 45%;

  span {
    font-family: Proxima-Nova, sans-serif;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.25;
  }

  .balloon {
    width: min(90vh, 38vh);
    height: min(90vw, 32vh);
    border-radius: 10px;
    box-shadow: 0 0 32px 0 rgba(0, 0, 0, 0.49);
    background-color: #ffffff;
    display: flex;
    flex-direction: column;

    .title {
      font-weight: bold;
      line-height: 1.25;
      letter-spacing: normal;
      text-align: center;
      color: #000000;
      margin-bottom: 2px;
    }

    button.close {
      border: none;
      border-top: solid 1px #c9c9c9;
      outline: none;
      background: none;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: auto;
      height: 50px;

      span {
        font-size: 14px;
        line-height: 1.25;
        letter-spacing: normal;
        text-align: center;
        color: #000000;
      }
    }
  }
`,pe=E.default.div`
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: center;
  width: 100%;
  height: 100%;

  .title {
    padding: 20px;
    padding-bottom: 0;
  }

  .buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    height: 100%;

    & > button {
      width: 24%;
      height: 55px;
      border-radius: 5px;
      border: none;
      margin: none;
    }

    .dislike {
      background-color: #d96a6a;
    }

    .like {
      background-color: #a9ce8f;
    }
  }
`,ue=E.default.div`
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  text-align: center;
  width: 100%;
  height: 100%;
`;var fe=()=>{const{closeModal:e}=(0,o.useContext)(g),{t:t}=(0,v.$)();return setTimeout(e,2e3),o.createElement(ue,null,o.createElement(O.mn,{width:60,height:60,cursor:"pointer"}),o.createElement("span",{className:"title"},t("feedback.confirm.title")),o.createElement("span",null,t("feedback.confirm.text")))};var he=({onLike:e,onDislike:t})=>{const{t:n}=(0,v.$)();return o.createElement(pe,null,o.createElement("span",{className:"title"},n("feedback.main.title")),o.createElement("div",{className:"buttons"},o.createElement("button",{type:"button",className:"dislike",onClick:t},o.createElement(O.Ov,{width:30,height:30,cursor:"pointer"})),o.createElement("button",{type:"button",className:"like",onClick:e},o.createElement(O.L7,{width:30,height:30,cursor:"pointer"}))))};var ge=({onLike:e,onDislike:t,onOpen:n})=>{const{closeModal:r}=(0,o.useContext)(g),{t:a}=(0,v.$)(),[i,l]=(0,o.useState)(!1);(0,o.useEffect)(n,[]);return o.createElement(C,{color:"RGBA(0, 0, 0, 0.5)"},o.createElement(me,null,o.createElement("div",{className:"balloon"},i?o.createElement(fe,null):o.createElement(he,{onLike:()=>{l(!0),e()},onDislike:()=>{l(!0),t()}}),o.createElement("button",{type:"button",className:"close",onClick:()=>r()},o.createElement("span",{className:"finish"},a(i?"feedback.confirm.button":"feedback.main.button"))))))},be=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var ve=e=>{var{openerElement:t,openerEvent:n,onClose:r}=e,a=be(e,["openerElement","openerEvent","onClose"]);return o.createElement(b,{onClose:r,openerElement:t,openerEvent:n},o.createElement(ge,Object.assign({onClose:r},a)))};const xe=E.default.div`
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;

  .balloon {
    height: max-content;
    width: 90%;
    height: 50%;
    background-color: white;
    border-radius: 10px;

    position: relative;

    display: flex;
    flex-direction: column;
  }

  .info {
    padding: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    img {
      max-width: 100%;
      margin: 0;
    }

    h2 {
      margin: 5px 10px 5px 10px;
      font-family: Proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #222222;
    }

    p {
      margin: 5px 3px 15px 3px;
      font-family: Proxima-Nova, sans-serif;
      font-size: 14px;
      font-weight: normal;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.21;
      letter-spacing: normal;
      text-align: center;
      color: #222222;

      u {
        font-weight: bold;
      }
    }
  }

  button {
    padding: 20px;
    border: none;
    border-top: solid 0.1px rgba(0, 0, 0, 0.2);
    margin-top: auto;
    height: 20%;
    outline: none;
    background: none;

    font-family: Proxima-Nova, sans-serif;
    font-size: 16px;
    font-weight: normal;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.19;
    letter-spacing: normal;
    text-align: center;
    color: #3d71ba;
  }
`;var we=()=>{const{closeModal:e}=(0,o.useContext)(g),{t:t}=(0,v.$)();return o.createElement(C,{color:"rgba(0, 0, 0, 0.3)"},o.createElement(xe,null,o.createElement("div",{className:"balloon"},o.createElement("div",{className:"info"},o.createElement("h2",null,t("fallback.social.title")),o.createElement("p",null,t("fallback.social.text")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-open-safari.png",alt:""})),o.createElement("button",{type:"button",onClick:e},t("fallback.social.button")))))};var Ee=({openerElement:e,openerEvent:t})=>o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(we,null)),ye=n(2151);null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported&&self.XRSession.prototype.requestHitTestSource,self.ResizeObserver,self.IntersectionObserver,(()=>{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)})(),/\bCrOS\b/.test(navigator.userAgent);const ke=/android/i.test(navigator.userAgent),Oe=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;(()=>{const e=document.createElement("a");Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))})(),/Safari\//.test(navigator.userAgent),/firefox/i.test(navigator.userAgent),/OculusBrowser/.test(navigator.userAgent),Oe&&/CriOS\//.test(navigator.userAgent);var Ne=function(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))},je=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const Se="#no-ar-fallback",Ce=e=>{var{container:t}=e,n=je(e,["container"]);const a="r2u-feedback-open",i=document.createElement("div");return i.className="feedback",t.appendChild(i),r.render(o.createElement(ve,Object.assign({openerElement:i,openerEvent:a},n)),i),{open:()=>{i.dispatchEvent(new Event(a))},render:()=>{}}};function Le({element:e,event:t="click"}){return Ne(this,void 0,void 0,(function*(){e.dispatchEvent(new Event(t))}))}var Pe={attach:function({sku:e,price:t,element:n,callToAction:u,event:f="click",showInstructions:h="once",showFeedback:g=!0,fallbackOptions:b={alertMessage:"Sentimos muito, mas infelizmente seu dispositivo não é compatível com a visualização em Realidade Aumentada"}}){return Ne(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));const{activateWebXR:v,activateAR:x,WebXREvents:w}=yield a,E=()=>Ne(this,void 0,void 0,(function*(){const e=new URLSearchParams(window.location.search);if(e.has("r2u_ar_mode"))return"webxr"===e.get("r2u_ar_mode");const t=yield p.fm();i.Z.growthbook=new ye.Z({user:{id:t},overrides:i.Z.customer.experiments.overrides});const n="webxr-vs-sceneviewer-v3",{value:o}=i.Z.growthbook.run({key:n,variations:["sceneviewer-v3","webxr-v3"]});return p.KN(n),p.fQ(o),"webxr-v3"===o})),{glb:y,usdz:k,name:O,placement:N,sound:j,resize:S,pdpUrl:C}=yield(0,m.Z)(e),L=S?"resizable":"fixed",[P,z]="pt"===i.Z.customer.language?["pt-BR","BRL"]:["en-US","USD"],A=u?Object.assign(Object.assign({},u),{onClick:()=>{u.onClick(),document.dispatchEvent(new Event("r2u-webxr-close")),p.ar.onClick()}}):void 0,M={glb:y,usdz:k,price:t,placement:N,scale:L,sound:j,callToAction:A,pdpUrl:C,title:O,mode:"ar_preferred"},I=Boolean(i.Z.customer.waterMarkPosition),T=()=>{const e=c("feedback");return g&&!e},W={model:{name:O,description:t?new Intl.NumberFormat(P,{style:"currency",currency:z}).format(Number(t)):"",glb:y,placement:N,resizable:S,url:C,showInstructions:(()=>{switch(h){case"always":return{translate:!0,rotate:!0};case"never":return{translate:!1,rotate:!1};default:const e=l("translate"),t=l("rotate");return{translate:!e,rotate:!t}}})()},beforeClose:e=>{const{open:t}=Ce({container:e,onLike:()=>{p.J1.onLike(),p.XH.onLike()},onDislike:()=>{p.J1.onDislike(),p.XH.onDislike()},onClose:()=>document.dispatchEvent(new Event("r2u-webxr-close")),onOpen:()=>d("feedback")});T()?t():document.dispatchEvent(new Event("r2u-webxr-close"))},callToAction:A,language:i.Z.customer.language};p.J1.componentDidMount();const{open:H,render:X}=(({glb:e,fallbackOptions:t})=>{const n=document.createElement("div"),a="r2u-open-fallback";document.body.appendChild(n);const i=e=>{r.render(o.createElement(R,Object.assign({openerElement:n,openerEvent:a,fallbackOptions:t},e)),n)};return i({glb:e}),{open:()=>{n.dispatchEvent(new Event(a))},render:i}})({fallbackOptions:b,glb:M.glb}),{open:Z,render:$}=(e=>{var{hasWaterMark:t,onOpen:n,activateAR:a,sku:l}=e,s=je(e,["hasWaterMark","onOpen","activateAR","sku"]);const c=document.createElement("div"),d="r2u-open-instructions";document.body.appendChild(c);const m=e=>{r.render(o.createElement(de,Object.assign({openerElement:c,openerEvent:d,onOpen:n,hasWaterMark:t,activateAR:a,customerId:i.Z.customer._id,sku:l},e)),c)};return m(s),{open:()=>{c.dispatchEvent(new Event(d))},render:m}})(Object.assign({hasWaterMark:I,sku:e,activateAR:x,onOpen:()=>d("instructions")},M)),{open:_}=Ce({container:document.body.appendChild(document.createElement("div")),onLike:()=>p.J1.onLike(),onDislike:()=>p.J1.onDislike(),onClose:()=>{},onOpen:()=>d("feedback")}),{open:U}=(()=>{const e=document.createElement("div"),t="r2u-open-social-fallback";return document.body.appendChild(e),r.render(o.createElement(Ee,{openerElement:e,openerEvent:t}),e),{open:()=>{e.dispatchEvent(new Event(t))},render:()=>{}}})(),F=e=>Ne(this,void 0,void 0,(function*(){const t=yield(0,m.Z)(e);M.glb=t.glb,M.usdz=t.usdz,M.placement=t.placement,M.sound=t.sound,M.scale=t.resize?"resizable":"fixed",M.title=t.name,W.model.glb=t.glb,W.model.name=t.name,W.model.placement=t.placement,W.model.url=t.pdpUrl,W.model.resizable=t.resize,$(M),X(M)})),J=()=>Ne(this,void 0,void 0,(function*(){if(Oe&&/instagram|FBAN|FBAV|LinkedInApp/i.test(navigator.userAgent))return void U();var e;ke&&"wall"!==N&&(yield E())?(e=w,p.XH.setSession(),document.addEventListener(e.r2uWebxrSessionStart,p.XH.onSessionStart,{once:!0}),document.addEventListener(e.r2uWebxrSessionEnd,p.XH.onSessionEnd,{once:!0}),document.addEventListener(e.r2uWebxrCompatible,(()=>p.XH.setCompatible(!0)),{once:!0}),document.addEventListener(e.r2uWebxrNotCompatible,(()=>p.XH.setCompatible(!1)),{once:!0}),document.addEventListener(e.r2uWebxrPlaneMapped,p.XH.setPlaneMapped,{once:!0}),document.addEventListener(e.r2uWebxrObjectPlaced,p.XH.setObjectPlaced,{once:!0}),document.addEventListener(e.r2uWebxrShowTranslatingInstructions,(()=>{p.XH.setTranslateInstructions(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrShowRotatingInstructions,(()=>{p.XH.setRotateInstructions(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrTranslating,(()=>{p.XH.setFirstTranslation(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrRotating,(()=>{p.XH.setFirstRotation(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrReset,p.XH.setReset,{once:!0}),document.addEventListener(e.r2uWebxrFallbackToSceneviewer,p.XH.onSceneViewerFallback,{once:!0}),window.addEventListener("hashchange",(()=>{window.location.hash===Se&&p.XH.onFallback()}),{once:!0}),document.addEventListener(e.r2uWebxrShare,p.XH.onShare),document.addEventListener(e.r2uWebxrExit,p.XH.onExit),document.addEventListener(e.r2uWebxrCallToAction,p.XH.onCallToAction),document.addEventListener(e.r2uWebxrTranslating,p.XH.onTranslation),document.addEventListener(e.r2uWebxrRotating,p.XH.onRotation),v(W)):(()=>{switch(h){case"always":return!0;case"never":return!1;default:return!c("instructions")}})()?Z():x(M),yield p.J1.onClick();const t=(new Date).getTime(),n=()=>{if(document.hidden)return;const e=(new Date).getTime();p.J1.onSessionTimeCollect(e-t),T()&&_(),document.removeEventListener("visibilitychange",n)},o=()=>{const e=(new Date).getTime();p.J1.onSessionTimeCollect(e-t),document.removeEventListener("r2u-webxr-close",o),document.removeEventListener("visibilitychange",n)};document.addEventListener("r2u-webxr-close",o),document.addEventListener("visibilitychange",n)}));n.addEventListener(f,J);const D=new URL(window.location.href),B="true"===D.searchParams.get("r2u_redirect"),V=D.searchParams.get("r2u_sku");return B&&!i.Z.hasAutoOpenedAR&&(i.Z.hasAutoOpenedAR=!0,V&&(yield F(V)),Le({element:n,event:f})),window.addEventListener("hashchange",(()=>{window.location.hash===Se&&(p.J1.onFallback(),n.removeEventListener(f,J),n.addEventListener(f,H),Le({element:n,event:f}))}),{once:!0}),{setSku:F}}))},open:Le,getLink:function(e){return Ne(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));const t=i.Z.customer._id,n=yield(0,u.U2)(`/sdk-ar/openar-link?customerId=${t}&productSku=${e}`);return Promise.resolve(n)}))}}}}]);