This commit is contained in:
status-im-auto 2024-10-29 10:40:40 +00:00 committed by Jenkins
parent 8fa5588c7b
commit 4afa6e9d43
39 changed files with 4458 additions and 29 deletions

View File

@ -0,0 +1 @@
import{i as h,I as m,v as p,w,x as g,y as E,z as x,c as O,e as b,H as y,A as M}from"./index-B-6Lwopd.js";function R(s,e){if(!h(s,{strict:!1}))throw new m({address:s});if(!h(e,{strict:!1}))throw new m({address:e});return s.toLowerCase()===e.toLowerCase()}class $ extends p{constructor({callbackSelector:e,cause:a,data:n,extraData:c,sender:d,urls:t}){var i;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(i=a.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${w(f)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat(),name:"OffchainLookupError"})}}class A extends p{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${g(e)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends p{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}const T="0x556f1830",q={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function v(s,{blockNumber:e,blockTag:a,data:n,to:c}){const{args:d}=E({data:n,abi:[q]}),[t,i,f,r,o]=d,{ccipRead:u}=s,k=u&&typeof(u==null?void 0:u.request)=="function"?u.request:C;try{if(!R(c,t))throw new S({sender:t,to:c});const l=await k({data:f,sender:t,urls:i}),{data:L}=await x(s,{blockNumber:e,blockTag:a,data:O([r,b([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return L}catch(l){throw new $({callbackSelector:r,cause:l,data:n,extraData:o,sender:t,urls:i})}}async function C({data:s,sender:e,urls:a}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d<a.length;d++){const t=a[d],i=t.includes("{data}")?"GET":"POST",f=i==="POST"?{data:s,sender:e}:void 0;try{const r=await fetch(t.replace("{sender}",e).replace("{data}",s),{body:JSON.stringify(f),method:i});let o;if((c=r.headers.get("Content-Type"))!=null&&c.startsWith("application/json")?o=(await r.json()).data:o=await r.text(),!r.ok){n=new y({body:f,details:o!=null&&o.error?g(o.error):r.statusText,headers:r.headers,status:r.status,url:t});continue}if(!M(o)){n=new A({result:o,url:t});continue}return o}catch(r){n=new y({body:f,details:r.message,url:t})}}throw n}export{C as ccipRequest,v as offchainLookup,q as offchainLookupAbiItem,T as offchainLookupSignature};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{e as p}from"./events-BzDGR98G.js";function _(n,r){for(var i=0;i<r.length;i++){const e=r[i];if(typeof e!="string"&&!Array.isArray(e)){for(const s in e)if(s!=="default"&&!(s in n)){const o=Object.getOwnPropertyDescriptor(e,s);o&&Object.defineProperty(n,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var l={},g={},f={};Object.defineProperty(f,"__esModule",{value:!0});f.getLowerCase=void 0;function m(n){return n&&n.toLowerCase()}f.getLowerCase=m;Object.defineProperty(g,"__esModule",{value:!0});g.SafeAppProvider=void 0;const w=p,u=f;class k extends w.EventEmitter{constructor(r,i){super(),this.submittedTxs=new Map,this.safe=r,this.sdk=i}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(r){const{method:i,params:e=[]}=r;switch(i){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return`0x${this.chainId.toString(16)}`;case"personal_sign":{const[t,a]=e;if(this.safe.safeAddress.toLowerCase()!==a.toLowerCase())throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(t);return("signature"in h?h.signature:void 0)||"0x"}case"eth_sign":{const[t,a]=e;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase()||!a.startsWith("0x"))throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(a);return("signature"in h?h.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[t,a]=e,h=typeof a=="string"?JSON.parse(a):a;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase())throw new Error("The address is invalid");const c=await this.sdk.txs.signTypedMessage(h);return("signature"in c?c.signature:void 0)||"0x"}case"eth_sendTransaction":const s={...e[0],value:e[0].value||"0",data:e[0].data||"0x"};typeof s.gas=="string"&&s.gas.startsWith("0x")&&(s.gas=parseInt(s.gas,16));const o=await this.sdk.txs.send({txs:[s],params:{safeTxGas:s.gas}});return this.submittedTxs.set(o.safeTxHash,{from:this.safe.safeAddress,hash:o.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:s.data,value:s.value,to:s.to,blockHash:null,blockNumber:null,transactionIndex:null}),o.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,u.getLowerCase)(e[0]),e[1],e[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([e[0],e[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([e[0],e[1]]);case"eth_getTransactionByHash":let d=e[0];try{d=(await this.sdk.txs.getBySafeTxHash(d)).txHash||d}catch{}return this.submittedTxs.has(d)?this.submittedTxs.get(d):this.sdk.eth.getTransactionByHash([d]).then(t=>(t&&(t.hash=e[0]),t));case"eth_getTransactionReceipt":{let t=e[0];try{t=(await this.sdk.txs.getBySafeTxHash(t)).txHash||t}catch{}return this.sdk.eth.getTransactionReceipt([t]).then(a=>(a&&(a.transactionHash=e[0]),a))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(e[0]);case"eth_call":return this.sdk.eth.call([e[0],e[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([e[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(e[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([e[0]]);default:throw Error(`"${r.method}" not implemented`)}}send(r,i){r||i("Undefined request"),this.request(r).then(e=>i(null,{jsonrpc:"2.0",id:r.id,result:e})).catch(e=>i(e,null))}}g.SafeAppProvider=k;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SafeAppProvider=void 0;var r=g;Object.defineProperty(n,"SafeAppProvider",{enumerable:!0,get:function(){return r.SafeAppProvider}})})(l);const T=_({__proto__:null},[l]);export{T as i};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
import{g as n,u as s}from"./index-B-6Lwopd.js";const a=n(s);var r={exports:{}};typeof Object.create=="function"?r.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,t){if(t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}};var u=r.exports;export{u as i,a as r};

14
buddybook/index.html Normal file
View File

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BuddyBook Dogfood</title>
<script type="module" crossorigin src="/assets/index-B-6Lwopd.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Dt_CGZqf.css">
</head>
<body>
<div id="root"></div>
</body>
</html>

1
buddybook/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,13 @@
{
"files": {
"main.css": "/web-chat/static/css/main.4df59f7b.css",
"main.js": "/web-chat/static/js/main.547d0ff0.js",
"main.css": "/web-chat/static/css/main.1a162b96.css",
"main.js": "/web-chat/static/js/main.b0962d94.js",
"index.html": "/web-chat/index.html",
"main.4df59f7b.css.map": "/web-chat/static/css/main.4df59f7b.css.map",
"main.547d0ff0.js.map": "/web-chat/static/js/main.547d0ff0.js.map"
"main.1a162b96.css.map": "/web-chat/static/css/main.1a162b96.css.map",
"main.b0962d94.js.map": "/web-chat/static/js/main.b0962d94.js.map"
},
"entrypoints": [
"static/css/main.4df59f7b.css",
"static/js/main.547d0ff0.js"
"static/css/main.1a162b96.css",
"static/js/main.b0962d94.js"
]
}

View File

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><meta name="description" content="Chat app powered by js-waku"/><link rel="manifest" href="/web-chat/manifest.json"/><link rel="apple-touch-icon" href="/web-chat/favicon.png"/><link rel="icon" href="/web-chat/favicon.ico"/><title>Waku v2 chat app</title><script defer="defer" src="/web-chat/static/js/main.547d0ff0.js"></script><link href="/web-chat/static/css/main.4df59f7b.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><meta name="description" content="Chat app powered by js-waku"/><link rel="manifest" href="/web-chat/manifest.json"/><link rel="apple-touch-icon" href="/web-chat/favicon.png"/><link rel="icon" href="/web-chat/favicon.ico"/><title>Waku v2 chat app</title><script defer="defer" src="/web-chat/static/js/main.b0962d94.js"></script><link href="/web-chat/static/css/main.1a162b96.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"version":3,"file":"static/css/main.1a162b96.css","mappings":"AAAA;;CAAc,CAAd,uCAAc,CAAd,qBAAc,CAAd,8BAAc,CAAd,wCAAc,CAAd,4BAAc,CAAd,uCAAc,CAAd,gHAAc,CAAd,8BAAc,CAAd,eAAc,CAAd,UAAc,CAAd,wBAAc,CAAd,QAAc,CAAd,uBAAc,CAAd,aAAc,CAAd,QAAc,CAAd,4DAAc,CAAd,gCAAc,CAAd,mCAAc,CAAd,mBAAc,CAAd,eAAc,CAAd,uBAAc,CAAd,2BAAc,CAAd,8CAAc,CAAd,mGAAc,CAAd,aAAc,CAAd,8BAAc,CAAd,mBAAc,CAAd,qBAAc,CAAd,aAAc,CAAd,iBAAc,CAAd,sBAAc,CAAd,iBAAc,CAAd,aAAc,CAAd,8BAAc,CAAd,oBAAc,CAAd,aAAc,CAAd,mEAAc,CAAd,aAAc,CAAd,mBAAc,CAAd,cAAc,CAAd,+BAAc,CAAd,mBAAc,CAAd,sBAAc,CAAd,mBAAc,CAAd,QAAc,CAAd,SAAc,CAAd,iCAAc,CAAd,gHAAc,CAAd,wBAAc,CAAd,qBAAc,CAAd,4BAAc,CAAd,gCAAc,CAAd,+BAAc,CAAd,mEAAc,CAAd,0CAAc,CAAd,mBAAc,CAAd,mDAAc,CAAd,sDAAc,CAAd,YAAc,CAAd,yBAAc,CAAd,2DAAc,CAAd,iBAAc,CAAd,yBAAc,CAAd,0BAAc,CAAd,QAAc,CAAd,SAAc,CAAd,gBAAc,CAAd,wBAAc,CAAd,sDAAc,CAAd,SAAc,CAAd,mCAAc,CAAd,wBAAc,CAAd,4DAAc,CAAd,qBAAc,CAAd,qBAAc,CAAd,cAAc,CAAd,qBAAc,CAAd,mDAAc,CAAd,uBAAc,CAAd,kBAAc,CAAd,kBAAc,CAAd,aAAc,CAAd,aAAc,CAAd,aAAc,CAAd,cAAc,CAAd,cAAc,CAAd,YAAc,CAAd,YAAc,CAAd,iBAAc,CAAd,qCAAc,CAAd,6BAAc,CAAd,4BAAc,CAAd,2BAAc,CAAd,cAAc,CAAd,mBAAc,CAAd,qBAAc,CAAd,sBAAc,CAAd,uBAAc,CAAd,iBAAc,CAAd,0BAAc,CAAd,2BAAc,CAAd,yBAAc,CAAd,iCAAc,CAAd,0BAAc,CAAd,qBAAc,CAAd,6BAAc,CAAd,WAAc,CAAd,iBAAc,CAAd,eAAc,CAAd,gBAAc,CAAd,iBAAc,CAAd,aAAc,CAAd,eAAc,CAAd,YAAc,CAAd,kBAAc,CAAd,oBAAc,CAAd,0BAAc,CAAd,wBAAc,CAAd,yBAAc,CAAd,0BAAc,CAAd,sBAAc,CAAd,uBAAc,CAAd,wBAAc,CAAd,qBAAc,CAAd,mBAAc,CAAd,qBAAc,CAAd,oBAAc,CAAd,oBAAc,CAEd,uBAAmB,CAAnB,sBAAmB,CAAnB,kBAAmB,CAAnB,oBAAmB,CAAnB,mBAAmB,CAAnB,sBAAmB,CAAnB,oBAAmB,CAAnB,sBAAmB,CAAnB,sCAAmB,CAAnB,+BAAmB,CAAnB,gCAAmB,CAAnB,8CAAmB,CAAnB,gCAAmB,CAAnB,8EAAmB,CAAnB,gFAAmB,CAAnB,wBAAmB,CAAnB,iCAAmB,CAAnB,sCAAmB,CAAnB,sDAAmB,CAAnB,sCAAmB,CAAnB,sDAAmB,CAAnB,8BAAmB,CAAnB,sDAAmB,CAAnB,8BAAmB,CAAnB,qDAAmB,CAAnB,8BAAmB,CAAnB,mDAAmB,CAAnB,kBAAmB,CAAnB,iBAAmB,CAAnB,uBAAmB,CAAnB,kBAAmB,CAAnB,4CAAmB,CAAnB,0BAAmB,CAAnB,mBAAmB,CAAnB,kCAAmB,CAAnB,6CAAmB,CAAnB,kCAAmB,CAAnB,0CAAmB,CAAnB,+BAAmB,CAAnB,6CAAmB,CAAnB,wLAAmB","sources":["index.css"],"sourcesContent":["@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"],"names":[],"sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"file":"static/css/main.4df59f7b.css","mappings":"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","sources":["index.css"],"sourcesContent":["@tailwind base;\n@tailwind components;\n@tailwind utilities;\n"],"names":[],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{5856:function(){},2678:function(){},5819:function(){},4112:function(){},8080:function(t,i,e){Promise.resolve().then(e.bind(e,5685))},5685:function(t,i,e){"use strict";e.r(i),e.d(i,{default:function(){return h}});var n=e(7437),s=e(1654),r=e.n(s),a=e(2265),u=e(7441),l=e(1177),o=e(6309);let c=a.createContext({status:l.c.Initializing,waku:void 0}),d=t=>{let i=a.useRef(),[e,s]=a.useState(l.c.Initializing);return(a.useEffect(()=>{if(i.current)return;let t=t=>{s(t.detail)};return u.H5.addEventListener(u.J9.Status,t),u.H5.init().then(()=>{i.current=u.H5}),()=>{u.H5.removeEventListener(u.J9.Status,t)}},[i,s]),e===l.c.Failed)?(0,n.jsx)(n.Fragment,{children:e}):e!==l.c.Connected?(0,n.jsx)(o.g,{}):(0,n.jsx)(c.Provider,{value:{status:e,waku:i.current},children:t.children})};function h(t){let{children:i}=t;return(0,n.jsxs)("html",{lang:"en",children:[(0,n.jsx)("title",{children:"Share notes"}),(0,n.jsx)("body",{className:r().className,children:(0,n.jsx)(d,{children:i})})]})}e(2489)},6309:function(t,i,e){"use strict";e.d(i,{g:function(){return s}});var n=e(7437);let s=()=>(0,n.jsx)("div",{className:"loading-block",children:(0,n.jsx)("p",{children:"Loading..."})})},1177:function(t,i,e){"use strict";var n,s;e.d(i,{c:function(){return n},m:function(){return r}});let r="/flush-notes/1/note/proto";(s=n||(n={})).Initializing="Initializing...",s.WaitingForPeers="Waiting for peers...",s.Connected="Connected",s.Failed="Failed to initialize(see logs)"},7441:function(t,i,e){"use strict";e.d(i,{H5:function(){return l},J9:function(){return n}});var n,s=e(1177),r=e(8089),a=e(9527);(n||(n={})).Status="status";class u{async init(){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.emitStatusEvent(s.c.Initializing),this.pubsubTopic=(0,a.L3)(s.m);let t=await (0,r.pq)({defaultBootstrap:!0,contentTopics:[s.m]});await t.start(),this.emitStatusEvent(s.c.WaitingForPeers),await (0,r.gT)(t,[r.Uw.Filter,r.Uw.LightPush,r.Uw.Store]),this.node=t,this.initialized=!0,this.emitStatusEvent(s.c.Connected)}catch(t){console.error("Failed to initialize Waku node:",t),this.emitStatusEvent(s.c.Failed)}this.initializing=!1}}addEventListener(t,i){return this.emitter.addEventListener(t,i)}removeEventListener(t,i){return this.emitter.removeEventListener(t,i)}send(t,i){var e;return this.ensureWakuInitialized(),null===(e=this.node)||void 0===e?void 0:e.lightPush.send(t,i)}async getHistory(t){this.ensureWakuInitialized();let i=[];for await(let e of this.node.store.queryGenerator([t])){let t=await Promise.all(e),n=t.filter(t=>!!t);i=[...i,...n]}return i}async subscribe(t,i){return this.ensureWakuInitialized(),this.node.filter.subscribe(t,i)}emitStatusEvent(t){this.emitter.dispatchEvent(new CustomEvent("status",{detail:t}))}ensureWakuInitialized(){if(!l.initialized){let t="Waku is not initialized.";throw console.log(t),Error(t)}}constructor(){this.emitter=new EventTarget,this.initialized=!1,this.initializing=!1}}let l=new u},2489:function(){},1654:function(t){t.exports={style:{fontFamily:"'__Inter_d65c78', '__Inter_Fallback_d65c78'",fontStyle:"normal"},className:"__className_d65c78"}}},function(t){t.O(0,[948,971,472,744],function(){return t(t.s=8080)}),_N_E=t.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{5856:function(){},2678:function(){},5819:function(){},4112:function(){},8080:function(t,i,e){Promise.resolve().then(e.bind(e,5685))},5685:function(t,i,e){"use strict";e.r(i),e.d(i,{default:function(){return h}});var n=e(7437),s=e(1654),r=e.n(s),a=e(2265),u=e(7441),l=e(1177),o=e(6309);let c=a.createContext({status:l.c.Initializing,waku:void 0}),d=t=>{let i=a.useRef(),[e,s]=a.useState(l.c.Initializing);return(a.useEffect(()=>{if(i.current)return;let t=t=>{s(t.detail)};return u.H5.addEventListener(u.J9.Status,t),u.H5.init().then(()=>{i.current=u.H5}),()=>{u.H5.removeEventListener(u.J9.Status,t)}},[i,s]),e===l.c.Failed)?(0,n.jsx)(n.Fragment,{children:e}):e!==l.c.Connected?(0,n.jsx)(o.g,{}):(0,n.jsx)(c.Provider,{value:{status:e,waku:i.current},children:t.children})};function h(t){let{children:i}=t;return(0,n.jsxs)("html",{lang:"en",children:[(0,n.jsx)("title",{children:"Share notes"}),(0,n.jsx)("body",{className:r().className,children:(0,n.jsx)(d,{children:i})})]})}e(2489)},6309:function(t,i,e){"use strict";e.d(i,{g:function(){return s}});var n=e(7437);let s=()=>(0,n.jsx)("div",{className:"loading-block",children:(0,n.jsx)("p",{children:"Loading..."})})},1177:function(t,i,e){"use strict";var n,s;e.d(i,{c:function(){return n},m:function(){return r}});let r="/flush-notes/1/note/proto";(s=n||(n={})).Initializing="Initializing...",s.WaitingForPeers="Waiting for peers...",s.Connected="Connected",s.Failed="Failed to initialize(see logs)"},7441:function(t,i,e){"use strict";e.d(i,{H5:function(){return l},J9:function(){return n}});var n,s=e(1177),r=e(8089),a=e(9527);(n||(n={})).Status="status";class u{async init(){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.emitStatusEvent(s.c.Initializing),this.pubsubTopic=(0,a.L3)(s.m);let t=await (0,r.pq)({defaultBootstrap:!0,contentTopics:[s.m]});await t.start(),this.emitStatusEvent(s.c.WaitingForPeers),await (0,r.gT)(t,[r.Uw.Filter,r.Uw.LightPush,r.Uw.Store]),this.node=t,this.initialized=!0,this.emitStatusEvent(s.c.Connected)}catch(t){console.error("Failed to initialize Waku node:",t),this.emitStatusEvent(s.c.Failed)}this.initializing=!1}}addEventListener(t,i){return this.emitter.addEventListener(t,i)}removeEventListener(t,i){return this.emitter.removeEventListener(t,i)}send(t,i){var e;return this.ensureWakuInitialized(),null===(e=this.node)||void 0===e?void 0:e.lightPush.send(t,i)}async getHistory(t){this.ensureWakuInitialized();let i=[];for await(let e of this.node.store.queryGenerator([t])){let t=await Promise.all(e),n=t.filter(t=>!!t);i=[...i,...n]}return i}async subscribe(t,i){return this.ensureWakuInitialized(),this.node.filter.subscribe(t,i)}emitStatusEvent(t){this.emitter.dispatchEvent(new CustomEvent("status",{detail:t}))}ensureWakuInitialized(){if(!this.initialized){let t="Waku is not initialized.";throw console.log(t),Error(t)}}constructor(){this.emitter=new EventTarget,this.initialized=!1,this.initializing=!1}}let l=new u},2489:function(){},1654:function(t){t.exports={style:{fontFamily:"'__Inter_d65c78', '__Inter_Fallback_d65c78'",fontStyle:"normal"},className:"__className_d65c78"}}},function(t){t.O(0,[948,971,472,744],function(){return t(t.s=8080)}),_N_E=t.O()}]);

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{5856:function(){},7761:function(){},2678:function(){},5819:function(){},4112:function(){},7747:function(t,e,i){Promise.resolve().then(i.bind(i,5721))},5721:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return o}});var n=i(7437),s=i(2265),r=i(4033),a=i(7923);function o(){let t=(0,r.useRouter)(),{note:e,onNoteChange:i}=u(),s=async()=>{if(e)try{let{id:i,key:n}=await a.$.createNote(e);t.push("/view/".concat(i).concat("?key=".concat(n)))}catch(t){console.error("Failed to create a note:",t)}};return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"note-info",children:"Your record will be stored for couple of days. Markdown is supported."}),(0,n.jsxs)("div",{className:"create-header",children:[(0,n.jsx)("div",{}),(0,n.jsx)("button",{onClick:s,className:"save-note",children:"Save note"})]}),(0,n.jsx)("textarea",{className:"note-value",value:e,onChange:i})]})}let u=()=>{let[t,e]=s.useState("");return{note:t,onNoteChange:t=>{var i;e(null==t?void 0:null===(i=t.currentTarget)||void 0===i?void 0:i.value)}}}},1177:function(t,e,i){"use strict";var n,s;i.d(e,{c:function(){return n},m:function(){return r}});let r="/flush-notes/1/note/proto";(s=n||(n={})).Initializing="Initializing...",s.WaitingForPeers="Waiting for peers...",s.Connected="Connected",s.Failed="Failed to initialize(see logs)"},7923:function(t,e,i){"use strict";i.d(e,{$:function(){return l}});var n=i(7441),s=i(1177),r=i(5136),a=i(8089),o=i(9710);class u{async createNote(t){var e;let i=(0,r.oQ)(),u=(0,r.Mf)({contentTopic:s.m,symKey:i,pubsubTopic:n.H5.pubsubTopic}),l=self.crypto.randomUUID();if(36!==l.length)throw"Unexpected uuid length";let c=await n.H5.send(u,{payload:(0,a.iY)(l+t)});return(null==c?void 0:null===(e=c.failures)||void 0===e?void 0:e.length)&&c.failures.length>0&&console.error("Failures when pushing note: ",c.failures.map(t=>t.error)),{id:l,key:(0,o.ci)(i)}}async readNote(t,e){await this.initMessages((0,o.nr)(e));let i=this.messages.map(t=>{try{let e=(0,a.Md)(t.payload),i=e.substring(0,36),n=e.substring(36);return{id:i,content:n}}catch(t){console.log("Failed to read message:",t)}}).find(e=>{if((null==e?void 0:e.id)===t)return!0});return null==i?void 0:i.content}async initMessages(t){if(this.subscription)return;let e=(0,r.UF)(s.m,t,n.H5.pubsubTopic);this.messages=await n.H5.getHistory(e),this.subscription=await n.H5.subscribe(e,t=>{this.messages.push(t)})}constructor(){this.messages=[]}}let l=new u},7441:function(t,e,i){"use strict";i.d(e,{H5:function(){return u},J9:function(){return n}});var n,s=i(1177),r=i(8089),a=i(9527);(n||(n={})).Status="status";class o{async init(){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.emitStatusEvent(s.c.Initializing),this.pubsubTopic=(0,a.L3)(s.m);let t=await (0,r.pq)({defaultBootstrap:!0,contentTopics:[s.m]});await t.start(),this.emitStatusEvent(s.c.WaitingForPeers),await (0,r.gT)(t,[r.Uw.Filter,r.Uw.LightPush,r.Uw.Store]),this.node=t,this.initialized=!0,this.emitStatusEvent(s.c.Connected)}catch(t){console.error("Failed to initialize Waku node:",t),this.emitStatusEvent(s.c.Failed)}this.initializing=!1}}addEventListener(t,e){return this.emitter.addEventListener(t,e)}removeEventListener(t,e){return this.emitter.removeEventListener(t,e)}send(t,e){var i;return this.ensureWakuInitialized(),null===(i=this.node)||void 0===i?void 0:i.lightPush.send(t,e)}async getHistory(t){this.ensureWakuInitialized();let e=[];for await(let i of this.node.store.queryGenerator([t])){let t=await Promise.all(i),n=t.filter(t=>!!t);e=[...e,...n]}return e}async subscribe(t,e){return this.ensureWakuInitialized(),this.node.filter.subscribe(t,e)}emitStatusEvent(t){this.emitter.dispatchEvent(new CustomEvent("status",{detail:t}))}ensureWakuInitialized(){if(!u.initialized){let t="Waku is not initialized.";throw console.log(t),Error(t)}}constructor(){this.emitter=new EventTarget,this.initialized=!1,this.initializing=!1}}let u=new o}},function(t){t.O(0,[948,990,971,472,744],function(){return t(t.s=7747)}),_N_E=t.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{5856:function(){},7761:function(){},2678:function(){},5819:function(){},4112:function(){},7747:function(t,e,i){Promise.resolve().then(i.bind(i,5721))},5721:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return o}});var n=i(7437),s=i(2265),r=i(4033),a=i(7923);function o(){let t=(0,r.useRouter)(),{note:e,onNoteChange:i}=u(),s=async()=>{if(e)try{let{id:i,key:n}=await a.$.createNote(e);t.push("/view/".concat(i).concat("?key=".concat(n)))}catch(t){console.error("Failed to create a note:",t)}};return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"note-info",children:"Your record will be stored for couple of days. Markdown is supported."}),(0,n.jsxs)("div",{className:"create-header",children:[(0,n.jsx)("div",{}),(0,n.jsx)("button",{onClick:s,className:"save-note",children:"Save note"})]}),(0,n.jsx)("textarea",{className:"note-value",value:e,onChange:i})]})}let u=()=>{let[t,e]=s.useState("");return{note:t,onNoteChange:t=>{var i;e(null==t?void 0:null===(i=t.currentTarget)||void 0===i?void 0:i.value)}}}},1177:function(t,e,i){"use strict";var n,s;i.d(e,{c:function(){return n},m:function(){return r}});let r="/flush-notes/1/note/proto";(s=n||(n={})).Initializing="Initializing...",s.WaitingForPeers="Waiting for peers...",s.Connected="Connected",s.Failed="Failed to initialize(see logs)"},7923:function(t,e,i){"use strict";i.d(e,{$:function(){return l}});var n=i(7441),s=i(1177),r=i(5136),a=i(8089),o=i(9710);class u{async createNote(t){var e;let i=(0,r.oQ)(),u=(0,r.Mf)({contentTopic:s.m,symKey:i,pubsubTopic:n.H5.pubsubTopic}),l=self.crypto.randomUUID();if(36!==l.length)throw"Unexpected uuid length";let c=await n.H5.send(u,{payload:(0,a.iY)(l+t)});return(null==c?void 0:null===(e=c.failures)||void 0===e?void 0:e.length)&&c.failures.length>0&&console.error("Failures when pushing note: ",c.failures.map(t=>t.error)),{id:l,key:(0,o.ci)(i)}}async readNote(t,e){await this.initMessages((0,o.nr)(e));let i=this.messages.map(t=>{try{let e=(0,a.Md)(t.payload),i=e.substring(0,36),n=e.substring(36);return{id:i,content:n}}catch(t){console.log("Failed to read message:",t)}}).find(e=>{if((null==e?void 0:e.id)===t)return!0});return null==i?void 0:i.content}async initMessages(t){if(this.subscription)return;let e=(0,r.UF)(s.m,t,n.H5.pubsubTopic);this.messages=await n.H5.getHistory(e),this.subscription=await n.H5.subscribe(e,t=>{this.messages.push(t)})}constructor(){this.messages=[]}}let l=new u},7441:function(t,e,i){"use strict";i.d(e,{H5:function(){return u},J9:function(){return n}});var n,s=i(1177),r=i(8089),a=i(9527);(n||(n={})).Status="status";class o{async init(){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.emitStatusEvent(s.c.Initializing),this.pubsubTopic=(0,a.L3)(s.m);let t=await (0,r.pq)({defaultBootstrap:!0,contentTopics:[s.m]});await t.start(),this.emitStatusEvent(s.c.WaitingForPeers),await (0,r.gT)(t,[r.Uw.Filter,r.Uw.LightPush,r.Uw.Store]),this.node=t,this.initialized=!0,this.emitStatusEvent(s.c.Connected)}catch(t){console.error("Failed to initialize Waku node:",t),this.emitStatusEvent(s.c.Failed)}this.initializing=!1}}addEventListener(t,e){return this.emitter.addEventListener(t,e)}removeEventListener(t,e){return this.emitter.removeEventListener(t,e)}send(t,e){var i;return this.ensureWakuInitialized(),null===(i=this.node)||void 0===i?void 0:i.lightPush.send(t,e)}async getHistory(t){this.ensureWakuInitialized();let e=[];for await(let i of this.node.store.queryGenerator([t])){let t=await Promise.all(i),n=t.filter(t=>!!t);e=[...e,...n]}return e}async subscribe(t,e){return this.ensureWakuInitialized(),this.node.filter.subscribe(t,e)}emitStatusEvent(t){this.emitter.dispatchEvent(new CustomEvent("status",{detail:t}))}ensureWakuInitialized(){if(!this.initialized){let t="Waku is not initialized.";throw console.log(t),Error(t)}}constructor(){this.emitter=new EventTarget,this.initialized=!1,this.initializing=!1}}let u=new o}},function(t){t.O(0,[948,990,971,472,744],function(){return t(t.s=7747)}),_N_E=t.O()}]);

