-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathapi.js
More file actions
1 lines (1 loc) · 3.26 KB
/
Copy pathapi.js
File metadata and controls
1 lines (1 loc) · 3.26 KB
1
var y=Object.create;var{getPrototypeOf:g,defineProperty:d,getOwnPropertyNames:l,getOwnPropertyDescriptor:p}=Object,u=Object.prototype.hasOwnProperty;var f=(A,e,t)=>{t=A!=null?y(g(A)):{};let i=e||!A||!A.__esModule?d(t,"default",{value:A,enumerable:!0}):t;for(let n of l(A))if(!u.call(i,n))d(i,n,{get:()=>A[n],enumerable:!0});return i},c=/*@__PURE__*/new WeakMap,h=(A)=>{var e=c.get(A),t;if(e)return e;if(e=d({},"__esModule",{value:!0}),A&&typeof A==="object"||typeof A==="function")l(A).map((i)=>!u.call(e,i)&&d(e,i,{get:()=>A[i],enumerable:!(t=p(A,i))||t.enumerable}));return c.set(A,e),e},E=(A,e)=>()=>(e||A((e={exports:{}}).exports,e),e.exports);var v=(A,e)=>{for(var t in e)d(A,t,{get:e[t],enumerable:!0,configurable:!0,set:(i)=>e[t]=()=>i})};var k=(A,e)=>()=>(A&&(e=A(A=0)),e);var Q=/*@__PURE__*/((A)=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(A,{get:(e,t)=>(typeof require!=="undefined"?require:e)[t]}):A)(function(A){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+A+'" is not supported')});function w(A,e){let t=document.createElement("iframe");if(e)t.style.width="100%",t.style.height="100%",t.style.top="0",t.style.left="0",t.style.border="0",t.style.position="fixed",t.style.zIndex="99999",document.body.appendChild(t);return t.src=`${import.meta.url.replace("dist/api.js","")}?${A}`,t}var b={configuration:{music:!0},async editMii(A="AwEAAAAAAAAAAAAAgP9wmQAAAAAAAAAAAABNAGkAaQAAAAAAAAAAAAAAAAAAAEBAAAAhAQJoRBgmNEYUgRIXaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMNn",e=!0,t=["headshot"]){return new Promise((i,n)=>{let a=w(`data=${encodeURIComponent(A)}&renderTypes=${t.map((s)=>encodeURIComponent(s)).join(",")}&origin=${encodeURIComponent(location.origin)}`,e);function r(){if(e)a.style.width=`${window.innerWidth}px`,a.style.height=`${window.innerHeight}px`}function o(s){let m=s;if(m.data===void 0)return;if(m.data.type===void 0)return;if(m.data.type!=="miic-data-finalize")return;a.style.transition="opacity 0.5s linear",a.style.opacity="0",setTimeout(()=>{a.remove(),window.removeEventListener("resize",r),window.removeEventListener("onmessage",o),i(m.data)},500)}window.addEventListener("resize",r),window.addEventListener("message",o)})},async selectMii(A=!0,e=["headshot"]){return new Promise((t,i)=>{let n=w(`select=yes&renderTypes=${e.map((o)=>encodeURIComponent(o)).join(",")}`,A);function a(){if(A)n.style.width=`${window.innerWidth}px`,n.style.height=`${window.innerHeight}px`}function r(o){let s=o;if(s.data===void 0)return;if(s.data.type===void 0)return;if(s.data.type!=="miic-select")return;n.style.transition="opacity 0.5s linear",n.style.opacity="0",setTimeout(()=>{n.remove(),window.removeEventListener("resize",a),window.removeEventListener("onmessage",r),t(s.data)},500)}window.addEventListener("resize",a),window.addEventListener("message",r)})},newMii(A="male"){switch(A){case"male":return this.editMii("AwEAAAAAAAAAAAAAgP9wmQAAAAAAAAAAAABNAGkAaQAAAAAAAAAAAAAAAAAAAEBAAAAhAQJoRBgmNEYUgRIXaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMNn");case"female":return this.editMii("AwEAAAAAAAAAAAAAgN8ZmgAAAAAAAAAAAQBNAGkAaQAAAAAAAAAAAAAAAAAAAEBAAAAMAQRoQxggNEYUgRIXaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFik")}},configure(A){if(A.music!==void 0&&typeof A.music==="boolean")this.configuration.music=A.music}};export{b as default};