@r2u/javascript-ar-sdk 6.22.5 → 6.22.6
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.
- package/dist/index.js +1 -1
- package/dist/init.bundle.js +1 -1
- package/dist/sku.bundle.js +1 -1
- package/dist/src/methods/viewer.d.ts +1 -0
- package/dist/src/methods/viewer.js +11 -1
- package/dist/src/methods/viewer.js.map +1 -1
- package/dist/{vendors.1ec6642030c154885945.bundle.js → vendors.2b1073deed7fa6ae5a48.bundle.js} +1 -1
- package/dist/viewer.bundle.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e,n,t,r,o={},u={};function i(e){var n=u[e];if(void 0!==n)return n.exports;var t=u[e]={exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,{a:n}),n},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(t,r){if(1&r&&(t=this(t)),8&r)return t;if("object"==typeof t&&t){if(4&r&&t.__esModule)return t;if(16&r&&"function"==typeof t.then)return t}var o=Object.create(null);i.r(o);var u={};e=e||[null,n({}),n([]),n(n)];for(var a=2&r&&t;"object"==typeof a&&!~e.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((function(e){u[e]=function(){return t[e]}}));return u.default=function(){return t},i.d(o,u),o},i.d=function(e,n){for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(n,t){return i.f[t](e,n),n}),[]))},i.u=function(e){return 691===e?"vendors.72e0cdbf51fef996d405.bundle.js":665===e?"vendors.6c46067ffeb7a1054cd1.bundle.js":215===e?"vendors.2864f1aaf3fa743e1983.bundle.js":410===e?"init.bundle.js":497===e?"config.bundle.js":30===e?"vendors.d0043338c48c5993c6a9.bundle.js":10===e?"vendors.f18e74fe48ceb07d8c70.bundle.js":603===e?"vendors.5861a640ff3844504854.bundle.js":593===e?"vendors.
|
|
1
|
+
!function(){"use strict";var e,n,t,r,o={},u={};function i(e){var n=u[e];if(void 0!==n)return n.exports;var t=u[e]={exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,{a:n}),n},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(t,r){if(1&r&&(t=this(t)),8&r)return t;if("object"==typeof t&&t){if(4&r&&t.__esModule)return t;if(16&r&&"function"==typeof t.then)return t}var o=Object.create(null);i.r(o);var u={};e=e||[null,n({}),n([]),n(n)];for(var a=2&r&&t;"object"==typeof a&&!~e.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((function(e){u[e]=function(){return t[e]}}));return u.default=function(){return t},i.d(o,u),o},i.d=function(e,n){for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(n,t){return i.f[t](e,n),n}),[]))},i.u=function(e){return 691===e?"vendors.72e0cdbf51fef996d405.bundle.js":665===e?"vendors.6c46067ffeb7a1054cd1.bundle.js":215===e?"vendors.2864f1aaf3fa743e1983.bundle.js":410===e?"init.bundle.js":497===e?"config.bundle.js":30===e?"vendors.d0043338c48c5993c6a9.bundle.js":10===e?"vendors.f18e74fe48ceb07d8c70.bundle.js":603===e?"vendors.5861a640ff3844504854.bundle.js":593===e?"vendors.2b1073deed7fa6ae5a48.bundle.js":850===e?"ar.bundle.js":465===e?"sku.bundle.js":361===e?"vendors.6e3f8af05556e404968a.bundle.js":428===e?"viewer.bundle.js":142===e?"analytics.bundle.js":869===e?"qrCode.bundle.js":void 0},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t={},r="R2U:",i.l=function(e,n,o,u){if(t[e])t[e].push(n);else{var a,d;if(void 0!==o)for(var f=document.getElementsByTagName("script"),c=0;c<f.length;c++){var l=f[c];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==r+o){a=l;break}}a||(d=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",r+o),a.src=e),t[e]=[n];var s=function(n,r){a.onerror=a.onload=null,clearTimeout(b);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((function(e){return e(r)})),n)return n(r)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),d&&document.head.appendChild(a)}},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="https://unpkg.com/@r2u/javascript-ar-sdk@6.22.6/dist/",function(){var e={179:0};i.f.j=function(n,t){var r=i.o(e,n)?e[n]:void 0;if(0!==r)if(r)t.push(r[2]);else{var o=new Promise((function(t,o){r=e[n]=[t,o]}));t.push(r[2]=o);var u=i.p+i.u(n),a=new Error;i.l(u,(function(t){if(i.o(e,n)&&(0!==(r=e[n])&&(e[n]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;a.message="Loading chunk "+n+" failed.\n("+o+": "+u+")",a.name="ChunkLoadError",a.type=o,a.request=u,r[1](a)}}),"chunk-"+n,n)}};var n=function(n,t){var r,o,u=t[0],a=t[1],d=t[2],f=0;if(u.some((function(n){return 0!==e[n]}))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(d)d(i)}for(n&&n(t);f<u.length;f++)o=u[f],i.o(e,o)&&e[o]&&e[o][0](),e[u[f]]=0},t=self.webpackChunkR2U=self.webpackChunkR2U||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var a={};i.r(a),i.d(a,{init:function(){return d},sku:function(){return l},ar:function(){return c},viewer:function(){return s},analytics:function(){return b},qrCode:function(){return h},config:function(){return f}});const d=e=>Promise.all([i.e(691),i.e(665),i.e(215),i.e(410)]).then(i.bind(i,6526)).then((n=>n.default(e))),f={changeLanguage:e=>Promise.all([i.e(665),i.e(497)]).then(i.bind(i,7328)).then((n=>n.default.changeLanguage(e)))},c={open:e=>Promise.all([i.e(691),i.e(30),i.e(665),i.e(10),i.e(215),i.e(603),i.e(593),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.open(e))),attach:e=>Promise.all([i.e(691),i.e(30),i.e(665),i.e(10),i.e(215),i.e(603),i.e(593),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.attach(e))),getLink:e=>Promise.all([i.e(691),i.e(30),i.e(665),i.e(10),i.e(215),i.e(603),i.e(593),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.getLink(e)))},l={isActive:e=>Promise.all([i.e(691),i.e(465)]).then(i.bind(i,6025)).then((n=>n.default.isActive(e))),getData:e=>Promise.all([i.e(691),i.e(465)]).then(i.bind(i,6025)).then((n=>n.default.getData(e)))},s={create:e=>Promise.all([i.e(691),i.e(30),i.e(10),i.e(361),i.e(593),i.e(428)]).then(i.bind(i,8305)).then((n=>n.default.create(e)))},b={send:e=>i.e(142).then(i.bind(i,9448)).then((n=>n.default.send(e)))},h={create:e=>Promise.all([i.e(30),i.e(361),i.e(869)]).then(i.bind(i,5004)).then((n=>n.default.create(e)))};document.dispatchEvent(new CustomEvent("r2u-sdk-loaded")),window.R2U=a}();
|
package/dist/init.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[410],{6504:function(e,n,t){t.d(n,{f2:function(){return u}});var i=t(8665),a=t(1580),s=t(5538),r=t(660),o=t(2297),c=t(2367),l=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const u=i.Z.createInstance();n.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const n=c.Z.customer.language,t=(c.Z.customer.slug,e||n||"en"),i=(0,o.Bv)(),l=["translation"];return new Promise(((e,n)=>{u.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:t,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[t],interpolation:{escapeValue:!1},backend:{backends:[r.Z,s.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(t=>{t&&n(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,n,t){t.r(n),t.d(n,{default:function(){return l}});var i=t(2367),a=t(7374),s=t(2297),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};var o=t(6504),c=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};function l({customerId:e,language:n,analyticsParams:t={dataLayerIntegration:!0,sessionDuration:30},refreshCache:l=!1}){return c(this,void 0,void 0,(function*(){if(!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(e)&&!/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))throw new Error(`Invalid customer '${e}'`);i.Z.init=!0,i.Z.refreshCache=l;const c=yield function(e){return r(this,void 0,void 0,(function*(){return yield(0,s.U2)(`/customers/${e}`)}))}(e),u=yield(0,a.ZP)({client:e,dataLayerIntegration:t.dataLayerIntegration,sessionDurationMinutes:t.sessionDuration});i.Z.analytics=u,i.Z.customer=c,yield Promise.all([o.ZP.init({language:n})])}))}},7374:function(e,n,t){t.d(n,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return w},fQ:function(){return g},hN:function(){return y},lY:function(){return v},G0:function(){return b},fm:function(){return m}});var i=t(2085),a=t(5877),s=t(2367),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>s.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>s.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{s.Z.analytics.webxrSet(i.D1.session_id,(0,a.v4)())},setCompatible:e=>{s.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([s.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{s.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{s.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{s.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{s.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{s.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},y=e=>{s.Z.analytics.set(i.MB.sku,e)},v=e=>{s.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{s.Z.analytics.set(i.MB.is_active_3d,`${e}`),s.Z.analytics.send({event:i.U3.product_page_view})},w=e=>{s.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{s.Z.analytics.set(i.MB.variation_id,e)},m=()=>r(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return s.Z.analytics.set(i.MB.fingerprint,e),e}));n.ZP=({client:e,dataLayerIntegration:n,sessionDurationMinutes:t,info:a={}})=>r(void 0,void 0,void 0,(function*(){const s={version:"6.22.5",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:t,dataLayerIntegration:n},r=new i.ZP(s,Object.assign(Object.assign({},a),{[i.MB.client]:e}));return yield r.init(),r}))},2297:function(e,n,t){t.d(n,{U2:function(){return r},v_:function(){return o},Bv:function(){return c}});var i=t(2367),a=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const s="https://api.r2u.io";function r(e){return a(this,void 0,void 0,(function*(){const n={};i.Z.refreshCache&&(n["Cache-Control"]="max-age=0");return(yield fetch(`${s}${e}`,{method:"get",headers:n})).json()}))}function o(e,n){return a(this,void 0,void 0,(function*(){return(yield fetch(`${s}${e}`,{method:"POST",body:JSON.stringify(n)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,n){const t={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,n)=>{},send:({event:e,data:n,scope:t})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};n.Z=t},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.5","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
|
1
|
+
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[410],{6504:function(e,n,t){t.d(n,{f2:function(){return u}});var i=t(8665),a=t(1580),s=t(5538),r=t(660),o=t(2297),c=t(2367),l=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const u=i.Z.createInstance();n.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const n=c.Z.customer.language,t=(c.Z.customer.slug,e||n||"en"),i=(0,o.Bv)(),l=["translation"];return new Promise(((e,n)=>{u.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:t,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[t],interpolation:{escapeValue:!1},backend:{backends:[r.Z,s.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(t=>{t&&n(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,n,t){t.r(n),t.d(n,{default:function(){return l}});var i=t(2367),a=t(7374),s=t(2297),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};var o=t(6504),c=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};function l({customerId:e,language:n,analyticsParams:t={dataLayerIntegration:!0,sessionDuration:30},refreshCache:l=!1}){return c(this,void 0,void 0,(function*(){if(!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(e)&&!/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))throw new Error(`Invalid customer '${e}'`);i.Z.init=!0,i.Z.refreshCache=l;const c=yield function(e){return r(this,void 0,void 0,(function*(){return yield(0,s.U2)(`/customers/${e}`)}))}(e),u=yield(0,a.ZP)({client:e,dataLayerIntegration:t.dataLayerIntegration,sessionDurationMinutes:t.sessionDuration});i.Z.analytics=u,i.Z.customer=c,yield Promise.all([o.ZP.init({language:n})])}))}},7374:function(e,n,t){t.d(n,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return w},fQ:function(){return g},hN:function(){return y},lY:function(){return v},G0:function(){return b},fm:function(){return m}});var i=t(2085),a=t(5877),s=t(2367),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>s.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>s.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{s.Z.analytics.webxrSet(i.D1.session_id,(0,a.v4)())},setCompatible:e=>{s.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([s.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{s.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{s.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{s.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{s.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{s.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},y=e=>{s.Z.analytics.set(i.MB.sku,e)},v=e=>{s.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{s.Z.analytics.set(i.MB.is_active_3d,`${e}`),s.Z.analytics.send({event:i.U3.product_page_view})},w=e=>{s.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{s.Z.analytics.set(i.MB.variation_id,e)},m=()=>r(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return s.Z.analytics.set(i.MB.fingerprint,e),e}));n.ZP=({client:e,dataLayerIntegration:n,sessionDurationMinutes:t,info:a={}})=>r(void 0,void 0,void 0,(function*(){const s={version:"6.22.6",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:t,dataLayerIntegration:n},r=new i.ZP(s,Object.assign(Object.assign({},a),{[i.MB.client]:e}));return yield r.init(),r}))},2297:function(e,n,t){t.d(n,{U2:function(){return r},v_:function(){return o},Bv:function(){return c}});var i=t(2367),a=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const s="https://api.r2u.io";function r(e){return a(this,void 0,void 0,(function*(){const n={};i.Z.refreshCache&&(n["Cache-Control"]="max-age=0");return(yield fetch(`${s}${e}`,{method:"get",headers:n})).json()}))}function o(e,n){return a(this,void 0,void 0,(function*(){return(yield fetch(`${s}${e}`,{method:"POST",body:JSON.stringify(n)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,n){const t={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,n)=>{},send:({event:e,data:n,scope:t})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};n.Z=t},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.6","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
package/dist/sku.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[465],{2587:function(e){function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,i,r){n=n||"&",i=i||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(n);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var c=e.length;o>0&&c>o&&(c=o);for(var l=0;l<c;++l){var u,d,p,f,v=e[l].replace(s,"%20"),y=v.indexOf(i);y>=0?(u=v.substr(0,y),d=v.substr(y+1)):(u=v,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),t(a,p)?Array.isArray(a[p])?a[p].push(f):a[p]=[a[p],f]:a[p]=f}return a}},2361:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,i,r){return n=n||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(r){var a=encodeURIComponent(t(r))+i;return Array.isArray(e[r])?e[r].map((function(e){return a+encodeURIComponent(t(e))})).join(n):a+encodeURIComponent(t(e[r]))})).filter(Boolean).join(n):r?encodeURIComponent(t(r))+i+encodeURIComponent(t(e)):""}},7673:function(e,t,n){t.decode=t.parse=n(2587),t.encode=t.stringify=n(2361)},6025:function(e,t,n){n.r(t);var i=n(2367),r=n(7523),a=n(7374),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};t.default={isActive:function(e){return s(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"));a.hN(e);try{const{isActive:t,manufacturerId:n}=yield(0,r.Z)(e);return n&&a.lY(n),a.G0(t),t}catch(e){return!1}}))},getData:function(e){return s(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"));return yield(0,r.Z)(e)}))}}},7374:function(e,t,n){n.d(t,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return m},fQ:function(){return w},hN:function(){return v},lY:function(){return y},G0:function(){return b},fm:function(){return x}});var i=n(2085),r=n(5877),a=n(2367),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>a.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>a.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{a.Z.analytics.webxrSet(i.D1.session_id,(0,r.v4)())},setCompatible:e=>{a.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([a.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{a.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{a.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{a.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{a.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{a.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{a.Z.analytics.set(i.MB.sku,e)},y=e=>{a.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{a.Z.analytics.set(i.MB.is_active_3d,`${e}`),a.Z.analytics.send({event:i.U3.product_page_view})},m=e=>{a.Z.analytics.set(i.MB.experiment_id,e)},w=e=>{a.Z.analytics.set(i.MB.variation_id,e)},x=()=>s(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return a.Z.analytics.set(i.MB.fingerprint,e),e}));t.ZP=({client:e,dataLayerIntegration:t,sessionDurationMinutes:n,info:r={}})=>s(void 0,void 0,void 0,(function*(){const a={version:"6.22.5",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:n,dataLayerIntegration:t},s=new i.ZP(a,Object.assign(Object.assign({},r),{[i.MB.client]:e}));return yield s.init(),s}))},7523:function(e,t,n){n.d(t,{Z:function(){return o}});var i=n(2297),r=n(2367),a=n(7673),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};function o(e){return s(this,void 0,void 0,(function*(){if(r.Z.products[e])return Promise.resolve(r.Z.products[e]);const t=a.encode({"product.sku":e,"asset.types":["GLB","USDZ"].join(","),"product_review.status":"RUNNING"}),[n]=yield(0,i.U2)(`/customers/${r.Z.customer._id}/products/assets?${t}`);if(!n)throw new Error("R2U - SKU not found");const s=n.assets||[],o=n.product_reviews||[],c=s.find((e=>"GLB"===e.type)),l=s.find((e=>"USDZ"===e.type)),u={glb:c?c.url:"",usdz:l?l.url:"",isActive:o.length>0,name:n.name,placement:n.placement||"floor",resize:n.resize||!1,sound:n.soundUrl,modelId:n.modelId,manufacturerId:n.manufacturerId,pdpUrl:n.pdpUrl,hdri:n.hdri,exposure:n.exposure,bloom:n.bloom,viewerOptions:n.viewerOptions||{}};return r.Z.products[e]=u,u}))}},2297:function(e,t,n){n.d(t,{U2:function(){return s},v_:function(){return o},Bv:function(){return c}});var i=n(2367),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};const a="https://api.r2u.io";function s(e){return r(this,void 0,void 0,(function*(){const t={};i.Z.refreshCache&&(t["Cache-Control"]="max-age=0");return(yield fetch(`${a}${e}`,{method:"get",headers:t})).json()}))}function o(e,t){return r(this,void 0,void 0,(function*(){return(yield fetch(`${a}${e}`,{method:"POST",body:JSON.stringify(t)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,t){const n={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,t)=>{},send:({event:e,data:t,scope:n})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};t.Z=n},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.5","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
|
1
|
+
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[465],{2587:function(e){function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,i,r){n=n||"&",i=i||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(n);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var c=e.length;o>0&&c>o&&(c=o);for(var l=0;l<c;++l){var u,d,p,f,v=e[l].replace(s,"%20"),y=v.indexOf(i);y>=0?(u=v.substr(0,y),d=v.substr(y+1)):(u=v,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),t(a,p)?Array.isArray(a[p])?a[p].push(f):a[p]=[a[p],f]:a[p]=f}return a}},2361:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,i,r){return n=n||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(r){var a=encodeURIComponent(t(r))+i;return Array.isArray(e[r])?e[r].map((function(e){return a+encodeURIComponent(t(e))})).join(n):a+encodeURIComponent(t(e[r]))})).filter(Boolean).join(n):r?encodeURIComponent(t(r))+i+encodeURIComponent(t(e)):""}},7673:function(e,t,n){t.decode=t.parse=n(2587),t.encode=t.stringify=n(2361)},6025:function(e,t,n){n.r(t);var i=n(2367),r=n(7523),a=n(7374),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};t.default={isActive:function(e){return s(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"));a.hN(e);try{const{isActive:t,manufacturerId:n}=yield(0,r.Z)(e);return n&&a.lY(n),a.G0(t),t}catch(e){return!1}}))},getData:function(e){return s(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"));return yield(0,r.Z)(e)}))}}},7374:function(e,t,n){n.d(t,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return m},fQ:function(){return w},hN:function(){return v},lY:function(){return y},G0:function(){return b},fm:function(){return x}});var i=n(2085),r=n(5877),a=n(2367),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>a.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>a.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{a.Z.analytics.webxrSet(i.D1.session_id,(0,r.v4)())},setCompatible:e=>{a.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([a.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{a.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{a.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{a.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{a.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{a.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{a.Z.analytics.set(i.MB.sku,e)},y=e=>{a.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{a.Z.analytics.set(i.MB.is_active_3d,`${e}`),a.Z.analytics.send({event:i.U3.product_page_view})},m=e=>{a.Z.analytics.set(i.MB.experiment_id,e)},w=e=>{a.Z.analytics.set(i.MB.variation_id,e)},x=()=>s(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return a.Z.analytics.set(i.MB.fingerprint,e),e}));t.ZP=({client:e,dataLayerIntegration:t,sessionDurationMinutes:n,info:r={}})=>s(void 0,void 0,void 0,(function*(){const a={version:"6.22.6",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:n,dataLayerIntegration:t},s=new i.ZP(a,Object.assign(Object.assign({},r),{[i.MB.client]:e}));return yield s.init(),s}))},7523:function(e,t,n){n.d(t,{Z:function(){return o}});var i=n(2297),r=n(2367),a=n(7673),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};function o(e){return s(this,void 0,void 0,(function*(){if(r.Z.products[e])return Promise.resolve(r.Z.products[e]);const t=a.encode({"product.sku":e,"asset.types":["GLB","USDZ"].join(","),"product_review.status":"RUNNING"}),[n]=yield(0,i.U2)(`/customers/${r.Z.customer._id}/products/assets?${t}`);if(!n)throw new Error("R2U - SKU not found");const s=n.assets||[],o=n.product_reviews||[],c=s.find((e=>"GLB"===e.type)),l=s.find((e=>"USDZ"===e.type)),u={glb:c?c.url:"",usdz:l?l.url:"",isActive:o.length>0,name:n.name,placement:n.placement||"floor",resize:n.resize||!1,sound:n.soundUrl,modelId:n.modelId,manufacturerId:n.manufacturerId,pdpUrl:n.pdpUrl,hdri:n.hdri,exposure:n.exposure,bloom:n.bloom,viewerOptions:n.viewerOptions||{}};return r.Z.products[e]=u,u}))}},2297:function(e,t,n){n.d(t,{U2:function(){return s},v_:function(){return o},Bv:function(){return c}});var i=n(2367),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};const a="https://api.r2u.io";function s(e){return r(this,void 0,void 0,(function*(){const t={};i.Z.refreshCache&&(t["Cache-Control"]="max-age=0");return(yield fetch(`${a}${e}`,{method:"get",headers:t})).json()}))}function o(e,t){return r(this,void 0,void 0,(function*(){return(yield fetch(`${a}${e}`,{method:"POST",body:JSON.stringify(t)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,t){const n={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,t)=>{},send:({event:e,data:t,scope:n})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};t.Z=n},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.6","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
|
@@ -19,6 +19,7 @@ export declare type ViewerFunctions = SKUHandler & Omit<ViewerRef, 'getCustomize
|
|
|
19
19
|
openAR: (customMaterial?: boolean) => Promise<boolean>;
|
|
20
20
|
renderQRCode: (element: HTMLElement, customMaterial?: boolean) => Promise<boolean>;
|
|
21
21
|
getViewerURL: (customMaterial?: boolean) => Promise<string | null>;
|
|
22
|
+
getGlb: (draco?: boolean) => Promise<Blob | null>;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
declare const _default: {
|
|
@@ -206,6 +206,11 @@ const create = ({ element, sku, name, popup = true, progressBarPosition = 'top',
|
|
|
206
206
|
return;
|
|
207
207
|
refViewerFunctions.current.downloadGlb(...args);
|
|
208
208
|
};
|
|
209
|
+
const getCustomizedGlb = (draco) => __awaiter(void 0, void 0, void 0, function* () {
|
|
210
|
+
if (!refViewerFunctions.current)
|
|
211
|
+
return null;
|
|
212
|
+
return refViewerFunctions.current.getCustomizedModel(draco);
|
|
213
|
+
});
|
|
209
214
|
const waitForFunctions = (callback) => __awaiter(void 0, void 0, void 0, function* () {
|
|
210
215
|
const interval = setInterval(() => {
|
|
211
216
|
if (refViewerFunctions.current) {
|
|
@@ -287,7 +292,12 @@ const create = ({ element, sku, name, popup = true, progressBarPosition = 'top',
|
|
|
287
292
|
focusHotspot,
|
|
288
293
|
getActiveHotspotId,
|
|
289
294
|
lookToHotspot,
|
|
290
|
-
customization: {
|
|
295
|
+
customization: {
|
|
296
|
+
openAR,
|
|
297
|
+
renderQRCode,
|
|
298
|
+
getViewerURL,
|
|
299
|
+
getGlb: getCustomizedGlb,
|
|
300
|
+
},
|
|
291
301
|
getSceneTree,
|
|
292
302
|
playAnimation,
|
|
293
303
|
pauseAnimation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../../src/methods/viewer.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,QAAQ,MAAM,WAAW,CAAA;AAEhC,OAAO,MAAM,MAAM,cAAc,CAAA;AAEjC,OAAO,KAAK,MAAM,UAAU,CAAA;AAG5B,OAAO,cAAc,MAAM,4BAA4B,CAAA;AACvD,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,OAAO,MAAM,mBAAmB,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,qBAAqB,CA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SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,KAAK,IACR,aAAa,EACb,WAAW,IACf,iBAAiB,EAAE,SAAS,CAAC,aAAa,CAAC,iBAAiB,EAC5D,OAAO,EAAE,CAAC,CAAC,EAAQ,EAAE;gBACnB,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,CAAA;gBACjC,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO;oBACtB,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAClB,CAAiD,EAClD;YACL,CAAC,EACD,oBAAoB,EAAE,SAAS,CAAC,aAAa,CAAC,oBAAoB,EAClE,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,IACd,EACF,OAAO,CACR,CAAA;IACH,CAAC,CAAA,CAAC,CAAA;EAAA,CAAA;AAEJ,eAAe;IACb,MAAM;CACP,CAAA"}
|
package/dist/{vendors.1ec6642030c154885945.bundle.js → vendors.2b1073deed7fa6ae5a48.bundle.js}
RENAMED
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
a:hover {
|
|
18
18
|
content: url('https://sdk.r2u.io/assets/r2u-icon.svg');
|
|
19
19
|
}
|
|
20
|
-
`;var a=({position:e})=>i.createElement(r,{position:e},i.createElement("a",{href:"https://r2u.io",target:"_blank",rel:"noopener noreferrer"},i.createElement("img",{alt:""})))},7374:function(e,t,n){n.d(t,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return C},KN:function(){return m},fQ:function(){return g},hN:function(){return v},lY:function(){return f},G0:function(){return w},fm:function(){return h}});var i=n(2085),s=n(5877),r=n(2367),a=function(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>r.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>r.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{r.Z.analytics.webxrSet(i.D1.session_id,(0,s.v4)())},setCompatible:e=>{r.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([r.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{r.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{r.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{r.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{r.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{r.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},C={onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{r.Z.analytics.set(i.MB.sku,e)},f=e=>{r.Z.analytics.set(i.MB.manufacturer_id,e)},w=e=>{r.Z.analytics.set(i.MB.is_active_3d,`${e}`),r.Z.analytics.send({event:i.U3.product_page_view})},m=e=>{r.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{r.Z.analytics.set(i.MB.variation_id,e)},h=()=>a(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return r.Z.analytics.set(i.MB.fingerprint,e),e}));t.ZP=({client:e,dataLayerIntegration:t,sessionDurationMinutes:n,info:s={}})=>a(void 0,void 0,void 0,(function*(){const r={version:"6.22.
|
|
20
|
+
`;var a=({position:e})=>i.createElement(r,{position:e},i.createElement("a",{href:"https://r2u.io",target:"_blank",rel:"noopener noreferrer"},i.createElement("img",{alt:""})))},7374:function(e,t,n){n.d(t,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return C},KN:function(){return m},fQ:function(){return g},hN:function(){return v},lY:function(){return f},G0:function(){return w},fm:function(){return h}});var i=n(2085),s=n(5877),r=n(2367),a=function(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>r.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>r.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{r.Z.analytics.webxrSet(i.D1.session_id,(0,s.v4)())},setCompatible:e=>{r.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([r.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{r.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{r.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{r.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{r.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{r.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},C={onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{r.Z.analytics.set(i.MB.sku,e)},f=e=>{r.Z.analytics.set(i.MB.manufacturer_id,e)},w=e=>{r.Z.analytics.set(i.MB.is_active_3d,`${e}`),r.Z.analytics.send({event:i.U3.product_page_view})},m=e=>{r.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{r.Z.analytics.set(i.MB.variation_id,e)},h=()=>a(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return r.Z.analytics.set(i.MB.fingerprint,e),e}));t.ZP=({client:e,dataLayerIntegration:t,sessionDurationMinutes:n,info:s={}})=>a(void 0,void 0,void 0,(function*(){const r={version:"6.22.6",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:n,dataLayerIntegration:t},a=new i.ZP(r,Object.assign(Object.assign({},s),{[i.MB.client]:e}));return yield a.init(),a}))},7523:function(e,t,n){n.d(t,{Z:function(){return o}});var i=n(2297),s=n(2367),r=n(7673),a=function(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))};function o(e){return a(this,void 0,void 0,(function*(){if(s.Z.products[e])return Promise.resolve(s.Z.products[e]);const t=r.encode({"product.sku":e,"asset.types":["GLB","USDZ"].join(","),"product_review.status":"RUNNING"}),[n]=yield(0,i.U2)(`/customers/${s.Z.customer._id}/products/assets?${t}`);if(!n)throw new Error("R2U - SKU not found");const a=n.assets||[],o=n.product_reviews||[],c=a.find((e=>"GLB"===e.type)),l=a.find((e=>"USDZ"===e.type)),u={glb:c?c.url:"",usdz:l?l.url:"",isActive:o.length>0,name:n.name,placement:n.placement||"floor",resize:n.resize||!1,sound:n.soundUrl,modelId:n.modelId,manufacturerId:n.manufacturerId,pdpUrl:n.pdpUrl,hdri:n.hdri,exposure:n.exposure,bloom:n.bloom,viewerOptions:n.viewerOptions||{}};return s.Z.products[e]=u,u}))}},2297:function(e,t,n){n.d(t,{U2:function(){return a},v_:function(){return o},Bv:function(){return c}});var i=n(2367),s=function(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}c((i=i.apply(e,t||[])).next())}))};const r="https://api.r2u.io";function a(e){return s(this,void 0,void 0,(function*(){const t={};i.Z.refreshCache&&(t["Cache-Control"]="max-age=0");return(yield fetch(`${r}${e}`,{method:"get",headers:t})).json()}))}function o(e,t){return s(this,void 0,void 0,(function*(){return(yield fetch(`${r}${e}`,{method:"POST",body:JSON.stringify(t)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,t){const n={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,t)=>{},send:({event:e,data:t,scope:n})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};t.Z=n},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.6","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
|
package/dist/viewer.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[428],{8305:function(e,o,t){t.r(o),t.d(o,{default:function(){return z}});var n=t(7294),r=t(3935),i=t(9361),l=t.n(i),
|
|
1
|
+
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[428],{8305:function(e,o,t){t.r(o),t.d(o,{default:function(){return z}});var n=t(7294),r=t(3935),i=t(9361),l=t.n(i),u=t(2367),a=t(5060),c=t(3026),s=t(9163);const d=s.default.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
4
|
|
|
@@ -120,4 +120,4 @@
|
|
|
120
120
|
box-shadow: none;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
`;var p=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};const v=(0,n.forwardRef)(((e,o)=>{const{exitImgSrc:t="https://sdk.r2u.io/assets/exit-icon.png",expandImgSrc:r="https://sdk.r2u.io/assets/expand-icon.png",popup:i=!0,children:l=null,waterMarkPosition:a,refViewerPopup:s,ModelViewerElement:v,refViewerFunctions:m}=e,f=p(e,["exitImgSrc","expandImgSrc","popup","children","waterMarkPosition","refViewerPopup","ModelViewerElement","refViewerFunctions"]),[g,b]=(0,n.useState)(!1),h=()=>{b(!1)};(0,n.useEffect)((()=>{s&&s.current&&s.current.addEventListener("mousedown",(e=>(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!1)))}),[s]);const w=(0,n.useRef)(null),[y,x]=(0,n.useState)(!1),[E,k]=(0,n.useState)(f.glbSrc);return(0,n.useImperativeHandle)(o,(()=>({updateGlb:e=>{k(e)}})),[]),n.createElement(d,{expanded:g,bloom:y},n.createElement("div",{className:"viewer-container"},E&&n.createElement(v,Object.assign({ref:m,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f,{glbSrc:E}),l,i&&n.createElement("button",{className:"expand-button",type:"button",onClick:()=>{b(!0)}},n.createElement("img",{className:"expand-image",alt:"",src:r})),a&&n.createElement(u.Z,{position:a}))),i&&g&&n.createElement("div",{className:"background",onMouseDown:h},n.createElement("div",{className:"viewer-container popup"},E&&n.createElement(v,Object.assign({ref:w,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f,{enableBloomButton:!1,glbSrc:E}),l,f.bloom&&n.createElement("button",{className:"bloomButton",type:"button",onMouseDown:e=>e.stopPropagation(),onClick:()=>{x(!y),w.current&&w.current.updateBloom(!y)}},y?n.createElement(c.cu,{className:"lamp"}):n.createElement(c.H_,{className:"lamp"})),n.createElement("button",{className:"exit-button",type:"button",onClick:h},n.createElement("img",{alt:"",src:t})),a&&n.createElement(u.Z,{position:a})))))}));v.displayName="R2UModelViewer";var m=v,f=t(1841),g=t.n(f),b=t(7523),h=t(7374),w=t(2297),y=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,a)}u((n=n.apply(e,o||[])).next())}))};function x(e,o){return y(this,void 0,void 0,(function*(){try{const t=`/viewer-customization/customer/${a.Z.customer._id}/products/${e}?customization=${encodeURI(JSON.stringify(o))}`;return(yield(0,w.U2)(t))||{}}catch(e){return console.error(`Error on getting customized model: ${e.message}`),Promise.reject(e)}}))}function E(e){return y(this,void 0,void 0,(function*(){try{const{status:o}=yield(0,w.U2)(`/job-status/${e}`);return["waiting","processing"].includes(o)?E(e):o}catch(e){return console.error(`Error on retry check conversion: ${e.message}`),Promise.reject(e)}}))}var k=t(5865);const S=({materialSlots:e,modelSlots:o})=>{e.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.forEach((e=>{e.activeModel&&S(e.activeModel)}))};var M=S;class C extends Error{constructor(e){super(e),this.name="ViewerError"}}var P=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,a)}u((n=n.apply(e,o||[])).next())}))};var z={create:({element:e,sku:o,name:t,popup:i=!0,progressBarPosition:u="top",progressBarColor:c,poster:s,autoRotate:d=!0,viewerProps:p})=>P(void 0,void 0,void 0,(function*(){return new Promise(((v,f)=>P(void 0,void 0,void 0,(function*(){if(!a.Z.init)return f(new Error("R2U - Not initialized"));if(!o)return f(new Error("R2U - Missing SKU"));const{glb:S,name:z,viewerOptions:R}=yield(0,b.Z)(o);let $=S;const O=a.Z.customer.waterMarkPosition,N=R||a.Z.customer.viewerOptions||void 0,j=(0,n.createRef)(),H=(0,n.createRef)(),I=(0,n.createRef)(),U=(0,n.createRef)(),A=e=>P(void 0,void 0,void 0,(function*(){return new Promise(((o,t)=>P(void 0,void 0,void 0,(function*(){var n,r;try{const{glb:t}=yield(0,b.Z)(e);$=t,yield null===(n=I.current)||void 0===n?void 0:n.updateGlb(t),null===(r=U.current)||void 0===r||r.updateGlb(t),o()}catch(e){t(e)}}))))})),B=(...e)=>{var o;null===(o=I.current)||void 0===o||o.insertModelNode(...e)},Z=(...e)=>P(void 0,void 0,void 0,(function*(){var o;yield null===(o=I.current)||void 0===o?void 0:o.insertSlotModelNode(...e)})),V=(...e)=>{var o;null===(o=I.current)||void 0===o||o.deleteModelNode(...e)},T=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateBloom(...e)},D=({sku:e,glb:o})=>P(void 0,void 0,void 0,(function*(){var t,n;if(o)return(null===(t=I.current)||void 0===t?void 0:t.loadMaterials(o))||!1;if(e){const{glb:o}=yield(0,b.Z)(e);return(null===(n=I.current)||void 0===n?void 0:n.loadMaterials(o))||!1}return!1})),F=(...e)=>{var o;null===(o=I.current)||void 0===o||o.setMaterial(...e)},_=(...e)=>{var o;return(null===(o=I.current)||void 0===o?void 0:o.setCustomMaterial(...e))||Promise.resolve(!1)},G=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getAllSlotsMaterials())||null},L=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getAllSlotsModels())||null},J=(...e)=>{var o;null===(o=I.current)||void 0===o||o.setModel(...e)},Q=(...e)=>{var o;null===(o=I.current)||void 0===o||o.setCamera(...e)},q=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateShadow(...e)},K=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateFog(...e)},W=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateBloomProps(...e)},X=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateEnvironment(...e)},Y=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getCamera())||null},ee=(e,t=!0)=>P(void 0,void 0,void 0,(function*(){try{if(!I.current)throw new C("Viewer not completely loaded!");let n=null;try{n=I.current.getCurrentCustomization(e)}catch(e){console.error(`Error on get current customization: ${e.message}`)}if(!n)throw new C("No customization returned!");M(n);const r=yield x(o,n);if(!r.glb){let e=null;try{e=yield I.current.getCustomizedModel(t)}catch(e){console.error(`Error on export the customization glb: ${e.message}`)}if(!e)throw new C("Could not export the customization glb!");r.glb=yield function(e,o,t){return y(this,void 0,void 0,(function*(){try{const n=`/viewer-customization/customer/${a.Z.customer._id}/products/${e}/upload-customization-data?customization=${encodeURI(JSON.stringify(o))}`,r=yield(0,w.U2)(n),i=new File([t],r.filename),l=new FormData;return Object.keys(r.fields).forEach((e=>l.append(e,r.fields[e]))),l.append("file",i),yield fetch(r.url,{method:"POST",body:l}),r.url.concat(r.fields.key)}catch(e){return console.error(`Error on upload customization: ${e.message}`),Promise.reject(e)}}))}(o,n,e)}if(!r.usdz){const e=yield function(e,o){return y(this,void 0,void 0,(function*(){try{const t=`/viewer-customization/customers/${a.Z.customer._id}/products/${e}/convert`;return yield(0,w.v_)(t,{filename:o})}catch(e){return console.error(`Error on request sku conversion: ${e.message}`),Promise.reject(e)}}))}(o,r.glb.split("/").pop());if("success"!==(yield E(e.jobId)))throw new C("Error while converting to usdz!");r.usdz=e.usdz}return x(o,n),r}catch(e){return console.error(`Error getting customization AR: ${e.message}`),Promise.reject(e)}})),oe=(e=!1,o=!0)=>P(void 0,void 0,void 0,(function*(){try{const t=yield ee(e,o);return(0,k.activateAR)({glb:t.glb,usdz:t.usdz,mode:"ar_preferred"}),!0}catch(e){return console.error(`Error opening AR: ${e.message}`),!1}})),te=(e,o=!1,t=!0)=>P(void 0,void 0,void 0,(function*(){try{const i=yield ee(o,t),a=`https://viewer.r2u.io/?customizationUri=${encodeURIComponent(i.glb.replace("https://storage.googleapis.com/","").replace(/\.glb$/,""))}&autoOpen=1`;return r.render(n.createElement(l(),Object.assign({},{"data-url":a},{value:a,style:{width:"100%",height:"100%"},renderAs:"svg"})),e),!0}catch(e){return console.error(`Error generating QR Code: ${e.message}`),!1}})),ne=(e=!1,o=!0)=>P(void 0,void 0,void 0,(function*(){try{const t=yield ee(e,o);return`https://viewer.r2u.io/?customizationUri=${encodeURIComponent(t.glb.replace("https://storage.googleapis.com/","").replace(/\.glb$/,""))}&autoOpen=1`}catch(e){return console.error(`Error generating viewer URL: ${e.message}`),null}})),re=(...e)=>{I.current&&I.current.downloadGlb(...e)},ie=e=>P(void 0,void 0,void 0,(function*(){const o=setInterval((()=>{I.current&&(clearInterval(o),e())}),200);setTimeout((()=>{if(!I.current)throw clearInterval(o),new Error("Internal error: Unable to load viewerRefFunctions.")}),1e4)})),le=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.insertHotspot(...e)}))})),ae=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.updateHotspot(...e)}))})),ue=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.deleteHotspot(...e)}))})),ce=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.showHotspot(...e)}))})),se=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.hideHotspot(...e)}))})),de=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.focusHotspot(...e)}))})),pe=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getActiveHotspotId())||null},ve=(...e)=>P(void 0,void 0,void 0,(function*(){yield ie((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.lookToHotspot(...e)}))})),me=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getSceneTree())||null},fe=(...e)=>{var o;null===(o=I.current)||void 0===o||o.playAnimation(...e)},ge=()=>{var e;null===(e=I.current)||void 0===e||e.pauseAnimation()},be=(...e)=>P(void 0,void 0,void 0,(function*(){var o;null===(o=I.current)||void 0===o||o.stopAnimation(...e)})),he=(...e)=>P(void 0,void 0,void 0,(function*(){var o;return(null===(o=I.current)||void 0===o?void 0:o.takeSnapshot(...e))||null})),we=(...e)=>P(void 0,void 0,void 0,(function*(){var o;null===(o=I.current)||void 0===o||o.updateBackground(...e)}));r.render(n.createElement(m,Object.assign({ref:U,alt:t||z,autoRotate:d,poster:s,refViewer:j,refViewerPopup:H,refViewerFunctions:I,waterMarkPosition:O,progressBarPosition:u,progressBarColor:c,popup:i},N,p,{componentDidMount:h.E9.componentDidMount,onClick:e=>{h.E9.onClick(),(null==p?void 0:p.onClick)&&(null==p||p.onClick(e))},onSessionTimeCollect:h.E9.onSessionTimeCollect,ModelViewerElement:g(),onLoad:()=>{v({setSku:A,insertModelNode:B,insertSlotModelNode:Z,deleteModelNode:V,loadMaterials:D,setMaterial:F,setCustomMaterial:_,getAllSlotsMaterials:G,updateBloom:T,getAllSlotsModels:L,setModel:J,setCamera:Q,updateShadow:q,updateFog:K,updateBloomProps:W,updateEnvironment:X,getCamera:Y,insertHotspot:le,updateHotspot:ae,deleteHotspot:ue,showHotspot:ce,hideHotspot:se,focusHotspot:de,getActiveHotspotId:pe,lookToHotspot:ve,customization:{openAR:oe,renderQRCode:te,getViewerURL:ne},getSceneTree:me,playAnimation:fe,pauseAnimation:ge,stopAnimation:be,downloadGlb:re,takeSnapshot:he,updateBackground:we})},glbSrc:$})),e)}))))}))}},5671:function(e,o,t){function n(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}t.d(o,{Z:function(){return n}})},3144:function(e,o,t){function n(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,o,t){return o&&n(e.prototype,o),t&&n(e,t),e}t.d(o,{Z:function(){return r}})},4942:function(e,o,t){function n(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}t.d(o,{Z:function(){return n}})},1002:function(e,o,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.d(o,{Z:function(){return n}})}}]);
|
|
123
|
+
`;var p=function(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t};const v=(0,n.forwardRef)(((e,o)=>{const{exitImgSrc:t="https://sdk.r2u.io/assets/exit-icon.png",expandImgSrc:r="https://sdk.r2u.io/assets/expand-icon.png",popup:i=!0,children:l=null,waterMarkPosition:u,refViewerPopup:s,ModelViewerElement:v,refViewerFunctions:m}=e,f=p(e,["exitImgSrc","expandImgSrc","popup","children","waterMarkPosition","refViewerPopup","ModelViewerElement","refViewerFunctions"]),[g,b]=(0,n.useState)(!1),h=()=>{b(!1)};(0,n.useEffect)((()=>{s&&s.current&&s.current.addEventListener("mousedown",(e=>(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),!1)))}),[s]);const w=(0,n.useRef)(null),[y,x]=(0,n.useState)(!1),[E,k]=(0,n.useState)(f.glbSrc);return(0,n.useImperativeHandle)(o,(()=>({updateGlb:e=>{k(e)}})),[]),n.createElement(d,{expanded:g,bloom:y},n.createElement("div",{className:"viewer-container"},E&&n.createElement(v,Object.assign({ref:m,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f,{glbSrc:E}),l,i&&n.createElement("button",{className:"expand-button",type:"button",onClick:()=>{b(!0)}},n.createElement("img",{className:"expand-image",alt:"",src:r})),u&&n.createElement(a.Z,{position:u}))),i&&g&&n.createElement("div",{className:"background",onMouseDown:h},n.createElement("div",{className:"viewer-container popup"},E&&n.createElement(v,Object.assign({ref:w,componentDidMount:f.componentDidMount,onClick:f.onClick,onSessionTimeCollect:f.onSessionTimeCollect},f,{enableBloomButton:!1,glbSrc:E}),l,f.bloom&&n.createElement("button",{className:"bloomButton",type:"button",onMouseDown:e=>e.stopPropagation(),onClick:()=>{x(!y),w.current&&w.current.updateBloom(!y)}},y?n.createElement(c.cu,{className:"lamp"}):n.createElement(c.H_,{className:"lamp"})),n.createElement("button",{className:"exit-button",type:"button",onClick:h},n.createElement("img",{alt:"",src:t})),u&&n.createElement(a.Z,{position:u})))))}));v.displayName="R2UModelViewer";var m=v,f=t(1841),g=t.n(f),b=t(7523),h=t(7374),w=t(2297),y=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,u)}a((n=n.apply(e,o||[])).next())}))};function x(e,o){return y(this,void 0,void 0,(function*(){try{const t=`/viewer-customization/customer/${u.Z.customer._id}/products/${e}?customization=${encodeURI(JSON.stringify(o))}`;return(yield(0,w.U2)(t))||{}}catch(e){return console.error(`Error on getting customized model: ${e.message}`),Promise.reject(e)}}))}function E(e){return y(this,void 0,void 0,(function*(){try{const{status:o}=yield(0,w.U2)(`/job-status/${e}`);return["waiting","processing"].includes(o)?E(e):o}catch(e){return console.error(`Error on retry check conversion: ${e.message}`),Promise.reject(e)}}))}var k=t(5865);const S=({materialSlots:e,modelSlots:o})=>{e.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.sort(((e,o)=>e.slot>o.slot?1:e.slot<o.slot?-1:0)),o.forEach((e=>{e.activeModel&&S(e.activeModel)}))};var M=S;class C extends Error{constructor(e){super(e),this.name="ViewerError"}}var P=function(e,o,t,n){return new(t||(t=Promise))((function(r,i){function l(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?r(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(l,u)}a((n=n.apply(e,o||[])).next())}))};var z={create:({element:e,sku:o,name:t,popup:i=!0,progressBarPosition:a="top",progressBarColor:c,poster:s,autoRotate:d=!0,viewerProps:p})=>P(void 0,void 0,void 0,(function*(){return new Promise(((v,f)=>P(void 0,void 0,void 0,(function*(){if(!u.Z.init)return f(new Error("R2U - Not initialized"));if(!o)return f(new Error("R2U - Missing SKU"));const{glb:S,name:z,viewerOptions:R}=yield(0,b.Z)(o);let $=S;const O=u.Z.customer.waterMarkPosition,N=R||u.Z.customer.viewerOptions||void 0,j=(0,n.createRef)(),H=(0,n.createRef)(),I=(0,n.createRef)(),U=(0,n.createRef)(),A=e=>P(void 0,void 0,void 0,(function*(){return new Promise(((o,t)=>P(void 0,void 0,void 0,(function*(){var n,r;try{const{glb:t}=yield(0,b.Z)(e);$=t,yield null===(n=I.current)||void 0===n?void 0:n.updateGlb(t),null===(r=U.current)||void 0===r||r.updateGlb(t),o()}catch(e){t(e)}}))))})),B=(...e)=>{var o;null===(o=I.current)||void 0===o||o.insertModelNode(...e)},Z=(...e)=>P(void 0,void 0,void 0,(function*(){var o;yield null===(o=I.current)||void 0===o?void 0:o.insertSlotModelNode(...e)})),V=(...e)=>{var o;null===(o=I.current)||void 0===o||o.deleteModelNode(...e)},T=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateBloom(...e)},D=({sku:e,glb:o})=>P(void 0,void 0,void 0,(function*(){var t,n;if(o)return(null===(t=I.current)||void 0===t?void 0:t.loadMaterials(o))||!1;if(e){const{glb:o}=yield(0,b.Z)(e);return(null===(n=I.current)||void 0===n?void 0:n.loadMaterials(o))||!1}return!1})),F=(...e)=>{var o;null===(o=I.current)||void 0===o||o.setMaterial(...e)},G=(...e)=>{var o;return(null===(o=I.current)||void 0===o?void 0:o.setCustomMaterial(...e))||Promise.resolve(!1)},_=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getAllSlotsMaterials())||null},L=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getAllSlotsModels())||null},J=(...e)=>{var o;null===(o=I.current)||void 0===o||o.setModel(...e)},Q=(...e)=>{var o;null===(o=I.current)||void 0===o||o.setCamera(...e)},q=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateShadow(...e)},K=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateFog(...e)},W=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateBloomProps(...e)},X=(...e)=>{var o;null===(o=I.current)||void 0===o||o.updateEnvironment(...e)},Y=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getCamera())||null},ee=(e,t=!0)=>P(void 0,void 0,void 0,(function*(){try{if(!I.current)throw new C("Viewer not completely loaded!");let n=null;try{n=I.current.getCurrentCustomization(e)}catch(e){console.error(`Error on get current customization: ${e.message}`)}if(!n)throw new C("No customization returned!");M(n);const r=yield x(o,n);if(!r.glb){let e=null;try{e=yield I.current.getCustomizedModel(t)}catch(e){console.error(`Error on export the customization glb: ${e.message}`)}if(!e)throw new C("Could not export the customization glb!");r.glb=yield function(e,o,t){return y(this,void 0,void 0,(function*(){try{const n=`/viewer-customization/customer/${u.Z.customer._id}/products/${e}/upload-customization-data?customization=${encodeURI(JSON.stringify(o))}`,r=yield(0,w.U2)(n),i=new File([t],r.filename),l=new FormData;return Object.keys(r.fields).forEach((e=>l.append(e,r.fields[e]))),l.append("file",i),yield fetch(r.url,{method:"POST",body:l}),r.url.concat(r.fields.key)}catch(e){return console.error(`Error on upload customization: ${e.message}`),Promise.reject(e)}}))}(o,n,e)}if(!r.usdz){const e=yield function(e,o){return y(this,void 0,void 0,(function*(){try{const t=`/viewer-customization/customers/${u.Z.customer._id}/products/${e}/convert`;return yield(0,w.v_)(t,{filename:o})}catch(e){return console.error(`Error on request sku conversion: ${e.message}`),Promise.reject(e)}}))}(o,r.glb.split("/").pop());if("success"!==(yield E(e.jobId)))throw new C("Error while converting to usdz!");r.usdz=e.usdz}return x(o,n),r}catch(e){return console.error(`Error getting customization AR: ${e.message}`),Promise.reject(e)}})),oe=(e=!1,o=!0)=>P(void 0,void 0,void 0,(function*(){try{const t=yield ee(e,o);return(0,k.activateAR)({glb:t.glb,usdz:t.usdz,mode:"ar_preferred"}),!0}catch(e){return console.error(`Error opening AR: ${e.message}`),!1}})),te=(e,o=!1,t=!0)=>P(void 0,void 0,void 0,(function*(){try{const i=yield ee(o,t),u=`https://viewer.r2u.io/?customizationUri=${encodeURIComponent(i.glb.replace("https://storage.googleapis.com/","").replace(/\.glb$/,""))}&autoOpen=1`;return r.render(n.createElement(l(),Object.assign({},{"data-url":u},{value:u,style:{width:"100%",height:"100%"},renderAs:"svg"})),e),!0}catch(e){return console.error(`Error generating QR Code: ${e.message}`),!1}})),ne=(e=!1,o=!0)=>P(void 0,void 0,void 0,(function*(){try{const t=yield ee(e,o);return`https://viewer.r2u.io/?customizationUri=${encodeURIComponent(t.glb.replace("https://storage.googleapis.com/","").replace(/\.glb$/,""))}&autoOpen=1`}catch(e){return console.error(`Error generating viewer URL: ${e.message}`),null}})),re=(...e)=>{I.current&&I.current.downloadGlb(...e)},ie=e=>P(void 0,void 0,void 0,(function*(){return I.current?I.current.getCustomizedModel(e):null})),le=e=>P(void 0,void 0,void 0,(function*(){const o=setInterval((()=>{I.current&&(clearInterval(o),e())}),200);setTimeout((()=>{if(!I.current)throw clearInterval(o),new Error("Internal error: Unable to load viewerRefFunctions.")}),1e4)})),ue=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.insertHotspot(...e)}))})),ae=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.updateHotspot(...e)}))})),ce=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.deleteHotspot(...e)}))})),se=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.showHotspot(...e)}))})),de=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.hideHotspot(...e)}))})),pe=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.focusHotspot(...e)}))})),ve=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getActiveHotspotId())||null},me=(...e)=>P(void 0,void 0,void 0,(function*(){yield le((()=>{var o;return null===(o=I.current)||void 0===o?void 0:o.lookToHotspot(...e)}))})),fe=()=>{var e;return(null===(e=I.current)||void 0===e?void 0:e.getSceneTree())||null},ge=(...e)=>{var o;null===(o=I.current)||void 0===o||o.playAnimation(...e)},be=()=>{var e;null===(e=I.current)||void 0===e||e.pauseAnimation()},he=(...e)=>P(void 0,void 0,void 0,(function*(){var o;null===(o=I.current)||void 0===o||o.stopAnimation(...e)})),we=(...e)=>P(void 0,void 0,void 0,(function*(){var o;return(null===(o=I.current)||void 0===o?void 0:o.takeSnapshot(...e))||null})),ye=(...e)=>P(void 0,void 0,void 0,(function*(){var o;null===(o=I.current)||void 0===o||o.updateBackground(...e)}));r.render(n.createElement(m,Object.assign({ref:U,alt:t||z,autoRotate:d,poster:s,refViewer:j,refViewerPopup:H,refViewerFunctions:I,waterMarkPosition:O,progressBarPosition:a,progressBarColor:c,popup:i},N,p,{componentDidMount:h.E9.componentDidMount,onClick:e=>{h.E9.onClick(),(null==p?void 0:p.onClick)&&(null==p||p.onClick(e))},onSessionTimeCollect:h.E9.onSessionTimeCollect,ModelViewerElement:g(),onLoad:()=>{v({setSku:A,insertModelNode:B,insertSlotModelNode:Z,deleteModelNode:V,loadMaterials:D,setMaterial:F,setCustomMaterial:G,getAllSlotsMaterials:_,updateBloom:T,getAllSlotsModels:L,setModel:J,setCamera:Q,updateShadow:q,updateFog:K,updateBloomProps:W,updateEnvironment:X,getCamera:Y,insertHotspot:ue,updateHotspot:ae,deleteHotspot:ce,showHotspot:se,hideHotspot:de,focusHotspot:pe,getActiveHotspotId:ve,lookToHotspot:me,customization:{openAR:oe,renderQRCode:te,getViewerURL:ne,getGlb:ie},getSceneTree:fe,playAnimation:ge,pauseAnimation:be,stopAnimation:he,downloadGlb:re,takeSnapshot:we,updateBackground:ye})},glbSrc:$})),e)}))))}))}},5671:function(e,o,t){function n(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}t.d(o,{Z:function(){return n}})},3144:function(e,o,t){function n(e,o){for(var t=0;t<o.length;t++){var n=o[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,o,t){return o&&n(e.prototype,o),t&&n(e,t),e}t.d(o,{Z:function(){return r}})},4942:function(e,o,t){function n(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}t.d(o,{Z:function(){return n}})},1002:function(e,o,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.d(o,{Z:function(){return n}})}}]);
|