diff --git a/client/js/main.js b/client/js/main.js index c67dbe2..1d5c0a2 100644 --- a/client/js/main.js +++ b/client/js/main.js @@ -65,7 +65,7 @@ import { renderUserList, // 渲染用户列表 / Render user list // 设置全局配置参数 // Set global configuration parameters window.config = { - wsAddress: 'ws://127.0.0.1:8787', // WebSocket 服务器地址 / WebSocket server address + wsAddress: `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}`, // WebSocket 服务器地址 / WebSocket server address debug: true // 是否开启调试模式 / Enable debug mode }; diff --git a/workers/public/assets/avatar-libs-exuC_fCG.js b/workers/public/assets/avatar-libs-exuC_fCG.js new file mode 100644 index 0000000..bf16b91 --- /dev/null +++ b/workers/public/assets/avatar-libs-exuC_fCG.js @@ -0,0 +1 @@ +function e(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(//g,">")}const t=-2147483648;function a(e){return e^=e<<13,e^=e>>17,e^=e<<5}function r(e=""){let l=function(e){let t=0;for(let r=0;rl=a(l),i=(e,a)=>Math.floor((o()-t)/4294967295*(a+1-e)+e);return{seed:e,next:o,bool:(e=50)=>i(1,100)<=e,integer:(e,t)=>i(e,t),pick(e,t){var a;return 0===e.length?(o(),t):null!==(a=e[i(0,e.length-1)])&&void 0!==a?a:t},shuffle(e){const t=r(o().toString()),a=[...e];for(let r=a.length-1;r>0;r--){const e=t.integer(0,r);[a[r],a[e]]=[a[e],a[r]]}return a},string(e,t="abcdefghijklmnopqrstuvwxyz1234567890"){const a=r(o().toString());let l="";for(let r=0;r{let t=r[e];"object"==typeof t&&void 0!==t.default&&(Array.isArray(t.default)?a[e]=[...t.default]:"object"==typeof t.default?a[e]={...t.default}:a[e]=t.default)})),a}function n(e){return"transparent"===e?e:`#${e}`}function s(t,a={}){var s,d,c,u,f;a=function(e,t){var a;let r={...i(o),...i(null!==(a=e.schema)&&void 0!==a?a:{}),...t};return JSON.parse(JSON.stringify(r))}(t,a);const p=r(a.seed),g=t.create({prng:p,options:a}),h=p.pick(null!==(s=a.backgroundType)&&void 0!==s?s:[],"solid"),{primary:m,secondary:y}=function(e,t,a){var r;let l=e.shuffle(t);l.length<=1||2==t.length&&"gradientLinear"==a?(l=t,e.next()):l=e.shuffle(t),0===l.length&&(l=["transparent"]);const o=l[0],i=null!==(r=l[1])&&void 0!==r?r:l[0];return{primary:n(o),secondary:n(i)}}(p,null!==(d=a.backgroundColor)&&void 0!==d?d:[],h),v=p.integer((null===(c=a.backgroundRotation)||void 0===c?void 0:c.length)?Math.min(...a.backgroundRotation):0,(null===(u=a.backgroundRotation)||void 0===u?void 0:u.length)?Math.max(...a.backgroundRotation):0);a.size&&(g.attributes.width=a.size.toString(),g.attributes.height=a.size.toString()),void 0!==a.scale&&100!==a.scale&&(g.body=function(e,t){let{width:a,height:r,x:o,y:i}=l(e),n=t?(t-100)/100:0;return`${e.body}`}(g,a.scale)),a.flip&&(g.body=function(e){let{width:t,x:a}=l(e);return`${e.body}`}(g)),a.rotate&&(g.body=function(e,t){let{width:a,height:r,x:o,y:i}=l(e);return`${e.body}`}(g,a.rotate)),(a.translateX||a.translateY)&&(g.body=function(e,t,a){let r=l(e);return`${e.body}`}(g,a.translateX,a.translateY)),"transparent"!==m&&"transparent"!==y&&(g.body=function(e,t,a,r,o){let{width:i,height:n,x:s,y:d}=l(e);const c=``;switch(r){case"solid":return c+e.body;case"gradientLinear":return``+e.body}}(g,m,y,h,v)),(a.radius||a.clip)&&(g.body=function(e,t){let{width:a,height:r,x:o,y:i}=l(e);return`${e.body}`}(g,null!==(f=a.radius)&&void 0!==f?f:0)),a.randomizeIds&&(g.body=function(e){const t=r(Math.random().toString()),a={};return e.body.replace(/(id="|url\(#)([a-z0-9-_]+)([")])/gi,((e,r,l,o)=>(a[l]=a[l]||t.string(8),`${r}${a[l]}${o}`)))}(g));const M=function(t){const a={xmlns:"http://www.w3.org/2000/svg",...t.attributes};return Object.keys(a).map((t=>`${e(t)}="${e(a[t])}"`)).join(" ")}(g),$=function(t){var a,r,l,o,i,n,s;const d=null===(a=t.meta)||void 0===a?void 0:a.title,c=null===(r=t.meta)||void 0===r?void 0:r.creator,u=null===(l=t.meta)||void 0===l?void 0:l.source,f=null===(i=null===(o=t.meta)||void 0===o?void 0:o.license)||void 0===i?void 0:i.url,p=function(e){var t,a,r,l,o,i,n,s,d,c,u,f,p,g,h;let m=(null===(t=e.meta)||void 0===t?void 0:t.title)?`„${null===(a=e.meta)||void 0===a?void 0:a.title}”`:"Design",y=`„${null!==(l=null===(r=e.meta)||void 0===r?void 0:r.creator)&&void 0!==l?l:"Unknown"}”`;(null===(o=e.meta)||void 0===o?void 0:o.source)&&(m+=` (${e.meta.source})`);let v="";return"MIT"!==(null===(n=null===(i=e.meta)||void 0===i?void 0:i.license)||void 0===n?void 0:n.name)&&"DiceBear"!==(null===(s=e.meta)||void 0===s?void 0:s.creator)&&(null===(d=e.meta)||void 0===d?void 0:d.title)&&(v+="Remix of "),v+=`${m} by ${y}`,(null===(u=null===(c=e.meta)||void 0===c?void 0:c.license)||void 0===u?void 0:u.name)&&(v+=`, licensed under „${null===(p=null===(f=e.meta)||void 0===f?void 0:f.license)||void 0===p?void 0:p.name}”`,(null===(h=null===(g=e.meta)||void 0===g?void 0:g.license)||void 0===h?void 0:h.url)&&(v+=` (${e.meta.license.url})`)),v}(t);return d||c||u||f||p?''+(d?`${e(d)}`:"")+(c?`${e(c)}`:"")+(u?`${e(null!==(s=null===(n=t.meta)||void 0===n?void 0:n.source)&&void 0!==s?s:"")}`:"")+(f?`${e(f)}`:"")+(p?`${e(p)}`:"")+"":""}(t),Z=`${$}${g.body}`;return{toString:()=>Z,toJson:()=>{var e;return{svg:Z,extra:{primaryBackgroundColor:m,secondaryBackgroundColor:y,backgroundType:h,backgroundRotation:v,...null===(e=g.extra)||void 0===e?void 0:e.call(g)}}},toDataUri:()=>`data:image/svg+xml;utf8,${encodeURIComponent(Z)}`}}const d={standard:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.facialHair)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`}},c={surprised:(t,a)=>``,laughing:(t,a)=>``,nervous:(t,a)=>``,smile:(t,a)=>``,sad:(t,a)=>``,pucker:(t,a)=>``,frown:(t,a)=>``,smirk:(t,a)=>``},u={up:(t,a)=>``,down:(t,a)=>``,eyelashesUp:(t,a)=>``,eyelashesDown:(t,a)=>``},f={fonze:(t,a)=>``,mrT:(t,a)=>``,dougFunny:(t,a)=>``,mrClean:(e,t)=>'',dannyPhantom:(t,a)=>``,full:(t,a)=>``,turban:(t,a)=>``,pixie:(t,a)=>``},p={eyes:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.glasses)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`},round:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.glasses)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`},eyesShadow:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.glasses)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`},smiling:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.glasses)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`},smilingShadow:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.glasses)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`}},g={attached:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.earrings)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`},detached:(t,a)=>{var r,l;return`${null!==(l=null===(r=t.earrings)||void 0===r?void 0:r.value(t,a))&&void 0!==l?l:""}`}},h={open:(t,a)=>``,crew:(t,a)=>``,collared:(t,a)=>``},m={hoop:(t,a)=>``,stud:(t,a)=>``},y={round:(t,a)=>``,square:(t,a)=>``},v={beard:(t,a)=>``,scruff:(t,a)=>``},M=Object.freeze(Object.defineProperty({__proto__:null,base:d,earrings:m,ears:g,eyebrows:u,eyes:p,facialHair:v,glasses:y,hair:f,mouth:c,nose:{curve:(e,t)=>'',pointed:(e,t)=>'',tound:(e,t)=>''},shirt:h},Symbol.toStringTag,{value:"Module"}));function $({prng:e,group:t,values:a=[]}){const r=M,l=e.pick(a);return l&&r[t][l]?{name:l,value:r[t][l]}:void 0}function Z(e){return"transparent"===e?e:`#${e}`}const b=Object.freeze(Object.defineProperty({__proto__:null,create:({prng:e,options:t})=>{var a,r,l,o,i,n,s,d,c,u,f,p,g,h,m,y;!function({prng:e,options:t}){var a;t.baseColor=t.baseColor&&t.baseColor.length>0?[e.pick(t.baseColor,"transparent")]:[];for(const r of["eyebrows","hair","eyes","nose","ears","shirt","earrings","glasses","facialHair"]){const e=null!==(a=t[`${r}Color`])&&void 0!==a?a:[],l=e.indexOf(t.baseColor[0]);e.length>1&&l>-1&&e.splice(l,1)}}({prng:e,options:t});const v=function({prng:e,options:t}){const a=$({prng:e,group:"base",values:t.base}),r=$({prng:e,group:"mouth",values:t.mouth}),l=$({prng:e,group:"eyebrows",values:t.eyebrows}),o=$({prng:e,group:"hair",values:t.hair}),i=$({prng:e,group:"eyes",values:t.eyes}),n=$({prng:e,group:"nose",values:t.nose}),s=$({prng:e,group:"ears",values:t.ears}),d=$({prng:e,group:"shirt",values:t.shirt}),c=$({prng:e,group:"earrings",values:t.earrings}),u=$({prng:e,group:"glasses",values:t.glasses}),f=$({prng:e,group:"facialHair",values:t.facialHair});return{base:a,mouth:r,eyebrows:l,hair:e.bool(t.hairProbability)?o:void 0,eyes:i,nose:n,ears:s,shirt:d,earrings:e.bool(t.earringsProbability)?c:void 0,glasses:e.bool(t.glassesProbability)?u:void 0,facialHair:e.bool(t.facialHairProbability)?f:void 0}}({prng:e,options:t}),M=function({prng:e,options:t}){var a,r,l,o,i,n,s,d,c,u;return{base:Z(e.pick(null!==(a=t.baseColor)&&void 0!==a?a:[],"transparent")),earring:Z(e.pick(null!==(r=t.earringColor)&&void 0!==r?r:[],"transparent")),eyeShadow:Z(e.pick(null!==(l=t.eyeShadowColor)&&void 0!==l?l:[],"transparent")),eyebrows:Z(e.pick(null!==(o=t.eyebrowsColor)&&void 0!==o?o:[],"transparent")),facialHair:Z(e.pick(null!==(i=t.facialHairColor)&&void 0!==i?i:[],"transparent")),glasses:Z(e.pick(null!==(n=t.glassesColor)&&void 0!==n?n:[],"transparent")),hair:Z(e.pick(null!==(s=t.hairColor)&&void 0!==s?s:[],"transparent")),mouth:Z(e.pick(null!==(d=t.mouthColor)&&void 0!==d?d:[],"transparent")),shirt:Z(e.pick(null!==(c=t.shirtColor)&&void 0!==c?c:[],"transparent")),eyes:Z(e.pick(null!==(u=t.eyesColor)&&void 0!==u?u:[],"transparent"))}}({prng:e,options:t});return function({prng:e,options:t,components:a,colors:r}){var l;"beard"===(null===(l=a.facialHair)||void 0===l?void 0:l.name)&&r.facialHair===r.mouth&&(r.mouth="#ffffff33")}({prng:e,options:t,components:v,colors:M}),{attributes:{viewBox:"0 0 360 360",fill:"none","shape-rendering":"auto"},body:`${null!==(r=null===(a=v.base)||void 0===a?void 0:a.value(v,M))&&void 0!==r?r:""}${null!==(o=null===(l=v.mouth)||void 0===l?void 0:l.value(v,M))&&void 0!==o?o:""}${null!==(n=null===(i=v.eyebrows)||void 0===i?void 0:i.value(v,M))&&void 0!==n?n:""}${null!==(d=null===(s=v.hair)||void 0===s?void 0:s.value(v,M))&&void 0!==d?d:""}${null!==(u=null===(c=v.eyes)||void 0===c?void 0:c.value(v,M))&&void 0!==u?u:""}${null!==(p=null===(f=v.nose)||void 0===f?void 0:f.value(v,M))&&void 0!==p?p:""}${null!==(h=null===(g=v.ears)||void 0===g?void 0:g.value(v,M))&&void 0!==h?h:""}${null!==(y=null===(m=v.shirt)||void 0===m?void 0:m.value(v,M))&&void 0!==y?y:""}`,extra:()=>({...Object.entries(v).reduce(((e,[t,a])=>(e[t]=null==a?void 0:a.name,e)),{}),...Object.entries(M).reduce(((e,[t,a])=>(e[`${t}Color`]=a,e)),{})})}},meta:{title:"Avatar Illustration System",creator:"Micah Lanier",source:"https://www.figma.com/community/file/829741575478342595",homepage:"https://dribbble.com/micahlanier",license:{name:"CC BY 4.0",url:"https://creativecommons.org/licenses/by/4.0/"}},schema:{$schema:"http://json-schema.org/draft-07/schema#",properties:{base:{type:"array",items:{type:"string",enum:["standard"]},default:["standard"]},baseColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["f9c9b6","ac6651","77311d"]},earringColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["f9c9b6","d2eff3","000000","e0ddff","f4d150","ac6651","9287ff","ffeba4","fc909f","ffedef","6bd9e9","77311d","ffffff"]},earrings:{type:"array",items:{type:"string",enum:["hoop","stud"]},default:["hoop","stud"]},earringsProbability:{type:"integer",minimum:0,maximum:100,default:30},ears:{type:"array",items:{type:"string",enum:["attached","detached"]},default:["attached","detached"]},eyeShadowColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["d2eff3","e0ddff","ffeba4","ffedef","ffffff"]},eyebrows:{type:"array",items:{type:"string",enum:["up","down","eyelashesUp","eyelashesDown"]},default:["up","down","eyelashesUp","eyelashesDown"]},eyebrowsColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["000000"]},eyes:{type:"array",items:{type:"string",enum:["eyes","round","eyesShadow","smiling","smilingShadow"]},default:["eyes","round","eyesShadow","smiling","smilingShadow"]},eyesColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["000000"]},facialHair:{type:"array",items:{type:"string",enum:["beard","scruff"]},default:["beard","scruff"]},facialHairColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["000000"]},facialHairProbability:{type:"integer",minimum:0,maximum:100,default:10},glasses:{type:"array",items:{type:"string",enum:["round","square"]},default:["round","square"]},glassesColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["f9c9b6","d2eff3","000000","e0ddff","f4d150","ac6651","9287ff","ffeba4","fc909f","ffedef","6bd9e9","77311d","ffffff"]},glassesProbability:{type:"integer",minimum:0,maximum:100,default:30},hair:{type:"array",items:{type:"string",enum:["fonze","mrT","dougFunny","mrClean","dannyPhantom","full","turban","pixie"]},default:["fonze","mrT","dougFunny","mrClean","dannyPhantom","full","turban","pixie"]},hairColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["f9c9b6","d2eff3","000000","e0ddff","f4d150","ac6651","9287ff","ffeba4","fc909f","ffedef","6bd9e9","77311d","ffffff"]},hairProbability:{type:"integer",minimum:0,maximum:100,default:100},mouth:{type:"array",items:{type:"string",enum:["surprised","laughing","nervous","smile","sad","pucker","frown","smirk"]},default:["surprised","laughing","nervous","smile","sad","pucker","frown","smirk"]},mouthColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["000000"]},nose:{type:"array",items:{type:"string",enum:["curve","pointed","tound"]},default:["curve","pointed","tound"]},shirt:{type:"array",items:{type:"string",enum:["open","crew","collared"]},default:["open","crew","collared"]},shirtColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["f9c9b6","d2eff3","000000","e0ddff","f4d150","ac6651","9287ff","ffeba4","fc909f","ffedef","6bd9e9","77311d","ffffff"]}}}},Symbol.toStringTag,{value:"Module"}));export{s as c,b as d}; diff --git a/workers/public/assets/crypto-libs-Biap7jvT.js b/workers/public/assets/crypto-libs-Biap7jvT.js new file mode 100644 index 0000000..fc3d5cd --- /dev/null +++ b/workers/public/assets/crypto-libs-Biap7jvT.js @@ -0,0 +1,10 @@ +import{r as e,a as f,b as t,c as d,d as r,e as a,f as c}from"./vendor-deps-CUoVodhr.js";var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var f=e.default;if("function"==typeof f){var t=function e(){return this instanceof e?Reflect.construct(f,arguments,this.constructor):f.apply(this,arguments)};t.prototype=f.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach((function(f){var d=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(t,f,d.get?d:{enumerable:!0,get:function(){return e[f]}})})),t}var s={exports:{}};const o=b(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))); +/** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.11.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2024 + * @license MIT + */ +var h;var u,p=(h||(h=1,u=s,function(){var e="input is invalid type",f="object"==typeof window,t=f?window:{};t.JS_SHA256_NO_WINDOW&&(f=!1);var d=!f&&"object"==typeof self,r=!t.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;r?t=i:d&&(t=self);var a=!t.JS_SHA256_NO_COMMON_JS&&u.exports,c=!t.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,n="0123456789abcdef".split(""),b=[-2147483648,8388608,32768,128],s=[24,16,8,0],h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=["hex","array","digest","arrayBuffer"],l=[];!t.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!c||!t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,f){return function(t){return new w(f,!0).update(t)[e]()}},v=function(e){var f=y("hex",e);r&&(f=m(f,e)),f.create=function(){return new w(e)},f.update=function(e){return f.create().update(e)};for(var t=0;t>>6,n[s++]=128|63&i):i<55296||i>=57344?(n[s++]=224|i>>>12,n[s++]=128|i>>>6&63,n[s++]=128|63&i):(i=65536+((1023&i)<<10|1023&f.charCodeAt(++r)),n[s++]=240|i>>>18,n[s++]=128|i>>>12&63,n[s++]=128|i>>>6&63,n[s++]=128|63&i);f=n}else{if("object"!==a)throw new Error(e);if(null===f)throw new Error(e);if(c&&f.constructor===ArrayBuffer)f=new Uint8Array(f);else if(!(Array.isArray(f)||c&&ArrayBuffer.isView(f)))throw new Error(e)}f.length>64&&(f=new w(t,!0).update(f).array());var o=[],h=[];for(r=0;r<64;++r){var u=f[r]||0;o[r]=92^u,h[r]=54^u}w.call(this,t,d),this.update(h),this.oKeyPad=o,this.inner=!0,this.sharedMemory=d}w.prototype.update=function(f){if(!this.finalized){var t,d=typeof f;if("string"!==d){if("object"!==d)throw new Error(e);if(null===f)throw new Error(e);if(c&&f.constructor===ArrayBuffer)f=new Uint8Array(f);else if(!(Array.isArray(f)||c&&ArrayBuffer.isView(f)))throw new Error(e);t=!0}for(var r,a,i=0,n=f.length,b=this.blocks;i>>2]|=f[i]<>>2]|=r<>>2]|=(192|r>>>6)<>>2]|=(128|63&r)<=57344?(b[a>>>2]|=(224|r>>>12)<>>2]|=(128|r>>>6&63)<>>2]|=(128|63&r)<>>2]|=(240|r>>>18)<>>2]|=(128|r>>>12&63)<>>2]|=(128|r>>>6&63)<>>2]|=(128|63&r)<=64?(this.block=b[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,f=this.lastByteIndex;e[16]=this.block,e[f>>>2]|=b[3&f],this.block=e[16],f>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e,f,t,d,r,a,c,i,n,b=this.h0,s=this.h1,o=this.h2,u=this.h3,p=this.h4,l=this.h5,y=this.h6,v=this.h7,m=this.blocks;for(e=16;e<64;++e)f=((r=m[e-15])>>>7|r<<25)^(r>>>18|r<<14)^r>>>3,t=((r=m[e-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,m[e]=m[e-16]+f+m[e-7]+t|0;for(n=s&o,e=0;e<64;e+=4)this.first?(this.is224?(a=300032,v=(r=m[0]-1413257819)-150054599|0,u=r+24177077|0):(a=704751109,v=(r=m[0]-210244248)-1521486534|0,u=r+143694565|0),this.first=!1):(f=(b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),d=(a=b&s)^b&o^n,v=u+(r=v+(t=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&l^~p&y)+h[e]+m[e])|0,u=r+(f+d)|0),f=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),d=(c=u&b)^u&s^a,y=o+(r=y+(t=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&p^~v&l)+h[e+1]+m[e+1])|0,f=((o=r+(f+d)|0)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),d=(i=o&u)^o&b^c,l=s+(r=l+(t=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&v^~y&p)+h[e+2]+m[e+2])|0,f=((s=r+(f+d)|0)>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),d=(n=s&o)^s&u^i,p=b+(r=p+(t=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&y^~l&v)+h[e+3]+m[e+3])|0,b=r+(f+d)|0,this.chromeBugWorkAround=!0;this.h0=this.h0+b|0,this.h1=this.h1+s|0,this.h2=this.h2+o|0,this.h3=this.h3+u|0,this.h4=this.h4+p|0,this.h5=this.h5+l|0,this.h6=this.h6+y|0,this.h7=this.h7+v|0},w.prototype.hex=function(){this.finalize();var e=this.h0,f=this.h1,t=this.h2,d=this.h3,r=this.h4,a=this.h5,c=this.h6,i=this.h7,b=n[e>>>28&15]+n[e>>>24&15]+n[e>>>20&15]+n[e>>>16&15]+n[e>>>12&15]+n[e>>>8&15]+n[e>>>4&15]+n[15&e]+n[f>>>28&15]+n[f>>>24&15]+n[f>>>20&15]+n[f>>>16&15]+n[f>>>12&15]+n[f>>>8&15]+n[f>>>4&15]+n[15&f]+n[t>>>28&15]+n[t>>>24&15]+n[t>>>20&15]+n[t>>>16&15]+n[t>>>12&15]+n[t>>>8&15]+n[t>>>4&15]+n[15&t]+n[d>>>28&15]+n[d>>>24&15]+n[d>>>20&15]+n[d>>>16&15]+n[d>>>12&15]+n[d>>>8&15]+n[d>>>4&15]+n[15&d]+n[r>>>28&15]+n[r>>>24&15]+n[r>>>20&15]+n[r>>>16&15]+n[r>>>12&15]+n[r>>>8&15]+n[r>>>4&15]+n[15&r]+n[a>>>28&15]+n[a>>>24&15]+n[a>>>20&15]+n[a>>>16&15]+n[a>>>12&15]+n[a>>>8&15]+n[a>>>4&15]+n[15&a]+n[c>>>28&15]+n[c>>>24&15]+n[c>>>20&15]+n[c>>>16&15]+n[c>>>12&15]+n[c>>>8&15]+n[c>>>4&15]+n[15&c];return this.is224||(b+=n[i>>>28&15]+n[i>>>24&15]+n[i>>>20&15]+n[i>>>16&15]+n[i>>>12&15]+n[i>>>8&15]+n[i>>>4&15]+n[15&i]),b},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,f=this.h1,t=this.h2,d=this.h3,r=this.h4,a=this.h5,c=this.h6,i=this.h7,n=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,f>>>24&255,f>>>16&255,f>>>8&255,255&f,t>>>24&255,t>>>16&255,t>>>8&255,255&t,d>>>24&255,d>>>16&255,d>>>8&255,255&d,r>>>24&255,r>>>16&255,r>>>8&255,255&r,a>>>24&255,a>>>16&255,a>>>8&255,255&a,c>>>24&255,c>>>16&255,c>>>8&255,255&c];return this.is224||n.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i),n},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),f=new DataView(e);return f.setUint32(0,this.h0),f.setUint32(4,this.h1),f.setUint32(8,this.h2),f.setUint32(12,this.h3),f.setUint32(16,this.h4),f.setUint32(20,this.h5),f.setUint32(24,this.h6),this.is224||f.setUint32(28,this.h7),e},_.prototype=new w,_.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var A=v();A.sha256=A,A.sha224=v(!0),A.sha256.hmac=S(),A.sha224.hmac=S(!0),a?u.exports=A:(t.sha256=A.sha256,t.sha224=A.sha224)}()),s.exports),l={};var y,v={};function m(){return y||(y=1,d=v,r=e(),a=f(),c=t(),d.assert=a,d.toArray=c.toArray,d.zero2=c.zero2,d.toHex=c.toHex,d.encode=c.encode,d.getNAF=function(e,f,t){var d,r=new Array(Math.max(e.bitLength(),t)+1);for(d=0;d(a>>1)-1?(a>>1)-n:n,c.isubn(i)):i=0,r[d]=i,c.iushrn(1)}return r},d.getJSF=function(e,f){var t=[[],[]];e=e.clone(),f=f.clone();for(var d,r=0,a=0;e.cmpn(-r)>0||f.cmpn(-a)>0;){var c,i,n=e.andln(3)+r&3,b=f.andln(3)+a&3;3===n&&(n=-1),3===b&&(b=-1),c=1&n?3!=(d=e.andln(7)+r&7)&&5!==d||2!==b?n:-n:0,t[0].push(c),i=1&b?3!=(d=f.andln(7)+a&7)&&5!==d||2!==n?b:-b:0,t[1].push(i),2*r===c+1&&(r=1-r),2*a===i+1&&(a=1-a),e.iushrn(1),f.iushrn(1)}return t},d.cachedProperty=function(e,f,t){var d="_"+f;e.prototype[f]=function(){return void 0!==this[d]?this[d]:this[d]=t.call(this)}},d.parseBytes=function(e){return"string"==typeof e?d.toArray(e,"hex"):e},d.intFromLE=function(e){return new r(e,"hex","le")}),v;var d,r,a,c}var g,S,w,_,A,I,x,M,z,q={};function P(){if(S)return g;S=1;var f=e(),t=m(),d=t.getNAF,r=t.getJSF,a=t.assert;function c(e,t){this.type=e,this.p=new f(t.p,16),this.red=t.prime?f.red(t.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=t.n&&new f(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var d=this.n&&this.p.div(this.n);!d||d.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(e,f){this.curve=e,this.type=f,this.precomputed=null}return g=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,f){a(e.precomputed);var t=e._getDoubles(),r=d(f,1,this._bitLength),c=(1<=i;s--)n=(n<<1)+r[s];b.push(n)}for(var o=this.jpoint(null,null,null),h=this.jpoint(null,null,null),u=c;u>0;u--){for(i=0;i=0;b--){for(var s=0;b>=0&&0===i[b];b--)s++;if(b>=0&&s++,n=n.dblp(s),b<0)break;var o=i[b];a(0!==o),n="affine"===e.type?o>0?n.mixedAdd(c[o-1>>1]):n.mixedAdd(c[-o-1>>1].neg()):o>0?n.add(c[o-1>>1]):n.add(c[-o-1>>1].neg())}return"affine"===e.type?n.toP():n},c.prototype._wnafMulAdd=function(e,f,t,a,c){var i,n,b,s=this._wnafT1,o=this._wnafT2,h=this._wnafT3,u=0;for(i=0;i=1;i-=2){var l=i-1,y=i;if(1===s[l]&&1===s[y]){var v=[f[l],null,null,f[y]];0===f[l].y.cmp(f[y].y)?(v[1]=f[l].add(f[y]),v[2]=f[l].toJ().mixedAdd(f[y].neg())):0===f[l].y.cmp(f[y].y.redNeg())?(v[1]=f[l].toJ().mixedAdd(f[y]),v[2]=f[l].add(f[y].neg())):(v[1]=f[l].toJ().mixedAdd(f[y]),v[2]=f[l].toJ().mixedAdd(f[y].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=r(t[l],t[y]);for(u=Math.max(g[0].length,u),h[l]=new Array(u),h[y]=new Array(u),n=0;n=0;i--){for(var I=0;i>=0;){var x=!0;for(n=0;n=0&&I++,_=_.dblp(I),i<0)break;for(n=0;n0?b=o[n][M-1>>1]:M<0&&(b=o[n][-M-1>>1].neg()),_="affine"===b.type?_.mixedAdd(b):_.add(b))}}for(i=0;i=Math.ceil((e.bitLength()+1)/f.step)},i.prototype._getDoubles=function(e,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],d=this,r=0;r=0&&(c=f,i=d),r.negative&&(r=r.neg(),a=a.neg()),c.negative&&(c=c.neg(),i=i.neg()),[{a:r,b:a},{a:c,b:i}]},i.prototype._endoSplit=function(e){var f=this.endo.basis,t=f[0],d=f[1],r=d.b.mul(e).divRound(this.n),a=t.b.neg().mul(e).divRound(this.n),c=r.mul(t.a),i=a.mul(d.a),n=r.mul(t.b),b=a.mul(d.b);return{k1:e.sub(c).sub(i),k2:n.add(b).neg()}},i.prototype.pointFromX=function(e,f){(e=new t(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=d.redSqrt();if(0!==r.redSqr().redSub(d).cmp(this.zero))throw new Error("invalid point");var a=r.fromRed().isOdd();return(f&&!a||!f&&a)&&(r=r.redNeg()),this.point(e,r)},i.prototype.validate=function(e){if(e.inf)return!0;var f=e.x,t=e.y,d=this.a.redMul(f),r=f.redSqr().redMul(f).redIAdd(d).redIAdd(this.b);return 0===t.redSqr().redISub(r).cmpn(0)},i.prototype._endoWnafMulAdd=function(e,f,t){for(var d=this._endoWnafT1,r=this._endoWnafT2,a=0;a":""},n.prototype.isInfinity=function(){return this.inf},n.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var f=this.y.redSub(e.y);0!==f.cmpn(0)&&(f=f.redMul(this.x.redSub(e.x).redInvm()));var t=f.redSqr().redISub(this.x).redISub(e.x),d=f.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,d)},n.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var f=this.curve.a,t=this.x.redSqr(),d=e.redInvm(),r=t.redAdd(t).redIAdd(t).redIAdd(f).redMul(d),a=r.redSqr().redISub(this.x.redAdd(this.x)),c=r.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,c)},n.prototype.getX=function(){return this.x.fromRed()},n.prototype.getY=function(){return this.y.fromRed()},n.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},n.prototype.mulAdd=function(e,f,t){var d=[this,f],r=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,r):this.curve._wnafMulAdd(1,d,r,2)},n.prototype.jmulAdd=function(e,f,t){var d=[this,f],r=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,r,!0):this.curve._wnafMulAdd(1,d,r,2,!0)},n.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},n.prototype.neg=function(e){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var t=this.precomputed,d=function(e){return e.neg()};f.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(d)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(d)}}}return f},n.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(b,a.BasePoint),i.prototype.jpoint=function(e,f,t){return new b(this,e,f,t)},b.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),f=e.redSqr(),t=this.x.redMul(f),d=this.y.redMul(f).redMul(e);return this.curve.point(t,d)},b.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},b.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var f=e.z.redSqr(),t=this.z.redSqr(),d=this.x.redMul(f),r=e.x.redMul(t),a=this.y.redMul(f.redMul(e.z)),c=e.y.redMul(t.redMul(this.z)),i=d.redSub(r),n=a.redSub(c);if(0===i.cmpn(0))return 0!==n.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var b=i.redSqr(),s=b.redMul(i),o=d.redMul(b),h=n.redSqr().redIAdd(s).redISub(o).redISub(o),u=n.redMul(o.redISub(h)).redISub(a.redMul(s)),p=this.z.redMul(e.z).redMul(i);return this.curve.jpoint(h,u,p)},b.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var f=this.z.redSqr(),t=this.x,d=e.x.redMul(f),r=this.y,a=e.y.redMul(f).redMul(this.z),c=t.redSub(d),i=r.redSub(a);if(0===c.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var n=c.redSqr(),b=n.redMul(c),s=t.redMul(n),o=i.redSqr().redIAdd(b).redISub(s).redISub(s),h=i.redMul(s.redISub(o)).redISub(r.redMul(b)),u=this.z.redMul(c);return this.curve.jpoint(o,h,u)},b.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var f;if(this.curve.zeroA||this.curve.threeA){var t=this;for(f=0;f=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},b.prototype.inspect=function(){return this.isInfinity()?"":""},b.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},w}(),f.mont=function(){if(I)return A;I=1;var f=e(),t=d(),r=P(),a=m();function c(e){r.call(this,"mont",e),this.a=new f(e.a,16).toRed(this.red),this.b=new f(e.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(e,t,d){r.BasePoint.call(this,e,"projective"),null===t&&null===d?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(t,16),this.z=new f(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(c,r),A=c,c.prototype.validate=function(e){var f=e.normalize().x,t=f.redSqr(),d=t.redMul(f).redAdd(t.redMul(this.a)).redAdd(f);return 0===d.redSqrt().redSqr().cmp(d)},t(i,r.BasePoint),c.prototype.decodePoint=function(e,f){return this.point(a.toArray(e,f),1)},c.prototype.point=function(e,f){return new i(this,e,f)},c.prototype.pointFromJSON=function(e){return i.fromJSON(this,e)},i.prototype.precompute=function(){},i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},i.fromJSON=function(e,f){return new i(e,f[0],f[1]||e.one)},i.prototype.inspect=function(){return this.isInfinity()?"":""},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},i.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),f=this.x.redSub(this.z).redSqr(),t=e.redSub(f),d=e.redMul(f),r=t.redMul(f.redAdd(this.curve.a24.redMul(t)));return this.curve.point(d,r)},i.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.diffAdd=function(e,f){var t=this.x.redAdd(this.z),d=this.x.redSub(this.z),r=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(t),c=r.redMul(d),i=f.z.redMul(a.redAdd(c).redSqr()),n=f.x.redMul(a.redISub(c).redSqr());return this.curve.point(i,n)},i.prototype.mul=function(e){for(var f=e.clone(),t=this,d=this.curve.point(null,null),r=[];0!==f.cmpn(0);f.iushrn(1))r.push(f.andln(1));for(var a=r.length-1;a>=0;a--)0===r[a]?(t=t.diffAdd(d,this),d=d.dbl()):(d=t.diffAdd(d,this),t=t.dbl());return d},i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},i.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},i.prototype.getX=function(){return this.normalize(),this.x.fromRed()},A}(),f.edwards=function(){if(M)return x;M=1;var f=m(),t=e(),r=d(),a=P(),c=f.assert;function i(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function n(e,f,d,r,c){a.BasePoint.call(this,e,"projective"),null===f&&null===d&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(f,16),this.y=new t(d,16),this.z=r?new t(r,16):this.curve.one,this.t=c&&new t(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(i,a),x=i,i.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},i.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},i.prototype.jpoint=function(e,f,t,d){return this.point(e,f,t,d)},i.prototype.pointFromX=function(e,f){(e=new t(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),r=this.c2.redSub(this.a.redMul(d)),a=this.one.redSub(this.c2.redMul(this.d).redMul(d)),c=r.redMul(a.redInvm()),i=c.redSqrt();if(0!==i.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(f&&!n||!f&&n)&&(i=i.redNeg()),this.point(e,i)},i.prototype.pointFromY=function(e,f){(e=new t(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),r=d.redSub(this.c2),a=d.redMul(this.d).redMul(this.c2).redSub(this.a),c=r.redMul(a.redInvm());if(0===c.cmp(this.zero)){if(f)throw new Error("invalid point");return this.point(this.zero,e)}var i=c.redSqrt();if(0!==i.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");return i.fromRed().isOdd()!==f&&(i=i.redNeg()),this.point(i,e)},i.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var f=e.x.redSqr(),t=e.y.redSqr(),d=f.redMul(this.a).redAdd(t),r=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(t)));return 0===d.cmp(r)},r(n,a.BasePoint),i.prototype.pointFromJSON=function(e){return n.fromJSON(this,e)},i.prototype.point=function(e,f,t,d){return new n(this,e,f,t,d)},n.fromJSON=function(e,f){return new n(e,f[0],f[1],f[2])},n.prototype.inspect=function(){return this.isInfinity()?"":""},n.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},n.prototype._extDbl=function(){var e=this.x.redSqr(),f=this.y.redSqr(),t=this.z.redSqr();t=t.redIAdd(t);var d=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(f),a=d.redAdd(f),c=a.redSub(t),i=d.redSub(f),n=r.redMul(c),b=a.redMul(i),s=r.redMul(i),o=c.redMul(a);return this.curve.point(n,b,o,s)},n.prototype._projDbl=function(){var e,f,t,d,r,a,c=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),n=this.y.redSqr();if(this.curve.twisted){var b=(d=this.curve._mulA(i)).redAdd(n);this.zOne?(e=c.redSub(i).redSub(n).redMul(b.redSub(this.curve.two)),f=b.redMul(d.redSub(n)),t=b.redSqr().redSub(b).redSub(b)):(r=this.z.redSqr(),a=b.redSub(r).redISub(r),e=c.redSub(i).redISub(n).redMul(a),f=b.redMul(d.redSub(n)),t=b.redMul(a))}else d=i.redAdd(n),r=this.curve._mulC(this.z).redSqr(),a=d.redSub(r).redSub(r),e=this.curve._mulC(c.redISub(d)).redMul(a),f=this.curve._mulC(d).redMul(i.redISub(n)),t=d.redMul(a);return this.curve.point(e,f,t)},n.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},n.prototype._extAdd=function(e){var f=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),t=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),d=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),a=t.redSub(f),c=r.redSub(d),i=r.redAdd(d),n=t.redAdd(f),b=a.redMul(c),s=i.redMul(n),o=a.redMul(n),h=c.redMul(i);return this.curve.point(b,s,h,o)},n.prototype._projAdd=function(e){var f,t,d=this.z.redMul(e.z),r=d.redSqr(),a=this.x.redMul(e.x),c=this.y.redMul(e.y),i=this.curve.d.redMul(a).redMul(c),n=r.redSub(i),b=r.redAdd(i),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(c),o=d.redMul(n).redMul(s);return this.curve.twisted?(f=d.redMul(b).redMul(c.redSub(this.curve._mulA(a))),t=n.redMul(b)):(f=d.redMul(b).redMul(c.redSub(a)),t=this.curve._mulC(n).redMul(b)),this.curve.point(o,f,t)},n.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},n.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},n.prototype.mulAdd=function(e,f,t){return this.curve._wnafMulAdd(1,[this,f],[e,t],2,!1)},n.prototype.jmulAdd=function(e,f,t){return this.curve._wnafMulAdd(1,[this,f],[e,t],2,!0)},n.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},n.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()},n.prototype.getY=function(){return this.normalize(),this.y.fromRed()},n.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},n.prototype.eqXToP=function(e){var f=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(f))return!0;for(var t=e.clone(),d=this.curve.redN.redMul(this.z);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(d),0===this.x.cmp(f))return!0}},n.prototype.toP=n.prototype.normalize,n.prototype.mixedAdd=n.prototype.add,x}()),q;var f}var E,k,N,B,O,C,j,F,L,J,K,U,T,D,X,H,W={};function Y(){return N||(N=1,function(){var e,f=W,t=r(),d=R(),a=m().assert;function c(e){"short"===e.type?this.curve=new d.short(e):"edwards"===e.type?this.curve=new d.edwards(e):this.curve=new d.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function i(e,t){Object.defineProperty(f,e,{configurable:!0,enumerable:!0,get:function(){var d=new c(t);return Object.defineProperty(f,e,{configurable:!0,enumerable:!0,value:d}),d}})}f.PresetCurve=c,i("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),i("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),i("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),i("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:t.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),i("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:t.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),i("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),i("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{e=k?E:(k=1,E={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}catch(n){e=void 0}i("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:t.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",e]})}()),W}function V(){if(L)return F;L=1;var f=e(),t=a(),d=m(),r=Y(),i=c(),n=d.assert,b=function(){if(O)return B;O=1;var f=e(),t=m().assert;function d(e,f){this.ec=e,this.priv=null,this.pub=null,f.priv&&this._importPrivate(f.priv,f.privEnc),f.pub&&this._importPublic(f.pub,f.pubEnc)}return B=d,d.fromPublic=function(e,f,t){return f instanceof d?f:new d(e,{pub:f,pubEnc:t})},d.fromPrivate=function(e,f,t){return f instanceof d?f:new d(e,{priv:f,privEnc:t})},d.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(e,f){return"string"==typeof e&&(f=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),f?this.pub.encode(f,e):this.pub},d.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(e,t){this.priv=new f(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(e,f){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,f)},d.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},d.prototype.sign=function(e,f,t){return this.ec.sign(e,this,f,t)},d.prototype.verify=function(e,f,t){return this.ec.verify(e,f,this,void 0,t)},d.prototype.inspect=function(){return""},B}(),s=function(){if(j)return C;j=1;var f=e(),t=m(),d=t.assert;function r(e,t){if(e instanceof r)return e;this._importDER(e,t)||(d(e.r&&e.s,"Signature without r or s"),this.r=new f(e.r,16),this.s=new f(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,f){var t=e[f.place++];if(!(128&t))return t;var d=15&t;if(0===d||d>4)return!1;if(0===e[f.place])return!1;for(var r=0,a=0,c=f.place;a>>=0;return!(r<=127)&&(f.place=c,r)}function i(e){for(var f=0,t=e.length-1;!e[f]&&!(128&e[f+1])&&f>>3);for(e.push(128|t);--t;)e.push(f>>>(t<<3)&255);e.push(f)}}return C=r,r.prototype._importDER=function(e,d){e=t.toArray(e,d);var r=new a;if(48!==e[r.place++])return!1;var i=c(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=c(e,r);if(!1===n)return!1;if(128&e[r.place])return!1;var b=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;if(128&e[r.place])return!1;var o=e.slice(r.place,s+r.place);if(0===b[0]){if(!(128&b[1]))return!1;b=b.slice(1)}if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}return this.r=new f(b),this.s=new f(o),this.recoveryParam=null,!0},r.prototype.toDER=function(e){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=i(f),d=i(d);!(d[0]||128&d[1]);)d=d.slice(1);var r=[2];n(r,f.length),(r=r.concat(f)).push(2),n(r,d.length);var a=r.concat(d),c=[48];return n(c,a.length),c=c.concat(a),t.encode(c,e)},C}();function o(e){if(!(this instanceof o))return new o(e);"string"==typeof e&&(n(Object.prototype.hasOwnProperty.call(r,e),"Unknown curve "+e),e=r[e]),e instanceof r.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return F=o,o.prototype.keyPair=function(e){return new b(this,e)},o.prototype.keyFromPrivate=function(e,f){return b.fromPrivate(this,e,f)},o.prototype.keyFromPublic=function(e,f){return b.fromPublic(this,e,f)},o.prototype.genKeyPair=function(e){e||(e={});for(var d=new t({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||i(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new f(2));;){var c=new f(d.generate(r));if(!(c.cmp(a)>0))return c.iaddn(1),this.keyFromPrivate(c)}},o.prototype._truncateToN=function(e,t,d){var r;if(f.isBN(e)||"number"==typeof e)r=(e=new f(e,16)).byteLength();else if("object"==typeof e)r=e.length,e=new f(e,16);else{var a=e.toString();r=a.length+1>>>1,e=new f(a,16)}"number"!=typeof d&&(d=8*r);var c=d-this.n.bitLength();return c>0&&(e=e.ushrn(c)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},o.prototype.sign=function(e,d,r,a){if("object"==typeof r&&(a=r,r=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!f.isBN(e)){n("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),n(e.length>>>0===e.length);for(var c=0;c=0)){var y=this.g.mul(l);if(!y.isInfinity()){var v=y.getX(),m=v.umod(this.n);if(0!==m.cmpn(0)){var g=l.invm(this.n).mul(m.mul(d.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var S=(y.getY().isOdd()?1:0)|(0!==v.cmp(m)?2:0);return a.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),S^=1),new s({r:m,s:g,recoveryParam:S})}}}}}},o.prototype.verify=function(e,f,t,d,r){r||(r={}),e=this._truncateToN(e,!1,r.msgBitLength),t=this.keyFromPublic(t,d);var a=(f=new s(f,"hex")).r,c=f.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var i,n=c.invm(this.n),b=n.mul(e).umod(this.n),o=n.mul(a).umod(this.n);return this.curve._maxwellTrick?!(i=this.g.jmulAdd(b,t.getPublic(),o)).isInfinity()&&i.eqXToP(a):!(i=this.g.mulAdd(b,t.getPublic(),o)).isInfinity()&&0===i.getX().umod(this.n).cmp(a)},o.prototype.recoverPubKey=function(e,t,d,r){n((3&d)===d,"The recovery param is more than two bits"),t=new s(t,r);var a=this.n,c=new f(e),i=t.r,b=t.s,o=1&d,h=d>>1;if(i.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");i=h?this.curve.pointFromX(i.add(this.curve.n),o):this.curve.pointFromX(i,o);var u=t.r.invm(a),p=a.sub(c).mul(u).umod(a),l=b.mul(u).umod(a);return this.g.mulAdd(p,i,l)},o.prototype.getKeyRecoveryParam=function(e,f,t,d){if(null!==(f=new s(f,d)).recoveryParam)return f.recoveryParam;for(var r=0;r<4;r++){var a;try{a=this.recoverPubKey(e,f,r)}catch(c){continue}if(a.eq(t))return r}throw new Error("Unable to find valid recovery factor")},F}function G(){if(X)return D;X=1;var f=r(),t=Y(),d=m(),a=d.assert,c=d.parseBytes,i=function(){if(K)return J;K=1;var e=m(),f=e.assert,t=e.parseBytes,d=e.cachedProperty;function r(e,f){this.eddsa=e,this._secret=t(f.secret),e.isPoint(f.pub)?this._pub=f.pub:this._pubBytes=t(f.pub)}return r.fromPublic=function(e,f){return f instanceof r?f:new r(e,{pub:f})},r.fromSecret=function(e,f){return f instanceof r?f:new r(e,{secret:f})},r.prototype.secret=function(){return this._secret},d(r,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),d(r,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),d(r,"privBytes",(function(){var e=this.eddsa,f=this.hash(),t=e.encodingLength-1,d=f.slice(0,e.encodingLength);return d[0]&=248,d[t]&=127,d[t]|=64,d})),d(r,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),d(r,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),d(r,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),r.prototype.sign=function(e){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},r.prototype.verify=function(e,f){return this.eddsa.verify(e,f,this)},r.prototype.getSecret=function(t){return f(this._secret,"KeyPair is public only"),e.encode(this.secret(),t)},r.prototype.getPublic=function(f){return e.encode(this.pubBytes(),f)},J=r}(),n=function(){if(T)return U;T=1;var f=e(),t=m(),d=t.assert,r=t.cachedProperty,a=t.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(d(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),d(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof f&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}return r(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),r(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),r(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),r(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},U=c}();function b(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof b))return new b(e);e=t[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=f.sha512}return D=b,b.prototype.sign=function(e,f){e=c(e);var t=this.keyFromSecret(f),d=this.hashInt(t.messagePrefix(),e),r=this.g.mul(d),a=this.encodePoint(r),i=this.hashInt(a,t.pubBytes(),e).mul(t.priv()),n=d.add(i).umod(this.curve.n);return this.makeSignature({R:r,S:n,Rencoded:a})},b.prototype.verify=function(e,f,t){if(e=c(e),(f=this.makeSignature(f)).S().gte(f.eddsa.curve.n)||f.S().isNeg())return!1;var d=this.keyFromPublic(t),r=this.hashInt(f.Rencoded(),d.pubBytes(),e),a=this.g.mul(f.S());return f.R().add(d.pub().mul(r)).eq(a)},b.prototype.hashInt=function(){for(var e=this.hash(),f=0;f255)return!1;return!0}function d(e,d){if(e.buffer&&"Uint8Array"===e.name)return d&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!t(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(f(e.length)&&t(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function r(e){return new Uint8Array(e)}function a(e,f,t,d,r){null==d&&null==r||(e=e.slice?e.slice(d,r):Array.prototype.slice.call(e,d,r)),f.set(e,t)}var c=function(){return{toBytes:function(e){var f=[],t=0;for(e=encodeURI(e);t191&&d<224?(f.push(String.fromCharCode((31&d)<<6|63&e[t+1])),t+=2):(f.push(String.fromCharCode((15&d)<<12|(63&e[t+1])<<6|63&e[t+2])),t+=3)}return f.join("")}}}(),i=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var f=[],t=0;t>4]+e[15&r])}return t.join("")}}}(),n={16:10,24:12,32:14},b=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],s=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],o=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],h=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],u=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],p=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],l=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],m=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],g=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],S=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],w=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],_=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function I(e){for(var f=[],t=0;t>2,this._Ke[t][f%4]=a[f],this._Kd[e-t][f%4]=a[f];for(var c,i=0,o=r;o>16&255]<<24^s[c>>8&255]<<16^s[255&c]<<8^s[c>>24&255]^b[i]<<24,i+=1,8!=r)for(f=1;f>8&255]<<8^s[c>>16&255]<<16^s[c>>24&255]<<24,f=r/2+1;f>2,u=o%4,this._Ke[h][u]=a[f],this._Kd[e-h][u]=a[f++],o++}for(var h=1;h>24&255]^w[c>>16&255]^_[c>>8&255]^A[255&c]},x.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var f=this._Ke.length-1,t=[0,0,0,0],d=I(e),a=0;a<4;a++)d[a]^=this._Ke[0][a];for(var c=1;c>24&255]^u[d[(a+1)%4]>>16&255]^p[d[(a+2)%4]>>8&255]^l[255&d[(a+3)%4]]^this._Ke[c][a];d=t.slice()}var i,n=r(16);for(a=0;a<4;a++)i=this._Ke[f][a],n[4*a]=255&(s[d[a]>>24&255]^i>>24),n[4*a+1]=255&(s[d[(a+1)%4]>>16&255]^i>>16),n[4*a+2]=255&(s[d[(a+2)%4]>>8&255]^i>>8),n[4*a+3]=255&(s[255&d[(a+3)%4]]^i);return n},x.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var f=this._Kd.length-1,t=[0,0,0,0],d=I(e),a=0;a<4;a++)d[a]^=this._Kd[0][a];for(var c=1;c>24&255]^v[d[(a+3)%4]>>16&255]^m[d[(a+2)%4]>>8&255]^g[255&d[(a+1)%4]]^this._Kd[c][a];d=t.slice()}var i,n=r(16);for(a=0;a<4;a++)i=this._Kd[f][a],n[4*a]=255&(o[d[a]>>24&255]^i>>24),n[4*a+1]=255&(o[d[(a+3)%4]>>16&255]^i>>16),n[4*a+2]=255&(o[d[(a+2)%4]>>8&255]^i>>8),n[4*a+3]=255&(o[255&d[(a+1)%4]]^i);return n};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new x(e)};M.prototype.encrypt=function(e){if((e=d(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var f=r(e.length),t=r(16),c=0;cNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var f=15;f>=0;--f)this._counter[f]=e%256,e=parseInt(e/256)},R.prototype.setBytes=function(e){if(16!=(e=d(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var E=function(e,f){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",f instanceof R||(f=new R(f)),this._counter=f,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new x(e)};E.prototype.encrypt=function(e){for(var f=d(e,!0),t=0;t16)throw new Error("PKCS#7 padding byte out of range");for(var t=e.length-f,c=0;c>>8&255,this._keystream[t++]=e[f]>>>16&255,this._keystream[t++]=e[f]>>>24&255},f.prototype._quarterround=function(e,f,t,d,r){e[r]=this._rotl(e[r]^(e[f]+=e[t]),16),e[t]=this._rotl(e[t]^(e[d]+=e[r]),12),e[r]=this._rotl(e[r]^(e[f]+=e[t]),8),e[t]=this._rotl(e[t]^(e[d]+=e[r]),7),e[f]>>>=0,e[t]>>>=0,e[d]>>>=0,e[r]>>>=0},f.prototype._get32=function(e,f){return e[f++]^e[f++]<<8^e[f++]<<16^e[f]<<24},f.prototype._rotl=function(e,f){return e<>>32-f},f.prototype.encrypt=function(e){return this._update(e)},f.prototype.decrypt=function(e){return this._update(e)},f.prototype._update=function(e){if(!(e instanceof Uint8Array)||0===e.length)throw new Error("Data should be type of bytes (Uint8Array) and not empty!");for(var f=new Uint8Array(e.length),t=0;te.unicode))}const p={},g={},b={};function k(e,t,n){n.onerror=()=>t(n.error),n.onblocked=()=>t(new Error("IDB blocked")),n.onsuccess=()=>e(n.result)}async function v(e){const t=await new Promise(((t,c)=>{const d=indexedDB.open(e,1);p[e]=d,d.onupgradeneeded=e=>{e.oldVersion<1&&function(e){function t(t,n,o){const i=n?e.createObjectStore(t,{keyPath:n}):e.createObjectStore(t);if(o)for(const[e,[r,a]]of Object.entries(o))i.createIndex(e,r,{multiEntry:a});return i}t(o),t(n,"unicode",{[r]:["tokens",!0],[s]:[["group","order"]],[f]:["skinUnicodes",!0]}),t(i,void 0,{[a]:[""]})}(d.result)},k(t,c,d)}));return t.onclose=()=>w(e),t}function y(e,t,n,o){return new Promise(((i,r)=>{const a=e.transaction(t,n,{durability:"relaxed"}),s="string"==typeof t?a.objectStore(t):t.map((e=>a.objectStore(e)));let c;o(s,a,(e=>{c=e})),a.oncomplete=()=>i(c),a.onerror=()=>r(a.error)}))}function w(e){const t=p[e],n=t&&t.result;if(n){n.close();const t=b[e];if(t)for(const e of t)e()}delete p[e],delete g[e],delete b[e]}const j=new Set([":D","XD",":'D","O:)",":X",":P",";P","XP",":L",":Z",":j","8D","XO","8)",":B",":O",":S",":'o","Dx","X(","D:",":C",">0)",":3","!e.match(/\w/)||j.has(e)?e.toLowerCase():e.replace(/[)(:,]/g,"").replace(/’/g,"'").toLowerCase())).filter(Boolean)}function S(e){return e.filter(Boolean).map((e=>e.toLowerCase())).filter((e=>e.length>=2))}function T(e,t,n,o){e[t](n).onsuccess=e=>o&&o(e.target.result)}function x(e,t,n){T(e,"get",t,n)}function $(e,t,n){T(e,"getAll",t,n)}function C(e){e.commit&&e.commit()}function _(e,t){const n=function(e,t){let n=e[0];for(let o=1;ot(i)&&(n=i)}return n}(e,(e=>e.length)),o=[];for(const i of n)e.some((e=>-1===e.findIndex((e=>t(e)===t(i)))))||o.push(i);return o}async function L(e,t,i,r){try{const a=function(e){return e.map((({annotation:e,emoticon:t,group:n,order:o,shortcodes:i,skins:r,tags:a,emoji:s,version:c})=>{const d={annotation:e,group:n,order:o,tags:a,tokens:[...new Set(S([...(i||[]).map(E).flat(),...(a||[]).map(E).flat(),...E(e),t]))].sort(),unicode:s,version:c};if(t&&(d.emoticon=t),i&&(d.shortcodes=i),r){d.skinTones=[],d.skinUnicodes=[],d.skinVersions=[];for(const{tone:e,emoji:t,version:n}of r)d.skinTones.push(e),d.skinUnicodes.push(t),d.skinVersions.push(n)}return d}))}(t);await y(e,[n,o],m,(([e,t],n)=>{let o,s,u=0;function l(){2===++u&&function(){if(o===r&&s===i)return;e.clear();for(const t of a)e.put(t);t.put(r,c),t.put(i,d),C(n)}()}x(t,c,(e=>{o=e,l()})),x(t,d,(e=>{s=e,l()}))}))}finally{}}async function I(e,t){const o=S(E(t));return o.length?y(e,n,l,((e,t,n)=>{const i=[],a=()=>{const e=_(i,(e=>e.unicode));n(e.sort(((e,t)=>e.order{i.push(e),i.length===o.length&&a()}))}})):[]}async function z(e,t){const o=await I(e,t);if(!o.length){const o=e=>(e.shortcodes||[]).includes(t.toLowerCase());return await async function(e,t){return y(e,n,l,((e,n,o)=>{let i;const r=()=>{e.getAll(i&&IDBKeyRange.lowerBound(i,!0),50).onsuccess=e=>{const n=e.target.result;for(const r of n)if(i=r.unicode,t(r))return o(r);if(n.length<50)return o();r()}};r()}))}(e,o)||null}return o.filter((e=>(e.shortcodes||[]).map((e=>e.toLowerCase())).includes(t.toLowerCase())))[0]||null}function M(e,t,n){return y(e,t,l,((e,t,o)=>x(e,n,o)))}const P=["name","url"];function A(e){!function(e){const t=e&&Array.isArray(e),n=t&&e.length&&(!e[0]||P.some((t=>!(t in e[0]))));if(!t||n)throw new Error("Custom emojis are in the wrong format")}(e);const t=(e,t)=>e.name.toLowerCase(){let o=n;for(let n=0;ne[0]{const t=new Set;if(e.shortcodes)for(const n of e.shortcodes)for(const e of E(n))t.add(e);return t})),i=e=>o(e,!0),r=e=>o(e,!1),a=new Map,s=new Map;for(const c of e){s.set(c.name.toLowerCase(),c);for(const e of c.shortcodes||[])a.set(e.toLowerCase(),c)}return{all:n,search:e=>{const n=E(e);return _(n.map(((e,t)=>(te.name)).sort(t)},byShortcode:e=>a.get(e.toLowerCase()),byName:e=>s.get(e.toLowerCase())}}const B="undefined"!=typeof wrappedJSObject;function O(e){if(!e)return e;if(B&&(e=structuredClone(e)),delete e.tokens,e.skinTones){const t=e.skinTones.length;e.skins=Array(t);for(let n=0;n!(t in e[0]))))throw new Error("Emoji data is in the wrong format")}(o),[n,o]}async function W(e){let t=function(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),i=-1;++iM(e,o,t))));return i===n&&r===t}(e,t,i));else{if(!n){n=(await U(t))[1]}await L(e,n,t,i)}}class V{constructor({dataSource:e="https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",locale:t="en",customEmoji:n=[]}={}){this.dataSource=e,this.locale=t,this._dbName=`emoji-picker-element-${this.locale}`,this._db=void 0,this._lazyUpdate=void 0,this._custom=A(n),this._clear=this._clear.bind(this),this._ready=this._init()}async _init(){const e=this._db=await(t=this._dbName,g[t]||(g[t]=v(t)),g[t]);var t;!function(e,t){let n=b[e];n||(n=b[e]=[]),n.push(t)}(this._dbName,this._clear);const n=this.dataSource,i=await async function(e){return!(await M(e,o,d))}(e);i?await async function(e,t){let[n,o]=await U(t);n||(n=await W(o)),await L(e,o,t,n)}(e,n):this._lazyUpdate=async function(e,t){try{await G(e,t)}catch(n){if("InvalidStateError"!==n.name)throw n}}(e,n)}async ready(){const e=async()=>(this._ready||(this._ready=this._init()),this._ready);await e(),this._db||await e()}async getEmojiByGroup(e){return t(e),await this.ready(),h(await async function(e,t){return y(e,n,l,((e,n,o)=>{const i=IDBKeyRange.bound([t,0],[t+1,0],!1,!0);$(e.index(s),i,o)}))}(this._db,e)).map(O)}async getEmojiBySearchQuery(t){e(t),await this.ready();return[...this._custom.search(t),...h(await I(this._db,t)).map(O)]}async getEmojiByShortcode(t){e(t),await this.ready();const n=this._custom.byShortcode(t);return n||O(await z(this._db,t))}async getEmojiByUnicodeOrName(t){e(t),await this.ready();const o=this._custom.byName(t);return o||O(await async function(e,t){return y(e,n,l,((e,n,o)=>x(e,t,(n=>{if(n)return o(n);x(e.index(f),t,(e=>o(e||null)))}))))}(this._db,t))}async getPreferredSkinTone(){return await this.ready(),await M(this._db,o,u)||0}async setPreferredSkinTone(e){return t(e),await this.ready(),n=this._db,i=u,r=e,y(n,o,m,((e,t)=>{e.put(r,i),C(t)}));var n,i,r}async incrementFavoriteEmojiCount(t){return e(t),await this.ready(),n=this._db,o=t,y(n,i,m,((e,t)=>x(e,o,(n=>{e.put((n||0)+1,o),C(t)}))));var n,o}async getTopFavoriteEmoji(e){return t(e),await this.ready(),(await function(e,t,o){return 0===o?[]:y(e,[i,n],l,(([e,n],i,r)=>{const s=[];e.index(a).openCursor(void 0,"prev").onsuccess=e=>{const i=e.target.result;if(!i)return r(s);function a(e){if(s.push(e),s.length===o)return r(s);i.continue()}const c=i.primaryKey,d=t.byName(c);if(d)return a(d);x(n,c,(e=>{if(e)return a(e);i.continue()}))}}))}(this._db,this._custom,e)).map(O)}set customEmoji(e){this._custom=A(e)}get customEmoji(){return this._custom.all}async _shutdown(){await this.ready();try{await this._lazyUpdate}catch(e){}}_clear(){this._db=this._ready=this._lazyUpdate=void 0}async close(){await this._shutdown(),await w(this._dbName)}async delete(){var e;await this._shutdown(),await(e=this._dbName,new Promise(((t,n)=>{w(e),k(t,n,indexedDB.deleteDatabase(e))})))}}const R=[[-1,"✨","custom"],[0,"😀","smileys-emotion"],[1,"👋","people-body"],[3,"🐱","animals-nature"],[4,"🍎","food-drink"],[5,"🏠️","travel-places"],[6,"⚽","activities"],[7,"📝","objects"],[8,"⛔️","symbols"],[9,"🏁","flags"]].map((([e,t,n])=>({id:e,emoji:t,name:n}))),K=R.slice(1),H="function"==typeof requestIdleCallback?requestIdleCallback:setTimeout;function q(e){return e.unicode.includes("‍")}const X={"🫩":16,"🫨":15.1,"🫠":14,"🥲":13.1,"🥻":12.1,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6},J=["😊","😒","❤️","👍️","😍","😂","😭","☺️","😔","😩","😏","💕","🙌","😘"],Q='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',Y=(e,t)=>et?1:0,Z=(e,t)=>{const n=document.createElement("canvas");n.width=n.height=1;const o=n.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font=`100px ${Q}`,o.fillStyle=t,o.scale(.01,.01),o.fillText(e,0,0),o.getImageData(0,0,1,1).data};function ee(e){const t=Z(e,"#000"),n=Z(e,"#fff");return t&&n&&((e,t)=>{const n=[...e].join(",");return n===[...t].join(",")&&!n.startsWith("0,0,0,")})(t,n)}let te;const ne=()=>(te||(te=new Promise((e=>H((()=>e(function(){const e=Object.entries(X);try{for(const[t,n]of e)if(ee(t))return n}catch(t){}return e[0][1]}())))))),te),oe=new Map;function ie(e){e.preventDefault(),e.stopPropagation()}function re(e,t,n){return(t+=e?-1:1)<0?t=n.length-1:t>=n.length&&(t=0),t}function ae(e,t){const n=new Set,o=[];for(const i of e){const e=t(i);n.has(e)||(n.add(e),o.push(i))}return o}const se=requestAnimationFrame;let ce,de="function"==typeof ResizeObserver;function ue(e){{const t=document.createRange();return t.selectNode(e.firstChild),t.getBoundingClientRect().width}}function le(e,t,n){let o=e.get(t);return o||(o=n(),e.set(t,o)),o}function me(e){return""+e}const fe=new WeakMap,he=new WeakMap,pe=Symbol("un-keyed"),ge="replaceChildren"in Element.prototype;function be(e,t){const{targetNode:n}=t;let{targetParentNode:o}=t,i=!1;o?i=function(e,t){let n=e.firstChild,o=0;for(;n;){if(t[o]!==n)return!0;n=n.nextSibling,o++}return o!==t.length}(o,e):(i=!0,t.targetNode=void 0,t.targetParentNode=o=n.parentNode),i&&function(e,t){ge?e.replaceChildren(...t):(e.innerHTML="",e.append(...t))}(o,e)}function ke(e){let t="",n=!1,o=!1,i=-1;const r=new Map,a=[];let s=0;for(let d=0,u=e.length;d":n=!1,o=!1;break;case"=":o=!0}}const l=le(r,a[a.length-1],(()=>[]));let m,f,h;if(o){const n=/(\S+)="?([^"=]*)$/.exec(c);m=n[1],f=n[2];const o=/^([^">]*)("?)/.exec(e[d+1]);h=o[1],t=t.slice(0,-1*n[0].length),s=o[0].length}else s=0;const p={attributeName:m,attributeValuePre:f,attributeValuePost:h,expressionIndex:d};l.push(p),n||o||(t+=" ")}const c=function(e){const t=document.createElement("template");return t.innerHTML=e,t}(t);return{template:c,elementsToBindings:r}}function ve(e,t,n){for(let o=0;oke(e))),o=t.cloneNode(!0).content.firstElementChild,i=function(e,t){const n=[];let o;if(1===t.size&&(o=t.get(0)))ve(o,e,n);else{const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let i=e,r=-1;do{const e=t.get(++r);e&&ve(e,i,n)}while(i=o.nextNode())}return n}(o,n);return function(e){return function(e,t){for(const n of t){const{targetNode:t,currentExpression:o,binding:{expressionIndex:i,attributeName:r,attributeValuePre:a,attributeValuePost:s}}=n,c=e[i];if(o!==c)if(n.currentExpression=c,r)if(null===c)t.removeAttribute(r);else{const e=a+me(c)+s;t.setAttribute(r,e)}else{let e;Array.isArray(c)?be(c,n):c instanceof Element?(e=c,t.replaceWith(e)):t.nodeValue=me(c),e&&(n.targetNode=e)}}}(e,i),o}}function we(e,t,n,o,i,r,a,s,c){const{labelWithSkin:d,titleForEmoji:u,unicodeWithSkin:l}=n,{html:m,map:f}=function(e){const t=le(he,e,(()=>new Map));let n=pe;return{map:function(e,t,o){return e.map(((e,i)=>{const r=n;n=o(e);try{return t(e,i)}finally{n=r}}))},html:function(e,...o){const i=le(t,e,(()=>new Map));return le(i,n,(()=>ye(e)))(o)}}}(t);function h(e,n,o){return f(e,((e,i)=>m``),(e=>`${o}-${e.id}`))}const p=m`
${t.i18n.searchDescription}
${t.i18n.skinToneDescription}
${f(t.skinTones,((e,n)=>m`
${e}
`),(e=>e))}
${f(t.currentEmojisWithCategories,((e,n)=>m`
${h(e.emojis,t.searchMode,"emo")}
`),(e=>e.category))}
`,g=(t,n)=>{for(const o of e.querySelectorAll(`[${t}]`))n(o,o.getAttribute(t))};if(c){e.appendChild(p);for(const e of["click","focusout","input","keydown","keyup"])g(`data-on-${e}`,((t,n)=>{t.addEventListener(e,o[n])}));g("data-ref",((e,t)=>{r[t]=e})),a.addEventListener("abort",(()=>{e.removeChild(p)}))}g("data-action",((e,t)=>{let n=s.get(t);n||s.set(t,n=new WeakSet),n.has(e)||(n.add(e),i[t](e))}))}const je="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e);function Ee(e,t,n){if(e.length!==t.length)return!1;for(let o=0;o{if(n)return;const e=[...i];i.clear();try{for(const t of e)t()}finally{r=!1,i.size&&(r=!0,je(a))}},s=new Proxy({},{get(e,n){if(t){let e=o.get(n);e||(e=new Set,o.set(n,e)),e.add(t)}return e[n]},set(e,t,n){if(e[t]!==n){e[t]=n;const s=o.get(t);if(s){for(const e of s)i.add(e);r||(r=!0,je(a))}}return!0}});return e.addEventListener("abort",(()=>{n=!0})),{state:s,createEffect:e=>{const n=()=>{const o=t;t=n;try{return e()}finally{t=o}};return n()}}}(i),s=new Map;xe(r,{skinToneEmoji:void 0,i18n:void 0,database:void 0,customEmoji:void 0,customCategorySorting:void 0,emojiVersion:void 0}),xe(r,t),xe(r,{initialLoad:!0,currentEmojis:[],currentEmojisWithCategories:[],rawSearchText:"",searchText:"",searchMode:!1,activeSearchItem:-1,message:void 0,skinTonePickerExpanded:!1,skinTonePickerExpandedAfterAnimation:!1,currentSkinTone:0,activeSkinTone:0,skinToneButtonText:void 0,pickerStyle:void 0,skinToneButtonLabel:"",skinTones:[],currentFavorites:[],defaultFavoriteEmojis:void 0,numColumns:8,isRtl:!1,currentGroupIndex:0,groups:K,databaseLoaded:!1,activeSearchItemId:void 0}),a((()=>{r.currentGroup!==r.groups[r.currentGroupIndex]&&(r.currentGroup=r.groups[r.currentGroupIndex])}));const c=t=>{e.getElementById(t).focus()},d=t=>e.getElementById(`emo-${t.id}`),u=(e,t)=>{n.rootElement.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))},l=(e,t)=>e.id===t.id,m=(e,t)=>{const{category:n,emojis:o}=e,{category:i,emojis:r}=t;return n===i&&Ee(o,r,l)},f=e=>{Ee(r.currentEmojis,e,l)||(r.currentEmojis=e)},h=e=>{r.searchMode!==e&&(r.searchMode=e)},p=(e,t)=>t&&e.skins&&e.skins[t]||e.unicode,g={labelWithSkin:(e,t)=>{return(n=[e.name||p(e,t),e.annotation,...e.shortcodes||Te].filter(Boolean),ae(n,(e=>e))).join(", ");var n},titleForEmoji:e=>e.annotation||(e.shortcodes||Te).join(", "),unicodeWithSkin:p},b={onClickSkinToneButton:function(e){r.skinTonePickerExpanded=!r.skinTonePickerExpanded,r.activeSkinTone=r.currentSkinTone,r.skinTonePickerExpanded&&(ie(e),se((()=>c("skintone-list"))))},onEmojiClick:async function(e){const{target:t}=e;if(!t.classList.contains("emoji"))return;ie(e);T(t.id.substring(4))},onNavClick:function(e){const{target:t}=e,o=t.closest(".nav-button");if(!o)return;const i=parseInt(o.dataset.groupId,10);n.searchElement.value="",r.rawSearchText="",r.searchText="",r.activeSearchItem=-1,r.currentGroupIndex=r.groups.findIndex((e=>e.id===i))},onNavKeydown:function(e){const{target:t,key:n}=e,o=t=>{t&&(ie(e),t.focus())};switch(n){case"ArrowLeft":return o(t.previousElementSibling);case"ArrowRight":return o(t.nextElementSibling);case"Home":return o(t.parentElement.firstElementChild);case"End":return o(t.parentElement.lastElementChild)}},onSearchKeydown:function(e){if(!r.searchMode||!r.currentEmojis.length)return;const t=t=>{ie(e),r.activeSearchItem=re(t,r.activeSearchItem,r.currentEmojis)};switch(e.key){case"ArrowDown":return t(!1);case"ArrowUp":return t(!0);case"Enter":if(-1!==r.activeSearchItem)return ie(e),T(r.currentEmojis[r.activeSearchItem].id);r.activeSearchItem=0}},onSkinToneOptionsClick:function(e){const{target:{id:t}}=e,n=t&&t.match(/^skintone-(\d)/);if(!n)return;ie(e);x(parseInt(n[1],10))},onSkinToneOptionsFocusOut:async function(e){const{relatedTarget:t}=e;t&&"skintone-list"===t.id||(r.skinTonePickerExpanded=!1)},onSkinToneOptionsKeydown:function(e){if(!r.skinTonePickerExpanded)return;const t=async t=>{ie(e),r.activeSkinTone=t};switch(e.key){case"ArrowUp":return t(re(!0,r.activeSkinTone,r.skinTones));case"ArrowDown":return t(re(!1,r.activeSkinTone,r.skinTones));case"Home":return t(0);case"End":return t(r.skinTones.length-1);case"Enter":return ie(e),x(r.activeSkinTone);case"Escape":return ie(e),r.skinTonePickerExpanded=!1,c("skintone-button")}},onSkinToneOptionsKeyup:function(e){if(!r.skinTonePickerExpanded)return;if(" "===e.key)return ie(e),x(r.activeSkinTone)},onSearchInput:function(e){r.rawSearchText=e.target.value}},k={calculateEmojiGridStyle:function(e){!function(e,t,n){let o;de?(o=new ResizeObserver(n),o.observe(e)):se(n),t.addEventListener("abort",(()=>{o&&o.disconnect()}))}(e,i,(()=>{{const e=getComputedStyle(n.rootElement),t=parseInt(e.getPropertyValue("--num-columns"),10),o="rtl"===e.getPropertyValue("direction");r.numColumns=t,r.isRtl=o}}))},updateOnIntersection:function(e){!function(e,t,n){{const o=e.closest(".tabpanel");let i=Se.get(o);i||(i=new IntersectionObserver(n,{root:o,rootMargin:"50% 0px 50% 0px",threshold:0}),Se.set(o,i),t.addEventListener("abort",(()=>{i.disconnect()}))),i.observe(e)}}(e,i,(e=>{for(const{target:t,isIntersecting:n}of e)t.classList.toggle("onscreen",n)}))}};let v=!0;function y(){const{customEmoji:e,database:t}=r,n=e||Te;t.customEmoji!==n&&(t.customEmoji=n)}a((()=>{we(e,r,g,b,k,n,i,s,v),v=!1})),r.emojiVersion||ne().then((e=>{e||(r.message=r.i18n.emojiUnsupportedMessage)})),a((()=>{r.database&&async function(){let e=!1;const t=setTimeout((()=>{e=!0,r.message=r.i18n.loadingMessage}),1e3);try{await r.database.ready(),r.databaseLoaded=!0}catch(n){console.error(n),r.message=r.i18n.networkErrorMessage}finally{clearTimeout(t),e&&(e=!1,r.message="")}}()})),a((()=>{r.pickerStyle=`\n --num-groups: ${r.groups.length}; \n --indicator-opacity: ${r.searchMode?0:1}; \n --num-skintones: 6;`})),a((()=>{r.customEmoji&&r.database&&y()})),a((()=>{r.customEmoji&&r.customEmoji.length?r.groups!==R&&(r.groups=R):r.groups!==K&&(r.currentGroupIndex&&r.currentGroupIndex--,r.groups=K)})),a((()=>{!async function(){r.databaseLoaded&&(r.currentSkinTone=await r.database.getPreferredSkinTone())}()})),a((()=>{r.skinTones=Array(6).fill().map(((e,t)=>function(e,t){if(0===t)return e;const n=e.indexOf("‍");return-1!==n?e.substring(0,n)+String.fromCodePoint(127995+t-1)+e.substring(n):(e.endsWith("️")&&(e=e.substring(0,e.length-1)),e+"\ud83c"+String.fromCodePoint(57339+t-1))}(r.skinToneEmoji,t)))})),a((()=>{r.skinToneButtonText=r.skinTones[r.currentSkinTone]})),a((()=>{r.skinToneButtonLabel=r.i18n.skinToneLabel.replace("{skinTone}",r.i18n.skinTones[r.currentSkinTone])})),a((()=>{r.databaseLoaded&&async function(){const{database:e}=r,t=(await Promise.all(J.map((t=>e.getEmojiByUnicodeOrName(t))))).filter(Boolean);r.defaultFavoriteEmojis=t}()})),a((()=>{r.databaseLoaded&&r.defaultFavoriteEmojis&&async function(){y();const{database:e,defaultFavoriteEmojis:t,numColumns:n}=r,o=await e.getTopFavoriteEmoji(n),i=await S(ae([...o,...t],(e=>e.unicode||e.name)).slice(0,n));r.currentFavorites=i}()})),a((()=>{!async function(){const{searchText:e,currentGroup:t,databaseLoaded:n,customEmoji:o}=r;if(n)if(e.length>=2){const t=await async function(e){return S(await E(await r.database.getEmojiBySearchQuery(e)))}(e);r.searchText===e&&(f(t),h(!0))}else{const{id:e}=t;if(-1!==e||o&&o.length){const t=await async function(e){const t=-1===e?r.customEmoji:await r.database.getEmojiByGroup(e);return S(await E(t))}(e);r.currentGroup.id===e&&(f(t),h(!1))}}else r.currentEmojis=[],r.searchMode=!1}()}));const w=()=>{se((()=>{var e;(e=n.tabpanelElement)&&(e.scrollTop=0)}))};function j(e){return!e.unicode||!q(e)||oe.get(e.unicode)}async function E(e){const t=r.emojiVersion||await ne();return e.filter((({version:e})=>!e||e<=t))}async function S(e){return function(e,t){const n=e=>{const n={};for(const o of e)"number"==typeof o.tone&&o.version<=t&&(n[o.tone]=o.unicode);return n};return e.map((({unicode:e,skins:t,shortcodes:o,url:i,name:r,category:a,annotation:s})=>({unicode:e,name:r,shortcodes:o,url:i,category:a,annotation:s,id:e||r,skins:t&&n(t)})))}(e,r.emojiVersion||await ne())}async function T(e){const t=await r.database.getEmojiByUnicodeOrName(e),n=[...r.currentEmojis,...r.currentFavorites].find((t=>t.id===e)),o=n.unicode&&p(n,r.currentSkinTone);await r.database.incrementFavoriteEmojiCount(e),u("emoji-click",{emoji:t,skinTone:r.currentSkinTone,...o&&{unicode:o},...n.name&&{name:n.name}})}function x(e){r.currentSkinTone=e,r.skinTonePickerExpanded=!1,c("skintone-button"),u("skin-tone-change",{skinTone:e}),r.database.setPreferredSkinTone(e)}return a((()=>{const{currentEmojis:e,emojiVersion:t}=r,o=e.filter((e=>e.unicode)).filter((e=>q(e)&&!oe.has(e.unicode)));if(!t&&o.length)f(e),se((()=>function(e){const t=function(e,t,n){let o=!0;for(const i of e){const e=n(i);if(!e)continue;const r=ue(e);void 0===ce&&(ce=ue(t));const a=r/1.8{})),a((()=>{(e=>{Ee(r.currentEmojisWithCategories,e,m)||(r.currentEmojisWithCategories=e)})(function(){const{searchMode:e,currentEmojis:t}=r;if(e)return[{category:"",emojis:t}];const n=new Map;for(const o of t){const e=o.category||"";let t=n.get(e);t||(t=[],n.set(e,t)),t.push(o)}return[...n.entries()].map((([e,t])=>({category:e,emojis:t}))).sort(((e,t)=>r.customCategorySorting(e.category,t.category)))}())})),a((()=>{r.activeSearchItemId=-1!==r.activeSearchItem&&r.currentEmojis[r.activeSearchItem].id})),a((()=>{const{rawSearchText:e}=r;H((()=>{r.searchText=(e||"").trim(),r.activeSearchItem=-1}))})),a((()=>{r.skinTonePickerExpanded?n.skinToneDropdown.addEventListener("transitionend",(()=>{r.skinTonePickerExpandedAfterAnimation=!0}),{once:!0}):r.skinTonePickerExpandedAfterAnimation=!1})),{$set(e){xe(r,e)},$destroy(){o.abort()}}}var Ce={categoriesLabel:"Categories",emojiUnsupportedMessage:"Your browser does not support color emoji.",favoritesLabel:"Favorites",loadingMessage:"Loading…",networkErrorMessage:"Could not load emoji.",regionLabel:"Emoji picker",searchDescription:"When search results are available, press up or down to select and enter to choose.",searchLabel:"Search",searchResultsLabel:"Search results",skinToneDescription:"When expanded, press up or down to select and enter to choose.",skinToneLabel:"Choose a skin tone (currently {skinTone})",skinTonesLabel:"Skin tones",skinTones:["Default","Light","Medium-Light","Medium","Medium-Dark","Dark"],categories:{custom:"Custom","smileys-emotion":"Smileys and emoticons","people-body":"People and body","animals-nature":"Animals and nature","food-drink":"Food and drink","travel-places":"Travel and places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"}};const _e=["customEmoji","customCategorySorting","database","dataSource","i18n","locale","skinToneEmoji","emojiVersion"],Le=`:host{--emoji-font-family:${Q}}`;class Ie extends HTMLElement{constructor(e){super(),this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=':host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:"";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}'+Le,this.shadowRoot.appendChild(t),this._ctx={locale:"en",dataSource:"https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json",skinToneEmoji:"🖐️",customCategorySorting:Y,customEmoji:null,i18n:Ce,emojiVersion:null,...e};for(const n of _e)"database"!==n&&Object.prototype.hasOwnProperty.call(this,n)&&(this._ctx[n]=this[n],delete this[n]);this._dbFlush()}connectedCallback(){this._cmp||(this._cmp=$e(this.shadowRoot,this._ctx))}disconnectedCallback(){je((()=>{if(!this.isConnected&&this._cmp){this._cmp.$destroy(),this._cmp=void 0;const{database:e}=this._ctx;e.close().catch((e=>console.error(e)))}}))}static get observedAttributes(){return["locale","data-source","skin-tone-emoji","emoji-version"]}attributeChangedCallback(e,t,n){this._set(e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase())),"emoji-version"===e?parseFloat(n):n)}_set(e,t){this._ctx[e]=t,this._cmp&&this._cmp.$set({[e]:t}),["locale","dataSource"].includes(e)&&this._dbFlush()}_dbCreate(){const{locale:e,dataSource:t,database:n}=this._ctx;n&&n.locale===e&&n.dataSource===t||this._set("database",new V({locale:e,dataSource:t}))}_dbFlush(){je((()=>this._dbCreate()))}}const ze={};for(const Me of _e)ze[Me]={get(){return"database"===Me&&this._dbCreate(),this._ctx[Me]},set(e){if("database"===Me)throw new Error("database is read-only");this._set(Me,e)}};Object.defineProperties(Ie.prototype,ze),customElements.get("emoji-picker")||customElements.define("emoji-picker",Ie); diff --git a/workers/public/assets/favicon-DhO2lYdT.svg b/workers/public/assets/favicon-DhO2lYdT.svg new file mode 100644 index 0000000..869047a --- /dev/null +++ b/workers/public/assets/favicon-DhO2lYdT.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/workers/public/assets/index-Cps9cQM-.js b/workers/public/assets/index-Cps9cQM-.js new file mode 100644 index 0000000..046ad11 --- /dev/null +++ b/workers/public/assets/index-Cps9cQM-.js @@ -0,0 +1 @@ +import{e,s as t,a as n,c as s}from"./crypto-libs-Biap7jvT.js";import{b as i}from"./vendor-Cez3xphJ.js";import"./emoji-libs-WM5lT91j.js";import{c as o,d as r}from"./avatar-libs-exuC_fCG.js";import{p as a}from"./vendor-deps-CUoVodhr.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}(),window.Buffer=i.Buffer;class c{constructor(t={},n={}){this.config={rsaPublic:t.rsaPublic||"",wsAddress:t.wsAddress||"",reconnectDelay:t.reconnectDelay||3e3,pingInterval:t.pingInterval||2e4,debug:t.debug||!1},this.callbacks={onServerClosed:n.onServerClosed||null,onServerSecured:n.onServerSecured||null,onClientSecured:n.onClientSecured||null,onClientList:n.onClientList||null,onClientMessage:n.onClientMessage||null},this.SERVER_KEY_STORAGE="nodecrypt_server_key";try{this.clientEc=new e.ec("curve25519")}catch(s){this.logEvent("constructor",s,"error")}this.serverKeys=null,this.serverShared=null,this.credentials=null,this.connection=null,this.reconnect=null,this.ping=null,this.channel={},this.setCredentials=this.setCredentials.bind(this),this.connect=this.connect.bind(this),this.destruct=this.destruct.bind(this),this.onOpen=this.onOpen.bind(this),this.onMessage=this.onMessage.bind(this),this.onError=this.onError.bind(this),this.onClose=this.onClose.bind(this),this.logEvent=this.logEvent.bind(this),this.isOpen=this.isOpen.bind(this),this.isClosed=this.isClosed.bind(this),this.startReconnect=this.startReconnect.bind(this),this.stopReconnect=this.stopReconnect.bind(this),this.startPing=this.startPing.bind(this),this.stopPing=this.stopPing.bind(this),this.disconnect=this.disconnect.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendChannelMessage=this.sendChannelMessage.bind(this),this.encryptServerMessage=this.encryptServerMessage.bind(this),this.decryptServerMessage=this.decryptServerMessage.bind(this),this.encryptClientMessage=this.encryptClientMessage.bind(this),this.decryptClientMessage=this.decryptClientMessage.bind(this)}setCredentials(e,n,s){this.logEvent("setCredentials");try{this.credentials={username:e,channel:t.sha256(n),password:t.sha256(s)}}catch(i){return this.logEvent("setCredentials",i,"error"),!1}return!0}connect(){if(!this.credentials)return!1;this.logEvent("connect",this.config.wsAddress),this.stopReconnect(),this.stopPing(),this.serverKeys=null,this.serverShared=null,this.channel={};try{this.connection=new WebSocket(this.config.wsAddress),this.connection.onopen=this.onOpen,this.connection.onmessage=this.onMessage,this.connection.onerror=this.onError,this.connection.onclose=this.onClose}catch(e){return this.logEvent("connect",e,"error"),!1}return!0}destruct(){this.logEvent("destruct"),this.stopReconnect(),this.stopPing(),this.reconnect=null,this.ping=null,this.config={rsaPublic:"",wsAddress:"",reconnectDelay:3e3,pingInterval:15e3,debug:!1},this.callbacks.onServerClosed=null,this.callbacks.onServerSecured=null,this.callbacks.onClientSecured=null,this.callbacks.onClientList=null,this.callbacks.onClientMessage=null,this.clientEc=null,this.serverKeys=null,this.serverShared=null,this.credentials=null,this.connection.onopen=null,this.connection.onmessage=null,this.connection.onerror=null,this.connection.onclose=null;try{this.connection.removeAllListeners()}catch(e){this.logEvent("destruct",e,"error")}try{this.connection.close()}catch(e){this.logEvent("destruct",e,"error")}return this.connection=null,this.channel={},!0}async onOpen(){this.logEvent("onOpen"),this.startPing();try{this.serverKeys=await crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-384"},!1,["deriveKey","deriveBits"]),this.serverShared=null,this.sendMessage(i.Buffer.from(await crypto.subtle.exportKey("raw",this.serverKeys.publicKey)).toString("hex"))}catch(e){this.logEvent("onOpen",e,"error")}}async onMessage(e){if(!e||!this.isString(e.data))return;if("pong"===e.data)return;this.logEvent("onMessage",e.data);try{const t=JSON.parse(e.data);if("server-key"===t.type){if(!(await this.handleServerKey(t.key)))return}}catch(n){}if(!this.serverShared){const t=e.data.split("|");if(!t[0]||!t[1])return;try{if(!0===await crypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},await crypto.subtle.importKey("spki",i.Buffer.from(this.config.rsaPublic,"base64"),{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]),i.Buffer.from(t[1],"base64"),i.Buffer.from(t[0],"hex"))&&(this.serverShared=i.Buffer.from(await crypto.subtle.deriveBits({name:"ECDH",namedCurve:"P-384",public:await crypto.subtle.importKey("raw",i.Buffer.from(t[0],"hex"),{name:"ECDH",namedCurve:"P-384"},!0,[])},this.serverKeys.privateKey,384)).slice(8,40),this.sendMessage(this.encryptServerMessage({a:"j",p:this.credentials.channel},this.serverShared)),this.callbacks.onServerSecured))try{this.callbacks.onServerSecured()}catch(s){this.logEvent("onMessage-server-secured-callback",s,"error")}}catch(s){this.logEvent("onMessage",s,"error")}return}const t=this.decryptServerMessage(e.data,this.serverShared);if(this.logEvent("onMessage-server-decrypted",t),this.isObject(t)&&this.isString(t.a))if("l"===t.a&&this.isArray(t.p)){try{for(const n in this.channel)t.p.indexOf(n)<0&&delete this.channel[n];let e={};for(const n of t.p)this.channel[n]||(this.channel[n]={username:null,keys:this.clientEc.genKeyPair(),shared:null},e[n]=this.channel[n].keys.getPublic("hex"));Object.keys(e).length>0&&this.sendMessage(this.encryptServerMessage({a:"w",p:e},this.serverShared))}catch(s){this.logEvent("onMessage-list",s,"error")}if(this.callbacks.onClientList){let e=[];for(const t in this.channel)this.channel[t].shared&&this.channel[t].username&&e.push({clientId:t,username:this.channel[t].username});try{this.callbacks.onClientList(e)}catch(s){this.logEvent("onMessage-client-list-callback",s,"error")}}}else if(this.isString(t.p)&&this.isString(t.c))if("c"!==t.a||this.channel[t.c]&&this.channel[t.c].shared){if("c"===t.a&&this.channel[t.c]&&this.channel[t.c].shared){const e=this.decryptClientMessage(t.p,this.channel[t.c].shared);if(this.logEvent("onMessage-client-decrypted",e),!this.isObject(e)||!this.isString(e.a))return;if("u"===e.a&&this.isString(e.p)&&e.p.match(/\S+/)&&!this.channel[t.c].username){if(this.channel[t.c].username=e.p.replace(/^\s+/,"").replace(/\s+$/,""),this.callbacks.onClientSecured)try{this.callbacks.onClientSecured({clientId:t.c,username:this.channel[t.c].username})}catch(s){this.logEvent("onMessage-client-secured-callback",s,"error")}return}if(!this.channel[t.c].username)return;if("m"===e.a&&this.isString(e.t)&&this.isString(e.d)){if(this.callbacks.onClientMessage)try{this.callbacks.onClientMessage({clientId:t.c,username:this.channel[t.c].username,type:e.t,data:e.d})}catch(s){this.logEvent("onMessage-client-message-callback",s,"error")}return}}}else try{this.channel[t.c]||(this.channel[t.c]={username:null,keys:this.clientEc.genKeyPair(),shared:null},this.sendMessage(this.encryptServerMessage({a:"c",p:this.channel[t.c].keys.getPublic("hex"),c:t.c},this.serverShared))),this.channel[t.c].shared=i.Buffer.from(this.xorHex(this.channel[t.c].keys.derive(this.clientEc.keyFromPublic(t.p,"hex").getPublic()).toString("hex").padEnd(64,"8").substr(0,64),this.credentials.password),"hex"),this.sendMessage(this.encryptServerMessage({a:"c",p:this.encryptClientMessage({a:"u",p:this.credentials.username},this.channel[t.c].shared),c:t.c},this.serverShared))}catch(s){this.logEvent("onMessage-client",s,"error")}}async onError(e){if(this.logEvent("onError",e,"error"),this.disconnect(),this.credentials&&this.startReconnect(),this.callbacks.onServerClosed)try{this.callbacks.onServerClosed()}catch(t){this.logEvent("onError-server-closed-callback",t,"error")}}async onClose(e){if(this.logEvent("onClose",e),this.disconnect(),this.credentials&&this.startReconnect(),this.callbacks.onServerClosed)try{this.callbacks.onServerClosed()}catch(t){this.logEvent("onClose-server-closed-callback",t,"error")}}logEvent(e,t,n){if(this.config.debug){const s=new Date,i=s.getFullYear()+"-"+("0"+(s.getMonth()+1)).slice(-2)+"-"+("0"+s.getDate()).slice(-2)+" "+("0"+s.getHours()).slice(-2)+":"+("0"+s.getMinutes()).slice(-2)+":"+("0"+s.getSeconds()).slice(-2);console.log("["+i+"]",n?n.toUpperCase():"INFO",e+(t?":":""),t||"")}}isOpen(){return!(!this.connection||!this.connection.readyState||this.connection.readyState!==WebSocket.OPEN)}isClosed(){return!this.connection||!this.connection.readyState||this.connection.readyState===WebSocket.CLOSED}startReconnect(){this.stopReconnect(),this.logEvent("startReconnect"),this.reconnect=setTimeout((()=>{this.reconnect=null,this.connect()}),this.config.reconnectDelay)}stopReconnect(){this.reconnect&&(this.logEvent("stopReconnect"),clearTimeout(this.reconnect),this.reconnect=null)}startPing(){this.stopPing(),this.logEvent("startPing"),this.ping=setInterval((()=>{this.sendMessage("ping")}),this.config.pingInterval)}stopPing(){this.ping&&(this.logEvent("stopPing"),clearInterval(this.ping),this.ping=null)}disconnect(){if(this.stopReconnect(),this.stopPing(),!this.isClosed())try{this.logEvent("disconnect"),this.connection.close()}catch(e){this.logEvent("disconnect",e,"error")}}sendMessage(e){try{if(this.isOpen())return this.connection.send(e),!0}catch(t){this.logEvent("sendMessage",t,"error")}return!1}sendChannelMessage(e,t){if(this.serverShared)try{let n={};for(const s in this.channel)if(this.channel[s].shared&&this.channel[s].username&&(n[s]=this.encryptClientMessage({a:"m",t:e,d:t},this.channel[s].shared),0===n[s].length))return!1;if(Object.keys(n).length>0){const e=this.encryptServerMessage({a:"w",p:n},this.serverShared);if(!this.isOpen()||0===e.length||e.length>8388608)return!1;this.connection.send(e)}return!0}catch(n){this.logEvent("sendChannelMessage",n,"error")}return!1}encryptServerMessage(e,t){let s="";try{(e=i.Buffer.from(JSON.stringify(e),"utf8")).length%16!=0&&(e=i.Buffer.from([...e,...i.Buffer.alloc(16-e.length%16)]));const o=i.Buffer.from(crypto.getRandomValues(new Uint8Array(16))),r=new n.ModeOfOperation.cbc(t,o);s=o.toString("base64")+"|"+i.Buffer.from(r.encrypt(e)).toString("base64")}catch(o){this.logEvent("encryptServerMessage",o,"error")}return s}decryptServerMessage(e,t){let s={};try{const o=e.split("|"),r=new n.ModeOfOperation.cbc(t,i.Buffer.from(o[0],"base64"));s=JSON.parse(i.Buffer.from(r.decrypt(i.Buffer.from(o[1],"base64"))).toString("utf8").replace(/\0+$/,""))}catch(o){this.logEvent("decryptServerMessage",o,"error")}return s}encryptClientMessage(e,t){let n="";try{(e=i.Buffer.from(JSON.stringify(e),"utf8")).length%16!=0&&(e=i.Buffer.from([...e,...i.Buffer.alloc(16-e.length%16)]));const o=i.Buffer.from(crypto.getRandomValues(new Uint8Array(12))),r=i.Buffer.from(crypto.getRandomValues(new Uint8Array(4))),a=new s(t,o,r.reduce(((e,t)=>e*t)));n=o.toString("base64")+"|"+r.toString("base64")+"|"+i.Buffer.from(a.encrypt(e)).toString("base64")}catch(o){this.logEvent("encryptClientMessage",o,"error")}return n}decryptClientMessage(e,t){let n={};try{const o=e.split("|"),r=new s(t,i.Buffer.from(o[0],"base64"),i.Buffer.from(o[1],"base64").reduce(((e,t)=>e*t)));n=JSON.parse(i.Buffer.from(r.decrypt(i.Buffer.from(o[2],"base64"))).toString("utf8").replace(/\0+$/,""))}catch(o){this.logEvent("decryptClientMessage",o,"error")}return n}xorHex(e,t){let n="",s=Math.min(e.length,t.length);for(let i=0;i{"class"===e||"className"===e?s.className=t:"style"===e&&"object"==typeof t?Object.assign(s.style,t):e.startsWith("on")&&"function"==typeof t?s.addEventListener(e.slice(2).toLowerCase(),t):s.setAttribute(e,t)})),"string"==typeof n?s.innerHTML=n:n instanceof Element&&s.appendChild(n),s}function h(e,t,n,s){const i="string"==typeof e?l(e):e;i&&i.addEventListener(t,n,s)}function p(e,...t){e.classList.add(...t)}function m(e,...t){e.classList.remove(...t)}async function g(e,t){const n=new Image;n.onload=function(){let e=n.naturalWidth,s=n.naturalHeight;if(e>1280||s>1280){const t=Math.min(1280/e,1280/s);e=Math.round(e*t),s=Math.round(s*t)}const i=u("canvas");i.width=e,i.height=s;let o;i.getContext("2d").drawImage(n,0,0,e,s),o=i.toDataURL("image/webp",.8),t(o)};const s=new FileReader;s.onload=function(e){n.src=e.target.result},s.readAsDataURL(e)}function f(e){return{tooLarge:"Image is too large (over 5MB)"}[e]}"undefined"!=typeof window&&(window.NodeCrypt=c);function v({btnSelector:e=".chat-emoji-btn",inputSelector:t=".input-message-input"}={}){const n=l(e),s=l(t);if(n&&s)try{let e=function(){o.style.display="block",o.offsetHeight,o.classList.add("show")},t=function(){o.classList.remove("show"),setTimeout((()=>{o.style.display="none"}),300)};(()=>{if(document.querySelector("#emoji-picker-styles"))return;const e=document.createElement("style");e.id="emoji-picker-styles",e.textContent='emoji-picker{--background:#fff;--border-color:rgba(0,0,0,0.1);--border-radius:10px;--emoji-padding:0.4rem;--category-emoji-size:1.2rem;--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;position:absolute;bottom:60px;left:22px;z-index:5;box-shadow:0 3px 12px rgba(0,0,0,0.15);width:320px;display:none;opacity:0;transform:translateY(-10px) scale(0.95);transition:opacity 0.3s ease,transform 0.3s ease}emoji-picker.show{opacity:1;transform:translateY(0) scale(1)}',document.head.appendChild(e)})();const i=l("emoji-picker",n.parentNode);i&&i.remove();const o=document.createElement("emoji-picker");o.style.display="none",n.parentNode.style.position="relative",n.parentNode.appendChild(o),o.addEventListener("emoji-click",(e=>{!function(e,t){if(e.focus(),document.getSelection&&window.getSelection){let e=window.getSelection();if(!e.rangeCount)return;let n=e.getRangeAt(0);n.deleteContents(),n.insertNode(document.createTextNode(t)),n.collapse(!1),e.removeAllRanges(),e.addRange(n)}else e.innerText+=t;e.dispatchEvent(new Event("input"))}(s,e.detail.unicode),t()})),h(n,"click",(n=>{n.stopPropagation(),"none"===o.style.display?e():t()})),h(document,"click",(e=>{o.contains(e.target)||e.target===n||t()})),console.log("Emoji picker initialized successfully")}catch(i){console.error("Failed to initialize emoji picker:",i)}}const y={notify:!1,sound:!1};function b(){let e=localStorage.getItem("settings");try{e=e?JSON.parse(e):{}}catch{e={}}return{...y,...e}}function w(e){const{notify:t,sound:n}=e;localStorage.setItem("settings",JSON.stringify({notify:t,sound:n}))}function S(e){document.documentElement.lang="en"}function C(){let e=d("settings-panel");e||(e=u("div",{id:"settings-panel",class:"settings-panel"},'
Settings
Desktop Notification
Sound Notification
'),document.body.appendChild(e));const t=b(),n=l("#settings-notify",e),s=l("#settings-sound",e);n&&(n.checked=!!t.notify),s&&(s.checked=!!t.sound),h(n,"change",(n=>{if(n.target.checked){if(!("Notification"in window))return alert("Notifications are not supported by your browser."),void(n.target.checked=!1);i=i=>{"granted"===i?(t.notify=!0,t.sound=!1,s&&(s.checked=!1),w(t),S(),e._notificationShown||(new Notification("Notifications enabled",{body:"You will receive alerts here."}),e._notificationShown=!0)):(t.notify=!1,n.target.checked=!1,w(t),S(),alert("Please allow notifications in your browser settings."))},0===Notification.requestPermission.length?Notification.requestPermission().then(i):Notification.requestPermission(i)}else t.notify=!1,w(t),S(),e._notificationShown&&(e._notificationShown=!1);var i})),h(s,"change",(e=>{t.sound=e.target.checked,t.sound&&(t.notify=!1,n&&(n.checked=!1)),w(t),S()}))}function E(e){return e.length>100?e.slice(0,100)+"...":e}const M=["f87171","fb923c","09acf4","fb923c","f472b6","a78bfa","34d399"];function k(e){let t=0;for(let n=0;n"']/g,(function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[e]}))}function I(e){if("string"!=typeof e)return"";const t=x(e).replace(/\n/g,"
");return a.sanitize(t,{ALLOWED_TAGS:["br"],ALLOWED_ATTR:[]})}function N(){const e=d("chat-area");e&&(z<0||!G[z]?e.innerHTML="":(e.innerHTML="",G[z].messages.forEach((e=>{"me"===e.type?T(e.text,!0,e.msgType||"text",e.timestamp):"system"===e.type?R(e.text,!0,e.timestamp):function(e,t="",n="",s=!1,i="text",o=null){if(!t&&z>=0){const n=G[z];n&&e&&e.clientId&&n.userMap[e.clientId]&&(t=n.userMap[e.clientId].userName||n.userMap[e.clientId].username||n.userMap[e.clientId].name||"Anonymous")}t=t||"Anonymous";let r=s?o:o||Date.now();!s&&z>=0&&G[z].messages.push({type:"other",text:e,userName:t,avatar:n,msgType:i,timestamp:r});if(!r)return;const a=d("chat-area");if(!a)return;const c=u("div",{class:"bubble-other-wrap"});let h="";if("image"===i||"image_private"===i){h=``}else h=I(e);const p=x(t),m=new Date(r),g=m.getHours().toString().padStart(2,"0")+":"+m.getMinutes().toString().padStart(2,"0");let f="bubble other";i&&i.includes("_private")&&(f+=" private-message");c.innerHTML=`
${p}
${h}${g}
`;const v=L(t),y=l(".avatar",c);if(y){const e=v.replace(/)<[^<]*)*<\/script>/gi,"");y.innerHTML=e}a.appendChild(c),a.scrollTop=a.scrollHeight}(e.text,e.userName,e.avatar,!0,e.msgType||"text",e.timestamp)}))))}function T(e,t=!1,n="text",s=null){let i=t?s:s||Date.now();if(!i)return;!t&&z>=0&&G[z].messages.push({type:"me",text:e,msgType:n,timestamp:i});const o=d("chat-area");if(!o)return;const r="bubble me"+(n.includes("_private")?" private-message":""),a=new Date(i),c=a.getHours().toString().padStart(2,"0")+":"+a.getMinutes().toString().padStart(2,"0");let l="";if("image"===n||"image_private"===n){l=``}else l=I(e);const h=u("div",{class:r},`${l}${c}`);o.appendChild(h),o.scrollTop=o.scrollHeight}function R(e,t=!1,n=null){if(!t&&z>=0){const t=n||Date.now();G[z].messages.push({type:"system",text:e,timestamp:t})}const s=d("chat-area");if(!s)return;const i=u("div",{class:"bubble system"},`${I(e)}`);s.appendChild(i),s.scrollTop=s.scrollHeight}function B(){const e=G[z],t=l(".chat-input-area"),n=l(".input-field-placeholder"),s=l(".input-message-input");if(!t||!n||!s)return;e&&e.privateChatTargetId?(p(t,"private-mode"),p(s,"private-mode"),n.textContent=`Private Message to ${x(e.privateChatTargetName)}`):(m(t,"private-mode"),m(s,"private-mode"),n.textContent="Message");const i=s.innerHTML.replace(/(\s*)?/gi,"").replace(/ /g,"").replace(/\u200B/g,"").trim();n.style.opacity=""===i?"1":"0"}function O(){h(d("chat-area"),"click",(function(e){const t=e.target;"IMG"===t.tagName&&t.closest(".bubble-content")&&function(e){const t=u("div",{class:"img-modal-bg"},`
×
`);document.body.appendChild(t),h(l(".img-modal-close",t),"click",(()=>t.remove())),h(t,"click",(e=>{e.target===t&&t.remove()}));const n=l("img",t);let s=1,i=!1,o=0,r=0,a=0,c=0;function d(){n.style.transform=`translate(${a}px,${c}px)scale(${s})`,n.style.cursor=s>1?i?"grabbing":"grab":"zoom-in"}function p(e){i&&(a+=e.clientX-o,c+=e.clientY-r,o=e.clientX,r=e.clientY,d())}function m(){i&&(i=!1,n.style.cursor="grab",document.body.style.userSelect="")}n.ondragstart=function(e){e.preventDefault()},h(n,"wheel",(function(e){e.preventDefault(),s+=e.deltaY<0?.1:-.1,s=Math.max(.2,Math.min(5,s)),1===s&&(a=0,c=0),d()})),h(n,"mousedown",(function(e){s<=1||(i=!0,o=e.clientX,r=e.clientY,n.style.cursor="grabbing",document.body.style.userSelect="none")})),h(window,"mousemove",p),h(window,"mouseup",m),h(n,"dblclick",(function(){s=1,a=0,c=0,d()}));const g=()=>{off(window,"mousemove",p),off(window,"mouseup",m),document.body.style.userSelect=""};h(t,"remove",g),h(l(".img-modal-close",t),"click",g),d()}(t.src)}))}function P(){const e=l(".input-message-input");e&&(e.style.height="auto",e.style.height=e.scrollHeight+"px")}function $(){const e=l(".input-message-input"),t=l(".input-field-placeholder");var n;e&&t&&(h(e,"input",s),h(e,"blur",s),h(e,"focus",s),(n=e)&&h(n,"paste",(function(e){e.preventDefault();let t="";if((e.clipboardData||window.clipboardData)&&(t=(e.clipboardData||window.clipboardData).getData("text/plain")),document.queryCommandSupported("insertText"))document.execCommand("insertText",!1,t);else{const e=window.getSelection();if(e.rangeCount){const n=e.getRangeAt(0);n.deleteContents();const s=document.createTextNode(t);n.insertNode(s),n.setStartAfter(s),n.setEndAfter(s),e.removeAllRanges(),e.addRange(n)}}})),s(),P(),B());function s(){const n=e.innerHTML.replace(/(\s*)?/gi,"").replace(/ /g,"").replace(/\u200B/g,"").trim();t.style.opacity=""===n?"1":"0",P()}}function A(){const e=G[z];let t=e?e.roomName:"Room",n=e&&e.userList?e.userList.length:0;e&&!e.userList.some((t=>t.clientId===e.myId))&&(n+=1);const s=x(t);d("main-header").innerHTML=`
#${s}
${n}members
Share
Quit
`,_(),function(){const e=document.getElementById("sidebar"),t=document.getElementById("rightbar"),n=document.getElementById("mobile-menu-btn"),s=document.getElementById("mobile-info-btn"),i=document.getElementById("mobile-sidebar-mask"),o=document.getElementById("mobile-rightbar-mask");function r(){return window.innerWidth<=768}function a(){r()?(n&&(n.style.display="flex"),s&&(s.style.display="flex")):(n&&(n.style.display="none"),s&&(s.style.display="none"),e&&e.classList.remove("mobile-open"),t&&t.classList.remove("mobile-open"),i&&i.classList.remove("active"),o&&o.classList.remove("active"))}a(),window.addEventListener("resize",a),n&&e&&i&&(n.onclick=function(t){t.stopPropagation(),e.classList.add("mobile-open"),i.classList.add("active")},i.onclick=function(){e.classList.remove("mobile-open"),i.classList.remove("active")});s&&t&&o&&(s.onclick=function(e){e.stopPropagation(),t.classList.add("mobile-open"),o.classList.add("active")},o.onclick=function(){t.classList.remove("mobile-open"),o.classList.remove("active")});document.addEventListener("click",(function(a){r()&&(e&&e.classList.contains("mobile-open")&&(e.contains(a.target)||a.target===n||(e.classList.remove("mobile-open"),i&&i.classList.remove("active"))),t&&t.classList.contains("mobile-open")&&(t.contains(a.target)||a.target===s||(t.classList.remove("mobile-open"),o&&o.classList.remove("active"))))}))}()}function j(e=!1){const t=d("member-list");if(!t)return;t.innerHTML="";const n=G[z];if(!n)return;const s=n.userList.find((e=>e.clientId===n.myId)),i=n.userList.filter((e=>e.clientId!==n.myId));s&&t.appendChild(H(s,!0)),i.forEach((e=>t.appendChild(H(e,!1)))),e&&A()}function H(e,t){const n=document.createElement("div"),s=G[z],i=s&&e.clientId===s.privateChatTargetId;n.className="member"+(t?" me":"")+(i?" private-chat-active":"");const o=e.userName||e.username||e.name||"",r=x(o);n.innerHTML=`
${r}${t?" (me)":""}
`;const a=n.querySelector(".avatar");if(a){const e=L(o).replace(/)<[^<]*)*<\/script>/gi,"");a.innerHTML=e}return t||(n.onclick=()=>function(e,t){const n=G[z];if(!n)return;n.privateChatTargetId===e?(n.privateChatTargetId=null,n.privateChatTargetName=null):(n.privateChatTargetId=e,n.privateChatTargetName=t);j(),B()}(e.clientId,r)),n}function _(){const e=d("more-btn"),t=d("more-menu");if(!e||!t)return;let n=!1;function s(){n||(n=!0,t.classList.remove("open"),t.classList.add("close"),setTimeout((()=>{t.classList.contains("close")&&(t.style.display="none"),n=!1}),300))}e.onclick=function(e){e.stopPropagation(),t.classList.contains("open")?s():(t.style.display="block",t.classList.remove("close"),t.offsetHeight,t.classList.add("open"))},t.onclick=function(e){if(e.target.classList.contains("more-menu-item"))if("share"===e.target.dataset.action){if(z>=0&&G[z]){const e=G[z],t=encodeURIComponent(e.roomName||""),n=encodeURIComponent(e.password||""),s=`${location.origin}${location.pathname}?node=${t}&pwd=${n}`;navigator.clipboard?navigator.clipboard.writeText(s).then((()=>{window.addSystemMsg("Share link copied!")}),(()=>{prompt("Copy failed, url:",s)})):prompt("Copy failed, url:",s)}s()}else if("exit"===e.target.dataset.action){(function(){if(z>=0&&G[z]){const e=G[z].chat;return e&&"function"==typeof e.destruct?e.destruct():e&&"function"==typeof e.disconnect&&e.disconnect(),G[z].chat=null,G.splice(z,1),G.length>0&&(W(0),!0)}return!1})()||location.reload(),s()}},document.addEventListener("click",(function(n){t.contains(n.target)||n.target===e||s()})),t.addEventListener("animationend",(function(e){n=!1})),t.addEventListener("transitionend",(function(e){n=!1}))}function D(e){e&&(e.addEventListener("keydown",(function(e){(" "===e.key||/[\u0000-\u007f]/.test(e.key)&&/[\p{P}\p{S}]/u.test(e.key)&&"'"!==e.key)&&e.preventDefault()})),e.addEventListener("input",(function(t){e.value=e.value.replace(/[\s\p{P}\p{S}]/gu,(function(e){return"'"===e?"'":""}))})))}function K(e){return function(t){let n,s,i,o,r,a;t.preventDefault(),e?(n=document.getElementById("userName-modal").value.trim(),s=document.getElementById("roomName-modal").value.trim(),i=document.getElementById("password-modal").value.trim(),o=e.querySelector(".login-btn"),r=document.getElementById("roomName-modal")):(n=document.getElementById("userName").value.trim(),s=document.getElementById("roomName").value.trim(),i=document.getElementById("password").value.trim(),o=document.querySelector("#login-form .login-btn"),r=document.getElementById("roomName"));const c=G.some((e=>e.roomName&&e.roomName.toLowerCase()===s.toLowerCase()));if(r&&(r.style.border="",r.style.background="",r._warnTip&&(r.parentNode.removeChild(r._warnTip),r._warnTip=null)),c)return r&&(r.style.border="1.5px solid #e74c3c",r.style.background="#fff6f6",a=document.createElement("div"),a.style.color="#e74c3c",a.style.fontSize="13px",a.style.marginTop="4px",a.textContent="Node already exists",r.parentNode.appendChild(a),r._warnTip=a,r.focus()),void(o&&(o.disabled=!1,o.innerText="ENTER"));o&&(o.disabled=!0,o.innerText="Connecting..."),window.joinRoom(n,s,i,e,(function(e){!e&&o&&(o.disabled=!1,o.innerText="ENTER")}))}}function U(e=!1){const t=e?"-modal":"";return`\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t\n\t\t
\n\t\t\n\t`}function V(){const e=document.createElement("div");e.className="login-modal",e.innerHTML=``,document.body.appendChild(e),e.querySelector(".login-modal-close").onclick=()=>e.remove(),D(e.querySelector("#userName-modal")),D(e.querySelector("#roomName-modal")),D(e.querySelector("#password-modal"));e.querySelector("#login-form-modal").addEventListener("submit",K(e)),q("userName-modal")}function q(e=""){const t=new URLSearchParams(window.location.search),n=t.get("node"),s=t.get("pwd");if(n){const t=document.getElementById(e+"roomName");t&&(t.value=decodeURIComponent(n),t.readOnly=!0,t.style.background="#f5f5f5")}if(s){const t=document.getElementById(e+"password");t&&(t.value=decodeURIComponent(s),t.readOnly=!0,t.style.background="#f5f5f5")}(n||s)&&window.history.replaceState({},"",location.pathname)}let G=[],z=-1;function W(e){if(e<0||e>=G.length)return;z=e;const t=G[e];"number"==typeof t.unreadCount&&(t.unreadCount=0);const n=document.getElementById("sidebar-username");n&&(n.textContent=t.myUserName),Y(t.myUserName),Z(e),A(),j(!1),N(),B()}function Y(e){if(!e)return;const t=L(e),n=d("sidebar-user-avatar");if(n){const e=t.replace(/)<[^<]*)*<\/script>/gi,"");n.innerHTML=e}}function Z(e=0){const t=d("room-list");t.innerHTML="",G.forEach(((n,s)=>{const i=u("div",{class:"room"+(s===e?" active":""),onclick:()=>W(s)}),o=x(n.roomName);let r="";n.unreadCount&&s!==e&&(r=`${n.unreadCount>99?"99+":n.unreadCount}`),i.innerHTML=`
#${o}
${r}`,t.appendChild(i)}))}function F(e,t){const n=G[e];if(!n)return;n.privateChatTargetId===t&&(n.privateChatTargetId=null,n.privateChatTargetName=null,z===e&&B());const s=n.userMap[t],i=`${s&&(s.userName||s.username||s.name)||"Anonymous"}left`;n.messages.push({type:"system",text:i}),z===e&&R(i,!0),n.userList=n.userList.filter((e=>e.clientId!==t)),delete n.userMap[t],z===e&&(j(!1),A())}function J(e){let t=d("status-bar");t||(t=u("div",{id:"status-bar",style:"color:green;padding:4px 10px;font-size:13px;"}),document.body.appendChild(t)),t.innerText=e}window.config={wsAddress:`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}`,debug:!0},window.addSystemMsg=R,window.joinRoom=function(e,t,n,s=null,i){const o={roomName:"",userList:[],userMap:{},myId:null,myUserName:"",chat:null,messages:[],prevUserList:[],knownUserIds:new Set,unreadCount:0,privateChatTargetId:null,privateChatTargetName:null};o.roomName=t,o.myUserName=e,o.password=n,G.push(o);const r=G.length-1;W(r);const a=d("sidebar-username");a&&(a.textContent=e),Y(e);let c=!1;const l={onServerClosed:()=>{J("Node connection closed"),i&&!c&&(c=!0,i(!1))},onServerSecured:()=>{if(J("Secure connection to node"),s)s.remove();else{const e=d("login-container");e&&(e.style.display="none");const t=d("chat-container");t&&(t.style.display="")}i&&!c&&(c=!0,i(!0)),R("Server connection secured")},onClientSecured:e=>function(e,t){const n=G[e];if(!n)return;n.userMap[t.clientId]=t;const s=n.userList.findIndex((e=>e.clientId===t.clientId));-1===s?n.userList.push(t):n.userList[s]=t;z===e&&(j(!1),A());if(!n.isInitialized)return;const i=!n.knownUserIds.has(t.clientId);if(i){n.knownUserIds.add(t.clientId);const s=`${t.userName||t.username||t.name||"Anonymous"}joined`;n.messages.push({type:"system",text:s}),z===e&&R(s,!0),window.notifyMessage&&window.notifyMessage(n.roomName,"system",s)}}(r,e),onClientList:(e,t)=>function(e,t,n){const s=G[e];if(!s)return;const i=new Set((s.userList||[]).map((e=>e.clientId))),o=new Set(t.map((e=>e.clientId)));for(const r of i)o.has(r)||F(e,r);s.userList=t,s.userMap={},t.forEach((e=>{s.userMap[e.clientId]=e})),s.myId=n,z===e&&(j(!1),A());s.initCount=(s.initCount||0)+1,2===s.initCount&&(s.isInitialized=!0,s.knownUserIds=new Set(t.map((e=>e.clientId))))}(r,e,t),onClientLeft:e=>F(r,e),onClientMessage:e=>function(e,t){const n=G[e];if(!n)return;if(t.userName===n.myUserName&&!t.type.includes("_private")){const s=G[e];if(s&&t.clientId===s.myId&&t.type.includes("_private"));else if(t.clientId===n.myId)return}let s=t.type||"text";!s.includes("_private")&&t.data&&t.data.startsWith("data:image/")&&(s="image");let i=t.userName;!i&&t.clientId&&n.userMap[t.clientId]&&(i=n.userMap[t.clientId].userName||n.userMap[t.clientId].username||n.userMap[t.clientId].name);G[e].messages.push({type:"other",text:t.data,userName:i,avatar:i,msgType:s,timestamp:Date.now()});const o=s.includes("_private")?`private ${s.split("_")[0]}`:s;window.notifyMessage&&window.notifyMessage(n.roomName,o,t.data,i);z!==e?(G[e].unreadCount=(G[e].unreadCount||0)+1,Z(z)):N()}(r,e)},u=new window.NodeCrypt(window.config,l);u.setCredentials(e,t,n),u.connect(),G[r].chat=u},window.notifyMessage=function(e,t,n,s){const i=b();i.notify?function(e,t,n,s){if(!("Notification"in window)||"granted"!==Notification.permission)return;let i;const o=s?`${s}:`:"";"image"===n||"private image"===n?(i=`${o}[image]`,"private image"===n&&(i=`(Private)${i}`)):"text"===n||"private text"===n?(i=`${o}${E(t)}`,"private text"===n&&(i=`(Private)${i}`)):i=E(t),new Notification(`#${e}`,{body:i})}(e,n,t,s):i.sound&&function(){try{const e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.frequency.value=1e3,t.connect(n),n.connect(e.destination),t.start(),n.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+.5),setTimeout((()=>{t.stop(),e.close()}),600)}catch(e){console.error("Sound notification failed",e)}}()},window.setupEmojiPicker=v,window.addEventListener("DOMContentLoaded",(()=>{!function(){const e=document.getElementById("login-form");e&&(e.innerHTML=U(!1))}();const e=d("login-form");e&&e.addEventListener("submit",K(null));const t=l(".join-room");t&&(t.onclick=V),D(d("userName")),D(d("roomName")),D(d("password")),q(),$(),_(),O(),v(),b(),S();const n=d("settings-btn");n&&(n.onclick=e=>{e.stopPropagation(),function(){C();const e=d("settings-panel"),t=d("settings-btn");if(!t||!e)return;if("block"===e.style.display)return;const n=t.getBoundingClientRect();e.style.display="block";const s=l(".settings-panel-card",e);s&&(s.style.position="fixed",s.style.left=n.left+"px",s.style.top=n.bottom+8+"px",s.style.transform="translateX(0)",m(s,"close-anim"),s.offsetHeight,p(s,"open-anim"))}()}),document.addEventListener("click",(e=>{const t=d("settings-panel");if(t&&"block"===t.style.display){const n=t.querySelector(".settings-panel-card");n&&!n.contains(e.target)&&"settings-btn"!==e.target.id&&function(){const e=d("settings-panel");if(!e)return;const t=l(".settings-panel-card",e);t&&(m(t,"open-anim"),p(t,"close-anim"),setTimeout((()=>{e.style.display="none",m(t,"close-anim")}),300))}()}}));const s=document.querySelector(".input-message-input");s&&(s.focus(),s.addEventListener("keydown",(e=>{if("Enter"===e.key&&!e.shiftKey){e.preventDefault();const t=s.innerText.trim(),n=G[z];if(t&&n&&n.chat){if(n.privateChatTargetId){const e=n.chat.channel[n.privateChatTargetId];if(e&&e.shared){const s={a:"m",t:"text_private",d:t},i={a:"c",p:n.chat.encryptClientMessage(s,e.shared),c:n.privateChatTargetId},o=n.chat.encryptServerMessage(i,n.chat.serverShared);n.chat.sendMessage(o),T(t,!1,"text_private")}else R(`Cannot send private message to ${n.privateChatTargetName}.User might not be fully connected.`)}else n.chat.sendChannelMessage("text",t),T(t);s.innerText="",s.dispatchEvent(new Event("input"))}}}))),function({inputSelector:e,attachBtnSelector:t,fileInputSelector:n,onSend:s}){const i=l(e),o=l(t),r=l(n);r&&r.setAttribute("accept","image/*"),o&&r&&(h(o,"click",(()=>r.click())),h(r,"change",(async function(){if(!r.files||!r.files.length)return;const e=r.files[0];e.type.startsWith("image/")&&(e.size>5242880?alert(f("tooLarge")):(g(e,(e=>{"function"==typeof s&&s(e)})),r.value=""))}))),i&&h(i,"paste",(function(e){if(e.clipboardData)for(const t of e.clipboardData.items)if(t.type.startsWith("image/")){const n=t.getAsFile();if(!n)continue;if(n.size>5242880){alert(f("tooLarge"));continue}g(n,(e=>{"function"==typeof s&&s(e)})),e.preventDefault();break}}))}({inputSelector:".input-message-input",attachBtnSelector:".chat-attach-btn",fileInputSelector:'.new-message-wrapper input[type="file"]',onSend:e=>{const t=G[z];if(t&&t.chat)if(t.privateChatTargetId){const n=t.chat.channel[t.privateChatTargetId];if(n&&n.shared){const s={a:"m",t:"image_private",d:e},i={a:"c",p:t.chat.encryptClientMessage(s,n.shared),c:t.privateChatTargetId},o=t.chat.encryptServerMessage(i,t.chat.serverShared);t.chat.sendMessage(o),T(e,!1,"image_private")}else R(`Cannot send private image to ${t.privateChatTargetName}.User might not be fully connected.`)}else t.chat.sendChannelMessage("image",e),T(e,!1,"image")}});const i=()=>window.innerWidth<=768;A(),j(),function(){const e=document.getElementById("member-tabs").children;for(let t=0;t{i()&&(null==r||r.classList.remove("mobile-open"),null==c||c.classList.remove("active"))}));const y=d("member-tabs");y&&y.addEventListener("click",(()=>{i()&&(m(a,"mobile-open"),m(u,"active"))}))})); diff --git a/workers/public/assets/index-D3uwBhG0.css b/workers/public/assets/index-D3uwBhG0.css new file mode 100644 index 0000000..b74b05d --- /dev/null +++ b/workers/public/assets/index-D3uwBhG0.css @@ -0,0 +1 @@ +body{margin:0;font-family:Roboto,Arial,sans-serif;height:100vh;overflow:hidden;background:#fff}.container{display:flex;height:100vh;background:#fff}.sidebar{width:250px;background:#fff;border-right:1px solid #e0e0e0;display:flex;flex-direction:column;box-shadow:2px 0 8px #e0e0e0a0;transition:width .3s ease}.sidebar-user{display:flex;align-items:center;padding:17.2px 18px 10px 17px;background:#fff;border-bottom:1px solid #dcdcdc;position:relative}.settings-btn{margin-left:auto;background:none;border:none;cursor:pointer;padding:4px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease}.settings-btn:hover{background:#f5f5f5}.settings-btn svg{display:block}.settings-panel{display:none;position:fixed;left:0;top:0;right:0;bottom:0;z-index:9999;pointer-events:none;background:none}.settings-panel-card{background:#fff;border-radius:16px;box-shadow:0 2px 24px #3c50642e;padding:15px;min-width:210px;position:absolute;display:flex;flex-direction:column;gap:10px;pointer-events:auto;opacity:0;transform:translateY(-10px) scale(.95);transition:opacity .3s ease,transform .3s ease}.settings-panel-card.open-anim{opacity:1;transform:translateY(0) scale(1)}.settings-panel-card.close-anim{opacity:0;transform:translateY(-10px) scale(.95)}.settings-title{font-size:1.3rem;font-weight:600;margin-bottom:10px;color:#30a8f7;text-align:left}.settings-item{display:flex;align-items:center;justify-content:space-between;font-size:1.08rem;color:#222;margin-bottom:8px}.settings-item select{font-size:1rem;border-radius:8px;border:1px solid #e0e0e0;padding:4px 10px;background:#fafbfc;outline:none;transition:border-color .2s ease,background-color .2s ease}.settings-item select:focus{border-color:#30a8f7;background:#fff}.switch{position:relative;display:inline-block;width:38px;height:22px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:#e0e0e0;border-radius:22px;transition:background-color .3s ease}.slider:before{position:absolute;content:"";height:16px;width:16px;left:3px;bottom:3px;background:#fff;border-radius:50%;box-shadow:0 1px 4px #0001;transition:transform .3s ease}.switch input:checked+.slider{background:#30a8f7}.switch input:checked+.slider:before{transform:translate(16px)}.settings-close{position:absolute;right:18px;top:14px;background:none;border:none;font-size:1.7rem;color:#888;cursor:pointer;z-index:3;line-height:1;border-radius:50%;transition:background-color .2s ease,color .2s ease}.settings-close:hover{background:#f5f5f5;color:#30a8f7}.sidebar .join-room{display:flex;align-items:center;justify-content:flex-start;padding:18px 0;background:#fff;border-bottom:1px solid #e0e0e0;font-size:1.13rem;font-weight:600;letter-spacing:1px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .2s ease}.sidebar .join-room input,.sidebar .join-room .menu-icon{display:none!important}.sidebar .join-room:hover{background:#f5f5f5}.sidebar .rooms{flex:1;overflow-y:auto;background:#fff}.room{display:flex;align-items:center;padding:20px 15px;border-bottom:2px solid #ededed3b;cursor:pointer;background:#fff;border-radius:10px;margin:6px 8px;box-sizing:border-box;position:relative;box-shadow:none;transition:background-color .2s ease,box-shadow .2s ease}.room.active,.room.active:hover{background:#7bc0ff}.room:hover:not(.active){background:#f5f5f5}.room .info{flex:1}.room .title{font-weight:500;font-size:16px}.room .lastmsg{font-size:13px;color:#888;margin-top:2px}.room .time{font-size:12px;color:#999}.room .unread{background:#30a8f7;color:#fff;font-size:12px;border-radius:10px;padding:2px 7px;margin-left:8px;min-width:20px;text-align:center}.room-unread-badge{position:absolute;right:18px;top:50%;transform:translateY(-50%);min-width:22px;height:22px;background:linear-gradient(135deg,#ff3b30 60%,#ff5e62);color:#fff;font-size:13px;font-weight:700;border-radius:50%;display:flex;align-items:center;justify-content:center;letter-spacing:.5px;z-index:2;-webkit-user-select:none;user-select:none;pointer-events:none;transition:transform .3s ease,opacity .3s ease}.room:not(.active) .room-unread-badge{animation:badge-pop .4s cubic-bezier(.68,-.55,.265,1.55)}@keyframes badge-pop{0%{transform:scale(.3) translateY(-50%);opacity:0}50%{transform:scale(1.1) translateY(-50%);opacity:1}to{transform:scale(1) translateY(-50%);opacity:1}}.main{display:flex;flex-direction:column;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAI/0lEQVRoQ61Z24pcVRDtM52JX+sVRRAfBB8y0cmDTz75JKjxQhAVVAgoogRviYnRj0ky7a5atapW7XN6VDTSOed0eqZr7XWp2tvl3h/nh8Nu/Bl/+RW3O3uT14txd2HP4/VkvOz+YjzYPV6H3eMLXJ+M6+N4z+757/pz+Pnpe8Z38DtZAwtiXVFeXha5W34jkABAQMfAsAi7euF2HQ92NQCPxz1BOSAClAX4t0ASmCBRELvxMIDcCEKAW9lRMGBkMDM+AxDFgIMgGAPSngswmbwMiBbNWlg/mVmBGB9Y7v95w+pLUfE2pSUy00JUMpATmHBGgiUA+v+AdGkFHGODQLomh1ZnZkwWAYjeUFZSSg1QgaME/ysjBaSDsPedkUadCG3lkwCURpfVpjeKmW0gBorBYb/f7itgRN6pEa4qq9wAMThZHpi0hDM+gJdKL6YMTe7XYIAecWmlxCYgkWCagGS55HwESEomdGQMRM0Dgt+tgLB4/GzILBKHK8hVTSAC4FGaXQIgYjmlFUyoD5GWayCoo+ztRc8glmAkAZPOpHsNBP2AsVs9pJldmQnjs+fYz657CJinyHDbixfRxL8GEwaCjFwKxFeKTZDRi2JSUp5OFbs9vSCxVUMU2aoK5lpmAIDYQfg7l3lEza6NUBlJJqb4rRiWxhlsqtkjW3Kq+DsgMwh7HqR0IGr0zcTy1MIYog0xOzqZYQhwXIlmqR6x7zKz62hU4triYc3E4rIKIIzfAhEmD0n5F4q81Og+Y3nxGFNmQJAeGKEUjU1KlYu1VTYtEyLKj6B4gPL78TqxZ+3s+MXVED1VYuW4mtT6HL0seu7sGg4zI1uyWoMSKJsgBhB7v2atNQhlgmmTE2/IZWvOUpB2nz8bC5WpdURaACMTld9uMQEQCaQxITJSNpo8pBFyuj028ZIRHRQpr21G2kg46i9GyhMmJ4I4AZB7Y/pNOYWM6ItKqtL4PCxetgdRX+SsJrELIPb30lIroYSUnA1v6vREgdgbIycD1t2HNqLU/FPDITdRHcSFSKpJKBqfDpO+ENmDqrm6AsIMbT6iQZQF32xAVr7ywoSB2A8Q+2UA+fXh+YG53r840iajtvYfWuzWLlDlpAkFbwDCWlbzHBWe0Ih1EJCSFb8/4XW/W37+HUDmV47eU8/Q7S1B6CC5ycIkJ4JoCRWGTptPCeWmVjaCCWPkijHy44MCUtEq+3HZi8+JVR6IZEoZ1VgDGQULoSfKKtOpJnOkk/gBUjJ1kQmwYoxccTB7vy537p8fsO+uOQoJJPvteLb39dCBLNpnuQ1m0nGyTRmJLzoTHDoiYBPE8ATN7RErknJZgQm7np4MaX1/r4D4cCdF5+nIhryaFNkfREIKoO6x2vrHIpVyaiNHk1KxcDLoAYDBRLByxYB8e3cAib12dWc9TCA7JbfZT30iQGFdPiEiNjaRUgLhqMGxY+UJgCELKyC3fzk/5DaVhwc57BWgbuwYXaJ5tg1SW266AInkM1JIB8/Ufw1/7NS4lpzsGZ4IWc2MfPXTm4dHVvgTFO33MrV2v1S6aayuJthc8ZISBryp+PFcPog+EdFKQD1mxeQzkM/vAIhvUe3qgGIzFKAyzTymcSKInhAdmTqqlhxFGwNrAJZC3txiTuJzMYDOzWZX/YLSKn9k/N76YQAZlQIMgfBsqqdXNs409eTcsK2v/LT6iNAa8lg8Rww0OQXAZkc5lbTM3CmxkNpy87s3BpAAIdJCAFTc5tAXY4cb+jBHEOehLiHIBCxY6lTBUXh2abKgbFBOAOY+oVcChI8o734zgDgT4g/fKM0nhP3gGclUQBBIHCtUOrjX4skCZiUWKAxkxLJfdGBMrhxV7HvfuW1ABgh6Q/xRBwa1wdKdZNszCBDoPxggiGCiFe6ry75gq42C2R+w8j2tdFCsBRqMvP319RG/kBZPP7TT6z5iHbOdEW5D1chWKL/Qi2bxXjCfIZl6FSAHE5+1K8aTkmRurN768ro3RADRg4WQUiZUnT1Vs9OurPvoLTlhxRXIqRa/FyDiBWcpvbAGwEVbzr8AED2+4TC4mpuiAVbPCyDs2OMfmrHpAVlRA+IARuEEcqogFBxDICSmbCQT7svx39lnJi09OewjPcYPlJ5MZN8oRoyPithiRHXu0gkACuZ0v09QXWKQESRVgaHSzeng9U/PnJHcLNk9+8Q0gvRxj6Ne9QztHUwmSsOuXHmbVu3eX7yPKXb2SXV2OWgIj2DrG5J+7dYAEj4goBnI0SFwOumobSgbmyUSVrRA2P1+d1VAXBVG+LnqGf2QwftRnmlJ33r1k7PVDtFP4bdGkJkSWw5rH/G+dm72CI/SPUxeTAwg49kBDEAdiG2UpPlFE81hcgbh7Wss4SsfdyB5EBE0zEf6xJIQYqpFGyn6E0iY1zxBKTkbzkoxY+/Z6FGMALx6g78fU3RsyNiEX/4IQJBQ8r+IM6G25inwEGEVjKyboOd/RC6AoHAHMIpWQAS59sjkjQDBhUs1vPThmZ9rHfdFB6ItUIGk8SRdNIFQaIBQQC4vpBY/U/MUJGbzGXxRTCQjlPWLN6+BESYVY7Zt8aL8dlFG+qheIzjk4f4wJkI6kNR+95R6hGDi8z7KZP+IY1HKKHZpyYax9MIH17xNtPHjWOMLZ9MfxUjIKoyI6EViVe8oY6e86JOQXWuM0Qz7jlG+Wb1pQJ43IGQkDb6Kp0qnZKUmXZVV7exiXhKzd5MbI2V6SivluAGk/peCG0XCfzw+934wchSEBmxELZuQpAcSBRrGUFdG51jCqKW0mtml19TevLp5gjgmr2cDiO675xMQxd7ktAFk3murR6yPqKwSmMSuMcO009kqFypMn7kZElsciHhiPU9BZgSzCSQYUj1j39HNTiDaQxgA87zFPqS/s40kInH3/jPvQVqhrOmG2VZAkN8xGpCRCQjN3oCIoXsPgU/cI5lYSLp1M5T4nZhJICsmVn4vgWlnVe2q0bk3T2lJZ8+xRCLZ2LLJGJ+PPcjmeNLB5HnZ04ORZEPMsT7h+edA0Ee6tNTwLi1hyGewGPEdSAyaZLZFcDvkDtmPz/8FWbQaff2vbC4AAAAASUVORK5CYII=)!important;background-size:100% 100%;position:relative;flex:2.5}.main:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:url(./wallpaper-DfETqQeD.png) left top / auto 100% no-repeat;opacity:.15;mix-blend-mode:multiply;pointer-events:none;z-index:0}.main-header{display:flex;align-items:center;padding:14.6px;background:#fff;justify-content:space-between;min-height:30px;position:relative;z-index:3}.main-header .group-title{font-weight:700;font-size:18px;margin-left:16px;color:#222}.main-header-right,.main-header-actions{position:relative;display:flex;align-items:center;height:100%}.pinned{padding:2px 24px;background:#fff;font-size:13px;color:#2a5d8f;border-bottom:1px solid #eee;min-height:18px;border-left:4px solid #30a8f7;font-weight:500}.chat-area{flex:1;overflow-y:auto;padding:32px 24px 24px;display:flex;flex-direction:column;background:none;z-index:1}.bubble{max-width:80%;padding:12px 18px;border-radius:13px;margin-bottom:.375rem;font-size:15px;line-height:1.6;position:relative;word-break:break-all;display:flex;flex-direction:column}.bubble-content{display:block;word-break:break-all}.bubble-meta{font-size:12px;color:#999;margin-left:0;margin-top:6px;align-self:flex-end;position:absolute;right:3px;bottom:7px;display:inline-block;background:transparent;line-height:1}.bubble.me{background:#e3fee0;color:#222;margin-left:auto;border-bottom-right-radius:0;padding:10px 39px 7px 10px}.bubble.other{background:#fff;max-width:100%;color:#222;border-bottom-left-radius:0;margin-left:0;padding:1px 40px 5px 10px}.bubble.other .bubble-meta{right:4px}.bubble .bubble-meta{font-size:12px;color:#999;margin-top:4px;text-align:right}.bubble-meta{font-size:12px;color:#999;margin-left:10px;vertical-align:baseline;display:inline}.bubble-other-wrap{display:flex;align-items:flex-end;position:relative;z-index:2;margin-bottom:.375rem}.bubble-other-main{display:flex;flex-direction:column;align-items:flex-start}.bubble-other-name{font-size:13px;color:#30a8f7;font-weight:500;margin-left:-5px}:root{--chat-input-border-radius: 1rem;--chat-input-size: 3.25rem;--chat-input-inner-padding: 1.25rem;--surface-color: #fff}.chat-input-area{display:flex;justify-content:center;align-items:flex-end;padding:3px 30px 17px;background:none}.rows-wrapper{transform:translate(0) scaleX(1);border-end-end-radius:0;min-height:37px;max-height:none}.chat-input-wrapper{--padding-vertical: .6rem;--padding-horizontal: var(--chat-input-inner-padding);--padding: var(--padding-vertical) var(--padding-horizontal);--button-size: 2.125rem;--button-horizontal-margin: .125rem;display:flex;align-items:center;flex-direction:column;width:100%;max-width:100%;justify-content:center;border-radius:var(--chat-input-border-radius);min-height:37px;max-height:none;flex:0 0 auto;position:relative;z-index:3;background:none}.chat-input-wrapper:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;box-shadow:0 1px 8px 1px #0000001f;background-color:var(--surface-color);opacity:1;z-index:-1}.bubble-tail{position:absolute;left:12px;bottom:0;fill:#fff;z-index:2;display:none}.new-message-wrapper{display:flex;align-items:flex-end;width:100%;padding:var(--padding);position:relative}.btn-icon.toggle-emoticons{width:var(--button-size);height:var(--button-size);border:none;background:none;margin-right:var(--button-horizontal-margin);font-size:1.5rem;color:#30a8f7;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color .2s ease,transform .2s ease}.btn-icon.toggle-emoticons:hover{background:#f5f5f5}.btn-icon.toggle-emoticons:active{transform:scale(.95)}.chat-emoji-btn{background:none;border:none;cursor:pointer;color:gray;display:flex;align-items:center;justify-content:center;margin:0 10px 3px;padding-left:unset;padding-right:unset;transition:color .2s ease,background-color .2s ease,transform .2s ease}.chat-emoji-btn:hover{color:#007bff;background:#f5f5f5;border-radius:50%}.chat-emoji-btn:active{transform:scale(.95)}.btn-icon.rp.btn-menu-toggle{position:relative;width:2.125rem;height:2.125rem;border:none;background:none;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;transition:background-color .2s ease}.btn-icon.rp.btn-menu-toggle:hover{background:#30a8f71a}.c-ripple{position:absolute;border-radius:50%;pointer-events:none;width:100%;height:100%;left:0;top:0;background:#30a8f72e;opacity:0;transform:scale(.5);z-index:1;transition:opacity .3s ease,transform .3s ease}.btn-icon.rp.btn-menu-toggle:active .c-ripple{opacity:1;transform:scale(1.2)}.tgico.button-icon{font-size:1.3rem;z-index:2;position:relative}.input-message-container{flex:1;display:flex;flex-direction:column;position:relative;margin:0 30px 0 0;justify-content:center;min-height:37px;max-height:none}.input-message-input{min-height:37px;max-height:518px;outline:none;border:none;background:transparent;font-size:16px;line-height:37px;padding:0;margin:0;resize:none;color:#222;width:100%;overflow-y:auto!important;display:block;white-space:pre-wrap;word-break:break-word;word-wrap:break-word;overflow-wrap:break-word;max-width:100%}.input-field-placeholder{position:absolute;left:0;top:0;color:#aaa;font-size:16px;pointer-events:none;padding:0;margin:0;line-height:37px;white-space:pre;display:flex;align-items:center;opacity:1;transition:opacity .2s ease}.input-message-input:not(:empty)+.input-field-placeholder{opacity:0}.input-message-input:empty+.input-field-placeholder{opacity:1}.input-field-input-fake{display:none}.chat-input{display:none!important}.more-btn{width:40px;height:40px;border:none;background:none;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;position:relative;overflow:hidden;gap:3px;transition:background-color .2s ease,transform .2s ease}.more-btn:hover{background:#f5f5f5}.more-btn:active{transform:scale(.95)}.more-menu{display:none;position:absolute;right:0;top:44px;background:#fff;border-radius:10px;box-shadow:0 8px 32px #0000002e;min-width:120px;z-index:100;font-size:1rem;width:max-content;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;--transform-extra: translateX(0);--transform-origin-x: center;--transform-origin-y: center;transform-origin:var(--transform-origin-x) var(--transform-origin-y);transform:var(--transform-extra);opacity:0;pointer-events:none;transform:translateY(-10px) scale(.95);transition:opacity .3s ease,transform .3s ease}.more-menu.open{display:block;opacity:1;pointer-events:auto;transform:translateY(0) scale(1)}.more-menu.close{opacity:0;pointer-events:none;transform:translateY(-10px) scale(.95)}.more-menu-item{padding:6px 40px;cursor:pointer;border-radius:6px;font-size:15px;color:#222;margin:5px;transition:background-color .2s ease,transform .2s ease}.more-menu-item:hover{background:#f5f5f5;transform:translate(2px)}.rightbar{width:250px;background:#fff;border-left:1px solid #e0e0e0;display:flex;flex-direction:column;box-shadow:-2px 0 8px #e0e0e0a0;transition:width .3s ease}.rightbar-header{padding:23.27px 18px 24px;border-bottom:1px solid #dcdcdc;background:#fff;border-radius:0 12px 0 0}.rightbar-group{display:flex;align-items:center;justify-content:space-around}.rightbar .group-info .title{font-size:18px;font-weight:600;color:#222}.rightbar .group-info .group-desc{font-size:13px;color:#888}.rightbar-tabs{background:#fff;border-radius:0;box-shadow:0 2px 8px #e0e0e020}.rightbar .tabs{display:flex;border-bottom:1px solid #f3f3f3;margin:0 18px}.rightbar .tabs div{padding:10px 16px;cursor:pointer;font-size:15px;color:#30a8f7;font-weight:500;border-bottom:1px solid #f3f3f3;border-radius:8px 8px 0 0;margin-right:8px;transition:background-color .2s ease,color .2s ease,border-bottom-color .2s ease}.rightbar .tabs .active{background:#fff;color:#30a8f7;border-bottom:2px solid #30a8f7}.members{flex:1;overflow-y:auto;padding:10px 0;background:#fff}.member{display:flex;align-items:center;padding:10px 18px;border-radius:8px;margin:6px 8px;transition:background-color .2s ease,transform .2s ease}.member:hover{background:#f5f5f5;transform:translate(2px)}.member .member-info{flex:1}.member .member-name{font-weight:500;font-size:15px;color:#222}.member .member-status{font-size:12px;color:#30a8f7}::-webkit-scrollbar{width:4px;background:#fff}::-webkit-scrollbar-thumb{background:#e0e0e0;border-radius:4px}body{background:#fff;font-family:Roboto,Arial,sans-serif;margin:0}.login-container{max-width:400px;margin:60px auto 0;padding:32px 24px 24px;background:#fff;border-radius:14px;box-shadow:0 2px 16px #3c506417;text-align:center}.login-container h1{font-size:2.2rem;font-weight:700;margin-bottom:40px}.subtips{color:#7a7a7a;margin-bottom:26px;font-size:1rem}.login-container form{display:flex;flex-direction:column;gap:18px}.input-group{display:flex;flex-direction:column;align-items:flex-start;position:relative;margin-bottom:10px}.input-group label:not(.floating-label){font-size:.98rem;color:#888;margin-bottom:6px;margin-left:2px}.input-group .optional{color:#b5b5b5;font-size:.92em;margin-left:4px}.input-group input{width:92%;border:1px solid #e5e5e5;border-radius:10px;padding:14px;font-size:1.1rem;outline:none;background:#fafbfc;transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease}.input-group input:focus{border-color:#30a8f7;background:#fff;box-shadow:0 0 0 3px #30a8f71a}.login-btn{margin-top:20px;background:#30a8f7;border:none;color:#fff;font-size:1.2rem;font-weight:500;border-radius:12px;padding:14px 0;cursor:pointer;letter-spacing:1px;transition:background-color .2s ease,transform .2s ease,box-shadow .2s ease}.login-btn:hover,.login-btn:focus{background:#2196e3;box-shadow:0 4px 12px #30a8f74d}.login-btn:active{transform:translateY(1px)}.login-modal{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.login-modal-bg{position:absolute;left:0;top:0;right:0;bottom:0;background:#ffffff80;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:1}.login-modal-card{position:relative;z-index:2;background:#fff;border-radius:14px;box-shadow:0 2px 16px #3c506421;padding:32px 24px 24px;min-width:200px;width:400px;text-align:center}.login-modal-card form{display:flex;flex-direction:column;gap:18px}.login-modal-close{position:absolute;right:12px;top:10px;background:none;border:none;font-size:1.7rem;color:#888;cursor:pointer;z-index:3;line-height:1;transition:color .2s ease,transform .2s ease}.login-modal-close:hover{color:#30a8f7;transform:scale(1.1)}.avatar{width:42px!important;height:42px!important;border-radius:50%!important;display:flex!important;align-items:center!important;justify-content:center!important;font-weight:700!important;font-size:20px!important;-webkit-user-select:none!important;user-select:none!important;overflow:hidden!important;flex-shrink:0!important;object-fit:cover!important;margin-right:8px!important;box-sizing:border-box!important;z-index:2!important;position:relative!important}.avatar img{width:100%!important;height:100%!important;border-radius:50%!important;object-fit:cover!important;display:block!important;z-index:2!important;position:relative!important}.img-modal-bg{position:fixed;left:0;top:0;right:0;bottom:0;z-index:9999;display:flex;align-items:center;justify-content:center;background:#141414eb}.img-modal-blur{display:none}.img-modal-content{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;background:none;border-radius:0;box-shadow:none;padding:0;width:100vw;height:100vh;max-width:100vw;max-height:100vh}.img-modal-content img{max-width:100vw;max-height:100vh;border-radius:0;box-shadow:none;background:none;margin:0 auto;display:block;cursor:zoom-in;border:none}.img-modal-close{position:fixed;right:15px;top:15px;font-size:2.6rem;color:#bbb;background:none;border-radius:50%;width:48px;height:48px;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10000;line-height:1;box-shadow:none;transition:background-color .2s ease,color .2s ease,transform .2s ease}.img-modal-close:hover{background:#50505040;color:#fff;transform:scale(1.1)}.bubble.system{max-width:70%;padding:5px 14px;border-radius:20px;margin:0 auto 5px;font-size:13px;line-height:1.4;position:relative;word-break:break-word;background:#f0f4f8b3;color:#555;display:inline-block;text-align:center}.icon-22-middle{width:22px;height:22px;vertical-align:middle;margin-right:25px;margin-left:25px}.icon-22{width:22px;height:22px}.input-hidden{display:none}.chat-attach-btn-abs{background:none;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;position:absolute;right:-20px;top:50%;transform:translateY(-50%);transition:transform .2s ease,color .2s ease}.chat-attach-btn-abs:hover{transform:translateY(-50%) scale(1.1);color:#30a8f7}.input-message-input-init{height:37px}.bubble-img{max-width:220px;max-height:180px;border-radius:8px}.login-modal-close-abs{position:absolute;right:10px;top:10px;font-size:22px;background:none;border:none;cursor:pointer}.main-header-flex{display:flex;align-items:center}.group-title-bold{font-size:1.22em;font-weight:700}.main-header-members{margin-left:10px;font-size:13px;color:#888}.img-modal-content-overflow{overflow:hidden}.img-modal-img{max-width:90vw;max-height:90vh;cursor:grab;-webkit-user-select:none;user-select:none}@media (max-width:768px){html,body{width:100vw;min-width:0;min-height:0;max-width:100vw;max-height:100dvh;height:100dvh;overflow:hidden;margin:0;padding:0;overscroll-behavior:none}.container{width:100vw;height:100dvh;min-width:0;min-height:0;max-width:100vw;max-height:100dvh;overflow:hidden;margin:0;padding:0;left:0;top:0}.main{width:100vw;height:100dvh;min-width:0;min-height:0;max-width:100vw;max-height:100dvh;overflow:hidden;margin:0;padding:0;position:relative;flex:1 1 100%}.chat-area{width:100vw;max-width:100vw;min-width:0;flex:1 1 auto;overflow-y:auto;box-sizing:border-box;background:none;margin:0;padding:16px 4px 88px}.chat-input-area{position:fixed;left:0;right:0;bottom:0;width:100vw;max-width:100vw;min-width:0;box-sizing:border-box;margin:0;padding:5px 15px calc(10px + env(safe-area-inset-bottom)) 10px;z-index:1200}*{touch-action:pan-y}.sidebar,.rightbar{position:fixed;top:0;bottom:0;z-index:1000;height:100dvh;background:#fff;box-shadow:2px 0 16px #0002;transition:transform .3s cubic-bezier(.4,0,.2,1)}.sidebar{left:0;max-width:70vw;transform:translate(-100%);border-right:1px solid #e0e0e0}.sidebar.mobile-open{transform:translate(0)}.rightbar{right:0;max-width:70vw;transform:translate(100%);border-left:1px solid #e0e0e0}.rightbar.mobile-open{transform:translate(0)}.mobile-sidebar-mask,.mobile-rightbar-mask{display:none;position:fixed;left:0;top:0;right:0;bottom:0;background:#0000002e;z-index:999}.mobile-sidebar-mask.active,.mobile-rightbar-mask.active{display:block}.mobile-menu-btn,.mobile-info-btn{background:#ffffffd9;border:none;align-items:center;width:45px;height:45px;z-index:1100;cursor:pointer;border-radius:50%;opacity:1;will-change:transform,opacity;color:#707070;transition:background-color .2s ease,transform .2s ease,box-shadow .2s ease}.mobile-menu-btn:active,.mobile-info-btn:active{background:#e0e0e0;transform:scale(.93)}.settings-panel-card{left:2vw!important}}.member.private-chat-active{background-color:#e0d0ff!important;transition:background-color .2s ease}.member.private-chat-active:hover{background-color:#d8c8f8!important}.chat-input-area.private-mode .chat-input-wrapper:before{background-color:#f0e8ff!important;transition:background-color .3s ease}.bubble.other.private-message{background-color:#9370db!important;color:#fff!important}.bubble.other.private-message .bubble-other-name{color:#f0e8ff!important}.bubble.other.private-message .bubble-meta{color:#e0d0ff!important}.bubble.other.private-message .bubble-content{color:#fff!important;background-color:transparent!important}.bubble.me.private-message{background-color:#9370db!important;color:#fff!important}.bubble.me.private-message .bubble-meta{color:#e0d0ff!important}.bubble.me.private-message .bubble-content{color:#fff!important;background-color:transparent!important}.input-group{position:relative}.input-group .floating-label{position:absolute;top:14px;left:16px;pointer-events:none;font-size:1.1rem;color:#888;transition:.25s cubic-bezier(.68,-.55,.265,1.55)}.input-group input:focus+.floating-label,.input-group input:not(:placeholder-shown)+.floating-label{color:#30a8f7;transform:translateY(-35px)}.input-group .floating-label span{display:inline;color:inherit;transition:none;min-width:0} diff --git a/workers/public/assets/vendor-Cez3xphJ.js b/workers/public/assets/vendor-Cez3xphJ.js new file mode 100644 index 0000000..e8355e3 --- /dev/null +++ b/workers/public/assets/vendor-Cez3xphJ.js @@ -0,0 +1,7 @@ +import{g as t,h as e}from"./vendor-deps-CUoVodhr.js";var r,n={}; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */var i=(r||(r=1,function(r){const n=e(),i=t(),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=u,r.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},r.INSPECT_MAX_BYTES=50;const f=2147483647;function s(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=s(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|g(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Z(t.length)?s(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return c(t),s(t<0?0:0|g(t))}function p(t){const e=t.length<0?0:0|g(t.length),r=s(e);for(let n=0;n=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return v(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:B(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):B(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(t,e,r,n,i){let o,f=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;f=2,s/=2,u/=2,r/=2}function h(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(i){let n=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let f;for(n>o/2&&(n=o/2),f=0;f>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function v(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+f<=r){let r,n,s,u;switch(f){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=f}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ee&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),f=(r>>>=0)-(e>>>=0);const s=Math.min(o,f),h=this.slice(n,i),c=t.slice(e,r);for(let u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":case"latin1":case"binary":return I(this,t,e,r);case"base64":return U(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function O(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let o=e;or)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function C(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function k(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return e=+e,r>>>=0,o||k(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||k(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=K((function(t){Y(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=K((function(t){Y(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||x(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||$(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||$(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=K((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=K((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);$(this,t,e,r,n-1,-n)}let i=0,o=1,f=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);$(this,t,e,r,n-1,-n)}let i=r-1,o=1,f=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/o|0)-f&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||$(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=K((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=K((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,i,o){if(t>r||t= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new M.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){Y(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function Y(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw Y(t,r),new M.ERR_OUT_OF_RANGE("offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let f=0;f55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function X(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const H=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}}(n)),n);export{i as b}; diff --git a/workers/public/assets/vendor-deps-CUoVodhr.js b/workers/public/assets/vendor-deps-CUoVodhr.js new file mode 100644 index 0000000..6a1437d --- /dev/null +++ b/workers/public/assets/vendor-deps-CUoVodhr.js @@ -0,0 +1,3 @@ +import{r as t}from"./crypto-libs-Biap7jvT.js";var e,i,r,n={exports:{}},o=n.exports;function h(){return e||(e=1,function(e,i){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function o(t,e,i){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var h;"object"==typeof e?e.exports=o:i.BN=o,o.BN=o,o.wordSize=26;try{h="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t.Buffer}catch(T){}function s(t,e){var i=t.charCodeAt(e);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function a(t,e,i){var r=s(t,i);return i-1>=e&&(r|=s(t,i-1)<<4),r}function u(t,e,i,r){for(var n=0,o=Math.min(t.length,i),h=e;h=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)h=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=h<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,i){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)n=a(t,e,r)<=18?(o-=18,h+=1,this.words[h]|=n>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r=18?(o-=18,h+=1,this.words[h]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,h=o%r,s=Math.min(o,o-h)+i,a=0,l=i;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function c(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],h=n*o,s=67108863&h,a=h/67108864|0;i.words[0]=s;for(var u=1;u>>26,f=67108863&a,m=Math.min(u,e.length-1),c=Math.max(0,u-t.length+1);c<=m;c++){var p=u-c|0;l+=(h=(n=0|t.words[p])*(o=0|e.words[c])+f)/67108864|0,f=67108863&h}i.words[u]=0|f,a=0|l}return 0!==a?i.words[u]=0|a:i.length--,i.strip()}o.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var n=0,o=0,h=0;h>>24-n&16777215,(n+=2)>=26&&(n-=26,h--),i=0!==o||h!==this.length-1?l[6-a.length]+a+i:a+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],c=m[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var d=p.modn(c).toString(t);i=(p=p.idivn(c)).isZero()?d+i:l[u-d.length]+d+i}for(this.isZero()&&(i="0"+i);i.length%e!==0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r(void 0!==h),this.toArrayLike(h,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var h,s,a="le"===e,u=new t(o),l=this.clone();if(a){for(s=0;!l.isZero();s++)h=l.andln(255),l.iushrn(8),u[s]=h;for(;s=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 8191&e||(i+=13,e>>>=13),127&e||(i+=7,e>>>=7),15&e||(i+=4,e>>>=4),3&e||(i+=2,e>>>=2),1&e||i++,i},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,h=0;h>26,this.words[h]=67108863&e;for(;0!==o&&h>26,this.words[h]=67108863&e;if(0===o&&h>>13,c=0|h[1],p=8191&c,d=c>>>13,g=0|h[2],v=8191&g,M=g>>>13,y=0|h[3],w=8191&y,_=y>>>13,b=0|h[4],A=8191&b,S=b>>>13,T=0|h[5],E=8191&T,N=T>>>13,x=0|h[6],k=8191&x,R=x>>>13,L=0|h[7],C=8191&L,O=L>>>13,I=0|h[8],D=8191&I,z=I>>>13,B=0|h[9],H=8191&B,U=B>>>13,P=0|s[0],F=8191&P,q=P>>>13,W=0|s[1],j=8191&W,Z=W>>>13,G=0|s[2],V=8191&G,Y=G>>>13,K=0|s[3],X=8191&K,$=K>>>13,J=0|s[4],Q=8191&J,tt=J>>>13,et=0|s[5],it=8191&et,rt=et>>>13,nt=0|s[6],ot=8191&nt,ht=nt>>>13,st=0|s[7],at=8191&st,ut=st>>>13,lt=0|s[8],ft=8191<,mt=lt>>>13,ct=0|s[9],pt=8191&ct,dt=ct>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(u+(r=Math.imul(f,F))|0)+((8191&(n=(n=Math.imul(f,q))+Math.imul(m,F)|0))<<13)|0;u=((o=Math.imul(m,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,F),n=(n=Math.imul(p,q))+Math.imul(d,F)|0,o=Math.imul(d,q);var vt=(u+(r=r+Math.imul(f,j)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(m,j)|0))<<13)|0;u=((o=o+Math.imul(m,Z)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,F),n=(n=Math.imul(v,q))+Math.imul(M,F)|0,o=Math.imul(M,q),r=r+Math.imul(p,j)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(d,j)|0,o=o+Math.imul(d,Z)|0;var Mt=(u+(r=r+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,V)|0))<<13)|0;u=((o=o+Math.imul(m,Y)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(w,F),n=(n=Math.imul(w,q))+Math.imul(_,F)|0,o=Math.imul(_,q),r=r+Math.imul(v,j)|0,n=(n=n+Math.imul(v,Z)|0)+Math.imul(M,j)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(p,V)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(d,V)|0,o=o+Math.imul(d,Y)|0;var yt=(u+(r=r+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,$)|0)+Math.imul(m,X)|0))<<13)|0;u=((o=o+Math.imul(m,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(A,F),n=(n=Math.imul(A,q))+Math.imul(S,F)|0,o=Math.imul(S,q),r=r+Math.imul(w,j)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,j)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(v,V)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,Y)|0,r=r+Math.imul(p,X)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(d,X)|0,o=o+Math.imul(d,$)|0;var wt=(u+(r=r+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0))<<13)|0;u=((o=o+Math.imul(m,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(E,F),n=(n=Math.imul(E,q))+Math.imul(N,F)|0,o=Math.imul(N,q),r=r+Math.imul(A,j)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(S,j)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(w,V)|0,n=(n=n+Math.imul(w,Y)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Y)|0,r=r+Math.imul(v,X)|0,n=(n=n+Math.imul(v,$)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(d,Q)|0,o=o+Math.imul(d,tt)|0;var _t=(u+(r=r+Math.imul(f,it)|0)|0)+((8191&(n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0))<<13)|0;u=((o=o+Math.imul(m,rt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(k,F),n=(n=Math.imul(k,q))+Math.imul(R,F)|0,o=Math.imul(R,q),r=r+Math.imul(E,j)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(N,j)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(A,V)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,r=r+Math.imul(w,X)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,$)|0,r=r+Math.imul(v,Q)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(p,it)|0,n=(n=n+Math.imul(p,rt)|0)+Math.imul(d,it)|0,o=o+Math.imul(d,rt)|0;var bt=(u+(r=r+Math.imul(f,ot)|0)|0)+((8191&(n=(n=n+Math.imul(f,ht)|0)+Math.imul(m,ot)|0))<<13)|0;u=((o=o+Math.imul(m,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(C,F),n=(n=Math.imul(C,q))+Math.imul(O,F)|0,o=Math.imul(O,q),r=r+Math.imul(k,j)|0,n=(n=n+Math.imul(k,Z)|0)+Math.imul(R,j)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(E,V)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(A,X)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(v,it)|0,n=(n=n+Math.imul(v,rt)|0)+Math.imul(M,it)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(d,ot)|0,o=o+Math.imul(d,ht)|0;var At=(u+(r=r+Math.imul(f,at)|0)|0)+((8191&(n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,at)|0))<<13)|0;u=((o=o+Math.imul(m,ut)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(D,F),n=(n=Math.imul(D,q))+Math.imul(z,F)|0,o=Math.imul(z,q),r=r+Math.imul(C,j)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(O,j)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(k,V)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,r=r+Math.imul(E,X)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,$)|0,r=r+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,r=r+Math.imul(w,it)|0,n=(n=n+Math.imul(w,rt)|0)+Math.imul(_,it)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(v,ot)|0,n=(n=n+Math.imul(v,ht)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,ht)|0,r=r+Math.imul(p,at)|0,n=(n=n+Math.imul(p,ut)|0)+Math.imul(d,at)|0,o=o+Math.imul(d,ut)|0;var St=(u+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;u=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(H,F),n=(n=Math.imul(H,q))+Math.imul(U,F)|0,o=Math.imul(U,q),r=r+Math.imul(D,j)|0,n=(n=n+Math.imul(D,Z)|0)+Math.imul(z,j)|0,o=o+Math.imul(z,Z)|0,r=r+Math.imul(C,V)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(k,X)|0,n=(n=n+Math.imul(k,$)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,$)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(A,it)|0,n=(n=n+Math.imul(A,rt)|0)+Math.imul(S,it)|0,o=o+Math.imul(S,rt)|0,r=r+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,ht)|0,r=r+Math.imul(v,at)|0,n=(n=n+Math.imul(v,ut)|0)+Math.imul(M,at)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(p,ft)|0,n=(n=n+Math.imul(p,mt)|0)+Math.imul(d,ft)|0,o=o+Math.imul(d,mt)|0;var Tt=(u+(r=r+Math.imul(f,pt)|0)|0)+((8191&(n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,dt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(H,j),n=(n=Math.imul(H,Z))+Math.imul(U,j)|0,o=Math.imul(U,Z),r=r+Math.imul(D,V)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(z,V)|0,o=o+Math.imul(z,Y)|0,r=r+Math.imul(C,X)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,ht)|0,r=r+Math.imul(w,at)|0,n=(n=n+Math.imul(w,ut)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(v,ft)|0,n=(n=n+Math.imul(v,mt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,mt)|0;var Et=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,dt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(H,V),n=(n=Math.imul(H,Y))+Math.imul(U,V)|0,o=Math.imul(U,Y),r=r+Math.imul(D,X)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(z,X)|0,o=o+Math.imul(z,$)|0,r=r+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,r=r+Math.imul(k,it)|0,n=(n=n+Math.imul(k,rt)|0)+Math.imul(R,it)|0,o=o+Math.imul(R,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,ht)|0,r=r+Math.imul(A,at)|0,n=(n=n+Math.imul(A,ut)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ut)|0,r=r+Math.imul(w,ft)|0,n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,mt)|0;var Nt=(u+(r=r+Math.imul(v,pt)|0)|0)+((8191&(n=(n=n+Math.imul(v,dt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,dt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(H,X),n=(n=Math.imul(H,$))+Math.imul(U,X)|0,o=Math.imul(U,$),r=r+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(z,Q)|0,o=o+Math.imul(z,tt)|0,r=r+Math.imul(C,it)|0,n=(n=n+Math.imul(C,rt)|0)+Math.imul(O,it)|0,o=o+Math.imul(O,rt)|0,r=r+Math.imul(k,ot)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,ht)|0,r=r+Math.imul(E,at)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ut)|0,r=r+Math.imul(A,ft)|0,n=(n=n+Math.imul(A,mt)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,mt)|0;var xt=(u+(r=r+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,dt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,dt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(H,Q),n=(n=Math.imul(H,tt))+Math.imul(U,Q)|0,o=Math.imul(U,tt),r=r+Math.imul(D,it)|0,n=(n=n+Math.imul(D,rt)|0)+Math.imul(z,it)|0,o=o+Math.imul(z,rt)|0,r=r+Math.imul(C,ot)|0,n=(n=n+Math.imul(C,ht)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,ht)|0,r=r+Math.imul(k,at)|0,n=(n=n+Math.imul(k,ut)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ut)|0,r=r+Math.imul(E,ft)|0,n=(n=n+Math.imul(E,mt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,mt)|0;var kt=(u+(r=r+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,dt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((o=o+Math.imul(S,dt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(H,it),n=(n=Math.imul(H,rt))+Math.imul(U,it)|0,o=Math.imul(U,rt),r=r+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,ht)|0)+Math.imul(z,ot)|0,o=o+Math.imul(z,ht)|0,r=r+Math.imul(C,at)|0,n=(n=n+Math.imul(C,ut)|0)+Math.imul(O,at)|0,o=o+Math.imul(O,ut)|0,r=r+Math.imul(k,ft)|0,n=(n=n+Math.imul(k,mt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,mt)|0;var Rt=(u+(r=r+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,dt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,dt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(H,ot),n=(n=Math.imul(H,ht))+Math.imul(U,ot)|0,o=Math.imul(U,ht),r=r+Math.imul(D,at)|0,n=(n=n+Math.imul(D,ut)|0)+Math.imul(z,at)|0,o=o+Math.imul(z,ut)|0,r=r+Math.imul(C,ft)|0,n=(n=n+Math.imul(C,mt)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,mt)|0;var Lt=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,dt)|0)+Math.imul(R,pt)|0))<<13)|0;u=((o=o+Math.imul(R,dt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,r=Math.imul(H,at),n=(n=Math.imul(H,ut))+Math.imul(U,at)|0,o=Math.imul(U,ut),r=r+Math.imul(D,ft)|0,n=(n=n+Math.imul(D,mt)|0)+Math.imul(z,ft)|0,o=o+Math.imul(z,mt)|0;var Ct=(u+(r=r+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,dt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((o=o+Math.imul(O,dt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(H,ft),n=(n=Math.imul(H,mt))+Math.imul(U,ft)|0,o=Math.imul(U,mt);var Ot=(u+(r=r+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,dt)|0)+Math.imul(z,pt)|0))<<13)|0;u=((o=o+Math.imul(z,dt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var It=(u+(r=Math.imul(H,pt))|0)+((8191&(n=(n=Math.imul(H,dt))+Math.imul(U,pt)|0))<<13)|0;return u=((o=Math.imul(U,dt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,a[0]=gt,a[1]=vt,a[2]=Mt,a[3]=yt,a[4]=wt,a[5]=_t,a[6]=bt,a[7]=At,a[8]=St,a[9]=Tt,a[10]=Et,a[11]=Nt,a[12]=xt,a[13]=kt,a[14]=Rt,a[15]=Lt,a[16]=Ct,a[17]=Ot,a[18]=It,0!==u&&(a[19]=u,i.length++),i};function d(t,e,i){return(new g).mulp(t,e,i)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=c),o.prototype.mulTo=function(t,e){var i,r=this.length+t.length;return i=10===this.length&&10===t.length?p(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o>>26)|0)>>>26,h&=67108863}i.words[o]=s,r=h,h=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):d(this,t,e),i},g.prototype.makeRBT=function(t){for(var e=new Array(t),i=o.prototype._countBits(t)-1,r=0;r>=1;return r},g.prototype.permute=function(t,e,i,r,n,o){for(var h=0;h>>=1)n++;return 1<>>=13,i[2*h+1]=8191&o,o>>>=13;for(h=2*e;h>=26,e+=n/67108864|0,e+=o>>>26,this.words[i]=67108863&o}return 0!==e&&(this.words[i]=e,this.length++),this.length=0===t?1:this.length,this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n}return e}(t);if(0===e.length)return new o(1);for(var i=this,r=0;r=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var h=0;for(e=0;e>>26-i}h&&(this.words[e]=h,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,h=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<h)for(this.length-=h,u=0;u=0&&(0!==l||u>=n);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&s}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26,n=1<=0);var e=t%26,i=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(a/67108864|0),this.words[n+i]=67108863&o}for(;n>26,this.words[n+i]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var i=(this.length,t.length),r=this.clone(),n=t,h=0|n.words[n.length-1];0!=(i=26-this._countBits(h))&&(n=n.ushln(i),r.iushln(i),h=0|n.words[n.length-1]);var s,a=r.length-n.length;if("mod"!==e){(s=new o(null)).length=a+1,s.words=new Array(s.length);for(var u=0;u=0;f--){var m=67108864*(0|r.words[n.length+f])+(0|r.words[n.length+f-1]);for(m=Math.min(m/h|0,67108863),r._ishlnsubmul(n,m,f);0!==r.negative;)m--,r.negative=0,r._ishlnsubmul(n,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=m)}return s&&s.strip(),r.strip(),"div"!==e&&0!==i&&r.iushrn(i),{div:s||null,mod:r}},o.prototype.divmod=function(t,e,i){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(h=s.mod.neg(),i&&0!==h.negative&&h.iadd(t)),{div:n,mod:h}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(h=s.mod.neg(),i&&0!==h.negative&&h.isub(t)),{div:s.div,mod:h}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,h,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,i=0,n=this.length-1;n>=0;n--)i=(e*i+(0|this.words[n]))%t;return i},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*e;this.words[i]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),h=new o(0),s=new o(0),a=new o(1),u=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++u;for(var l=i.clone(),f=e.clone();!e.isZero();){for(var m=0,c=1;0===(e.words[0]&c)&&m<26;++m,c<<=1);if(m>0)for(e.iushrn(m);m-- >0;)(n.isOdd()||h.isOdd())&&(n.iadd(l),h.isub(f)),n.iushrn(1),h.iushrn(1);for(var p=0,d=1;0===(i.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(l),a.isub(f)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),h.isub(a)):(i.isub(e),s.isub(n),a.isub(h))}return{a:s,b:a,gcd:i.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,h=new o(1),s=new o(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;0===(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)h.isOdd()&&h.iadd(a),h.iushrn(1);for(var f=0,m=1;0===(i.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(i.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),h.isub(s)):(i.isub(e),s.isub(h))}return(n=0===e.cmpn(1)?h:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,s&=67108863,this.words[h]=s}return 0!==o&&(this.words[h]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){rn&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},n(y,M),y.prototype.split=function(t,e){for(var i=4194303,r=Math.min(t.length,9),n=0;n>>22,o=h}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return v[t]=e,e},A.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new o(1)).iushrn(2);return this.pow(t,i)}for(var n=this.m.subn(1),h=0;!n.isZero()&&0===n.andln(1);)h++,n.iushrn(1);r(!n.isZero());var s=new o(1).toRed(this),a=s.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(a);)l.redIAdd(a);for(var f=this.pow(l,n),m=this.pow(t,n.addn(1).iushrn(1)),c=this.pow(t,n),p=h;0!==c.cmp(s);){for(var d=c,g=0;0!==d.cmp(s);g++)d=d.redSqr();r(g=0;r--){for(var u=e.words[r],l=a-1;l>=0;l--){var f=u>>l&1;n!==i[0]&&(n=this.sqr(n)),0!==f||0!==h?(h<<=1,h|=f,(4===++s||0===r&&0===l)&&(n=this.mul(n,i[h]),s=0,h=0)):s=0}a=26}return n},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,A),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var i=t.mul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(n,o)),n.exports}function s(){if(r)return i;function t(t,e){if(!t)throw new Error(e||"Assertion failed")}return r=1,i=t,t.equal=function(t,e,i){if(t!=e)throw new Error(i||"Assertion failed: "+t+" != "+e)},i}var a,u={};function l(){return a||(a=1,function(){var t=u;function e(t){return 1===t.length?"0"+t:t}function i(t){for(var i="",r=0;r>8,h=255&n;o?i.push(o,h):i.push(h)}return i},t.zero2=e,t.toHex=i,t.encode=function(t,e){return"hex"===e?i(t):t}}()),u}var f,m={exports:{}};function c(){if(f)return m.exports;var e;function i(t){this.rand=t}if(f=1,m.exports=function(t){return e||(e=new i(null)),e.generate(t)},m.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),i=0;i=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function r(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function n(t){return 1===t.length?"0"+t:t}function o(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}return y.inherits=e,y.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o>6|192,r[n++]=63&h|128):i(t,o)?(h=65536+((1023&h)<<10)+(1023&t.charCodeAt(++o)),r[n++]=h>>18|240,r[n++]=h>>12&63|128,r[n++]=h>>6&63|128,r[n++]=63&h|128):(r[n++]=h>>12|224,r[n++]=h>>6&63|128,r[n++]=63&h|128)}else for(o=0;o>>0}return h},y.split32=function(t,e){for(var i=new Array(4*t.length),r=0,n=0;r>>24,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=255&o):(i[n+3]=o>>>24,i[n+2]=o>>>16&255,i[n+1]=o>>>8&255,i[n]=255&o)}return i},y.rotr32=function(t,e){return t>>>e|t<<32-e},y.rotl32=function(t,e){return t<>>32-e},y.sum32=function(t,e){return t+e>>>0},y.sum32_3=function(t,e,i){return t+e+i>>>0},y.sum32_4=function(t,e,i,r){return t+e+i+r>>>0},y.sum32_5=function(t,e,i,r,n){return t+e+i+r+n>>>0},y.sum64=function(t,e,i,r){var n=t[e],o=r+t[e+1]>>>0,h=(o>>0,t[e+1]=o},y.sum64_hi=function(t,e,i,r){return(e+r>>>0>>0},y.sum64_lo=function(t,e,i,r){return e+r>>>0},y.sum64_4_hi=function(t,e,i,r,n,o,h,s){var a=0,u=e;return a+=(u=u+r>>>0)>>0)>>0)>>0},y.sum64_4_lo=function(t,e,i,r,n,o,h,s){return e+r+o+s>>>0},y.sum64_5_hi=function(t,e,i,r,n,o,h,s,a,u){var l=0,f=e;return l+=(f=f+r>>>0)>>0)>>0)>>0)>>0},y.sum64_5_lo=function(t,e,i,r,n,o,h,s,a,u){return e+r+o+s+u>>>0},y.rotr64_hi=function(t,e,i){return(e<<32-i|t>>>i)>>>0},y.rotr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0},y.shr64_hi=function(t,e,i){return t>>>i},y.shr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0},y}var _,b={};function A(){if(_)return b;_=1;var t=w(),e=s();function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return b.BlockHash=i,i.prototype.update=function(e,i){if(e=t.toArray(e,i),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=t.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,r[n++]=t>>>16&255,r[n++]=t>>>8&255,r[n++]=255&t}else for(r[n++]=255&t,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o>>3},B.g1_256=function(e){return t(e,17)^t(e,19)^e>>>10},B}function U(){if(x)return N;x=1;var t=w(),e=A(),i=H(),r=s(),n=t.sum32,o=t.sum32_4,h=t.sum32_5,a=i.ch32,u=i.maj32,l=i.s0_256,f=i.s1_256,m=i.g0_256,c=i.g1_256,p=e.BlockHash,d=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;p.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=d,this.W=new Array(64)}return t.inherits(g,p),N=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var i=this.W,s=0;s<16;s++)i[s]=t[e+s];for(;sthis.blockSize&&(t=(new this.Hash).update(t).digest()),e(t.length<=this.blockSize);for(var i=t.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,o,h)}return G=r,r.prototype._init=function(t,e,i){var r=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},r.prototype.generate=function(t,i,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof i&&(n=r,r=i,i=null),r&&(r=e.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length0?s-4:s;for(n=0;n>16&255,u[l++]=r>>8&255,u[l++]=255&r;2===a&&(r=e[t.charCodeAt(n)]<<2|e[t.charCodeAt(n+1)]>>4,u[l++]=255&r);1===a&&(r=e[t.charCodeAt(n)]<<10|e[t.charCodeAt(n+1)]<<4|e[t.charCodeAt(n+2)]>>2,u[l++]=r>>8&255,u[l++]=255&r);return u},J.fromByteArray=function(e){for(var i,r=e.length,n=r%3,o=[],s=16383,a=0,u=r-n;au?u:a+s));1===n?(i=e[r-1],o.push(t[i>>2]+t[i<<4&63]+"==")):2===n&&(i=(e[r-2]<<8)+e[r-1],o.push(t[i>>10]+t[i>>4&63]+t[i<<2&63]+"="));return o.join("")};for(var t=[],e=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)t[n]=r[n],e[r.charCodeAt(n)]=n;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function h(e,i,r){for(var n,o,h=[],s=i;s>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return h.join("")}return e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63,J}var tt,et={}; +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */function it(){return tt||(tt=1,et.read=function(t,e,i,r,n){var o,h,s=8*n-r-1,a=(1<>1,l=-7,f=i?n-1:0,m=i?-1:1,c=t[e+f];for(f+=m,o=c&(1<<-l)-1,c>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=m,l-=8);for(h=o&(1<<-l)-1,o>>=-l,l+=r;l>0;h=256*h+t[e+f],f+=m,l-=8);if(0===o)o=1-u;else{if(o===a)return h?NaN:1/0*(c?-1:1);h+=Math.pow(2,r),o-=u}return(c?-1:1)*h*Math.pow(2,o-r)},et.write=function(t,e,i,r,n,o){var h,s,a,u=8*o-n-1,l=(1<>1,m=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:o-1,p=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,h=l):(h=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-h))<1&&(h--,a*=2),(e+=h+f>=1?m/a:m*Math.pow(2,1-f))*a>=2&&(h++,a/=2),h+f>=l?(s=0,h=l):h+f>=1?(s=(e*a-1)*Math.pow(2,n),h+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,n),h=0));n>=8;t[i+c]=255&s,c+=p,s/=256,n-=8);for(h=h<0;t[i+c]=255&h,c+=p,h/=256,u-=8);t[i+c-p]|=128*d}),et} +/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:rt,setPrototypeOf:nt,isFrozen:ot,getPrototypeOf:ht,getOwnPropertyDescriptor:st}=Object;let{freeze:at,seal:ut,create:lt}=Object,{apply:ft,construct:mt}="undefined"!=typeof Reflect&&Reflect;at||(at=function(t){return t}),ut||(ut=function(t){return t}),ft||(ft=function(t,e,i){return t.apply(e,i)}),mt||(mt=function(t,e){return new t(...e)});const ct=xt(Array.prototype.forEach),pt=xt(Array.prototype.lastIndexOf),dt=xt(Array.prototype.pop),gt=xt(Array.prototype.push),vt=xt(Array.prototype.splice),Mt=xt(String.prototype.toLowerCase),yt=xt(String.prototype.toString),wt=xt(String.prototype.match),_t=xt(String.prototype.replace),bt=xt(String.prototype.indexOf),At=xt(String.prototype.trim),St=xt(Object.prototype.hasOwnProperty),Tt=xt(RegExp.prototype.test),Et=(Nt=TypeError,function(){for(var t=arguments.length,e=new Array(t),i=0;i1?i-1:0),n=1;n2&&void 0!==arguments[2]?arguments[2]:Mt;nt&&nt(t,null);let r=e.length;for(;r--;){let n=e[r];if("string"==typeof n){const t=i(n);t!==n&&(ot(e)||(e[r]=t),n=t)}t[n]=!0}return t}function Rt(t){for(let e=0;e/gm),Gt=ut(/\$\{[\w\W]*/gm),Vt=ut(/^data-[\-\w.\u00B7-\uFFFF]+$/),Yt=ut(/^aria-[\-\w]+$/),Kt=ut(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xt=ut(/^(?:\w+script|data):/i),$t=ut(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jt=ut(/^html$/i),Qt=ut(/^[a-z][.\w]*(-[.\w]+)+$/i);var te=Object.freeze({__proto__:null,ARIA_ATTR:Yt,ATTR_WHITESPACE:$t,CUSTOM_ELEMENT:Qt,DATA_ATTR:Vt,DOCTYPE_NAME:Jt,ERB_EXPR:Zt,IS_ALLOWED_URI:Kt,IS_SCRIPT_OR_DATA:Xt,MUSTACHE_EXPR:jt,TMPLIT_EXPR:Gt});const ee=1,ie=3,re=7,ne=8,oe=9;var he=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const i=e=>t(e);if(i.version="3.2.6",i.removed=[],!e||!e.document||e.document.nodeType!==oe||!e.Element)return i.isSupported=!1,i;let{document:r}=e;const n=r,o=n.currentScript,{DocumentFragment:h,HTMLTemplateElement:s,Node:a,Element:u,NodeFilter:l,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:m,DOMParser:c,trustedTypes:p}=e,d=u.prototype,g=Ct(d,"cloneNode"),v=Ct(d,"remove"),M=Ct(d,"nextSibling"),y=Ct(d,"childNodes"),w=Ct(d,"parentNode");if("function"==typeof s){const t=r.createElement("template");t.content&&t.content.ownerDocument&&(r=t.content.ownerDocument)}let _,b="";const{implementation:A,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:E}=r,{importNode:N}=n;let x={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof rt&&"function"==typeof w&&A&&void 0!==A.createHTMLDocument;const{MUSTACHE_EXPR:k,ERB_EXPR:R,TMPLIT_EXPR:L,DATA_ATTR:C,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:D,CUSTOM_ELEMENT:z}=te;let{IS_ALLOWED_URI:B}=te,H=null;const U=kt({},[...Ot,...It,...Dt,...Bt,...Ut]);let P=null;const F=kt({},[...Pt,...Ft,...qt,...Wt]);let q=Object.seal(lt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),W=null,j=null,Z=!0,G=!0,V=!1,Y=!0,K=!1,X=!0,$=!1,J=!1,Q=!1,tt=!1,et=!1,it=!1,nt=!0,ot=!1,ht=!0,st=!1,ut={},ft=null;const mt=kt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Nt=null;const xt=kt({},["audio","video","img","source","image","track"]);let Rt=null;const jt=kt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Zt="http://www.w3.org/1998/Math/MathML",Gt="http://www.w3.org/2000/svg",Vt="http://www.w3.org/1999/xhtml";let Yt=Vt,Xt=!1,$t=null;const Qt=kt({},[Zt,Gt,Vt],yt);let he=kt({},["mi","mo","mn","ms","mtext"]),se=kt({},["annotation-xml"]);const ae=kt({},["title","style","font","a","script"]);let ue=null;const le=["application/xhtml+xml","text/html"];let fe=null,me=null;const ce=r.createElement("form"),pe=function(t){return t instanceof RegExp||t instanceof Function},de=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!me||me!==t){if(t&&"object"==typeof t||(t={}),t=Lt(t),ue=-1===le.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,fe="application/xhtml+xml"===ue?yt:Mt,H=St(t,"ALLOWED_TAGS")?kt({},t.ALLOWED_TAGS,fe):U,P=St(t,"ALLOWED_ATTR")?kt({},t.ALLOWED_ATTR,fe):F,$t=St(t,"ALLOWED_NAMESPACES")?kt({},t.ALLOWED_NAMESPACES,yt):Qt,Rt=St(t,"ADD_URI_SAFE_ATTR")?kt(Lt(jt),t.ADD_URI_SAFE_ATTR,fe):jt,Nt=St(t,"ADD_DATA_URI_TAGS")?kt(Lt(xt),t.ADD_DATA_URI_TAGS,fe):xt,ft=St(t,"FORBID_CONTENTS")?kt({},t.FORBID_CONTENTS,fe):mt,W=St(t,"FORBID_TAGS")?kt({},t.FORBID_TAGS,fe):Lt({}),j=St(t,"FORBID_ATTR")?kt({},t.FORBID_ATTR,fe):Lt({}),ut=!!St(t,"USE_PROFILES")&&t.USE_PROFILES,Z=!1!==t.ALLOW_ARIA_ATTR,G=!1!==t.ALLOW_DATA_ATTR,V=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,K=t.SAFE_FOR_TEMPLATES||!1,X=!1!==t.SAFE_FOR_XML,$=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,it=t.RETURN_TRUSTED_TYPE||!1,Q=t.FORCE_BODY||!1,nt=!1!==t.SANITIZE_DOM,ot=t.SANITIZE_NAMED_PROPS||!1,ht=!1!==t.KEEP_CONTENT,st=t.IN_PLACE||!1,B=t.ALLOWED_URI_REGEXP||Kt,Yt=t.NAMESPACE||Vt,he=t.MATHML_TEXT_INTEGRATION_POINTS||he,se=t.HTML_INTEGRATION_POINTS||se,q=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&pe(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&pe(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(q.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),K&&(G=!1),et&&(tt=!0),ut&&(H=kt({},Ut),P=[],!0===ut.html&&(kt(H,Ot),kt(P,Pt)),!0===ut.svg&&(kt(H,It),kt(P,Ft),kt(P,Wt)),!0===ut.svgFilters&&(kt(H,Dt),kt(P,Ft),kt(P,Wt)),!0===ut.mathMl&&(kt(H,Bt),kt(P,qt),kt(P,Wt))),t.ADD_TAGS&&(H===U&&(H=Lt(H)),kt(H,t.ADD_TAGS,fe)),t.ADD_ATTR&&(P===F&&(P=Lt(P)),kt(P,t.ADD_ATTR,fe)),t.ADD_URI_SAFE_ATTR&&kt(Rt,t.ADD_URI_SAFE_ATTR,fe),t.FORBID_CONTENTS&&(ft===mt&&(ft=Lt(ft)),kt(ft,t.FORBID_CONTENTS,fe)),ht&&(H["#text"]=!0),$&&kt(H,["html","head","body"]),H.table&&(kt(H,["tbody"]),delete W.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=t.TRUSTED_TYPES_POLICY,b=_.createHTML("")}else void 0===_&&(_=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let i=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(i=e.getAttribute(r));const n="dompurify"+(i?"#"+i:"");try{return t.createPolicy(n,{createHTML:t=>t,createScriptURL:t=>t})}catch(o){return console.warn("TrustedTypes policy "+n+" could not be created."),null}}(p,o)),null!==_&&"string"==typeof b&&(b=_.createHTML(""));at&&at(t),me=t}},ge=kt({},[...It,...Dt,...zt]),ve=kt({},[...Bt,...Ht]),Me=function(t){gt(i.removed,{element:t});try{w(t).removeChild(t)}catch(e){v(t)}},ye=function(t,e){try{gt(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(r){gt(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(tt||et)try{Me(e)}catch(r){}else try{e.setAttribute(t,"")}catch(r){}},we=function(t){let e=null,i=null;if(Q)t=""+t;else{const e=wt(t,/^[\r\n\t ]+/);i=e&&e[0]}"application/xhtml+xml"===ue&&Yt===Vt&&(t=''+t+"");const n=_?_.createHTML(t):t;if(Yt===Vt)try{e=(new c).parseFromString(n,ue)}catch(h){}if(!e||!e.documentElement){e=A.createDocument(Yt,"template",null);try{e.documentElement.innerHTML=Xt?b:n}catch(h){}}const o=e.body||e.documentElement;return t&&i&&o.insertBefore(r.createTextNode(i),o.childNodes[0]||null),Yt===Vt?E.call(e,$?"html":"body")[0]:$?e.documentElement:o},_e=function(t){return S.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},be=function(t){return t instanceof m&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof f)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},Ae=function(t){return"function"==typeof a&&t instanceof a};function Se(t,e,r){ct(t,(t=>{t.call(i,e,r,me)}))}const Te=function(t){let e=null;if(Se(x.beforeSanitizeElements,t,null),be(t))return Me(t),!0;const r=fe(t.nodeName);if(Se(x.uponSanitizeElement,t,{tagName:r,allowedTags:H}),X&&t.hasChildNodes()&&!Ae(t.firstElementChild)&&Tt(/<[/\w!]/g,t.innerHTML)&&Tt(/<[/\w!]/g,t.textContent))return Me(t),!0;if(t.nodeType===re)return Me(t),!0;if(X&&t.nodeType===ne&&Tt(/<[/\w]/g,t.data))return Me(t),!0;if(!H[r]||W[r]){if(!W[r]&&Ne(r)){if(q.tagNameCheck instanceof RegExp&&Tt(q.tagNameCheck,r))return!1;if(q.tagNameCheck instanceof Function&&q.tagNameCheck(r))return!1}if(ht&&!ft[r]){const e=w(t)||t.parentNode,i=y(t)||t.childNodes;if(i&&e){for(let r=i.length-1;r>=0;--r){const n=g(i[r],!0);n.__removalCount=(t.__removalCount||0)+1,e.insertBefore(n,M(t))}}}return Me(t),!0}return t instanceof u&&!function(t){let e=w(t);e&&e.tagName||(e={namespaceURI:Yt,tagName:"template"});const i=Mt(t.tagName),r=Mt(e.tagName);return!!$t[t.namespaceURI]&&(t.namespaceURI===Gt?e.namespaceURI===Vt?"svg"===i:e.namespaceURI===Zt?"svg"===i&&("annotation-xml"===r||he[r]):Boolean(ge[i]):t.namespaceURI===Zt?e.namespaceURI===Vt?"math"===i:e.namespaceURI===Gt?"math"===i&&se[r]:Boolean(ve[i]):t.namespaceURI===Vt?!(e.namespaceURI===Gt&&!se[r])&&!(e.namespaceURI===Zt&&!he[r])&&!ve[i]&&(ae[i]||!ge[i]):!("application/xhtml+xml"!==ue||!$t[t.namespaceURI]))}(t)?(Me(t),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!Tt(/<\/no(script|embed|frames)/i,t.innerHTML)?(K&&t.nodeType===ie&&(e=t.textContent,ct([k,R,L],(t=>{e=_t(e,t," ")})),t.textContent!==e&&(gt(i.removed,{element:t.cloneNode()}),t.textContent=e)),Se(x.afterSanitizeElements,t,null),!1):(Me(t),!0)},Ee=function(t,e,i){if(nt&&("id"===e||"name"===e)&&(i in r||i in ce))return!1;if(G&&!j[e]&&Tt(C,e));else if(Z&&Tt(O,e));else if(!P[e]||j[e]){if(!(Ne(t)&&(q.tagNameCheck instanceof RegExp&&Tt(q.tagNameCheck,t)||q.tagNameCheck instanceof Function&&q.tagNameCheck(t))&&(q.attributeNameCheck instanceof RegExp&&Tt(q.attributeNameCheck,e)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(e))||"is"===e&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&Tt(q.tagNameCheck,i)||q.tagNameCheck instanceof Function&&q.tagNameCheck(i))))return!1}else if(Rt[e]);else if(Tt(B,_t(i,D,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==bt(i,"data:")||!Nt[t]){if(V&&!Tt(I,_t(i,D,"")));else if(i)return!1}else;return!0},Ne=function(t){return"annotation-xml"!==t&&wt(t,z)},xe=function(t){Se(x.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||be(t))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0};let n=e.length;for(;n--;){const h=e[n],{name:s,namespaceURI:a,value:u}=h,l=fe(s),f=u;let m="value"===s?f:At(f);if(r.attrName=l,r.attrValue=m,r.keepAttr=!0,r.forceKeepAttr=void 0,Se(x.uponSanitizeAttribute,t,r),m=r.attrValue,!ot||"id"!==l&&"name"!==l||(ye(s,t),m="user-content-"+m),X&&Tt(/((--!?|])>)|<\/(style|title)/i,m)){ye(s,t);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){ye(s,t);continue}if(!Y&&Tt(/\/>/i,m)){ye(s,t);continue}K&&ct([k,R,L],(t=>{m=_t(m,t," ")}));const c=fe(t.nodeName);if(Ee(c,l,m)){if(_&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(a);else switch(p.getAttributeType(c,l)){case"TrustedHTML":m=_.createHTML(m);break;case"TrustedScriptURL":m=_.createScriptURL(m)}if(m!==f)try{a?t.setAttributeNS(a,s,m):t.setAttribute(s,m),be(t)?Me(t):dt(i.removed)}catch(o){ye(s,t)}}else ye(s,t)}Se(x.afterSanitizeAttributes,t,null)},ke=function t(e){let i=null;const r=_e(e);for(Se(x.beforeSanitizeShadowDOM,e,null);i=r.nextNode();)Se(x.uponSanitizeShadowNode,i,null),Te(i),xe(i),i.content instanceof h&&t(i.content);Se(x.afterSanitizeShadowDOM,e,null)};return i.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,u=null;if(Xt=!t,Xt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ae(t)){if("function"!=typeof t.toString)throw Et("toString is not a function");if("string"!=typeof(t=t.toString()))throw Et("dirty is not a string, aborting")}if(!i.isSupported)return t;if(J||de(e),i.removed=[],"string"==typeof t&&(st=!1),st){if(t.nodeName){const e=fe(t.nodeName);if(!H[e]||W[e])throw Et("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof a)r=we("\x3c!----\x3e"),o=r.ownerDocument.importNode(t,!0),o.nodeType===ee&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!tt&&!K&&!$&&-1===t.indexOf("<"))return _&&it?_.createHTML(t):t;if(r=we(t),!r)return tt?null:it?b:""}r&&Q&&Me(r.firstChild);const l=_e(st?t:r);for(;s=l.nextNode();)Te(s),xe(s),s.content instanceof h&&ke(s.content);if(st)return t;if(tt){if(et)for(u=T.call(r.ownerDocument);r.firstChild;)u.appendChild(r.firstChild);else u=r;return(P.shadowroot||P.shadowrootmode)&&(u=N.call(n,u,!0)),u}let f=$?r.outerHTML:r.innerHTML;return $&&H["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Tt(Jt,r.ownerDocument.doctype.name)&&(f="\n"+f),K&&ct([k,R,L],(t=>{f=_t(f,t," ")})),_&&it?_.createHTML(f):f},i.setConfig=function(){de(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},i.clearConfig=function(){me=null,J=!1},i.isValidAttribute=function(t,e,i){me||de({});const r=fe(t),n=fe(e);return Ee(r,n,i)},i.addHook=function(t,e){"function"==typeof e&>(x[t],e)},i.removeHook=function(t,e){if(void 0!==e){const i=pt(x[t],e);return-1===i?void 0:vt(x[t],i,1)[0]}return dt(x[t])},i.removeHooks=function(t){x[t]=[]},i.removeAllHooks=function(){x={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}();export{s as a,l as b,g as c,K as d,X as e,c as f,it as g,Q as h,he as p,h as r}; diff --git a/workers/public/assets/wallpaper-DfETqQeD.png b/workers/public/assets/wallpaper-DfETqQeD.png new file mode 100644 index 0000000..5def0e4 Binary files /dev/null and b/workers/public/assets/wallpaper-DfETqQeD.png differ diff --git a/workers/public/index.html b/workers/public/index.html new file mode 100644 index 0000000..78a2820 --- /dev/null +++ b/workers/public/index.html @@ -0,0 +1,84 @@ + + + + + NodeCrypt + + + + + + + + + + + + + \ No newline at end of file diff --git a/workers/src/index.js b/workers/src/index.js index d9f3130..89301d4 100644 --- a/workers/src/index.js +++ b/workers/src/index.js @@ -1,17 +1,74 @@ import { generateClientId, encryptMessage, decryptMessage, logEvent, isString, isObject, getTime } from './utils.js'; +// 定义Content-Type映射 +const contentTypeMap = { + 'html': 'text/html', + 'css': 'text/css', + 'js': 'text/javascript', + 'json': 'application/json', + 'png': 'image/png', + 'jpg': 'image/jpeg', + 'jpeg': 'image/jpeg', + 'gif': 'image/gif', + 'svg': 'image/svg+xml', + 'ico': 'image/x-icon' +}; + +// 获取文件的Content-Type +function getContentType(filename) { + const ext = filename.split('.').pop().toLowerCase(); + return contentTypeMap[ext] || 'text/plain'; +} + export default { async fetch(request, env, ctx) { - const upgradeHeader = request.headers.get('Upgrade'); - if (!upgradeHeader || upgradeHeader !== 'websocket') { - return new Response('Expected WebSocket Upgrade', { status: 426 }); - } - - // Get or create a Durable Object instance - const id = env.CHAT_ROOM.idFromName('chat-room'); - const stub = env.CHAT_ROOM.get(id); + const url = new URL(request.url); + const path = url.pathname; - return stub.fetch(request); + // 处理WebSocket请求 + const upgradeHeader = request.headers.get('Upgrade'); + if (upgradeHeader && upgradeHeader === 'websocket') { + // Get or create a Durable Object instance + const id = env.CHAT_ROOM.idFromName('chat-room'); + const stub = env.CHAT_ROOM.get(id); + + return stub.fetch(request); + } + + // 处理静态文件请求 + try { + // 根路径重定向到index.html + if (path === '/' || path === '') { + return new Response('', { + status: 302, + headers: { + 'Location': '/index.html' + } + }); + } + + // 从KV存储或Assets中获取静态文件 + let contentPath = path; + if (contentPath.startsWith('/')) { + contentPath = contentPath.substring(1); + } + + // 这里使用了Cloudflare Workers的__STATIC_CONTENT变量来获取静态资源 + // 在实际部署时,您需要将静态文件上传到Cloudflare Workers的Assets中 + const staticContent = await env.__STATIC_CONTENT.get(contentPath, 'stream'); + + if (staticContent === null) { + return new Response('Not Found', { status: 404 }); + } + + return new Response(staticContent, { + headers: { + 'Content-Type': getContentType(contentPath) + } + }); + } catch (error) { + return new Response('Server Error: ' + error.message, { status: 500 }); + } } }; diff --git a/workers/wrangler.toml b/workers/wrangler.toml index f681d37..5b028f4 100644 --- a/workers/wrangler.toml +++ b/workers/wrangler.toml @@ -3,6 +3,10 @@ main = "src/index.js" compatibility_date = "2024-09-23" compatibility_flags = ["nodejs_compat"] +# 配置静态资源 +[site] +bucket = "./public" + [durable_objects] bindings = [ { name = "CHAT_ROOM", class_name = "ChatRoom" }