@fkn/lib 0.9.51 → 0.9.53
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-generation-hUekEHGW.js → account-generation-BgiEc3fw.js} +1 -1
- package/{account-generation-9VhfEDoW.cjs → account-generation-C5rMCyt1.cjs} +1 -1
- package/{account-storage-C31d68BN.js → account-storage-DptsMWKl.js} +2 -2
- package/{account-storage-C6hcXjG0.cjs → account-storage-IAVrRXTF.cjs} +1 -1
- package/account.cjs +1 -1
- package/account.js +2 -2
- package/api-6wTec7WK.cjs +3 -0
- package/{api-ySazPAwN.js → api-CX9w35R2.js} +131 -143
- package/{api-BFVa-RbA.d.ts → api-mHRuM_Sd.d.ts} +10 -9
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-D8I5SjTC.js → cloud-CMEnCSBw.js} +3 -3
- package/{cloud-DMlEP2L-.d.ts → cloud-Dykm74YZ.d.ts} +2 -2
- package/{cloud-BP_iRJY9.cjs → cloud-kg1hOpPJ.cjs} +1 -1
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -3
- package/cloud.js +2 -2
- package/{contract-De1rQSCD.d.ts → contract-BN0cD-Oq.d.ts} +5 -4
- package/contract.d.ts +1 -1
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-BhLUxlMu.cjs → extension-BdAR-wQ0.cjs} +1 -1
- package/{extension-LAOGLbEB.js → extension-DiyykwoW.js} +3 -3
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.js +1 -1
- package/{fs-zERmcLRS.cjs → fs-CPsnX6ti.cjs} +1 -1
- package/{fs-ClnOPmRF.js → fs-Cd1HK3C3.js} +2 -2
- package/fs.cjs +1 -1
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +2 -2
- package/index.js +5 -5
- package/{lib-B3BXMegM.cjs → lib-C0xyv8BQ.cjs} +1 -1
- package/{lib-ERmfLvVp.js → lib-C5N2rmbj.js} +1 -23
- package/{net-CF0QTQkN.d.ts → net-Dq1KyRP0.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +1 -1
- package/{proxy-C2BGx_V8.d.ts → proxy-Cer0Iarp.d.ts} +2 -2
- package/{proxy-BfkfFsNI.cjs → proxy-DhalpZoN.cjs} +1 -1
- package/{proxy-BXkxwBxK.js → proxy-v_Z5aPh2.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +11 -11
- package/rooms.js +1 -2
- package/storage.cjs +1 -1
- package/storage.d.ts +1 -1
- package/storage.js +3 -3
- package/api-DMnVye0K.cjs +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, l as t, u as n } from "./api-
|
|
1
|
+
import { c as e, l as t, u as n } from "./api-CX9w35R2.js";
|
|
2
2
|
//#region src/account-generation.ts
|
|
3
3
|
var r = 0, i = /* @__PURE__ */ new Set(), a = 2e3, o = null, s = (e) => {
|
|
4
4
|
e?.switched !== !1 && (r += 1, o &&= (clearTimeout(o.timer), null));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./api-
|
|
1
|
+
const e=require("./api-6wTec7WK.cjs");var t=0,n=new Set,r=2e3,i=null,a=e=>{e?.switched!==!1&&(t+=1,i&&=(clearTimeout(i.timer),null));for(let e of[...n])try{e()}catch{}},o=!1,s=0,c=()=>{let t=e.c();t&&s!==t.epoch&&(s=t.epoch,Promise.resolve(t.remote.account.onChange(a)).catch(()=>{s===t.epoch&&(s=0)}))},l=()=>{!o&&e.l&&(o=!0,e.u(c))},u=()=>t,d=e=>(n.add(e),l(),()=>{n.delete(e)}),f=e=>{if(e!==t||i?.generation===e)return;let n=setTimeout(()=>{i?.timer===n&&(i=null,t===e&&a({switched:!0}))},r);i={generation:e,timer:n}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./api-
|
|
2
|
+
import { o as t } from "./api-CX9w35R2.js";
|
|
3
3
|
import { STORAGE_ACCOUNT_CHANGED as n, STORAGE_ACCOUNT_PIN_UNSUPPORTED as r, STORAGE_NOT_FOUND as i } from "./messages.js";
|
|
4
|
-
import { n as a, r as o, t as s } from "./account-generation-
|
|
4
|
+
import { n as a, r as o, t as s } from "./account-generation-BgiEc3fw.js";
|
|
5
5
|
//#region src/account-storage.ts
|
|
6
6
|
var c = /* @__PURE__ */ e({
|
|
7
7
|
StorageAccountChangedError: () => f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-6wTec7WK.cjs"),n=require("./messages.cjs"),r=require("./account-generation-C5rMCyt1.cjs");var i=e.t({StorageAccountChangedError:()=>c,StorageAccountPinUnsupportedError:()=>l,StorageLockedError:()=>a,StorageNotFoundError:()=>o,availability:()=>k,available:()=>w,captureAccount:()=>p,encryption:()=>L,isAccountChanged:()=>u,isInvalidPin:()=>d,isNotFound:()=>s,knownPin:()=>y,list:()=>A,pinFor:()=>b,quota:()=>j,readFile:()=>M,readFileSealed:()=>P,remove:()=>I,unlock:()=>R,writeFile:()=>F}),a=class extends Error{code=`FKN_E2E_LOCKED`;constructor(){super(`storage locked: connect the app again to open encrypted data`)}},o=class extends Error{code=n.STORAGE_NOT_FOUND;constructor(e=`storage: no object at that path`){super(e)}},s=e=>e?.code===n.STORAGE_NOT_FOUND,c=class extends Error{code=n.STORAGE_ACCOUNT_CHANGED;constructor(e=`storage: the signed-in account changed, so this call was not made`){super(e)}},l=class extends Error{code=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED;constructor(e=`storage: the FKN broker cannot pin calls to an account yet, so nothing was sent`){super(e)}},u=e=>e?.code===`FKN_ACCOUNT_CHANGED`||e instanceof Error&&e.message.startsWith(`fkn:account-changed`),d=e=>e instanceof Error&&e.message.startsWith(`fkn:account-pin-invalid`),f=e=>{throw e instanceof Error&&e.message.startsWith(`fkn:e2e-locked`)?new a:s(e)?new o(e.message):u(e)?new c:e instanceof Error&&e.message.startsWith(`fkn:account-pin-unsupported`)?new l:e instanceof Error&&(/^not found$/i.test(e.message)||/\(404\)$/.test(e.message))?new o(e.message):e},p=()=>(r.n(),{generation:r.t()}),m=new Map,h=null,g=e=>typeof e?.accountPin==`function`,_=(e,t)=>{let n=Promise.resolve(t.accountPin()).then(t=>{if(typeof t!=`string`||!t)throw Error(`storage: the broker answered no account pin`);return r.t()===e&&m.set(e,t),t});return h={generation:e,pin:n},n.catch(()=>{h?.pin===n&&(h=null)}),n},v=async(e,t)=>{let n=m.get(e.generation);if(n!==void 0)return n;if(e.generation!==r.t())throw new c;let i=await(h?.generation===e.generation?h.pin:_(e.generation,t)).catch(f);if(e.generation!==r.t())throw new c;return i},y=e=>m.get(e.generation),b=async e=>{let n=(await t.o).cloud.fs;if(!g(n))throw new l;return v(e,n)},x=e=>{for(let[t,n]of m)if(n===e)return t},S=e=>e?.pin??p(),C=async(e,n)=>{let i=(await t.o).cloud.fs;if(!g(i))throw new l;let a=`pin`in e?e.pin:await v(e,i);if(!g(i))throw new l;return n(i,{accountPin:a}).catch(t=>{if(u(t)){let t=`generation`in e?e.generation:x(a);t!==void 0&&r.r(t)}return f(t)})},w=()=>t.o.then(e=>e.cloud.fs.available()).catch(()=>!1),T=8e3,E=1e3,D=!1,O=async()=>{let e=(await t.o).cloud.fs;return typeof e.availability==`function`?e.availability():await e.available()?`connected`:`disconnected`},k=async()=>{let e=D?E:T,t=await new Promise(t=>{let n=setTimeout(()=>t(`timeout`),e);O().then(e=>{clearTimeout(n),t(e)},()=>{clearTimeout(n),t(`unknown`)})});return t===`timeout`?(D=!0,`unknown`):(D=!1,t)},A=e=>C(S(e),(e,t)=>e.list(t)),j=()=>t.o.then(e=>e.cloud.fs.quota()),M=async(e,t)=>{let n=await C(S(t),(t,n)=>t.readFile(e,n));return new Blob([n])},N=e=>{if(e===null||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString()},P=async(e,t)=>C(S(t),async(t,n)=>{let r=t;if(typeof r.readFileSealed!=`function`)return{data:await t.readFile(e,n),sealedAt:null};let i=await r.readFileSealed(e,n);return{data:i.bytes,sealedAt:N(i.sealedAt)}}),F=async(e,t,n)=>{let r=S(n),i=t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t;await C(r,(t,r)=>t.writeFile(e,i,n?.contentType??null,r))},I=async(e,t)=>{await C(S(t),(t,n)=>t.remove(e,n))},L=()=>t.o.then(e=>e.cloud.fs.encryption()),R=()=>t.o.then(e=>e.cloud.fs.unlock());Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return R}});
|
package/account.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-6wTec7WK.cjs"),n=require("./account-generation-C5rMCyt1.cjs");var r=e.t({info:()=>o,login:()=>i,logout:()=>a,onChange:()=>s}),i=async()=>typeof window>`u`?!1:(await t.o).account.login(location.origin).catch(()=>!1),a=async()=>{typeof window<`u`&&await(await t.o).account.logout().catch(()=>{})},o=async()=>{if(typeof window>`u`)return null;let e=await t.o.then(e=>e.account.info()).catch(()=>null);return e?{name:e.name,image:e.image,premium:e.premium,premiumUntil:e.premiumUntil?Date.parse(e.premiumUntil):null}:null},s=async e=>t.l?n.i(e):()=>{};exports.info=o,exports.login=i,exports.logout=a,exports.onChange=s,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
package/account.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { l as t, o as n } from "./api-
|
|
3
|
-
import { i as r } from "./account-generation-
|
|
2
|
+
import { l as t, o as n } from "./api-CX9w35R2.js";
|
|
3
|
+
import { i as r } from "./account-generation-BgiEc3fw.js";
|
|
4
4
|
//#region src/account.ts
|
|
5
5
|
var i = /* @__PURE__ */ e({
|
|
6
6
|
info: () => s,
|
package/api-6wTec7WK.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
let e=require("osra");var t=1e4,n=16,r=e=>{let t;try{t=e.contentWindow}catch{return!0}if(!t)return!0;try{let e=t.location.href;return e!==``&&e!==`about:blank`}catch{return!0}},i=(e,i=t)=>new Promise(t=>{if(r(e))return t();let a=()=>{clearInterval(o),clearTimeout(s),e.removeEventListener(`load`,a),t()},o=setInterval(()=>{r(e)&&a()},n),s=setTimeout(a,i);e.addEventListener(`load`,a)}),a=32,o=8,s=120,c=typeof CSS<`u`&&CSS.supports(`clip-path`,`path('M0 0H1V1H0Z')`),l=typeof CSS<`u`&&CSS.supports(`clip-path`,`polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)`),u=e=>{let t=e.style;t.setProperty(`display`,`block`,`important`),t.setProperty(`position`,`fixed`,`important`),t.setProperty(`top`,`0`,`important`),t.setProperty(`left`,`0`,`important`),t.setProperty(`width`,`100%`,`important`),t.setProperty(`height`,`100%`,`important`),t.setProperty(`border`,`none`,`important`),t.setProperty(`padding`,`0`,`important`),t.setProperty(`box-sizing`,`border-box`,`important`),t.setProperty(`clip-path`,`inset(100%)`,`important`),t.setProperty(`background`,`transparent`),t.setProperty(`color-scheme`,`normal`),t.setProperty(`z-index`,`2147483647`),e.setAttribute(`title`,`FKN`)},d=({x:e,y:t,width:n,height:r,radius:i})=>{if(!i)return`M${e} ${t}h${n}v${r}h${-n}Z`;let a=Math.min(n,r)/2,[o,s,c,l]=i.map(e=>Math.max(0,Math.min(e,a)));return`M${e+o} ${t}h${n-o-s}a${s} ${s} 0 0 1 ${s} ${s}v${r-s-c}a${c} ${c} 0 0 1 ${-c} ${c}h${-(n-c-l)}a${l} ${l} 0 0 1 ${-l} ${-l}v${-(r-l-o)}a${o} ${o} 0 0 1 ${o} ${-o}Z`},f=()=>c&&l,p=({x:e,y:t,width:n,height:r})=>[[e,t],[e+n,t],[e+n,t+r],[e,t+r],[e,t]],m=e=>{let t=e[0];if(!t)return[];let n=p(t)[0],r=[];return e.forEach((t,i)=>{r.push(...p(t)),i>0&&i<e.length-1&&r.push(n)}),r},h=e=>`polygon(nonzero, ${m(e).map(([e,t])=>`${e}px ${t}px`).join(`, `)})`,g=({x:e,y:t,width:n,height:r,radius:i},a)=>{let o=`${t}px ${a.width-e-n}px ${a.height-t-r}px ${e}px`;return i?`inset(${o} round ${i.map(e=>`${e}px`).join(` `)})`:`inset(${o})`},ee=(e,t,n)=>{if(t)return`none`;if(e.length===0)return`inset(100%)`;let r=e.length===1?e[0]:void 0;return r?g(r,n):l&&e.length<=5&&!e.some(e=>e.radius)?h(e):`path('${e.map(d).join(``)}')`},te=e=>{if(e.length<2)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y));return{x:t,y:n,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-n}},ne=(e,t,n)=>t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height,re=16,_=(e,t,n)=>t===1?e*re:t===2?e*n:e,ie=(e,t,n)=>{let r=getComputedStyle(e);return n!==0&&/auto|scroll/.test(r.overflowY)&&e.scrollHeight>e.clientHeight?!0:t!==0&&/auto|scroll/.test(r.overflowX)&&e.scrollWidth>e.clientWidth},ae=(e,t,n)=>{for(let r=e;r;r=r.parentElement)if(ie(r,t,n))return r;return document.scrollingElement},v=null,y=null,b=e=>({width:e.offsetWidth||window.innerWidth,height:e.offsetHeight||window.innerHeight}),x=e=>{if(!y||!v||!ne(y,e.clientX,e.clientY))return;let t=document.elementFromPoint(e.clientX,e.clientY);if(!t||t===v)return;let n=_(e.deltaX,e.deltaMode,window.innerWidth),r=_(e.deltaY,e.deltaMode,window.innerHeight),i=ae(t,n,r);i&&(i.scrollBy({left:n,top:r,behavior:`instant`}),e.cancelable&&e.preventDefault())},oe=e=>{let t=y!==null;y=e,t!==(e!==null)&&(e?window.addEventListener(`wheel`,x,{capture:!0,passive:!1}):window.removeEventListener(`wheel`,x,{capture:!0}))},S=0,se=e=>{if(e===S)return;S=e;let t=document.documentElement.style;e>0?(t.setProperty(`margin-top`,`${e}px`,`important`),t.setProperty(`--fkn-inset-top`,`${e}px`)):(t.removeProperty(`margin-top`),t.removeProperty(`--fkn-inset-top`))},C=(e,{modal:t,rects:n,inset:r},i)=>{if(se(r),!c){let r=t||n.length>0;e.style.setProperty(`pointer-events`,r?`auto`:`none`,`important`),e.style.setProperty(`visibility`,r?`visible`:`hidden`,`important`);return}let a=ee(n,t,i),o=a===`none`||CSS.supports(`clip-path`,a)?a:`inset(100%)`;e.style.setProperty(`clip-path`,o,`important`),oe(t||o!==a?null:te(n))},ce=e=>{if(typeof e!=`object`||!e)return 0;let{top:t}=e;return typeof t!=`number`||!Number.isFinite(t)||t<=0?0:Math.min(Math.round(t),s)},le=e=>{if(Array.isArray(e)&&e.length===4&&e.every(e=>typeof e==`number`&&Number.isFinite(e)&&e>=0))return e.some(e=>e>0)?e:void 0},ue=(e,t)=>{if(typeof e!=`object`||!e)return null;let{x:n,y:r,width:i,height:a}=e;if(![n,r,i,a].every(e=>typeof e==`number`&&Number.isFinite(e)))return null;let o=t.width,s=t.height,c=Math.max(0,Math.min(Math.round(n),o)),l=Math.max(0,Math.min(Math.round(r),s)),u=Math.max(c,Math.min(Math.round(n+i),o)),d=Math.max(l,Math.min(Math.round(r+a),s)),f=le(e.radius);return{x:c,y:l,width:u-c,height:d-l,...f?{radius:f}:{}}},w={"not-rendered":`this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout`,clipped:`it is clipped away or positioned outside the viewport`,"not-shown":`it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter`},de=e=>Array.isArray(e)?e.slice(0,o).flatMap(e=>{if(typeof e!=`object`||!e)return[];let{kind:t,cause:n,level:r}=e;return typeof t!=`string`||t.length>40||typeof n!=`string`||!(n in w)||r!==`full`&&r!==`liveness`?[]:[{kind:t,cause:n,level:r}]}):[],T=new Set,fe=e=>{for(let{kind:t,cause:n,level:r}of e)T.has(t)||(T.add(t),console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${w[n]}. Nobody using this page can see or answer it.
|
|
2
|
+
@fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.`+(r===`liveness`?`
|
|
3
|
+
This browser reports limited detail, so the cause above is a best guess.`:``)))},E=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=e,r=(Array.isArray(n.rects)?n.rects.slice(0,a):[]).map(e=>ue(e,t)).filter(e=>e!==null&&e.width>0&&e.height>0);return{modal:n.modal===!0,rects:r,hidden:de(n.hidden),inset:ce(n.inset)}},pe=()=>v!==null,D=null,O=null,me=()=>{if(!v||D===null)return;let e=b(v),t=E(D,e);t&&C(v,t,e)},he=e=>{typeof ResizeObserver<`u`&&(O??=new ResizeObserver(me),O.disconnect(),O.observe(e))},ge=e=>{u(e),C(e,{modal:!1,rects:[],hidden:[],inset:0},b(e)),v=e,he(e)},_e=e=>{if(!v)return;let t=b(v),n=E(e,t);n&&(D=e,C(v,n,t),fe(n.hidden))},ve=`fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,plugins.banou.dev`.split(`,`),k=e=>e.toLowerCase().replace(/\.+$/,``),ye=[`79.127.204.69`,`152.233.49.59`],be=e=>{let t;try{t=new URL(`http://${e.includes(`:`)&&!e.startsWith(`[`)?`[${e}]`:e}/`).hostname}catch{return}let n=/^\[(?:::ffff:|64:ff9b::)([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(n){let e=parseInt(n[1],16),t=parseInt(n[2],16);return[e>>8,e&255,t>>8,t&255].join(`.`)}return/^\d+\.\d+\.\d+\.\d+$/.test(t)?t:void 0},xe=e=>{let t=k(e);return ve.some(e=>t===e||t.endsWith(`.${e}`))},Se=e=>{if(xe(e))return!0;let t=be(k(e));return t!==void 0&&ye.includes(t)},Ce=e=>{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n;try{n=new URL(t)}catch{return}if(Se(n.hostname))throw Error(`fetch refuses FKN platform domains (${n.hostname})`)},we=`autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network`.split(`.`),Te=()=>{try{let e=globalThis.document?.featurePolicy?.features?.();return e===void 0?void 0:new Set(e)}catch{return}},A=(e=!0,t=Te())=>[...we,...e?[`cross-origin-isolated`]:[]].filter(e=>t===void 0||t.has(e)).join(`; `),j=`https://fkn.app`,M=typeof globalThis<`u`&&globalThis.document?globalThis.document:void 0,N=typeof globalThis<`u`&&globalThis.crossOriginIsolated===!0,P=`${j}/api${N?`?coi=1`:``}`,Ee=`fkn-api-port`,De=`fkn-api-port-ack`,Oe=2e3,ke=()=>{if(!M||typeof window>`u`||window.parent===window)return Promise.resolve(void 0);let e;try{e=window.parent}catch{return Promise.resolve(void 0)}let t=new MessageChannel;return new Promise(n=>{let r=e=>{if(clearTimeout(a),t.port1.removeEventListener(`message`,i),!e)try{t.port1.close()}catch{}n(e)},i=e=>{e.data?.type===De&&r(t.port1)},a=setTimeout(()=>r(void 0),Oe);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:Ee},j,[t.port2])}catch{r(void 0)}})},F,Ae=()=>{if(F||!M)return F;let e=M.querySelector(`iframe[src="${P}"]`);if(e)F=e;else{let e=M.createElement(`iframe`);e.setAttribute(`allow`,A(N)),e.src=P,M.body.appendChild(e),F=e}return ge(F),F},I=(async()=>{if(!M)return;let e=await ke();if(e)return{receive:e,emit:e};let t=Ae();if(!t)return;await i(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),je=(e,{boundRetired:t=e=>e}={})=>{let n,r=0,i=!1,a=()=>{},o=()=>new Promise(e=>{a=e}),s=o(),c=s,l=new Set,u=new Set,d=0,f=0,p=()=>{let e=[...u];u.clear();let t=Error(`FKN: the broker was replaced while this call was pending; retry it`);for(let n of e)try{n(t)}catch{}};(async()=>{for await(let t of e){let e=++r;n={remote:t,epoch:e};let i=a;s=o(),i(t),p();for(let n of[...l])try{n(t,e)}catch{}}})().catch(()=>{});let m=async(e,r)=>{let a=n?.remote??await(i?t(s):s);for(let t of e.slice(0,-1))a=a[t];let o=a[e[e.length-1]??``];d=Date.now(),f+=1;let c=()=>{},l=new Promise((e,t)=>{c=t});u.add(c);try{return await Promise.race([Promise.resolve(o.apply(a,r)),l])}finally{--f,u.delete(c),d=Date.now()}},h=new Map,g=e=>{let t=e.join(`\0`),r=h.get(t);if(r)return r;let i=new Proxy(function(){},{get:(t,r)=>{if(typeof r!=`string`||r===`then`)return;let i=n;if(i){let t=i.remote;for(let n of e)t=t?.[n];if(t?.[r]===void 0)return}return g([...e,r])},apply:(t,n,r)=>m(e,r)});return h.set(t,i),i};return{facade:g([]),first:c.then(()=>{}),current:()=>n,onEpoch:e=>{if(l.add(e),n)try{e(n.remote,n.epoch)}catch{}return()=>{l.delete(e)}},lastCall:()=>d,inFlight:()=>f,routable:()=>n?Promise.resolve():s.then(()=>{}),retire:()=>{i=!0,n=void 0,p()}}},L=!1,R=new Set,z=()=>L,Me=()=>{if(!L){L=!0;for(let e of[...R])try{e()}catch{}R.clear()}},B=e=>{L?e():R.add(e)},Ne=typeof window<`u`||typeof self<`u`,V=async()=>{if(typeof window<`u`)return I;if(typeof self<`u`)return{receive:self,emit:self}},H=`fkn-api`,Pe=`fkn-api-window`,Fe={async*[Symbol.asyncIterator](){let t=await V();if(!t){await new Promise(()=>{});return}if(!z()){let n=new AbortController;B(()=>n.abort());for await(let r of(0,e.expose)({},{key:H,transport:t,unregisterSignal:n.signal})){if(n.signal.aborted)break;yield r}}yield*(0,e.expose)({},{key:Pe,transport:t})}},U=!1,W=V().then(t=>new Promise(n=>{if(!t)return;let{receive:r}=t,i=t=>{(0,e.checkOsraMessageKey)(t.data,H)&&(r.removeEventListener(`message`,i),U=!0,n())};r.addEventListener(`message`,i)})),G=je(Fe,{boundRetired:e=>Promise.race([e,W.then(()=>Q(e,()=>new Z))])});B(()=>G.retire());var K=Promise.race([G.first,new Promise(e=>B(e))]).then(()=>G.facade),q=8e3,J=1e3,Y=!1,X=class extends Error{constructor(e,t){super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`),this.name=`BrokerUnreachableError`}},Z=class extends Error{constructor(){super(`FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload`),this.name=`OwnChannelUnavailableError`}},Q=(e,t)=>{let n=Y?J:q;return Promise.race([e,new Promise((e,r)=>setTimeout(()=>{Y=!0,r(t(n))},n))])},Ie=e=>z()?Q(G.routable().then(()=>G.facade),t=>U?new Z:new X(e,t)):Q(K,t=>new X(e,t));B(()=>{W.then(()=>{let e=setTimeout(()=>console.error(new Z),q);G.routable().then(()=>clearTimeout(e))})});var $=G.onEpoch,Le=G.current,Re=G.lastCall,ze=G.inFlight;$(e=>{pe()&&e.overlay.setHost(_e,{exactClips:f()}).catch(()=>{})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return $}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { checkOsraMessageKey as e, expose as t } from "osra";
|
|
2
2
|
//#region src/frame-ready.ts
|
|
3
|
-
var
|
|
3
|
+
var n = 1e4, r = 16, i = (e) => {
|
|
4
4
|
let t;
|
|
5
5
|
try {
|
|
6
6
|
t = e.contentWindow;
|
|
@@ -14,43 +14,43 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
14
14
|
} catch {
|
|
15
15
|
return !0;
|
|
16
16
|
}
|
|
17
|
-
},
|
|
18
|
-
if (
|
|
17
|
+
}, a = (e, t = n) => new Promise((n) => {
|
|
18
|
+
if (i(e)) return n();
|
|
19
19
|
let a = () => {
|
|
20
|
-
clearInterval(o), clearTimeout(s), e.removeEventListener("load", a),
|
|
20
|
+
clearInterval(o), clearTimeout(s), e.removeEventListener("load", a), n();
|
|
21
21
|
}, o = setInterval(() => {
|
|
22
|
-
|
|
23
|
-
},
|
|
22
|
+
i(e) && a();
|
|
23
|
+
}, r), s = setTimeout(a, t);
|
|
24
24
|
e.addEventListener("load", a);
|
|
25
|
-
}),
|
|
25
|
+
}), o = 32, s = 8, c = 120, l = typeof CSS < "u" && CSS.supports("clip-path", "path('M0 0H1V1H0Z')"), u = typeof CSS < "u" && CSS.supports("clip-path", "polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)"), d = (e) => {
|
|
26
26
|
let t = e.style;
|
|
27
27
|
t.setProperty("display", "block", "important"), t.setProperty("position", "fixed", "important"), t.setProperty("top", "0", "important"), t.setProperty("left", "0", "important"), t.setProperty("width", "100%", "important"), t.setProperty("height", "100%", "important"), t.setProperty("border", "none", "important"), t.setProperty("padding", "0", "important"), t.setProperty("box-sizing", "border-box", "important"), t.setProperty("clip-path", "inset(100%)", "important"), t.setProperty("background", "transparent"), t.setProperty("color-scheme", "normal"), t.setProperty("z-index", "2147483647"), e.setAttribute("title", "FKN");
|
|
28
|
-
},
|
|
28
|
+
}, f = ({ x: e, y: t, width: n, height: r, radius: i }) => {
|
|
29
29
|
if (!i) return `M${e} ${t}h${n}v${r}h${-n}Z`;
|
|
30
30
|
let a = Math.min(n, r) / 2, [o, s, c, l] = i.map((e) => Math.max(0, Math.min(e, a)));
|
|
31
31
|
return `M${e + o} ${t}h${n - o - s}a${s} ${s} 0 0 1 ${s} ${s}v${r - s - c}a${c} ${c} 0 0 1 ${-c} ${c}h${-(n - c - l)}a${l} ${l} 0 0 1 ${-l} ${-l}v${-(r - l - o)}a${o} ${o} 0 0 1 ${o} ${-o}Z`;
|
|
32
|
-
},
|
|
32
|
+
}, p = () => l && u, m = ({ x: e, y: t, width: n, height: r }) => [
|
|
33
33
|
[e, t],
|
|
34
34
|
[e + n, t],
|
|
35
35
|
[e + n, t + r],
|
|
36
36
|
[e, t + r],
|
|
37
37
|
[e, t]
|
|
38
|
-
],
|
|
38
|
+
], h = (e) => {
|
|
39
39
|
let t = e[0];
|
|
40
40
|
if (!t) return [];
|
|
41
|
-
let n =
|
|
41
|
+
let n = m(t)[0], r = [];
|
|
42
42
|
return e.forEach((t, i) => {
|
|
43
|
-
r.push(...
|
|
43
|
+
r.push(...m(t)), i > 0 && i < e.length - 1 && r.push(n);
|
|
44
44
|
}), r;
|
|
45
|
-
},
|
|
45
|
+
}, g = (e) => `polygon(nonzero, ${h(e).map(([e, t]) => `${e}px ${t}px`).join(", ")})`, ee = ({ x: e, y: t, width: n, height: r, radius: i }, a) => {
|
|
46
46
|
let o = `${t}px ${a.width - e - n}px ${a.height - t - r}px ${e}px`;
|
|
47
47
|
return i ? `inset(${o} round ${i.map((e) => `${e}px`).join(" ")})` : `inset(${o})`;
|
|
48
|
-
},
|
|
48
|
+
}, te = (e, t, n) => {
|
|
49
49
|
if (t) return "none";
|
|
50
50
|
if (e.length === 0) return "inset(100%)";
|
|
51
51
|
let r = e.length === 1 ? e[0] : void 0;
|
|
52
|
-
return r ?
|
|
53
|
-
},
|
|
52
|
+
return r ? ee(r, n) : u && e.length <= 5 && !e.some((e) => e.radius) ? g(e) : `path('${e.map(f).join("")}')`;
|
|
53
|
+
}, ne = (e) => {
|
|
54
54
|
if (e.length < 2) return null;
|
|
55
55
|
let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y));
|
|
56
56
|
return {
|
|
@@ -59,51 +59,51 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
59
59
|
width: Math.max(...e.map((e) => e.x + e.width)) - t,
|
|
60
60
|
height: Math.max(...e.map((e) => e.y + e.height)) - n
|
|
61
61
|
};
|
|
62
|
-
},
|
|
62
|
+
}, re = (e, t, n) => t >= e.x && t < e.x + e.width && n >= e.y && n < e.y + e.height, ie = 16, _ = (e, t, n) => t === 1 ? e * ie : t === 2 ? e * n : e, ae = (e, t, n) => {
|
|
63
63
|
let r = getComputedStyle(e);
|
|
64
64
|
return n !== 0 && /auto|scroll/.test(r.overflowY) && e.scrollHeight > e.clientHeight ? !0 : t !== 0 && /auto|scroll/.test(r.overflowX) && e.scrollWidth > e.clientWidth;
|
|
65
|
-
},
|
|
66
|
-
for (let r = e; r; r = r.parentElement) if (
|
|
65
|
+
}, oe = (e, t, n) => {
|
|
66
|
+
for (let r = e; r; r = r.parentElement) if (ae(r, t, n)) return r;
|
|
67
67
|
return document.scrollingElement;
|
|
68
|
-
},
|
|
68
|
+
}, v = null, y = null, b = (e) => ({
|
|
69
69
|
width: e.offsetWidth || window.innerWidth,
|
|
70
70
|
height: e.offsetHeight || window.innerHeight
|
|
71
|
-
}),
|
|
72
|
-
if (!
|
|
71
|
+
}), x = (e) => {
|
|
72
|
+
if (!y || !v || !re(y, e.clientX, e.clientY)) return;
|
|
73
73
|
let t = document.elementFromPoint(e.clientX, e.clientY);
|
|
74
|
-
if (!t || t ===
|
|
75
|
-
let n =
|
|
74
|
+
if (!t || t === v) return;
|
|
75
|
+
let n = _(e.deltaX, e.deltaMode, window.innerWidth), r = _(e.deltaY, e.deltaMode, window.innerHeight), i = oe(t, n, r);
|
|
76
76
|
i && (i.scrollBy({
|
|
77
77
|
left: n,
|
|
78
78
|
top: r,
|
|
79
79
|
behavior: "instant"
|
|
80
80
|
}), e.cancelable && e.preventDefault());
|
|
81
|
-
},
|
|
82
|
-
let t =
|
|
83
|
-
|
|
81
|
+
}, se = (e) => {
|
|
82
|
+
let t = y !== null;
|
|
83
|
+
y = e, t !== (e !== null) && (e ? window.addEventListener("wheel", x, {
|
|
84
84
|
capture: !0,
|
|
85
85
|
passive: !1
|
|
86
|
-
}) : window.removeEventListener("wheel",
|
|
87
|
-
},
|
|
88
|
-
if (e ===
|
|
89
|
-
|
|
86
|
+
}) : window.removeEventListener("wheel", x, { capture: !0 }));
|
|
87
|
+
}, S = 0, ce = (e) => {
|
|
88
|
+
if (e === S) return;
|
|
89
|
+
S = e;
|
|
90
90
|
let t = document.documentElement.style;
|
|
91
91
|
e > 0 ? (t.setProperty("margin-top", `${e}px`, "important"), t.setProperty("--fkn-inset-top", `${e}px`)) : (t.removeProperty("margin-top"), t.removeProperty("--fkn-inset-top"));
|
|
92
|
-
},
|
|
93
|
-
if (
|
|
92
|
+
}, C = (e, { modal: t, rects: n, inset: r }, i) => {
|
|
93
|
+
if (ce(r), !l) {
|
|
94
94
|
let r = t || n.length > 0;
|
|
95
95
|
e.style.setProperty("pointer-events", r ? "auto" : "none", "important"), e.style.setProperty("visibility", r ? "visible" : "hidden", "important");
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
|
-
let a =
|
|
99
|
-
e.style.setProperty("clip-path", o, "important"),
|
|
100
|
-
},
|
|
98
|
+
let a = te(n, t, i), o = a === "none" || CSS.supports("clip-path", a) ? a : "inset(100%)";
|
|
99
|
+
e.style.setProperty("clip-path", o, "important"), se(t || o !== a ? null : ne(n));
|
|
100
|
+
}, le = (e) => {
|
|
101
101
|
if (typeof e != "object" || !e) return 0;
|
|
102
102
|
let { top: t } = e;
|
|
103
|
-
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t),
|
|
104
|
-
},
|
|
103
|
+
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t), c);
|
|
104
|
+
}, ue = (e) => {
|
|
105
105
|
if (Array.isArray(e) && e.length === 4 && e.every((e) => typeof e == "number" && Number.isFinite(e) && e >= 0)) return e.some((e) => e > 0) ? e : void 0;
|
|
106
|
-
},
|
|
106
|
+
}, de = (e, t) => {
|
|
107
107
|
if (typeof e != "object" || !e) return null;
|
|
108
108
|
let { x: n, y: r, width: i, height: a } = e;
|
|
109
109
|
if (![
|
|
@@ -112,7 +112,7 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
112
112
|
i,
|
|
113
113
|
a
|
|
114
114
|
].every((e) => typeof e == "number" && Number.isFinite(e))) return null;
|
|
115
|
-
let o = t.width, s = t.height, c = Math.max(0, Math.min(Math.round(n), o)), l = Math.max(0, Math.min(Math.round(r), s)), u = Math.max(c, Math.min(Math.round(n + i), o)), d = Math.max(l, Math.min(Math.round(r + a), s)), f =
|
|
115
|
+
let o = t.width, s = t.height, c = Math.max(0, Math.min(Math.round(n), o)), l = Math.max(0, Math.min(Math.round(r), s)), u = Math.max(c, Math.min(Math.round(n + i), o)), d = Math.max(l, Math.min(Math.round(r + a), s)), f = ue(e.radius);
|
|
116
116
|
return {
|
|
117
117
|
x: c,
|
|
118
118
|
y: l,
|
|
@@ -120,70 +120,48 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
120
120
|
height: d - l,
|
|
121
121
|
...f ? { radius: f } : {}
|
|
122
122
|
};
|
|
123
|
-
},
|
|
123
|
+
}, w = {
|
|
124
124
|
"not-rendered": "this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout",
|
|
125
125
|
clipped: "it is clipped away or positioned outside the viewport",
|
|
126
126
|
"not-shown": "it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter"
|
|
127
|
-
},
|
|
127
|
+
}, fe = (e) => Array.isArray(e) ? e.slice(0, s).flatMap((e) => {
|
|
128
128
|
if (typeof e != "object" || !e) return [];
|
|
129
129
|
let { kind: t, cause: n, level: r } = e;
|
|
130
|
-
return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in
|
|
130
|
+
return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in w) || r !== "full" && r !== "liveness" ? [] : [{
|
|
131
131
|
kind: t,
|
|
132
132
|
cause: n,
|
|
133
133
|
level: r
|
|
134
134
|
}];
|
|
135
|
-
}) : [],
|
|
136
|
-
for (let { kind: t, cause: n, level: r } of e)
|
|
135
|
+
}) : [], T = /* @__PURE__ */ new Set(), pe = (e) => {
|
|
136
|
+
for (let { kind: t, cause: n, level: r } of e) T.has(t) || (T.add(t), console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${w[n]}. Nobody using this page can see or answer it.
|
|
137
137
|
@fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.` + (r === "liveness" ? "\nThis browser reports limited detail, so the cause above is a best guess." : "")));
|
|
138
|
-
},
|
|
138
|
+
}, E = (e, t) => {
|
|
139
139
|
if (typeof e != "object" || !e) return null;
|
|
140
|
-
let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0,
|
|
140
|
+
let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0, o) : []).map((e) => de(e, t)).filter((e) => e !== null && e.width > 0 && e.height > 0);
|
|
141
141
|
return {
|
|
142
142
|
modal: n.modal === !0,
|
|
143
143
|
rects: r,
|
|
144
|
-
hidden:
|
|
145
|
-
inset:
|
|
144
|
+
hidden: fe(n.hidden),
|
|
145
|
+
inset: le(n.inset)
|
|
146
146
|
};
|
|
147
|
-
},
|
|
148
|
-
if (!
|
|
149
|
-
let e =
|
|
150
|
-
t &&
|
|
151
|
-
},
|
|
152
|
-
typeof ResizeObserver < "u" && (
|
|
153
|
-
},
|
|
154
|
-
|
|
147
|
+
}, me = () => v !== null, D = null, O = null, he = () => {
|
|
148
|
+
if (!v || D === null) return;
|
|
149
|
+
let e = b(v), t = E(D, e);
|
|
150
|
+
t && C(v, t, e);
|
|
151
|
+
}, ge = (e) => {
|
|
152
|
+
typeof ResizeObserver < "u" && (O ??= new ResizeObserver(he), O.disconnect(), O.observe(e));
|
|
153
|
+
}, _e = (e) => {
|
|
154
|
+
d(e), C(e, {
|
|
155
155
|
modal: !1,
|
|
156
156
|
rects: [],
|
|
157
157
|
hidden: [],
|
|
158
158
|
inset: 0
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
if (!
|
|
162
|
-
let t =
|
|
163
|
-
n && (
|
|
164
|
-
},
|
|
165
|
-
"fkn.app",
|
|
166
|
-
"fkn.dev",
|
|
167
|
-
"sdbx.app",
|
|
168
|
-
"fkn.cloudflareaccess.com",
|
|
169
|
-
"horionsoftware.com",
|
|
170
|
-
"62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com",
|
|
171
|
-
"web-b3z.pages.dev",
|
|
172
|
-
"fkn-console.pages.dev",
|
|
173
|
-
"dev-dms.pages.dev",
|
|
174
|
-
"fkn-www.pages.dev",
|
|
175
|
-
"fkn-homepage.pages.dev",
|
|
176
|
-
"fkn-sandbox.pages.dev",
|
|
177
|
-
"internal-3ar.pages.dev",
|
|
178
|
-
"stub-ben.pages.dev",
|
|
179
|
-
"ripple-3t3.pages.dev",
|
|
180
|
-
"media-player-e3s.pages.dev",
|
|
181
|
-
"youtube-3c4.pages.dev",
|
|
182
|
-
"horionsoftware.pages.dev",
|
|
183
|
-
"container-ckf.pages.dev",
|
|
184
|
-
"stub-plugin.pages.dev",
|
|
185
|
-
"stub.plugins.banou.dev"
|
|
186
|
-
], ve = (e) => e.replace(/\.+$/, ""), ye = ["79.127.204.69", "152.233.49.59"], A = (e) => {
|
|
159
|
+
}, b(e)), v = e, ge(e);
|
|
160
|
+
}, ve = (e) => {
|
|
161
|
+
if (!v) return;
|
|
162
|
+
let t = b(v), n = E(e, t);
|
|
163
|
+
n && (D = e, C(v, n, t), pe(n.hidden));
|
|
164
|
+
}, ye = /* @__PURE__ */ "fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,plugins.banou.dev".split(","), k = (e) => e.toLowerCase().replace(/\.+$/, ""), be = ["79.127.204.69", "152.233.49.59"], xe = (e) => {
|
|
187
165
|
let t;
|
|
188
166
|
try {
|
|
189
167
|
t = new URL(`http://${e.includes(":") && !e.startsWith("[") ? `[${e}]` : e}/`).hostname;
|
|
@@ -201,28 +179,30 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
201
179
|
].join(".");
|
|
202
180
|
}
|
|
203
181
|
return /^\d+\.\d+\.\d+\.\d+$/.test(t) ? t : void 0;
|
|
204
|
-
},
|
|
205
|
-
let t =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
182
|
+
}, Se = (e) => {
|
|
183
|
+
let t = k(e);
|
|
184
|
+
return ye.some((e) => t === e || t.endsWith(`.${e}`));
|
|
185
|
+
}, Ce = (e) => {
|
|
186
|
+
if (Se(e)) return !0;
|
|
187
|
+
let t = xe(k(e));
|
|
188
|
+
return t !== void 0 && be.includes(t);
|
|
189
|
+
}, we = (e) => {
|
|
210
190
|
let t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, n;
|
|
211
191
|
try {
|
|
212
192
|
n = new URL(t);
|
|
213
193
|
} catch {
|
|
214
194
|
return;
|
|
215
195
|
}
|
|
216
|
-
if (
|
|
217
|
-
},
|
|
196
|
+
if (Ce(n.hostname)) throw Error(`fetch refuses FKN platform domains (${n.hostname})`);
|
|
197
|
+
}, Te = /* @__PURE__ */ "autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network".split("."), Ee = () => {
|
|
218
198
|
try {
|
|
219
199
|
let e = globalThis.document?.featurePolicy?.features?.();
|
|
220
200
|
return e === void 0 ? void 0 : new Set(e);
|
|
221
201
|
} catch {
|
|
222
202
|
return;
|
|
223
203
|
}
|
|
224
|
-
},
|
|
225
|
-
if (!
|
|
204
|
+
}, A = (e = !0, t = Ee()) => [...Te, ...e ? ["cross-origin-isolated"] : []].filter((e) => t === void 0 || t.has(e)).join("; "), j = "https://fkn.app", M = typeof globalThis < "u" && globalThis.document ? globalThis.document : void 0, N = typeof globalThis < "u" && globalThis.crossOriginIsolated === !0, P = `${j}/api${N ? "?coi=1" : ""}`, F = "fkn-api-port", De = "fkn-api-port-ack", Oe = 2e3, ke = () => {
|
|
205
|
+
if (!M || typeof window > "u" || window.parent === window) return Promise.resolve(void 0);
|
|
226
206
|
let e;
|
|
227
207
|
try {
|
|
228
208
|
e = window.parent;
|
|
@@ -237,40 +217,40 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
237
217
|
} catch {}
|
|
238
218
|
n(e);
|
|
239
219
|
}, i = (e) => {
|
|
240
|
-
e.data?.type ===
|
|
241
|
-
}, a = setTimeout(() => r(void 0),
|
|
220
|
+
e.data?.type === De && r(t.port1);
|
|
221
|
+
}, a = setTimeout(() => r(void 0), Oe);
|
|
242
222
|
t.port1.addEventListener("message", i), t.port1.start();
|
|
243
223
|
try {
|
|
244
|
-
e.postMessage({ type:
|
|
224
|
+
e.postMessage({ type: F }, j, [t.port2]);
|
|
245
225
|
} catch {
|
|
246
226
|
r(void 0);
|
|
247
227
|
}
|
|
248
228
|
});
|
|
249
|
-
},
|
|
250
|
-
if (
|
|
251
|
-
let e =
|
|
252
|
-
if (e)
|
|
229
|
+
}, I, Ae = () => {
|
|
230
|
+
if (I || !M) return I;
|
|
231
|
+
let e = M.querySelector(`iframe[src="${P}"]`);
|
|
232
|
+
if (e) I = e;
|
|
253
233
|
else {
|
|
254
|
-
let e =
|
|
255
|
-
e.setAttribute("allow",
|
|
234
|
+
let e = M.createElement("iframe");
|
|
235
|
+
e.setAttribute("allow", A(N)), e.src = P, M.body.appendChild(e), I = e;
|
|
256
236
|
}
|
|
257
|
-
return
|
|
258
|
-
},
|
|
259
|
-
if (!
|
|
260
|
-
let e = await
|
|
237
|
+
return _e(I), I;
|
|
238
|
+
}, L = (async () => {
|
|
239
|
+
if (!M) return;
|
|
240
|
+
let e = await ke();
|
|
261
241
|
if (e) return {
|
|
262
242
|
receive: e,
|
|
263
243
|
emit: e
|
|
264
244
|
};
|
|
265
|
-
let t =
|
|
245
|
+
let t = Ae();
|
|
266
246
|
if (!t) return;
|
|
267
|
-
await
|
|
247
|
+
await a(t);
|
|
268
248
|
let n = t.contentWindow;
|
|
269
249
|
return n ? {
|
|
270
250
|
receive: window,
|
|
271
251
|
emit: n
|
|
272
252
|
} : void 0;
|
|
273
|
-
})(),
|
|
253
|
+
})(), je = (e, { boundRetired: t = (e) => e } = {}) => {
|
|
274
254
|
let n, r = 0, i = !1, a = () => {}, o = () => new Promise((e) => {
|
|
275
255
|
a = e;
|
|
276
256
|
}), s = o(), c = s, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = 0, f = 0, p = () => {
|
|
@@ -346,47 +326,53 @@ var t = 1e4, n = 16, r = (e) => {
|
|
|
346
326
|
i = !0, n = void 0, p();
|
|
347
327
|
}
|
|
348
328
|
};
|
|
349
|
-
},
|
|
350
|
-
if (!
|
|
351
|
-
|
|
352
|
-
for (let e of [...
|
|
329
|
+
}, R = !1, z = /* @__PURE__ */ new Set(), B = () => R, Me = () => {
|
|
330
|
+
if (!R) {
|
|
331
|
+
R = !0;
|
|
332
|
+
for (let e of [...z]) try {
|
|
353
333
|
e();
|
|
354
334
|
} catch {}
|
|
355
|
-
|
|
335
|
+
z.clear();
|
|
356
336
|
}
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
},
|
|
360
|
-
if (typeof window < "u") return
|
|
337
|
+
}, V = (e) => {
|
|
338
|
+
R ? e() : z.add(e);
|
|
339
|
+
}, Ne = typeof window < "u" || typeof self < "u", H = async () => {
|
|
340
|
+
if (typeof window < "u") return L;
|
|
361
341
|
if (typeof self < "u") return {
|
|
362
342
|
receive: self,
|
|
363
343
|
emit: self
|
|
364
344
|
};
|
|
365
|
-
},
|
|
366
|
-
let
|
|
367
|
-
if (!
|
|
345
|
+
}, U = "fkn-api", Pe = "fkn-api-window", Fe = { async *[Symbol.asyncIterator]() {
|
|
346
|
+
let e = await H();
|
|
347
|
+
if (!e) {
|
|
368
348
|
await new Promise(() => {});
|
|
369
349
|
return;
|
|
370
350
|
}
|
|
371
|
-
if (!
|
|
351
|
+
if (!B()) {
|
|
372
352
|
let n = new AbortController();
|
|
373
|
-
|
|
374
|
-
for await (let r of
|
|
375
|
-
key:
|
|
376
|
-
transport:
|
|
353
|
+
V(() => n.abort());
|
|
354
|
+
for await (let r of t({}, {
|
|
355
|
+
key: U,
|
|
356
|
+
transport: e,
|
|
377
357
|
unregisterSignal: n.signal
|
|
378
358
|
})) {
|
|
379
359
|
if (n.signal.aborted) break;
|
|
380
360
|
yield r;
|
|
381
361
|
}
|
|
382
362
|
}
|
|
383
|
-
yield*
|
|
384
|
-
key:
|
|
385
|
-
transport:
|
|
363
|
+
yield* t({}, {
|
|
364
|
+
key: Pe,
|
|
365
|
+
transport: e
|
|
386
366
|
});
|
|
387
|
-
} },
|
|
388
|
-
|
|
389
|
-
|
|
367
|
+
} }, W = !1, G = H().then((t) => new Promise((n) => {
|
|
368
|
+
if (!t) return;
|
|
369
|
+
let { receive: r } = t, i = (t) => {
|
|
370
|
+
e(t.data, U) && (r.removeEventListener("message", i), W = !0, n());
|
|
371
|
+
};
|
|
372
|
+
r.addEventListener("message", i);
|
|
373
|
+
})), K = je(Fe, { boundRetired: (e) => Promise.race([e, G.then(() => Q(e, () => new Z()))]) });
|
|
374
|
+
V(() => K.retire());
|
|
375
|
+
var q = Promise.race([K.first, new Promise((e) => V(e))]).then(() => K.facade), J = 8e3, Ie = 1e3, Y = !1, X = class extends Error {
|
|
390
376
|
constructor(e, t) {
|
|
391
377
|
super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`), this.name = "BrokerUnreachableError";
|
|
392
378
|
}
|
|
@@ -395,18 +381,20 @@ var q = Promise.race([K.first, new Promise((e) => G(e))]).then(() => K.facade),
|
|
|
395
381
|
super("FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload"), this.name = "OwnChannelUnavailableError";
|
|
396
382
|
}
|
|
397
383
|
}, Q = (e, t) => {
|
|
398
|
-
let n = Y ?
|
|
384
|
+
let n = Y ? Ie : J;
|
|
399
385
|
return Promise.race([e, new Promise((e, r) => setTimeout(() => {
|
|
400
386
|
Y = !0, r(t(n));
|
|
401
387
|
}, n))]);
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
388
|
+
}, Le = (e) => B() ? Q(K.routable().then(() => K.facade), (t) => W ? new Z() : new X(e, t)) : Q(q, (t) => new X(e, t));
|
|
389
|
+
V(() => {
|
|
390
|
+
G.then(() => {
|
|
391
|
+
let e = setTimeout(() => console.error(new Z()), J);
|
|
392
|
+
K.routable().then(() => clearTimeout(e));
|
|
393
|
+
});
|
|
406
394
|
});
|
|
407
|
-
var $ = K.onEpoch,
|
|
395
|
+
var $ = K.onEpoch, Re = K.current, ze = K.lastCall, Be = K.inFlight;
|
|
408
396
|
$((e) => {
|
|
409
|
-
|
|
397
|
+
me() && e.overlay.setHost(ve, { exactClips: p() }).catch(() => {});
|
|
410
398
|
});
|
|
411
399
|
//#endregion
|
|
412
|
-
export {
|
|
400
|
+
export { ze as a, Re as c, Me as d, L as f, Be as i, Ne as l, A as m, X as n, q as o, we as p, Z as r, Le as s, J as t, $ as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as IpFamily, Ft as UdpDatagram, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, N as OverlayState, Nt as TcpSocketOptions, P as PackageQuery, Q as RoomEvent, R as PickOptions, T as InstallOptions, Tt as StoragePutWire, V as ProxyFetchInit, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, c as AdoptRequest, d as ConflictRequest, et as RoomJoinOptions, it as RoomOpenOptions, jt as TcpSocketListenerOptions, l as AdoptState, m as ConnectOptions, o as AccountPinOptions, p as ConnectAvailability, st as RoomsErrorCode, tt as RoomMailbox, u as ConflictChoice, x as FrameConsentRequest, xt as StorageErrorCode, z as Placement } from "./contract-
|
|
1
|
+
import { D as IpFamily, Ft as UdpDatagram, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, N as OverlayState, Nt as TcpSocketOptions, P as PackageQuery, Q as RoomEvent, R as PickOptions, T as InstallOptions, Tt as StoragePutWire, V as ProxyFetchInit, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, c as AdoptRequest, d as ConflictRequest, et as RoomJoinOptions, it as RoomOpenOptions, jt as TcpSocketListenerOptions, l as AdoptState, m as ConnectOptions, o as AccountPinOptions, p as ConnectAvailability, st as RoomsErrorCode, tt as RoomMailbox, u as ConflictChoice, x as FrameConsentRequest, xt as StorageErrorCode, z as Placement } from "./contract-BN0cD-Oq.js";
|
|
2
2
|
import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
|
|
3
3
|
import { Remote } from "osra";
|
|
4
4
|
//#region src/api-epochs.d.ts
|
|
@@ -15,8 +15,8 @@ type Api = Remote<Resolvers>;
|
|
|
15
15
|
* A window realm that relays its channel to a worker (`relayWorker`) moves its own calls to a channel
|
|
16
16
|
* of their own, never back to the relayed one. There it also settles once the realm relays, a call in
|
|
17
17
|
* flight on the relayed channel then rejects as on a replacement, and a call waits for the realm's own
|
|
18
|
-
* channel
|
|
19
|
-
*
|
|
18
|
+
* channel, rejecting with `OwnChannelUnavailableError` when the broker answers on the relayed channel
|
|
19
|
+
* and not there within the deadline below.
|
|
20
20
|
*/
|
|
21
21
|
declare const apiPromise: Promise<Api>;
|
|
22
22
|
/**
|
|
@@ -35,19 +35,20 @@ declare class BrokerUnreachableError extends Error {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* A page's own call, refused because the page relays its FKN channel to a worker (`relayWorker`) and
|
|
38
|
-
* the broker
|
|
39
|
-
* before that channel, as fkn.app's service worker can still serve
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* the broker, once it answered on the relayed channel, did not answer on the page's own within the
|
|
39
|
+
* deadline: a broker document from before that channel, as fkn.app's service worker can still serve
|
|
40
|
+
* from its cache. A broker that has not answered at all is waited for, never refused with this. The
|
|
41
|
+
* page's own calls never fall back to the relayed channel, so this is the answer until a reload
|
|
42
|
+
* reaches a newer broker. The relayed worker's calls are unaffected.
|
|
42
43
|
*
|
|
43
44
|
* What the page registered on the relayed channel went with it: FKN's UI over this page is no longer
|
|
44
45
|
* placed and account changes are no longer heard. So the realm also logs this error once with
|
|
45
|
-
* `console.error` when
|
|
46
|
+
* `console.error` when that deadline passes, whether or not the page calls.
|
|
46
47
|
*/
|
|
47
48
|
declare class OwnChannelUnavailableError extends Error {
|
|
48
49
|
constructor();
|
|
49
50
|
}
|
|
50
|
-
/** In a realm that relays, this waits for the realm's own channel
|
|
51
|
+
/** In a realm that relays, this waits for the realm's own channel, refusing with `OwnChannelUnavailableError` once the broker has answered on the relayed one. */
|
|
51
52
|
declare const apiWithin: (what: string) => Promise<Api>;
|
|
52
53
|
/**
|
|
53
54
|
* Runs for the current broker connection on subscribe (if one exists) and for every later one.
|
package/api.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-6wTec7WK.cjs");exports.API_DEADLINE_MS=e.t,exports.BrokerUnreachableError=e.n,exports.OwnChannelUnavailableError=e.r,exports.apiInFlight=e.i,exports.apiLastCall=e.a,exports.apiPromise=e.o,exports.apiWithin=e.s,exports.currentApiEpoch=e.c,exports.hasTransport=e.l,exports.onApiEpoch=e.u;
|
package/api.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { K as Resolvers } from "./contract-
|
|
2
|
-
import { a as apiLastCall, c as currentApiEpoch, i as apiInFlight, l as hasTransport, n as BrokerUnreachableError, o as apiPromise, r as OwnChannelUnavailableError, s as apiWithin, t as API_DEADLINE_MS, u as onApiEpoch } from "./api-
|
|
1
|
+
import { K as Resolvers } from "./contract-BN0cD-Oq.js";
|
|
2
|
+
import { a as apiLastCall, c as currentApiEpoch, i as apiInFlight, l as hasTransport, n as BrokerUnreachableError, o as apiPromise, r as OwnChannelUnavailableError, s as apiWithin, t as API_DEADLINE_MS, u as onApiEpoch } from "./api-mHRuM_Sd.js";
|
|
3
3
|
export { API_DEADLINE_MS, BrokerUnreachableError, OwnChannelUnavailableError, type Resolvers, apiInFlight, apiLastCall, apiPromise, apiWithin, currentApiEpoch, hasTransport, onApiEpoch };
|