@fkn/lib 0.9.67 → 0.9.69
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-Uh0-1Cbp.js → account-CAX5oCUD.js} +2 -2
- package/{account-DBagcNfd.d.ts → account-CXUwroRM.d.ts} +1 -1
- package/{account-m2iCmNui.cjs → account-aaD_dWUH.cjs} +1 -1
- package/{account-generation-BKHNe-jL.js → account-generation-BElgcQwo.js} +1 -1
- package/{account-generation-ACCBzaI-.cjs → account-generation-DwMcJFGc.cjs} +1 -1
- package/{account-storage-BmCVutNL.js → account-storage-C7Lyae5Q.js} +2 -2
- package/{account-storage-dYWDpqsr.cjs → account-storage-gOL0HE6i.cjs} +1 -1
- package/account.cjs +1 -1
- package/account.d.ts +2 -2
- package/account.js +1 -1
- package/api-BkoXMcoe.cjs +3 -0
- package/{api-DRglK7ft.js → api-DeGR_tzF.js} +62 -60
- package/{api-BlYVLNjo.d.ts → api-DhwJz0vo.d.ts} +35 -1
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/{broker-frame-vjSpBa8d.js → broker-frame-BClLp2ZV.js} +3 -1
- package/broker-frame-BKHtDSjv.cjs +11 -0
- package/broker-frame.cjs +1 -1
- package/broker-frame.d.ts +2 -1
- package/broker-frame.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-CoHrHk6t.js → cloud-B3LylTk3.js} +9 -9
- package/{cloud-r8DsgB1W.cjs → cloud-BvRWgECW.cjs} +1 -1
- package/{cloud-BCRo1U9I.d.ts → cloud-P8d7GYmM.d.ts} +5 -5
- package/cloud.cjs +1 -1
- package/cloud.d.ts +6 -6
- package/cloud.js +7 -7
- package/{contract-CJk3vE9P.d.ts → contract-CDdIE_Es.d.ts} +49 -2
- package/contract.d.ts +1 -1
- package/{dgram-BBbLokVF.js → dgram-BMCYdn0Q.js} +1 -1
- package/{dgram-DSgktX7M.d.ts → dgram-CPQqam5Z.d.ts} +3 -3
- package/{dgram-D9ljiUFh.cjs → dgram-Xrt2rPrC.cjs} +1 -1
- package/dgram.cjs +1 -1
- package/dgram.d.ts +1 -1
- package/dgram.js +1 -1
- package/{dns-o8DLFjP1.js → dns-CxfA8mGU.js} +1 -1
- package/{dns-BwS2LM9b.d.ts → dns-_NCe2YLS.d.ts} +1 -1
- package/{dns-2v96zoEh.cjs → dns-ijWQw2NO.cjs} +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +2 -2
- package/dns.js +1 -1
- package/{extension-Dn64NfoU.cjs → extension-gWkpzDKG.cjs} +1 -1
- package/{extension-CG7Qi3I0.js → extension-nTQBWRg6.js} +4 -4
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-BX_ghRy0.cjs → fs-BVISC6T6.cjs} +1 -1
- package/{fs--MLHvMW-.cjs → fs-Cu7wH1Fo.cjs} +1 -1
- package/{fs-BnWXGRik.js → fs-D16P3dtE.js} +1 -1
- package/{fs-Cw7CcUhx.js → fs-DsHrUu0O.js} +3 -3
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/{http-DIDjdm08.js → http-1ruN3pj9.js} +1 -1
- package/{http-BE3UBktN.cjs → http-CzMigExo.cjs} +1 -1
- package/{http-D8ulR5RD.d.ts → http-D3wvnIVo.d.ts} +1 -1
- 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 +11 -11
- package/index.js +13 -13
- package/{lib-D2uKjgLV.js → lib-6lykV0aT.js} +1 -1
- package/{lib-_WDKIXcj.cjs → lib-C1OPIW6F.cjs} +1 -1
- package/{net-COkJw8lV.js → net-Bj1vCk29.js} +1 -1
- package/{net-Dk2kqtgE.cjs → net-b250sYEx.cjs} +1 -1
- package/{net-BCEAHCZe.d.ts → net-v_6ythjK.d.ts} +3 -3
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/{packages-Cws_rcgf.js → packages-BqY5yoIM.js} +73 -70
- package/packages-Cb8FXQu1.cjs +1 -0
- package/{packages-BlJK4kSJ.d.ts → packages-SwO4CxMl.d.ts} +19 -6
- package/packages.cjs +1 -1
- package/packages.d.ts +3 -3
- package/packages.js +1 -1
- package/{proxy-DVgGp6A8.cjs → proxy-BFa0n5gx.cjs} +1 -1
- package/{proxy-CfgavvzR.d.ts → proxy-CzP07me0.d.ts} +2 -2
- package/{proxy-BBAQxJmP.js → proxy-FSgMUaD3.js} +2 -2
- package/{relay-choice-D5Jeevab.d.ts → relay-choice-DB1F7bcn.d.ts} +1 -1
- package/{rooms-0vp7HaAY.d.ts → rooms-3XplwXzb.d.ts} +1 -1
- package/{rooms-DHFS9cwA.cjs → rooms-CYP6g-p9.cjs} +1 -1
- package/{rooms-DP5stTEr.js → rooms-GZ798oSd.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +2 -2
- package/rooms.js +1 -1
- package/{storage-CidJUc0x.d.ts → storage-C38adB-z.d.ts} +1 -1
- package/{storage-BCjYihUO.cjs → storage-CoEDsbk2.cjs} +1 -1
- package/{storage-BhfImh_2.js → storage-sCdMPRVY.js} +3 -3
- package/storage.cjs +1 -1
- package/storage.d.ts +2 -2
- package/storage.js +1 -1
- package/api-DrvhPN56.cjs +0 -3
- package/broker-frame-CF4-yXtj.cjs +0 -9
- package/packages-DT8vPB5_.cjs +0 -1
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-CzMigExo.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-D3wvnIVo.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-1ruN3pj9.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-b250sYEx.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-v_6ythjK.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-Bj1vCk29.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,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-
|
|
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-6lykV0aT.js";
|
|
3
3
|
import { c as S, m as C, t as w } from "./hosts-HUfgMimI.js";
|
|
4
|
-
import { i as T } from "./broker-frame-
|
|
5
|
-
import { l as E, n as D, o as O, s as k } from "./api-
|
|
4
|
+
import { i as T } from "./broker-frame-BClLp2ZV.js";
|
|
5
|
+
import { l as E, n as D, o as O, s as k } from "./api-DeGR_tzF.js";
|
|
6
6
|
import { r as A } from "./busy-C1JPjoZ_.js";
|
|
7
7
|
import { ATTACH_FRAME_KEY as j, ATTACH_WINDOW_KEY as ee, ATTACH_WINDOW_MESSAGE as M, RELAY_CHOICE_UNSUPPORTED as N, WINDOW_HANDSHAKE_TIMEOUT_MS as te } from "./contract.js";
|
|
8
8
|
import { a as P, i as F, t as I } from "./relay-choice-Bb3oP2gw.js";
|
|
9
|
-
import { t as L } from "./proxy-
|
|
9
|
+
import { t as L } from "./proxy-FSgMUaD3.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-CxfA8mGU.js";
|
|
12
|
+
import { n as re } from "./fs-D16P3dtE.js";
|
|
13
|
+
import { s as ie } from "./net-Bj1vCk29.js";
|
|
14
|
+
import { i as ae } from "./dgram-BMCYdn0Q.js";
|
|
15
|
+
import { p as oe } from "./http-1ruN3pj9.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-_WDKIXcj.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./broker-frame-CF4-yXtj.cjs"),i=require("./api-DrvhPN56.cjs"),a=require("./busy-BXbVH595.cjs"),o=require("./contract.cjs"),s=require("./relay-choice-JC_JJY_M.cjs"),c=require("./proxy-DVgGp6A8.cjs"),l=require("./attach-policy.cjs"),u=require("./dns-2v96zoEh.cjs"),d=require("./fs-BX_ghRy0.cjs"),f=require("./net-Dk2kqtgE.cjs"),p=require("./dgram-D9ljiUFh.cjs"),m=require("./http-BE3UBktN.cjs");let h=require("osra");var g=async()=>{let e=()=>i.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 i.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:r,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=()=>n.t([...s,...b(f)]),v=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:o,phase:c})=>{r();let y=n.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:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:n.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=n.t([u,...s]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await v(r,{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=n.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=>{r(),t.f(`frame.requestPermissions`,e);let o=await h(),c=n.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 i.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 i.s(`a relay choice`);s.t(t,`attachFrame`);let n=await t.relay.resolve(e);if(`refused`in n)throw s.i(`attachFrame: ${n.refused}`);return n.id},K=async(e,t)=>{if((typeof e.relay==`function`?await e.relay():``)!==t)throw s.i(`attachFrame: ${o.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,r,i)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:c=[],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(r),v=n.t(c),y=new Set;d&&y.add(new URL(d).origin);let b=r===`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:o.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===o.ATTACH_WINDOW_MESSAGE.gone?E(C?J():fe()):r.type===o.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:o.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:o.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)}),o.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)),a.r(`attached frame`,S.signal);let c=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(c,{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?s.a(p,I):F.then(e=>s.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,i,c)=>{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=c===void 0?v:``,b=O(i),x=n.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(r.i(),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:o.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),c!==void 0&&await z(e,c),(v||l)&&Ce(u),ye(u,()=>E.abort()),a.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?s.a(r,T):C.then(e=>s.a(r,e)),c!==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 i.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:()=>c.t,fs:()=>d.n,http:()=>m.p,net:()=>f.s,quota:()=>ke}),je=()=>i.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-C1OPIW6F.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./broker-frame-BKHtDSjv.cjs"),i=require("./api-BkoXMcoe.cjs"),a=require("./busy-BXbVH595.cjs"),o=require("./contract.cjs"),s=require("./relay-choice-JC_JJY_M.cjs"),c=require("./proxy-BFa0n5gx.cjs"),l=require("./attach-policy.cjs"),u=require("./dns-ijWQw2NO.cjs"),d=require("./fs-BVISC6T6.cjs"),f=require("./net-b250sYEx.cjs"),p=require("./dgram-Xrt2rPrC.cjs"),m=require("./http-CzMigExo.cjs");let h=require("osra");var g=async()=>{let e=()=>i.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 i.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:r,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=()=>n.t([...s,...b(f)]),v=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:o,phase:c})=>{r();let y=n.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:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:n.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=n.t([u,...s]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await v(r,{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=n.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=>{r(),t.f(`frame.requestPermissions`,e);let o=await h(),c=n.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 i.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 i.s(`a relay choice`);s.t(t,`attachFrame`);let n=await t.relay.resolve(e);if(`refused`in n)throw s.i(`attachFrame: ${n.refused}`);return n.id},K=async(e,t)=>{if((typeof e.relay==`function`?await e.relay():``)!==t)throw s.i(`attachFrame: ${o.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,r,i)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:c=[],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(r),v=n.t(c),y=new Set;d&&y.add(new URL(d).origin);let b=r===`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:o.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===o.ATTACH_WINDOW_MESSAGE.gone?E(C?J():fe()):r.type===o.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:o.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:o.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)}),o.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)),a.r(`attached frame`,S.signal);let c=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(c,{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?s.a(p,I):F.then(e=>s.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,i,c)=>{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=c===void 0?v:``,b=O(i),x=n.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(r.i(),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:o.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),c!==void 0&&await z(e,c),(v||l)&&Ce(u),ye(u,()=>E.abort()),a.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?s.a(r,T):C.then(e=>s.a(r,e)),c!==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 i.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:()=>c.t,fs:()=>d.n,http:()=>m.p,net:()=>f.s,quota:()=>ke}),je=()=>i.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,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-CzP07me0.js";
|
|
3
|
+
import { t as dns_d_exports } from "./dns-_NCe2YLS.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-v_6ythjK.js";
|
|
6
|
+
import { i as dgram_d_exports } from "./dgram-CPQqam5Z.js";
|
|
7
|
+
import { _ as http_d_exports } from "./http-D3wvnIVo.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.
|
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-BFa0n5gx.cjs"),t=require("./cloud-BvRWgECW.cjs"),n=require("./dns-ijWQw2NO.cjs"),r=require("./fs-BVISC6T6.cjs"),i=require("./net-b250sYEx.cjs"),a=require("./dgram-Xrt2rPrC.cjs"),o=require("./http-CzMigExo.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-CzP07me0.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-P8d7GYmM.js";
|
|
3
|
+
import { t as dns_d_exports } from "./dns-_NCe2YLS.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-v_6ythjK.js";
|
|
6
|
+
import { i as dgram_d_exports } from "./dgram-CPQqam5Z.js";
|
|
7
|
+
import { _ as http_d_exports } from "./http-D3wvnIVo.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-FSgMUaD3.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-B3LylTk3.js";
|
|
3
|
+
import { t as i } from "./dns-CxfA8mGU.js";
|
|
4
|
+
import { n as a } from "./fs-D16P3dtE.js";
|
|
5
|
+
import { s as o } from "./net-Bj1vCk29.js";
|
|
6
|
+
import { i as s } from "./dgram-BMCYdn0Q.js";
|
|
7
|
+
import { p as c } from "./http-1ruN3pj9.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 };
|
|
@@ -500,6 +500,11 @@ type InstalledPackage = {
|
|
|
500
500
|
installedAt: number;
|
|
501
501
|
/** the app id this pin last verified as, version-free. Absent until a verified resolve has run. */
|
|
502
502
|
appId?: string;
|
|
503
|
+
/**
|
|
504
|
+
* `true` on a temporary install (`InstallOptions.temporary`), absent on a kept one and on anything an
|
|
505
|
+
* older fkn.app answers, so read it with `=== true`. A package both kept and temporary reads as kept.
|
|
506
|
+
*/
|
|
507
|
+
temporary?: true;
|
|
503
508
|
};
|
|
504
509
|
type PickOptions = {
|
|
505
510
|
/** untrusted, rendered as text in the picker header */
|
|
@@ -514,9 +519,41 @@ type InstallOptions = {
|
|
|
514
519
|
/**
|
|
515
520
|
* Re-pin an existing record to whatever the source now calls latest, instead of answering the
|
|
516
521
|
* record already held. A host page pinning its own package on every load is what this exists for.
|
|
517
|
-
* An unreachable source keeps the record rather than dropping it.
|
|
522
|
+
* An unreachable source keeps the record rather than dropping it. A temporary install stays temporary.
|
|
518
523
|
*/
|
|
519
524
|
latest?: boolean;
|
|
525
|
+
/**
|
|
526
|
+
* Install for this tab only, writing no install record. The package connects, mounts and lists like a
|
|
527
|
+
* kept one, and asks exactly what a kept install asks: the confirm, or with `noConfirm` the notice.
|
|
528
|
+
*
|
|
529
|
+
* It lasts as long as the tab: a reload keeps it, another tab does not have it, and closing the tab
|
|
530
|
+
* ends it. The exceptions are the browser's own copies of a tab: on Chromium, Duplicate Tab, Reopen
|
|
531
|
+
* Closed Tab and a `window.open` that keeps its opener carry it along, and the copy then lives on its
|
|
532
|
+
* own. A link's `target=_blank` carries nothing, and neither does Firefox's `window.open`.
|
|
533
|
+
*
|
|
534
|
+
* Signing out of the app ends it, on the app's other websites too wherever the sign out reaches them.
|
|
535
|
+
* One installed after the sign out stays until the next one.
|
|
536
|
+
*
|
|
537
|
+
* Within one tab it follows the app between its websites fkn.dev holds as verified, as long as they
|
|
538
|
+
* share a site (anime.fkn.app to movies.fkn.app). A website on another domain reads other storage and
|
|
539
|
+
* does not have it, so carry the package on the link there and install it again.
|
|
540
|
+
*
|
|
541
|
+
* Over a package already kept this changes nothing and answers the kept record. `install()` without
|
|
542
|
+
* this option, and without `latest`, keeps a temporary package, behind what a kept install asks, and
|
|
543
|
+
* replaces the temporary record. To turn a kept install temporary, uninstall it and install it
|
|
544
|
+
* temporary at the version it had. That ends its connections, so connect again, and takes it off the
|
|
545
|
+
* app's other tabs. An install that fails there, offline say, leaves the package uninstalled.
|
|
546
|
+
*
|
|
547
|
+
* ```ts
|
|
548
|
+
* await packages.uninstall(uri)
|
|
549
|
+
* await packages.install(uri, { temporary: true, noConfirm: true, version: kept.version ?? undefined })
|
|
550
|
+
* ```
|
|
551
|
+
*
|
|
552
|
+
* An older fkn.app cannot do this, and `install` then throws a PackagesError with code 'unsupported'
|
|
553
|
+
* and installs nothing. To know beforehand, which the uninstall above needs, ask
|
|
554
|
+
* `await packages.supportsTemporary?.() === true`: the `?.` covers an @fkn/lib older than this option.
|
|
555
|
+
*/
|
|
556
|
+
temporary?: boolean;
|
|
520
557
|
};
|
|
521
558
|
type ConnectOptions = {
|
|
522
559
|
/** opaque contract tag delivered to the package's onConnect, e.g. 'stub-source@1' */
|
|
@@ -541,7 +578,7 @@ type Placement = {
|
|
|
541
578
|
/** the placeholder's corner radii, so the frame follows a rounded container */
|
|
542
579
|
radius?: Radii;
|
|
543
580
|
};
|
|
544
|
-
type PackagesErrorCode = 'invalid' | 'not-installed' | 'unaddressable' | 'timeout' | 'unavailable' | 'denied';
|
|
581
|
+
type PackagesErrorCode = 'invalid' | 'not-installed' | 'unaddressable' | 'timeout' | 'unavailable' | 'denied' | 'unsupported';
|
|
545
582
|
type PackagesFail = {
|
|
546
583
|
error: PackagesErrorCode;
|
|
547
584
|
message: string;
|
|
@@ -1393,6 +1430,16 @@ type Resolvers = {
|
|
|
1393
1430
|
} | {
|
|
1394
1431
|
declined: true;
|
|
1395
1432
|
}>;
|
|
1433
|
+
/**
|
|
1434
|
+
* `install` with `temporary: true`. A member of its own, and a function, because that is what the
|
|
1435
|
+
* lib's facade can detect: a broker predating it reads undefined and is never asked, where its
|
|
1436
|
+
* `install` would ignore the option and keep the package.
|
|
1437
|
+
*/
|
|
1438
|
+
installTemporary?: (uri: string, options?: InstallOptions) => Promise<PackagesFail | {
|
|
1439
|
+
installed: InstalledPackage;
|
|
1440
|
+
} | {
|
|
1441
|
+
declined: true;
|
|
1442
|
+
}>;
|
|
1396
1443
|
frame: (uri: string) => Promise<PackagesFail | MountDescriptor>;
|
|
1397
1444
|
list: () => Promise<{
|
|
1398
1445
|
results: InstalledPackage[];
|
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 RoomCreateOptions, A as MiddleGotoOptions, At as StorageFail, B as ProxyFetch, Bt as TcpSocketListenerResult, C as FrameMessageRelay, Ct as SetOverlayHost, D as IpFamily, Dt as ShellJarUnreachable, E as InstalledPackage, Et as ShellGotoOptions, F as PackageResult, Ft as StoredHandle, G as RELAY_HEADER, Gt as UdpSocketResult, H as ProxyFetchInput, Ht as TcpSocketResult, I as PackagesErrorCode, It as StoredObject, J as Radii, Jt as WINDOW_JAR_MODE_TIMEOUT_MS, K as RELAY_UNAVAILABLE, Kt as WINDOW_HANDSHAKE_TIMEOUT_MS, L as PackagesFail, Lt as StoredPage, M as OverlayRect, Mt as StoragePutOptions, N as OverlayState, Nt as StoragePutWire, O as JAR_ANCHOR_MESSAGE, Ot as StorageEntry, P as PackageQuery, Pt as StorageQuota, Q as RoomClaimOptions, Qt as JarSeedCookie, R as PickOptions, Rt as SurfaceRect, S as FrameFetchScope, St as STORAGE_REFUSALS, T as InstallOptions, Tt as ShellFrameMessage, U as Quota, Ut as UdpDatagram, V as ProxyFetchInit, Vt as TcpSocketOptions, W as RELAY_CHOICE_UNSUPPORTED, Wt as UdpSocketOptions, X as Resolvers, Xt as WriteData, Y as RelayResolution, Yt as WindowMiddleControl, Z as RoomBacklog, Zt as JarSeed, _ as DnsLookup, _t as SHELL_ATTACH_ERROR, a as AccountChange, at as RoomJoinOptions, b as FrameConsentAnswer, bt as SHELL_JAR_MESSAGE, c as AdoptRequest, ct as RoomMember, d as ConflictRequest, dt as RoomPermission, et as RoomDefaults, f as ConflictSide, ft as RoomPermissions, g as DisplayLevel, gt as RoomsFail, h as DisplayCause, ht as RoomsErrorCode, i as Account, it as RoomHandle, j as MountDescriptor, jt as StorageProgress, k as MiddleControl, kt as StorageErrorCode, l as AdoptState, lt as RoomMessage, m as ConnectOptions, mt as RoomType, n as ATTACH_WINDOW_KEY, nt as RoomEnvelope, o as AccountPinOptions, ot as RoomJson, p as ConnectAvailability, pt as RoomSchema, q as ROOM_TEMPORARY_MS, qt as WINDOW_HELLO_TIMEOUT_MS, r as ATTACH_WINDOW_MESSAGE, rt as RoomEvent, s as AddressLookupResult, st as RoomMailbox, t as ATTACH_FRAME_KEY, tt as RoomEnd, u as ConflictChoice, ut as RoomOpenOptions, v as EncryptionState, vt as SHELL_CONTROL_KEY, w as HiddenSurface, wt as ShellControl, x as FrameConsentRequest, xt as SHELL_JAR_UNREACHABLE, y as FRAME_MESSAGE, yt as SHELL_FRAME_MESSAGE, z as Placement, zt as TcpSocketListenerOptions } from "./contract-
|
|
2
|
+
import { $ as RoomCreateOptions, A as MiddleGotoOptions, At as StorageFail, B as ProxyFetch, Bt as TcpSocketListenerResult, C as FrameMessageRelay, Ct as SetOverlayHost, D as IpFamily, Dt as ShellJarUnreachable, E as InstalledPackage, Et as ShellGotoOptions, F as PackageResult, Ft as StoredHandle, G as RELAY_HEADER, Gt as UdpSocketResult, H as ProxyFetchInput, Ht as TcpSocketResult, I as PackagesErrorCode, It as StoredObject, J as Radii, Jt as WINDOW_JAR_MODE_TIMEOUT_MS, K as RELAY_UNAVAILABLE, Kt as WINDOW_HANDSHAKE_TIMEOUT_MS, L as PackagesFail, Lt as StoredPage, M as OverlayRect, Mt as StoragePutOptions, N as OverlayState, Nt as StoragePutWire, O as JAR_ANCHOR_MESSAGE, Ot as StorageEntry, P as PackageQuery, Pt as StorageQuota, Q as RoomClaimOptions, Qt as JarSeedCookie, R as PickOptions, Rt as SurfaceRect, S as FrameFetchScope, St as STORAGE_REFUSALS, T as InstallOptions, Tt as ShellFrameMessage, U as Quota, Ut as UdpDatagram, V as ProxyFetchInit, Vt as TcpSocketOptions, W as RELAY_CHOICE_UNSUPPORTED, Wt as UdpSocketOptions, X as Resolvers, Xt as WriteData, Y as RelayResolution, Yt as WindowMiddleControl, Z as RoomBacklog, Zt as JarSeed, _ as DnsLookup, _t as SHELL_ATTACH_ERROR, a as AccountChange, at as RoomJoinOptions, b as FrameConsentAnswer, bt as SHELL_JAR_MESSAGE, c as AdoptRequest, ct as RoomMember, d as ConflictRequest, dt as RoomPermission, et as RoomDefaults, f as ConflictSide, ft as RoomPermissions, g as DisplayLevel, gt as RoomsFail, h as DisplayCause, ht as RoomsErrorCode, i as Account, it as RoomHandle, j as MountDescriptor, jt as StorageProgress, k as MiddleControl, kt as StorageErrorCode, l as AdoptState, lt as RoomMessage, m as ConnectOptions, mt as RoomType, n as ATTACH_WINDOW_KEY, nt as RoomEnvelope, o as AccountPinOptions, ot as RoomJson, p as ConnectAvailability, pt as RoomSchema, q as ROOM_TEMPORARY_MS, qt as WINDOW_HELLO_TIMEOUT_MS, r as ATTACH_WINDOW_MESSAGE, rt as RoomEvent, s as AddressLookupResult, st as RoomMailbox, t as ATTACH_FRAME_KEY, tt as RoomEnd, u as ConflictChoice, ut as RoomOpenOptions, v as EncryptionState, vt as SHELL_CONTROL_KEY, w as HiddenSurface, wt as ShellControl, x as FrameConsentRequest, xt as SHELL_JAR_UNREACHABLE, y as FRAME_MESSAGE, yt as SHELL_FRAME_MESSAGE, z as Placement, zt as TcpSocketListenerOptions } from "./contract-CDdIE_Es.js";
|
|
3
3
|
import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-DhmLnYEU.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, 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, 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-DeGR_tzF.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,8 +1,8 @@
|
|
|
1
1
|
import { D as RelayChoice } from "./index-HMfzm6dF.js";
|
|
2
|
-
import { Gt as UdpSocketResult, X as Resolvers } from "./contract-
|
|
2
|
+
import { Gt as UdpSocketResult, X as Resolvers } from "./contract-CDdIE_Es.js";
|
|
3
3
|
import { x as UdpSocketOption } from "./wire-DhmLnYEU.js";
|
|
4
|
-
import "./api-
|
|
5
|
-
import { t as RelayOption } from "./relay-choice-
|
|
4
|
+
import "./api-DhwJz0vo.js";
|
|
5
|
+
import { t as RelayOption } from "./relay-choice-DB1F7bcn.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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DrvhPN56.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=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).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;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)):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=>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-BkoXMcoe.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=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).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;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)):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=>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}});
|
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-Xrt2rPrC.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-CPQqam5Z.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-BMCYdn0Q.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-DeGR_tzF.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-BkoXMcoe.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-ijWQw2NO.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-CDdIE_Es.js";
|
|
2
|
+
import { n as lookup } from "./dns-_NCe2YLS.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-CxfA8mGU.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-C1OPIW6F.cjs"),n=require("./broker-frame-BKHtDSjv.cjs"),r=require("./api-BkoXMcoe.cjs"),i=require("./contract.cjs"),a=require("./proxy-BFa0n5gx.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 r.o,i=null,a=new Promise(e=>{i=()=>{t.rt()&&e(!0)},t.nt.addEventListener(`statuschange`,i)}),o=n.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.nt.removeEventListener(`statuschange`,i),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(i.RELAY_HEADER)}catch{}return e},f=()=>typeof document<`u`&&t.rt(),p=async(e,r)=>{if(n.r(e),t.Z(`fetch`,r?.reason),r?.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,r).then(d)}return f()?t.W(e,{...r,credentials:`omit`}).then(d):o.t()?o.a(e,r):a.t(e,r)},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,9 +1,9 @@
|
|
|
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 { r as le } from "./broker-frame-
|
|
4
|
-
import { o as ue } from "./api-
|
|
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-6lykV0aT.js";
|
|
3
|
+
import { r as le } from "./broker-frame-BClLp2ZV.js";
|
|
4
|
+
import { o as ue } from "./api-DeGR_tzF.js";
|
|
5
5
|
import { RELAY_HEADER as de } from "./contract.js";
|
|
6
|
-
import { t as fe } from "./proxy-
|
|
6
|
+
import { t as fe } from "./proxy-FSgMUaD3.js";
|
|
7
7
|
import { a as q, t as pe } from "./desktop-xTT7ciGX.js";
|
|
8
8
|
// ../web-extension/lib/utils/background-stopped.js
|
|
9
9
|
var J = "BackgroundStoppedError", Y = (e) => w(e) && e.name === "BackgroundStoppedError", X = async (e) => {
|
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-C1OPIW6F.cjs"),t=require("./extension-gWkpzDKG.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-6lykV0aT.js";
|
|
2
|
+
import { a as ne, i as re, o as ie, r as ae } from "./extension-nTQBWRg6.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-Cu7wH1Fo.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-DsHrUu0O.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 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./node-fs-DN0ejGTL.cjs"),n=require("./messages.cjs"),r=require("./account-storage-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./node-fs-DN0ejGTL.cjs"),n=require("./messages.cjs"),r=require("./account-storage-gOL0HE6i.cjs");var i=e.t({STORAGE_ACCOUNT_CHANGED:()=>n.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageAccountChangedError:()=>r.t,StorageAccountPinUnsupportedError:()=>r.n,StorageLockedError:()=>r.r,StorageNotFoundError:()=>r.i,availability:()=>r.o,available:()=>a,encryption:()=>r.c,isAccountChanged:()=>r.l,isNotFound:()=>r.d,list:()=>h,mkdir:()=>d,promises:()=>m,quota:()=>r.h,readFile:()=>o,readFileSealed:()=>g,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.y,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.a,{memfs:!1}),h=()=>r.p(),g=e=>r._(e);Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return f}});
|