View File

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[803],{5856:function(){},7761:function(){},2678:function(){},5819:function(){},4112:function(){},629:function(t,e,i){Promise.resolve().then(i.bind(i,8815))},8815:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return c}});var n=i(7437),s=i(2265),r=i(9149),a=i(4033);let u=()=>{let t=(0,a.usePathname)(),e=(0,a.useSearchParams)(),i=t.split("/"),n=i.indexOf("view"),s=e.get("key"),r=i[n+1];return{key:s,id:r}};var o=i(7923),l=i(6309),c=()=>{let t=(0,a.useRouter)(),{id:e,key:i}=u(),[c,d]=s.useState("");return(s.useEffect(()=>{if(!e){t.replace("/404");return}o.$.readNote(e,i).then(t=>d(t||""))},[e,i,d]),c)?(0,n.jsx)(r.U,{children:c}):(0,n.jsx)(l.g,{})}},6309:function(t,e,i){"use strict";i.d(e,{g:function(){return s}});var n=i(7437);let s=()=>(0,n.jsx)("div",{className:"loading-block",children:(0,n.jsx)("p",{children:"Loading..."})})},1177:function(t,e,i){"use strict";var n,s;i.d(e,{c:function(){return n},m:function(){return r}});let r="/flush-notes/1/note/proto";(s=n||(n={})).Initializing="Initializing...",s.WaitingForPeers="Waiting for peers...",s.Connected="Connected",s.Failed="Failed to initialize(see logs)"},7923:function(t,e,i){"use strict";i.d(e,{$:function(){return l}});var n=i(7441),s=i(1177),r=i(5136),a=i(8089),u=i(9710);class o{async createNote(t){var e;let i=(0,r.oQ)(),o=(0,r.Mf)({contentTopic:s.m,symKey:i,pubsubTopic:n.H5.pubsubTopic}),l=self.crypto.randomUUID();if(36!==l.length)throw"Unexpected uuid length";let c=await n.H5.send(o,{payload:(0,a.iY)(l+t)});return(null==c?void 0:null===(e=c.failures)||void 0===e?void 0:e.length)&&c.failures.length>0&&console.error("Failures when pushing note: ",c.failures.map(t=>t.error)),{id:l,key:(0,u.ci)(i)}}async readNote(t,e){await this.initMessages((0,u.nr)(e));let i=this.messages.map(t=>{try{let e=(0,a.Md)(t.payload),i=e.substring(0,36),n=e.substring(36);return{id:i,content:n}}catch(t){console.log("Failed to read message:",t)}}).find(e=>{if((null==e?void 0:e.id)===t)return!0});return null==i?void 0:i.content}async initMessages(t){if(this.subscription)return;let e=(0,r.UF)(s.m,t,n.H5.pubsubTopic);this.messages=await n.H5.getHistory(e),this.subscription=await n.H5.subscribe(e,t=>{this.messages.push(t)})}constructor(){this.messages=[]}}let l=new o},7441:function(t,e,i){"use strict";i.d(e,{H5:function(){return o},J9:function(){return n}});var n,s=i(1177),r=i(8089),a=i(9527);(n||(n={})).Status="status";class u{async init(){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.emitStatusEvent(s.c.Initializing),this.pubsubTopic=(0,a.L3)(s.m);let t=await (0,r.pq)({defaultBootstrap:!0,contentTopics:[s.m]});await t.start(),this.emitStatusEvent(s.c.WaitingForPeers),await (0,r.gT)(t,[r.Uw.Filter,r.Uw.LightPush,r.Uw.Store]),this.node=t,this.initialized=!0,this.emitStatusEvent(s.c.Connected)}catch(t){console.error("Failed to initialize Waku node:",t),this.emitStatusEvent(s.c.Failed)}this.initializing=!1}}addEventListener(t,e){return this.emitter.addEventListener(t,e)}removeEventListener(t,e){return this.emitter.removeEventListener(t,e)}send(t,e){var i;return this.ensureWakuInitialized(),null===(i=this.node)||void 0===i?void 0:i.lightPush.send(t,e)}async getHistory(t){this.ensureWakuInitialized();let e=[];for await(let i of this.node.store.queryGenerator([t])){let t=await Promise.all(i),n=t.filter(t=>!!t);e=[...e,...n]}return e}async subscribe(t,e){return this.ensureWakuInitialized(),this.node.filter.subscribe(t,e)}emitStatusEvent(t){this.emitter.dispatchEvent(new CustomEvent("status",{detail:t}))}ensureWakuInitialized(){if(!o.initialized){let t="Waku is not initialized.";throw console.log(t),Error(t)}}constructor(){this.emitter=new EventTarget,this.initialized=!1,this.initializing=!1}}let o=new u}},function(t){t.O(0,[948,990,149,971,472,744],function(){return t(t.s=629)}),_N_E=t.O()}]);

