-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path556.7f34cbbae0d78587d449.bundle.js
More file actions
2 lines (2 loc) · 33.4 KB
/
556.7f34cbbae0d78587d449.bundle.js
File metadata and controls
2 lines (2 loc) · 33.4 KB
1
2
/*! For license information please see 556.7f34cbbae0d78587d449.bundle.js.LICENSE.txt */
"use strict";(self.webpackChunkmetapress_ready_player_me=self.webpackChunkmetapress_ready_player_me||[]).push([[556],{556:(e,t,r)=>{r.r(t),r.d(t,{default:()=>N});var n=r(504),o=r(604),i=function(e){return n.createElement("div",{style:{display:"flex",flex:"0 0 auto",height:40,borderBottom:"1px solid rgba(255, 255, 255, 0.1)",alignItems:"center"}},n.createElement("div",{style:{fontSize:15,margin:"0px 20px",flex:"1 1 1px"}},e.title),n.createElement("div",{title:"Close",onClick:function(t){return e.onClose(!0)},style:{width:24,height:"100%",flex:"0 0 auto",cursor:"pointer",backgroundSize:"contain",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundImage:"url(".concat(r(908),")")}}),n.createElement("div",{style:{width:10,flex:"0 0 auto"}}))},a=function(e){return n.createElement("div",{style:{display:"flex",flexDirection:"column",flex:"1 1 auto",position:"relative",maxHeight:"calc(100% - 40px)"}},e.children)};function u(e){return u="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},u(e)}function c(){c=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:j(e,r,u)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",b={};function g(){}function w(){}function _(){}var x={};f(x,a,(function(){return this}));var E=Object.getPrototypeOf,k=E&&E(E(I([])));k&&k!==r&&n.call(k,a)&&(x=k);var L=_.prototype=g.prototype=Object.create(x);function S(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function r(o,i,a,c){var l=h(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==u(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=y;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=h(t,r,n);if("normal"===l.type){if(o=n.done?m:v,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=h(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(u(t)+" is not iterable")}return w.prototype=_,o(L,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,f(e,s,"GeneratorFunction")),e.prototype=Object.create(L),e},t.awrap=function(e){return{__await:e}},S(O.prototype),f(O.prototype,l,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(p(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(L),f(L,s,"Generator"),f(L,a,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=I,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function l(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,m(n.key),n)}}function f(e,t,r){return t=h(t),function(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function d(e,t,r){return(t=m(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:String(t)}var b=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return d(y(e=f(this,t,[].concat(n))),"contentRef",null),d(y(e),"onMessage",function(){var t,r=(t=c().mark((function t(r){var n,o,i,a,u;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=null==r?void 0:r.data,t.prev=1,"string"==typeof n&&(n=JSON.parse(n)),t.next=8;break;case 5:return t.prev=5,t.t0=t.catch(1),t.abrupt("return");case 8:if("readyplayerme"===n.source){t.next=10;break}return t.abrupt("return");case 10:if("v1.frame.ready"!=n.eventName){t.next=20;break}console.log("[ReadyPlayerMe] Frame loaded successfully.");case 12:if(null!==(o=e.contentRef)&&void 0!==o&&o.contentWindow){t.next=17;break}return t.next=15,new Promise((function(e){return setTimeout(e,250)}));case 15:t.next=12;break;case 17:e.contentRef.contentWindow.postMessage(JSON.stringify({target:"readyplayerme",type:"subscribe",eventName:"v1.**"}),"*"),t.next=30;break;case 20:if("v1.avatar.exported"!=n.eventName){t.next=30;break}if(i=/([0-9a-zA-Z]+)\.glb/g.exec(n.data.url)[1]){t.next=26;break}return console.warn('[ReadyPlayerMe] Unexpected URL format returned. Attempting to continue with URL: "'.concat(n.data.url,'"')),e.props.onAvatarExported({modelURL:n.data.url,modelID:""}),t.abrupt("return");case 26:a=["viseme_CH","viseme_DD","viseme_E","viseme_FF","viseme_I","viseme_O","viseme_PP","viseme_RR","viseme_SS","viseme_TH","viseme_U","viseme_aa","viseme_kk","viseme_nn","viseme_sil","eyeBlinkLeft","eyeBlinkRight","eyeLookDownLeft","eyeLookDownRight","eyeLookInLeft","eyeLookInRight","eyeLookOutLeft","eyeLookOutLeft","eyeLookOutRight","eyeLookUpLeft","eyeLookUpRight"],u="https://models.readyplayer.me/".concat(i,".glb?pose=T&lod=0&textureSizeLimit=1024&textureAtlas=1024&morphTargets=").concat(a.join(",")),console.debug('[ReadyPlayerMe] Fetched lower LOD-level model with URL: "'.concat(u,'"')),e.props.onAvatarExported({modelURL:u,modelID:i});case 30:case"end":return t.stop()}}),t,null,[[1,5]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(e){l(i,n,o,a,u,"next",e)}function u(e){l(i,n,o,a,u,"throw",e)}a(void 0)}))});return function(e){return r.apply(this,arguments)}}()),e}var r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(t,e),r=t,(o=[{key:"componentDidMount",value:function(){window.addEventListener("message",this.onMessage)}},{key:"render",value:function(){var e=this;return n.createElement("div",{style:{display:"flex",position:"relative",flexDirection:"column",flex:"1 1 1px",width:"100%",height:"100%"}},n.createElement(i,{title:"Ready Player Me",onClose:this.props.onClose}),n.createElement(a,null,n.createElement("iframe",{ref:function(t){return e.contentRef=t},src:"https://metapress.readyplayer.me/avatar?frameApi&bodyType=fullbody",style:{width:"100%",height:"100%",margin:0,padding:0,border:"none"}})))}}])&&s(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),t}(n.PureComponent);function g(e){return g="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},g(e)}function w(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_(n.key),n)}}function _(e){var t=function(e,t){if("object"!=g(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==g(t)?t:String(t)}function x(e,t,r){return t=k(t),function(e,t){if(t&&("object"===g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,E()?Reflect.construct(t,r||[],k(e).constructor):t.apply(e,r))}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(E=function(){return!!e})()}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),x(this,t,arguments)}var o,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}(t,e),o=t,(u=[{key:"render",value:function(){var e=this;return n.createElement(n.Fragment,null,n.createElement(i,{title:"Choose Avatar",onClose:this.props.onClose}),n.createElement(a,null,n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:30,padding:20}},n.createElement("div",{style:{fontSize:16,color:"#D9D9D9",textAlign:"center"}},"We have detected that you have a previous avatar saved.",n.createElement("br",null),"Would you like to use that avatar, or create a new one?"),n.createElement(O,{icon:r(292),title:"Use Previous Avatar",primary:"#206173",secondary:"#133d49",onClick:function(t){return e.props.onChoice({choice:"previous"})}}),n.createElement(O,{icon:r(984),title:"Create New Avatar",primary:"#207344",secondary:"#185934",onClick:function(t){return e.props.onChoice({choice:"new"})}}))))}}])&&w(o.prototype,u),Object.defineProperty(o,"prototype",{writable:!1}),t}(n.PureComponent),O=function(e){return n.createElement("div",{onClick:e.onClick,style:{display:"flex",width:"100%",height:80,color:"#FFF",fontSize:20,backgroundColor:e.primary,boxSizing:"border-box",borderRadius:10,boxShadow:"0 0.4rem 0 0 ".concat(e.secondary,"e6, 0 5px 10px 0px rgba(0, 0, 0, 0.6)"),cursor:"pointer",textAlign:"center",justifyContent:"center",alignItems:"center"}},e.icon?n.createElement("img",{src:e.icon,style:{width:30,height:30,marginRight:20}}):null,e.title)};function j(e){return j="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},j(e)}function P(){P=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:S(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",v="completed",d={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var _=Object.getPrototypeOf,x=_&&_(_(I([])));x&&x!==r&&n.call(x,a)&&(w=x);var E=g.prototype=m.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function L(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==j(s)&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function S(t,r,n){var o=p;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=O(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?v:h,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function O(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(j(t)+" is not iterable")}return b.prototype=g,o(E,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},k(L.prototype),l(L.prototype,u,(function(){return this})),t.AsyncIterator=L,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new L(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(E),l(E,c,"Generator"),l(E,a,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=I,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),d}},t}function R(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function C(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){R(i,n,o,a,u,"next",e)}function u(e){R(i,n,o,a,u,"throw",e)}a(void 0)}))}}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,A(n.key),n)}}function I(e,t,r){return(t=A(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e){var t=function(e,t){if("object"!=j(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==j(t)?t:String(t)}var N=function(){function e(){var t,r,i,a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),I(this,"id",(null===(t=o.kt)||void 0===t?void 0:t.id)||o.N9),I(this,"name",(null===(r=o.kt)||void 0===r?void 0:r.name)||o.N9),I(this,"description",(null===(i=o.kt)||void 0===i?void 0:i.description)||o.kr),I(this,"version",o.WU),I(this,"provides",[]),I(this,"requires",["backend","entities","dialogs","profile"]),I(this,"avatarResolve",null),I(this,"onContentClose",(function(e){var t;e&&(null===(t=a.avatarResolve)||void 0===t||t.call(a,{error:"User cancelled avatar creation."}),a.avatarResolve=null)})),I(this,"onAvatarExported",(function(e){var t;null===(t=a.avatarResolve)||void 0===t||t.call(a,e),a.avatarResolve=null})),I(this,"getModelURL",C(P().mark((function e(){var t,r,o,i,u,c;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=metapress.profile.get("rpm_model_url"),r=null,!t){e.next=10;break}return e.next=5,a.showPicker();case 5:if(r=e.sent){e.next=8;break}return e.abrupt("return",null);case 8:if("previous"!==r.type){e.next=10;break}return e.abrupt("return",t);case 10:return o=metapress.dialogs.show({title:"Create your own",noHeader:!0,hideMetaverseButton:!0,content:n.createElement(b,{onAvatarExported:a.onAvatarExported,onClose:a.onContentClose})}),e.next=13,new Promise((function(e,t){a.avatarResolve=e}));case 13:if(i=e.sent,o.close(),a.onContentClose(!1),i&&!i.error){e.next=18;break}throw new Error((null==i?void 0:i.error)||"User cancelled avatar creation.");case 18:return u=i.modelURL,c=i.modelID,u+=(u.includes("?")?"&":"?")+"_="+Date.now(),metapress.profile.set("rpm_model_url",u),e.abrupt("return",{url:u,modelID:c});case 23:case"end":return e.stop()}}),e)})))),I(this,"$ai_getKnowledgeBaseEntries",(function(){return[{id:a.id+":createAvatar",type:"action",name:"Create custom avatar",tags:"Create avatar, new avatar, customize avatar, ready player me, RPM, avatar creation, avatar maker",content:"\n Call this action to show the avatar creation UI and allow the user to create their own avatar.\n ",action:function(e){return metapress.avatars.setConfigurationByID("extra.rpm"),"Opened avatar creation panel."}}]}))}var t,i;return t=e,i=[{key:"showPicker",value:function(){return new Promise(function(){var e=C(P().mark((function e(t,r){var o,i,a,u,c;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=!1,i=function(e,r){var n;o=r,null==c||null===(n=c.close)||void 0===n||n.call(c),t(e)},a=function(){i(null,!1)},u=function(e){try{if(!e||"object"!=j(e)||!e.choice)throw new Error("Invalid data from choice.");"previous"===e.choice?i({type:"previous"},!0):i({type:"new"},!0)}catch(e){i(null,!1)}},c=metapress.dialogs.show({title:"Choose Avatar",noHeader:!0,hideMetaverseButton:!0,content:n.createElement(S,{onChoice:u,onClose:a})});case 5:if(c.isClosed){e.next=12;break}if(!o){e.next=8;break}return e.abrupt("break",12);case 8:return e.next=10,new Promise((function(e){return setTimeout(e,250)}));case 10:e.next=5;break;case 12:o||i(null,!1);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}())}},{key:"$getAvatarConfigurations",value:function(){return{avatar_id:"extra.rpm",avatar_image:r(268),avatar_name:"Create your own",avatar_description:"Ready Player Me avatar. This opens the avatar creation UI and allows you to create your own avatar.",avatar_skeletonType:"core.human",avatar_height:1.8,avatar_walkSpeed:1.2,avatar_runSpeed:4,extra_offset_y:0,order:-10,url:"",getURL:this.getModelURL,type:"mesh",mesh_bounding_box:!0,"modifier:avatar-controller":!0,"modifier:physics":!0,physics_enabled:!0,physics_shape:"capsule",physics_lockRotation:!0,physics_anchorBottom:!0,physics_kinematicVelocity:!0,"modifier:transform-smoothing":!0,"modifier:face-movement-direction":!0,"modifier:animator":!0}}}],i&&T(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},28:(e,t)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator,y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,d={};function m(e,t,r){this.props=e,this.context=t,this.refs=d,this.updater=r||y}function b(){}function g(e,t,r){this.props=e,this.context=t,this.refs=d,this.updater=r||y}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=m.prototype;var w=g.prototype=new b;w.constructor=g,v(w,m.prototype),w.isPureReactComponent=!0;var _=Array.isArray,x=Object.prototype.hasOwnProperty,E={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function L(e,t,n){var o,i={},a=null,u=null;if(null!=t)for(o in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,o)&&!k.hasOwnProperty(o)&&(i[o]=t[o]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var l=Array(c),s=0;s<c;s++)l[s]=arguments[s+2];i.children=l}if(e&&e.defaultProps)for(o in c=e.defaultProps)void 0===i[o]&&(i[o]=c[o]);return{$$typeof:r,type:e,key:a,ref:u,props:i,_owner:E.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var O=/\/+/g;function j(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function P(e,t,o,i,a){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var c=!1;if(null===e)c=!0;else switch(u){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case r:case n:c=!0}}if(c)return a=a(c=e),e=""===i?"."+j(c,0):i,_(a)?(o="",null!=e&&(o=e.replace(O,"$&/")+"/"),P(a,t,o,"",(function(e){return e}))):null!=a&&(S(a)&&(a=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+e)),t.push(a)),1;if(c=0,i=""===i?".":i+":",_(e))for(var l=0;l<e.length;l++){var s=i+j(u=e[l],l);c+=P(u,t,o,s,a)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),l=0;!(u=e.next()).done;)c+=P(u=u.value,t,o,s=i+j(u,l++),a);else if("object"===u)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function R(e,t,r){if(null==e)return e;var n=[],o=0;return P(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function C(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var T={current:null},I={transition:null},A={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:I,ReactCurrentOwner:E};t.Children={map:R,forEach:function(e,t,r){R(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return R(e,(function(){t++})),t},toArray:function(e){return R(e,(function(e){return e}))||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=o,t.Profiler=a,t.PureComponent=g,t.StrictMode=i,t.Suspense=s,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=v({},e.props),i=e.key,a=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,u=E.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)x.call(t,l)&&!k.hasOwnProperty(l)&&(o[l]=void 0===t[l]&&void 0!==c?c[l]:t[l])}var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){c=Array(l);for(var s=0;s<l;s++)c[s]=arguments[s+2];o.children=c}return{$$typeof:r,type:e.type,key:i,ref:a,props:o,_owner:u}},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:u,_context:e},e.Consumer=e},t.createElement=L,t.createFactory=function(e){var t=L.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:C}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=I.transition;I.transition={};try{e()}finally{I.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return T.current.useCallback(e,t)},t.useContext=function(e){return T.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return T.current.useDeferredValue(e)},t.useEffect=function(e,t){return T.current.useEffect(e,t)},t.useId=function(){return T.current.useId()},t.useImperativeHandle=function(e,t,r){return T.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return T.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return T.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return T.current.useMemo(e,t)},t.useReducer=function(e,t,r){return T.current.useReducer(e,t,r)},t.useRef=function(e){return T.current.useRef(e)},t.useState=function(e){return T.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return T.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return T.current.useTransition()},t.version="18.2.0"},504:(e,t,r)=>{e.exports=r(28)},908:(e,t,r)=>{e.exports=r.p+"close.9b4e57a8512d18bd5a68.svg"},984:(e,t,r)=>{e.exports=r.p+"new.c0916108197d9671bb9a.svg"},292:(e,t,r)=>{e.exports=r.p+"previous.0eb6640cfc4f3b813603.svg"},268:(e,t,r)=>{e.exports=r.p+"rpm-icon.dc6a7525209506fc62dd.jpg"}}]);