1import{g as ce}from"./@edraw-DXktQCef.js";var de={exports:{}};/*! For license information please see main.js.LICENSE.txt */(function(J,ie){(function($,k){J.exports=k()})(self,()=>(()=>{var $={662:(n,e,r)=>{r.d(e,{A:()=>u});var t=r(601),o=r.n(t),i=r(314),a=r.n(i)()(o());a.push([n.id,`.edrawai-auth { 2 position: fixed; 3 top: 0; 4 left: 0; 5 right: 0; 6 bottom: 0; 7 background: rgba(0, 0, 0, 0.6); 8 display: flex; 9 justify-content: space-around; 10 align-items: center; 11 z-index: 9999; 12 visibility: hidden; 13} 14 15.edrawai-auth--wraper { 16 position: relative; 17 background: #fff; 18 width: 405px; 19 height: 666px; 20 border-radius: 12px; 21 overflow: hidden; 22} 23 24.edrawai-auth--wraper__mobile { 25 width: 100%; 26 height: 100%; 27 overflow: hidden; 28} 29 30.edrawai-auth--close { 31 position: absolute; 32 top: 0; 33 right: 0; 34 box-sizing: content-box; 35 padding: 10px; 36 width: 15px; 37 height: 15px; 38 cursor: pointer; 39} 40 41.edrawai-auth--close__mobile { 42 width: 25px; 43 height: 25px; 44} 45 46.edrawai-auth--frame { 47 width: 100%; 48 height: 100%; 49}`,""]);const u=a},314:n=>{n.exports=function(e){var r=[];return r.toString=function(){return this.map(function(t){var o="",i=t[5]!==void 0;return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),i&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),i&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o}).join("")},r.i=function(t,o,i,a,u){typeof t=="string"&&(t=[[null,t,void 0]]);var p={};if(i)for(var l=0;l<this.length;l++){var v=this[l][0];v!=null&&(p[v]=!0)}for(var b=0;b<t.length;b++){var f=[].concat(t[b]);i&&p[f[0]]||(u!==void 0&&(f[5]===void 0||(f[1]="@layer".concat(f[5].length>0?" ".concat(f[5]):""," {").concat(f[1],"}")),f[5]=u),o&&(f[2]&&(f[1]="@media ".concat(f[2]," {").concat(f[1],"}")),f[2]=o),a&&(f[4]?(f[1]="@supports (".concat(f[4],") {").concat(f[1],"}"),f[4]=a):f[4]="".concat(a)),r.push(f))}},r}},601:n=>{n.exports=function(e){return e[1]}},72:n=>{var e=[];function r(i){for(var a=-1,u=0;u<e.length;u++)if(e[u].identifier===i){a=u;break}return a}function t(i,a){for(var u={},p=[],l=0;l<i.length;l++){var v=i[l],b=a.base?v[0]+a.base:v[0],f=u[b]||0,j="".concat(b," ").concat(f);u[b]=f+1;var re=r(j),oe={css:v[1],media:v[2],sourceMap:v[3],supports:v[4],layer:v[5]};if(re!==-1)e[re].references++,e[re].updater(oe);else{var se=o(oe,a);a.byIndex=l,e.splice(l,0,{identifier:j,updater:se,references:1})}p.push(j)}return p}function o(i,a){var u=a.domAPI(a);return u.update(i),function(p){if(p){if(p.css===i.css&&p.media===i.media&&p.sourceMap===i.sourceMap&&p.supports===i.supports&&p.layer===i.layer)return;u.update(i=p)}else u.remove()}}n.exports=function(i,a){var u=t(i=i||[],a=a||{});return function(p){p=p||[];for(var l=0;l<u.length;l++){var v=r(u[l]);e[v].references--}for(var b=t(p,a),f=0;f<u.length;f++){var j=r(u[f]);e[j].references===0&&(e[j].updater(),e.splice(j,1))}u=b}}},659:n=>{var e={};n.exports=function(r,t){var o=function(i){if(e[i]===void 0){var a=document.querySelector(i);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch{a=null}e[i]=a}return e[i]}(r);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}},540:n=>{n.exports=function(e){var r=document.createElement("style");return e.setAttributes(r,e.attributes),e.insert(r,e.options),r}},56:(n,e,r)=>{n.exports=function(t){var o=r.nc;o&&t.setAttribute("nonce",o)}},825:n=>{n.exports=function(e){if(typeof document>"u")return{update:function(){},remove:function(){}};var r=e.insertStyleElement(e);return{update:function(t){(function(o,i,a){var u="";a.supports&&(u+="@supports (".concat(a.supports,") {")),a.media&&(u+="@media ".concat(a.media," {"));var p=a.layer!==void 0;p&&(u+="@layer".concat(a.layer.length>0?" ".concat(a.layer):""," {")),u+=a.css,p&&(u+="}"),a.media&&(u+="}"),a.supports&&(u+="}");var l=a.sourceMap;l&&typeof btoa<"u"&&(u+=` 50/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(l))))," */")),i.styleTagTransform(u,o,i.options)})(r,e,t)},remove:function(){(function(t){if(t.parentNode===null)return!1;t.parentNode.removeChild(t)})(r)}}}},113:n=>{n.exports=function(e,r){if(r.styleSheet)r.styleSheet.cssText=e;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(e))}}}},k={};function h(n){var e=k[n];if(e!==void 0)return e.exports;var r=k[n]={id:n,exports:{}};return $[n](r,r.exports,h),r.exports}h.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return h.d(e,{a:e}),e},h.d=(n,e)=>{for(var r in e)h.o(e,r)&&!h.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},h.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),h.nc=void 0;var z={};function C(n){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)n[t]=r[t]}return n}h.d(z,{default:()=>c});var w=function n(e,r){function t(o,i,a){if(typeof document<"u"){typeof(a=C({},r,a)).expires=="number"&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decode
50URIComponent).replace(/[()]/g,escape);var u="";for(var p in a)a[p]&&(u+="; "+p,a[p]!==!0&&(u+="="+a[p].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+u}}return Object.create({set:t,get:function(o){if(typeof document<"u"&&(!arguments.length||o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},u=0;u<i.length;u++){var p=i[u].split("="),l=p.slice(1).join("=");try{var v=decodeURIComponent(p[0]);if(a[v]=e.read(l,v),o===v)break}catch{}}return o?a[o]:a}},remove:function(o,i){t(o,"",C({},i,{expires:-1}))},withAttributes:function(o){return n(this.converter,C({},this.attributes,o))},withConverter:function(o){return n(C({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(e)}})}({read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function L(n,e){var r=document.getElementsByTagName("head")[0],t=document.createElement("script");e||(e=function(){}),t.addEventListener("load",e,!1),t.src=n,r.appendChild(t)}var H=h(72),K=h.n(H),W=h(825),G=h.n(W),Q=h(659),X=h.n(Q),V=h(56),Y=h.n(V),Z=h(540),ee=h.n(Z),te=h(113),ne=h.n(te),E=h(662),x={};x.styleTagTransform=ne(),x.setAttributes=Y(),x.insert=X().bind(null,"head"),x.domAPI=G(),x.insertStyleElement=ee(),K()(E.A,x),E.A&&E.A.locals&&E.A.locals;let U=new URLSearchParams(location.search.substr(1)).get("auth_code"),M=!1,T="8a01d9e99a8ec0cf31ff4a78e9c7ddb5",B="EN",m="en-us",O=location.port=="5001"||location.host.includes("127.0.0")||location.host.includes("10."),_=20032,S=(O?"https:":location.protocol)+"//dev-en.edraw.ai",P=S+"/app/callback.html",y=S+"/api/user/ws/wscode/login",q=S+"/api/";const A={trident:(g=navigator.userAgent).indexOf("Trident")>-1,presto:g.indexOf("Presto")>-1,webKit:g.indexOf("AppleWebKit")>-1,gecko:g.indexOf("Gecko")>-1&&g.indexOf("KHTML")==-1,mobile:!!g.match(/AppleWebKit.*Mobile.*/),ios:!!g.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:g.indexOf("Android")>-1||g.indexOf("Linux")>-1,iPhone:g.indexOf("iPhone")>-1,iPad:g.indexOf("iPad")>-1,webApp:g.indexOf("Safari")==-1,weixin:g.indexOf("MicroMessenger")>-1,qq:g.match(/\sQQ/i)==" qq"};var g;const R=A.mobile||A.android||A.ios,I="edrawai-authorization";function N(n){let e,r,t,o;typeof n=="object"?(e=n.language,r=n.product,t=n.inviter,o=n.node_limit_inviter):typeof n=="string"&&(e=n);let i=document.getElementById(I);if(i)return void(i.style.visibility="visible");let a=document.createElement("div");a.setAttribute("id",I),a.className="edrawai-auth",e&&(B=e),r&&(_=r),a.innerHTML=function({lang:l}){if(l)switch(l.toLowerCase()){case"cn":case"zh":m="zh-cn";break;case"tw":m="zh-tw";break;case"jp":m="ja-jp";break;case"de":m="de-de";break;case"fr":m="fr-fr";break;case"es":m="es-es";break;case"it":m="it-it";break;case"pt":m="pt-br";break;case"kr":case"ko":m="ko-kr";break;default:m="en-us"}return` 51 <div class="edrawai-auth--wraper" id='edrawai-authorization--wrapper'> 52 <svg class="edrawai-auth--close" id='edrawai-authorization--close' xmlns="http://www.w3.org/2000/svg" 53 xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1024 1024" width="200" height="200"> 54 <path 55 d="M521.693867 449.297067L111.4112 39.0144a51.2 51.2 0 1 0-72.430933 72.362667l410.282666 410.3168-410.282666 410.3168a51.2 51.2 0 1 0 72.3968 72.3968l410.3168-410.282667 410.3168 410.282667a51.2 51.2 0 1 0 72.3968-72.362667l-410.282667-410.350933 410.282667-410.282667a51.2 51.2 0 1 0-72.3968-72.3968l-410.282667 410.282667z" 56 fill="#515151" /> 57 </svg> 58 <iframe src="${"https://accounts.wondershare.com/v3/user/oauth-client/authorize?app_key="+T+"&redirect_uri="+P+`&response_type=code&scope=user&state=10000&product_id=${_}&source=103&lang=${m}&mode=1&verify=no`}" class='edrawai-auth--frame' frameborder="0"></iframe> 59 </div> 60`}({lang:B,product:r,inviter:t,node_limit_inviter:o}),document.body.appendChild(a);let u=document.getElementById("edrawai-authorization--close");u.addEventListener("click",()=>{a.style.visibility="hidden"});let p=document.getElementById("edrawai-authorization--wrapper");R&&(p.classList.add("edrawai-auth--wraper__mobile"),u.classList.add("edrawai-auth--close__mobile"))}function D(n){let e;var r=n.refresh_token.split(".")[1];r=JSON.parse(window.atob(r)).exp,e=new Date(1e3*r),n.islogin="true",w.set("EDCurrent",JSON.stringify(n),{expires:e})}function F(){return new Promise((n,e)=>{let r=w.get("EDCurrent");
60if(r){r=JSON.parse(r),r.user_id;let t=r.token;fetch(`${q}user/base/info?ext=1`,{method:"GET",headers:{Authorization:`Bearer ${t}`}}).then(o=>o.json()).then(o=>{const{data:i}=o;o.code==0?n({...r,...i}):(w.remove("EDCurrent"),e())}).catch(()=>{e()})}else e()})}function d(){/(edraw.ai)/.test(location.host)&&L("https://dc-static.wondershare.cc/account_center/google-sdk.js",()=>{let n="https://accounts.wondershare.com/v3/user/oauth-client/authorize?app_key="+T+`&redirect_uri=${encodeURIComponent(P+`?redirect=${encodeURIComponent(location.href)}`)}&response_type=code&scope=user&state=10000&product_id=${_}&source=103&lang=${m}&mode=1&verify=no`,e=n;document.addEventListener("onetapNodisplay",()=>{L(`https://www.edrawsoft.com/assets/js/register.js?source=103&redirect_uri=${encodeURIComponent(P+`?redirect=${encodeURIComponent(location.href)}`)}`)}),window.loadDom&&window.loadDom(n,e,"499842837879-cnaa0jfuivlc73bqpnqasnolviotfe7v.apps.googleusercontent.com")})}function s(n){return new Promise((e,r)=>{let t=n||w.get("EDCurrent")&&JSON.parse(w.get("EDCurrent"));if(t){let o=t.refresh_token,i=t.token,a=new FormData;a.append("refresh_token",o),fetch(`${q}user/ws/account/refresh/token`,{method:"POST",headers:{Authorization:`Bearer ${i}`},body:a}).then(u=>u.json()).then(u=>{const{data:p}=u;p?(t.token=p.token,t.refresh_token=p.refresh_token,D(t),e(t)):(w.remove("EDCurrent"),r())}).catch(()=>{r()})}else r()})}const c={checkLocalCookie(n={}){const{product:e}=n;return e&&(_=e),new Promise((r,t)=>{U?function(o){let{code:i}=o,a=new FormData;return a.append("code",i),a.append("from","web"),a.append("pid",_),new Promise((u,p)=>{fetch(y,{method:"POST",body:a,redirect:"follow"}).then(l=>l.json()).then(l=>{l.status=="success"?u(l.data):p()}).catch(()=>p())})}({code:U}).then(o=>{D(o),history.replaceState(history.state,"",location.href.replace(/[?|&]auth_code=.[^&]*/,"")),F().then(i=>{i&&(o=i)}).finally(()=>{r(o)})}).catch(()=>{d(),t()}):F().then(o=>{r(o)}).catch(()=>{s().then(o=>{r(o)}).catch(()=>{d(),t()})})})},auth(n,e,r){M||(M=!0,function(t,o){window.addEventListener("message",i=>{let a=i.data;if(a)if(a.type==="edrawai_auth_succeed"){let u=a.userInfo;D(u),F().then(p=>{p&&(u=p)}).finally(()=>{t&&t(u),document.getElementById(I).style.visibility="hidden"})}else if(a.type==="show_edrawai_auth")document.getElementById(I).style.visibility="visible",o&&o();else if(a.type==="edrawai_auth_mobile_third"){let u=a.url;location.href=u}else a.type==="edrawai_auth_ask_host"&&function(u){document.getElementById(I).getElementsByTagName("iframe")[0].contentWindow.postMessage(u,"*")}({type:"edrawai_auth_answer_host",host:location.host})})}(n,e),N(r))},show(n={}){const{product:e}=n;e&&(_=e),new Promise((r,t)=>{if(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent))r(!1);else{let o=document.createElement("iframe"),i=!1,a=()=>{document.body.contains(o)&&(document.body.removeChild(o),a=null)};window.addEventListener("message",function u(p){if(p.data==="3pc.supported"||p.data==="3pc.unsupported"){let l=p.data==="3pc.supported";i=!0,r(l),a&&a(),window.removeEventListener("message",u)}},!1),o.id="3pc",o.src="https://accounts.wondershare.com/web/cookie-check",o.style.display="none",o.style.position="fixed",document.body.appendChild(o),setTimeout(function(){i||(r(!0),a&&a())},5e3)}}).then(r=>{r?N():function(t=0){let o="https://accounts.wondershare.com/v3/user/oauth-client/authorize?app_key="+T+`&redirect_uri=${P}?redirect=${location.href}&response_type=code&scope=user&state=10000&product_id=${_}&source=103&lang=${m}&mode=1&verify=no&remember_login=2`;t&&(o+="&goto=1"),location.href=o}()})},logout:()=>w.get("EDCurrent")?(w.remove("EDCurrent"),new Promise((n,e)=>{location.href="https://accounts.wondershare.com/v3/user/oauth/logout?redirect="+encodeURIComponent(location.href),n()})):Promise.resolve(),getFreshToken:s};return z.default})())})(de);var ae={exports:{}};/*! For license information please see main.js.LICENSE.txt */(function(J,ie){(function($,k){J.exports=k()})(self,()=>(()=>{var $={662:(d,s,c)=>{c.d(s,{A:()=>o});var n=c(601),e=c.n(n),r=c(314),t=c.n(r)()(e());t.push([d.id,`.edrawai-auth { 61 position: fixed; 62 top: 0; 63 left: 0; 64 right: 0; 65 bottom: 0; 66 background: rgba(0, 0, 0, 0.6); 67 display: flex; 68 justify-content: space-around; 69 align-items: center; 70 z-index: 9999; 71 visibility: hidden; 72} 73 74.edrawai-auth--wraper { 75 position: relative; 76 background: #fff; 77 width: 405px; 78 height: 666px; 79 border-radius: 12px; 80 overflow: hidden; 81} 82 83.edrawai-auth--wraper__mobile { 84 width: 100%; 85 height: 100%; 86 overflow: hidden; 87} 88 89.edrawai-auth--close { 90 position: absolute; 91 top: 0; 92 right: 0; 93 box-sizing: content-box; 94 padding: 10px; 95 width: 15px; 96 height: 15px; 97 cursor: pointer; 98} 99 100.edrawai-auth--close__mobile { 101 width: 25px; 102 height: 25px; 103} 104 105.edrawai-auth--frame { 106 width: 100%; 107 height: 100%; 108}`,""]);const o=t},314:d=>{d.exports=function(s){var c=[];return c.toString=function(){return this.map(function(n){var e="",r=n[5]!==void 0;return n[4]&&(e+="@supports (".concat(n[4],") {")),n[2]&&(e+="@media ".concat(n[2]," {")),r&&(e+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),e+=s(n),r&&(e+="}"),n[2]&&(e+="}"),n[4]&&(e+="}"),e}).join("")},c.i=function(n,e,r,t,o){typeof n=="string"&&(n=[[null,n,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var u=this[a][0];u!=null&&(i[u]=!0)}for(var p=0;p<n.length;p++){var l=[].concat(n[p]);r&&i[l[0]]||(o!==void 0&&(l[5]===void 0||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=o),e&&(l[2]&&(l[1]="@media ".concat(l[2]," {").concat(l[1],"}")),l[2]=e),t&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=t):l[4]="".concat(t)),c.push(l))}},c}},601:d=>{d.exports=function(s){return s[1]}},72:d=>{var s=[];function c(r){for(var t=-1,o=0;o<s.length;o++)if(s[o].identifier===r){t=o;break}return t}function n(r,t){for(var o={},i=[],a=0;a<r.length;
108a++){var u=r[a],p=t.base?u[0]+t.base:u[0],l=o[p]||0,v="".concat(p," ").concat(l);o[p]=l+1;var b=c(v),f={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(b!==-1)s[b].references++,s[b].updater(f);else{var j=e(f,t);t.byIndex=a,s.splice(a,0,{identifier:v,updater:j,references:1})}i.push(v)}return i}function e(r,t){var o=t.domAPI(t);return o.update(r),function(i){if(i){if(i.css===r.css&&i.media===r.media&&i.sourceMap===r.sourceMap&&i.supports===r.supports&&i.layer===r.layer)return;o.update(r=i)}else o.remove()}}d.exports=function(r,t){var o=n(r=r||[],t=t||{});return function(i){i=i||[];for(var a=0;a<o.length;a++){var u=c(o[a]);s[u].references--}for(var p=n(i,t),l=0;l<o.length;l++){var v=c(o[l]);s[v].references===0&&(s[v].updater(),s.splice(v,1))}o=p}}},659:d=>{var s={};d.exports=function(c,n){var e=function(r){if(s[r]===void 0){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch{t=null}s[r]=t}return s[r]}(c);if(!e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");e.appendChild(n)}},540:d=>{d.exports=function(s){var c=document.createElement("style");return s.setAttributes(c,s.attributes),s.insert(c,s.options),c}},56:(d,s,c)=>{d.exports=function(n){var e=c.nc;e&&n.setAttribute("nonce",e)}},825:d=>{d.exports=function(s){if(typeof document>"u")return{update:function(){},remove:function(){}};var c=s.insertStyleElement(s);return{update:function(n){(function(e,r,t){var o="";t.supports&&(o+="@supports (".concat(t.supports,") {")),t.media&&(o+="@media ".concat(t.media," {"));var i=t.layer!==void 0;i&&(o+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),o+=t.css,i&&(o+="}"),t.media&&(o+="}"),t.supports&&(o+="}");var a=t.sourceMap;a&&typeof btoa<"u"&&(o+=` 109/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),r.styleTagTransform(o,e,r.options)})(c,s,n)},remove:function(){(function(n){if(n.parentNode===null)return!1;n.parentNode.removeChild(n)})(c)}}}},113:d=>{d.exports=function(s,c){if(c.styleSheet)c.styleSheet.cssText=s;else{for(;c.firstChild;)c.removeChild(c.firstChild);c.appendChild(document.createTextNode(s))}}}},k={};function h(d){var s=k[d];if(s!==void 0)return s.exports;var c=k[d]={id:d,exports:{}};return $[d](c,c.exports,h),c.exports}h.n=d=>{var s=d&&d.__esModule?()=>d.default:()=>d;return h.d(s,{a:s}),s},h.d=(d,s)=>{for(var c in s)h.o(s,c)&&!h.o(d,c)&&Object.defineProperty(d,c,{enumerable:!0,get:s[c]})},h.o=(d,s)=>Object.prototype.hasOwnProperty.call(d,s),h.nc=void 0;var z={};function C(d){for(var s=1;s<arguments.length;s++){var c=arguments[s];for(var n in c)d[n]=c[n]}return d}h.d(z,{default:()=>F});var w=function d(s,c){function n(e,r,t){if(typeof document<"u"){typeof(t=C({},c,t)).expires=="number"&&(t.expires=new Date(Date.now()+864e5*t.expires)),t.expires&&(t.expires=t.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in t)t[i]&&(o+="; "+i,t[i]!==!0&&(o+="="+t[i].split(";")[0]));return document.cookie=e+"="+s.write(r,e)+o}}return Object.create({set:n,get:function(e){if(typeof document<"u"&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],t={},o=0;o<r.length;o++){var i=r[o].split("="),a=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(t[u]=s.read(a,u),e===u)break}catch{}}return e?t[e]:t}},remove:function(e,r){n(e,"",C({},r,{expires:-1}))},withAttributes:function(e){return d(this.converter,C({},this.attributes,e))},withConverter:function(e){return d(C({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(c)},converter:{value:Object.freeze(s)}})}({read:function(d){return d[0]==='"'&&(d=d.slice(1,-1)),d.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(d){return encodeURIComponent(d).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function L(d,s){var c=document.getElementsByTagName("head")[0],n=document.createElement("script");s||(s=function(){}),n.addEventListener("load",s,!1),n.src=d,c.appendChild(n)}var H=h(72),K=h.n(H),W=h(825),G=h.n(W),Q=h(659),X=h.n(Q),V=h(56),Y=h.n(V),Z=h(540),ee=h.n(Z),te=h(113),ne=h.n(te),E=h(662),x={};x.styleTagTransform=ne(),x.setAttributes=Y(),x.insert=X().bind(null,"head"),x.domAPI=G(),x.insertStyleElement=ee(),K()(E.A,x),E.A&&E.A.locals&&E.A.locals;let U=new URLSearchParams(location.search.substr(1)).get("auth_code"),M=!1,T="c1559ed92a1f0305996dba09d1aeaa27",B="EN",m="en-us",O=20032,_="https://www.edraw.ai/app/callback.html",S="https://api.edraw.ai/api/";const P={trident:(y=navigator.userAgent).indexOf("Trident")>-1,presto:y.indexOf("Presto")>-1,webKit:y.indexOf("AppleWebKit")>-1,gecko:y.indexOf("Gecko")>
109-1&&y.indexOf("KHTML")==-1,mobile:!!y.match(/AppleWebKit.*Mobile.*/),ios:!!y.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:y.indexOf("Android")>-1||y.indexOf("Linux")>-1,iPhone:y.indexOf("iPhone")>-1,iPad:y.indexOf("iPad")>-1,webApp:y.indexOf("Safari")==-1,weixin:y.indexOf("MicroMessenger")>-1,qq:y.match(/\sQQ/i)==" qq"};var y;const q=P.mobile||P.android||P.ios,A="edrawai-authorization";function g(d){let s,c,n,e;typeof d=="object"?(s=d.language,c=d.product,n=d.inviter,e=d.node_limit_inviter):typeof d=="string"&&(s=d);let r=document.getElementById(A);if(r)return void(r.style.visibility="visible");let t=document.createElement("div");t.setAttribute("id",A),t.className="edrawai-auth",s&&(B=s),c&&(O=c),t.innerHTML=function({lang:a}){if(a)switch(a.toLowerCase()){case"cn":case"zh":m="zh-cn";break;case"tw":m="zh-tw";break;case"jp":m="ja-jp";break;case"de":m="de-de";break;case"fr":m="fr-fr";break;case"es":m="es-es";break;case"it":m="it-it";break;case"pt":m="pt-br";break;case"kr":case"ko":m="ko-kr";break;default:m="en-us"}return` 110 <div class="edrawai-auth--wraper" id='edrawai-authorization--wrapper'> 111 <svg class="edrawai-auth--close" id='edrawai-authorization--close' xmlns="http://www.w3.org/2000/svg" 112 xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1024 1024" width="200" height="200"> 113 <path 114 d="M521.693867 449.297067L111.4112 39.0144a51.2 51.2 0 1 0-72.430933 72.362667l410.282666 410.3168-410.282666 410.3168a51.2 51.2 0 1 0 72.3968 72.3968l410.3168-410.282667 410.3168 410.282667a51.2 51.2 0 1 0 72.3968-72.362667l-410.282667-410.350933 410.282667-410.282667a51.2 51.2 0 1 0-72.3968-72.3968l-410.282667 410.282667z" 115 fill="#515151" /> 116 </svg> 117 <iframe src="${"https://accounts.wondershare.com/v3/user/oauth-client/authorize?app_key="+T+"&redirect_uri="+_+`&response_type=code&scope=user&state=10000&product_id=${O}&source=103&lang=${m}&mode=1&verify=no`}" class='edrawai-auth--frame' frameborder="0"></iframe> 118 </div> 119`}({lang:B,product:c,inviter:n,node_limit_inviter:e}),document.body.appendChild(t);let o=document.getElementById("edrawai-authorization--close");o.addEventListener("click",()=>{t.style.visibility="hidden"});let i=document.getElementById("edrawai-authorization--wrapper");q&&(i.classList.add("edrawai-auth--wraper__mobile"),o.classList.add("edrawai-auth--close__mobile"))}function R(d){let s;var c=d.refresh_token.split(".")[1];c=JSON.parse(window.atob(c)).exp,s=new Date(1e3*c),d.islogin="true",w.set("EDCurrent",JSON.stringify(d),{expires:s})}function I(){return new Promise((d,s)=>{let c=w.get("EDCurrent");if(c){c=JSON.parse(c),c.user_id;let n=c.token;fetch(`${S}user/base/info?ext=1`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(e=>e.json()).then(e=>{const{data:r}=e;e.code==0?d({...c,...r}):(w.remove("EDCurrent"),s())}).catch(()=>{s()})}else s()})}function N(){/(edraw.ai)/.test(location.host)&&L("https://dc-static.wondershare.cc/account_center/google-sdk.js",()=>{let d="https://accounts.wondershare.com/v3/user/oauth-client/authorize?app_key="+T+`&redirect_uri=${encodeURIComponent(_+`?redirect=${encodeURIComponent(location.href)}`)}&response_type=code&scope=user&state=10000&product_id=${O}&source=103&lang=${m}&mode=1&verify=no`,s=d;document.addEventListener("onetapNodisplay",()=>{L(`https://www.edrawsoft.com/assets/js/register.js?source=103&redirect_uri=${encodeURIComponent(_+`?redirect=${encodeURIComponent(location.href)}`)}`)}),window.loadDom&&window.loadDom(d,s,"499842837879-cnaa0jfuivlc73bqpnqasnolviotfe7v.apps.googleusercontent.com")})}function D(d){return new Promise((s,c)=>{let n=d||w.get("EDCurrent")&&JSON.parse(w.get("EDCurrent"));if(n){let e=n.refresh_token,r=n.token,t=new FormData;t.append("refresh_token",e),fetch(`${S}user/ws/account/refresh/token`,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:t}).then(o=>o.json()).then(o=>{const{data:i}=o;i?(n.token=i.token,n.refresh_token=i.refresh_token,R(n),s(n)):(w.remove("EDCurrent"),c())}).catch(()=>{c()})}else c()})}const F={checkLocalCookie(d={}){const{product:s}=d;return s&&(O=s),new Promise((c,n)=>
119{U?function(e){let{code:r}=e,t=new FormData;return t.append("code",r),t.append("from","web"),t.append("pid",O),new Promise((o,i)=>{fetch("https://api.edraw.ai/api/user/ws/wscode/login",{method:"POST",body:t,redirect:"follow"}).then(a=>a.json()).then(a=>{a.status=="success"?o(a.data):i()}).catch(()=>i())})}({code:U}).then(e=>{R(e),history.replaceState(history.state,"",location.href.replace(/[?|&]auth_code=.[^&]*/,"")),I().then(r=>{r&&(e=r)}).finally(()=>{c(e)})}).catch(()=>{N(),n()}):I().then(e=>{c(e)}).catch(()=>{D().then(e=>{c(e)}).catch(()=>{N(),n()})})})},auth(d,s,c){M||(M=!0,function(n,e){window.addEventListener("message",r=>{let t=r.data;if(t)if(t.type==="edrawai_auth_succeed"){let o=t.userInfo;R(o),I().then(i=>{i&&(o=i)}).finally(()=>{n&&n(o),document.getElementById(A).style.visibility="hidden"})}else if(t.type==="show_edrawai_auth")document.getElementById(A).style.visibility="visible",e&&e();else if(t.type==="edrawai_auth_mobile_third"){let o=t.url;location.href=o}else t.type==="edrawai_auth_ask_host"&&function(o){document.getElementById(A).getElementsByTagName("iframe")[0].contentWindow.postMessage(o,"*")}({type:"edrawai_auth_answer_host",host:location.host})})}(d,s),g(c))},show(d={}){const{product:s}=d;s&&(O=s),new Promise((c,n)=>{if(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent))c(!1);else{let e=document.createElement("iframe"),r=!1,t=()=>{document.body.contains(e)&&(document.body.removeChild(e),t=null)};window.addEventListener("message",function o(i){if(i.data==="3pc.supported"||i.data==="3pc.unsupported"){let a=i.data==="3pc.supported";r=!0,c(a),t&&t(),window.removeEventListener("message",o)}},!1),e.id="3pc",e.src="https://accounts.wondershare.com/web/cookie-check",e.style.display="none",e.style.position="fixed",document.body.appendChild(e),setTimeout(function(){r||(c(!0),t&&t())},5e3)}}).then(c=>{c?g():function(n=0){let e="https://accounts.wondershare.com/v3/user/oauth-client/authorize?app_key="+T+`&redirect_uri=${_}?redirect=${location.href}&response_type=code&scope=user&state=10000&product_id=${O}&source=103&lang=${m}&mode=1&verify=no&remember_login=2`;n&&(e+="&goto=1"),location.href=e}()})},logout:()=>w.get("EDCurrent")?(w.remove("EDCurrent"),new Promise((d,s)=>{location.href="https://accounts.wondershare.com/v3/user/oauth/logout?redirect="+encodeURIComponent(location.href),d()})):Promise.resolve(),getFreshToken:D};return z.default})())})(ae);var ue=ae.exports;const pe=ce(ue);export{pe as $}; 120//# sourceMappingURL=@edrawai-Cr-K_-km.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.