View File

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[803],{5856:function(){},7761:function(){},2678:function(){},5819:function(){},4112:function(){},629:function(t,i,e){Promise.resolve().then(e.bind(e,8815))},8815:function(t,i,e){"use strict";e.r(i),e.d(i,{default:function(){return c}});var n=e(7437),s=e(2265),r=e(9149),a=e(4033);let o=()=>{var t,i;let e=new URLSearchParams((null===(i=window)||void 0===i?void 0:null===(t=i.location)||void 0===t?void 0:t.search)||""),n=e.get("id")||"",s=e.get("key")||"";return{key:s,id:n}};var u=e(7923),l=e(6309),c=()=>{let t=(0,a.useRouter)(),{id:i,key:e}=o(),[c,d]=s.useState("");return(s.useEffect(()=>{if(!i){t.replace("/404");return}u.$.readNote(i,e).then(t=>d(t||""))},[i,e,d,t]),c)?(0,n.jsx)(r.U,{children:c}):(0,n.jsx)(l.g,{})}},6309:function(t,i,e){"use strict";e.d(i,{g:function(){return s}});var n=e(7437);let s=()=>(0,n.jsx)("div",{className:"loading-block",children:(0,n.jsx)("p",{children:"Loading..."})})},1177:function(t,i,e){"use strict";var n,s;e.d(i,{c:function(){return n},m:function(){return r}});let r="/flush-notes/1/note/proto";(s=n||(n={})).Initializing="Initializing...",s.WaitingForPeers="Waiting for peers...",s.Connected="Connected",s.Failed="Failed to initialize(see logs)"},7923:function(t,i,e){"use strict";e.d(i,{$:function(){return l}});var n=e(7441),s=e(1177),r=e(5136),a=e(8089),o=e(9710);class u{async createNote(t){var i;let e=(0,r.oQ)(),u=(0,r.Mf)({contentTopic:s.m,symKey:e,pubsubTopic:n.H5.pubsubTopic}),l=self.crypto.randomUUID();if(36!==l.length)throw"Unexpected uuid length";let c=await n.H5.send(u,{payload:(0,a.iY)(l+t)});return(null==c?void 0:null===(i=c.failures)||void 0===i?void 0:i.length)&&c.failures.length>0&&console.error("Failures when pushing note: ",c.failures.map(t=>t.error)),{id:l,key:(0,o.ci)(e)}}async readNote(t,i){await this.initMessages((0,o.nr)(i));let e=this.messages.map(t=>{try{let i=(0,a.Md)(t.payload),e=i.substring(0,36),n=i.substring(36);return{id:e,content:n}}catch(t){console.log("Failed to read message:",t)}}).find(i=>{if((null==i?void 0:i.id)===t)return!0});return null==e?void 0:e.content}async initMessages(t){if(this.subscription)return;let i=(0,r.UF)(s.m,t,n.H5.pubsubTopic);this.messages=await n.H5.getHistory(i),this.subscription=await n.H5.subscribe(i,t=>{this.messages.push(t)})}constructor(){this.messages=[]}}let l=new u},7441:function(t,i,e){"use strict";e.d(i,{H5:function(){return u},J9:function(){return n}});var n,s=e(1177),r=e(8089),a=e(9527);(n||(n={})).Status="status";class o{async init(){if(!this.initialized&&!this.initializing){this.initializing=!0;try{this.emitStatusEvent(s.c.Initializing),this.pubsubTopic=(0,a.L3)(s.m);let t=await (0,r.pq)({defaultBootstrap:!0,contentTopics:[s.m]});await t.start(),this.emitStatusEvent(s.c.WaitingForPeers),await (0,r.gT)(t,[r.Uw.Filter,r.Uw.LightPush,r.Uw.Store]),this.node=t,this.initialized=!0,this.emitStatusEvent(s.c.Connected)}catch(t){console.error("Failed to initialize Waku node:",t),this.emitStatusEvent(s.c.Failed)}this.initializing=!1}}addEventListener(t,i){return this.emitter.addEventListener(t,i)}removeEventListener(t,i){return this.emitter.removeEventListener(t,i)}send(t,i){var e;return this.ensureWakuInitialized(),null===(e=this.node)||void 0===e?void 0:e.lightPush.send(t,i)}async getHistory(t){this.ensureWakuInitialized();let i=[];for await(let e of this.node.store.queryGenerator([t])){let t=await Promise.all(e),n=t.filter(t=>!!t);i=[...i,...n]}return i}async subscribe(t,i){return this.ensureWakuInitialized(),this.node.filter.subscribe(t,i)}emitStatusEvent(t){this.emitter.dispatchEvent(new CustomEvent("status",{detail:t}))}ensureWakuInitialized(){if(!this.initialized){let t="Waku is not initialized.";throw console.log(t),Error(t)}}constructor(){this.emitter=new EventTarget,this.initialized=!1,this.initializing=!1}}let u=new o}},function(t){t.O(0,[948,990,149,971,472,744],function(){return t(t.s=629)}),_N_E=t.O()}]);

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
1:HL["/_next/static/media/a34f9d1faa5f3315-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
2:HL["/_next/static/css/93e318bfbcd18d37.css","style",{"crossOrigin":""}]
0:["Wn00J-QkjvXTJhi4lpAoC",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]]
5:I[5685,["948","static/chunks/948-50bbf5866eb892b4.js","185","static/chunks/app/layout-728a76cd335ea299.js"],""]
0:["uspfk6pqKRl83s-QjjuPw",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]]
5:I[5685,["948","static/chunks/948-50bbf5866eb892b4.js","185","static/chunks/app/layout-6076b03a814c7003.js"],""]
6:I[6954,[],""]
7:I[7264,[],""]
9:I[8297,[],""]
a:I[5721,["948","static/chunks/948-50bbf5866eb892b4.js","990","static/chunks/990-35c20412112b0913.js","931","static/chunks/app/page-6f37c3f6b755896a.js"],""]
a:I[5721,["948","static/chunks/948-50bbf5866eb892b4.js","990","static/chunks/990-221729f16830b71b.js","931","static/chunks/app/page-1fab92edd07a9fd3.js"],""]
b:{}
3:[null,["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$L8",["$","$L9",null,{"propsForComponent":{"params":{}},"Component":"$a","isStaticGeneration":true}],null],"segment":"__PAGE__"},"styles":null}],"params":"$b"}],null]
4:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"32x32"}],["$","meta","3",{"name":"next-size-adjust"}]]

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
1:HL["/_next/static/media/a34f9d1faa5f3315-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
2:HL["/_next/static/css/93e318bfbcd18d37.css","style",{"crossOrigin":""}]
0:["Wn00J-QkjvXTJhi4lpAoC",[[["",{"children":["view",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]]
5:I[5685,["948","static/chunks/948-50bbf5866eb892b4.js","185","static/chunks/app/layout-728a76cd335ea299.js"],""]
0:["uspfk6pqKRl83s-QjjuPw",[[["",{"children":["view",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]]
5:I[5685,["948","static/chunks/948-50bbf5866eb892b4.js","185","static/chunks/app/layout-6076b03a814c7003.js"],""]
6:I[6954,[],""]
7:I[7264,[],""]
9:I[8297,[],""]
a:I[8815,["948","static/chunks/948-50bbf5866eb892b4.js","990","static/chunks/990-35c20412112b0913.js","149","static/chunks/149-4f27ed9900df2b44.js","803","static/chunks/app/view/page-40306218709107ea.js"],""]
a:I[8815,["948","static/chunks/948-50bbf5866eb892b4.js","990","static/chunks/990-221729f16830b71b.js","149","static/chunks/149-4f27ed9900df2b44.js","803","static/chunks/app/view/page-df1439bdda084351.js"],""]
b:{}
3:[null,["$","$L5",null,{"children":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"childProp":{"current":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children","view","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","childProp":{"current":["$L8",["$","$L9",null,{"propsForComponent":{"params":{}},"Component":"$a","isStaticGeneration":true}],null],"segment":"__PAGE__"},"styles":null}],"segment":"view"},"styles":null}],"params":"$b"}],null]
4:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","link","2",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"32x32"}],["$","meta","3",{"name":"next-size-adjust"}]]