@fkn/lib 0.9.73 → 0.9.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{account-URj9bMMj.js → account-CTOhAc2x.js} +2 -2
- package/{account-BdwCDacQ.cjs → account-DO7KokEs.cjs} +1 -1
- package/{account-generation--7m_60Fl.cjs → account-generation-6F54U_B3.cjs} +1 -1
- package/{account-generation-DgK9YHiL.js → account-generation-Cq_xRcUr.js} +1 -1
- package/{account-C9w41S0_.d.ts → account-kRplShh-.d.ts} +1 -1
- package/{account-storage-CcdeHbnj.js → account-storage-DQryXWDZ.js} +2 -2
- package/{account-storage-CQ8k71N3.cjs → account-storage-f0HN_zgo.cjs} +1 -1
- package/account.cjs +1 -1
- package/account.d.ts +2 -2
- package/account.js +1 -1
- package/{api-iKK1u-V0.d.ts → api-CXvE64Jr.d.ts} +2 -2
- package/{api-De7vAubY.js → api-DR6y3Q0Y.js} +152 -135
- package/api-RuHgAkxf.cjs +3 -0
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.d.ts +1 -1
- package/cloud/dgram.js +1 -1
- package/cloud/dns.cjs +1 -1
- package/cloud/dns.d.ts +2 -2
- package/cloud/dns.js +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.cjs +1 -1
- package/cloud/fs/promises.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +2 -2
- package/cloud/http.cjs +1 -1
- package/cloud/http.d.ts +1 -1
- package/cloud/http.js +1 -1
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +1 -1
- package/{cloud-BDTtnMtj.d.ts → cloud-C9alQ9TA.d.ts} +5 -5
- package/{cloud-Bv_GUwcG.js → cloud-Cn27x6RK.js} +8 -8
- package/{cloud-Buku7KQJ.cjs → cloud-CrKxBmgy.cjs} +1 -1
- package/cloud.cjs +1 -1
- package/cloud.d.ts +6 -6
- package/cloud.js +7 -7
- package/{contract-Cqq1vOqF.d.ts → contract-B-iUk1mJ.d.ts} +1 -1
- package/contract.d.ts +2 -2
- package/{dgram-CYegbMMa.js → dgram-Cj1vkCE9.js} +1 -1
- package/{dgram-BgWDRjw-.cjs → dgram-D7I5nP9w.cjs} +1 -1
- package/{dgram-BggVwnRp.d.ts → dgram-D9DiXmhU.d.ts} +4 -4
- package/dgram.cjs +1 -1
- package/dgram.d.ts +1 -1
- package/dgram.js +1 -1
- package/{dns-DTbLD2s6.js → dns-43gybmwY.js} +1 -1
- package/{dns-DeuTGd8C.d.ts → dns-CfUsfETG.d.ts} +1 -1
- package/{dns-CtxN7cCj.cjs → dns-D8cfGYaF.cjs} +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +2 -2
- package/dns.js +1 -1
- package/{extension-DHx7sHE4.cjs → extension-D8Kj6rRT.cjs} +1 -1
- package/{extension-0RxQ4Bor.js → extension-DFeaP0Ou.js} +3 -3
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-BJdr72O6.js → fs-BnCWJ-jg.js} +1 -1
- package/{fs-BPfRlX_R.cjs → fs-COtIapGm.cjs} +1 -1
- package/{fs-C0RZ54fk.js → fs-DXz_TgC8.js} +3 -3
- package/{fs-1Q6VCx3d.cjs → fs-Dp_8uaZe.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/{http-DkvhaPVT.cjs → http-B72t08kn.cjs} +2 -2
- package/{http-LhyEQ2D8.d.ts → http-D1qvoYf6.d.ts} +1 -1
- package/{http-D-rs8b6m.js → http-DLMUTBb4.js} +2 -2
- package/http.cjs +1 -1
- package/http.d.ts +1 -1
- package/http.js +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +13 -14
- package/index.js +32 -38
- package/{lib-B4Th0aXQ.js → lib-DIxvhbhf.js} +1 -1
- package/{lib-By2YAF1s.cjs → lib-uND2BvAa.cjs} +1 -1
- package/{net-CK_1P9_C.d.ts → net-B0N6hTWu.d.ts} +4 -4
- package/net-D7oBrZbA.cjs +1 -0
- package/{net-C_R3PDi7.js → net-wirsgKVa.js} +26 -25
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/{packages-CNXf-8A8.js → packages-BAc5K4BQ.js} +1 -1
- package/{packages-FCSR6WEw.d.ts → packages-DTs-fy67.d.ts} +1 -1
- package/{packages-BwD1QMOz.cjs → packages-DkKru6li.cjs} +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +2 -2
- package/packages.js +1 -1
- package/{proxy-Xe45WiQU.d.ts → proxy-1E6vjFKx.d.ts} +2 -2
- package/{proxy-OrF-WHyi.js → proxy-BmptuWKa.js} +1 -1
- package/{proxy-CgISk6T6.cjs → proxy-CLsTNt40.cjs} +1 -1
- package/{relay-choice-BhdjlopH.d.ts → relay-choice-BeNCw3ba.d.ts} +1 -1
- package/{rooms-lJGFgMXH.d.ts → rooms-APVrHbvL.d.ts} +1 -1
- package/{rooms-B_sM_Z93.cjs → rooms-BJ5MQq-S.cjs} +1 -1
- package/{rooms-Dz13jhtS.js → rooms-a1_jHEhL.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +2 -2
- package/rooms.js +1 -1
- package/{storage-Dd3miXPI.js → storage-ChE9vSDe.js} +3 -3
- package/{storage-B49NeC-h.cjs → storage-D9_L4Coi.cjs} +1 -1
- package/{storage-ngeijVxI.d.ts → storage-YQNVOwp8.d.ts} +1 -1
- package/storage.cjs +1 -1
- package/storage.d.ts +2 -2
- package/storage.js +1 -1
- package/websocket.cjs +1 -1
- package/websocket.js +1 -1
- package/{wire-DhmLnYEU.d.ts → wire-Cddfpu2U.d.ts} +12 -1
- package/wire.cjs +1 -1
- package/wire.d.ts +2 -2
- package/wire.js +6 -2
- package/api-BORAfb8e.cjs +0 -3
- package/net-B3SziNT3.cjs +0 -1
package/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as API_DEADLINE_MS, n as BrokerUnreachableError, r as OwnChannelUnavailableError, i as apiInFlight, a as apiLastCall, o as apiPromise, s as apiWithin, c as currentApiEpoch, l as hasTransport, u as onApiEpoch } from "./api-
|
|
1
|
+
export { t as API_DEADLINE_MS, n as BrokerUnreachableError, r as OwnChannelUnavailableError, i as apiInFlight, a as apiLastCall, o as apiPromise, s as apiWithin, c as currentApiEpoch, l as hasTransport, u as onApiEpoch } from "./api-DR6y3Q0Y.js";
|
package/cloud/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../dgram-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../dgram-D7I5nP9w.cjs");exports.Socket=e.t,exports.createSocket=e.n,exports.default=e.r;
|
package/cloud/dgram.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, r as createSocket, t as Socket } from "../dgram-
|
|
1
|
+
import { n as _default, r as createSocket, t as Socket } from "../dgram-D9DiXmhU.js";
|
|
2
2
|
export { Socket, createSocket, _default as default };
|
package/cloud/dgram.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Socket, n as createSocket, r as default } from "../dgram-
|
|
1
|
+
export { t as Socket, n as createSocket, r as default } from "../dgram-Cj1vkCE9.js";
|
package/cloud/dns.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../dns-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../dns-D8cfGYaF.cjs");exports.lookup=e.n;
|
package/cloud/dns.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { s as AddressLookupResult } from "../contract-
|
|
2
|
-
import { n as lookup } from "../dns-
|
|
1
|
+
import { s as AddressLookupResult } from "../contract-B-iUk1mJ.js";
|
|
2
|
+
import { n as lookup } from "../dns-CfUsfETG.js";
|
|
3
3
|
export { type AddressLookupResult, lookup };
|
package/cloud/dns.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as lookup } from "../dns-
|
|
1
|
+
export { n as lookup } from "../dns-43gybmwY.js";
|
package/cloud/fetch.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-CLsTNt40.cjs");exports.fetch=e.t;
|
package/cloud/fetch.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as cloudFetch } from "../proxy-
|
|
1
|
+
import { t as cloudFetch } from "../proxy-1E6vjFKx.js";
|
|
2
2
|
export { cloudFetch as fetch };
|
package/cloud/fetch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as fetch } from "../proxy-
|
|
1
|
+
export { t as fetch } from "../proxy-BmptuWKa.js";
|
package/cloud/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var{readFile:e,writeFile:t,unlink:n,rename:r,readdir:i,mkdir:a,rm:o,rmdir:s,stat:c,lstat:l,access:u}=require("../../fs-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var{readFile:e,writeFile:t,unlink:n,rename:r,readdir:i,mkdir:a,rm:o,rmdir:s,stat:c,lstat:l,access:u}=require("../../fs-Dp_8uaZe.cjs").a;exports.access=u,exports.lstat=l,exports.mkdir=a,exports.readFile=e,exports.readdir=i,exports.rename=r,exports.rm=o,exports.rmdir=s,exports.stat=c,exports.unlink=n,exports.writeFile=t;
|
package/cloud/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e } from "../../fs-
|
|
1
|
+
import { a as e } from "../../fs-BnCWJ-jg.js";
|
|
2
2
|
// src/cloud/fs-promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, unlink: r, rename: i, readdir: a, mkdir: o, rm: s, rmdir: c, stat: l, lstat: u, access: d } = e;
|
|
4
4
|
export { d as access, u as lstat, o as mkdir, t as readFile, a as readdir, i as rename, s as rm, c as rmdir, l as stat, r as unlink, n as writeFile };
|
package/cloud/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../messages.cjs"),t=require("../account-storage-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../messages.cjs"),t=require("../account-storage-f0HN_zgo.cjs"),n=require("../fs-Dp_8uaZe.cjs");exports.STORAGE_ACCOUNT_CHANGED=e.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=e.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.STORAGE_NOT_FOUND=e.STORAGE_NOT_FOUND,exports.StorageAccountChangedError=t.t,exports.StorageAccountPinUnsupportedError=t.n,exports.StorageLockedError=t.r,exports.StorageNotFoundError=t.i,exports.availability=t.o,exports.available=n.t,exports.encryption=t.c,exports.isAccountChanged=t.l,exports.isNotFound=t.d,exports.list=n.r,exports.mkdir=n.i,exports.promises=n.a,exports.quota=t.h,exports.readFile=n.o,exports.readFileSealed=n.s,exports.readdir=n.c,exports.rename=n.l,exports.rm=n.u,exports.stat=n.d,exports.unlink=n.f,exports.unlock=t.y,exports.writeFile=n.p;
|
package/cloud/fs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { STORAGE_ACCOUNT_CHANGED as e, STORAGE_ACCOUNT_PIN_UNSUPPORTED as t, STORAGE_NOT_FOUND as n } from "../messages.js";
|
|
2
|
-
import { c as r, d as i, h as a, i as o, l as s, n as c, o as l, r as u, t as d, y as f } from "../account-storage-
|
|
3
|
-
import { a as p, c as m, d as h, f as g, i as _, l as v, o as y, p as b, r as x, s as S, t as C, u as w } from "../fs-
|
|
2
|
+
import { c as r, d as i, h as a, i as o, l as s, n as c, o as l, r as u, t as d, y as f } from "../account-storage-DQryXWDZ.js";
|
|
3
|
+
import { a as p, c as m, d as h, f as g, i as _, l as v, o as y, p as b, r as x, s as S, t as C, u as w } from "../fs-BnCWJ-jg.js";
|
|
4
4
|
export { e as STORAGE_ACCOUNT_CHANGED, t as STORAGE_ACCOUNT_PIN_UNSUPPORTED, n as STORAGE_NOT_FOUND, d as StorageAccountChangedError, c as StorageAccountPinUnsupportedError, u as StorageLockedError, o as StorageNotFoundError, l as availability, C as available, r as encryption, s as isAccountChanged, i as isNotFound, x as list, _ as mkdir, p as promises, a as quota, y as readFile, S as readFileSealed, m as readdir, v as rename, w as rm, h as stat, g as unlink, f as unlock, b as writeFile };
|
package/cloud/http.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../http-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../http-B72t08kn.cjs");exports.Agent=e.t,exports.ClientRequest=e.n,exports.HTTPParser=e.r,exports.IncomingMessage=e.i,exports.METHODS=e.a,exports.STATUS_CODES=e.o,exports.Server=e.s,exports.ServerResponse=e.c,exports._default=e.l,exports.default=e.l,exports.createServer=e.u,exports.get=e.d,exports.globalAgent=e.f,exports.request=e.m;
|
package/cloud/http.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as IncomingMessage, c as RequestListener, d as ServerResponse, f as ServerResponseOptions, g as globalAgent, h as get, i as HTTPParser, l as STATUS_CODES, m as createServer, n as ClientRequest, o as METHODS, p as _default, r as ClientRequestArgs, s as ParsedHead, t as Agent, u as Server, v as request } from "../http-
|
|
1
|
+
import { a as IncomingMessage, c as RequestListener, d as ServerResponse, f as ServerResponseOptions, g as globalAgent, h as get, i as HTTPParser, l as STATUS_CODES, m as createServer, n as ClientRequest, o as METHODS, p as _default, r as ClientRequestArgs, s as ParsedHead, t as Agent, u as Server, v as request } from "../http-D1qvoYf6.js";
|
|
2
2
|
export { Agent, ClientRequest, ClientRequestArgs, HTTPParser, IncomingMessage, METHODS, ParsedHead, RequestListener, STATUS_CODES, Server, ServerResponse, ServerResponseOptions, _default, _default as default, createServer, get, globalAgent, request };
|
package/cloud/http.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Agent, n as ClientRequest, r as HTTPParser, i as IncomingMessage, a as METHODS, o as STATUS_CODES, s as Server, c as ServerResponse, l as _default, l as default, u as createServer, d as get, f as globalAgent, m as request } from "../http-
|
|
1
|
+
export { t as Agent, n as ClientRequest, r as HTTPParser, i as IncomingMessage, a as METHODS, o as STATUS_CODES, s as Server, c as ServerResponse, l as _default, l as default, u as createServer, d as get, f as globalAgent, m as request } from "../http-DLMUTBb4.js";
|
package/cloud/net.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../utils-BpHmMkIR.cjs"),t=require("../net-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../utils-BpHmMkIR.cjs"),t=require("../net-D7oBrZbA.cjs");exports.Server=t.t,exports.Socket=t.n,exports._default=t.r,exports.default=t.r,exports.connect=t.i,exports.createConnection=t.a,exports.createServer=t.o,exports.isIP=e.t,exports.isIPv4=e.n,exports.isIPv6=e.r;
|
package/cloud/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-B0N6hTWu.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
package/cloud/net.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "../utils-DtWP-E9x.js";
|
|
2
|
-
import { a as r, i, n as a, o, r as s, t as c } from "../net-
|
|
2
|
+
import { a as r, i, n as a, o, r as s, t as c } from "../net-wirsgKVa.js";
|
|
3
3
|
export { c as Server, a as Socket, s as _default, s as default, i as connect, r as createConnection, o as createServer, n as isIP, e as isIPv4, t as isIPv6 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as AttachFrameFunction } from "./index-HMfzm6dF.js";
|
|
2
|
-
import { t as cloudFetch } from "./proxy-
|
|
3
|
-
import { t as dns_d_exports } from "./dns-
|
|
2
|
+
import { t as cloudFetch } from "./proxy-1E6vjFKx.js";
|
|
3
|
+
import { t as dns_d_exports } from "./dns-CfUsfETG.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-ChOYC6VD.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
6
|
-
import { i as dgram_d_exports } from "./dgram-
|
|
7
|
-
import { _ as http_d_exports } from "./http-
|
|
5
|
+
import { s as net_d_exports } from "./net-B0N6hTWu.js";
|
|
6
|
+
import { i as dgram_d_exports } from "./dgram-D9DiXmhU.js";
|
|
7
|
+
import { _ as http_d_exports } from "./http-D1qvoYf6.js";
|
|
8
8
|
/**
|
|
9
9
|
* Attaches the render proxy to an iframe the app mounted, or opens it in a window of its own with
|
|
10
10
|
* `{ window }`. A window opens before the first await, so call this directly in a click handler.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { D as t, E as n, N as r, O as i, T as a, _ as o, c as s, f as c, ft as l, g as u, h as d, j as f, k as p, l as m, m as h, o as g, p as _, s as v, u as y, x as b, y as x } from "./lib-
|
|
3
|
-
import { t as S } from "./proxy-
|
|
2
|
+
import { D as t, E as n, N as r, O as i, T as a, _ as o, c as s, f as c, ft as l, g as u, h as d, j as f, k as p, l as m, m as h, o as g, p as _, s as v, u as y, x as b, y as x } from "./lib-DIxvhbhf.js";
|
|
3
|
+
import { t as S } from "./proxy-BmptuWKa.js";
|
|
4
4
|
import { c as C, m as w, t as T } from "./hosts-HUfgMimI.js";
|
|
5
5
|
import { a as E } from "./broker-frame-AQDD3D9E.js";
|
|
6
|
-
import { l as D, n as O, o as k, s as A } from "./api-
|
|
6
|
+
import { l as D, n as O, o as k, s as A } from "./api-DR6y3Q0Y.js";
|
|
7
7
|
import { r as j } from "./busy-C1JPjoZ_.js";
|
|
8
8
|
import { ATTACH_FRAME_KEY as M, ATTACH_WINDOW_KEY as ee, ATTACH_WINDOW_MESSAGE as N, RELAY_CHOICE_UNSUPPORTED as P, WINDOW_HANDSHAKE_TIMEOUT_MS as te } from "./contract.js";
|
|
9
9
|
import { a as F, i as I, t as L } from "./relay-choice-Bb3oP2gw.js";
|
|
10
10
|
import { frameFetchVerdict as R } from "./attach-policy.js";
|
|
11
|
-
import { t as ne } from "./dns-
|
|
12
|
-
import { n as re } from "./fs-
|
|
13
|
-
import { s as ie } from "./net-
|
|
14
|
-
import { i as ae } from "./dgram-
|
|
15
|
-
import { p as oe } from "./http-
|
|
11
|
+
import { t as ne } from "./dns-43gybmwY.js";
|
|
12
|
+
import { n as re } from "./fs-BnCWJ-jg.js";
|
|
13
|
+
import { s as ie } from "./net-wirsgKVa.js";
|
|
14
|
+
import { i as ae } from "./dgram-Cj1vkCE9.js";
|
|
15
|
+
import { p as oe } from "./http-DLMUTBb4.js";
|
|
16
16
|
import { expose as z } from "osra";
|
|
17
17
|
// src/cloud/frame-broker.ts
|
|
18
18
|
var se = async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-By2YAF1s.cjs"),n=require("./proxy-CgISk6T6.cjs"),r=require("./hosts-GNBhZO3-.cjs"),i=require("./broker-frame-cVEhez7A.cjs"),a=require("./api-BORAfb8e.cjs"),o=require("./busy-BXbVH595.cjs"),s=require("./contract.cjs"),c=require("./relay-choice-JC_JJY_M.cjs"),l=require("./attach-policy.cjs"),u=require("./dns-CtxN7cCj.cjs"),d=require("./fs-1Q6VCx3d.cjs"),f=require("./net-B3SziNT3.cjs"),p=require("./dgram-BgWDRjw-.cjs"),m=require("./http-DkvhaPVT.cjs");let h=require("osra");var g=async()=>{let e=()=>a.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof a.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},_=`frame: this frame no longer holds the document the app attached it to`,v=!1,y=()=>{v||(v=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},b=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),x=e=>typeof e?.reason==`string`?{reason:e.reason}:{},S=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,C=e=>{let{assertLive:n,attach:i,consent:a,current:o,declaredHosts:s,documentHost:c,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(o()).hostname}catch{return``}},h=async()=>c?await c():m(),g=()=>r.t([...s,...b(f)]),v=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:o,phase:c})=>{n();let y=r.m(e,o);if(y===null)return;let b=t.h(y);if(b===void 0||b===`auto`)return;if(e===`fetch`){let e=l.frameFetchVerdict({session:d,declaredHosts:s,approvedOrigins:f},c===`ensure`?void 0:o[0],{classifier:`fetchTarget`});if(c===`ensure`&&!d)throw t.k(e.kind===`refuse`?e.reason:``,`fetch`);if(c!==`ensure`&&e.kind===`refuse`)throw t.k(e.reason,`fetch`);let{request:n,ensure:i}=await a();if(!n){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:r.c(o[0],o[1]).scope,hosts:e.promptHosts}))throw t.k(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await h(),p=r.t([u,...s]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await v(n,{category:`network`,hosts:p,...x(t.T(o))})===!1)throw t.k(S(`fetch`,`network`,u||null),`fetch`);return}let C=await h();if(!C)throw t.k(`frame: navigate the frame before ${e}`,e);if(!g().includes(C))throw t.k(_,e);let w=t.m(y);if(w===void 0||w===`evaluation`&&C===m()&&await u?.()||b===`critical`&&p.has(`${y} ${C}`))return;let{request:T}=await a();if(!T)return;let E=r.t([C,...s]),D=x(t.T(o)),O=b===`critical`?{key:y,hosts:E,attach:i,...D}:{category:w,hosts:E,...D},k=await v(T,O);if(k===!1)throw t.k(S(e,w,null),e);if(k===`once`&&c!==`ensure`)for(let e of E)p.add(`${y} ${e}`)},requestCategories:async e=>{n(),t.f(`frame.requestPermissions`,e);let o=await h(),c=r.t(o?[o,...s]:s);if(!c.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:c,allow:r}),{request:d}=await a();if(!d)return y(),l.map(e=>u(e,!1));let f=await d(l.map(({named:t,critical:n,category:r},a)=>{let o=x(e[a]);return n?{key:t,hosts:c,attach:i,...o}:{category:r,hosts:c,...o}}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:g}},w=e=>e,T=5e3,E=new Set([]),D=()=>`https://fkn.app`,O=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,k=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.E(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},A=e=>Object.assign(Error(e),{name:t.D}),j=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,M=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,N=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,P=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,F=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,I=3e4,L=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,R=2e4,z=async(e,n)=>{if(typeof e.seed!=`function`)throw t.N(L,`storageState`,`cloud`);try{await k(e.seed(n),R,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.O(e)?t.N(L,`storageState`,`cloud`):e}},B=`frame.clearCookies: the render proxy did not answer within ${I}ms; the cookies may or may not be gone, and calling it again is safe`,V=e=>t.O(e)&&e.message===t.j(`addScriptTag`).message,H=!1,ee=()=>{H||(H=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},U=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},te=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},W=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,h=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},g=Promise.resolve(),{gate:v,requestCategories:y,boundary:b}=C({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:te(u),freshBlank:h});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>E.has(r)?Promise.reject(t.j(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n],phase:`execute`}),k(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await k(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,N)}catch(e){throw V(e)?t.N(M,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.N(P,`clearCookies`,`cloud`);if(b().length===0)throw t.k(F,`clearCookies`);await k(l(()=>e.clearCookies(n)),I,B)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.N(j,`postMessage`,`cloud`);if(r!==`*`&&!b().includes(new URL(r).hostname))throw t.k(_,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=g.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return g=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&ee(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await k(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+T,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},G=async e=>{if(e===void 0){let e=await a.s(`a relay`).catch(()=>void 0);if(typeof e?.relay?.resolve!=`function`)return;let t=await e.relay.resolve().catch(()=>void 0);return t&&`id`in t?t.id:void 0}let t=await a.s(`a relay choice`);c.t(t,`attachFrame`);let n=await t.relay.resolve(e);if(`refused`in n)throw c.i(`attachFrame: ${n.refused}`);return n.id},K=async(e,t)=>{if((typeof e.relay==`function`?await e.relay():``)!==t)throw c.i(`attachFrame: ${s.RELAY_CHOICE_UNSUPPORTED}`)},ne=250,re=500,q=65e3,ie=2e3,ae=2e3,oe=2,se=2e3,ce=2e3,le=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},ue=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},de=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},J=()=>A(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),Y=()=>A(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),fe=()=>A(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>A(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,n,i)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:a=[],permissions:l,relay:u}=e,{url:d,width:f,height:p}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let m=D(),g=crypto.randomUUID(),_=O(n),v=r.t(a),y=new Set;d&&y.add(new URL(d).origin);let b=n===`persistent`?ue(m,g):null,x=window.open(le({origin:m,target:i===void 0?d:``,session:_,domains:v,attach:g}),`_blank`,`popup,width=${f},height=${p}`);if(!x)throw b?.remove(),new t.g;let S=new AbortController,C=!1,T=null,E=(e,t=!1)=>{if(T===null){T=e,S.abort(t?Y():J());try{x.closed||x.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:g,...t?{unanswered:t}:{}},m)}catch{}b&&setTimeout(()=>b.remove(),ce)}};b&&de(b,S.signal);let A=new Promise((e,t)=>{S.signal.addEventListener(`abort`,()=>t(S.signal.reason),{once:!0})});A.catch(()=>{});let j=A.then(()=>{},()=>{}),M=()=>{if(S.signal.aborted)throw S.signal.reason},N=e=>S.signal.aborted?Promise.reject(S.signal.reason):Promise.race([e(),A]),P=e=>e.source===x&&e.origin===m;window.addEventListener(`message`,e=>{let n=e.source===null&&e.origin===m;if(!P(e)&&!n)return;let r=e.data;typeof r==`object`&&r&&r.attach===g&&(r.type===s.ATTACH_WINDOW_MESSAGE.gone?E(C?J():fe()):r.type===s.ATTACH_WINDOW_MESSAGE.refused&&!n&&E(new t._(r.reason)))},{signal:S.signal}),window.addEventListener(`pagehide`,()=>E(J()),{signal:S.signal});let F=G(u),I,L,R=()=>{let e=()=>{try{x.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:g,...I?{relay:I}:{}},m)}catch{}};e(),L=setInterval(e,ne)};u===void 0&&R();let B=setInterval(()=>{x.closed&&E(C?J():pe())},re);S.signal.addEventListener(`abort`,()=>{clearInterval(L),clearInterval(B)},{once:!0});let V=async e=>{try{return await Promise.race([e,A])}catch(e){throw T??e}};try{u!==void 0&&(I=await V(F),R());let e=await V(k((0,h.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>x.postMessage(e,m,t??[]),receive:e=>{let t=t=>{P(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:S.signal,revivableModules:w(t.ft)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));C=!0,clearInterval(L);let n=0,r=setInterval(()=>{k(N(()=>e.ping()),ae,`ping`).then(()=>{n=0},()=>{S.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=oe&&E(Y(),!0))})},ie);S.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),I&&await V(k(K(e,I),q,`cloud.attachFrame: the window never became ready`)),await V(k(e.ready(),q,`cloud.attachFrame: the window never became ready`)),i!==void 0&&await V(z(e,i)),o.r(`attached frame`,S.signal);let a=W({control:e,target:d,session:_,declaredHosts:v,approvedOrigins:y,attach:g,assertLive:M,guard:N,consent:{request:t=>N(()=>e.requestConsent(t)),ensure:t=>N(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:U({from:()=>x,origin:m,attach:g,signal:S.signal})}),f=null,p=Object.assign(a,{close:()=>f??=(async()=>{S.signal.aborted||await k(Promise.allSettled([N(()=>e.flushCookies()),N(()=>e.sweepStorage())]),se,`close`).catch(()=>{});try{x.close()}catch{}E(J())})(),closed:j});return I?c.a(p,I):F.then(e=>c.a(p,e)),i!==void 0&&d&&await V(p.goto(d)),l?.length&&await V(p.requestPermissions(l)),p}catch(e){let n=T??e;if(!(n instanceof t._))try{x.close()}catch{}throw E(n),n}},he=2e4,X=65e3,Z=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,Q=e=>e.split(`#`)[0]??``,$=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!Z(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Oe())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i,relay:a})=>{let o=new URL(`/attach-frame`,D());return t?o.searchParams.set(`blank`,t):e&&o.searchParams.set(`url`,e),n&&o.searchParams.set(`session`,n),r.length&&o.searchParams.set(`domains`,r.join(`,`)),o.searchParams.set(`attach`,i),a&&o.searchParams.set(`relay`,a),o.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{e.isConnected&&e.parentNode===r||(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>A(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],Ce=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},we=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},Te=async(e,n)=>{let r=typeof e.blank==`function`?await k(e.blank(),X,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||Q(r)!==Q(n))throw t.N(ge,`blank`,`cloud`)},Ee=async(e,n,a)=>{let l=$(e),{iframe:u,domains:d=[],permissions:f,relay:p}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!u.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);we(u);let m=u.getAttribute(`src`)??``,_=(()=>{if(Z(m))return null;try{return new URL(u.src||m,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${m}`)}})();if(_){let e=new URL(`/attach-frame`,D());if(_.origin===e.origin&&_.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let v=_?.href??``;v&&t.x(v);let y=a===void 0?v:``,b=O(n),x=r.t(d),S=new Set;try{S.add(new URL(l||v).origin)}catch{}let C=G(p),T=p===void 0?void 0:await C,E=new AbortController,A=u.referrerPolicy,j=u.allow,M=crypto.randomUUID();if(u.referrerPolicy=`origin`,u.allow=xe(i.a(),u.allow),u.src=ve({target:y,blank:l,session:b,domains:x,attach:M,relay:T}),!u.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await k((0,h.expose)({},{key:s.ATTACH_FRAME_KEY,origin:D(),transport:{receive:window,emit:u.contentWindow},unregisterSignal:E.signal,revivableModules:w(t.ft)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);T&&await k(K(e,T),X,`cloud.attachFrame: the render proxy never became ready`),await k(e.ready(),X,`cloud.attachFrame: the render proxy never became ready`),l&&await Te(e,l),a!==void 0&&await z(e,a),(v||l)&&Ce(u),ye(u,()=>E.abort()),o.r(`attached frame`,E.signal);let n=u.contentWindow,r=W({control:e,target:l||v,blank:l!==``,session:b,declaredHosts:x,approvedOrigins:S,attach:M,assertLive:()=>{if(E.signal.aborted||!u.isConnected||u.contentWindow!==n)throw E.abort(),be()},guard:e=>e(),consent:g,onNavigated:()=>Ce(u),relay:U({from:()=>n,origin:D(),attach:M,signal:E.signal})});return T?c.a(r,T):C.then(e=>c.a(r,e)),a!==void 0&&v&&await r.goto(v),f?.length&&await r.requestPermissions(f),r}catch(e){throw E.abort(),u.referrerPolicy=A,u.allow=j,u.src=y||`about:blank`,e}},De=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):Ee(e,r,i)}),Oe=()=>typeof window<`u`&&!0,ke=async()=>{let e=await a.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},Ae=e.t({attachFrame:()=>De,available:()=>je,dgram:()=>p.i,dns:()=>u.t,fetch:()=>n.t,fs:()=>d.n,http:()=>m.p,net:()=>f.s,quota:()=>ke}),je=()=>a.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return je}});
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-uND2BvAa.cjs"),n=require("./proxy-CLsTNt40.cjs"),r=require("./hosts-GNBhZO3-.cjs"),i=require("./broker-frame-cVEhez7A.cjs"),a=require("./api-RuHgAkxf.cjs"),o=require("./busy-BXbVH595.cjs"),s=require("./contract.cjs"),c=require("./relay-choice-JC_JJY_M.cjs"),l=require("./attach-policy.cjs"),u=require("./dns-D8cfGYaF.cjs"),d=require("./fs-Dp_8uaZe.cjs"),f=require("./net-D7oBrZbA.cjs"),p=require("./dgram-D7I5nP9w.cjs"),m=require("./http-B72t08kn.cjs");let h=require("osra");var g=async()=>{let e=()=>a.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof a.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},_=`frame: this frame no longer holds the document the app attached it to`,v=!1,y=()=>{v||(v=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},b=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),x=e=>typeof e?.reason==`string`?{reason:e.reason}:{},S=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,C=e=>{let{assertLive:n,attach:i,consent:a,current:o,declaredHosts:s,documentHost:c,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(o()).hostname}catch{return``}},h=async()=>c?await c():m(),g=()=>r.t([...s,...b(f)]),v=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:o,phase:c})=>{n();let y=r.m(e,o);if(y===null)return;let b=t.h(y);if(b===void 0||b===`auto`)return;if(e===`fetch`){let e=l.frameFetchVerdict({session:d,declaredHosts:s,approvedOrigins:f},c===`ensure`?void 0:o[0],{classifier:`fetchTarget`});if(c===`ensure`&&!d)throw t.k(e.kind===`refuse`?e.reason:``,`fetch`);if(c!==`ensure`&&e.kind===`refuse`)throw t.k(e.reason,`fetch`);let{request:n,ensure:i}=await a();if(!n){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:r.c(o[0],o[1]).scope,hosts:e.promptHosts}))throw t.k(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await h(),p=r.t([u,...s]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await v(n,{category:`network`,hosts:p,...x(t.T(o))})===!1)throw t.k(S(`fetch`,`network`,u||null),`fetch`);return}let C=await h();if(!C)throw t.k(`frame: navigate the frame before ${e}`,e);if(!g().includes(C))throw t.k(_,e);let w=t.m(y);if(w===void 0||w===`evaluation`&&C===m()&&await u?.()||b===`critical`&&p.has(`${y} ${C}`))return;let{request:T}=await a();if(!T)return;let E=r.t([C,...s]),D=x(t.T(o)),O=b===`critical`?{key:y,hosts:E,attach:i,...D}:{category:w,hosts:E,...D},k=await v(T,O);if(k===!1)throw t.k(S(e,w,null),e);if(k===`once`&&c!==`ensure`)for(let e of E)p.add(`${y} ${e}`)},requestCategories:async e=>{n(),t.f(`frame.requestPermissions`,e);let o=await h(),c=r.t(o?[o,...s]:s);if(!c.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:c,allow:r}),{request:d}=await a();if(!d)return y(),l.map(e=>u(e,!1));let f=await d(l.map(({named:t,critical:n,category:r},a)=>{let o=x(e[a]);return n?{key:t,hosts:c,attach:i,...o}:{category:r,hosts:c,...o}}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:g}},w=e=>e,T=5e3,E=new Set([]),D=()=>`https://fkn.app`,O=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,k=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.E(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},A=e=>Object.assign(Error(e),{name:t.D}),j=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,M=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,N=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,P=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,F=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,I=3e4,L=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,R=2e4,z=async(e,n)=>{if(typeof e.seed!=`function`)throw t.N(L,`storageState`,`cloud`);try{await k(e.seed(n),R,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.O(e)?t.N(L,`storageState`,`cloud`):e}},B=`frame.clearCookies: the render proxy did not answer within ${I}ms; the cookies may or may not be gone, and calling it again is safe`,V=e=>t.O(e)&&e.message===t.j(`addScriptTag`).message,H=!1,ee=()=>{H||(H=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},U=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},te=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},W=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,h=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},g=Promise.resolve(),{gate:v,requestCategories:y,boundary:b}=C({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:te(u),freshBlank:h});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>E.has(r)?Promise.reject(t.j(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n],phase:`execute`}),k(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await k(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,N)}catch(e){throw V(e)?t.N(M,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.N(P,`clearCookies`,`cloud`);if(b().length===0)throw t.k(F,`clearCookies`);await k(l(()=>e.clearCookies(n)),I,B)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.N(j,`postMessage`,`cloud`);if(r!==`*`&&!b().includes(new URL(r).hostname))throw t.k(_,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=g.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return g=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&ee(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await k(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+T,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},G=async e=>{if(e===void 0){let e=await a.s(`a relay`).catch(()=>void 0);if(typeof e?.relay?.resolve!=`function`)return;let t=await e.relay.resolve().catch(()=>void 0);return t&&`id`in t?t.id:void 0}let t=await a.s(`a relay choice`);c.t(t,`attachFrame`);let n=await t.relay.resolve(e);if(`refused`in n)throw c.i(`attachFrame: ${n.refused}`);return n.id},K=async(e,t)=>{if((typeof e.relay==`function`?await e.relay():``)!==t)throw c.i(`attachFrame: ${s.RELAY_CHOICE_UNSUPPORTED}`)},ne=250,re=500,q=65e3,ie=2e3,ae=2e3,oe=2,se=2e3,ce=2e3,le=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},ue=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},de=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},J=()=>A(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),Y=()=>A(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),fe=()=>A(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>A(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,n,i)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:a=[],permissions:l,relay:u}=e,{url:d,width:f,height:p}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let m=D(),g=crypto.randomUUID(),_=O(n),v=r.t(a),y=new Set;d&&y.add(new URL(d).origin);let b=n===`persistent`?ue(m,g):null,x=window.open(le({origin:m,target:i===void 0?d:``,session:_,domains:v,attach:g}),`_blank`,`popup,width=${f},height=${p}`);if(!x)throw b?.remove(),new t.g;let S=new AbortController,C=!1,T=null,E=(e,t=!1)=>{if(T===null){T=e,S.abort(t?Y():J());try{x.closed||x.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:g,...t?{unanswered:t}:{}},m)}catch{}b&&setTimeout(()=>b.remove(),ce)}};b&&de(b,S.signal);let A=new Promise((e,t)=>{S.signal.addEventListener(`abort`,()=>t(S.signal.reason),{once:!0})});A.catch(()=>{});let j=A.then(()=>{},()=>{}),M=()=>{if(S.signal.aborted)throw S.signal.reason},N=e=>S.signal.aborted?Promise.reject(S.signal.reason):Promise.race([e(),A]),P=e=>e.source===x&&e.origin===m;window.addEventListener(`message`,e=>{let n=e.source===null&&e.origin===m;if(!P(e)&&!n)return;let r=e.data;typeof r==`object`&&r&&r.attach===g&&(r.type===s.ATTACH_WINDOW_MESSAGE.gone?E(C?J():fe()):r.type===s.ATTACH_WINDOW_MESSAGE.refused&&!n&&E(new t._(r.reason)))},{signal:S.signal}),window.addEventListener(`pagehide`,()=>E(J()),{signal:S.signal});let F=G(u),I,L,R=()=>{let e=()=>{try{x.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:g,...I?{relay:I}:{}},m)}catch{}};e(),L=setInterval(e,ne)};u===void 0&&R();let B=setInterval(()=>{x.closed&&E(C?J():pe())},re);S.signal.addEventListener(`abort`,()=>{clearInterval(L),clearInterval(B)},{once:!0});let V=async e=>{try{return await Promise.race([e,A])}catch(e){throw T??e}};try{u!==void 0&&(I=await V(F),R());let e=await V(k((0,h.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>x.postMessage(e,m,t??[]),receive:e=>{let t=t=>{P(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:S.signal,revivableModules:w(t.ft)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));C=!0,clearInterval(L);let n=0,r=setInterval(()=>{k(N(()=>e.ping()),ae,`ping`).then(()=>{n=0},()=>{S.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=oe&&E(Y(),!0))})},ie);S.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),I&&await V(k(K(e,I),q,`cloud.attachFrame: the window never became ready`)),await V(k(e.ready(),q,`cloud.attachFrame: the window never became ready`)),i!==void 0&&await V(z(e,i)),o.r(`attached frame`,S.signal);let a=W({control:e,target:d,session:_,declaredHosts:v,approvedOrigins:y,attach:g,assertLive:M,guard:N,consent:{request:t=>N(()=>e.requestConsent(t)),ensure:t=>N(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:U({from:()=>x,origin:m,attach:g,signal:S.signal})}),f=null,p=Object.assign(a,{close:()=>f??=(async()=>{S.signal.aborted||await k(Promise.allSettled([N(()=>e.flushCookies()),N(()=>e.sweepStorage())]),se,`close`).catch(()=>{});try{x.close()}catch{}E(J())})(),closed:j});return I?c.a(p,I):F.then(e=>c.a(p,e)),i!==void 0&&d&&await V(p.goto(d)),l?.length&&await V(p.requestPermissions(l)),p}catch(e){let n=T??e;if(!(n instanceof t._))try{x.close()}catch{}throw E(n),n}},he=2e4,X=65e3,Z=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,Q=e=>e.split(`#`)[0]??``,$=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!Z(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Oe())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i,relay:a})=>{let o=new URL(`/attach-frame`,D());return t?o.searchParams.set(`blank`,t):e&&o.searchParams.set(`url`,e),n&&o.searchParams.set(`session`,n),r.length&&o.searchParams.set(`domains`,r.join(`,`)),o.searchParams.set(`attach`,i),a&&o.searchParams.set(`relay`,a),o.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{e.isConnected&&e.parentNode===r||(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>A(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],Ce=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},we=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},Te=async(e,n)=>{let r=typeof e.blank==`function`?await k(e.blank(),X,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||Q(r)!==Q(n))throw t.N(ge,`blank`,`cloud`)},Ee=async(e,n,a)=>{let l=$(e),{iframe:u,domains:d=[],permissions:f,relay:p}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!u.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);we(u);let m=u.getAttribute(`src`)??``,_=(()=>{if(Z(m))return null;try{return new URL(u.src||m,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${m}`)}})();if(_){let e=new URL(`/attach-frame`,D());if(_.origin===e.origin&&_.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let v=_?.href??``;v&&t.x(v);let y=a===void 0?v:``,b=O(n),x=r.t(d),S=new Set;try{S.add(new URL(l||v).origin)}catch{}let C=G(p),T=p===void 0?void 0:await C,E=new AbortController,A=u.referrerPolicy,j=u.allow,M=crypto.randomUUID();if(u.referrerPolicy=`origin`,u.allow=xe(i.a(),u.allow),u.src=ve({target:y,blank:l,session:b,domains:x,attach:M,relay:T}),!u.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await k((0,h.expose)({},{key:s.ATTACH_FRAME_KEY,origin:D(),transport:{receive:window,emit:u.contentWindow},unregisterSignal:E.signal,revivableModules:w(t.ft)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);T&&await k(K(e,T),X,`cloud.attachFrame: the render proxy never became ready`),await k(e.ready(),X,`cloud.attachFrame: the render proxy never became ready`),l&&await Te(e,l),a!==void 0&&await z(e,a),(v||l)&&Ce(u),ye(u,()=>E.abort()),o.r(`attached frame`,E.signal);let n=u.contentWindow,r=W({control:e,target:l||v,blank:l!==``,session:b,declaredHosts:x,approvedOrigins:S,attach:M,assertLive:()=>{if(E.signal.aborted||!u.isConnected||u.contentWindow!==n)throw E.abort(),be()},guard:e=>e(),consent:g,onNavigated:()=>Ce(u),relay:U({from:()=>n,origin:D(),attach:M,signal:E.signal})});return T?c.a(r,T):C.then(e=>c.a(r,e)),a!==void 0&&v&&await r.goto(v),f?.length&&await r.requestPermissions(f),r}catch(e){throw E.abort(),u.referrerPolicy=A,u.allow=j,u.src=y||`about:blank`,e}},De=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):Ee(e,r,i)}),Oe=()=>typeof window<`u`&&!0,ke=async()=>{let e=await a.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},Ae=e.t({attachFrame:()=>De,available:()=>je,dgram:()=>p.i,dns:()=>u.t,fetch:()=>n.t,fs:()=>d.n,http:()=>m.p,net:()=>f.s,quota:()=>ke}),je=()=>a.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return je}});
|
package/cloud.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-CLsTNt40.cjs"),t=require("./cloud-CrKxBmgy.cjs"),n=require("./dns-D8cfGYaF.cjs"),r=require("./fs-Dp_8uaZe.cjs"),i=require("./net-D7oBrZbA.cjs"),a=require("./dgram-D7I5nP9w.cjs"),o=require("./http-B72t08kn.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.i}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.n}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.p}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.s}}),exports.quota=t.r;
|
package/cloud.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-
|
|
3
|
-
import { t as dns_d_exports } from "./dns-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-1E6vjFKx.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-C9alQ9TA.js";
|
|
3
|
+
import { t as dns_d_exports } from "./dns-CfUsfETG.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-ChOYC6VD.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
6
|
-
import { i as dgram_d_exports } from "./dgram-
|
|
7
|
-
import { _ as http_d_exports } from "./http-
|
|
5
|
+
import { s as net_d_exports } from "./net-B0N6hTWu.js";
|
|
6
|
+
import { i as dgram_d_exports } from "./dgram-D9DiXmhU.js";
|
|
7
|
+
import { _ as http_d_exports } from "./http-D1qvoYf6.js";
|
|
8
8
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
package/cloud.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./proxy-
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
3
|
-
import { t as i } from "./dns-
|
|
4
|
-
import { n as a } from "./fs-
|
|
5
|
-
import { s as o } from "./net-
|
|
6
|
-
import { i as s } from "./dgram-
|
|
7
|
-
import { p as c } from "./http-
|
|
1
|
+
import { t as e } from "./proxy-BmptuWKa.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-Cn27x6RK.js";
|
|
3
|
+
import { t as i } from "./dns-43gybmwY.js";
|
|
4
|
+
import { n as a } from "./fs-BnCWJ-jg.js";
|
|
5
|
+
import { s as o } from "./net-wirsgKVa.js";
|
|
6
|
+
import { i as s } from "./dgram-Cj1vkCE9.js";
|
|
7
|
+
import { p as c } from "./http-DLMUTBb4.js";
|
|
8
8
|
export { t as attachFrame, r as available, s as dgram, i as dns, e as fetch, a as fs, c as http, o as net, n as quota };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as RelayChoice, O as StorageState, nt as SelectorPart, u as ClearCookiesWire } from "./index-HMfzm6dF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { S as UdpSocketOption, s as TcpSocketOption } from "./wire-Cddfpu2U.js";
|
|
3
3
|
/**
|
|
4
4
|
* A `storageState` cookie in the cloud jar's own shape (mirage's `Cookie`): `domain` always with
|
|
5
5
|
* its leading dot and `hostOnly` beside it, `expires` in milliseconds or absent for a session
|
package/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { D as RelayChoice, d as CookieMatchWire, u as ClearCookiesWire } from "./index-HMfzm6dF.js";
|
|
2
|
-
import { $ as RoomBacklog, $t as WebSocketResult, A as MiddleGotoOptions, At as StorageEntry, B as PickOptions, Bt as SurfaceRect, C as FrameMessageRelay, Ct as SHELL_JAR_UNREACHABLE, D as IpFamily, Dt as ShellFrameMessage, E as InstalledPackage, Et as ShellControl, F as PROXY_WEBSOCKET_MARKER, Ft as StoragePutWire, G as Quota, Gt as UdpDatagram, H as ProxyFetch, Ht as TcpSocketListenerResult, I as PackageQuery, It as StorageQuota, J as RELAY_UNAVAILABLE, Jt as WINDOW_HANDSHAKE_TIMEOUT_MS, K as RELAY_CHOICE_UNSUPPORTED, Kt as UdpSocketOptions, L as PackageResult, Lt as StoredHandle, M as OverlayRect, Mt as StorageFail, N as OverlayState, Nt as StorageProgress, O as JAR_ANCHOR_MESSAGE, Ot as ShellGotoOptions, P as PROXY_WEBSOCKET_ENTRY, Pt as StoragePutOptions, Q as Resolvers, Qt as WebSocketOptions, R as PackagesErrorCode, Rt as StoredObject, S as FrameFetchScope, St as SHELL_JAR_MESSAGE, T as InstallOptions, Tt as SetOverlayHost, U as ProxyFetchInit, Ut as TcpSocketOptions, V as Placement, Vt as TcpSocketListenerOptions, W as ProxyFetchInput, Wt as TcpSocketResult, X as Radii, Xt as WINDOW_JAR_MODE_TIMEOUT_MS, Y as ROOM_TEMPORARY_MS, Yt as WINDOW_HELLO_TIMEOUT_MS, Z as RelayResolution, Zt as WebSocketClose, _ as DnsLookup, _t as RoomsErrorCode, a as AccountChange, at as RoomEvent, b as FrameConsentAnswer, bt as SHELL_CONTROL_KEY, c as AdoptRequest, ct as RoomJson, d as ConflictRequest, dt as RoomMessage, en as WindowMiddleControl, et as RoomClaimOptions, f as ConflictSide, ft as RoomOpenOptions, g as DisplayLevel, gt as RoomType, h as DisplayCause, ht as RoomSchema, i as Account, it as RoomEnvelope, j as MountDescriptor, jt as StorageErrorCode, k as MiddleControl, kt as ShellJarUnreachable, l as AdoptState, lt as RoomMailbox, m as ConnectOptions, mt as RoomPermissions, n as ATTACH_WINDOW_KEY, nn as JarSeed, nt as RoomDefaults, o as AccountPinOptions, ot as RoomHandle, p as ConnectAvailability, pt as RoomPermission, q as RELAY_HEADER, qt as UdpSocketResult, r as ATTACH_WINDOW_MESSAGE, rn as JarSeedCookie, rt as RoomEnd, s as AddressLookupResult, st as RoomJoinOptions, t as ATTACH_FRAME_KEY, tn as WriteData, tt as RoomCreateOptions, u as ConflictChoice, ut as RoomMember, v as EncryptionState, vt as RoomsFail, w as HiddenSurface, wt as STORAGE_REFUSALS, x as FrameConsentRequest, xt as SHELL_FRAME_MESSAGE, y as FRAME_MESSAGE, yt as SHELL_ATTACH_ERROR, z as PackagesFail, zt as StoredPage } from "./contract-
|
|
3
|
-
import {
|
|
2
|
+
import { $ as RoomBacklog, $t as WebSocketResult, A as MiddleGotoOptions, At as StorageEntry, B as PickOptions, Bt as SurfaceRect, C as FrameMessageRelay, Ct as SHELL_JAR_UNREACHABLE, D as IpFamily, Dt as ShellFrameMessage, E as InstalledPackage, Et as ShellControl, F as PROXY_WEBSOCKET_MARKER, Ft as StoragePutWire, G as Quota, Gt as UdpDatagram, H as ProxyFetch, Ht as TcpSocketListenerResult, I as PackageQuery, It as StorageQuota, J as RELAY_UNAVAILABLE, Jt as WINDOW_HANDSHAKE_TIMEOUT_MS, K as RELAY_CHOICE_UNSUPPORTED, Kt as UdpSocketOptions, L as PackageResult, Lt as StoredHandle, M as OverlayRect, Mt as StorageFail, N as OverlayState, Nt as StorageProgress, O as JAR_ANCHOR_MESSAGE, Ot as ShellGotoOptions, P as PROXY_WEBSOCKET_ENTRY, Pt as StoragePutOptions, Q as Resolvers, Qt as WebSocketOptions, R as PackagesErrorCode, Rt as StoredObject, S as FrameFetchScope, St as SHELL_JAR_MESSAGE, T as InstallOptions, Tt as SetOverlayHost, U as ProxyFetchInit, Ut as TcpSocketOptions, V as Placement, Vt as TcpSocketListenerOptions, W as ProxyFetchInput, Wt as TcpSocketResult, X as Radii, Xt as WINDOW_JAR_MODE_TIMEOUT_MS, Y as ROOM_TEMPORARY_MS, Yt as WINDOW_HELLO_TIMEOUT_MS, Z as RelayResolution, Zt as WebSocketClose, _ as DnsLookup, _t as RoomsErrorCode, a as AccountChange, at as RoomEvent, b as FrameConsentAnswer, bt as SHELL_CONTROL_KEY, c as AdoptRequest, ct as RoomJson, d as ConflictRequest, dt as RoomMessage, en as WindowMiddleControl, et as RoomClaimOptions, f as ConflictSide, ft as RoomOpenOptions, g as DisplayLevel, gt as RoomType, h as DisplayCause, ht as RoomSchema, i as Account, it as RoomEnvelope, j as MountDescriptor, jt as StorageErrorCode, k as MiddleControl, kt as ShellJarUnreachable, l as AdoptState, lt as RoomMailbox, m as ConnectOptions, mt as RoomPermissions, n as ATTACH_WINDOW_KEY, nn as JarSeed, nt as RoomDefaults, o as AccountPinOptions, ot as RoomHandle, p as ConnectAvailability, pt as RoomPermission, q as RELAY_HEADER, qt as UdpSocketResult, r as ATTACH_WINDOW_MESSAGE, rn as JarSeedCookie, rt as RoomEnd, s as AddressLookupResult, st as RoomJoinOptions, t as ATTACH_FRAME_KEY, tn as WriteData, tt as RoomCreateOptions, u as ConflictChoice, ut as RoomMember, v as EncryptionState, vt as RoomsFail, w as HiddenSurface, wt as STORAGE_REFUSALS, x as FrameConsentRequest, xt as SHELL_FRAME_MESSAGE, y as FRAME_MESSAGE, yt as SHELL_ATTACH_ERROR, z as PackagesFail, zt as StoredPage } from "./contract-B-iUk1mJ.js";
|
|
3
|
+
import { S as UdpSocketOption, s as TcpSocketOption } from "./wire-Cddfpu2U.js";
|
|
4
4
|
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, type ClearCookiesWire, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, type CookieMatchWire, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, type JarSeed, type JarSeedCookie, MiddleControl, MiddleGotoOptions, MountDescriptor, OverlayRect, OverlayState, PROXY_WEBSOCKET_ENTRY, PROXY_WEBSOCKET_MARKER, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, RELAY_CHOICE_UNSUPPORTED, RELAY_HEADER, RELAY_UNAVAILABLE, ROOM_TEMPORARY_MS, Radii, type RelayChoice, RelayResolution, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEnvelope, RoomEvent, RoomHandle, RoomJoinOptions, RoomJson, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomSchema, RoomType, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, STORAGE_REFUSALS, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageErrorCode, StorageFail, StorageProgress, StoragePutOptions, StoragePutWire, StorageQuota, StoredHandle, StoredObject, StoredPage, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WebSocketClose, WebSocketOptions, WebSocketResult, WindowMiddleControl, WriteData };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { s as t } from "./api-
|
|
2
|
+
import { s as t } from "./api-DR6y3Q0Y.js";
|
|
3
3
|
import { t as n } from "./busy-C1JPjoZ_.js";
|
|
4
4
|
import { t as r } from "./relay-choice-Bb3oP2gw.js";
|
|
5
5
|
import { a as i, i as a, s as o } from "./utils-DtWP-E9x.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-BORAfb8e.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./relay-choice-JC_JJY_M.cjs"),i=require("./utils-BpHmMkIR.cjs"),a=require("./wire.cjs");let o=require("buffer"),s=require("events"),c=require("ip-address");var l=e.t({Socket:()=>u,createSocket:()=>g,default:()=>_}),u=class extends s.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;_relayChoice;_relay;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,this._relayChoice=e.relay,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){this._webVPNUdpSocketPromise?this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}}):this.emit(`error`,Error(`Cannot set socket option before bind`))}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:a.UDP_PORT_ACK_TYPE,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,i=0;for(;i+4<=e.byteLength;){let a=t.getUint32(i);i+=4;let s=i+a;if(s>e.byteLength)break;let c=i+4,l=t.getUint8(c);c+=1;let u,d,f;if(l===2){if(!this._remoteAddress){i=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,f=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=m(n)),c+=n.byteLength,f=t.getUint16(c),c+=2}let p=t.getUint32(c);c+=4;try{this.emit(`message`,o.Buffer.from(e.slice(c,c+p)),{address:u,family:d,port:f,size:p})}catch(e){n||(n=!0,r=e)}i=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return d;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=c.Address4.isValid(e)?p(e):h(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(c.Address4.isValid(e)){let n=p(e),r=t&&c.Address4.isValid(t)?p(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(c.Address6.isValid(e)){let t=h(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=i.i(...e),a=this._type===`udp6`?`::`:`0.0.0.0`,o=this._relayChoice,s=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>(o!==void 0&&r.t(e,`dgram.createSocket`),e.cloud.webvpn.udpSocket({type:this._type,address:n.address??a,port:n.port,dataPort:!0,relay:o}))));return n.callback&&s.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,o.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._relay=e.relay,this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{e?this.emit(`listening`):this._busyRelease?.()}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t?.close()}finally{try{n||this.emit(`close`)}finally{e&&e()}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(c.Address4.isValid(e)){let n=p(e),r=t&&c.Address4.isValid(t)?p(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(c.Address6.isValid(e)){let t=h(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=i.a(...e),n=f(t.message),r=n;if(t.hasRange){let{offset:e,length:i}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(i)||i<0||i>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});r=n.subarray(e,e+i)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,i=t.address??a,o=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(o||c.Address4.isValid(i)||c.Address6.isValid(i))){this._portSend(r,o?void 0:i,o?void 0:t.port),n?.call(this,null,r.byteLength);return}let s=this._destroyed;e.send({port:t.port,address:i,message:r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}).then(()=>n?.call(this,null,r.byteLength),e=>{(!this._destroyed||s)&&(n?n.call(this,e,0):this.emit(`error`,e))})})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},d=new Uint8Array([2]),f=e=>{if(typeof e==`string`)return i.s.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(f),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},p=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},m=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},h=e=>{let t=new c.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},g=(e,t)=>{let n=new u(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},_={Socket:u,createSocket:g};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-RuHgAkxf.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./relay-choice-JC_JJY_M.cjs"),i=require("./utils-BpHmMkIR.cjs"),a=require("./wire.cjs");let o=require("buffer"),s=require("events"),c=require("ip-address");var l=e.t({Socket:()=>u,createSocket:()=>g,default:()=>_}),u=class extends s.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;_relayChoice;_relay;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,this._relayChoice=e.relay,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){this._webVPNUdpSocketPromise?this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}}):this.emit(`error`,Error(`Cannot set socket option before bind`))}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:a.UDP_PORT_ACK_TYPE,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,i=0;for(;i+4<=e.byteLength;){let a=t.getUint32(i);i+=4;let s=i+a;if(s>e.byteLength)break;let c=i+4,l=t.getUint8(c);c+=1;let u,d,f;if(l===2){if(!this._remoteAddress){i=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,f=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=m(n)),c+=n.byteLength,f=t.getUint16(c),c+=2}let p=t.getUint32(c);c+=4;try{this.emit(`message`,o.Buffer.from(e.slice(c,c+p)),{address:u,family:d,port:f,size:p})}catch(e){n||(n=!0,r=e)}i=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return d;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=c.Address4.isValid(e)?p(e):h(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(c.Address4.isValid(e)){let n=p(e),r=t&&c.Address4.isValid(t)?p(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(c.Address6.isValid(e)){let t=h(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=i.i(...e),a=this._type===`udp6`?`::`:`0.0.0.0`,o=this._relayChoice,s=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>(o!==void 0&&r.t(e,`dgram.createSocket`),e.cloud.webvpn.udpSocket({type:this._type,address:n.address??a,port:n.port,dataPort:!0,relay:o}))));return n.callback&&s.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,o.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._relay=e.relay,this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{e?this.emit(`listening`):this._busyRelease?.()}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t?.close()}finally{try{n||this.emit(`close`)}finally{e&&e()}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(c.Address4.isValid(e)){let n=p(e),r=t&&c.Address4.isValid(t)?p(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(c.Address6.isValid(e)){let t=h(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=i.a(...e),n=f(t.message),r=n;if(t.hasRange){let{offset:e,length:i}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(i)||i<0||i>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});r=n.subarray(e,e+i)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,i=t.address??a,o=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(o||c.Address4.isValid(i)||c.Address6.isValid(i))){this._portSend(r,o?void 0:i,o?void 0:t.port),n?.call(this,null,r.byteLength);return}let s=this._destroyed;e.send({port:t.port,address:i,message:r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}).then(()=>n?.call(this,null,r.byteLength),e=>{(!this._destroyed||s)&&(n?n.call(this,e,0):this.emit(`error`,e))})})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},d=new Uint8Array([2]),f=e=>{if(typeof e==`string`)return i.s.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(f),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},p=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},m=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},h=e=>{let t=new c.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},g=(e,t)=>{let n=new u(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},_={Socket:u,createSocket:g};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { D as RelayChoice } from "./index-HMfzm6dF.js";
|
|
2
|
-
import { Q as Resolvers, qt as UdpSocketResult } from "./contract-
|
|
3
|
-
import {
|
|
4
|
-
import "./api-
|
|
5
|
-
import { t as RelayOption } from "./relay-choice-
|
|
2
|
+
import { Q as Resolvers, qt as UdpSocketResult } from "./contract-B-iUk1mJ.js";
|
|
3
|
+
import { S as UdpSocketOption } from "./wire-Cddfpu2U.js";
|
|
4
|
+
import "./api-CXvE64Jr.js";
|
|
5
|
+
import { t as RelayOption } from "./relay-choice-BeNCw3ba.js";
|
|
6
6
|
import { Buffer } from "buffer";
|
|
7
7
|
import { AddressInfo } from "net";
|
|
8
8
|
import { BindOptions, RemoteInfo, Socket as Socket$1, SocketOptions, SocketType } from "dgram";
|
package/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./dgram-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./dgram-D7I5nP9w.cjs");exports.Socket=e.t,exports.createSocket=e.n,exports.default=e.r;
|
package/dgram.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, r as createSocket, t as Socket } from "./dgram-
|
|
1
|
+
import { n as _default, r as createSocket, t as Socket } from "./dgram-D9DiXmhU.js";
|
|
2
2
|
export { Socket, createSocket, _default as default };
|
package/dgram.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Socket, n as createSocket, r as default } from "./dgram-
|
|
1
|
+
export { t as Socket, n as createSocket, r as default } from "./dgram-Cj1vkCE9.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { o as t } from "./api-
|
|
2
|
+
import { o as t } from "./api-DR6y3Q0Y.js";
|
|
3
3
|
// src/dns.ts
|
|
4
4
|
var n = /* @__PURE__ */ e({ lookup: () => r }), r = (e, n) => t.then((t) => t.cloud.dns.lookup(e, n));
|
|
5
5
|
export { r as n, n as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-RuHgAkxf.cjs");var n=e.t({lookup:()=>r}),r=(e,n)=>t.o.then(t=>t.cloud.dns.lookup(e,n));Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dns.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./dns-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./dns-D8cfGYaF.cjs");exports.lookup=e.n;
|
package/dns.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { s as AddressLookupResult } from "./contract-
|
|
2
|
-
import { n as lookup } from "./dns-
|
|
1
|
+
import { s as AddressLookupResult } from "./contract-B-iUk1mJ.js";
|
|
2
|
+
import { n as lookup } from "./dns-CfUsfETG.js";
|
|
3
3
|
export { type AddressLookupResult, lookup };
|
package/dns.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as lookup } from "./dns-
|
|
1
|
+
export { n as lookup } from "./dns-43gybmwY.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-uND2BvAa.cjs"),n=require("./proxy-CLsTNt40.cjs"),r=require("./broker-frame-cVEhez7A.cjs"),i=require("./api-RuHgAkxf.cjs"),a=require("./contract.cjs"),o=require("./desktop-vXKU4wEK.cjs");var s=`BackgroundStoppedError`,c=e=>t.d(e)&&e.name===`BackgroundStoppedError`,l=async e=>{if(t.Z(`promptInstall`,e),typeof window>`u`)return!1;if(t.rt())return!0;let n=await i.o,r=null,a=new Promise(e=>{r=()=>{t.rt()&&e(!0)},t.nt.addEventListener(`statuschange`,r)}),o=n.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return r&&t.nt.removeEventListener(`statuschange`,r),await n.installPrompt.hide().catch(()=>{}),s},u=null;t.at(()=>(u||=l().then(()=>void 0).finally(()=>{u=null}),u));var d=e=>{try{e.headers.delete(a.RELAY_HEADER)}catch{}return e},f=()=>typeof document<`u`&&t.rt(),p=async(e,i)=>{if(r.r(e),t.Z(`fetch`,i?.reason),i?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.W(e,i).then(d)}return f()?t.W(e,{...i,credentials:`omit`}).then(d):o.t()?o.a(e,i):n.t(e,i)},m=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,BACKGROUND_STOPPED:()=>s,CATEGORIES:()=>t.w,EXTENSION_ABI:()=>5,ExtensionOperationUnsupportedError:()=>t.ct,ExtensionOutdatedError:()=>t.lt,FORGEABLE_HEADERS:()=>t.Q,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.A,LOCATOR_ERROR:()=>t.P,LOCATOR_INVALID:()=>t.I,LOCATOR_UNSUPPORTED:()=>t.D,MAX_REASON_LENGTH:()=>100,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.E,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.U,assertForgeableHeaders:()=>t.$,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.et,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>f,box:()=>t.pt,cookies:()=>t.V,createFrame:()=>t.y,createVideoElementHandle:()=>t.mt,events:()=>t.nt,extension:()=>t.nt,fetch:()=>t.W,fetchCredentialedPermission:()=>t.G,fetchLocalPermission:()=>t.K,fetchPermission:()=>t.q,gotoPermission:()=>t.b,handleRevivableModules:()=>t.ft,hasForgedCookie:()=>t.tt,isBackgroundStopped:()=>c,isBlockedFetchUrl:()=>t.J,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.rt,isLocalNetworkUrl:()=>t.Y,isLocatorDenied:()=>t.F,isLocatorInvalid:()=>t.M,isLocatorUnsupported:()=>t.O,isPermissionDenied:()=>t.n,isTerminalError:()=>t.L,isType:()=>t.ht,modifyRequestHeadersPermission:()=>t.R,permissions:()=>t.r,promptInstall:()=>l,readCookiePermission:()=>t.H,readExtensionHandshake:()=>t.it,removeRequestHeaderRule:()=>t.z,revive:()=>t.gt,setMissingExtensionHandler:()=>t.at,setRequestHeaderRule:()=>t.B,supportsOperation:()=>t.dt,type:()=>t._t,waitForExtensionExposure:()=>t.ot});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
|
-
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as ee, K as te, L as ne, M as re, O as ie, P as ae, Q as oe, R as d, S as f, U as p, V as m, W as h, Y as g, Z as _, _ as v, _t as y, a as b, at as x, b as S, ct as C, d as w, dt as T, et as E, ft as D, g as O, gt as k, ht as A, i as j, it as M, lt as N, mt as P, n as se, nt as F, ot as I, pt as L, q as R, r as z, rt as B, t as V, tt as H, v as U, w as W, x as G, y as K, z as ce } from "./lib-
|
|
3
|
-
import { t as le } from "./proxy-
|
|
2
|
+
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as ee, K as te, L as ne, M as re, O as ie, P as ae, Q as oe, R as d, S as f, U as p, V as m, W as h, Y as g, Z as _, _ as v, _t as y, a as b, at as x, b as S, ct as C, d as w, dt as T, et as E, ft as D, g as O, gt as k, ht as A, i as j, it as M, lt as N, mt as P, n as se, nt as F, ot as I, pt as L, q as R, r as z, rt as B, t as V, tt as H, v as U, w as W, x as G, y as K, z as ce } from "./lib-DIxvhbhf.js";
|
|
3
|
+
import { t as le } from "./proxy-BmptuWKa.js";
|
|
4
4
|
import { r as ue } from "./broker-frame-AQDD3D9E.js";
|
|
5
|
-
import { o as de } from "./api-
|
|
5
|
+
import { o as de } from "./api-DR6y3Q0Y.js";
|
|
6
6
|
import { RELAY_HEADER as fe } from "./contract.js";
|
|
7
7
|
import { a as q, t as pe } from "./desktop-xTT7ciGX.js";
|
|
8
8
|
// ../web-extension/lib/utils/background-stopped.js
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-uND2BvAa.cjs"),t=require("./extension-D8Kj6rRT.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.st,exports.ExtensionOperationUnsupportedError=e.ct,exports.ExtensionOutdatedError=e.lt,exports.FORGEABLE_HEADERS=e.Q,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.A,exports.LOCATOR_ERROR=e.P,exports.LOCATOR_INVALID=e.I,exports.LOCATOR_UNSUPPORTED=e.D,exports.MAX_REASON_LENGTH=e.X,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.ut,exports.TimeoutError=e.E,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.U,exports.assertForgeableHeaders=e.$,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.et,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.pt,exports.cookies=e.V,exports.createFrame=e.y,exports.createVideoElementHandle=e.mt,exports.events=e.nt,exports.extension=e.nt,exports.fetch=e.W,exports.fetchCredentialedPermission=e.G,exports.fetchLocalPermission=e.K,exports.fetchPermission=e.q,exports.gotoPermission=e.b,exports.handleRevivableModules=e.ft,exports.hasForgedCookie=e.tt,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.J,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.rt,exports.isLocalNetworkUrl=e.Y,exports.isLocatorDenied=e.F,exports.isLocatorInvalid=e.M,exports.isLocatorUnsupported=e.O,exports.isPermissionDenied=e.n,exports.isTerminalError=e.L,exports.isType=e.ht,exports.modifyRequestHeadersPermission=e.R,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.H,exports.readExtensionHandshake=e.it,exports.removeRequestHeaderRule=e.z,exports.revive=e.gt,exports.setMissingExtensionHandler=e.at,exports.setRequestHeaderRule=e.B,exports.supportsOperation=e.dt,exports.type=e._t,exports.waitForExtensionExposure=e.ot;
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, O as m, P as h, Q as g, R as _, S as v, U as y, V as b, W as x, X as S, Y as C, _ as w, _t as T, a as E, at as D, b as O, ct as k, dt as ee, et as A, ft as j, g as M, gt as N, ht as P, i as F, it as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as te } from "./lib-
|
|
2
|
-
import { a as ne, i as re, o as ie, r as ae } from "./extension-
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, O as m, P as h, Q as g, R as _, S as v, U as y, V as b, W as x, X as S, Y as C, _ as w, _t as T, a as E, at as D, b as O, ct as k, dt as ee, et as A, ft as j, g as M, gt as N, ht as P, i as F, it as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as te } from "./lib-DIxvhbhf.js";
|
|
2
|
+
import { a as ne, i as re, o as ie, r as ae } from "./extension-DFeaP0Ou.js";
|
|
3
3
|
export { F as ATTACH_FRAME_EVENT_KEY, ne as BACKGROUND_STOPPED, Z as CATEGORIES, K as EXTENSION_ABI, k as ExtensionOperationUnsupportedError, L as ExtensionOutdatedError, g as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, t as LOCATOR_DENIED, h as LOCATOR_ERROR, l as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, S as MAX_REASON_LENGTH, q as PERMISSION_DENIED, Y as REQUIRED_EXTENSION_ABI, a as TimeoutError, Q as assertAttachableFrameUrl, y as assertFetchableUrl, e as assertForgeableHeaders, v as assertLockdownApplicable, A as assertOneCookieIdentity, E as attachFrame, X as attachFramePermission, ae as available, H as box, b as cookies, $ as createFrame, R as createVideoElementHandle, B as events, B as extension, x as fetch, s as fetchCredentialedPermission, d as fetchLocalPermission, U as fetchPermission, O as gotoPermission, j as handleRevivableModules, J as hasForgedCookie, ie as isBackgroundStopped, u as isBlockedFetchUrl, r as isBlockedFrameUrl, G as isExtensionExposed, C as isLocalNetworkUrl, o as isLocatorDenied, p as isLocatorInvalid, m as isLocatorUnsupported, z as isPermissionDenied, f as isTerminalError, P as isType, _ as modifyRequestHeadersPermission, W as permissions, re as promptInstall, c as readCookiePermission, I as readExtensionHandshake, te as removeRequestHeaderRule, N as revive, D as setMissingExtensionHandler, n as setRequestHeaderRule, ee as supportsOperation, T as type, V as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-COtIapGm.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-DXz_TgC8.js";
|
|
2
2
|
// src/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
export { f as access, r as appendFile, p as default, d as lstat, s as mkdir, t as readFile, o as readdir, a as rename, c as rm, l as rmdir, u as stat, i as unlink, n as writeFile };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
2
|
import { t } from "./node-fs-B4pY08Kc.js";
|
|
3
3
|
import { STORAGE_ACCOUNT_CHANGED as n, STORAGE_ACCOUNT_PIN_UNSUPPORTED as r, STORAGE_NOT_FOUND as i } from "./messages.js";
|
|
4
|
-
import { _ as a, a as o, c as s, d as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, y as _ } from "./account-storage-
|
|
4
|
+
import { _ as a, a as o, c as s, d as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, y as _ } from "./account-storage-DQryXWDZ.js";
|
|
5
5
|
// src/cloud/fs.ts
|
|
6
6
|
var v = /* @__PURE__ */ e({
|
|
7
7
|
STORAGE_ACCOUNT_CHANGED: () => n,
|