You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
215 KiB
JavaScript

9 months ago
"use strict";exports.id=610,exports.ids=[610],exports.modules={71052:(e,t,r)=>{r.d(t,{SE:()=>X,YM:()=>K});let n=(()=>{let e=0,t=()=>`0000${(1679616*Math.random()<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function i(e){let t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}function u(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function o(e,t={}){return{width:t.width||function(e){let t=u(e,"border-left-width"),r=u(e,"border-right-width");return e.clientWidth+t+r}(e),height:t.height||function(e){let t=u(e,"border-top-width"),r=u(e,"border-bottom-width");return e.clientHeight+t+r}(e)}}function s(e){return new Promise((t,r)=>{let n=new Image;n.decode=()=>t(n),n.onload=()=>t(n),n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function a(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function c(e,t,r){let n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg"),u=document.createElementNS(n,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${r}`),i.setAttribute("viewBox",`0 0 ${t} ${r}`),u.setAttribute("width","100%"),u.setAttribute("height","100%"),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("externalResourcesRequired","true"),i.appendChild(u),u.appendChild(e),a(i)}let l=(e,t)=>{if(e instanceof t)return!0;let r=Object.getPrototypeOf(e);return null!==r&&(r.constructor.name===t.name||l(r,t))};function f(e,t,r){let u=window.getComputedStyle(e,r),o=u.getPropertyValue("content");if(""===o||"none"===o)return;let s=n();try{t.className=`${t.className} ${s}`}catch(e){return}let a=document.createElement("style");a.appendChild(function(e,t,r){let n=`.${e}:${t}`,u=r.cssText?function(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}(r):i(r).map(e=>{let t=r.getPropertyValue(e),n=r.getPropertyPriority(e);return`${e}: ${t}${n?" !important":""};`}).join(" ");return document.createTextNode(`${n}{${u}}`)}(s,r,u)),t.appendChild(a)}let h="application/font-woff",p="image/jpeg",d={woff:h,woff2:h,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:p,jpeg:p,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function g(e){return d[(function(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""})(e).toLowerCase()]||""}function _(e){return -1!==e.search(/^(data:)/)}function v(e,t){return`data:${t};base64,${e}`}async function m(e,t,r){let n=await fetch(e,t);if(404===n.status)throw Error(`Resource "${n.url}" not found`);let i=await n.blob();return new Promise((e,t)=>{let u=new FileReader;u.onerror=t,u.onloadend=()=>{try{e(r({res:n,result:u.result}))}catch(e){t(e)}},u.readAsDataURL(i)})}let y={};async function D(e,t,r){var n,i,u;let o,s;let a=(n=e,i=t,u=r.includeQueryParams,s=n.replace(/\?.*/,""),u&&(s=n),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),i?`[${i}]${s}`:s);if(null!=y[a])return y[a];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());try{let n=await m(e,r.fetchRequestInit,({res:e,result:r})=>(t||(t=e.headers.get("Content-Type")||""),r.split(/,/)[1]));o=v(n,t)}catch(n){o=r.imagePlaceholder||"";let t=`Failed to fetch resource: ${e}`;n&&(t="string"==typeof n?n:n.message),t&&console.warn(t)}return y[a]=o,o}async function b(e){let t=e.toDataURL();return"data:,"===t?e.cloneNode(!1):s(t)}async function w(e,t){if(e.currentSrc){let t=document.createElement("canvas"),r=t.getContext("2d");return t.width=e.clientWidth,t.height=e.clientHeight,null==r||r.drawImage(e,0,0,t.width,t.height),s(t.toDataURL())}let r=e.poster,n=g(r);return s(await D(r,n,t))}async function E(e){var t;try{if(null===(t=null==e?void 0:e.contentDocument)||void 0===t?void 0:t.body)return await F(e.contentDocument.body,{},!0)}catch(e){}return e.cloneNode(!1)}async function x(e,t){return l(e,HTMLCanvasElement)?b(e):l(e,HTMLVideoElement)?w(e,t):l(e,HTMLIFrameElement)?E
`+Object.keys(i).map(e=>`${e}: ${i[e]}`).join("\r\n")+"\r\n\r\n"+n)}function p(e,t,r,n,i){if(e.listenerCount("wsClientError")){let n=Error(i);Error.captureStackTrace(n,p),e.emit("wsClientError",n,r,t)}else h(r,n,i)}}();var ef=function(e){return{success:!1,error:e}},eh=function(){function e(e,t){var r=this;this.closedPromise=void 0,this.messageQueue=[],this.receiverQueue=[],this.done=!1,this.validate=t.validate,this.serialize=t.serialize,this.connectedPromise=new Promise(function(t,n){return Z(r,void 0,void 0,function(){var r,i=this;return Q(this,function(u){switch(u.label){case 0:return r=this,[4,function(e){return Z(this,void 0,void 0,function(){return Q(this,function(t){switch(t.label){case 0:if(!(void 0!=e.policy))return[3,2];return[4,e.policy(e)];case 1:e=t.sent(),t.label=2;case 2:return[2,new el(e.uri,e.protocols,{headers:e.headers})]}})})}(e)];case 1:return r.socket=u.sent(),this.socket.onopen=function(){i.socket.onmessage=i.getMessageHandler(),i.closedPromise=new Promise(function(e){i.socket.onclose=i.getClosedHandler(e)}),i.socket.onerror=i.handleError,t()},this.socket.onerror=function(e){i.error=e.error,n(e)},[2]}})})})}return e.prototype.handleError=function(e){for(this.error=e.error;this.receiverQueue.length>0;){var t=H(this.receiverQueue.shift(),2);t[0],(0,t[1])(e.error)}},e.prototype.getClosedHandler=function(e){var t=this;return function(r){for(t.done=!0;t.receiverQueue.length>0;){var n=H(t.receiverQueue.shift(),2),i=n[0],u=n[1];t.error?u(t.error):i({value:void 0,done:!0})}e()}},e.prototype.getMessageHandler=function(){var e=this;return function(t){var r=e.validate(t);if(r.success){var n=r.message;if(e.receiverQueue.length>0){var i=H(e.receiverQueue.shift(),2),u=i[0];i[1],u({value:n,done:!1})}else e.messageQueue.push(n)}else e.error=r.error,e.socket.close(1e3,"Unexpected message received")}},e.prototype[Symbol.asyncIterator]=function(){var e=this;return{next:function(){return e.error?Promise.reject(e.error):e.done?Promise.resolve({value:void 0,done:!0}):e.messageQueue.length>0?Promise.resolve({value:e.messageQueue.shift(),done:!1}):new Promise(function(t,r){e.receiverQueue.push([t,r])})}}},e.prototype.send=function(e){return Z(this,void 0,void 0,function(){var t;return Q(this,function(r){switch(r.label){case 0:return[4,this.connectedPromise];case 1:var n;if(r.sent(),this.error)throw this.error;return t=this.serialize(e),[2,(n=this.socket,new Promise(function(e,r){n.send(t,function(t){t?r(t):e()})}))]}})})},e.prototype.close=function(){return Z(this,void 0,void 0,function(){return Q(this,function(e){switch(e.label){case 0:return[4,this.connectedPromise];case 1:if(e.sent(),this.done)return[2];return this.socket.close(),[4,this.closedPromise];case 2:return e.sent(),[2]}})})},e}();function ep(e){return"object"==typeof e&&null!==e&&"key"in e&&"string"==typeof e.key}var ed=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorPredicate=r,n.error=void 0,n}return V(t,e),t.prototype.notifyErrorMessage=function(e){for(;this.waitingReceivers.length>0;){var t=H(this.waitingReceivers.shift(),2);t[0];var r=H(t[1],2),n=r[0];r[1],n(e)}},t.prototype.notifyReceiver=function(e){if(this.errorPredicate(e)){this.error=e,this.notifyErrorMessage(e);return}var t=this.waitingReceivers.findIndex(function(t){var r=H(t,3),n=r[0],i=H(r[1],2);return i[0],i[1],r[2],n(e)});if(-1===t){this.pushBack(e);return}var r=H(this.waitingReceivers.splice(t,1)[0],3);r[0];var n=H(r[1],2),i=n[0];n[1],r[2],i(e)},t.prototype.receive=function(t){return Z(this,void 0,void 0,function(){var r=this;return Q(this,function(n){switch(n.label){case 0:if(void 0!==this.error)return[2,this.error];return[4,e.prototype.receive.call(this,function(e){return t(e)||r.errorPredicate(e)})];case 1:return[2,n.sent()]}})})},t}(function(){function e(e){this.receiveDelegate=e,this.messages=[],this.waitingReceivers=[],this.isPolling=!1,this.pollPromise=null}return e.prototype.pushBack=function(e){this.messages.push(e)},e.prototype.findAndRemove=function(e){var t=this.messages.findIndex(e);return -1===t?null:this.messages.splice(t,1)[0]},e.prototype.pollReceive=func