1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lbryinc-DPHS-q40.js","assets/rolldown-runtime-Czos8NxU.js","assets/asserts-Doeoh-uG.js","assets/claims-FR-UlCrs.js","assets/vendor-state~index~index~publish-v4~publish~index~nag-sunset~nag-no-user~nag-degraded-perfo~d8u5zn05-CDGblvVh.js","assets/icons-WQbxlx7M.js","assets/i18n-BTiDkSlz.js","assets/vendor-react~index~index~publish-v4~publish~index~nag-sunset~nag-no-user~nag-degraded-perfo~ef2jpwjt-DLne3g0l.js","assets/settings-Ckg8R9W3.js","assets/storage-C9vZc6x6.js","assets/time-C23D0mgw.js","assets/src-Dr1ZI6FQ.js","assets/vendor-state~index~index~index~index~index~index~index~index~index~index~index~index~index~~459ng6im-CibXGxq9.js","assets/src-CXAoazOq.js","assets/publish-v4-tasks-8zUK5ZTC.js","assets/publish-v4-tasks-CHyfbNoJ.js","assets/token-DENHBYpt.js","assets/publish-v4-B0_xRv25.js","assets/uploadCache-DwKdMhmg.js","assets/uploadCache-rAMO9qMZ.js","assets/localforage-BpmEEj9j.js","assets/localforage-DTdri6MG.js"])))=>i.map(i=>d[i]); 2import{t as e}from"./vendor-react~index~index~publish-v4~publish~index~nag-sunset~nag-no-user~nag-degraded-perfo~ef2jpwjt-DLne3g0l.js";import{n as t,r as n,s as r,t as i}from"./rolldown-runtime-Czos8NxU.js";import{n as a,t as o}from"./vendor-state~index~index~publish-v4~publish~index~nag-sunset~nag-no-user~nag-degraded-perfo~d8u5zn05-CDGblvVh.js";import{$ as s,A as c,B as l,E as u,F as d,G as f,H as p,I as m,L as h,M as g,N as _,O as v,P as y,R as b,U as x,V as S,Y as C,Z as ee,_ as w,c as te,d as ne,et as re,g as ie,h as ae,k as T,l as oe,lt as se,r as ce,rt as le,s as ue,st as E,t as D,tt as de,u as fe,v as pe,w as me,x as he}from"./i18n-BTiDkSlz.js";import{B as ge,C as _e,D as ve,E as ye,F as be,G as xe,I as Se,J as Ce,K as we,L as Te,O as Ee,P as De,R as Oe,S as ke,T as Ae,U as je,W as Me,b as Ne,ft as Pe,ht as Fe,l as Ie,mt as Le,pt as Re,q as ze,rt as Be,t as Ve,tt as He,w as Ue,x as We,y as Ge}from"./asserts-Doeoh-uG.js";import{t as Ke}from"./v4-B7dvJZog.js";import{f as qe}from"./vendor-react~index~nag-sunset~nag-no-user~nag-degraded-performance~index~index~index~index~~k5vco7za-D-CsX_iN.js";import{$ as Je,$r as Ye,A as Xe,Aa as Ze,Ao as Qe,At as $e,B as et,Bn as tt,Br as nt,Bt as rt,Ca as it,Cr as at,Do as ot,Ds as st,E as ct,Ea as lt,Eo as ut,Et as dt,F as ft,Fn as pt,Fo as mt,Ft as ht,Gi as gt,Gn as _t,Gt as vt,H as yt,Ha as bt,Hn as xt,Hr as St,I as Ct,Ii as wt,Io as Tt,It as Et,J as Dt,Ja as Ot,Ji as kt,Jr as At,Kr as jt,Kt as Mt,L as Nt,Ln as Pt,Lo as Ft,Ls as It,M as Lt,Ma as Rt,No as zt,O as Bt,Oa as Vt,Or as Ht,P as Ut,Pi as Wt,Po as Gt,Pt as Kt,Q as qt,Qa as Jt,R as Yt,Ri as Xt,Rr as Zt,Rt as Qt,S as $t,Sn as en,So as tn,Sr as nn,Ti as rn,To as an,Tt as on,U as sn,Ua as cn,Un as ln,V as un,Va as dn,Vn as fn,Vs as pn,Vt as mn,Wn as hn,Wr as gn,Wt as _n,X as vn,Xn as yn,Xr as bn,Y as xn,Ya as Sn,Zn as Cn,_c as wn,_i as Tn,_o as En,_r as Dn,a as On,aa as kn,an as An,ar as jn,bn as Mn,br as Nn,bt as Pn,cc as Fn,cn as In,co as Ln,di as Rn,dn as zn,f as Bn,fi as Vn,fn as Hn,g as Un,gn as Wn,gr as Gn,hn as Kn,ho as qn,hr as Jn,ht as Yn,ia as Xn,ii as Zn,in as Qn,j as $n,ja as er,jo as tr,jt as nr,ko as rr,kt as ir,l as ar,lc as or,mi as sr,mo as cr,n as lr,na as ur,or as dr,ot as fr,pi as pr,pn as mr,pr as hr,qn as gr,qr as _r,qt as vr,r as yr,ra as br,rn as xr,rr as Sr,rt as Cr,sn as wr,ta as Tr,to as Er,uc as Dr,un as Or,uo as kr,ur as Ar,ut as jr,v as Mr,vr as Nr,vt as Pr,wr as Fr,wt as Ir,xa as Lr,xn as Rr,xr as zr,y as Br,yi as Vr,yn as Hr,yr as Ur,z as Wr,zn as Gr,zo as Kr}from"./claims-FR-UlCrs.js";import{$ as qr,$a as Jr,$c as Yr,$i as Xr,$l as Zr,$o as Qr,$t as $r,A as ei,Aa as ti,Al as ni,Ao as ri,Ar as ii,As as ai,B as oi,Ba as si,Bc as ci,Bl as li,Ca as ui,Cc as di,Ci as fi,Cl as pi,Cn as mi,Co as hi,Cs as gi,Ct as _i,Cu as vi,D as yi,Da as bi,Di as xi,Dl as Si,Dn as Ci,Do as wi,Ds as Ti,Dt as Ei,Du as Di,E as Oi,Ec as ki,Ei as Ai,El as ji,En as Mi,Eo as Ni,Es as Pi,Et as Fi,Fc as Ii,Fi as Li,Fl as Ri,Fs as zi,Ft as Bi,G as Vi,Ga as Hi,Gc as Ui,Gl as Wi,Go as Gi,Gs as Ki,Gt as qi,H as Ji,Hc as Yi,Hi as Xi,Hl as Zi,Ho as Qi,Ht as $i,I as ea,Ic as ta,Ii as
2na,Il as ra,Is as ia,It as aa,Ja as oa,Jc as sa,Ji as ca,Jl as la,Jo as ua,Js as da,Jt as fa,K as pa,Ka as ma,Kc as ha,Kl as ga,Ks as _a,Kt as va,La as ya,Li as ba,Ll as xa,Ls as Sa,Lt as Ca,Ma as wa,Mc as Ta,Ml as Ea,Mr as Da,Ms as Oa,Mt as ka,Na as Aa,Nc as ja,Nl as Ma,Nr as Na,Ns as Pa,Nt as Fa,O as Ia,Oa as La,Oi as Ra,Ol as za,Oo as Ba,Or as Va,Os as Ha,Ot as Ua,P as Wa,Pc as Ga,Pi as Ka,Pl as qa,Ps as Ja,Pt as Ya,Q as Xa,Qa as Za,Qc as Qa,Qi as $a,Ql as eo,Qo as to,Qr as no,Qt as ro,R as io,Ra as ao,Rc as oo,Rl as so,Rr as co,Rs as lo,Rt as uo,Sa as fo,Sc as po,Si as mo,Sl as ho,Sn as go,So as _o,Ss as vo,St as yo,Su as bo,T as xo,Ta as So,Tc as Co,Ti as wo,Tl as To,Tn as Eo,To as Do,Ts as Oo,Tu as ko,U as Ao,Uc as jo,Ui as Mo,Ul as No,Uo as Po,Ur as Fo,Us as Io,Ut as Lo,V as Ro,Va as zo,Vc as Bo,Vl as Vo,Vr as Ho,Vt as Uo,W as Wo,Wa as Go,Wc as Ko,Wi as qo,Wl as Jo,Wo as Yo,Wr as Xo,Ws as Zo,Xa as Qo,Xi as $o,Xl as es,Xn as ts,Xo as ns,Xt as rs,Ya as is,Yi as as,Yl as os,Yo as ss,Yt as cs,Za as ls,Zc as us,Zl as ds,Zo as fs,Zr as ps,Zt as ms,_a as hs,_c as gs,_i as _s,_l as vs,_n as ys,_t as bs,a as xs,aa as Ss,ac as Cs,ai as ws,al as Ts,an as Es,ao as Ds,as as Os,at as ks,au as As,ba as js,bc as Ms,bi as Ns,bn as Ps,bo as Fs,bt as Is,bu as Ls,ca as Rs,cc as zs,ci as Bs,cl as Vs,cn as Hs,co as Us,cs as Ws,ct as Gs,cu as Ks,dc as qs,di as Js,dn as Ys,do as Xs,ds as Zs,dt as Qs,du as $s,ec,ei as tc,el as nc,en as rc,eo as ic,es as ac,et as oc,eu as sc,fc as cc,fn as lc,fr as uc,fs as dc,ft as fc,fu as pc,g as mc,ga as hc,gc,gi as _c,gn as vc,gs as yc,gt as bc,ha as xc,hc as Sc,hi as Cc,hl as wc,hn as Tc,ho as Ec,hs as Dc,ht as Oc,i as kc,ia as Ac,ic as
2jc,ii as Mc,il as Nc,in as Pc,io as Fc,is as Ic,it as Lc,iu as Rc,j as zc,ja as Bc,jc as Vc,jo as Hc,jr as Uc,js as Wc,jt as Gc,k as Kc,ka as qc,kl as Jc,ko as Yc,kr as Xc,ks as Zc,lc as Qc,li as $c,ll as el,lo as tl,ls as nl,lt as rl,lu as il,ma as al,mi as ol,ml as sl,mn as cl,mo as ll,mt as ul,na as dl,nc as fl,ni as pl,nl as ml,nn as hl,no as gl,nt as _l,nu as vl,oa as yl,oc as bl,oi as xl,ol as Sl,oo as Cl,ot as wl,ou as Tl,pa as El,pc as Dl,pn as Ol,po as kl,ps as Al,pt as jl,pu as Ml,q as Nl,qa as Pl,qi as Fl,ql as Il,qo as Ll,qt as Rl,r as zl,ra as Bl,rc as Vl,ri as Hl,rl as Ul,rn as Wl,ro as Gl,rs as Kl,rt as ql,ru as Jl,s as Yl,sa as Xl,sc as Zl,si as Ql,sn as $l,so as eu,ss as tu,st as nu,su as ru,t as iu,ta as au,tc as ou,ti as su,tl as cu,tn as lu,to as uu,ts as du,tt as fu,uc as pu,ui as mu,ul as hu,un as gu,uo as _u,us as vu,ut as yu,uu as bu,v as xu,va as Su,vi as Cu,vl as wu,vn as Tu,vo as Eu,vt as Du,w as Ou,wa as ku,wi as Au,wl as ju,wn as Mu,wo as Nu,ws as Pu,wu as Fu,xa as Iu,xi as Lu,xn as Ru,xo as zu,xr as Bu,xs as Vu,xt as Hu,xu as Uu,y as Wu,ya as Gu,yi as Ku,yn as qu,yo as Ju,yt as Yu,yu as Xu,z as Zu,za as Qu,zl as $u,zo as ed,zr as td}from"./settings-Ckg8R9W3.js";import{n as nd,t as rd}from"./storage-C9vZc6x6.js";import{n as id,t as ad}from"./token-DENHBYpt.js";import{n as od,o as sd,r as cd}from"./time-C23D0mgw.js";var ld=`confirm`,ud=`confirm_file_remove`,dd=`confirm_external_resource`,fd=`crypto_disclaimers`,pd=`customize_homepage`,md=`featured_channels_edit`,hd=`featured_channels_sort`,gd=`file_timeout`,_d=`file_selection`,vd=`downloading`,yd=`auto_update_downloaded`,bd=`error`,xd=`upgrade`,Sd=`phone_collection`,Cd=`first_reward`,wd=`transaction_failed`,Td=`reward_generated_code`,Ed=`affirm_purchase`,Dd=`confirm_claim_revoke`,Od=`send_tip`,kd=`preorder_and_purchase_content`,Ad=`repost`,jd=`social_share`,Md=`publish`,Nd=`publish_preview`,Pd=`confirm_transaction`,Fd=`confirm_thumbnail_upload`,Id=`confirm_thumbnail_url`,Ld=`wallet_encrypt`,Rd=`wallet_decrypt`,zd=`wallet_unlock`,Bd=`wallet_password_unsave`,Vd=`youtube_welcome`,Hd=`set_referrer`,Ud=`sign_out`,Wd=`liquidate_supports`,Gd=`mass_tip_unlock`,Kd=`confirm_age`,qd=`SYNC_ENABLE`,Jd=`image_upload`,Yd=`mobile_search`,Xd=`view_image`,Zd=`block_channel`,Qd=`min_channel_age`,$d=`collection_add`,ef=`collection_create`,tf=`collection_delete`,nf=`CONFIRM_REMOVE_COMMENT`,rf=`HIDE_RECOMMENDATION`,af=`ANNOUNCEMENTS`,of=`ADD_CARD`,sf=`ACCOUNT_DELETE`,cf=`ARWEAVE_CONNECT`,lf=`MEMBERSHIP_SPLASH`,uf=`JOIN_MEMBERSHIP`,df=`CONFIRM_ODYSEE_MEMBERSHIP`,ff=`ACTIVATE_CREATOR_MEMBERSHIPS`,pf=`COPY_FROM_UPLOAD`,mf=`MANAGE_UPLOAD_TEMPLATES`,hf=n({CLIENT_SYNC_KEYS:()=>_f,SDK_SYNC_KEYS:()=>gf}),gf=[io,Zu],_f=[ae,de,g,_,d,b,T,pe,y,re,p,x,le,oe,fe,ne,se,c,m,h,u,w,te,f,l,S,C,ue,E,ie,he,v],vf=`pending`,yf=`done`,bf=`ready`,xf=`error`,Sf=`filterType`,Cf=`search`,wf=99999,Tf=Object.freeze({ALL:{key:`All`,cmd:`stream,repost`,label:`All`,ariaLabel:`All uploads`},UPLOADS:{key:`Uploads`,cmd:`stream`,label:`Uploads`},REPOSTS:{key:`Reposts`,cmd:`repost`,label:`Reposts`},UNLISTED:{key:`Unlisted`,cmd:``,label:`Unlisted`},SCHEDULED:{key:`Scheduled`,cmd:``,label:`Scheduled`},PAID:{key:`Paid`,cmd:``,label:`Paid`},PAID_LEGACY:{key:`Paid-Legacy`,cmd:``,label:`Paid (Legacy/LBC)`}}),Ef=Object.freeze({ASC:`asc`,DESC:`desc`}),Df=Object.freeze({NAME:`name`,RELEASED_AT:`releasedAt`,UPDATED_AT:`updatedAt`}),Of=Object.freeze({[Df.NAME]:{str:`Name`,orders:{[Ef.ASC]:`A-Z`,[Ef.DESC]:`Z-A`}},[Df.RELEASED_AT]:{str:`Release Time`,orders:{[Ef.ASC]:`Newest First`,[Ef.DESC]:`Oldest First`}},[Df.UPDATED_AT]:{str:`Updated Time`,orders:{[Ef.ASC]:`Newest First`,[Ef.DESC]:`Oldest First`}}}),kf=Object.freeze({CLAIM_LIST:`CLAIM_LIST`,CLAIM_SEARCH:`CLAIM_SEARCH`});Df.UPDATED_AT,Ef.ASC;var Af=`not_transferred`,jf=`pending`,Mf=`pendingemail`,Nf=`pending_transfer`,Pf=`completed_transfer`,Ff=`queued`,If=`syncing`,Lf=`pendingupgrade`,Rf=`abandoned`,zf=`once the invite credit has been claimed the referrer cannot be changed`,Bf=`There was a network error, but the publish may have been completed. Wait a few minutes, then check your Uploads or Wallet page to confirm.`,Vf=`Your action timed out, but may have been completed.`,Hf=`promise timeout`,Uf=`There was a network error, but the publish may have been completed. Wait a few minutes, then check your Uploads or Wallet page to confirm. 3 4If the publish was successful, please verify the member restrictions (e.g. through Incognito), as it might not be applied correctly. If so, please re-upload (Edit) the content.`,O=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Wf=globalThis,Gf=`10.45.0`;function Kf(){return qf(Wf),Wf}function qf(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.45.0`,t[Gf]=t[`10.45.0`]||{}}function Jf(e,t,n=Wf){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[Gf]=r[`10.45.0`]||{};return i[e]||(i[e]=t())}var Yf=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],Xf=`Sentry Logger `,Zf={};function Qf(e){if(!(`console`in Wf))return e();let t=Wf.console,n={},r=Object.keys(Zf);
4r.forEach(e=>{let r=Zf[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function $f(){op().enabled=!0}function ep(){op().enabled=!1}function tp(){return op().enabled}function np(...e){ap(`log`,...e)}function rp(...e){ap(`warn`,...e)}function ip(...e){ap(`error`,...e)}function ap(e,...t){O&&tp()&&Qf(()=>{Wf.console[e](`${Xf}[${e}]:`,...t)})}function op(){return O?Jf(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var k={enable:$f,disable:ep,isEnabled:tp,log:np,warn:rp,error:ip},sp=50,cp=/\(error: (.*)\)/,lp=/captureMessage|captureException/;function up(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(` 5`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=cp.test(n)?n.replace(cp,`$1`):n;if(!o.match(/\S*Error: /)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=sp+r)break}}return fp(i.slice(r))}}function dp(e){return Array.isArray(e)?up(...e):e}function fp(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(pp(t).function||``)&&t.pop(),t.reverse(),lp.test(pp(t).function||``)&&(t.pop(),lp.test(pp(t).function||``)&&t.pop()),t.slice(0,sp).map(e=>({...e,filename:e.filename||pp(t).filename,function:e.function||`?`}))}function pp(e){return e[e.length-1]||{}}var mp=`<anonymous>`;function hp(e){try{return!e||typeof e!=`function`?mp:e.name||mp}catch{return mp}}function gp(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function _p(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var vp={},yp={};function bp(e,t){vp[e]=vp[e]||[],vp[e].push(t)}function xp(e,t){if(!yp[e]){yp[e]=!0;try{t()}catch(t){O&&k.error(`Error while instrumenting ${e}`,t)}}}function Sp(e,t){let n=e&&vp[e];if(n)for(let r of n)try{r(t)}catch(t){O&&k.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${hp(r)}\nError:`,t)}}var Cp=null;function wp(e){let t=`error`;bp(t,e),xp(t,Tp)}function Tp(){Cp=Wf.onerror,Wf.onerror=function(e,t,n,r,i){return Sp(`error`,{column:r,error:i,line:n,msg:e,url:t}),Cp?Cp.apply(this,arguments):!1},Wf.onerror.__SENTRY_INSTRUMENTED__=!0}var Ep=null;function Dp(e){let t=`unhandledrejection`;bp(t,e),xp(t,Op)}function Op(){Ep=Wf.onunhandledrejection,Wf.onunhandledrejection=function(e){return Sp(`unhandledrejection`,e),Ep?Ep.apply(this,arguments):!0},Wf.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var kp=Object.prototype.toString;function Ap(e){switch(kp.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return Wp(e,Error)}}function jp(e,t){return kp.call(e)===`[object ${t}]`}function Mp(e){return jp(e,`ErrorEvent`)}function Np(e){return jp(e,`DOMError`)}function Pp(e){return jp(e,`DOMException`)}function Fp(e){return jp(e,`String`)}function Ip(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function Lp(e){return e===null||Ip(e)||typeof e!=`object`&&typeof e!=`function`}function Rp(e){return jp(e,`Object`)}function zp(e){return typeof Event<`u`&&Wp(e,Event)}function Bp(e){return typeof Element<`u`&&Wp(e,Element)}function Vp(e){return jp(e,`RegExp`)}function Hp(e){return!!(e?.then&&typeof e.then==`function`)}function Up(e){return Rp(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function Wp(e,t){try{return e instanceof t}catch{return!1}}function Gp(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function Kp(e){return typeof Request<`u`&&Wp(e,Request)}var qp=Wf,Jp=80;function Yp(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Jp;for(;n&&i++<5&&(o=Xp(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function Xp(e,t){let n=e,r=[];if(!n?.tagName)return``;if(qp.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;
5if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&Fp(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function Zp(){try{return qp.document.location.href}catch{return``}}function Qp(e){if(!qp.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function $p(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&tm(i,r);try{e[t]=i}catch{O&&k.log(`Failed to replace method "${t}" in object`,e)}}function em(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{O&&k.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function tm(e,t){try{e.prototype=t.prototype=t.prototype||{},em(e,`__sentry_original__`,t)}catch{}}function nm(e){return e.__sentry_original__}function rm(e){if(Ap(e))return{message:e.message,name:e.name,stack:e.stack,...am(e)};if(zp(e)){let t={type:e.type,target:im(e.target),currentTarget:im(e.currentTarget),...am(e)};return typeof CustomEvent<`u`&&Wp(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function im(e){try{return Bp(e)?Yp(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function am(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function om(e){let t=Object.keys(rm(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var sm;function cm(e){if(sm!==void 0)return sm?sm(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=Wf;return t in n&&typeof n[t]==`function`?(sm=n[t],sm(e)):(sm=null,e())}function lm(){return cm(()=>Math.random())}function um(){return cm(()=>Date.now())}function dm(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function fm(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Gp(r)?n.push(_p(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function pm(e,t,n=!1){return Fp(e)?Vp(t)?t.test(e):Fp(t)?n?e===t:e.includes(t):!1:!1}function mm(e,t=[],n=!1){return t.some(t=>pm(e,t,n))}function hm(){let e=Wf;return e.crypto||e.msCrypto}var gm;function _m(){return lm()*16}function vm(e=hm()){try{if(e?.randomUUID)return cm(()=>e.randomUUID()).replace(/-/g,``)}catch{}return gm||=`10000000100040008000100000000000`,gm.replace(/[018]/g,e=>(e^(_m()&15)>>e/4).toString(16))}function ym(e){return e.exception?.values?.[0]}function bm(e){let{message:t,event_id:n}=e;if(t)return t;let r=ym(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function xm(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function Sm(e,t){let n=ym(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function Cm(e){if(wm(e))return!0;try{em(e,`__sentry_captured__`,!0)}catch{}return!1}function wm(e){try{return e.__sentry_captured__}catch{}}var Tm=1e3;function Em(){return um()/Tm}function Dm(){let{performance:e}=Wf;if(!e?.now||!e.timeOrigin)return Em;let t=e.timeOrigin;return()=>(t+cm(()=>e.now()))/Tm}var Om;function km(){return(Om??=Dm())()}function Am(e){let t=km(),n={sid:vm(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>Nm(n)};return e&&jm(n,e),n}function jm(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||km(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:vm()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),t
5ypeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Mm(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),jm(e,n)}function Nm(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Pm(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Pm(r[e],t[e],n-1));return r}function Fm(){return vm()}function Im(){return vm().substring(16)}var Lm=`_sentrySpan`;function Rm(e,t){t?em(e,Lm,t):delete e[Lm]}function zm(e){return e[Lm]}var Bm=100,Vm=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Fm(),sampleRand:lm()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Rm(t,zm(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&jm(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():Rp(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Rm(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Fm(),sampleRand:lm()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:Bm;if(n<=0)return this;let r={timestamp:Em(),...e,message:e.message?dm(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:zm(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Pm(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||vm();if(!this._client)return O&&k.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||vm();if(!this._client)return O&&k.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||vm();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(O&&k.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEac
5h(e=>{e(this)}),!1)}};function Hm(){return Jf(`defaultCurrentScope`,()=>new Vm)}function Um(){return Jf(`defaultIsolationScope`,()=>new Vm)}var Wm=class{constructor(e,t){let n;n=e||new Vm;let r;r=t||new Vm,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return Hp(n)?n.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Gm(){let e=qf(Kf());return e.stack=e.stack||new Wm(Hm(),Um())}function Km(e){return Gm().withScope(e)}function qm(e,t){let n=Gm();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Jm(e){return Gm().withScope(()=>e(Gm().getIsolationScope()))}function Ym(){return{withIsolationScope:Jm,withScope:Km,withSetScope:qm,withSetIsolationScope:(e,t)=>Jm(t),getCurrentScope:()=>Gm().getScope(),getIsolationScope:()=>Gm().getIsolationScope()}}function Xm(e){let t=qf(e);return t.acs?t.acs:Ym()}function Zm(){return Xm(Kf()).getCurrentScope()}function Qm(){return Xm(Kf()).getIsolationScope()}function $m(){return Jf(`globalScope`,()=>new Vm)}function eh(...e){let t=Xm(Kf());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function th(){return Zm().getClient()}function nh(e){let{traceId:t,parentSpanId:n,propagationSpanId:r}=e.getPropagationContext(),i={trace_id:t,span_id:r||Im()};return n&&(i.parent_span_id=n),i}var rh=`sentry.source`,ih=`sentry.op`,ah=`sentry.origin`,oh=`sentry.profile_id`,sh=`sentry.exclusive_time`,ch=`gen_ai.conversation.id`,lh=`_sentryScope`,uh=`_sentryIsolationScope`;function dh(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}function fh(e){let t=e;return{scope:t[lh],isolationScope:dh(t[uh])}}function ph(e){let t=mh(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function mh(e){if(!(!e||!Fp(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=hh(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):hh(e)}function hh(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var gh=/^o(\d+)\./,_h=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function vh(e){return e===`http`||e===`https`}function yh(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function bh(e){let t=_h.exec(e);if(!t){Qf(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return xh({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function xh(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function Sh(e){if(!O)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(k.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?vh(r)?t&&isNaN(parseInt(t,10))?(k.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(k.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(k.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ch(e){return e.match(gh)?.[1]}function wh(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Ch(n)),r}function Th(e){let t=typeof e==`string`?bh(e):xh(e);if(!(!t||!Sh(t)))return t}function Eh(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var Dh=!1;function Oh(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:Mh(e).parent_span_id,a=fh(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||Im():t,trace_id:n}}function kh(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Ah(e){return typeof e==`number`?jh(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?jh(e.getTime()):km()}function jh(e){return e>9999999999?e/1e3:e}function Mh(e){if(Ph(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Nh(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0,start_timestamp:Ah(i),timestamp:Ah(o)||void 0,status:Ih(s),op:r[ih],origin:r[ah],links:kh(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Nh(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Ph(e){return typeof e.getSpanJSON==`function`}function Fh(e){let{traceFlags:t}=e.spanContext();return t===1}function Ih(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}var Lh=`_sentryRootSpan`;function Rh(e){return e[Lh]||e}function zh(){Dh||=(Qf(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function Bh(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||th()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Vh(e){k.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Hh(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(Wh(n)){if(pm(e.description,n))return O&&Vh(e),!0;continue}if(!n.name&&!n.op)continue;let t=n.name?pm(e.description,n.name):!0,r=n.op?e.op&&pm(e.op,n.op):!0;if(t&&r)return O&&Vh(e),!0}return!1}function Uh(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function Wh(e){return typeof e==`string`||e instanceof RegExp}var Gh=`production`,Kh=`_frozenDsc`;function qh(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:wh(t)};return t.emit(`createDsc`,i),i}function Jh(e,t){let n=t.getPropagationContext();return n.dsc||qh(n.traceId,e)}function Yh(e){let t=th();if(!t)return{};let n=Rh(e),r=Mh(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[Kh];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&ph(l);if(u)return s(u);let d=qh(e.spanContext().traceId,t),f=i[rh],p=r.description;return f!==`url`&&p&&(d.transaction=p),Bh()&&(d.sampled=String(Fh(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??fh(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}function Xh(e,t=100,n=1/0){try{return Qh(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Zh(e,t=3,n=100*1024){let r=Xh(e,t);return ng(r)>n?Zh(e,t-1,n):r}function Qh(e,t,n=1/0,r=1/0,i=rg()){let[a,o]=i;
5if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=$h(e,t);if(!s.startsWith(`[object `))return s;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(c===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let l=t;if(l&&typeof l.toJSON==`function`)try{return Qh(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=rm(t);for(let e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(d>=r){u[e]=`[MaxProperties ~]`;break}let t=f[e];u[e]=Qh(e,t,c-1,r,i),d++}return o(t),u}function $h(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof globalThis<`u`&&t===globalThis)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Gp(t))return _p(t);if(Up(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${hp(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=eg(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function eg(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function tg(e){return~-encodeURI(e).split(/%..|./).length}function ng(e){return tg(JSON.stringify(e))}function rg(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function ig(e,t=[]){return[e,t]}function ag(e,t){let[n,r]=e;return[n,[...r,t]]}function og(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function sg(e,t){return og(e,(e,n)=>t.includes(n))}function cg(e){let t=qf(Wf);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function lg(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[cg(r),e]:r.push(typeof e==`string`?cg(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(Xh(n))}i(e)}}return typeof r==`string`?r:ug(r)}function ug(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function dg(e){let t=typeof e.data==`string`?cg(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var fg={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function pg(e){return e in fg}function mg(e){return pg(e)?fg[e]:e}function hg(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function gg(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:yh(r)},...i&&{trace:i}}}function _g(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function vg(e,t,n,r){let i=hg(n);return ig({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:yh(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function yg(e,t,n,r){let i=hg(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;_g(e,n?.sdk);let o=gg(e,i,r,t);return delete e.sdkProcessingMetadata,ig(o,[[{type:a},e]])}var bg=0,xg=1,Sg=2;function Cg(e){return new Tg(t=>{t(e)})}function wg(e){return new Tg((t,n)=>{n(e)})}var Tg=class e{constructor(e){this._state=bg,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>
5{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===bg)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===xg&&e[1](this._value),this._state===Sg&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===bg){if(Hp(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(xg,e)},r=e=>{t(Sg,e)};try{e(n,r)}catch(e){r(e)}}};function Eg(e,t,n,r=0){try{let i=Dg(t,n,e,r);return Hp(i)?i:Cg(i)}catch(e){return wg(e)}}function Dg(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return O&&a===null&&k.log(`Event processor "${i.id||`?`}" dropped event`),Hp(a)?a.then(e=>Dg(e,t,n,r+1)):Dg(a,t,n,r+1)}var Og,kg,Ag,jg;function Mg(e){let t=Wf._sentryDebugIds,n=Wf._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(jg&&r.length===kg&&i.length===Ag)return jg;kg=r.length,Ag=i.length,jg={},Og||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Og?.[r];if(i&&jg&&t)jg[i[0]]=t,Og&&(Og[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&jg&&Og){jg[i]=t,Og[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),jg}function Ng(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Lg(e,t),r&&Bg(e,r),Vg(e,n),Rg(e,i),zg(e,a)}function Pg(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Fg(e,`extra`,n),Fg(e,`tags`,r),Fg(e,`attributes`,i),Fg(e,`user`,a),Fg(e,`contexts`,o),e.sdkProcessingMetadata=Pm(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Fg(e,t,n){e[t]=Pm(e[t],n,1)}function Ig(e,t){let n=$m().getScopeData();return e&&Pg(n,e.getScopeData()),t&&Pg(n,t.getScopeData()),n}function Lg(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Rg(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function zg(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Bg(e,t){e.contexts={trace:Oh(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Yh(t),...e.sdkProcessingMetadata};let n=Mh(Rh(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function Vg(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Hg(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||vm(),timestamp:t.timestamp||Em()},l=n.integrations||e.integrations.map(e=>e.name);Ug(c,e),Kg(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Wg(c,e.stackParser);let u=Jg(r,n.captureContext);n.mechanism&&Sm(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Ig(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Ng(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Cg(c):Eg(m,c,n)).then(e=>(e&&Gg(e),typeof o==`number`&&o>0?qg(e,o,s):e))}function Ug(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=dm(o.url,a)),a&&e.exception?.values?.forEach(e
5=>{e.value&&=dm(e.value,a)})}function Wg(e,t){let n=Mg(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Gg(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Kg(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function qg(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Xh(e.data,t,n)}}))},...e.user&&{user:Xh(e.user,t,n)},...e.contexts&&{contexts:Xh(e.contexts,t,n)},...e.extra&&{extra:Xh(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Xh(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Xh(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Xh(e.contexts.flags,3,n)),r}function Jg(e,t){if(!t)return e;let n=e?e.clone():new Vm;return n.update(t),n}function Yg(e){if(e)return Xg(e)||Qg(e)?{captureContext:e}:e}function Xg(e){return e instanceof Vm||typeof e==`function`}var Zg=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Qg(e){return Object.keys(e).some(e=>Zg.includes(e))}function $g(e,t){return Zm().captureException(e,Yg(t))}function e_(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return Zm().captureMessage(e,n,r)}function t_(e,t){return Zm().captureEvent(e,t)}function n_(e,t){Qm().setContext(e,t)}function r_(e){let t=Qm(),{user:n}=Ig(t,Zm()),{userAgent:r}=Wf.navigator||{},i=Am({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&jm(a,{status:`exited`}),i_(),t.setSession(i),i}function i_(){let e=Qm(),t=Zm().getSession()||e.getSession();t&&Mm(t),a_(),e.setSession()}function a_(){let e=Qm(),t=th(),n=e.getSession();n&&t&&t.captureSession(n)}function o_(e=!1){if(e){i_();return}a_()}var s_=`7`;function c_(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function l_(e){return`${c_(e)}${e.projectId}/envelope/`}function u_(e,t){let n={sentry_version:s_};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function d_(e,t,n){return t||`${l_(e)}?${u_(e,n)}`}var f_=[];function p_(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function m_(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return p_(r)}function h_(e,t){let n={};return t.forEach(t=>{t&&__(e,t,n)}),n}function g_(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function __(e,t,n){if(n[t.name]){O&&k.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!f_.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),f_.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}O&&k.log(`Integration installed: ${t.name}`)}function v_(e){return e}function y_(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function b_(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=yh(r)),ig(i,[y_(e)])}function x_(e,t){let n=t??S_(e)??[];if(n.length===0)return;let r=e.getOptions(),i=b_(n,r._metadata,r.tunnel,e.getDsn());C_().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function S_(e){return C_().get(e)}function C_(){return Jf(`clientToLogBufferMap`,()=>new WeakMap)}function w_(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function T_(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=yh(r)),ig(i,[w_(e)])}function E_(e,t){let n=t??D_(e)??[];if(n.length===0)return;let r=e.getOptions(),i=T_(n,r._metadata,r.tunnel,e.getDsn());O_().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function D_(e){return O_().get(e)}function O_(){return Jf(`clientToMetricBufferMap`,()=>new WeakMap)}function k_(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}var A_=Symbol.for(`SentryBufferFullError`);function j_(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return wg(A_);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Cg(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>k_(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var M_=60*1e3;function N_(e,t=um()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?M_:r-t}function P_(e,t){return e[t]||e.all||0}function F_(e,t,n=um()){return P_(e,t)>n}function I_(e,{statusCode:t,headers:n},r=um()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+N_(o,r):t===429&&(i.all=r+60*1e3);return i}function L_(e,t,n=j_(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(og(i,(t,n)=>{let i=mg(n);F_(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=ig(i[0],a),s=t=>{if(sg(o,[`client_report`])){O&&k.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}og(o,(n,r)=>{e.recordDroppedEvent(t,mg(r))})};return n.add(()=>t({body:lg(o)}).then(e=>e.statusCode===413?(O&&k.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(O&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&k.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=I_(r,e),e),e=>{throw s(`network_error`),O&&k.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>
5{if(e===A_)return O&&k.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function R_(e,t,n){let r=[{type:`client_report`},{timestamp:n||Em(),discarded_events:e}];return ig(t?{dsn:t}:{},[r])}function z_(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function B_(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[oh],exclusive_time:o?.[sh],measurements:e.measurements,is_segment:!0}}function V_(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var H_=`Not capturing exception because it's already been captured.`,U_=`Discarded session because of missing or non-string release`,W_=Symbol.for(`SentryInternalError`),G_=Symbol.for(`SentryDoNotSendEventError`),K_=5e3;function q_(e){return{message:e,[W_]:!0}}function J_(e){return{message:e,[G_]:!0}}function Y_(e){return!!e&&typeof e==`object`&&W_ in e}function X_(e){return!!e&&typeof e==`object`&&G_ in e}function Z_(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=k_(setTimeout(()=>{i(e)},K_)))}),e.on(`flush`,()=>{i(e)})}var Q_=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=j_(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=Th(e.dsn):O&&k.warn(`No DSN provided, client will not send events.`),this._dsn){let t=d_(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Z_(this,`afterCaptureLog`,`flushLogs`,av,x_),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Z_(this,`afterCaptureMetric`,`flushMetrics`,iv,E_)}captureException(e,t,n){let r=vm();if(Cm(e))return O&&k.log(H_),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:vm(),...n},a=Ip(e)?e:String(e),o=Lp(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=vm();if(t?.originalException&&Cm(t.originalException))return O&&k.log(H_),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=$_(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),jm(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(!t)return!0;this.emit(`flush`);let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){x_(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];__(this,e,this._integrations),t||g_(this,[e])}sendEvent(e,t={}
5){this.emit(`beforeSendEvent`,e,t);let n=yg(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=ag(n,dg(e));this.sendEnvelope(n).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=Gh}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){O&&k.warn(U_);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){O&&k.warn(U_);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=vg(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;O&&k.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return O&&k.error(`Error while sending envelope:`,e),{}}return O&&k.error(`Transport disabled`),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=h_(this,e),g_(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(jm(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Hg(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...nh(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Jh(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=Zm(),r=Qm()){return O&&nv(e)&&k.log(`Captured error event \`${z_(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{O&&(X_(e)?k.log(e.message):Y_(e)?k.warn(e.message):k.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=rv(e),s=nv(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:Eh(a);if(s&&typeof l==`number`&&lm()>l)return this.recordDroppedEvent(`sample_rate`,`error`),wg(J_(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=$_(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),J_("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:ev(tv(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw J_(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw X_(e)||Y_(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),q_(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===A_&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){O&&k.log(`Flushing outcomes...`);let e=this._clearOutcomes();
5if(e.length===0){O&&k.log(`No outcomes to send`);return}if(!this._dsn){O&&k.log(`No dsn provided, will not send outcomes`);return}O&&k.log(`Sending outcomes:`,e);let t=R_(e,this._options.tunnel&&yh(this._dsn));this.sendEnvelope(t)}};function $_(e){return e===`replay_event`?`replay`:e||`error`}function ev(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Hp(e))return e.then(e=>{if(!Rp(e)&&e!==null)throw q_(n);return e},e=>{throw q_(`${t} rejected with ${e}`)});if(!Rp(e)&&e!==null)throw q_(n);return e}function tv(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t,c=n;if(nv(c)&&i)return i(c,r);if(rv(c)){if(o||s){let t=B_(c);if(s?.length&&Hh(t,s))return null;if(o){let e=o(t);e?c=Pm(n,V_(e)):zh()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(s?.length&&Hh(e,s)){Uh(n,e);continue}if(o){let n=o(e);n?t.push(n):(zh(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function nv(e){return e.type===void 0}function rv(e){return e.type===`transaction`}function iv(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+ov(e.attributes)}function av(e){let t=0;return e.message&&(t+=e.message.length*2),t+ov(e.attributes)}function ov(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*sv(e[0]):Lp(e)?t+=sv(e):t+=100}),t}function sv(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function cv(e){return Ap(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function lv(e){return cv(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function uv(e,t){t.debug===!0&&(O?k.enable():Qf(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Zm().update(t.initialScope);let n=new e(t);return dv(n),n.init(),n}function dv(e){Zm().setClient(e)}function fv(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function pv(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function mv(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function hv(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:Gf})),i.version=Gf)}var gv=100;function _v(e,t){let n=th(),r=Qm();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=gv}=n.getOptions();if(a<=0)return;let o={timestamp:Em(),...e},s=i?Qf(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var vv,yv=`FunctionToString`,bv=new WeakMap,xv=v_((()=>({name:yv,setupOnce(){vv=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=nm(this),n=bv.has(th())&&t!==void 0?t:this;return vv.apply(n,e)}}catch{}},setup(e){bv.set(e,!0)}}))),Sv=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Cv=`EventFilters`,wv=v_((e={})=>{let t;return{name:Cv,setup(n){t=Ev(e,n.getOptions())},processEvent(n,r,i){return t||=Ev(e,i.getOptions()),Dv(n,t)?null:n}}}),Tv=v_(((e={})=>({...wv(e),name:`InboundFilters`})));function Ev(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Sv],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Dv(e,t){if(!e.type){if(Ov(e,t.ignoreErrors))return O&&k.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${bm(e)}`),!0;if(Pv(e))return O&&k.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${bm(e)}`),!0;if(Av(e,t.denyUrls))return O&&k.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${bm(e)}.\nUrl: ${Nv(e)}`),!0;if(!jv(e,t.allowUrls))return O&&k.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${bm(e)}.\nUrl: ${Nv(e)}`),!0}else if(e.type===`transaction`&&kv(e,t.ignoreTransactions))return O&&k.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${bm(e)}`),!0;return!1}function Ov(e,t){return t?.length?z_(e).some(e=>mm(e,t)):!1}function kv(e,t){if(!t?.length)return!1;let n=e.transaction;return n?mm(n,t):!1}function Av(e,t){if(!t?.length)return!1;let n=Nv(e);return n?mm(n,t):!1}function jv(e,t){if(!t?.length)return!0;let n=Nv(e);return n?mm(n,t):!0}function Mv(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function Nv(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?Mv(t):null}catch{return O&&k.error(`Cannot extract url for event ${bm(e)}`),null}}function Pv(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function Fv(e,t,n,r,i,a){if(!i.exception?.values||!a||!Wp(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=Iv(e,t,r,a.originalException,n,i.exception.values,o,0))}
5function Iv(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Wp(r[i],Error)){Rv(o,s,r);let a=e(t,r[i]),l=c.length;zv(a,i,l,s),c=Iv(e,t,n,r[i],i,[a,...c],a,l)}return Lv(r)&&r.errors.forEach((a,l)=>{if(Wp(a,Error)){Rv(o,s,r);let u=e(t,a),d=c.length;zv(u,`errors[${l}]`,d,s),c=Iv(e,t,n,a,i,[u,...c],u,d)}}),c}function Lv(e){return Array.isArray(e.errors)}function Rv(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...Lv(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function zv(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Bv(e){let t=`console`;bp(t,e),xp(t,Vv)}function Vv(){`console`in Wf&&Yf.forEach(function(e){e in Wf.console&&$p(Wf.console,e,function(t){return Zf[e]=t,function(...t){Sp(`console`,{args:t,level:e}),Zf[e]?.apply(Wf.console,t)}})})}function Hv(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var Uv=`Dedupe`,Wv=v_((()=>{let e;return{name:Uv,processEvent(t){if(t.type)return t;try{if(Gv(t,e))return O&&k.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function Gv(e,t){return t?!!(Kv(e,t)||qv(e,t)):!1}function Kv(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Yv(e,t)||!Jv(e,t))}function qv(e,t){let n=Xv(t),r=Xv(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Yv(e,t)||!Jv(e,t))}function Jv(e,t){let n=gp(e),r=gp(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Yv(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Xv(e){return e.exception?.values?.[0]}var Zv=`ConversationId`,Qv=v_((()=>({name:Zv,setup(e){e.on(`spanStart`,e=>{let t=Zm().getScopeData(),n=Qm().getScopeData(),r=t.conversationId||n.conversationId;r&&e.setAttribute(ch,r)})}})));function $v(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var ey=Wf;function ty(){return`history`in ey&&!!ey.history}function ny(){if(!(`fetch`in ey))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function ry(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function iy(){if(typeof EdgeRuntime==`string`)return!0;if(!ny())return!1;if(ry(ey.fetch))return!0;let e=!1,t=ey.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ry(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){O&&k.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function ay(e,t){let n=`fetch`;bp(n,e),xp(n,()=>oy(void 0,t))}function oy(e,t=!1){t&&!iy()||$p(Wf,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=ly(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:km()*1e3,virtualError:r,headers:uy(n)};return e||Sp(`fetch`,{...o}),t.apply(Wf,n).then(async t=>(e?e(t):Sp(`fetch`,{...o,endTimestamp:km()*1e3,response:t}),t),e=>{Sp(`fetch`,{...o,endTimestamp:km()*1e3,error:e}),Ap(e)&&e.stack===void 0&&(e.stack=r.stack,em(e,`framesToPop`,1));let t=th()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:em(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}function sy(e,t){return!!e&&typeof e==`object`&&!!e[t]}function cy(e){return typeof e==`string`?e:e?sy(e,`url`)?e.url:e.toString?e.toString():``:``}function ly(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:cy(t),method:sy(n,`method`)?String(n.method).toUpperCase():Kp(t)&&sy(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:cy(t),method:sy(t,`method`)?String(t.method).toUpperCase():`GET`}}function uy(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(Kp(t))return new Headers(t.headers)}catch{}}function dy(){return`npm`}var fy=Wf,py=0;function my(){return py>0}function hy(){py++,setTimeout(()=>{py--})}function gy(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(nm(e))return e}catch{return e}let r=function(...n){try{let r=n.map(e=>gy(e,t));return e.apply(this,r)}catch(e){throw hy(),eh(r=>{r.addEventProcessor(e=>(t.mechanism&&(xm(e,void 0,void 0),Sm(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),$g(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}tm(r,e),em(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,`name`,{get(){return e.name}})}catch{}return r}function _y(){let e=Zp(),{referrer:t}=fy.document||{},{userAgent:n}=fy.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function vy(e,t){let n=xy(e,t),r={type:Ey(t),value:Dy(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function yy(e,t,n,r){let i=th()?.getOptions().normalizeDepth,a=Py(t),o={__serialized__:Zh(t,i)};if(a)return{exception:{values:[vy(e,a)]},extra:o};let s={exception:{values:[{type:zp(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:My(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=xy(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function by(e,t){return{exception:{values:[vy(e,t)]}}}function xy(e,t){let n=t.stacktrace||t.stack||``,r=Cy(t),i=wy(t);try{return e(n,r,i)}catch{}return[]}
5var Sy=/Minified React error #\d+;/i;function Cy(e){return e&&Sy.test(e.message)?1:0}function wy(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function Ty(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function Ey(e){let t=e?.name;return!t&&Ty(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function Dy(e){let t=e?.message;return Ty(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?lv(t.error):lv(e):`No error message`}function Oy(e,t,n,r){let i=Ay(e,t,n?.syntheticException||void 0,r);return Sm(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),Cg(i)}function ky(e,t,n=`info`,r,i){let a=jy(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),Cg(a)}function Ay(e,t,n,r,i){let a;if(Mp(t)&&t.error)return by(e,t.error);if(Np(t)||Pp(t)){let i=t;if(`stack`in t)a=by(e,t);else{let t=i.name||(Np(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=jy(e,o,n,r),xm(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return Ap(t)?by(e,t):Rp(t)||zp(t)?(a=yy(e,t,n,i),Sm(a,{synthetic:!0}),a):(a=jy(e,t,n,r),xm(a,`${t}`,void 0),Sm(a,{synthetic:!0}),a)}function jy(e,t,n,r){let i={};if(r&&n){let r=xy(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),Sm(i,{synthetic:!0})}if(Ip(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function My(e,{isUnhandledRejection:t}){let n=om(e),r=t?`promise rejection`:`exception`;return Mp(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:zp(e)?`Event \`${Ny(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Ny(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Py(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}var Fy=class extends Q_{constructor(e){let t=Iy(e);hv(t,`browser`,[`browser`],fy.SENTRY_SDK_SOURCE||dy()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?`auto`:`never`,...t._metadata.sdk.settings}),super(t);let{sendDefaultPii:n,sendClientReports:r,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;fy.document&&(r||i||s)&&fy.document.addEventListener(`visibilitychange`,()=>{fy.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),i&&x_(this),s&&E_(this))}),n&&this.on(`beforeSendSession`,mv)}eventFromException(e,t){return Oy(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return ky(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function Iy(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:fy.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var Ly=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Ry=Wf,zy=1e3,By,Vy,Hy;function Uy(e){bp(`dom`,e),xp(`dom`,Wy)}function Wy(){if(!Ry.document)return;let e=Sp.bind(null,`dom`),t=qy(e,!0);Ry.document.addEventListener(`click`,t,!1),Ry.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Ry[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&($p(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=qy(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),$p(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Gy(e){if(e.type!==Vy)return!1;try{if(!e.target||e.target._sentryId!==Hy)return!1}catch{}return!0}function Ky(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function qy(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;
5let r=Jy(n);if(Ky(n.type,r))return;em(n,`_sentryCaptured`,!0),r&&!r._sentryId&&em(r,`_sentryId`,vm());let i=n.type===`keypress`?`input`:n.type;Gy(n)||(e({event:n,name:i,global:t}),Vy=n.type,Hy=r?r._sentryId:void 0),clearTimeout(By),By=Ry.setTimeout(()=>{Hy=void 0,Vy=void 0},zy)}}function Jy(e){try{return e.target}catch{return null}}var Yy;function Xy(e){let t=`history`;bp(t,e),xp(t,Zy)}function Zy(){if(Ry.addEventListener(`popstate`,()=>{let e=Ry.location.href,t=Yy;Yy=e,t!==e&&Sp(`history`,{from:t,to:e})}),!ty())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=Yy,i=Qy(String(n));if(Yy=i,r===i)return e.apply(this,t);Sp(`history`,{from:r,to:i})}return e.apply(this,t)}}$p(Ry.history,`pushState`,e),$p(Ry.history,`replaceState`,e)}function Qy(e){try{return new URL(e,Ry.location.origin).toString()}catch{return e}}var $y={};function eb(e){let t=$y[e];if(t)return t;let n=Ry[e];if(ry(n))return $y[e]=n.bind(Ry);let r=Ry.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){Ly&&k.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&($y[e]=n.bind(Ry))}function tb(e){$y[e]=void 0}var nb=`__sentry_xhr_v3__`;function rb(e){bp(`xhr`,e),xp(`xhr`,ib)}function ib(){if(!Ry.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=km()*1e3,a=Fp(n[0])?n[0].toUpperCase():void 0,o=ab(n[1]);if(!a||!o)return e.apply(t,n);t[nb]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[nb];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}Sp(`xhr`,{endTimestamp:km()*1e3,startTimestamp:i,xhr:t,virtualError:r})}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[nb];return a&&Fp(r)&&Fp(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[nb];return r?(n[0]!==void 0&&(r.body=n[0]),Sp(`xhr`,{startTimestamp:km()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function ab(e){if(Fp(e))return e;try{return e.toString()}catch{}}var ob=40;function sb(e,t=eb(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw tb(`fetch`),e}finally{n-=a,r--}}return L_(e,i,j_(e.bufferSize||ob))}var cb=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,lb=30,ub=50;function db(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var fb=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,pb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mb=/\((\S*)(?::(\d+))(?::(\d+))\)/,hb=/at (.+?) ?\(data:(.+?),/,gb=[lb,e=>{let t=e.match(hb);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=fb.exec(e);if(n){let[,e,t,r]=n;return db(e,`?`,+t,+r)}let r=pb.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=mb.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=bb(r[1]||`?`,r[2]);return db(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],_b=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vb=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yb=up(gb,[ub,e=>{let t=_b.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=vb.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=bb(n,e),db(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),bb=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},xb=1024,Sb=`Breadcrumbs`,Cb=v_(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Sb,setup(e){t.console&&Bv(Eb(e)),t.dom&&Uy(Tb(e,t.dom)),t.xhr&&rb(Db(e)),t.fetch&&ay(Ob(e)),t.history&&Xy(kb(e)),t.sentry&&e.on(`beforeSendEvent`,wb(e))}}}));function wb(e){return function(t){th()===e&&_v({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:bm(t)}
5,{event:t})}}function Tb(e,t){return function(n){if(th()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>xb&&(cb&&k.warn(`\`dom.maxStringLength\` cannot exceed ${xb}, but a value of ${o} was configured. Sentry will use ${xb} instead.`),o=xb),typeof a==`string`&&(a=[a]);try{let e=n.event,t=Ab(e)?e.target:e;r=Yp(t,{keyAttrs:a,maxStringLength:o}),i=Qp(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),_v(s,{event:n.event,name:n.name,global:n.global})}}function Eb(e){return function(t){if(th()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:Hv(t.level),message:fm(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${fm(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;_v(n,{input:t.args,level:t.level})}}function Db(e){return function(t){if(th()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[nb];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:$v(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),_v(d,u)}}function Ob(e){return function(t){if(th()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.fetchData.method,t.fetchData.url,t.error){let i=t.fetchData,a={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},o={category:`fetch`,data:i,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,o,a),_v(o,a)}else{let i=t.response,a={...t.fetchData,status_code:i?.status};t.fetchData.request_body_size,t.fetchData.response_body_size,i?.status;let o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:$v(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),_v(s,o)}}}function kb(e){return function(t){if(th()!==e)return;let n=t.from,r=t.to,i=fv(fy.location.href),a=n?fv(n):void 0,o=fv(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),_v({category:`navigation`,data:{from:n,to:r}})}}function Ab(e){return!!e&&!!e.target}var jb=`EventTarget.Window.Node.ApplicationCache.AudioTrackList.BroadcastChannel.ChannelMergerNode.CryptoOperation.EventSource.FileReader.HTMLUnknownElement.IDBDatabase.IDBRequest.IDBTransaction.KeyOperation.MediaController.MessagePort.ModalWindow.Notification.SVGElementInstance.Screen.SharedWorker.TextTrack.TextTrackCue.TextTrackList.WebSocket.WebSocketWorker.Worker.XMLHttpRequest.XMLHttpRequestEventTarget.XMLHttpRequestUpload`.split(`.`),Mb=`BrowserApiErrors`,Nb=v_(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Mb,setupOnce(){t.setTimeout&&$p(fy,`setTimeout`,Pb),t.setInterval&&$p(fy,`setInterval`,Pb),t.requestAnimationFrame&&$p(fy,`requestAnimationFrame`,Fb),t.XMLHttpRequest&&`XMLHttpRequest`in fy&&$p(XMLHttpRequest.prototype,`send`,Ib);let e=t.eventTarget;e&&(Array.isArray(e)?e:jb).forEach(e=>Lb(e,t))}}}));function Pb(e){return function(...t){let n=t[0];return t[0]=gy(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${hp(e)}`}}),e.apply(this,t)}}function Fb(e){return function(t){return e.apply(this,[gy(t,{mechanism:{data:{handler:hp(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function Ib(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&$p(n,e,function(t){let n={mechanism:{data:{handler:hp(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=nm(t);return r&&(n.mechanism.data.handler=hp(r)),gy(t,n)})}),e.apply(this,t)}}function Lb(e,t){let n=fy[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&($p(n,`addEventListener`,function(n){return function(r,i,a){try{Rb(i)&&(i.handleEvent=gy(i.handleEvent,{mechanism:{data:{handler:hp(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&zb(this,r,i),n.apply(this,[r,gy(i,{mechanism:{data:{handler:hp(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),$p(n,`removeEventListener`,function(e){return function(t,n,r){try{let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch{}return e.call(this,t,n,r)}}))}function Rb(e){return typeof e.handleEvent==`function`}function zb(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var Bb=v_((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(fy.document===void 0){cb&&k.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}r_({ignoreDuration:!0}),o_();let e=Qm(),n=e.getUser();e.addScopeListener(e=>{let t=e.getUser();
5(n?.id!==t?.id||n?.ip_address!==t?.ip_address)&&(o_(),n=t)}),t===`route`&&Xy(({from:e,to:t})=>{e!==t&&(r_({ignoreDuration:!0}),o_())})}}}),Vb=`CultureContext`,Hb=v_((()=>({name:Vb,preprocessEvent(e){let t=Ub();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})));function Ub(){try{let e=fy.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var Wb=`GlobalHandlers`,Gb=v_(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:Wb,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(Kb(e),Zb(`onerror`)),t.onunhandledrejection&&(qb(e),Zb(`onunhandledrejection`))}}}));function Kb(e){wp(t=>{let{stackParser:n,attachStacktrace:r}=Qb();if(th()!==e||my())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=Xb(Ay(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,t_(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function qb(e){Dp(t=>{let{stackParser:n,attachStacktrace:r}=Qb();if(th()!==e||my())return;let i=Jb(t),a=Lp(i)?Yb(i):Ay(n,i,void 0,r,!0);a.level=`error`,t_(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function Jb(e){if(Lp(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function Yb(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Xb(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[],l=r,u=n,d=$b(t)??Zp();return c.length===0&&c.push({colno:l,filename:d,function:`?`,in_app:!0,lineno:u}),e}function Zb(e){cb&&k.log(`Global Handler attached: ${e}`)}function Qb(){return th()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function $b(e){if(!(!Fp(e)||e.length===0))return e.startsWith(`data:`)?`<${pv(e,!1)}>`:e}var ex=v_(()=>({name:`HttpContext`,preprocessEvent(e){if(!fy.navigator&&!fy.location&&!fy.document)return;let t=_y(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}})),tx=`cause`,nx=5,rx=`LinkedErrors`,ix=v_(((e={})=>{let t=e.limit||nx,n=e.key||tx;return{name:rx,preprocessEvent(e,r,i){Fv(vy,i.getOptions().stackParser,n,t,e,r)}}}));function ax(){return ox()?(cb&&Qf(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function ox(){if(fy.window===void 0)return!1;let e=fy;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=Zp();return!(fy===fy.top&&[`chrome-extension`,`moz-extension`,`ms-browser-extension`,`safari-web-extension`].some(e=>
5t.startsWith(`${e}://`)))}function sx(e){return[Tv(),xv(),Qv(),Nb(),Cb(),Gb(),ix(),Wv(),ex(),Hb(),Bb()]}function cx(e={}){let t=!e.skipBrowserExtensionCheck&&ax(),n=e.defaultIntegrations==null?sx():e.defaultIntegrations;return uv(Fy,{...e,enabled:t?!1:e.enabled,stackParser:dp(e.stackParser||yb),integrations:m_({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||sb})}var lx=r(e());function ux(e){let t={...e};return hv(t,`react`),n_(`react`,{version:lx.version}),cx(t)}var dx=!0;`https://api.odysee.com`.includes(`dev`);var fx=!1,px={setState:e=>{fx=e},view:(e,t,n)=>new Promise((r,i)=>{if(fx&&dx){let i={uri:e,outpoint:t,claim_id:n};r(M.call(`file`,`view`,i))}else r(void 0)}),search:()=>{fx&&dx&&M.call(`event`,`search`)},publish:(e,t)=>{if(fx){let{permanent_url:n,claim_id:r,txid:i,nout:a,signing_channel:o}=e,s;o&&(s=o.claim_id);let c={uri:n,claim_id:r,outpoint:`${i}:${a}`};s&&(c.channel_claim_id=s),M.call(`event`,`publish`,c).then(()=>{t&&t(e)})}},desktopError:e=>new Promise(t=>{if(fx&&dx)return M.call(`event`,`desktop_error`,{error_message:e}).then(()=>{t(!0)});t(!1)})},mx={TYPE:`type`,ACTION:`action`,VALUE:`value`,START_TIME_MS:`start_time_ms`,DURATION_MS:`duration_ms`,END_TIME_MS:`end_time_ms`},hx=0,gx={},_x=!1,vx={setState:e=>{_x=e&&!!window.gtag,_x&&window.gtag(`consent`,`update`,{ad_storage:`granted`,analytics_storage:`granted`})},setUser:e=>{_x&&e&&window.gtag(`set`,{user_id:e})},report:(e,t)=>{yx(e,t)},emailProvided:()=>{yx(`engagement`,{[mx.TYPE]:`email_provided`})},emailVerified:()=>{yx(`engagement`,{[mx.TYPE]:`email_verified`})},openUrl:e=>{yx(`engagement`,{[mx.TYPE]:`open_url`,url:e})},playerLoaded:(e,t)=>{let n=e=>{switch(e){case ea:return`loaded_video`;case xo:return`loaded_audio`;case`md`:return`loaded_markdown`;case zc:return`loaded_image`;case`livestream`:return`loaded_livestream`;default:return`loaded_misc`}};yx(`player`,{[mx.ACTION]:n(e),[mx.TYPE]:t?`embedded`:`onsite`})},playerVideoStarted:e=>{yx(`player`,{[mx.ACTION]:`started_video`,[mx.TYPE]:e?`embedded`:`onsite`})},purchase:e=>{yx(`purchase`,{[mx.VALUE]:e})},rewardEligible:()=>{yx(`engagement`,{[mx.TYPE]:`reward_eligible`})},startup:e=>{hx!==0&&yx(`diag_app_ready`,{[mx.DURATION_MS]:e-hx})},tagFollow:(e,t)=>{yx(`tags`,{[mx.ACTION]:t?`follow`:`unfollow`,[mx.VALUE]:e})},trendingAlgorithm:e=>{yx(`engagement`,{[mx.TYPE]:`trending_algorithm`,trending_algorithm:e})},initAppStartTime:e=>{hx=e},eventStarted:(e,t,n)=>{let r=n||e;gx[r]=t},eventCompleted:(e,t,n)=>{let r=n||e;gx[r]&&(yx(e,{[mx.START_TIME_MS]:gx[r]-hx,[mx.DURATION_MS]:t-gx[r],[mx.END_TIME_MS]:t-hx}),delete gx[r])}};function yx(e,t){_x&&window.gtag(`event`,e,t)}var bx=`https://[email protected]/2`,xx=nd.getItem(`sentry_test_dsn`)||``,Sx=nd.getItem(`sentry_install`)===`true`,Cx=!1,wx=!1,Tx={init:()=>{ux({dsn:xx||bx,beforeBreadcrumb:Dx,beforeSend:Ex,debug:nd.getItem(`sentry_debug`)===`true`,denyUrls:[/extensions\//i,/^chrome:\/\//i],maxBreadcrumbs:50,release:`79fa72f947ce3bb0674e52c616bad1c425fff019`,tracesSampleRate:0,allowUrls:Sx?null:[/https:\/\/((.*)\.)?odysee\.(com|tv)/]}),Cx=!0},setState:e=>{wx=e},log:(e,t,n)=>new Promise(r=>{Cx&&wx?eh(i=>{n&&i.setTransactionName(n),r(typeof e==`string`?e_(e,Ox(t)):$g(e,Ox(t)))}):r(null)})};function Ex(e,t){try{let t=e.exception?.values||[],n=t[0]?.value||``;if(n.includes(`NO_TARGET`)||n.includes(`DESTROYED`)||/[._]result\.default|reading 'default'|_result is undefined|evaluating.*_result|ChunkLoadError|dynamically imported module|Importing a module script failed|Unable to preload CSS|Lazy element type must resolve|Received a promise that resolves to: undefined|Minified React error #306|undefined is not an object \(evaluating '\$?\w+\.(use[A-Z]|jsxs?|jsxDEV|Fragment|createElement|cloneElement|forwardRef|memo)/i.test(n))return null;let r=t[0]?.stacktrace?.frames||[],i=r[r.length-1];if(i?.filename&&i.filename.match(/([a-z]*)-extension:\/\//))return null;r.length>0&&r.every(e=>e.filename===`<anonymous>`)&&(e.fingerprint=[`all-anonymous-frames`])}catch{}return e}function Dx(e,t){return e}function Ox(e){if(e&&e.tags){let t=Object.keys(e.tags);for(let n=0;n<t.length;++n){let r=t[n];r.startsWith(`_`)||(e.tags[`_${r}`]=e.tags[r],delete e.tags[r])}}return e}var kx=`https://watchman.na-backend.odysee.com/reports/playback`,Ax=10,jx=!1,Mx=0,Nx=0,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx;async function Ux(){if(!Fx)return`Can only be used with a user id`;if(!Rx)return`Video player not initialized`;let e=new Date().getTime()-Hx;Hx=new Date;let t,n=Rx.engine||Rx._hls;Px===`application/x-mpegURL`&&!Bx?(t=`hls`,zx=n?.levels?.[n.currentLevel]?.bitrate):Bx?(t=`lvs`,zx=n?.levels?.[n.currentLevel]?.bitrate):t=`stb`;let r=typeof Rx.currentTime==`function`?Rx.currentTime():Rx.currentTime,i=typeof Rx.duration==`function`?Rx.duration():Rx.duration,a=Bx?0:Rx&&Math.round(r)*1e3,o=Bx?0:Rx&&Math.round(i);Nx>e&&(Nx=e),await qx({rebuf_count:Mx,rebuf_duration:Nx,url:Ix.replace(`lbry://`,``),device:`web`,duration:e,protocol:t,player:Lx,user_id:Fx.toString(),position:Bx?0:Math.round(a),rel_position:Bx?0:Math.round(a/(o*1e3)*100),bitrate:zx,bandwidth:void 0,...Vx?{preview:!0}:{}}),Mx=0,Nx=0}var Wx;function Gx(){clearInterval(Wx),Wx=null}function Kx(){Wx||(Hx=new Date,jx&&(Wx=setInterval(Ux,1e3*Ax)))}async function qx(e){try{return await fetch(kx,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(e)})}catch{}}var Jx={setState:e=>{jx=e},videoIsPlaying:(e,t)=>
5{let n=!1;t&&t.seeking!==void 0&&(n=typeof t.seeking==`function`?t.seeking():t.seeking),!e&&!n?(Ux(),Gx()):!e&&n?(Ux(),Gx(),Kx()):e&&n||e&&!n&&Kx()},videoBufferEvent:async(e,t)=>{Mx+=1,Nx+=t.bufferDuration},videoStartEvent:(e,t,n,r,i,a,o,s,c)=>{Fx=r,Ix=i,Lx=n,Bx=s,Vx=!!c,Px=typeof a.currentSource==`function`?a.currentSource().type:a.currentSrc?.type||`application/x-mpegURL`,Rx=a,zx=o,!s&&Yx(`time_to_start`,t,Lx)},onDispose:()=>{Gx()}};function Yx(e,t,n){if(jx){let r=new URL(we+`/metric/ui`),i={name:e,value:t?t.toString():``,player:n};return r.search=new URLSearchParams(i).toString(),fetch(r,{method:`post`}).catch(function(e){})}}var Xx=!0,Zx=!1,Qx={init:()=>{Tx.init()},setState:e=>{Zx=e,Qx.apiLog.setState(Zx),Qx.event.setState(Zx),Qx.video.setState(Zx),Tx.setState(Zx)},apiLog:px,event:vx,video:Jx,error:e=>Qx.apiLog.desktopError(e),log:(e,t,n)=>Tx.log(e,{...t},n),sentryError:(e,t)=>new Promise(n=>{Zx&&Xx?eh(r=>{r.setExtras(t),r.setTag(`_origin`,`react-error-boundary`),r.setLevel(`fatal`),n($g(e))}):n(null)}),setUser:e=>{Qx.event.setUser(e)},toggleThirdParty:e=>{}};Qx.setState(!0);function $x(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(Error(Hf))},e);t.then(e=>{clearTimeout(i),n(e)},e=>{clearTimeout(i),r(e)})})}var eS=i(((e,t)=>{t.exports=function(){let e=null,t;function n(e){return e?typeof e==`object`||typeof e==`function`:!1}function r(e){if(e!==null&&!n(e))throw TypeError(`Object prototype may only be an Object or null: `+e)}let i=Object,a=!!i.create||!({__proto__:null}instanceof i),o=i.create||(a?function(e){return r(e),{__proto__:e}}:function(e){if(r(e),e===null)throw SyntaxError(`Native Object.create is required to create objects with null prototype`);var t=(function(){});return t.prototype=e,new t}),s=function(){return null},c=i.getPrototypeOf||([].__proto__===Array.prototype?function(e){let t=e.__proto__;return n(t)?t:null}:s);return t=function(l,u){if((this&&this instanceof t?this.constructor:void 0)===void 0)throw TypeError(`Constructor Proxy requires 'new'`);if(!n(l)||!n(u))throw TypeError(`Cannot create proxy with a non-object as target or handler`);let d=function(){};e=function(){l=null,d=function(e){throw TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}},setTimeout(function(){e=null},0);let f=u;u={get:null,set:null,apply:null,construct:null};for(let e in f){if(!(e in u))throw TypeError(`Proxy polyfill does not support trap '${e}'`);u[e]=f[e]}typeof f==`function`&&(u.apply=f.apply.bind(f));let p=c(l),m,h=!1,g=!1;typeof l==`function`?(m=function(){let e=this&&this.constructor===m,t=Array.prototype.slice.call(arguments);return d(e?`construct`:`apply`),e&&u.construct?u.construct.call(this,l,t):!e&&u.apply?u.apply(l,this,t):e?(t.unshift(l),new(l.bind.apply(l,t))):l.apply(this,t)},h=!0):l instanceof Array?(m=[],g=!0):m=a||p!==null?o(p):{};let _=u.get?function(e){return d(`get`),u.get(this,e,m)}:function(e){return d(`get`),this[e]},v=u.set?function(e,t){d(`set`),u.set(this,e,t,m)}:function(e,t){d(`set`),this[e]=t},y=i.getOwnPropertyNames(l),b={};y.forEach(function(e){if((h||g)&&e in m)return;let t={enumerable:!!i.getOwnPropertyDescriptor(l,e).enumerable,get:_.bind(l,e),set:v.bind(l,e)};i.defineProperty(m,e,t),b[e]=!0});let x=!0;if(h||g){let e=i.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return r(t),e.__proto__=t,e}:s);p&&e(m,p)||(x=!1)}if(u.get||!x)for(let e in l)b[e]||i.defineProperty(m,e,{get:_.bind(l,e)});return i.seal(l),i.seal(m),m},t.revocable=function(n,r){return{proxy:new t(n,r),revoke:e}},t}}));(function(e){e.Proxy||(e.Proxy=eS()(),e.Proxy.revocable=e.Proxy.revocable)})(typeof process<`u`&&{}.toString.call(process)===`[object process]`||typeof navigator<`u`&&navigator.product===`ReactNative`?globalThis:self);var tS=class extends Error{constructor(){super(`Confirm the current price before purchasing this content.`),this.name=`PurchaseConfirmationRequiredError`}};function nS(e){let t=new Set;for(;e?.reposted_claim&&!t.has(e);)t.add(e),e=e.reposted_claim;return e?.value_type===`stream`&&e.value&&!e.error?e:void 0}function rS(e){let t=nS(e);if(!t)return!1;let n=t.value.fee;return n==null||(typeof n.amount==`string`||typeof n.amount==`number`)&&String(n.amount).trim()!==``&&Number(n.amount)===0}function iS(e){let t=nS(e),n=t?.value.fee,r=Number(n?.amount);if(!(!t?.claim_id||![`string`,`number`].includes(typeof n?.amount)||!Number.isFinite(r)||r<=0||![`LBC`,`USD`,`BTC`].includes(n?.currency)||!n?.address))return Object.freeze({claimId:t.claim_id,amount:r,currency:n.currency,address:n.address})}function aS(e){return e.value.tags?.some(e=>[`c:purchase`,`c:rental`,`c:members-only`,`c:unlisted`].includes(e)||e.startsWith(`purchase:`)||e.startsWith(`rental:`))===!0}function oS(e,t){let n=Array.isArray(e)?e[0]:void 0;return!!(n&&(n.target_claim_id===t||n.reference_claim_id===t)&&[`confirmed`,`submitted`].includes(n.status)&&(n.type===`purchase`||n.type===`rental`&&new Date(n.valid_through).getTime()>Date.now()))}function sS(e){let t=new Map;return async(n,r)=>{let i=e.getContext(),a=nS((await e.resolve({urls:[n.uri],include_purchase_receipt:!0,include_is_my_output:!0,...n.wallet_id?{wallet_id:n.wallet_id}:{}}))?.[n.uri]);if(!a?.claim_id||!a.permanent_url)throw new tS;let o=iS(a),s=o&&r&&o.claimId===r.claimId&&o.amount===r.amount&&o.currency===r.currency&&o.address===r.address,c=a.is_my_output===!0||!!a.purchase_receipt?.txid;if(!rS(a)&&!c&&!aS(a)&&!s&&(!o||!await e.hasFiatPurchase(a.claim_id,n.environment).catch(()=>!1)))throw new tS;if(i!==e.getContext())throw Error(`Account changed while loading content. Please try again.`);let l={...n,uri:a.permanent_url},u=s&&!c&&!aS(a),d=JSON.stringify([i,n.wallet_id,u?a.claim_id:l]),f=t.get(d);if(f)return f;let p=e.get(l);t.set(d,p);try{return await p}finally{t.delete(d)}}}var cS=200,lS=[`support_create`],uS={isConnected:!1,connectPromise:null,daemonConnectionString:`http://localhost:5279`,alternateConnectionString:je,methodsUsingAlternateConnectionString:[`txo_list`],methodsWithNoArtificialTimeout:[`txo_list`],apiRequestHeaders:{"Content-Type":`application/json-rpc`},setDaemonConnectionString:e=>{uS.daemonConnectionString=e},setApiHeader:(e,t)=>{uS.apiRequestHeaders=Object.assign(uS.apiRequestHeaders,{[e]:t})},unsetApiHeader:e=>{Object.keys(uS.apiRequestHeaders).includes(e)&&delete uS.apiRequestHeaders[e]},overrides:{},setOverride:(e,t)=>{uS.overrides[e]=t},getApiRequestHeaders:()=>uS.apiRequestHeaders,getMediaType:(e,t)=>{if(t){let e=[[/\.(mp4|m4v|webm|flv|f4v|ogv)$/i,`video`],[/\.(mp3|m4a|aac|wav|flac|ogg|opus)$/i,`audio`],[/\.(jpeg|jpg|png|gif|svg|webp)$/i,`image`],[/\.(h|go|ja|java|js|jsx|c|cpp|cs|css|rb|scss|sh|php|py)$/i,`script`],[/\.(html|json|csv|txt|log|md|markdown|docx|pdf|xml|yml|yaml)$/i,`document`],[/\.(pdf|odf|doc|docx|epub|org|rtf)$/i,`e-book`],[/\.(stl|obj|fbx|gcode)$/i,`3D-file`],[/\.(cbr|cbt|cbz)$/i,`comic-book`],[/\.(lbry)$/i,`application`]].reduce((e,t)=>
5{switch(t[0].test(e)){case!0:return t[1];default:return e}},t);return e===t?`unknown`:e}else if(e)return/^[^/]+/.exec(e)[0];return`unknown`},status:(e={})=>A(`status`,e),stop:()=>A(`stop`,{}),version:()=>A(`version`,{}),resolve:e=>A(`resolve`,e,gS),get:sS({resolve:e=>uS.resolve(e),get:e=>A(`get`,e),getContext:()=>JSON.stringify([uS.daemonConnectionString,uS.apiRequestHeaders]),hasFiatPurchase:async(e,t)=>{let n=uS.apiRequestHeaders[id];if(!n)return!1;let{Lbryio:r}=await qe(async()=>{let{Lbryio:e}=await import(`./lbryinc-DPHS-q40.js`);return{Lbryio:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));return oS(await r.call(`customer`,`list`,{claim_id_filter:e,environment:t,auth_token:n}),e)}}),claim_search:e=>A(`claim_search`,e,_S),claim_list:e=>A(`claim_list`,e),channel_create:e=>A(`channel_create`,e),channel_update:e=>A(`channel_update`,e),channel_import:e=>A(`channel_import`,e),channel_list:e=>A(`channel_list`,e),stream_abandon:e=>A(`stream_abandon`,e),stream_list:e=>A(`stream_list`,e),channel_abandon:e=>A(`channel_abandon`,e),channel_sign:e=>A(`channel_sign`,e),support_create:e=>A(`support_create`,e),support_list:e=>A(`support_list`,e),stream_repost:e=>A(`stream_repost`,e),collection_resolve:e=>A(`collection_resolve`,e),collection_list:e=>A(`collection_list`,e),collection_create:e=>A(`collection_create`,e),collection_update:e=>A(`collection_update`,e),file_list:(e={})=>A(`file_list`,e),file_delete:(e={})=>A(`file_delete`,e),file_set_status:(e={})=>A(`file_set_status`,e),blob_delete:(e={})=>A(`blob_delete`,e),blob_list:(e={})=>A(`blob_list`,e),file_reflect:(e={})=>A(`file_reflect`,e),wallet_balance:(e={})=>A(`wallet_balance`,e),wallet_decrypt:()=>A(`wallet_decrypt`,{}),wallet_encrypt:(e={})=>A(`wallet_encrypt`,e),wallet_unlock:(e={})=>A(`wallet_unlock`,e),wallet_list:(e={})=>A(`wallet_list`,e),wallet_send:(e={})=>A(`wallet_send`,e),wallet_status:(e={})=>A(`wallet_status`,e),address_is_mine:(e={})=>A(`address_is_mine`,e),address_unused:(e={})=>A(`address_unused`,e),address_list:(e={})=>A(`address_list`,e),transaction_list:(e={})=>A(`transaction_list`,e),utxo_release:(e={})=>A(`utxo_release`,e),support_abandon:(e={})=>A(`support_abandon`,e),purchase_list:(e={})=>A(`purchase_list`,e),txo_list:(e={})=>A(`txo_list`,e),account_list:(e={})=>A(`account_list`,e),account_set:(e={})=>A(`account_set`,e),sync_hash:(e={})=>A(`sync_hash`,e),sync_apply:(e={})=>A(`sync_apply`,e),preference_get:(e={})=>A(`preference_get`,e),preference_set:(e={})=>A(`preference_set`,e),comment_list:(e={})=>A(`comment_list`,e),comment_create:(e={})=>A(`comment_create`,e),comment_hide:(e={})=>A(`comment_hide`,e),comment_abandon:(e={})=>A(`comment_abandon`,e),comment_update:(e={})=>A(`comment_update`,e),ffmpeg_find:(e={})=>A(`ffmpeg_find`,e),settings_get:e=>A(`settings_get`,e),settings_set:e=>A(`settings_set`,e),settings_clear:e=>A(`settings_clear`,e),connect:()=>(uS.connectPromise===null&&(uS.connectPromise=new Promise((e,t)=>{let n=0;function r(){n+=1,uS.status().then(e).catch(()=>{n<=cS?setTimeout(r,n<50?400:1e3):t(Error(`Unable to connect to LBRY`))})}r()})),uS.connectPromise),publish:(e={})=>new Promise((t,n)=>{uS.overrides.publish?uS.overrides.publish(e).then(t,n):mS(`publish`,e,t,n)})},dS={MAX_FAILED_ATTEMPTS:5,MAX_FAILED_GAP_MS:500,BLOCKED_DURATION_MS:6e4,METHODS_TO_LOG:[`claim_search`],failureTimestamps:{},logFailure:function(e,t,n){if(this.isListedMethod(e)){let r=this.getKey(e,t),i=this.failureTimestamps[r]||[];i.push(n),this.failureTimestamps[r]=i}},logSuccess:function(e,t){if(this.isListedMethod(e)){let n=this.getKey(e,t);delete this.failureTimestamps[n]}},isFailingAndShouldDrop:function(e,t){if(this.isListedMethod(e)){let n=this.getKey(e,t),r=this.failureTimestamps[n];if(r&&r.length>this.MAX_FAILED_ATTEMPTS){let e=r[r.length-1];return e-r[r.length-this.MAX_FAILED_ATTEMPTS]<this.MAX_FAILED_GAP_MS&&Date.now()-e<this.BLOCKED_DURATION_MS}}return!1},getKey:function(e,t){return e+`/`+JSON.stringify(t||{})},isListedMethod:function(e){return this.METHODS_TO_LOG.includes(e)}};function fS(e,t){if(typeof t==`object`)switch(t.status){case 504:case 524:switch(e){case`publish`:return D(`[Publish]: Your action timed out, but may have been completed. Refresh and check your Uploads or Wallet page to confirm after a few minutes.`);default:return`${e}: ${t.statusText} (${t.status})`}default:return`${e}: ${t.statusText} (${t.status})`}else if(t===`promise timeout`)return`${e}: ${Vf}`;else return`${e}: fetch failed.`}function pS(e,t){if(!e.ok){let n=fS(t,e);throw Error(n)}return e.status>
5=200&&e.status<300?e.json():e.json().then(e=>{if(e.error){let t=typeof e.error==`object`?e.error.message:e.error;return Promise.reject(Error(t))}else return Promise.reject(Error(`Protocol error with unknown response signature`))}).catch(()=>Promise.reject(Error(`${t}: ${e.statusText} (${e.status}, JSON)`)))}function mS(e,t,n,r){let i=uS.apiRequestHeaders;t&&t.no_auth&&(i=Object.assign({},uS.apiRequestHeaders),delete i[id],delete t[ad]);let a=new Date().getTime(),o={method:`POST`,headers:i,body:JSON.stringify({jsonrpc:`2.0`,method:e,params:t,id:a})};if(dS.isFailingAndShouldDrop(e,t))return Promise.reject(`Dropped due to successive failures.`);let s=`${uS.methodsUsingAlternateConnectionString.includes(e)?uS.alternateConnectionString:uS.daemonConnectionString}?m=${e}`,c=6e4;return(uS.methodsWithNoArtificialTimeout.includes(e)?fetch(s,o):$x(c,fetch(s,o))).then(t=>pS(t,e)).then(i=>{let o=i.error||i.result&&i.result.error;return o?(dS.logFailure(e,t,a),r(o)):(dS.logSuccess(e,t),n(i.result))}).catch(n=>{dS.logFailure(e,t,a),n?.message===`promise timeout`?(lS.includes(e)&&Qx.error(`${e}: timed out after ${c/1e3}s`),r(fS(e,Hf))):r(n)})}function A(e,t={},n=null){return new Promise((r,i)=>{mS(e,n?n(t):t,e=>{r(e)},i)})}var j=new Proxy(uS,{get(e,t){return t in e?e[t]:(e={})=>new Promise((n,r)=>{mS(t,e,n,r)})}}),hS=[`include_purchase_receipt`,`include_is_my_output`];function gS(e){return hS.some(t=>e.hasOwnProperty(t))?e:{...e,[ad]:!0}}function _S(e){let t=gS(e),n=2047,r=t.not_channel_ids;r&&r.length>n&&(t.not_channel_ids=r.slice(0,n));let i=t.claim_ids;return i&&i.length>n&&(t.claim_ids=i.slice(0,n)),t}var M={enabled:!0,authenticationPromise:null,exchangePromise:null,exchangeLastFetched:null,CONNECTION_STRING:`https://api.lbry.com/`},vS=1200*1e3,yS=`internal_apis_down`;M.setLocalApi=e=>{M.CONNECTION_STRING=e.replace(/\/*$/,`/`)},M.call=(e,t,n={},r=`post`)=>{if(!M.enabled)return Promise.reject(Error(D(`LBRY internal API is disabled`)));if(!(r===`get`||r===`post`))return Promise.reject(Error(D(`Invalid method`)));function i(n){if(n.status>=200&&n.status<300)return n.json();if(n.status===500)return e===`membership_v2`&&t===`update`?n.json().then(e=>e?.error?.match(/.*Duplicate entry.*membership_v2.idx_user_publish_name_unique'/)?Promise.reject(`Please try a different tier name, something you haven't used before on prior (even deleted memberships).`):Promise.reject(yS)):Promise.reject(yS);if(n)return n.json().then(e=>{let t;return t=e.error?Error(e.error):e.success===!1&&e.data?Error(e.data):Error(`Unknown API error signature`),t.response=n,Promise.reject(t)})}function a(e,t){return fetch(e,t).then(i)}return M.getAuthToken().then(i=>{let o={auth_token:i,...n};Object.keys(o).forEach(e=>{let t=o[e];typeof t==`object`&&(o[e]=JSON.stringify(t))});let s=new URLSearchParams(o).toString(),c=`${M.CONNECTION_STRING}${e}/${t}?${s}`,l={method:`GET`};return r===`post`&&(l={method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:s},c=`${M.CONNECTION_STRING}${e}/${t}`),a(c,l).then(r=>(bS(e,t,n),r.data)).catch(e=>{throw e})})},M.authToken=null,M.getAuthToken=()=>new Promise(e=>{if(M.authToken)e(M.authToken);else if(M.overrides.getAuthToken)M.overrides.getAuthToken().then(t=>{e(t)});else if(typeof window<`u`){let{store:t}=window;if(t){let n=t.getState(),r=n.auth?n.auth.authToken:null;M.authToken=r,e(r)}e(null)}else e(null)}),M.getCurrentUser=()=>M.call(`user`,`me`),M.authenticate=(e,t)=>{if(!M.enabled){let e={id:1,primary_email:`[email protected]`,has_verified_email:!0,is_identity_verified:!0,is_reward_approved:!1,language:t||`en`};return new Promise(t=>{t(e)})}return M.authenticationPromise===null&&(M.authenticationPromise=new Promise((n,r)=>{M.getAuthToken().then(e=>!e||e.length>60?!1:M.getCurrentUser().then(e=>e).catch(e=>{if(e===yS)throw Error(`Internal APIS down`);return!1})).then(n=>n||j.status().then(n=>new Promise((r,i)=>{let a=e&&e!==`lbry.tv`?(e.replace(/[.]/gi,``)+n.installation_id).slice(0,66):n.installation_id;M.call(`user`,`new`,{auth_token:``,language:t||`en`,app_id:a},`post`).then(e=>{if(!e.auth_token)throw Error(`auth_token was not set in the response`);let{store:t}=window;return M.overrides.setAuthToken&&M.overrides.setAuthToken(e.auth_token),t&&t.dispatch({type:Su,data:{authToken:e.auth_token}}),M.authToken=e.auth_token,r(e)}).catch(e=>i(e))})).then(e=>e||M.getCurrentUser())).then(n,r)})),M.authenticationPromise},M.getStripeToken=()=>M.CONNECTION_STRING.startsWith(`http://localhost:`)?`pk_test_NoL1JWL7i1ipfhVId5KfDZgo`:`pk_live_e8M4dRNnCCbmpZzduEUZBgJO`,M.getExchangeRates=()=>((!M.exchangeLastFetched||Date.now()-M.exchangeLastFetched>vS)&&(M.exchangePromise=new Promise((e,t)=>
5{M.call(`lbc`,`exchange_rate`,{},`post`,!0).then(({lbc_usd:t,lbc_btc:n,btc_usd:r})=>{e({LBC_USD:t,LBC_BTC:n,BTC_USD:r})}).catch(t)}),M.exchangeLastFetched=Date.now()),M.exchangePromise),M.overrides={},M.setOverride=(e,t)=>{M.overrides[e]=t};function bS(e,t,n){switch(e){case`customer`:t===`tip`&&Qx.event.report(`spend_virtual_currency`,{value:n.amount,virtual_currency_name:n.currency.toLowerCase(),item_name:`tip`});break;default:break}}var xS=3600*1e3;function SS(){return e=>{e({type:Js}),M.call(`file`,`list_blocked`,{auth_token:``,with_claim_id:1},`get`).then(t=>{let n={};t&&t.map(e=>{n[e.claim_id]={tag_name:e.tag_name}}),e({type:$c,data:{blackListedData:n,success:!0}})},({message:t})=>{e({type:mu,data:{error:t,success:!1}})})}}function CS(){return e=>{e(SS()),setInterval(()=>e(SS()),xS)}}var wS=3600*1e3;function TS(){return e=>{e({type:wo}),M.call(`file`,`list_filtered`,{auth_token:``,with_claim_id:1},`get`).then(t=>{let n={};t&&t.map(e=>{n[e.claim_id]={tag_name:e.tag_name}}),e({type:fi,data:{filteredData:n}})},({error:t})=>{e({type:Au,data:{error:t}})})}}function ES(){return e=>{e(TS()),setInterval(()=>e(TS()),wS)}}var DS=300*1e3,OS=100,kS=e=>t=>(t({type:Ac}),M.call(`file`,`view_count`,{claim_id:e}).then(n=>{t({type:dl,data:{claimIdCsv:e,viewCounts:n}})}).catch(e=>{t({type:Bl,data:e})})),AS=e=>(t,n)=>{let r=n().stats.subCountLastFetchedById,i=Date.now(),a=e.split(`,`).filter(e=>{let t=r[e];return!t||i-t>DS});if(a.length!==0)return t({type:qo}),M.call(`subscription`,`sub_count`,{claim_id:a.join(`,`)}).then(e=>{t({type:Xi,data:{claimIds:a,subCounts:e,fetchDate:i}})}).catch(e=>{t({type:Mo,data:e})})},jS,MS=``,NS=e=>t=>{jS&&clearTimeout(jS),MS&&!MS.endsWith(`,`)&&(MS+=`,`),MS+=e,jS=setTimeout(()=>{t(AS(MS)),MS=``},OS)},PS={COMMENT:`comment`,COMMENT_REPLY:`comment-reply`,CREATOR_COMMENT:`creator_comment`,FIAT_TIP:`fiat_tip`,NEW_CONTENT:`new_content`,NEW_LIVESTREAM:`new_livestream`,NEW_MEMBER:`new_member`,WEEKLY_WATCH_REMINDER:`weekly_watch_reminder`,DAILY_WATCH_AVAILABLE:`daily_watch_available`,DAILY_WATCH_REMIND:`daily_watch_remind`,MISSED_OUT:`missed_out`,REWARDS_APPROVAL_PROMPT:`rewards_approval_prompt`,CREATOR_SUBSCRIBER:`creator_subscriber`},FS=/^@\w+/gm,IS=/: .+$/gm,LS=e=>e.notifications||Sn,RS=e=>LS(e).notifications,zS=e=>LS(e).notificationsFiltered,BS=e=>LS(e).notificationCategories,VS=e=>LS(e).debugLog,HS=e=>a(RS,t=>t&&t.find(t=>t.notification_parameters&&t.notification_parameters.dynamic&&t.notification_parameters.dynamic.hash===e)),US=e=>LS(e).fetchingNotifications,WS=a(RS,e=>e?e.filter(e=>!e.is_read).length:0),GS=a(RS,e=>e?e.filter(e=>!e.is_seen).length:0),KS=a(LS,e=>{if(e.toasts.length){let{id:t,params:n}=e.toasts[e.toasts.length-1];return{id:t,...n}}return null}),qS=e=>LS(e).toasts.length,JS=a(LS,e=>{if(e.errors.length){let{error:t}=e.errors[0];return{error:t}}return null});function N(e){if(!e)throw Error(`'params' object is required to create a toast notification`);let t=e.message||``,n=e.subMessage||``;return/pending-/.test(t)||/pending-/.test(n)?{type:`NOOP`}:{type:Da,data:{id:Ke(),params:e}}}function YS(){return{type:Xo}}function XS(e){return{type:Uc,data:{error:e}}}function ZS(){return{type:Fo}}function QS(e,t=!0){return async n=>{n({type:Ds});let r={is_app_readable:!0};e&&(r.type=e.join(`,`));try{return M.call(`notification`,`list`,r).then(r=>{let i=r||[];t&&n(XG(i.filter(e=>!!(e.notification_parameters.dynamic&&e.notification_parameters.dynamic.comment_author||e.notification_rule===PS.NEW_CONTENT)).map(e=>e.notification_rule===PS.NEW_CONTENT?e.notification_parameters.device.target:e.notification_parameters.dynamic.comment_author),!0)),n({type:Gl,data:{newNotifications:i,filterRule:!!e}})})}catch(e){n({type:Fc,data:{error:e}})}}}function $S(){return async(e,t)=>{if(!BS(t())){let t=await M.call(`notification`,`categories`);t&&e({type:uu,data:{notificationCategories:t.slice().reverse()}})}}}var eC=e=>e.filter(e=>!e.is_read).map(e=>e.id),tC=e=>e.filter(e=>!e.is_seen).map(e=>e.id);function nC(e){return(t,n)=>{let r=n(),i=RS(r),a=zS(r);if(!i||!a)return;let o;return o=e&&Array.isArray(e)&&e.length!==0?e:Array.from(new Set([...eC(i),...eC(a)])),t({type:Us}),M.call(`notification`,`edit`,{notification_ids:o.join(`,`),is_read:!0}).then(()=>{t({type:Cl,data:{notificationIds:o}})}).catch(e=>{t({type:eu,data:{error:e}})})}}function rC(e){return t=>(t({type:Xs}),M.call(`notification`,`edit`,{notification_ids:e.join(`,`),is_seen:!0}).then(()=>{t({type:tl,data:{notificationIds:e}})}).catch(e=>{t({type:_u,data:{error:e}})}))}function iC(){return(e,t)=>{let n=t(),r=RS(n),i=zS(n);!r||!i||e(rC(Array.from(new Set([...tC(r),...tC(i)]))))}}function aC(e){return t=>{M.call(`notification`,`delete`,{notification_ids:e}).then(()=>{t({type:gl,data:{notificationId:e}})}).catch(()=>{t(N({isError:!0,message:D(`Unable to delete this right now. Please try again later.`)}))})}}function oC(e,t){return(n,r)=>{n({type:t?ic:Jr,data:e})}}function sC(){return{type:co,data:{clear:!0}}}
5var cC={INVALID_CHANNEL_AGE:`INVALID_CHANNEL_AGE`},lC=Object.freeze([{originalMsg:/^your user name (.*) is too close to the creator's user name (.*) and may cause confusion. Please use another identity.$/,replacement:`Your user name "%1%" is too close to the creator's user name "%2%" and may cause confusion. Please use another identity.`},{originalMsg:/^Slow mode is on. Please wait at most (.*) seconds before commenting again.$/,replacement:`Slow mode is on. Please wait up to %1% seconds before commenting again.`},{originalMsg:/^the comment contents are blocked by (.*)$/,replacement:`The comment contains contents that are blocked by %1%.`},{originalMsg:`channel is blocked by publisher`,replacement:`Unable to comment. This channel has blocked you.`},{originalMsg:`channel is not allowed to post comments`,replacement:`Unable to comment. Your channel has been blocked by an admin.`},{originalMsg:`comments are disabled by the creator`,replacement:`Unable to comment. The content owner has disabled comments.`},{originalMsg:`duplicate comment!`,replacement:`Please do not spam.`},{originalMsg:/^this creator has set minimum account age requirements that are not currently met: (.*) minutes$/,replacement:`Your channel does not meet the creator's minimum channel-age limit of %duration%.`,type:cC.INVALID_CHANNEL_AGE},{originalMsg:/^You only watched content (.*) days in the last week and it needs to be at least (.*) to get the credit.$/,replacement:`You only watched content for %1% days in the last week. It needs to be at least %2% to get the credit.`},{originalMsg:`Not enough funds to cover this transaction.`,replacement:`Insufficient credits to account for transaction fees.`}]);function uC(e=``){for(let t=0;t<lC.length;++t){let n=lC[t];if(typeof n.originalMsg==`string`){if(n.originalMsg===e)return D(n.replacement)}else{let t=e.match(n.originalMsg);if(t){if(n.type===cC.INVALID_CHANNEL_AGE)return D(n.replacement,{duration:sd(parseInt(t[1])*60)});let e={};for(let n=1;n<t.length;++n)e[`${n}`]=t[n];return D(n.replacement,e)}}}return D(e)}function dC(e){var t=e.toString().split(`.`);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,`,`),t.join(`.`)}function fC(e,t,n=!1){let r=parseFloat(String(e)),i=t,a=``;return Number.isNaN(r)||r===0?`0`:(r>=1e6?t<=7&&(n?(r/=1e6,a=`M`):i-=7):r>=1e3&&t<=4&&(n?(r/=1e3,a=`K`):i-=4),dC(r.toFixed(i>=0?i:1).replace(/\.*0+$/,``))+a)}function pC(e,t=1){let n=``,r=e.toString().split(`.`),i=r[1];if(i){let e=i.split(``),r=e.filter(e=>e!==`0`)[0],a=e.indexOf(r);n=`.${i.substring(0,a+t)}`}return parseFloat(r[0]+n)}function mC(e){return parseFloat(String(e)).toFixed(8)}function hC(e,t=2){let n=Number(e),r=10**(-1*t);return n>0&&n<r?`<${r}`:fC(e,t,!0)}function gC(e,t,n=``,r=`default`,i=!0){return e(N({message:t,subMessage:n||void 0,duration:r,isError:i}))}function _C(e,t){return gC(e,D(`Unable to verify signature.`),t)}function vC(e,t){console.error(t),e(N({isError:!0,message:`DEV: ${t}`}))}var yC=e=>e.app||Sn,bC=e=>yC(e).platform,xC=a(bC,e=>{switch(e){case`darwin`:return`https://lbry.com/get/lbry.dmg`;case`linux`:return`https://lbry.com/get/lbry.deb`;case`win32`:return`https://lbry.com/get/lbry.exe`;default:throw Error(`Unknown platform`)}});a(bC,e=>yC(e).remoteVersion,(e,t)=>{switch(e){case`darwin`:return`LBRY_${t}.dmg`;case`linux`:return`LBRY_${t}.deb`;case`win32`:return`LBRY_${t}.exe`;default:throw Error(`Unknown platform`)}});var SC=e=>yC(e).downloadProgress,CC=e=>yC(e).upgradeDownloadCompleted,wC=e=>yC(e).downloadPath,TC=e=>yC(e).downloadItem,EC=e=>yC(e).volume,DC=e=>yC(e).muted,OC=e=>yC(e).checkUpgradeTimer,kC=a(e=>yC(e).modal,e=>yC(e).modalProps,(e,t)=>e?{id:e,modalProps:t}:null),AC=e=>yC(e).searchOptionsExpanded,jC=e=>yC(e).hasNavigated,MC=e=>yC(e).allowAnalytics,NC=e=>yC(e).currentScroll,PC=e=>yC(e).interestedInYoutubeSync,FC=e=>yC(e).activeChannel,IC=a(e=>$n(e,FC(e)),e=>Rt(e),kc,Qt,(e,t,n,r)=>!t||r===null?null:!r||!r.length?void 0:e||n||r.slice().sort((e,t)=>{let n=e.meta&&Number(e.meta.effective_amount)||0,r=t.meta&&Number(t.meta.effective_amount)||0;return n===r?0:n>r?-1:1})[0]),LC=e=>{let t=IC(e);return t&&t.claim_id},RC=e=>yC(e).incognito,zC=e=>yC(e).appDrawerOpen,BC=e=>yC(e).mainPlayerDimensions,VC=e=>yC(e).videoSourceLoaded,HC=e=>!!zC(e),UC=e=>yC(e).assignedLbrynetServer,WC=(e,t)=>zC(e)===t,GC=(e,t)=>VC(e)===t,KC=Object.create,qC=Object.defineProperty,JC=Object.getOwnPropertyDescriptor,YC=Object.getOwnPropertyNames,XC=Object.getPrototypeOf,ZC=Object.prototype.hasOwnProperty,QC=(e,t)=>function(){return t||(0,e[YC(e)[0]])((t={exports:{}}).exports,t),t.exports},$C=(e,t)=>{for(var n in t)qC(e,n,{get:t[n],enumerable:!0})},ew=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of YC(t))!ZC.call(e,i)&&i!==n&&qC(e,i,{get:()=>t[i],enumerable:!(r=JC(t,i))||r.enumerable});return e},tw=(e,t,n)=>(n=e==null?{}:KC(XC(e)),ew(t||!e||!e.__esModule?qC(n,`default`,{value:e,enumerable:!0}):n,e)),nw=QC({"node_modules/obliterator/iterator.js"(e,t){function n(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){return new n(function(){return{done:!0}})},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e==`object`&&!!e&&typeof e.next==`function`}
5,t.exports=n}}),rw=QC({"node_modules/obliterator/support.js"(e){e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`}}),iw=QC({"node_modules/obliterator/foreach.js"(e,t){var n=rw(),r=n.ARRAY_BUFFER_SUPPORT,i=n.SYMBOL_SUPPORT;t.exports=function(e,t){var n,a,o,s,c;if(!e)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof t!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(e)||r&&ArrayBuffer.isView(e)||typeof e==`string`||e.toString()===`[object Arguments]`){for(o=0,s=e.length;o<s;o++)t(e[o],o);return}if(typeof e.forEach==`function`){e.forEach(t);return}if(i&&Symbol.iterator in e&&typeof e.next!=`function`&&(e=e[Symbol.iterator]()),typeof e.next==`function`){for(n=e,o=0;c=n.next(),c.done!==!0;)t(c.value,o),o++;return}for(a in e)e.hasOwnProperty(a)&&t(e[a],a)}}}),aw=QC({"node_modules/mnemonist/utils/typed-arrays.js"(e){var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}}}),ow=QC({"node_modules/mnemonist/utils/iterables.js"(e){var t=iw(),n=aw();function r(e){return Array.isArray(e)||n.isTypedArray(e)}function i(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function a(e){var n=i(e),r=typeof n==`number`?Array(n):[],a=0;return t(e,function(e){r[a++]=e}),r}function o(e){var r=i(e),a=typeof r==`number`?n.getPointerArray(r):Array,o=typeof r==`number`?Array(r):[],s=typeof r==`number`?new a(r):[],c=0;return t(e,function(e){o[c]=e,s[c]=c++}),[o,s]}e.isArrayLike=r,e.guessLength=i,e.toArray=a,e.toArrayWithIndices=o}}),sw=QC({"node_modules/mnemonist/lru-cache.js"(e,t){var n=nw(),r=iw(),i=aw(),a=ow();function o(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!=`number`||this.capacity<=0)throw Error(`mnemonist/lru-cache: capacity should be positive number.`);if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error(`mnemonist/lru-cache: capacity should be a finite positive integer.`);var r=i.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K=typeof e==`function`?new e(n):Array(n),this.V=typeof t==`function`?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items={}}o.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},o.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var n=this.backward[e],r=this.forward[e];return this.tail===e?this.tail=n:this.backward[r]=n,this.forward[n]=r,this.backward[t]=e,this.head=e,this.forward[e]=t,this},o.prototype.set=function(e,t){var n=this.items[e];if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],delete this.items[this.K[n]]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},o.prototype.setpop=function(e,t){var n=null,r=null,i=this.items[e];return i===void 0?(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],delete this.items[r]),this.items[e]=i,this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},o.prototype.has=function(e){return e in this.items},o.prototype.get=function(e){var t=this.items[e];if(t!==void 0)return this.splayOnTop(t),this.V[t]},o.prototype.peek=function(e){var t=this.items[e];if(t!==void 0)return this.V[t]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=0,r=this.size,i=this.head,a=this.K,o=this.V,s=this.forward;n<r;)e.call(t,o[i],a[i],this),i=s[i],n++},o.prototype.keys=function(){var e=0,t=this.size,r=this.head,i=this.K,a=this.forward;return new n(function(){if(e>=t)return{done:!0};var n=i[r];return e++,e<t&&(r=a[r]),{done:!1,value:n}})},o.prototype.values=function(){var e=0,t=this.size,r=this.head,i=this.V,a=this.forward;return new n(function(){if(e>=t)return{done:!0};var n=i[r];return e++,e<t&&(r=a[r]),{done:!1,value:n}})},o.prototype.entries=function(){var e=0,t=this.size,r=this.head,i=this.K,a=this.V,o=this.forward;return new n(function(){if(e>=t)return{done:!0};var n=i[r],s=a[r];return e++,e<t&&(r=o[r]),{done:!1,value:[n,s]}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.entries),o.prototype.inspect=function(){for(var e=new Map,t=this.entries(),n;n=t.next(),!n.done;)e.set(n.value[0],n.value[1]);return Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e,t,n,i){if(arguments.length<2){if(i=a.guessLength(e),typeof i!=`number`)throw Error(`mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(i=t,t=null,n=null);var s=new o(t,n,i);return r(e,function(e,t){s.set(t,e)}),s},t.exports=o}}),cw=QC({"node_modules/mnemonist/lru-map.js"(e,t){var n=sw(),r=iw(),i=aw(),a=ow();function o(e,t,n){if(arguments.length<2&&(n=e,e=null,t=null),this.capacity=n,typeof this.capacity!=`number`||this.capacity<=0)throw Error(`mnemonist/lru-map: capacity should be positive number.`);if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error(`mnemonist/lru-map: capacity should be a finite positive integer.`);var r=i.getPointerArray(n);this.forward=new r(n),this.backward=new r(n),this.K=typeof e==`function`?new e(n):Array(n),this.V=typeof t==`function`?new t(n):Array(n),this.size=0,this.head=0,this.tail=0,this.items=new Map}o.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},o.prototype.set=function(e,t){var n=this.items.get(e);if(n!==void 0){this.splayOnTop(n),this.V[n]=t;return}this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],this.items.delete(this.K[n])),this.items.set(e,n),this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n},o.prototype.setpop=function(e,t){var n=null,r=null,i=this.items.get(e);return i===void 0?(this.size<this.capacity?i=this.size++:(i=this.tail,this.tail=this.backward[i],n=this.V[i],r=this.K[i],this.items.delete(r)),this.items.set(e,i),this.K[i]=e,this.V[i]=t,this.forward[i]=this.head,this.backward[this.head]=i,this.head=i,r?{evicted:!0,key:r,value:n}:null):(this.splayOnTop(i),n=this.V[i],this.V[i]=t,{evicted:!1,key:e,value:n})},o.prototype.has=function(e){return this.items.has(e)},o.prototype.get=function(e){var t=this.items.get(e);if(t!==void 0)return this.splayOnTop(t),this.V[t]},o.prototype.peek=function(e){var t=this.items.get(e);if(t!==void 0)return this.V[t]},o.prototype.splayOnTop=n.prototype.splayOnTop,o.prototype.forEach=n.prototype.forEach,o.prototype.keys=n.prototype.keys,o.prototype.values=n.prototype.values,o.prototype.entries=n.prototype.entries,typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.entries),o.prototype.inspect=n.prototype.inspect,o.from=function(e,t,n,i){if(arguments.length<2){if(i=a.guessLength(e),typeof i!=`number`)throw Error(`mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.`)}else arguments.length===2&&(i=t,t=null,n=null);var s=new o(t,n,i);return r(e,function(e,t){s.set(t,e)}),s},t.exports=o}}),lw=QC({"node_modules/ms/index.js"(e,t){var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}}}),uw=QC({"node_modules/debug/src/common.js"(e,t){function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=a,n.enable=i,n.enabled=o,n.humanize=lw(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t,r=(typeof e==`string`?e:``).split(/[\s,]+/),i=r.length;for(t=0;t<i;t++)r[t]&&(e=r[t].replace(/\*/g,`.*?`),e[0]===`-`?n.skips.push(RegExp(`^`+e.slice(1)+`$`)):n.names.push(RegExp(`^`+e+`$`)))}function a(){let e=[...n.names.map(s),...n.skips.map(s).map(e=>`-`+e)].join(`,`);return n.enable(``),e}function o(e){if(e[e.length-1]===`*`)return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,`*`)}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n}}),dw=QC({"node_modules/debug/src/browser.js"(e,t){e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;
5if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t={}.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=uw()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}}}),fw=QC({"node_modules/base64-js/index.js"(e){e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;for(a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;var a,o;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}}}),pw=QC({"node_modules/ieee754/index.js"(e){e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}}}),mw=QC({"node_modules/buffer/index.js"(e){var t=fw(),n=pw(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>
vendor: 20,395 bytes, line 5
5i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(Ae(e,ArrayBuffer)||e&&Ae(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Ae(e,SharedArrayBuffer)||e&&Ae(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(Ae(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||je(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(Ae(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),Ae(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(Ae(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Ae(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return Te(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Oe(e).length;default:if(i)return r?-1:Te(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return le(this,t,n);case`utf8`:case`utf-8`:return ae(this,t,n);case`ascii`:return se(this,t,n);case`latin1`:case`binary`:return ce(this,t,n);case`base64`:return ie(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ue(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?ae(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(Ae(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:o<a?1:0};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,je(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function ee(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(je(r))return o;e[n+o]=r}return o}function w(e,t,n,r){return ke(Te(t,e.length-n),e,n,r)}function te(e,t,n,r){return ke(Ee(t),e,n,r)}function ne(e,t,n,r){return ke(Oe(t),e,n,r)}function re(e,t,n,r){return ke(De(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return ee(this,e,t,n);case`utf8`:case`utf-8`:return w(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return te(this,e,t,n);case`base64`:return ne(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return re(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function ie(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function ae(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return oe(r)}var T=4096;function oe(e){let t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=T));return n}function se(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function ce(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function le(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Me[e[r]];return i}function ue(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function E(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!1,52,8)};function D(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;D(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;D(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function de(e,t,n,r,i){be(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function fe(e,t,n,r,i){be(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=Ne(function(e,t=0){return de(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=Ne(function(e,t=0){return fe(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);D(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=Ne(function(e,t=0){return de(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=Ne(function(e,t=0){return fe(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function pe(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function me(e,t,r,i,a){return t=+t,r>>>=0,a||pe(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return me(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return me(this,e,t,!1,n)};function he(e,t,r,i,a){return t=+t,r>>>=0,a||pe(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return he(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return he(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;
5if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var ge={};function _e(e,t,n){ge[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}_e(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),_e(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),_e(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ve(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ve(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ve(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function ye(e,t,n){xe(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&Se(t,e.length-(n+1))}function be(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new ge.ERR_OUT_OF_RANGE(`value`,i,e)}ye(r,i,a)}function xe(e,t){if(typeof e!=`number`)throw new ge.ERR_INVALID_ARG_TYPE(t,`number`,e)}function Se(e,t,n){throw Math.floor(e)===e?t<0?new ge.ERR_BUFFER_OUT_OF_BOUNDS:new ge.ERR_OUT_OF_RANGE(n||`offset`,`>= ${n?1:0} and <= ${t}`,e):(xe(e,n),new ge.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var Ce=/[^+/0-9A-Za-z-_]/g;function we(e){if(e=e.split(`=`)[0],e=e.trim().replace(Ce,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function Te(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function Ee(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function De(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Oe(e){return t.toByteArray(we(e))}function ke(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Ae(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function je(e){return e!==e}var Me=function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Ne(e){return typeof BigInt>`u`?Pe:e}function Pe(){throw Error(`BigInt not supported`)}}}),hw={"@@functional/placeholder":!0};function gw(e){return e===hw}function _w(e){return function t(n){return arguments.length===0||gw(n)?t:e.apply(this,arguments)}}function vw(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return gw(n)?t:_w(function(t){return e(n,t)});default:return gw(n)&&gw(r)?t:gw(n)?_w(function(t){return e(t,r)}):gw(r)?_w(function(t){return e(n,t)}):e(n,r)}}}function yw(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,i){return t.apply(this,arguments)};case 5:return function(e,n,r,i,a){return t.apply(this,arguments)};case 6:return function(e,n,r,i,a,o){return t.apply(this,arguments)};case 7:return function(e,n,r,i,a,o,s){return t.apply(this,arguments)};case 8:return function(e,n,r,i,a,o,s,c){return t.apply(this,arguments)};case 9:return function(e,n,r,i,a,o,s,c,l){return t.apply(this,arguments)};case 10:return function(e,n,r,i,a,o,s,c,l,u){return t.apply(this,arguments)};default:throw Error(`First argument to _arity must be a non-negative integer no greater than ten`)}}function bw(e,t,n){return function(){for(var r=[],i=0,a=e,o=0,s=!1;o<t.length||i<arguments.length;){var c;o<t.length&&(!gw(t[o])||i>=arguments.length)?c=t[o]:(c=arguments[i],i+=1),r[o]=c,gw(c)?s=!0:--a,o+=1}return!s&&a<=0?n.apply(this,r):yw(Math.max(0,a),bw(e,r,n))}}var xw=vw(function(e,t){return e===1?_w(t):yw(e,bw(e,[],t))});function Sw(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return gw(n)?t:vw(function(t,r){return e(n,t,r)});case 2:return gw(n)&&gw(r)?t:gw(n)?vw(function(t,n){return e(t,r,n)}):gw(r)?vw(function(t,r){return e(n,t,r)}):_w(function(t){return e(n,r,t)});default:return gw(n)&&gw(r)&&gw(i)?t:gw(n)&&gw(r)?vw(function(t,n){return e(t,n,i)}):gw(n)&&gw(i)?vw(function(t,n){return e(t,r,n)}):gw(r)&&gw(i)?vw(function(t,r){return e(n,t,r)}):gw(n)?_w(function(t){return e(t,r,i)}):gw(r)?_w(function(t){return e(n,t,i)}):gw(i)?_w(function(t){return e(n,r,t)}):e(n,r,i)}}}var Cw=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)===`[object Array]`};function ww(e){return e!=null&&typeof e[`@@transducer/step`]==`function`}
5function Tw(e,t,n){return function(){if(arguments.length===0)return n();var r=arguments[arguments.length-1];if(!Cw(r)){for(var i=0;i<e.length;){if(typeof r[e[i]]==`function`)return r[e[i]].apply(r,Array.prototype.slice.call(arguments,0,-1));i+=1}if(ww(r))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(r)}return n.apply(this,arguments)}}function Ew(e){return e&&e[`@@transducer/reduced`]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var Dw={init:function(){return this.xf[`@@transducer/init`]()},result:function(e){return this.xf[`@@transducer/result`](e)}};function Ow(e){for(var t=[],n;!(n=e.next()).done;)t.push(n.value);return t}function kw(e,t,n){for(var r=0,i=n.length;r<i;){if(e(t,n[r]))return!0;r+=1}return!1}function Aw(e){var t=String(e).match(/^function (\w*)/);return t==null?``:t[1]}function jw(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Mw(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Nw=typeof Object.is==`function`?Object.is:Mw,Pw=Object.prototype.toString,Fw=function(){return Pw.call(arguments)===`[object Arguments]`?function(e){return Pw.call(e)===`[object Arguments]`}:function(e){return jw(`callee`,e)}}(),Iw=!{toString:null}.propertyIsEnumerable(`toString`),Lw=[`constructor`,`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],Rw=function(){return arguments.propertyIsEnumerable(`length`)}(),zw=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},Bw=typeof Object.keys==`function`&&!Rw?_w(function(e){return Object(e)===e?Object.keys(e):[]}):_w(function(e){if(Object(e)!==e)return[];var t,n,r=[],i=Rw&&Fw(e);for(t in e)jw(t,e)&&(!i||t!==`length`)&&(r[r.length]=t);if(Iw)for(n=Lw.length-1;n>=0;)t=Lw[n],jw(t,e)&&!zw(r,t)&&(r[r.length]=t),--n;return r}),Vw=_w(function(e){return e===null?`Null`:e===void 0?`Undefined`:Object.prototype.toString.call(e).slice(8,-1)});function Hw(e,t,n,r){var i=Ow(e),a=Ow(t);function o(e,t){return Uw(e,t,n.slice(),r.slice())}return!kw(function(e,t){return!kw(o,t,e)},a,i)}function Uw(e,t,n,r){if(Nw(e,t))return!0;var i=Vw(e);if(i!==Vw(t))return!1;if(typeof e[`fantasy-land/equals`]==`function`||typeof t[`fantasy-land/equals`]==`function`)return typeof e[`fantasy-land/equals`]==`function`&&e[`fantasy-land/equals`](t)&&typeof t[`fantasy-land/equals`]==`function`&&t[`fantasy-land/equals`](e);if(typeof e.equals==`function`||typeof t.equals==`function`)return typeof e.equals==`function`&&e.equals(t)&&typeof t.equals==`function`&&t.equals(e);switch(i){case`Arguments`:case`Array`:case`Object`:if(typeof e.constructor==`function`&&Aw(e.constructor)===`Promise`)return e===t;break;case`Boolean`:case`Number`:case`String`:if(!(typeof e==typeof t&&Nw(e.valueOf(),t.valueOf())))return!1;break;case`Date`:if(!Nw(e.valueOf(),t.valueOf()))return!1;break;case`Error`:return e.name===t.name&&e.message===t.message;case`RegExp`:if(!(e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.sticky===t.sticky&&e.unicode===t.unicode))return!1;break}for(var a=n.length-1;a>=0;){if(n[a]===e)return r[a]===t;--a}switch(i){case`Map`:return e.size===t.size?Hw(e.entries(),t.entries(),n.concat([e]),r.concat([t])):!1;case`Set`:return e.size===t.size?Hw(e.values(),t.values(),n.concat([e]),r.concat([t])):!1;case`Arguments`:case`Array`:case`Object`:case`Boolean`:case`Number`:case`String`:case`Date`:case`Error`:case`RegExp`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`ArrayBuffer`:break;default:return!1}var o=Bw(e);if(o.length!==Bw(t).length)return!1;var s=n.concat([e]),c=r.concat([t]);for(a=o.length-1;a>=0;){var l=o[a];if(!(jw(l,t)&&Uw(t[l],e[l],s,c)))return!1;--a}return!0}var Ww=vw(function(e,t){return Uw(e,t,[],[])});function Gw(e,t,n){var r,i;if(typeof e.indexOf==`function`)switch(typeof t){case`number`:if(t===0){for(r=1/t;n<e.length;){if(i=e[n],i===0&&1/i===r)return n;n+=1}return-1}else if(t!==t){for(;n<e.length;){if(i=e[n],typeof i==`number`&&i!==i)return n;n+=1}return-1}return e.indexOf(t,n);case`string`:case`boolean`:case`function`:case`undefined`:return e.indexOf(t,n);case`object`:if(t===null)return e.indexOf(t,n)}for(;n<e.length;){if(Ww(e[n],t))return n;n+=1}return-1}function Kw(e,t){return Gw(t,e,0)>=0}
5function qw(e,t){for(var n=0,r=t.length,i=Array(r);n<r;)i[n]=e(t[n]),n+=1;return i}function Jw(e){return`"`+e.replace(/\\/g,`\\\\`).replace(/[\b]/g,`\\b`).replace(/\f/g,`\\f`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\t/g,`\\t`).replace(/\v/g,`\\v`).replace(/\0/g,`\\0`).replace(/"/g,`\\"`)+`"`}var Yw=function(e){return(e<10?`0`:``)+e},Xw=typeof Date.prototype.toISOString==`function`?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+`-`+Yw(e.getUTCMonth()+1)+`-`+Yw(e.getUTCDate())+`T`+Yw(e.getUTCHours())+`:`+Yw(e.getUTCMinutes())+`:`+Yw(e.getUTCSeconds())+`.`+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+`Z`};function Zw(e){return function(){return!e.apply(this,arguments)}}function Qw(e,t,n){for(var r=0,i=n.length;r<i;)t=e(t,n[r]),r+=1;return t}function $w(e,t){for(var n=0,r=t.length,i=[];n<r;)e(t[n])&&(i[i.length]=t[n]),n+=1;return i}function eT(e){return Object.prototype.toString.call(e)===`[object Object]`}var tT=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype[`@@transducer/init`]=Dw.init,e.prototype[`@@transducer/result`]=Dw.result,e.prototype[`@@transducer/step`]=function(e,t){return this.f(t)?this.xf[`@@transducer/step`](e,t):e},e}();function nT(e){return function(t){return new tT(e,t)}}var rT=vw(Tw([`fantasy-land/filter`,`filter`],nT,function(e,t){return eT(t)?Qw(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{},Bw(t)):$w(e,t)})),iT=vw(function(e,t){return rT(Zw(e),t)});function aT(e,t){var n=function(n){var r=t.concat([e]);return Kw(n,r)?`<Circular>`:aT(n,r)},r=function(e,t){return qw(function(t){return Jw(t)+`: `+n(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case`[object Arguments]`:return`(function() { return arguments; }(`+qw(n,e).join(`, `)+`))`;case`[object Array]`:return`[`+qw(n,e).concat(r(e,iT(function(e){return/^\d+$/.test(e)},Bw(e)))).join(`, `)+`]`;case`[object Boolean]`:return typeof e==`object`?`new Boolean(`+n(e.valueOf())+`)`:e.toString();case`[object Date]`:return`new Date(`+(isNaN(e.valueOf())?n(NaN):Jw(Xw(e)))+`)`;case`[object Map]`:return`new Map(`+n(Array.from(e))+`)`;case`[object Null]`:return`null`;case`[object Number]`:return typeof e==`object`?`new Number(`+n(e.valueOf())+`)`:1/e==-1/0?`-0`:e.toString(10);case`[object Set]`:return`new Set(`+n(Array.from(e).sort())+`)`;case`[object String]`:return typeof e==`object`?`new String(`+n(e.valueOf())+`)`:Jw(e);case`[object Undefined]`:return`undefined`;default:if(typeof e.toString==`function`){var i=e.toString();if(i!==`[object Object]`)return i}return`{`+r(e,Bw(e)).join(`, `)+`}`}}var oT=_w(function(e){return aT(e,[])}),sT=vw(function(e,t){if(e===t)return t;function n(e,t){if(e>t!=t>e)return t>e?t:e}var r=n(e,t);if(r!==void 0)return r;var i=n(typeof e,typeof t);if(i!==void 0)return i===typeof e?e:t;var a=oT(e),o=n(a,oT(t));return o!==void 0&&o===a?e:t}),cT=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype[`@@transducer/init`]=Dw.init,e.prototype[`@@transducer/result`]=Dw.result,e.prototype[`@@transducer/step`]=function(e,t){return this.xf[`@@transducer/step`](e,this.f(t))},e}(),lT=vw(Tw([`fantasy-land/map`,`map`],function(e){return function(t){return new cT(e,t)}},function(e,t){switch(Object.prototype.toString.call(t)){case`[object Function]`:return xw(t.length,function(){return e.call(this,t.apply(this,arguments))});case`[object Object]`:return Qw(function(n,r){return n[r]=e(t[r]),n},{},Bw(t));default:return qw(e,t)}})),uT=Number.isInteger||function(e){return e<<0===e};function dT(e){return Object.prototype.toString.call(e)===`[object String]`}function fT(e,t){var n=e<0?t.length+e:e;return dT(t)?t.charAt(n):t[n]}var pT=vw(function(e,t){if(t!=null)return uT(e)?fT(e,t):t[e]}),mT=vw(function(e,t){return lT(pT(e),t)}),hT=_w(function(e){return Cw(e)?!0:!e||typeof e!=`object`||dT(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),gT=typeof Symbol<`u`?Symbol.iterator:`@@iterator`;function _T(e,t,n){return function(r,i,a){if(hT(a))return e(r,i,a);if(a==null)return i;if(typeof a[`fantasy-land/reduce`]==`function`)return t(r,i,a,`fantasy-land/reduce`);if(a[gT]!=null)return n(r,i,a[gT]());if(typeof a.next==`function`)return n(r,i,a);if(typeof a.reduce==`function`)return t(r,i,a,`reduce`);throw TypeError(`reduce: list must be array or iterable`)}}function vT(e,t,n){for(var r=0,i=n.length;r<i;){if(t=e[`@@transducer/step`](t,n[r]),t&&t[`@@transducer/reduced`]){t=t[`@@transducer/value`];break}r+=1}return e[`@@transducer/result`](t)}var yT=vw(function(e,t){return yw(e.length,function(){return e.apply(t,arguments)})});function bT(e,t,n){for(var r=n.next();!r.done;){if(t=e[`@@transducer/step`](t,r.value),t&&t[`@@transducer/reduced`]){t=t[`@@transducer/value`];break}r=n.next()}return e[`@@transducer/result`](t)}function xT(e,t,n,r){return e[`@@transducer/result`](n[r](yT(e[`@@transducer/step`],e),t))}var ST=_T(vT,xT,bT),CT=function(){function e(e){this.f=e}return e.prototype[`@@transducer/init`]=function(){throw Error(`init not implemented on XWrap`)},e.prototype[`@@transducer/result`]=function(e){return e},e.prototype[`@@transducer/step`]=function(e,t){return this.f(e,t)},e}();function wT(e){return new CT(e)}var TT=Sw(function(e,t,n){return ST(typeof e==`function`?wT(e):e,t,n)});function ET(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function DT(e,t){return function(){var n=arguments.length;if(n===0)return t();var r=arguments[n-1];return Cw(r)||typeof r[e]!=`function`?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}var OT=_w(DT(`tail`,Sw(DT(`slice`,function(e,t,n){return Array.prototype.slice.call(n,e,t)}))(1,1/0)));function kT(){if(arguments.length===0)throw Error(`pipe requires at least one argument`);return yw(arguments[0].length,TT(ET,arguments[0],OT(arguments)))}var AT=vw(function(e,t){return xw(TT(sT,0,mT(`length`,t)),function(){var n=arguments,r=this;return e.apply(r,qw(function(e){return e.apply(r,n)},t))})}),jT=vw(function(e,t){return t==null||t!==t?e:t}),MT=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype[`@@transducer/init`]=Dw.init,e.prototype[`@@transducer/result`]=function(e){return this.found||(e=this.xf[`@@transducer/step`](e,void 0)),this.xf[`@@transducer/result`](e)},e.prototype[`@@transducer/step`]=function(e,t){return this.f(t)&&(this.found=!0,e=Ew(this.xf[`@@transducer/step`](e,t))),e},e}();function NT(e){return function(t){return new MT(e,t)}}var PT=vw(Tw([`find`],NT,function(e,t){for(var n=0,r=t.length;n<r;){if(e(t[n]))return t[n];n+=1}})),FT=_w(function(e){return AT(function(){return Array.prototype.slice.call(arguments,0)},e)});function IT(e,t){for(var n=t,r=0;r<e.length;r+=1){if(n==null)return;var i=e[r];n=uT(i)?fT(i,n):n[i]}return n}var LT=vw(IT),RT=Sw(function(e,t,n){return Ww(e,pT(t,n))}
5),zT=class extends Error{name=`InvalidSchedulerLocation`},BT=class extends Error{name=`SchedulerTagNotFound`},VT=class extends Error{name=`TransactionNotFound`};function HT(e=``){return e=e.trim(),e.endsWith(`/`)?HT(e.slice(0,-1)):e}var UT=(e,{maxRetries:t=0,delay:n=300})=>{let r=(n,i)=>Promise.resolve().then(e).catch(e=>{if(n>=t)return Promise.reject(e);let a=n+1,o=i+i;return new Promise(e=>setTimeout(e,i)).then(()=>r(a,o))});return r(0,n)},WT=e=>{if(e.ok)return e;throw e},GT=`Url`,KT=`Time-To-Live`,qT=`Scheduler`,JT=e=>kT(jT([]),PT(RT(e,`name`)),jT({}),pT(`value`)),YT=e=>kT(t=>{if(!t)throw new VT(e);return t},pT(`tags`),jT([]));function XT({fetch:e,GRAPHQL_URL:t,GRAPHQL_MAX_RETRIES:n=0,GRAPHQL_RETRY_BACKOFF:r=300}){return async({query:i,variables:a})=>UT(()=>e(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:i,variables:a})}).then(WT).then(e=>e.json()),{maxRetries:n,delay:r})}function ZT({fetch:e,GRAPHQL_URL:t,GRAPHQL_MAX_RETRIES:n,GRAPHQL_RETRY_BACKOFF:r}){let i=XT({fetch:e,GRAPHQL_URL:t,GRAPHQL_MAX_RETRIES:n,GRAPHQL_RETRY_BACKOFF:r}),a=QT({fetch:e,GRAPHQL_URL:t,GRAPHQL_MAX_RETRIES:n,GRAPHQL_RETRY_BACKOFF:r});return async t=>await e(`https://su-router.ao-testnet.xyz?process-id=${t}`).then(e=>e.ok?e.json().then(({address:e})=>({url:`https://su-router.ao-testnet.xyz`,ttl:1728e5,address:e})):void 0)||i({query:` 6 query GetTransactions ($transactionIds: [ID!]!) { 7 transactions(ids: $transactionIds) { 8 edges { 9 node { 10 tags { 11 name 12 value 13 } 14 } 15 } 16 } 17 } 18 `,variables:{transactionIds:[t]}}).then(LT([`data`,`transactions`,`edges`,`0`,`node`])).then(YT(`Process ${t} was not found on gateway`)).then(JT(qT)).then(e=>{if(!e)throw new BT(`No "Scheduler" tag found on process`);return a(e)})}function QT({fetch:e,GRAPHQL_URL:t,GRAPHQL_MAX_RETRIES:n,GRAPHQL_RETRY_BACKOFF:r}){let i=XT({fetch:e,GRAPHQL_URL:t,GRAPHQL_MAX_RETRIES:n,GRAPHQL_RETRY_BACKOFF:r});return async e=>i({query:` 19 query GetSchedulerLocation ($owner: String!) { 20 transactions ( 21 owners: [$owner] 22 tags: [ 23 { name: "Data-Protocol", values: ["ao"] }, 24 { name: "Type", values: ["Scheduler-Location"] } 25 ] 26 # Only need the most recent Scheduler-Location 27 sort: HEIGHT_DESC 28 first: 1 29 ) { 30 edges { 31 node { 32 tags { 33 name 34 value 35 } 36 } 37 } 38 } 39 } 40 `,variables:{owner:e}}).then(LT([`data`,`transactions`,`edges`,`0`,`node`])).then(YT(`Could not find 'Scheduler-Location' owner by wallet ${e}`)).then(FT([JT(GT),JT(KT)])).then(([t,n])=>{if(!t)throw new zT(`No "Url" tag found on Scheduler-Location`);if(!n)throw new zT(`No "Time-To-Live" tag found on Scheduler-Location`);return{url:t,ttl:n,address:e}})}var $T=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,eE=new Set,tE=typeof process==`object`&&process?process:{},nE=(e,t,n,r)=>{typeof tE.emitWarning==`function`?tE.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},rE=globalThis.AbortController,iE=globalThis.AbortSignal;if(typeof rE>`u`){iE=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},rE=class{constructor(){t()}signal=new iE;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=tE.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,nE("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",`NO_ABORT_CONTROLLER`,`ENOTSUP`,t))}}var aE=e=>!eE.has(e),oE=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),sE=e=>oE(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?cE:null:null,cE=class extends Array{constructor(e){super(e),this.fill(0)}},lE=class e{heap;length;static#e=!1;static create(t){let n=sE(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},uE=class e{#e;#t;#n;#r;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;static unsafeExposeInternals(e){return{starts:e.#_,ttls:e.#v,sizes:e.#g,keyMap:e.#s,keyList:e.#c,valList:e.#l,next:e.#u,prev:e.#d,get head(){return e.#f},get tail(){return e.#p}
40,free:e.#m,isBackgroundFetch:t=>e.#I(t),backgroundFetch:(t,n,r,i)=>e.#F(t,n,r,i),moveToTail:t=>e.#R(t),indexes:t=>e.#j(t),rindexes:t=>e.#M(t),isStale:t=>e.#E(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#o}get size(){return this.#a}get fetchMethod(){return this.#i}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:b,ignoreFetchAbort:x}=t;if(n!==0&&!oE(n))throw TypeError(`max option must be a nonnegative integer`);let S=n?sE(n):Array;if(!S)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=h,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(g!==void 0&&typeof g!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#i=g,this.#b=!!g,this.#s=new Map,this.#c=Array(n).fill(void 0),this.#l=Array(n).fill(void 0),this.#u=new S(n),this.#d=new S(n),this.#f=0,this.#p=0,this.#m=lE.create(n),this.#a=0,this.#o=0,typeof l==`function`&&(this.#n=l),typeof u==`function`?(this.#r=u,this.#h=[]):(this.#r=void 0,this.#h=void 0),this.#y=!!this.#n,this.#x=!!this.#r,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!b,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#t!==0&&!oE(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!oE(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=oE(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!oE(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#S()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;aE(t)&&(eE.add(t),nE(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#S(){let e=new cE(this.#e),t=new cE(this.#e);this.#v=e,this.#_=t,this.#T=(n,r,i=$T.now())=>{if(t[n]=r===0?0:i,e[n]=r,r!==0&&this.ttlAutopurge){let e=setTimeout(()=>{this.#E(n)&&this.delete(this.#c[n])},r+1);e.unref&&e.unref()}},this.#C=n=>{t[n]=e[n]===0?0:$T.now()},this.#w=(i,a)=>
40{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;i.ttl=o,i.start=s,i.now=n||r(),i.remainingTTL=o-(i.now-s)}};let n=0,r=()=>{let e=$T.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let a=this.#s.get(i);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((n||r())-s)},this.#E=i=>{let a=t[i],o=e[i];return!!o&&!!a&&(n||r())-a>o}}#C=()=>{};#w=()=>{};#T=()=>{};#E=()=>!1;#D(){let e=new cE(this.#e);this.#o=0,this.#g=e,this.#O=t=>{this.#o-=e[t],e[t]=0},this.#A=(e,t,n,r)=>{if(this.#I(t))return 0;if(!oE(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!oE(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#k=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#o>n;)this.#P(!0)}this.#o+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#o)}}#O=e=>{};#k=(e,t,n)=>{};#A=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#j({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;!(!this.#N(t)||((e||!this.#E(t))&&(yield t),t===this.#f));)t=this.#d[t]}*#M({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#f;!(!this.#N(t)||((e||!this.#E(t))&&(yield t),t===this.#p));)t=this.#u[t]}#N(e){return e!==void 0&&this.#s.get(this.#c[e])===e}*entries(){for(let e of this.#j())this.#l[e]!==void 0&&this.#c[e]!==void 0&&!this.#I(this.#l[e])&&(yield[this.#c[e],this.#l[e]])}*rentries(){for(let e of this.#M())this.#l[e]!==void 0&&this.#c[e]!==void 0&&!this.#I(this.#l[e])&&(yield[this.#c[e],this.#l[e]])}*keys(){for(let e of this.#j()){let t=this.#c[e];t!==void 0&&!this.#I(this.#l[e])&&(yield t)}}*rkeys(){for(let e of this.#M()){let t=this.#c[e];t!==void 0&&!this.#I(this.#l[e])&&(yield t)}}*values(){for(let e of this.#j())this.#l[e]!==void 0&&!this.#I(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#M())this.#l[e]!==void 0&&!this.#I(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#j()){let r=this.#l[n],i=this.#I(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#j()){let r=this.#l[n],i=this.#I(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#M()){let r=this.#l[n],i=this.#I(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#c[n],this)}}purgeStale(){let e=!1;for(let t of this.#M({allowStale:!0}))this.#E(t)&&(this.delete(this.#c[t]),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let n=this.#l[t],r=this.#I(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#v&&this.#_){let e=this.#v[t],n=this.#_[t];e&&n&&(i.ttl=e-($T.now()-n),i.start=Date.now())}return this.#g&&(i.size=this.#g[t]),i}dump(){let e=[];for(let t of this.#j({allowStale:!0})){let n=this.#c[t],r=this.#l[t],i=this.#I(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#v&&this.#_){a.ttl=this.#v[t];let e=$T.now()-this.#_[t];a.start=Math.floor(Date.now()-e)}this.#g&&(a.size=this.#g[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=$T.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#A(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.delete(e),this;let u=this.#a===0?void 0:this.#s.get(e);if(u===void 0)u=this.#a===0?this.#p:this.#m.length===0?this.#a===this.#e?this.#P(!1):this.#a:this.#m.pop(),this.#c[u]=e,this.#l[u]=t,this.#s.set(e,u),this.#u[this.#p]=u,this.#d[u]=this.#p,this.#p=u,this.#a++,this.#k(u,l,s),s&&(s.set=`add`),c=!1;else{this.#R(u);let n=this.#l[u];if(t!==n){if(this.#b&&this.#I(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;
40t!==void 0&&!a&&(this.#y&&this.#n?.(t,e,`set`),this.#x&&this.#h?.push([t,e,`set`]))}else a||(this.#y&&this.#n?.(n,e,`set`),this.#x&&this.#h?.push([n,e,`set`]));if(this.#O(u),this.#k(u,l,s),this.#l[u]=t,s){s.set=`replace`;let e=n&&this.#I(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`)}if(r!==0&&!this.#v&&this.#S(),this.#v&&(c||this.#T(u,r,i),s&&this.#w(s,u)),!a&&this.#x&&this.#h){let e=this.#h,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#a;){let e=this.#l[this.#f];if(this.#P(!0),this.#I(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#x&&this.#h){let e=this.#h,t;for(;t=e?.shift();)this.#r?.(...t)}}}#P(e){let t=this.#f,n=this.#c[t],r=this.#l[t];return this.#b&&this.#I(r)?r.__abortController.abort(Error(`evicted`)):(this.#y||this.#x)&&(this.#y&&this.#n?.(r,n,`evict`),this.#x&&this.#h?.push([r,n,`evict`])),this.#O(t),e&&(this.#c[t]=void 0,this.#l[t]=void 0,this.#m.push(t)),this.#a===1?(this.#f=this.#p=0,this.#m.length=0):this.#f=this.#u[t],this.#s.delete(n),this.#a--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#s.get(e);if(i!==void 0){let e=this.#l[i];if(this.#I(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#E(i))r&&(r.has=`stale`,this.#w(r,i));else return n&&this.#C(i),r&&(r.has=`hit`,this.#w(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#s.get(e);if(r===void 0||!n&&this.#E(r))return;let i=this.#l[r];return this.#I(i)?i.__staleWhileFetching:i}#F(e,t,n,r){let i=t===void 0?void 0:this.#l[t];if(this.#I(i))return i;let a=new rE,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason);let l=f;return this.#l[t]===f&&(r===void 0?l.__staleWhileFetching?this.#l[t]=l.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,s.options))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)),u=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection,l=f;if(this.#l[t]===f&&(!c||l.__staleWhileFetching===void 0?this.delete(e):o||(this.#l[t]=l.__staleWhileFetching)),s)return n.status&&l.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r},d=(t,r)=>{let o=this.#i?.(e,i,s);o&&o instanceof Promise&&o.then(e=>t(e===void 0?void 0:e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=this.#s.get(e)):this.#l[t]=p,p}#I(e){if(!this.#b)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof rE}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#b)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#s.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#F(e,y,v,m);return t.__returned=t}else{let t=this.#l[y];if(this.#I(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#E(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#R(y),r&&this.#C(y),g&&this.#w(g,y),t;let a=this.#F(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#s.get(e);if(o!==void 0){let t=this.#l[o],s=this.#I(t);return a&&this.#w(a,o),this.#E(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.delete(e),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#R(o),r&&this.#C(o),t))}else a&&(a.get=`miss`)}#L(e,t){this.#d[t]=e,this.#u[e]=t}#R(e){e!==this.#p&&(e===this.#f?this.#f=this.#u[e]:this.#L(this.#d[e],this.#u[e]),this.#L(this.#p,e),this.#p=e)}delete(e){let t=!1;if(this.#a!==0){let n=this.#s.get(e);if(n!==void 0)if(t=!0,this.#a===1)this.clear();else{this.#O(n);let t=this.#l[n];if(this.#I(t)?t.__abortController.abort(Error(`deleted`)):(this.#y||this.#x)&&(this.#y&&this.#n?.(t,e,`delete`),this.#x&&this.#h?.push([t,e,`delete`])),this.#s.delete(e),this.#c[n]=void 0,this.#l[n]=void 0,n===this.#p)this.#p=this.#d[n];else if(n===this.#f)this.#f=this.#u[n];else{let e=this.#d[n];this.#u[e]=this.#u[n];let t=this.#u[n];this.#d[t]=this.#d[n]}this.#a--,this.#m.push(n)}}if(this.#x&&this.#h?.length){let e=this.#h,t;for(;t=e?.shift();)this.#r?.(...t)}return t}clear(){for(let e of this.#M({allowStale:!0})){let t=this.#l[e];if(this.#I(t))t.__abortController.abort(Error(`deleted`));else{let n=this.#c[e];this.#y&&this.#n?.(t,n,`delete`),this.#x&&this.#h?.push([t,n,`delete`])}}if(this.#s.clear(),this.#l.fill(void 0),this.#c.fill(void 0),this.#v&&this.#_&&(this.#v.fill(0),this.#_.fill(0)),this.#g&&this.#g.fill(0),this.#f=0,this.#p=0,this.#m.length=0,this.#o=0,this.#a=0,this.#x&&this.#h){let e=this.#h,t;for(;t=e?.shift();)this.#r?.(...t)}}};function dE({size:e}){return new uE({max:e,maxSize:5e6,sizeCalculation:e=>JSON.stringify(e).length,allowStale:!0})}function fE({cache:e}){return async t=>{if(e.max)return e.get(t)}}function pE({cache:e}){return async(t,{url:n,address:r},i)=>{if(e.max)return e.set(t,{url:n,address:r},{ttl:i})}}function mE({cache:e}){return async t=>{if(e.max)return e.get(t)}}function hE({cache:e}){return async(t,n,r)=>{if(e.max)return e.set(t,{url:n,address:t,ttl:r},{ttl:r})}}function gE({fetch:e}){return async(t,n)=>{let r=await e(`${t}?process-id=${n}`,{method:`GET`,redirect:`manual`});return[301,302,307,308].includes(r.status)?new URL(r.headers.get(`Location`)).origin:t}}var _E;(function(e){e.assertEqual=e=>e;function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>
vendor: 6,036 bytes, line 40
40typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(_E||={});var vE;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(vE||={});var P=_E.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),yE=e=>{switch(typeof e){case`undefined`:return P.undefined;case`string`:return P.string;case`number`:return isNaN(e)?P.nan:P.number;case`boolean`:return P.boolean;case`function`:return P.function;case`bigint`:return P.bigint;case`symbol`:return P.symbol;case`object`:return Array.isArray(e)?P.array:e===null?P.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?P.promise:typeof Map<`u`&&e instanceof Map?P.map:typeof Set<`u`&&e instanceof Set?P.set:typeof Date<`u`&&e instanceof Date?P.date:P.object;default:return P.unknown}},F=_E.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),bE=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`),xE=class e extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};xE.create=e=>new xE(e);var SE=(e,t)=>{let n;switch(e.code){case F.invalid_type:n=e.received===P.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case F.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_E.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:n=`Unrecognized key(s) in object: ${_E.joinValues(e.keys,`, `)}`;break;case F.invalid_union:n=`Invalid input`;break;case F.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_E.joinValues(e.options)}`;break;case F.invalid_enum_value:n=`Invalid enum value. Expected ${_E.joinValues(e.options)}, received '${e.received}'`;break;case F.invalid_arguments:n=`Invalid function arguments`;break;case F.invalid_return_type:n=`Invalid function return type`;break;case F.invalid_date:n=`Invalid date`;break;case F.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:_E.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case F.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case F.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case F.custom:n=`Invalid input`;break;case F.invalid_intersection_types:n=`Intersection results could not be merged`;break;case F.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case F.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,_E.assertNever(e)}return{message:n}},CE=SE;function wE(e){CE=e}function TE(){return CE}var EE=e=>
40{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},DE=[];function I(e,t){let n=TE(),r=EE({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===SE?void 0:SE].filter(e=>!!e)});e.common.issues.push(r)}var OE=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return L;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return L;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(typeof i.value<`u`||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},L=Object.freeze({status:`aborted`}),kE=e=>({status:`dirty`,value:e}),AE=e=>({status:`valid`,value:e}),jE=e=>e.status===`aborted`,ME=e=>e.status===`dirty`,NE=e=>e.status===`valid`,PE=e=>typeof Promise<`u`&&e instanceof Promise;function FE(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function IE(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var R;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(R||={});var LE,RE,zE=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},BE=(e,t)=>{if(NE(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new xE(e.common.issues),this._error}}};function z(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:typeof i.data>`u`?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var B=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return yE(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:yE(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new OE,ctx:{common:e.parent.common,data:e.data,parsedType:yE(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(PE(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yE(e)};return BE(n,this._parseSync({data:e,path:n.path,parent:n}))}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yE(e)},r=this._parse({data:e,path:n.path,parent:n});return BE(n,await(PE(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||typeof t>`u`?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:F.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new LD({schema:this,typeName:V.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return RD.create(this,this._def)}nullable(){return zD.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vD.create(this,this._def)}promise(){return ID.create(this,this._def)}or(e){return xD.create([this,e],this._def)}and(e){return TD.create(this,e,this._def)}transform(e){return new LD({...z(this._def),schema:this,typeName:V.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new BD({...z(this._def),innerType:this,defaultValue:t,typeName:V.ZodDefault})}brand(){return new WD({typeName:V.ZodBranded,type:this,...z(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new VD({...z(this._def),innerType:this,catchValue:t,typeName:V.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return GD.create(this,e)}readonly(){return KD.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},VE=/^c[^\s-]{8,}
vendor: 8,066 bytes, line 40
40$/i,HE=/^[0-9a-z]+$/,UE=/^[0-9A-HJKMNP-TV-Z]{26}$/,WE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,GE=/^[a-z0-9_-]{21}$/i,KE=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,JE=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,YE,XE=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ZE=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,QE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$E=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,eD=RegExp(`^${$E}$`);function tD(e){let t=`([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`),t}function nD(e){return RegExp(`^${tD(e)}$`)}function rD(e){let t=`${$E}T${tD(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function iD(e,t){return!!((t===`v4`||!t)&&XE.test(e)||(t===`v6`||!t)&&ZE.test(e))}var aD=class e extends B{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==P.string){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.string,received:t.parsedType}),L}let t=new OE,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?I(n,{code:F.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&I(n,{code:F.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)qE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`email`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)YE||=new RegExp(JE,`u`),YE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`emoji`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)WE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`uuid`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)GE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`nanoid`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)VE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`cuid`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)HE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`cuid2`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)UE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`ulid`,code:F.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),I(n,{validation:`url`,code:F.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`regex`,code:F.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),I(n,{code:F.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),I(n,{code:F.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),I(n,{code:F.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?rD(r).test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{code:F.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?eD.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{code:F.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?nD(r).test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{code:F.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?KE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`duration`,code:F.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?iD(e.data,r.version)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`ip`,code:F.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?QE.test(e.data)||(n=this._getOrReturnCtx(e,n),I(n,{validation:`base64`,code:F.invalid_string,message:r.message}),t.dirty()):_E.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:F.invalid_string,...R.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...R.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...R.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...R.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...R.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...R.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...R.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...R.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...R.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:typeof e?.precision>`u`?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...R.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:typeof e?.precision>`u`?null:e?.precision,...R.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...R.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...R.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...R.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...R.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...R.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...R.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...R.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...R.errToObj(t)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}
vendor: 7,969 bytes, line 40
40get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};aD.create=e=>new aD({checks:[],typeName:V.ZodString,coerce:e?.coerce??!1,...z(e)});function oD(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(`.`,``))%parseInt(t.toFixed(i).replace(`.`,``))/10**i}var sD=class e extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==P.number){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.number,received:t.parsedType}),L}let t,n=new OE;for(let r of this._def.checks)r.kind===`int`?_E.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),I(t,{code:F.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?oD(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_finite,message:r.message}),n.dirty()):_E.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,R.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,R.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,R.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,R.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:R.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:R.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:R.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:R.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:R.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&_E.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};sD.create=e=>new sD({checks:[],typeName:V.ZodNumber,coerce:e?.coerce||!1,...z(e)});var cD=class e extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==P.bigint){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.bigint,received:t.parsedType}),L}let t,n=new OE;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):_E.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,R.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,R.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,R.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,R.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:R.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};cD.create=e=>new cD({checks:[],typeName:V.ZodBigInt,coerce:e?.coerce??!1,...z(e)});var lD=class extends B{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==P.boolean){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.boolean,received:t.parsedType}),L}return AE(e.data)}};lD.create=e=>new lD({typeName:V.ZodBoolean,coerce:e?.coerce||!1,...z(e)});var uD=class e extends B{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==P.date){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.date,received:t.parsedType}),L}if(isNaN(e.data.getTime()))return I(this._getOrReturnCtx(e),{code:F.invalid_date}),L;let t=new OE,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):_E.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:R.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:R.toString(t)})}
vendor: 5,949 bytes, line 40
40get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};uD.create=e=>new uD({checks:[],coerce:e?.coerce||!1,typeName:V.ZodDate,...z(e)});var dD=class extends B{_parse(e){if(this._getType(e)!==P.symbol){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.symbol,received:t.parsedType}),L}return AE(e.data)}};dD.create=e=>new dD({typeName:V.ZodSymbol,...z(e)});var fD=class extends B{_parse(e){if(this._getType(e)!==P.undefined){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.undefined,received:t.parsedType}),L}return AE(e.data)}};fD.create=e=>new fD({typeName:V.ZodUndefined,...z(e)});var pD=class extends B{_parse(e){if(this._getType(e)!==P.null){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.null,received:t.parsedType}),L}return AE(e.data)}};pD.create=e=>new pD({typeName:V.ZodNull,...z(e)});var mD=class extends B{constructor(){super(...arguments),this._any=!0}_parse(e){return AE(e.data)}};mD.create=e=>new mD({typeName:V.ZodAny,...z(e)});var hD=class extends B{constructor(){super(...arguments),this._unknown=!0}_parse(e){return AE(e.data)}};hD.create=e=>new hD({typeName:V.ZodUnknown,...z(e)});var gD=class extends B{_parse(e){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.never,received:t.parsedType}),L}};gD.create=e=>new gD({typeName:V.ZodNever,...z(e)});var _D=class extends B{_parse(e){if(this._getType(e)!==P.undefined){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.void,received:t.parsedType}),L}return AE(e.data)}};_D.create=e=>new _D({typeName:V.ZodVoid,...z(e)});var vD=class e extends B{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==P.array)return I(t,{code:F.invalid_type,expected:P.array,received:t.parsedType}),L;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(I(t,{code:e?F.too_big:F.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(I(t,{code:F.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(I(t,{code:F.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new zE(t,e,t.path,n)))).then(e=>OE.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new zE(t,e,t.path,n)));return OE.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:R.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:R.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:R.toString(n)}})}nonempty(e){return this.min(1,e)}};vD.create=(e,t)=>new vD({type:e,minLength:null,maxLength:null,exactLength:null,typeName:V.ZodArray,...z(t)});function yD(e){if(e instanceof bD){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=RD.create(yD(r))}return new bD({...e._def,shape:()=>t})}else return e instanceof vD?new vD({...e._def,type:yD(e.element)}):e instanceof RD?RD.create(yD(e.unwrap())):e instanceof zD?zD.create(yD(e.unwrap())):e instanceof ED?ED.create(e.items.map(e=>yD(e))):e}var bD=class e extends B{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:_E.objectKeys(e)}}_parse(e){if(this._getType(e)!==P.object){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.object,received:t.parsedType}),L}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof gD&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new zE(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof gD){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(I(n,{code:F.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new zE(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>OE.mergeObjectSync(t,e)):OE.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{var r;let i=(r=this._def).errorMap?.call(r,e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:R.errToObj(t).message??i}:{message:i}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:V.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};
vendor: 4,648 bytes, line 40
40return _E.objectKeys(t).forEach(e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return _E.objectKeys(this.shape).forEach(e=>{t[e]||(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}deepPartial(){return yD(this)}partial(t){let n={};return _E.objectKeys(this.shape).forEach(e=>{let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return _E.objectKeys(this.shape).forEach(e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof RD;)t=t._def.innerType;n[e]=t}}),new e({...this._def,shape:()=>n})}keyof(){return ND(_E.objectKeys(this.shape))}};bD.create=(e,t)=>new bD({shape:()=>e,unknownKeys:`strip`,catchall:gD.create(),typeName:V.ZodObject,...z(t)}),bD.strictCreate=(e,t)=>new bD({shape:()=>e,unknownKeys:`strict`,catchall:gD.create(),typeName:V.ZodObject,...z(t)}),bD.lazycreate=(e,t)=>new bD({shape:e,unknownKeys:`strip`,catchall:gD.create(),typeName:V.ZodObject,...z(t)});var xD=class extends B{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new xE(e.ctx.common.issues));return I(t,{code:F.invalid_union,unionErrors:n}),L}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new xE(e));return I(t,{code:F.invalid_union,unionErrors:i}),L}}get options(){return this._def.options}};xD.create=(e,t)=>new xD({options:e,typeName:V.ZodUnion,...z(t)});var SD=e=>e instanceof jD?SD(e.schema):e instanceof LD?SD(e.innerType()):e instanceof MD?[e.value]:e instanceof PD?e.options:e instanceof FD?_E.objectValues(e.enum):e instanceof BD?SD(e._def.innerType):e instanceof fD?[void 0]:e instanceof pD?[null]:e instanceof RD?[void 0,...SD(e.unwrap())]:e instanceof zD?[null,...SD(e.unwrap())]:e instanceof WD||e instanceof KD?SD(e.unwrap()):e instanceof VD?SD(e._def.innerType):[],CD=class e extends B{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.object)return I(t,{code:F.invalid_type,expected:P.object,received:t.parsedType}),L;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(I(t,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=SD(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:V.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...z(r)})}};function wD(e,t){let n=yE(e),r=yE(t);if(e===t)return{valid:!0,data:e};if(n===P.object&&r===P.object){let n=_E.objectKeys(t),r=_E.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=wD(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===P.array&&r===P.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=wD(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else return n===P.date&&r===P.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var TD=class extends B{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(jE(e)||jE(r))return L;let i=wD(e.value,r.value);return i.valid?((ME(e)||ME(r))&&t.dirty(),{status:t.value,value:i.data}):(I(n,{code:F.invalid_intersection_types}),L)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};
vendor: 4,743 bytes, line 40
40TD.create=(e,t,n)=>new TD({left:e,right:t,typeName:V.ZodIntersection,...z(n)});var ED=class e extends B{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.array)return I(n,{code:F.invalid_type,expected:P.array,received:n.parsedType}),L;if(n.data.length<this._def.items.length)return I(n,{code:F.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),L;!this._def.rest&&n.data.length>this._def.items.length&&(I(n,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new zE(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>OE.mergeArray(t,e)):OE.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ED.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ED({items:e,typeName:V.ZodTuple,rest:null,...z(t)})};var DD=class e extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.object)return I(n,{code:F.invalid_type,expected:P.object,received:n.parsedType}),L;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new zE(n,e,n.path,e)),value:a._parse(new zE(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?OE.mergeObjectAsync(t,r):OE.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof B?new e({keyType:t,valueType:n,typeName:V.ZodRecord,...z(r)}):new e({keyType:aD.create(),valueType:t,typeName:V.ZodRecord,...z(n)})}},OD=class extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.map)return I(n,{code:F.invalid_type,expected:P.map,received:n.parsedType}),L;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new zE(n,e,n.path,[a,`key`])),value:i._parse(new zE(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return L;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return L;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};OD.create=(e,t,n)=>new OD({valueType:t,keyType:e,typeName:V.ZodMap,...z(n)});var kD=class e extends B{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.set)return I(n,{code:F.invalid_type,expected:P.set,received:n.parsedType}),L;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(I(n,{code:F.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(I(n,{code:F.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return L;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new zE(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:R.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:R.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};kD.create=(e,t)=>new kD({valueType:e,minSize:null,maxSize:null,typeName:V.ZodSet,...z(t)});var AD=class e extends B{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.function)return I(t,{code:F.invalid_type,expected:P.function,received:t.parsedType}),L;function n(e,n){return EE({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,TE(),SE].filter(e=>!!e),issueData:{code:F.invalid_arguments,argumentsError:n}})}function r(e,n){return EE({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,TE(),SE].filter(e=>!!e),issueData:{code:F.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof ID){let e=this;return AE(async function(...t){let o=new xE([]),s=await e._def.args.parseAsync(t,i).c
vendor: 1,515 bytes, line 40
40atch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return AE(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new xE([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new xE([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ED.create(t).rest(hD.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||ED.create([]).rest(hD.create()),returns:n||hD.create(),typeName:V.ZodFunction,...z(r)})}},jD=class extends B{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};jD.create=(e,t)=>new jD({getter:e,typeName:V.ZodLazy,...z(t)});var MD=class extends B{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return I(t,{received:t.data,code:F.invalid_literal,expected:this._def.value}),L}return{status:`valid`,value:e.data}}get value(){return this._def.value}};MD.create=(e,t)=>new MD({value:e,typeName:V.ZodLiteral,...z(t)});function ND(e,t){return new PD({values:e,typeName:V.ZodEnum,...z(t)})}var PD=class e extends B{constructor(){super(...arguments),LE.set(this,void 0)}
40_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return I(t,{expected:_E.joinValues(n),received:t.parsedType,code:F.invalid_type}),L}if(FE(this,LE,`f`)||IE(this,LE,new Set(this._def.values),`f`),!FE(this,LE,`f`).has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return I(t,{received:t.data,code:F.invalid_enum_value,options:n}),L}return AE(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};LE=new WeakMap,PD.create=ND;var FD=class extends B{constructor(){super(...arguments),RE.set(this,void 0)}_parse(e){let t=_E.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==P.string&&n.parsedType!==P.number){let e=_E.objectValues(t);return I(n,{expected:_E.joinValues(e),received:n.parsedType,code:F.invalid_type}),L}if(FE(this,RE,`f`)||IE(this,RE,new Set(_E.getValidEnumValues(this._def.values)),`f`),!FE(this,RE,`f`).has(e.data)){let e=_E.objectValues(t);return I(n,{received:n.data,code:F.invalid_enum_value,options:e}),L}return AE(e.data)}get enum(){return this._def.values}};RE=new WeakMap,FD.create=(e,t)=>new FD({values:e,typeName:V.ZodNativeEnum,...z(t)});var ID=class extends B{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==P.promise&&t.common.async===!1?(I(t,{code:F.invalid_type,expected:P.promise,received:t.parsedType}),L):AE((t.parsedType===P.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ID.create=(e,t)=>new ID({type:e,typeName:V.ZodPromise,...z(t)});var LD=class extends B{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===V.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{I(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return L;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?L:r.status===`dirty`||t.value===`dirty`?kE(r.value):r});{if(t.value===`aborted`)return L;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?L:r.status===`dirty`||t.value===`dirty`?kE(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?L:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?L:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!NE(e))return e;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>NE(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);_E.assertNever(r)}};LD.create=(e,t,n)=>new LD({schema:e,typeName:V.ZodEffects,effect:t,...z(n)}),LD.createWithPreprocess=(e,t,n)=>new LD({schema:t,effect:{type:`preprocess`,transform:e},typeName:V.ZodEffects,...z(n)});var RD=class extends B{_parse(e){return this._getType(e)===P.undefined?AE(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};RD.create=(e,t)=>
40new RD({innerType:e,typeName:V.ZodOptional,...z(t)});var zD=class extends B{_parse(e){return this._getType(e)===P.null?AE(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zD.create=(e,t)=>new zD({innerType:e,typeName:V.ZodNullable,...z(t)});var BD=class extends B{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===P.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};BD.create=(e,t)=>new BD({innerType:e,typeName:V.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...z(t)});var VD=class extends B{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return PE(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new xE(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new xE(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};VD.create=(e,t)=>new VD({innerType:e,typeName:V.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...z(t)});var HD=class extends B{_parse(e){if(this._getType(e)!==P.nan){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.nan,received:t.parsedType}),L}return{status:`valid`,value:e.data}}};HD.create=e=>new HD({typeName:V.ZodNaN,...z(e)});var UD=Symbol(`zod_brand`),WD=class extends B{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},GD=class e extends B{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?L:e.status===`dirty`?(t.dirty(),kE(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?L:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:V.ZodPipeline})}},KD=class extends B{_parse(e){let t=this._def.innerType._parse(e);return NE(t)&&(t.value=Object.freeze(t.value)),t}unwrap(){return this._def.innerType}};KD.create=(e,t)=>new KD({innerType:e,typeName:V.ZodReadonly,...z(t)});function qD(e,t={},n){return e?mD.create().superRefine((r,i)=>{if(!e(r)){let e=typeof t==`function`?t(r):typeof t==`string`?{message:t}:t,a=e.fatal??n??!0,o=typeof e==`string`?{message:e}:e;i.addIssue({code:`custom`,...o,fatal:a})}}):mD.create()}var JD={object:bD.lazycreate},V;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(V||={});var YD=(e,t={message:`Input not instance of ${e.name}`})=>qD(t=>t instanceof e,t),XD=aD.create,ZD=sD.create,QD=HD.create,$D=cD.create,eO=lD.create,tO=uD.create,nO=dD.create,rO=fD.create,iO=pD.create,aO=mD.create,oO=hD.create,sO=gD.create,cO=_D.create,lO=vD.create,uO=bD.create,dO=bD.strictCreate,fO=xD.create,pO=CD.create,mO=TD.create,hO=ED.create,gO=DD.create,_O=OD.create,vO=kD.create,yO=AD.create,bO=jD.create,xO=MD.create,SO=PD.create,CO=FD.create,wO=ID.create,TO=LD.create,EO=RD.create,DO=zD.create,OO=LD.createWithPreprocess,kO=GD.create,AO=()=>XD().optional(),jO=()=>ZD().optional(),MO=()=>eO().optional(),NO={string:e=>aD.create({...e,coerce:!0}),number:e=>sD.create({...e,coerce:!0}),boolean:e=>lD.create({...e,coerce:!0}),bigint:e=>cD.create({...e,coerce:!0}),date:e=>uD.create({...e,coerce:!0})},PO=L,FO=Object.freeze({__proto__:null,defaultErrorMap:SE,setErrorMap:wE,getErrorMap:TE,makeIssue:EE,EMPTY_PATH:DE,addIssueToContext:I,ParseStatus:OE,INVALID:L,DIRTY:kE,OK:AE,isAborted:jE,isDirty:ME,isValid:NE,isAsync:PE,get util(){return _E},get objectUtil(){return vE},ZodParsedType:P,getParsedType:yE,ZodType:B,datetimeRegex:rD,ZodString:aD,ZodNumber:sD,ZodBigInt:cD,ZodBoolean:lD,ZodDate:uD,ZodSymbol:dD,ZodUndefined:fD,ZodNull:pD,ZodAny:mD,ZodUnknown:hD,ZodNever:gD,ZodVoid:_D,ZodArray:vD,ZodObject:bD,ZodUnion:xD,ZodDiscriminatedUnion:CD,ZodIntersection:TD,ZodTuple:ED,ZodRecord:DD,ZodMap:OD,ZodSet:kD,ZodFunction:AD,ZodLazy:jD,ZodLiteral:MD,ZodEnum:PD,ZodNativeEnum:FD,ZodPromise:ID,ZodEffects:LD,ZodTransformer:LD,ZodOptional:RD,ZodNullable:zD,ZodDefault:BD,ZodCatch:VD,ZodNaN:HD,BRAND:UD,ZodBranded:WD,ZodPipeline:GD,ZodReadonly:KD,custom:qD,Schema:B,ZodSchema:B,late:JD,get ZodFirstPartyTypeKind(){return V},coerce:NO,any:aO,array:lO,bigint:$D,boolean:eO,date:tO,discriminatedUnion:pO,effect:TO,enum:SO,function:yO,instanceof:YD,intersection:mO,lazy:bO,literal:xO,map:_O,nan:QD,nativeEnum:CO,never:sO,null:iO,nullable:DO,number:ZD,object:uO,oboolean:MO,onumber:jO,optional:EO,ostring:AO,pipeline:kO,preprocess:OO,promise:wO,record:gO,set:vO,strictObject:dO,string:XD,symbol:nO,transformer:TO,tuple:hO,undefined:rO,union:fO,unknown:oO,void:cO,NEVER:PO,ZodIssueCode:F,quotelessJson:bE,ZodError:xE}),IO=FO.object({url:FO.string(),address:FO.string()}),LO=FO.object({url:FO.string(),address:FO.string(),ttl:FO.coerce.number()}),RO=FO.function().args(FO.string(),FO.string()).returns(FO.promise(FO.string())),zO=FO.function().args(FO.string()).returns(FO.promise(IO.nullish())),BO=FO.function().args(FO.string(),IO,FO.number()).returns(FO.promise(FO.any())),VO=FO.function().args(FO.string()).returns(FO.promise(LO.nullish())),HO=FO.function().args(FO.string(),FO.string(),FO.number()).returns(FO.promise(FO.any())),UO=FO.function().args(FO.string()).returns(FO.promise(LO)),WO=UO;function GO({loadProcessScheduler:e,loadScheduler:t,cache:n,followRedirects:r,checkForRedirect:i}){e=WO.implement(e),t=UO.implement(t),i=RO.implement(i);let a=zO.implement(n.getByProcess),o=VO.implement(n.getByOwner),s=BO.implement(n.setByProcess),c=HO.implement(n.setByOwner);return(n,l)=>a(n).then(async a=>a||Promise.resolve().then(async()=>l?await o(l)||t(l).then(e=>(c(e.address,e.url,e.ttl),e)):e(n)).then(async e=>{let t=e.url;r&&(t=await i(e.url,n));let a={url:HT(t),address:e.address};return await s(n,a,e.ttl),a}))}function KO({loadScheduler:e,cache:t}){e=UO.implement(e);let n=VO.implement(t.getByOwner),r=HO.implement(t.setByOwner);return t=>n(t).then(n=>n?{url:n.url}:e(t).then(e=>r(t,e.url,e.ttl).then(()=>({url:HT(e.url)}))).catch(e=>{if(!(e instanceof zT))throw e}))}function qO({loadScheduler:e,cache:t}){e=UO.implement(e);let n=VO.implement(t.getByOwner),r=HO.implement(t.setByOwner);return t=>n(t).then(n=>n?!0:e(t).then(e=>r(t,e.url,e.ttl)).then(()=>!0).catch(e=>{if(e instanceof zT)return!1;throw e}))}var JO=100,YO=`https://arweave.net/graphql`,XO=0,ZO=300,QO=!1;function $O({cacheSize:e=JO,followRedirects:t=QO,GRAPHQL_URL:n=YO,GRAPHQL_MAX_RETRIES:r=XO,GRAPHQL_RETRY_BACKOFF:i=ZO}={}){let a=dE({size:e}),o=QT({fetch,GRAPHQL_URL:n,GRAPHQL_MAX_RETRIES:r,GRAPHQL_RETRY_BACKOFF:i}),s={getByProcess:fE({cache:a}),getByOwner:mE({cache:a}
40),setByProcess:pE({cache:a}),setByOwner:hE({cache:a})};return{locate:GO({loadProcessScheduler:ZT({fetch,GRAPHQL_URL:n,GRAPHQL_MAX_RETRIES:r,GRAPHQL_RETRY_BACKOFF:i}),loadScheduler:o,cache:s,followRedirects:t,checkForRedirect:gE({fetch})}),validate:qO({loadScheduler:o,cache:s}),raw:KO({loadScheduler:o,cache:s})}}var{locate:ek,validate:tk,raw:nk}=$O({GRAPHQL_URL:globalThis.GRAPHQL_URL||void 0,cacheSize:globalThis.SCHEDULER_UTILS_CACHE_SIZE||void 0,followRedirects:globalThis.SCHEDULER_UTILS_FOLLOW_REDIRECTS===`true`||void 0,GRAPHQL_MAX_RETRIES:globalThis.GRAPHQL_MAX_RETRIES||void 0,GRAPHQL_RETRY_BACKOFF:globalThis.GRAPHQL_RETRY_BACKOFF||void 0}),rk=e=>({fork:e,toPromise:()=>new Promise((t,n)=>e(n,t)),map:t=>rk((n,r)=>e(n,e=>r(t(e)))),bimap:(t,n)=>rk((r,i)=>e(e=>r(t(e)),e=>i(n(e)))),chain:t=>rk((n,r)=>e(n,e=>t(e).fork(n,r))),bichain:(t,n)=>rk((r,i)=>e(e=>t(e).fork(r,i),e=>n(e).fork(r,i))),fold:(t,n)=>rk((r,i)=>e(e=>t(e).fork(r,i),e=>n(e).fork(r,i)))}),ik=e=>rk((t,n)=>n(e)),ak=e=>rk((t,n)=>n(e)),ok=e=>rk((t,n)=>t(e)),sk=e=>(...t)=>rk((n,r)=>e(...t).then(r).catch(n));function ck({fetch:e,MU_URL:t,logger:n}){let r=n.child(`deployMessage`);return n=>ik(n).chain(sk(({processId:e,data:t,tags:n,anchor:r,signer:i})=>i({data:t,tags:n,target:e,anchor:r}))).chain(n=>ik(n).chain(sk(async n=>e(t,{method:`POST`,headers:{"Content-Type":`application/octet-stream`,Accept:`application/json`},redirect:`follow`,body:n.raw}))).bichain(e=>ok(Error(`Error while communicating with MU: ${JSON.stringify(e)}`)),sk(async e=>{if(e.ok)return e.json();throw Error(`${e.status}: ${await e.text()}`)})).bimap(r.tap(`Error encountered when writing message via MU`),r.tap(`Successfully wrote message via MU`)).map(e=>({res:e,messageId:n.id}))).toPromise()}function lk({fetch:e,MU_URL:t,logger:n}){let r=n.child(`deployProcess`);return n=>ik(n).chain(sk(({data:e,tags:t,signer:n})=>n({data:e,tags:t}))).chain(n=>ik(n).chain(sk(async n=>e(t,{method:`POST`,headers:{"Content-Type":`application/octet-stream`,Accept:`application/json`},redirect:`follow`,body:n.raw}))).bichain(e=>ok(Error(`Error while communicating with MU: ${JSON.stringify(e)}`)),sk(async e=>{if(e.ok)return e.json();throw Error(`${e.status}: ${await e.text()}`)})).bimap(r.tap(`Error encountered when deploying process via MU`),r.tap(`Successfully deployed process via MU`)).map(e=>({res:e,processId:n.id}))).toPromise()}function uk({fetch:e,MU_URL:t,logger:n}){let r=n.child(`deployMonitor`);return n=>ik(n).chain(sk(({processId:e,data:t,tags:n,anchor:r,signer:i})=>i({data:t,tags:n,target:e,anchor:r}))).chain(i=>ik(i).chain(sk(async r=>e(t+`/monitor/`+n.processId,{method:`POST`,headers:{"Content-Type":`application/octet-stream`,Accept:`application/json`},redirect:`follow`,body:r.raw}))).bichain(e=>ok(Error(`Error while communicating with MU: ${JSON.stringify(e)}`)),sk(async e=>{if(e.ok)return{ok:!0};throw Error(`${e.status}: ${await e.text()}`)})).bimap(r.tap(`Error encountered when subscribing to process via MU`),r.tap(`Successfully subscribed to process via MU`)).map(e=>({res:e,messageId:i.id}))).toPromise()}function dk({fetch:e,MU_URL:t,logger:n}){let r=n.child(`deployUnmonitor`);return n=>ik(n).chain(sk(({processId:e,data:t,tags:n,anchor:r,signer:i})=>i({data:t,tags:n,target:e,anchor:r}))).chain(i=>ik(i).chain(sk(async r=>e(t+`/monitor/`+n.processId,{method:`DELETE`,headers:{"Content-Type":`application/octet-stream`,Accept:`application/json`},redirect:`follow`,body:r.raw}))).bichain(e=>ok(Error(`Error while communicating with MU: ${JSON.stringify(e)}`)),sk(async e=>{if(e.ok)return{ok:!0};throw Error(`${e.status}: ${await e.text()}`)})).bimap(r.tap(`Error encountered when unsubscribing to process via MU`),r.tap(`Successfully unsubscribed to process via MU`)).map(e=>({res:e,messageId:i.id}))).toPromise()}function fk({fetch:e,MU_URL:t,logger:n}){let r=n.child(`deployAssign`);return n=>ik(n).chain(sk(async({process:n,message:r,baseLayer:i,exclude:a})=>e(`${t}?process-id=${n}&assign=${r}${i?`&base-layer`:``}${a?`&exclude=`+a.join(`,`):``}`,{method:`POST`,headers:{"Content-Type":`application/octet-stream`,Accept:`application/json`}}))).bichain(e=>ok(Error(`Error while communicating with MU: ${JSON.stringify(e)}`)),sk(async e=>{if(e.ok)return e.json();throw Error(`${e.status}: ${await e.text()}`)})).bimap(r.tap(`Error encountered when writing assignment via MU`),r.tap(`Successfully wrote assignment via MU`)).map(e=>({res:e,assignmentId:e.id})).toPromise()}function pk({fetch:e,CU_URL:t,logger:n}){return r=>ik(r).map(n.tap(`posting dryrun request to CU`)).chain(sk(n=>e(`${t}/dry-run?process-id=${n.Target}`,{method:`POST`,headers:{"Content-Type":`application/json`},redirect:`follow`,body:JSON.stringify(n)}).then(e=>e.json()))).toPromise()}function mk({fetch:e,CU_URL:t,logger:n}){return({id:r,processId:i})=>ik(`${t}/result/${r}?process-id=${i}`).map(n.tap(`fetching message result from CU`)).chain(sk(async t=>e(t,{method:`GET`,headers:{Accept:`application/json`},redirect:`follow`}).then(e=>e.json()))).toPromise()}function hk({fetch:e,CU_URL:t,logger:n}){return({process:r,from:i,to:a,sort:o,limit:s})=>{let c=new URL(`${t}/results/${r}`),l=new URLSearchParams(c.search);
40return i&&l.append(`from`,i),a&&l.append(`to`,a),o&&l.append(`sort`,o),s&&l.append(`limit`,s),c.search=l,ik(c.toString()).map(n.tap(`fetching message result from CU`)).chain(sk(async t=>e(t,{method:`GET`,headers:{Accept:`application/json`},redirect:`follow`}).then(e=>e.json()))).toPromise()}}var gk=tw(cw(),1),_k,vk=({MAX_SIZE:e})=>_k||(_k=new gk.default(e),_k),yk=({logger:e,fetch:t,cache:n=_k})=>async({suUrl:r,processId:i})=>n.has(i)?n.get(i):t(`${r}/processes/${i}`,{method:`GET`,redirect:`follow`}).then(async t=>{if(t.ok)return t.json();throw e(`Error Encountered when fetching process meta from SU '%s' for process '%s'`,r,i),Error(`Encountered Error fetching scheduled messages from Scheduler Unit: ${t.status}: ${await t.text()}`)}).then(t=>(e(`Caching process meta for process '%s'`,i),n.set(i,{tags:t.tags}),t)),bk=function(){return!1},xk=function(){return!0},Sk={"@@functional/placeholder":!0};function Ck(e){return typeof e==`object`&&!!e&&e[`@@functional/placeholder`]===!0}function wk(e){return function t(n){return arguments.length===0||Ck(n)?t:e.apply(this,arguments)}}function Tk(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return Ck(n)?t:wk(function(t){return e(n,t)});default:return Ck(n)&&Ck(r)?t:Ck(n)?wk(function(t){return e(t,r)}):Ck(r)?wk(function(t){return e(n,t)}):e(n,r)}}}function Ek(e,t){e||=[],t||=[];var n,r=e.length,i=t.length,a=[];for(n=0;n<r;)a[a.length]=e[n],n+=1;for(n=0;n<i;)a[a.length]=t[n],n+=1;return a}function Dk(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,i){return t.apply(this,arguments)};case 5:return function(e,n,r,i,a){return t.apply(this,arguments)};case 6:return function(e,n,r,i,a,o){return t.apply(this,arguments)};case 7:return function(e,n,r,i,a,o,s){return t.apply(this,arguments)};case 8:return function(e,n,r,i,a,o,s,c){return t.apply(this,arguments)};case 9:return function(e,n,r,i,a,o,s,c,l){return t.apply(this,arguments)};case 10:return function(e,n,r,i,a,o,s,c,l,u){return t.apply(this,arguments)};default:throw Error(`First argument to _arity must be a non-negative integer no greater than ten`)}}function Ok(e,t,n){return function(){for(var r=[],i=0,a=e,o=0,s=!1;o<t.length||i<arguments.length;){var c;o<t.length&&(!Ck(t[o])||i>=arguments.length)?c=t[o]:(c=arguments[i],i+=1),r[o]=c,Ck(c)?s=!0:--a,o+=1}return!s&&a<=0?n.apply(this,r):Dk(Math.max(0,a),Ok(e,r,n))}}var kk=Tk(function(e,t){return e===1?wk(t):Dk(e,Ok(e,[],t))});function Ak(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return Ck(n)?t:Tk(function(t,r){return e(n,t,r)});case 2:return Ck(n)&&Ck(r)?t:Ck(n)?Tk(function(t,n){return e(t,r,n)}):Ck(r)?Tk(function(t,r){return e(n,t,r)}):wk(function(t){return e(n,r,t)});default:return Ck(n)&&Ck(r)&&Ck(i)?t:Ck(n)&&Ck(r)?Tk(function(t,n){return e(t,n,i)}):Ck(n)&&Ck(i)?Tk(function(t,n){return e(t,r,n)}):Ck(r)&&Ck(i)?Tk(function(t,r){return e(n,t,r)}):Ck(n)?wk(function(t){return e(t,r,i)}):Ck(r)?wk(function(t){return e(n,t,i)}):Ck(i)?wk(function(t){return e(n,r,t)}):e(n,r,i)}}}var jk=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)===`[object Array]`};function Mk(e){return e!=null&&typeof e[`@@transducer/step`]==`function`}function Nk(e,t,n){return function(){if(arguments.length===0)return n();var r=arguments[arguments.length-1];if(!jk(r)){for(var i=0;i<e.length;){if(typeof r[e[i]]==`function`)return r[e[i]].apply(r,Array.prototype.slice.call(arguments,0,-1));i+=1}if(Mk(r))return t.apply(null,Array.prototype.slice.call(arguments,0,-1))(r)}return n.apply(this,arguments)}}var Pk={init:function(){return this.xf[`@@transducer/init`]()},result:function(e){return this.xf[`@@transducer/result`](e)}};function Fk(e){for(var t=[],n;!(n=e.next()).done;)t.push(n.value);return t}function Ik(e,t,n){for(var r=0,i=n.length;r<i;){if(e(t,n[r]))return!0;r+=1}return!1}function Lk(e){var t=String(e).match(/^function (\w*)/);return t==null?``:t[1]}function Rk(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function zk(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Bk=typeof Object.is==`function`?Object.is:zk,Vk=Object.prototype.toString,Hk=function(){return Vk.call(arguments)===`[object Arguments]`?function(e){return Vk.call(e)===`[object Arguments]`}:function(e){return Rk(`callee`,e)}}(),Uk=!{toString:null}.propertyIsEnumerable(`toString`),Wk=[`constructor`,`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleStr
40ing`],Gk=function(){return arguments.propertyIsEnumerable(`length`)}(),Kk=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},qk=typeof Object.keys==`function`&&!Gk?wk(function(e){return Object(e)===e?Object.keys(e):[]}):wk(function(e){if(Object(e)!==e)return[];var t,n,r=[],i=Gk&&Hk(e);for(t in e)Rk(t,e)&&(!i||t!==`length`)&&(r[r.length]=t);if(Uk)for(n=Wk.length-1;n>=0;)t=Wk[n],Rk(t,e)&&!Kk(r,t)&&(r[r.length]=t),--n;return r}),Jk=wk(function(e){return e===null?`Null`:e===void 0?`Undefined`:Object.prototype.toString.call(e).slice(8,-1)});function Yk(e,t,n,r){var i=Fk(e),a=Fk(t);function o(e,t){return Xk(e,t,n.slice(),r.slice())}return!Ik(function(e,t){return!Ik(o,t,e)},a,i)}function Xk(e,t,n,r){if(Bk(e,t))return!0;var i=Jk(e);if(i!==Jk(t))return!1;if(typeof e[`fantasy-land/equals`]==`function`||typeof t[`fantasy-land/equals`]==`function`)return typeof e[`fantasy-land/equals`]==`function`&&e[`fantasy-land/equals`](t)&&typeof t[`fantasy-land/equals`]==`function`&&t[`fantasy-land/equals`](e);if(typeof e.equals==`function`||typeof t.equals==`function`)return typeof e.equals==`function`&&e.equals(t)&&typeof t.equals==`function`&&t.equals(e);switch(i){case`Arguments`:case`Array`:case`Object`:if(typeof e.constructor==`function`&&Lk(e.constructor)===`Promise`)return e===t;break;case`Boolean`:case`Number`:case`String`:if(!(typeof e==typeof t&&Bk(e.valueOf(),t.valueOf())))return!1;break;case`Date`:if(!Bk(e.valueOf(),t.valueOf()))return!1;break;case`Error`:return e.name===t.name&&e.message===t.message;case`RegExp`:if(!(e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.sticky===t.sticky&&e.unicode===t.unicode))return!1;break}for(var a=n.length-1;a>=0;){if(n[a]===e)return r[a]===t;--a}switch(i){case`Map`:return e.size===t.size?Yk(e.entries(),t.entries(),n.concat([e]),r.concat([t])):!1;case`Set`:return e.size===t.size?Yk(e.values(),t.values(),n.concat([e]),r.concat([t])):!1;case`Arguments`:case`Array`:case`Object`:case`Boolean`:case`Number`:case`String`:case`Date`:case`Error`:case`RegExp`:case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`ArrayBuffer`:break;default:return!1}var o=qk(e);if(o.length!==qk(t).length)return!1;var s=n.concat([e]),c=r.concat([t]);for(a=o.length-1;a>=0;){var l=o[a];if(!(Rk(l,t)&&Xk(t[l],e[l],s,c)))return!1;--a}return!0}var Zk=Tk(function(e,t){return Xk(e,t,[],[])});function Qk(e,t,n){var r,i;if(typeof e.indexOf==`function`)switch(typeof t){case`number`:if(t===0){for(r=1/t;n<e.length;){if(i=e[n],i===0&&1/i===r)return n;n+=1}return-1}else if(t!==t){for(;n<e.length;){if(i=e[n],typeof i==`number`&&i!==i)return n;n+=1}return-1}return e.indexOf(t,n);case`string`:case`boolean`:case`function`:case`undefined`:return e.indexOf(t,n);case`object`:if(t===null)return e.indexOf(t,n)}for(;n<e.length;){if(Zk(e[n],t))return n;n+=1}return-1}function $k(e,t){return Qk(t,e,0)>=0}function eA(e,t){for(var n=0,r=t.length,i=Array(r);n<r;)i[n]=e(t[n]),n+=1;return i}function tA(e){return`"`+e.replace(/\\/g,`\\\\`).replace(/[\b]/g,`\\b`).replace(/\f/g,`\\f`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`).replace(/\t/g,`\\t`).replace(/\v/g,`\\v`).replace(/\0/g,`\\0`).replace(/"/g,`\\"`)+`"`}var nA=function(e){return(e<10?`0`:``)+e},rA=typeof Date.prototype.toISOString==`function`?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+`-`+nA(e.getUTCMonth()+1)+`-`+nA(e.getUTCDate())+`T`+nA(e.getUTCHours())+`:`+nA(e.getUTCMinutes())+`:`+nA(e.getUTCSeconds())+`.`+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+`Z`};function iA(e){return function(){return!e.apply(this,arguments)}}function aA(e,t,n){for(var r=0,i=n.length;r<i;)t=e(t,n[r]),r+=1;return t}function oA(e,t){for(var n=0,r=t.length,i=[];n<r;)e(t[n])&&(i[i.length]=t[n]),n+=1;return i}function sA(e){return Object.prototype.toString.call(e)===`[object Object]`}var cA=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype[`@@transducer/init`]=Pk.init,e.prototype[`@@transducer/result`]=Pk.result,e.prototype[`@@transducer/step`]=function(e,t){return this.f(t)?this.xf[`@@transducer/step`](e,t):e},e}();function lA(e){return function(t){return new cA(e,t)}}var uA=Tk(Nk([`fantasy-land/filter`,`filter`],lA,function(e,t){return sA(t)?aA(function(n,r){return e(t[r])&&(n[r]=t[r]),n},{},qk(t)):oA(e,t)})),dA=Tk(function(e,t){return uA(iA(e),t)});function fA(e,t){var n=function(n){var r=t.concat([e]);return $k(n,r)?`<Circular>`:fA(n,r)},r=function(e,t){return eA(function(t){return tA(t)+`: `+n(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case`[object Arguments]`:return`(function() { return arguments; }(`+eA(n,e).join(`, `)+`))`;case`[object Array]`:return`[`+eA(n,e).concat(r(e,dA(function(e){return/^\d+$/.test(e)},qk(e)))).join(`, `)+`]`;case`[object Boolean]`:return typeof e==`object`?`new Boolean(`+n(e.valueOf())+`)`:e.toString();case`[object Date]`:return`new Date(`+(isNaN(e.valueOf())?n(NaN):tA(rA(e)))+`)`;case`[object Map]`:return`new Map(`+n(Array.from(e))+`)`;case`[object Null]`:return`null`;case`[object Number]`:return typeof e==`object`?`new Number(`+n(e.valueOf())+`)`:1/e==-1/0?`-0`:e.toString(10);case`[object Set]`:return`new Set(`+n(Array.from(e).sort())+`)`;case`[object String]`:return typeof e==`object`?`new String(`+n(e.valueOf())+`)`:tA(e);
40case`[object Undefined]`:return`undefined`;default:if(typeof e.toString==`function`){var i=e.toString();if(i!==`[object Object]`)return i}return`{`+r(e,qk(e)).join(`, `)+`}`}}var pA=wk(function(e){return fA(e,[])}),mA=Tk(function(e,t){if(e===t)return t;function n(e,t){if(e>t!=t>e)return t>e?t:e}var r=n(e,t);if(r!==void 0)return r;var i=n(typeof e,typeof t);if(i!==void 0)return i===typeof e?e:t;var a=pA(e),o=n(a,pA(t));return o===void 0?t:o===a?e:t}),hA=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype[`@@transducer/init`]=Pk.init,e.prototype[`@@transducer/result`]=Pk.result,e.prototype[`@@transducer/step`]=function(e,t){return this.xf[`@@transducer/step`](e,this.f(t))},e}(),gA=function(e){return function(t){return new hA(e,t)}},_A=Tk(Nk([`fantasy-land/map`,`map`],gA,function(e,t){switch(Object.prototype.toString.call(t)){case`[object Function]`:return kk(t.length,function(){return e.call(this,t.apply(this,arguments))});case`[object Object]`:return aA(function(n,r){return n[r]=e(t[r]),n},{},qk(t));default:return eA(e,t)}})),vA=Number.isInteger||function(e){return e<<0===e};function yA(e){return Object.prototype.toString.call(e)===`[object String]`}function bA(e,t){var n=e<0?t.length+e:e;return yA(t)?t.charAt(n):t[n]}var xA=Tk(function(e,t){if(t!=null)return vA(e)?bA(e,t):t[e]}),SA=wk(function(e){return jk(e)?!0:!e||typeof e!=`object`||yA(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),CA=typeof Symbol<`u`?Symbol.iterator:`@@iterator`;function wA(e,t,n){return function(r,i,a){if(SA(a))return e(r,i,a);if(a==null)return i;if(typeof a[`fantasy-land/reduce`]==`function`)return t(r,i,a,`fantasy-land/reduce`);if(a[CA]!=null)return n(r,i,a[CA]());if(typeof a.next==`function`)return n(r,i,a);if(typeof a.reduce==`function`)return t(r,i,a,`reduce`);throw TypeError(`reduce: list must be array or iterable`)}}function TA(e,t,n){for(var r=0,i=n.length;r<i;){if(t=e[`@@transducer/step`](t,n[r]),t&&t[`@@transducer/reduced`]){t=t[`@@transducer/value`];break}r+=1}return e[`@@transducer/result`](t)}var EA=Tk(function(e,t){return Dk(e.length,function(){return e.apply(t,arguments)})});function DA(e,t,n){for(var r=n.next();!r.done;){if(t=e[`@@transducer/step`](t,r.value),t&&t[`@@transducer/reduced`]){t=t[`@@transducer/value`];break}r=n.next()}return e[`@@transducer/result`](t)}function OA(e,t,n,r){return e[`@@transducer/result`](n[r](EA(e[`@@transducer/step`],e),t))}var kA=wA(TA,OA,DA),AA=function(){function e(e){this.f=e}return e.prototype[`@@transducer/init`]=function(){throw Error(`init not implemented on XWrap`)},e.prototype[`@@transducer/result`]=function(e){return e},e.prototype[`@@transducer/step`]=function(e,t){return this.f(e,t)},e}();function jA(e){return new AA(e)}var MA=Ak(function(e,t,n){return kA(typeof e==`function`?jA(e):e,t,n)}),NA=wk(function(e){return function(){return e}}),PA=Tk(function(e,t){return Ek(t,[e])}),FA=wk(function(e){return kk(e.length,e)});function IA(e,t,n){if(vA(e)&&jk(n)){var r=[].concat(n);return r[e]=t,r}var i={};for(var a in n)i[a]=n[a];return i[e]=t,i}var LA=wk(function(e){return e==null}),RA=Ak(function e(t,n,r){if(t.length===0)return n;var i=t[0];if(t.length>1){var a=!LA(r)&&Rk(i,r)&&typeof r[i]==`object`?r[i]:vA(t[1])?[]:{};n=e(Array.prototype.slice.call(t,1),n,a)}return IA(i,n,r)}),zA=Ak(function(e,t,n){return RA([e],t,n)});function BA(e){var t=Object.prototype.toString.call(e);return t===`[object Function]`||t===`[object AsyncFunction]`||t===`[object GeneratorFunction]`||t===`[object AsyncGeneratorFunction]`}function VA(e){return function t(n){for(var r,i,a,o=[],s=0,c=n.length;s<c;){if(SA(n[s]))for(r=e?t(n[s]):n[s],a=0,i=r.length;a<i;)o[o.length]=r[a],a+=1;else o[o.length]=n[s];s+=1}return o}}function HA(e){return{"@@transducer/value":e,"@@transducer/reduced":!0}}var UA=`@@transducer/init`,WA=`@@transducer/step`,GA=`@@transducer/result`,KA=function(){function e(e){this.xf=e}return e.prototype[UA]=Pk.init,e.prototype[GA]=Pk.result,e.prototype[WA]=function(e,t){var n=this.xf[WA](e,t);return n[`@@transducer/reduced`]?HA(n):n},e}(),qA=function(){function e(e){this.xf=new KA(e)}return e.prototype[UA]=Pk.init,e.prototype[GA]=Pk.result,e.prototype[WA]=function(e,t){return SA(t)?kA(this.xf,e,t):TA(this.xf,e,[t])},e}(),JA=function(e){return new qA(e)};function YA(e){return function(t){return gA(e)(JA(t))}}var XA=Tk(Nk([`fantasy-land/chain`,`chain`],YA,function(e,t){return typeof t==`function`?function(n){return e(t(n))(n)}:VA(!1)(_A(e,t))}));function ZA(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function QA(e,t){return function(){var n=arguments.length;if(n===0)return t();var r=arguments[n-1];return jk(r)||typeof r[e]!=`function`?t.apply(this,arguments):r[e].apply(r,Array.prototype.slice.call(arguments,0,n-1))}}var $A=wk(QA(`tail`,Ak(QA(`slice`,function(e,t,n){return Array.prototype.slice.call(n,e,t)}))(1,1/0)));function ej(){if(arguments.length===0)throw Error(`pipe requires at least one argument`);return Dk(arguments[0].length,MA(ZA,arguments[0],$A(arguments)))}function tj(e){return e}
40var nj=wk(tj),rj=Tk(function(e,t){if(jk(e)){if(jk(t))return e.concat(t);throw TypeError(pA(t)+` is not an array`)}if(yA(e)){if(yA(t))return e+t;throw TypeError(pA(t)+` is not a string`)}if(e!=null&&BA(e[`fantasy-land/concat`]))return e[`fantasy-land/concat`](t);if(e!=null&&BA(e.concat))return e.concat(t);throw TypeError(pA(e)+` does not have a method named "concat" or "fantasy-land/concat"`)}),ij=wk(function(e){return Dk(MA(mA,0,_A(function(e){return e[0].length},e)),function(){for(var t=0;t<e.length;){if(e[t][0].apply(this,arguments))return e[t][1].apply(this,arguments);t+=1}})}),aj=Tk(function(e,t){return t==null||t!==t?e:t}),oj=Tk(function(e,t){if(e.length===0||LA(t))return!1;for(var n=t,r=0;r<e.length;)if(!LA(n)&&Rk(e[r],n))n=n[e[r]],r+=1;else return!1;return!0}),sj=Tk(function(e,t){return oj([e],t)}),cj=Ak(function(e,t,n){return kk(Math.max(e.length,t.length,n.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):n.apply(this,arguments)})}),lj=Tk($k),uj=Tk(function(e,t){return kk(e+1,function(){var n=arguments[e];if(n!=null&&BA(n[t]))return n[t].apply(n,Array.prototype.slice.call(arguments,0,e));throw TypeError(pA(n)+` does not have a method named "`+t+`"`)})}),dj=Tk(function(e,t){return t instanceof e||t!=null&&(t.constructor===e||e.name===`Object`&&typeof t==`object`)}),fj=wk(function(e){return!LA(e)}),pj=uj(1,`join`);function mj(e,t){for(var n=t,r=0;r<e.length;r+=1){if(n==null)return;var i=e[r];n=vA(i)?bA(i,n):n[i]}return n}var hj=Tk(mj),gj=Ak(function(e,t,n){return aj(e,xA(t,n))}),_j=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype[`@@transducer/init`]=Pk.init,e.prototype[`@@transducer/result`]=Pk.result,e.prototype[`@@transducer/step`]=function(e,t){return this.f(t),this.xf[`@@transducer/step`](e,t)},e}();function vj(e){return function(t){return new _j(e,t)}}var yj=Tk(Nk([],vj,function(e,t){return e(t),t})),bj;(function(e){e.assertEqual=e=>e;function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(bj||={});var xj;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(xj||={});var H=bj.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Sj=e=>{switch(typeof e){case`undefined`:return H.undefined;case`string`:return H.string;case`number`:return isNaN(e)?H.nan:H.number;case`boolean`:return H.boolean;case`function`:return H.function;case`bigint`:return H.bigint;case`symbol`:return H.symbol;case`object`:return Array.isArray(e)?H.array:e===null?H.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?H.promise:typeof Map<`u`&&e instanceof Map?H.map:typeof Set<`u`&&e instanceof Set?H.set:typeof Date<`u`&&e instanceof Date?H.date:H.object;default:return H.unknown}},U=bj.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Cj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`),wj=class e extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>
40{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,bj.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};wj.create=e=>new wj(e);var Tj=(e,t)=>{let n;switch(e.code){case U.invalid_type:n=e.received===H.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case U.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,bj.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:n=`Unrecognized key(s) in object: ${bj.joinValues(e.keys,`, `)}`;break;case U.invalid_union:n=`Invalid input`;break;case U.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${bj.joinValues(e.options)}`;break;case U.invalid_enum_value:n=`Invalid enum value. Expected ${bj.joinValues(e.options)}, received '${e.received}'`;break;case U.invalid_arguments:n=`Invalid function arguments`;break;case U.invalid_return_type:n=`Invalid function return type`;break;case U.invalid_date:n=`Invalid date`;break;case U.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:bj.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case U.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case U.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case U.custom:n=`Invalid input`;break;case U.invalid_intersection_types:n=`Intersection results could not be merged`;break;case U.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case U.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,bj.assertNever(e)}return{message:n}},Ej=Tj;function Dj(e){Ej=e}function Oj(){return Ej}var kj=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},Aj=[];function W(e,t){let n=Oj(),r=kj({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Tj?void 0:Tj].filter(e=>!!e)});e.common.issues.push(r)}var jj=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return G;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return G;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},G=Object.freeze({status:`aborted`}),Mj=e=>({status:`dirty`,value:e}),Nj=e=>({status:`valid`,value:e}),Pj=e=>e.status===`aborted`,Fj=e=>e.status===`dirty`,Ij=e=>e.status===`valid`,Lj=e=>typeof Promise<`u`&&e instanceof Promise;function Rj(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function zj(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var K;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(K||={});var Bj,Vj,Hj=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Uj=(e,t)=>{if(Ij(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new wj(e.common.issues),this._error}}};function q(e){if(!e)return{};
vendor: 4,219 bytes, line 40
40let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var J=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Sj(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sj(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new jj,ctx:{common:e.parent.common,data:e.data,parsedType:Sj(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Lj(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sj(e)};return Uj(n,this._parseSync({data:e,path:n.path,parent:n}))}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sj(e)},r=this._parse({data:e,path:n.path,parent:n});return Uj(n,await(Lj(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:U.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new BM({schema:this,typeName:Y.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return VM.create(this,this._def)}nullable(){return HM.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xM.create(this,this._def)}promise(){return zM.create(this,this._def)}or(e){return wM.create([this,e],this._def)}and(e){return OM.create(this,e,this._def)}transform(e){return new BM({...q(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new UM({...q(this._def),innerType:this,defaultValue:t,typeName:Y.ZodDefault})}brand(){return new qM({typeName:Y.ZodBranded,type:this,...q(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new WM({...q(this._def),innerType:this,catchValue:t,typeName:Y.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return JM.create(this,e)}readonly(){return YM.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Wj=/^c[^\s-]{8,}
vendor: 8,062 bytes, line 40
40$/i,Gj=/^[0-9a-z]+$/,Kj=/^[0-9A-HJKMNP-TV-Z]{26}$/,qj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Jj=/^[a-z0-9_-]{21}$/i,Yj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zj=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Qj,$j=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eM=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nM=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,rM=RegExp(`^${nM}$`);function iM(e){let t=`([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`),t}function aM(e){return RegExp(`^${iM(e)}$`)}function oM(e){let t=`${nM}T${iM(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function sM(e,t){return!!((t===`v4`||!t)&&$j.test(e)||(t===`v6`||!t)&&eM.test(e))}var cM=class e extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==H.string){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.string,received:t.parsedType}),G}let t=new jj,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?W(n,{code:U.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&W(n,{code:U.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Xj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`email`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Qj||=new RegExp(Zj,`u`),Qj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`emoji`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)qj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`uuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Jj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`nanoid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Wj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Gj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`cuid2`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Kj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ulid`,code:U.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),W(n,{validation:`url`,code:U.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`regex`,code:U.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?oM(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?rM.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?aM(r).test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{code:U.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Yj.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`duration`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?sM(e.data,r.version)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`ip`,code:U.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?tM.test(e.data)||(n=this._getOrReturnCtx(e,n),W(n,{validation:`base64`,code:U.invalid_string,message:r.message}),t.dirty()):bj.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:U.invalid_string,...K.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...K.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...K.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...K.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...K.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...K.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...K.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...K.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...K.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...K.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...K.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...K.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...K.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...K.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...K.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...K.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...K.errToObj(t)})}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}
vendor: 21,030 bytes, line 40
40get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};cM.create=e=>new cM({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...q(e)});function lM(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(`.`,``))%parseInt(t.toFixed(i).replace(`.`,``))/10**i}var uM=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==H.number){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.number,received:t.parsedType}),G}let t,n=new jj;for(let r of this._def.checks)r.kind===`int`?bj.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?lM(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_finite,message:r.message}),n.dirty()):bj.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:K.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:K.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:K.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:K.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&bj.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};uM.create=e=>new uM({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...q(e)});var dM=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==H.bigint){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.bigint,received:t.parsedType}),G}let t,n=new jj;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),W(t,{code:U.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):bj.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,K.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,K.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,K.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,K.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:K.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:K.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};dM.create=e=>new dM({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...q(e)});var fM=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==H.boolean){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.boolean,received:t.parsedType}),G}return Nj(e.data)}};fM.create=e=>new fM({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...q(e)});var pM=class e extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==H.date){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.date,received:t.parsedType}),G}if(isNaN(e.data.getTime()))return W(this._getOrReturnCtx(e),{code:U.invalid_date}),G;let t=new jj,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),W(n,{code:U.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):bj.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:K.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:K.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};pM.create=e=>new pM({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...q(e)});var mM=class extends J{_parse(e){if(this._getType(e)!==H.symbol){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.symbol,received:t.parsedType}),G}return Nj(e.data)}};mM.create=e=>new mM({typeName:Y.ZodSymbol,...q(e)});var hM=class extends J{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.undefined,received:t.parsedType}),G}return Nj(e.data)}};hM.create=e=>new hM({typeName:Y.ZodUndefined,...q(e)});var gM=class extends J{_parse(e){if(this._getType(e)!==H.null){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.null,received:t.parsedType}),G}return Nj(e.data)}};gM.create=e=>new gM({typeName:Y.ZodNull,...q(e)});var _M=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return Nj(e.data)}};_M.create=e=>new _M({typeName:Y.ZodAny,...q(e)});var vM=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Nj(e.data)}};vM.create=e=>new vM({typeName:Y.ZodUnknown,...q(e)});var yM=class extends J{_parse(e){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.never,received:t.parsedType}),G}};yM.create=e=>new yM({typeName:Y.ZodNever,...q(e)});var bM=class extends J{_parse(e){if(this._getType(e)!==H.undefined){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.void,received:t.parsedType}),G}return Nj(e.data)}};bM.create=e=>new bM({typeName:Y.ZodVoid,...q(e)});var xM=class e extends J{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==H.array)return W(t,{code:U.invalid_type,expected:H.array,received:t.parsedType}),G;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(W(t,{code:e?U.too_big:U.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(W(t,{code:U.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(W(t,{code:U.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Hj(t,e,t.path,n)))).then(e=>jj.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Hj(t,e,t.path,n)));return jj.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:K.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:K.toString(n)}})}nonempty(e){return this.min(1,e)}};xM.create=(e,t)=>new xM({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...q(t)});function SM(e){if(e instanceof CM){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=VM.create(SM(r))}return new CM({...e._def,shape:()=>t})}else if(e instanceof xM)return new xM({...e._def,type:SM(e.element)});else if(e instanceof VM)return VM.create(SM(e.unwrap()));else if(e instanceof HM)return HM.create(SM(e.unwrap()));else if(e instanceof kM)return kM.create(e.items.map(e=>SM(e)));else return e}var CM=class e extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:bj.objectKeys(e)}}_parse(e){if(this._getType(e)!==H.object){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof yM&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Hj(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof yM){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(W(n,{code:U.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Hj(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>jj.mergeObjectSync(t,e)):jj.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return K.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{var r;let i=(r=this._def).errorMap?.call(r,e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:K.errToObj(t).message??i}:{message:i}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return bj.objectKeys(t).forEach(e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return bj.objectKeys(this.shape).forEach(e=>{t[e]||(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}deepPartial(){return SM(this)}partial(t){let n={};return bj.objectKeys(this.shape).forEach(e=>{let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return bj.objectKeys(this.shape).forEach(e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof VM;)t=t._def.innerType;n[e]=t}}),new e({...this._def,shape:()=>n})}keyof(){return IM(bj.objectKeys(this.shape))}};CM.create=(e,t)=>new CM({shape:()=>e,unknownKeys:`strip`,catchall:yM.create(),typeName:Y.ZodObject,...q(t)}),CM.strictCreate=(e,t)=>new CM({shape:()=>e,unknownKeys:`strict`,catchall:yM.create(),typeName:Y.ZodObject,...q(t)}),CM.lazycreate=(e,t)=>new CM({shape:e,unknownKeys:`strip`,catchall:yM.create(),typeName:Y.ZodObject,...q(t)});var wM=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new wj(e.ctx.common.issues));return W(t,{code:U.invalid_union,unionErrors:n}),G}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new wj(e));return W(t,{code:U.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};wM.create=(e,t)=>new wM({options:e,typeName:Y.ZodUnion,...q(t)});var TM=e=>e instanceof PM?TM(e.schema):e instanceof BM?TM(e.innerType()):e instanceof FM?[e.value]:e instanceof LM?e.options:e instanceof RM?bj.objectValues(e.enum):e instanceof UM?TM(e._def.innerType):e instanceof hM?[void 0]:e instanceof gM?[null]:e instanceof VM?[void 0,...TM(e.unwrap())]:e instanceof HM?[null,...TM(e.unwrap())]:e instanceof qM||e instanceof YM?TM(e.unwrap()):e instanceof WM?TM(e._def.innerType):[],EM=class e extends J{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.object)return W(t,{code:U.invalid_type,expected:H.object,received:t.parsedType}),G;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(W(t,{code:U.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),G)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=TM(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Y.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...q(r)})}};function DM(e,t){let n=Sj(e),r=Sj(t);if(e===t)return{valid:!0,data:e};if(n===H.object&&r===H.object){let n=bj.objectKeys(t),r=bj.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=DM(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===H.array&&r===H.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=DM(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===H.date&&r===H.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var OM=class extends J{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Pj(e)||Pj(r))return G;let i=DM(e.value,r.value);return i.valid?((Fj(e)||Fj(r))&&t.dirty(),{status:t.value,value:i.data}):(W(n,{code:U.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};OM.create=(e,t,n)=>new OM({left:e,right:t,typeName:Y.ZodIntersection,...q(n)});var kM=class e extends J{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.array)return W(n,{code:U.invalid_type,expected:H.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return W(n,{code:U.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),G;!this._def.rest&&n.data.length>this._def.items.length&&(W(n,{code:U.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Hj(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>jj.mergeArray(t,e)):jj.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};kM.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new kM({items:e,typeName:Y.ZodTuple,rest:null,...q(t)})};var AM=class e extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.object)return W(n,{code:U.invalid_type,expected:H.object,received:n.parsedType}),G;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Hj(n,e,n.path,e)),value:a._parse(new Hj(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?jj.mergeObjectAsync(t,r):jj.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof J?new e({keyType:t,valueType:n,typeName:Y.ZodRecord,...q(r)}):new e({keyType:cM.create(),valueType:t,typeName:Y.ZodRecord,...q(n)})}},jM=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.map)return W(n,{code:U.invalid_type,expected:H.map,received:n.parsedType}),G;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Hj(n,e,n.path,[a,`key`])),value:i._parse(new Hj(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return G;
vendor: 3,871 bytes, line 40
40(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return G;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};jM.create=(e,t,n)=>new jM({valueType:t,keyType:e,typeName:Y.ZodMap,...q(n)});var MM=class e extends J{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==H.set)return W(n,{code:U.invalid_type,expected:H.set,received:n.parsedType}),G;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(W(n,{code:U.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(W(n,{code:U.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return G;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Hj(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:K.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:K.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};MM.create=(e,t)=>new MM({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...q(t)});var NM=class e extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==H.function)return W(t,{code:U.invalid_type,expected:H.function,received:t.parsedType}),G;function n(e,n){return kj({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Oj(),Tj].filter(e=>!!e),issueData:{code:U.invalid_arguments,argumentsError:n}})}function r(e,n){return kj({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Oj(),Tj].filter(e=>!!e),issueData:{code:U.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof zM){let e=this;return Nj(async function(...t){let o=new wj([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return Nj(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new wj([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new wj([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:kM.create(t).rest(vM.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||kM.create([]).rest(vM.create()),returns:n||vM.create(),typeName:Y.ZodFunction,...q(r)})}},PM=class extends J{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};PM.create=(e,t)=>new PM({getter:e,typeName:Y.ZodLazy,...q(t)});var FM=class extends J{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return W(t,{received:t.data,code:U.invalid_literal,expected:this._def.value}),G}return{status:`valid`,value:e.data}}get value(){return this._def.value}};FM.create=(e,t)=>new FM({value:e,typeName:Y.ZodLiteral,...q(t)});function IM(e,t){return new LM({values:e,typeName:Y.ZodEnum,...q(t)})}var LM=class e extends J{constructor(){super(...arguments),Bj.set(this,void 0)}
40_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{expected:bj.joinValues(n),received:t.parsedType,code:U.invalid_type}),G}if(Rj(this,Bj,`f`)||zj(this,Bj,new Set(this._def.values),`f`),!Rj(this,Bj,`f`).has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return W(t,{received:t.data,code:U.invalid_enum_value,options:n}),G}return Nj(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Bj=new WeakMap,LM.create=IM;var RM=class extends J{constructor(){super(...arguments),Vj.set(this,void 0)}_parse(e){let t=bj.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==H.string&&n.parsedType!==H.number){let e=bj.objectValues(t);return W(n,{expected:bj.joinValues(e),received:n.parsedType,code:U.invalid_type}),G}if(Rj(this,Vj,`f`)||zj(this,Vj,new Set(bj.getValidEnumValues(this._def.values)),`f`),!Rj(this,Vj,`f`).has(e.data)){let e=bj.objectValues(t);return W(n,{received:n.data,code:U.invalid_enum_value,options:e}),G}return Nj(e.data)}get enum(){return this._def.values}};Vj=new WeakMap,RM.create=(e,t)=>new RM({values:e,typeName:Y.ZodNativeEnum,...q(t)});var zM=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==H.promise&&t.common.async===!1?(W(t,{code:U.invalid_type,expected:H.promise,received:t.parsedType}),G):Nj((t.parsedType===H.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};zM.create=(e,t)=>new zM({type:e,typeName:Y.ZodPromise,...q(t)});var BM=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{W(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return G;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?Mj(r.value):r});{if(t.value===`aborted`)return G;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?G:r.status===`dirty`||t.value===`dirty`?Mj(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?G:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?G:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ij(e))return e;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Ij(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);bj.assertNever(r)}};BM.create=(e,t,n)=>new BM({schema:e,typeName:Y.ZodEffects,effect:t,...q(n)}),BM.createWithPreprocess=(e,t,n)=>new BM({schema:t,effect:{type:`preprocess`,transform:e},typeName:Y.ZodEffects,...q(n)});var VM=class extends J{_parse(e){return this._getType(e)===H.undefined?Nj(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};VM.create=(e,t)=>
40new VM({innerType:e,typeName:Y.ZodOptional,...q(t)});var HM=class extends J{_parse(e){return this._getType(e)===H.null?Nj(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};HM.create=(e,t)=>new HM({innerType:e,typeName:Y.ZodNullable,...q(t)});var UM=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===H.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};UM.create=(e,t)=>new UM({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...q(t)});var WM=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Lj(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new wj(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new wj(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};WM.create=(e,t)=>new WM({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...q(t)});var GM=class extends J{_parse(e){if(this._getType(e)!==H.nan){let t=this._getOrReturnCtx(e);return W(t,{code:U.invalid_type,expected:H.nan,received:t.parsedType}),G}return{status:`valid`,value:e.data}}};GM.create=e=>new GM({typeName:Y.ZodNaN,...q(e)});var KM=Symbol(`zod_brand`),qM=class extends J{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},JM=class e extends J{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),Mj(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?G:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Y.ZodPipeline})}},YM=class extends J{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Ij(e)&&(e.value=Object.freeze(e.value)),e);return Lj(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};YM.create=(e,t)=>new YM({innerType:e,typeName:Y.ZodReadonly,...q(t)});function XM(e,t={},n){return e?_M.create().superRefine((r,i)=>{if(!e(r)){let e=typeof t==`function`?t(r):typeof t==`string`?{message:t}:t,a=e.fatal??n??!0,o=typeof e==`string`?{message:e}:e;i.addIssue({code:`custom`,...o,fatal:a})}}):_M.create()}var ZM={object:CM.lazycreate},Y;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(Y||={});var QM=(e,t={message:`Input not instance of ${e.name}`})=>XM(t=>t instanceof e,t),$M=cM.create,eN=uM.create,tN=GM.create,nN=dM.create,rN=fM.create,iN=pM.create,aN=mM.create,oN=hM.create,sN=gM.create,cN=_M.create,lN=vM.create,uN=yM.create,dN=bM.create,fN=xM.create,pN=CM.create,mN=CM.strictCreate,hN=wM.create,gN=EM.create,_N=OM.create,vN=kM.create,yN=AM.create,bN=jM.create,xN=MM.create,SN=NM.create,CN=PM.create,wN=FM.create,TN=LM.create,EN=RM.create,DN=zM.create,ON=BM.create,kN=VM.create,AN=HM.create,jN=BM.createWithPreprocess,MN=JM.create,NN=()=>$M().optional(),PN=()=>eN().optional(),FN=()=>rN().optional(),IN={string:e=>cM.create({...e,coerce:!0}),number:e=>uM.create({...e,coerce:!0}),boolean:e=>fM.create({...e,coerce:!0}),bigint:e=>dM.create({...e,coerce:!0}),date:e=>pM.create({...e,coerce:!0})}
40,LN=G,X=Object.freeze({__proto__:null,defaultErrorMap:Tj,setErrorMap:Dj,getErrorMap:Oj,makeIssue:kj,EMPTY_PATH:Aj,addIssueToContext:W,ParseStatus:jj,INVALID:G,DIRTY:Mj,OK:Nj,isAborted:Pj,isDirty:Fj,isValid:Ij,isAsync:Lj,get util(){return bj},get objectUtil(){return xj},ZodParsedType:H,getParsedType:Sj,ZodType:J,datetimeRegex:oM,ZodString:cM,ZodNumber:uM,ZodBigInt:dM,ZodBoolean:fM,ZodDate:pM,ZodSymbol:mM,ZodUndefined:hM,ZodNull:gM,ZodAny:_M,ZodUnknown:vM,ZodNever:yM,ZodVoid:bM,ZodArray:xM,ZodObject:CM,ZodUnion:wM,ZodDiscriminatedUnion:EM,ZodIntersection:OM,ZodTuple:kM,ZodRecord:AM,ZodMap:jM,ZodSet:MM,ZodFunction:NM,ZodLazy:PM,ZodLiteral:FM,ZodEnum:LM,ZodNativeEnum:RM,ZodPromise:zM,ZodEffects:BM,ZodTransformer:BM,ZodOptional:VM,ZodNullable:HM,ZodDefault:UM,ZodCatch:WM,ZodNaN:GM,BRAND:KM,ZodBranded:qM,ZodPipeline:JM,ZodReadonly:YM,custom:XM,Schema:J,ZodSchema:J,late:ZM,get ZodFirstPartyTypeKind(){return Y},coerce:IN,any:cN,array:fN,bigint:nN,boolean:rN,date:iN,discriminatedUnion:gN,effect:ON,enum:TN,function:SN,instanceof:QM,intersection:_N,lazy:CN,literal:wN,map:bN,nan:tN,nativeEnum:EN,never:uN,null:sN,nullable:AN,number:eN,object:pN,oboolean:FN,onumber:PN,optional:kN,ostring:NN,pipeline:MN,preprocess:jN,promise:DN,record:yN,set:xN,strictObject:mN,string:$M,symbol:aN,transformer:ON,tuple:vN,undefined:oN,union:hN,unknown:lN,void:dN,NEVER:LN,ZodIssueCode:U,quotelessJson:Cj,ZodError:wj});function RN({fetch:e,GRAPHQL_URL:t,logger:n}){let r=X.object({data:X.object({transactions:X.object({edges:X.array(X.object({node:X.record(X.any())}))})})});return i=>ik(i).chain(sk(i=>e(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({query:` 41 query GetTransactions ($transactionIds: [ID!]!) { 42 transactions(ids: $transactionIds) { 43 edges { 44 node { 45 owner { 46 address 47 } 48 tags { 49 name 50 value 51 } 52 block { 53 id 54 height 55 timestamp 56 } 57 } 58 } 59 } 60 }`,variables:{transactionIds:[i]}})}).then(async e=>{if(e.ok)return e.json();throw n(`Error Encountered when querying gateway for transaction "%s"`,i),Error(`${e.status}: ${await e.text()}`)}).then(r.parse).then(hj([`data`,`transactions`,`edges`,`0`,`node`])))).toPromise()}var zN=tw(dw(),1),BN=(e=`@permaweb/aoconnect`)=>{let t=(0,zN.default)(e);return t.child=e=>BN(`${t.namespace}:${e}`),t.tap=(e,...n)=>yj((...r)=>t(e,...n,...r)),t},VN=({url:e,path:t})=>t?t.startsWith(`/`)?VN({url:e,path:t.slice(1)}):(e=new URL(e),e.pathname+=t,e.toString()):e;function HN(e){return ej(aj([]),MA((e,t)=>ej(gj([],t.name),PA(t.value),zA(t.name,Sk,e))(e),{}),_A(e=>e.length>1?e:e[0]))(e)}function UN(e){return ij([[dj(String),Zk(e)],[dj(Array),lj(e)],[xk,bk]])}function WN(e){let t;return dj(wj,e)?(t=Error(GN(e)),t.stack+=e.stack):t=dj(Error,e)?e:sj(`message`,e)?Error(e.message):dj(String,e)?Error(e):Error(`An error occurred`),t}function GN(e){return ej(e=>function e(t,n,r){return MA((t,i)=>ej(ij([[Zk(U.invalid_arguments),()=>e(i.argumentsError,422,`Invalid Arguments`)],[Zk(U.invalid_return_type),()=>e(i.returnTypeError,500,`Invalid Return`)],[Zk(U.invalid_union),()=>XA(t=>e(t,400,`Invalid Union`),i.unionErrors)],[xk,()=>[{...i,status:n,contextCode:r}]]]),rj(t))(i.code),[],t.issues)}(e,400,``),e=>MA((e,t)=>{let{message:n,path:r,contextCode:i}=t,a=r[1]||r[0],o=i?`${i} `:``;return e.push(`${o}'${a}': ${n}.`),e},[],e),pj(` | `))(e)}var KN=X.object({id:X.string().min(1,{message:`message is required to be a message id`}),processId:X.string().min(1,{message:`process is required to be a process id`})});function qN(){return e=>ik(e).map(KN.parse).map(()=>e)}var JN=X.object({name:X.string(),value:X.string()}),YN=X.function().args(X.object({Id:X.string(),Target:X.string(),Owner:X.string(),Anchor:X.string().optional(),Data:X.any().default(`1234`),Tags:X.array(X.object({name:X.string(),value:X.string()}))})).returns(X.promise(X.any())),XN=X.function().args(X.object({id:X.string().min(1,{message:`message id is required`}),processId:X.string().min(1,{message:`process id is required`})})).returns(X.promise(X.any())),ZN=X.function().args(X.object({process:X.string().min(1,{message:`process id is required`}),from:X.string().optional(),to:X.string().optional(),sort:X.enum([`ASC`,`DESC`]).default(`ASC`),limit:X.number().optional()})).returns(X.promise(X.object({edges:X.array(X.object({cursor:X.string(),node:X.object({Output:X.any().optional(),Messages:X.array(X.any()).optional(),Spawns:X.array(X.any()).optional(),Error:X.any().optional()})}))}))),QN=X.function().args(X.object({processId:X.string(),data:X.any(),tags:X.array(JN),anchor:X.string().optional(),signer:X.any()})).returns(X.promise(X.object({messageId:X.string()}).passthrough())),$N=X.function().args(X.object({data:X.any(),tags:X.array(JN),signer:X.any()})).returns(X.promise(X.object({processId:X.string()}).passthrough())),eP=X.function().args(X.object({process:X.string(),message:X.string(),baseLayer:X.boolean().optional(),exclude:X.array(X.string()).optional()})).returns(X.promise(X.object({assignmentId:X.string()}
60).passthrough())),tP=QN;X.function().args(X.object({suUrl:X.string().url(),processId:X.string()})).returns(X.promise(X.object({tags:X.array(JN)}).passthrough())),X.function().args(X.string()).returns(X.promise(X.object({url:X.string()})));var nP=X.function().args(X.string()).returns(X.promise(X.boolean())),rP=X.function().args(X.string()).returns(X.promise(X.object({tags:X.array(JN)}).passthrough())),iP=X.function().args(X.object({data:X.any(),tags:X.array(JN),target:X.string().optional(),anchor:X.string().optional()})).returns(X.promise(X.object({id:X.string(),raw:X.any()})));function aP({loadResult:e}){return e=sk(XN.implement(e)),t=>ik({id:t.id,processId:t.processId}).chain(e)}function oP(e){let t=qN(e),n=aP(e);return({message:r,process:i})=>ik({id:r,processId:i}).chain(t).chain(n).map(e.logger.tap(`readResult result for message "%s": %O`,r)).map(e=>e).bimap(WN,nj).toPromise()}var sP=(...e)=>t=>e.reduce((e,t)=>t(e),t),cP=e=>t=>t??e,lP=e=>t=>sP(e=>e&&e[t],cP(e)),uP=e=>t=>{let n={};for(let r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r],r,t));return n},dP=e=>(...t)=>!e(...t),fP=e=>t=>{let n=t.findIndex(t=>t.name===`Data-Protocol`&&t.value===e);if(n===-1)return[0,0];let r=t.findIndex((t,r)=>r>n&&t.name===`Data-Protocol`&&t.value!==e);return r===-1&&(r=t.length),[n,r]},pP=e=>{let t=e.findIndex(e=>e.name===`Data-Protocol`);return t===-1&&(t=e.length),t},mP=e=>t=>t.name===e,hP=(e,t)=>sP(fP(e),([e,n])=>t.slice(e,n))(t),gP=(e,t,n)=>sP(t=>hP(e,t),e=>e.filter(mP(t)))(n),_P=(e,t,n)=>sP(n=>gP(e,t,n),e=>e[0])(n),vP=(e,t)=>(t=t.filter(t=>t.name!==`Data-Protocol`||t.value!==e),t.length?[{name:`Data-Protocol`,value:e},...t]:[]),yP=(e,t,n)=>{let[r,i]=fP(e)(n),[a,o,s]=[n.slice(0,r),n.slice(r,i),n.slice(i)];return o.length||(t=vP(e,t),a=s,s=[]),[a,o,t,s].flat(1)},bP=(e,t)=>{let n=pP(t),[r,i]=[t.slice(0,n),t.slice(n)];return[r,e,i].flat(1)},xP=(e,t,n)=>{let[r,i]=fP(e)(n),[a,o]=[n.slice(0,r),n.slice(i)];return o.length===n.length&&(a=o,o=[]),[a,vP(e,t),o].flat(1)},SP=(e,t)=>xP(e,[],t),CP=(e,t,n)=>{let[r,i]=fP(e)(n),[a,o,s]=[n.slice(0,r),n.slice(r,i),n.slice(i)];return[a,vP(e,o.filter(dP(mP(t)))),s].flat(1)},wP=(e,t=!1)=>sP(cP([]),e=>e.reduce((e,t)=>sP(lP([])(t.name),e=>(e.push(t.value),e),n=>(e[t.name]=n,e))(e),{}),uP(e=>t?e:e[0]))(e),TP=(e,t,n)=>sP(cP([]),t=>hP(e,t),e=>wP(e,n))(t),EP=(e,t)=>TP(e,t,!0),DP=(e,t)=>TP(e,t,!1),OP=e=>{let t=pP(e);return wP(e.slice(0,t),!1)},kP=e=>{let t=pP(e);return wP(e.slice(0,t),!0)},AP=e=>({findAll:t=>hP(e,t),findAllByName:(t,n)=>gP(e,t,n),findByName:(t,n)=>_P(e,t,n),create:t=>vP(e,t),update:(t,n)=>xP(e,t,n),concat:(t,n)=>yP(e,t,n),removeAll:t=>SP(e,t),removeAllByName:(t,n)=>CP(e,t,n),parse:t=>DP(e,t),parseAll:t=>EP(e,t),concatUnassoc:bP,parseUnassoc:OP,parseAllUnassoc:kP}),jP=AP(`ao`),MP=FA(jP.removeAllByName),NP=FA(jP.concat),PP=FA(jP.concatUnassoc),FP=X.array(X.object({name:X.string(),value:X.string()}));function IP(){return e=>ik(e.tags).map(aj([])).map(MP(`Variant`)).map(MP(`Type`)).map(NP([{name:`Variant`,value:`ao.TN.1`},{name:`Type`,value:`Message`}])).map(FP.parse).map(zA(`tags`,Sk,e))}function LP({logger:e}){return t=>ik(t).chain(cj(NA(t.data),()=>ak(t),()=>ak(` `).map(zA(`data`,Sk,t)).map(e=>ej(xA(`tags`),PP([{name:`Content-Type`,value:`text/plain`}]),zA(`tags`,Sk,e))(e)).map(e.tap(`added pseudo-random string as message "data"`)))).map(e=>ej(xA(`tags`),PP([{name:`SDK`,value:`aoconnect`}]),zA(`tags`,Sk,e))(e))}function RP(e){let t=IP(e),n=LP(e),r=QN.implement(e.deployMessage);return e=>ik(e).chain(t).chain(n).chain(sk(({id:e,data:t,tags:n,anchor:i,signer:a})=>r({processId:e,data:t,tags:n,anchor:i,signer:iP.implement(a)}))).map(t=>zA(`messageId`,t.messageId,e))}function zP(e){let t=RP(e);return({process:e,data:n,tags:r,anchor:i,signer:a})=>ik({id:e,data:n,tags:r,anchor:i,signer:a}).chain(t).map(e=>e.messageId).bimap(WN,nj).toPromise()}var BP=(e,t,n)=>r=>t(r[e])?ak(r):ok(`Tag '${e}': ${n}`);function VP({loadTransactionMeta:e,logger:t}){return e=sk(rP.implement(e)),n=>ik(n).chain(e).map(xA(`tags`)).map(HN).chain(BP(`Data-Protocol`,UN(`ao`),`value 'ao' was not found on module`)).chain(BP(`Type`,UN(`Module`),`value 'Module' was not found on module`)).chain(BP(`Module-Format`,fj,`was not found on module`)).chain(BP(`Input-Encoding`,fj,`was not found on module`)).chain(BP(`Output-Encoding`,fj,`was not found on module`)).bimap(t.tap(`Verifying module source failed: %s`),t.tap(`Verified module source`))}function HP({logger:e,validateScheduler:t}){return t=sk(nP.implement(t)),n=>ik(n).chain(e=>t(e).chain(t=>t?ak(e):ok(`Valid Scheduler-Location owned by ${e} not found`))).bimap(e.tap(`Verifying scheduler failed: %s`),e.tap(`Verified scheduler`))}function UP({logger:e}){return t=>ik(t).map(e.tap(`Checking for signer`)).chain(e=>e?ak(e):ok(`signer not found`))}function WP(e){let t=e.logger.child(`verifyInput`);e={...e,logger:t};let n=VP(e),r=HP(e),i=UP(e);return e=>ik(e).chain(e=>n(e.module).map(()=>e)).chain(e=>r(e.scheduler)).map(()=>e).chain(e=>i(e.signer).map(()=>e)).bimap(t.tap(`Error when verify input: %s`),t.tap(`Successfully verified inputs`))}var GP=AP(`ao`),KP=FA(GP.removeAllByName),qP=FA(GP.concat),JP=FA(GP.concatUnassoc),YP=X.array(X.object({name:X.string(),value:X.string()}));function XP(){return e=>ik(e).map(xA(`tags`)).map(aj([])).map(KP(`Variant`)).map(KP(`Type`)).map(KP(`Module`)).map(KP(`Scheduler`)).map(qP([{name:`Variant`,value:`ao.TN.1`},{name:`Type`,value:`Process`},{name:`Module`,value:e.module},{name:`Scheduler`,value:e.scheduler}])).map(YP.parse).map(zA(`tags`,Sk,e))}function ZP({logger:e}){return t=>ik(t).chain(cj(NA(t.data),()=>ak(t),()=>ak(` `).map(zA(`data`,Sk,t)).map(e=>ej(xA(`tags`),JP([{name:`Content-Type`,value:`text/plain`}]),zA(`tags`,Sk,e))(e)).map(e.tap(`added pseudo-random string as process "data"`)))).map(e=>ej(xA(`tags`),JP([{name:`SDK`,value:`aoconnect`}]),zA(`tags`,Sk,e))(e))}function QP(e){let t=e.logger.child(`uploadProcess`);e={...e,logger:t};let n=XP(e),r=ZP(e),i=$N.implement(e.deployProcess);return e=>ik(e).chain(n).chain(r).chain(sk(({data:e,tags:t,signer:n})=>i({data:e,tags:t,signer:iP.implement(n)}))).map(t=>zA(`processId`,t.processId,e))}function $P(e){let t=WP(e),n=QP(e);return({module:e,scheduler:r,signer:i,tags:a,data:o})=>ik({module:e,scheduler:r,signer:i,tags:a,data:o}).chain(t).chain(n).map(e=>e.processId).bimap(WN,nj).toPromise()}function eF(e){let t=tP.implement(e.deployMonitor);return e=>ik(e).chain(sk(({id:e,signer:n})=>t({processId:e,signer:iP.implement(n),data:` `,tags:[]}))).map(t=>zA(`monitorId`,t.messageId,e))}function tF(e){let t=eF(e);return({process:e,signer:n})=>ik({id:e,signer:n}).chain(t).map(e=>e.monitorId).bimap(WN,nj).toPromise()}function nF(e){let t=tP.implement(e.deployUnmonitor);return e=>ik(e).chain(sk(({id:e,signer:n})=>t({processId:e,signer:iP.implement(n),data:` `,tags:[]}))).map(t=>zA(`monitorId`,t.messageId,e))}function rF(e){let t=nF(e);return({process:e,signer:n})=>ik({id:e,signer:n}).chain(t).map(e=>e.monitorId).bimap(WN,nj).toPromise()}var iF=X.object({process:X.string().min(1,{message:`process identifier is required`}),from:X.string().optional(),to:X.string().optional(),sort:X.enum([`ASC`,`DESC`]).default(`ASC`),limit:X.number().optional()});function aF(){return e=>ik(e).map(iF.parse).map(()=>e)}function oF({queryResults:e}){return e=sk(ZN.implement(e)),t=>ik({process:t.process,from:t.from,to:t.to,sort:t.sort,limit:t.limit}).chain(e)}function sF(e){let t=aF(e),n=oF(e);return({process:r,from:i,to:a,sort:o,limit:s})=>ik({process:r,from:i,to:a,sort:o,limit:s}).chain(t).chain(n).map(e.logger.tap(`readResults result for message "%s": %O`,r)).map(e=>e).bimap(WN,nj).toPromise()}var cF=X.object({Id:X.string(),Target:X.string(),Owner:X.string(),Anchor:X.string().optional(),Data:X.any().default(`1234`),Tags:X.array(X.object({name:X.string(),value:X.string()}))});function lF(){return e=>ik(e).map(cF.parse).map(e=>(e.Tags=e.Tags.concat([{name:`Data-Protocol`,value:`ao`}
60,{name:`Type`,value:`Message`},{name:`Variant`,value:`ao.TN.1`}]),e))}function uF({dryrunFetch:e}){return sk(YN.implement(e))}function dF(e){let t=lF(e),n=uF(e);return e=>ik(e).map(fF).chain(t).chain(n).toPromise()}function fF({process:e,data:t,tags:n,anchor:r,...i}){return{Id:`1234`,Owner:`1234`,...i,Target:e,Data:t||`1234`,Tags:n||[],Anchor:r||`0`}}function pF(e){let t=eP.implement(e.deployAssign);return e=>ik(e).chain(sk(({process:e,message:n,baseLayer:r,exclude:i})=>t({process:e,message:n,baseLayer:r,exclude:i}))).map(t=>zA(`assignmentId`,t.assignmentId,e))}function mF(e){let t=pF(e);return({process:e,message:n,baseLayer:r,exclude:i})=>ik({process:e,message:n,baseLayer:r,exclude:i}).chain(t).map(e=>e.assignmentId).bimap(WN,nj).toPromise()}var hF=`https://arweave.net`,gF=`https://mu.ao-testnet.xyz`,_F=`https://cu.ao-testnet.xyz`;function vF({GRAPHQL_URL:e,GRAPHQL_MAX_RETRIES:t,GRAPHQL_RETRY_BACKOFF:n,GATEWAY_URL:r=hF,MU_URL:i=gF,CU_URL:a=_F}={}){let o=BN();e||=VN({url:r,path:`/graphql`});let{validate:s}=$O({cacheSize:100,GRAPHQL_URL:e,GRAPHQL_MAX_RETRIES:t,GRAPHQL_RETRY_BACKOFF:n}),c=vk({MAX_SIZE:25}),l=o.child(`result`),u=oP({loadResult:mk({fetch,CU_URL:a,logger:l}),logger:l}),d=o.child(`message`),f=zP({loadProcessMeta:yk({fetch,cache:c,logger:d}),deployMessage:ck({fetch,MU_URL:i,logger:d}),logger:d}),p=o.child(`spawn`),m=$P({loadTransactionMeta:RN({fetch,GRAPHQL_URL:e,logger:p}),validateScheduler:s,deployProcess:lk({fetch,MU_URL:i,logger:p}),logger:p}),h=o.child(`monitor`),g=tF({loadProcessMeta:yk({fetch,cache:c,logger:h}),deployMonitor:uk({fetch,MU_URL:i,logger:h}),logger:h}),_=o.child(`unmonitor`),v=rF({loadProcessMeta:yk({fetch,cache:c,logger:_}),deployUnmonitor:dk({fetch,MU_URL:i,logger:_}),logger:h}),y=o.child(`results`),b=sF({queryResults:hk({fetch,CU_URL:a,logger:y}),logger:y}),x=o.child(`dryrun`),S=dF({dryrunFetch:pk({fetch,CU_URL:a,logger:x}),logger:x}),C=o.child(`assign`);return{result:u,results:b,message:f,spawn:m,monitor:g,unmonitor:v,dryrun:S,assign:mF({deployAssign:fk({fetch,MU_URL:i,logger:C}),logger:d})}}var yF={};$C(yF,{createDataItemSigner:()=>wI});var bF=tw(mw(),1),xF={};$C(xF,{AVSCTap:()=>oI,ArweaveSigner:()=>eI,DataItem:()=>_I,MAX_TAG_BYTES:()=>hI,MIN_BINARY_SIZE:()=>gI,SIG_CONFIG:()=>$F,SignatureConfig:()=>QF,Signer:()=>HF,createData:()=>yI,default:()=>xI,deserializeTags:()=>lI,indexToType:()=>tI,serializeTags:()=>sI,tagsExceedLimit:()=>cI,warparbundles:()=>SI});var SF=Object.create,CF=Object.defineProperty,wF=Object.getOwnPropertyDescriptor,TF=Object.getOwnPropertyNames,EF=Object.getPrototypeOf,DF=Object.prototype.hasOwnProperty,OF=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kF=(e,t)=>{for(var n in t)CF(e,n,{get:t[n],enumerable:!0})},AF=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of TF(t))!DF.call(e,i)&&i!==n&&CF(e,i,{get:()=>t[i],enumerable:!(r=wF(t,i))||r.enumerable});return e},jF=(e,t,n)=>(n=e==null?{}:SF(EF(e)),AF(t||!e||!e.__esModule?CF(n,`default`,{value:e,enumerable:!0}):n,e)),MF=OF(e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){var t=4,n=e.length,r=n%t;if(!r)return e;var i=n,a=t-r,o=n+a,s=Buffer.alloc(o);for(s.write(e);a--;)s.write(`=`,i++);return s.toString()}e.default=t}),NF=OF(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=MF();function n(e,t){return t===void 0&&(t=`utf8`),Buffer.isBuffer(e)?a(e.toString(`base64`)):a(Buffer.from(e,t).toString(`base64`))}function r(e,t){return t===void 0&&(t=`utf8`),Buffer.from(i(e),`base64`).toString(t)}function i(e){return e=e.toString(),t.default(e).replace(/\-/g,`+`).replace(/_/g,`/`)}function a(e){return e.replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}function o(e){return Buffer.from(i(e),`base64`)}var s=n;s.encode=n,s.decode=r,s.toBase64=i,s.fromBase64=a,s.toBuffer=o,e.default=s}),PF=OF((e,t)=>{t.exports=NF().default,t.exports.default=t.exports}),FF=OF(e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;for(a=0,o=i.length;a<o;
60++a)t[a]=i[a],n[i.charCodeAt(a)]=a;var a,o;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}}),IF=OF(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.b64UrlDecode=e.b64UrlEncode=e.bufferTob64Url=e.bufferTob64=e.b64UrlToBuffer=e.stringToB64Url=e.stringToBuffer=e.bufferToString=e.b64UrlToString=e.concatBuffers=void 0;var t=FF();function n(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].byteLength;let n=new Uint8Array(t),r=0;n.set(new Uint8Array(e[0]),r),r+=e[0].byteLength;for(let t=1;t<e.length;t++)n.set(new Uint8Array(e[t]),r),r+=e[t].byteLength;return n}e.concatBuffers=n;function r(e){return i(s(e))}e.b64UrlToString=r;function i(e){return new TextDecoder(`utf-8`,{fatal:!0}).decode(e)}e.bufferToString=i;function a(e){return new TextEncoder().encode(e)}e.stringToBuffer=a;function o(e){return l(a(e))}e.stringToB64Url=o;function s(e){return new Uint8Array(t.toByteArray(d(e)))}e.b64UrlToBuffer=s;function c(e){return t.fromByteArray(new Uint8Array(e))}e.bufferTob64=c;function l(e){return u(c(e))}e.bufferTob64Url=l;function u(e){return e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/\=/g,``)}e.b64UrlEncode=u;function d(e){e=e.replace(/\-/g,`+`).replace(/\_/g,`/`);let t;return t=e.length%4==0?0:4-e.length%4,e.concat(`=`.repeat(t))}e.b64UrlDecode=d}),LF=OF(e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=IF();e.default=class{keyLength=4096;publicExponent=65537;hashAlgorithm=`sha256`;driver;constructor(){if(!this.detectWebCrypto())throw Error(`SubtleCrypto not available!`);this.driver=crypto.subtle}async generateJWK(){let e=await this.driver.generateKey({name:`RSA-PSS`,modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:`SHA-256`}},!0,[`sign`]),t=await this.driver.exportKey(`jwk`,e.privateKey);return{kty:t.kty,e:t.e,n:t.n,d:t.d,p:t.p,q:t.q,dp:t.dp,dq:t.dq,qi:t.qi}}async sign(e,t,{saltLength:n}={}){let r=await this.driver.sign({name:`RSA-PSS`,saltLength:32},await this.jwkToCryptoKey(e),t);return new Uint8Array(r)}async hash(e,t=`SHA-256`){let n=await this.driver.digest(t,e);return new Uint8Array(n)}async verify(e,t,n){let r={kty:`RSA`,e:`AQAB`,n:e},i=await this.jwkToPublicCryptoKey(r),a=await this.driver.digest(`SHA-256`,t),o=await this.driver.verify({name:`RSA-PSS`,saltLength:0},i,n,t),s=await this.driver.verify({name:`RSA-PSS`,saltLength:32},i,n,t),c=await this.driver.verify({name:`RSA-PSS`,saltLength:Math.ceil((i.algorithm.modulusLength-1)/8)-a.byteLength-2},i,n,t);return o||s||c}async jwkToCryptoKey(e){return this.driver.importKey(`jwk`,e,{name:`RSA-PSS`,hash:{name:`SHA-256`}},!1,[`sign`])}async jwkToPublicCryptoKey(e){return this.driver.importKey(`jwk`,e,{name:`RSA-PSS`,hash:{name:`SHA-256`}},!1,[`verify`])}detectWebCrypto(){if(typeof crypto>`u`)return!1;let e=crypto?.subtle;return e===void 0?!1:[`generateKey`,`importKey`,`exportKey`,`digest`,`sign`].every(t=>typeof e[t]==`function`)}async encrypt(e,n,r){let i=await this.driver.importKey(`raw`,typeof n==`string`?t.stringToBuffer(n):n,{name:`PBKDF2`,length:32},!1,[`deriveKey`]),a=await this.driver.deriveKey({name:`PBKDF2`,salt:r?t.stringToBuffer(r):t.stringToBuffer(`salt`),iterations:1e5,hash:`SHA-256`},i,{name:`AES-CBC`,length:256},!1,[`encrypt`,`decrypt`]),o=new Uint8Array(16);crypto.getRandomValues(o);let s=await this.driver.encrypt({name:`AES-CBC`,iv:o},a,e);return t.concatBuffers([o,s])}async decrypt(e,n,r){let i=await this.driver.importKey(`raw`,typeof n==`string`?t.stringToBuffer(n):n,{name:`PBKDF2`,length:32},!1,[`deriveKey`]),a=await this.driver.deriveKey({name:`PBKDF2`,salt:r?t.stringToBuffer(r):t.stringToBuffer(`salt`),iterations:1e5,hash:`SHA-256`},i,{name:`AES-CBC`,length:256},!1,[`encrypt`,`decrypt`]),o=e.slice(0,16),s=await this.driver.decrypt({
vendor: 22,182 bytes, line 60
60name:`AES-CBC`,iv:o},a,e.slice(16));return t.concatBuffers([s])}}}),RF=OF(e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(p?-1:1)*(1/0);o+=2**r,a-=l}return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}}),zF=OF(e=>{var t=FF(),n=RF(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(Ae(e,ArrayBuffer)||e&&Ae(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Ae(e,SharedArrayBuffer)||e&&Ae(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(Ae(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||je(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(Ae(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),Ae(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(Ae(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Ae(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return Te(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return Oe(e).length;default:if(i)return r?-1:Te(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return le(this,t,n);case`utf8`:case`utf-8`:return ae(this,t,n);case`ascii`:return se(this,t,n);case`latin1`:case`binary`:return ce(this,t,n);case`base64`:return ie(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return ue(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?ae(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(Ae(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:o<a?1:0};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,je(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function ee(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(je(r))return o;e[n+o]=r}return o}function w(e,t,n,r){return ke(Te(t,e.length-n),e,n,r)}function te(e,t,n,r){return ke(Ee(t),e,n,r)}function ne(e,t,n,r){return ke(Oe(t),e,n,r)}function re(e,t,n,r){return ke(De(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return ee(this,e,t,n);case`utf8`:case`utf-8`:return w(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return te(this,e,t,n);case`base64`:return ne(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return re(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function ie(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function ae(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return oe(r)}var T=4096;function oe(e){let t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=T));return n}function se(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function ce(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function le(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=Me[e[r]];return i}function ue(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function E(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=Ne(function(e){e>>>=0,xe(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Se(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),n.read(this,e,!1,52,8)};function D(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;D(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;D(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function de(e,t,n,r,i){be(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function fe(e,t,n,r,i){be(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=Ne(function(e,t=0){return de(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=Ne(function(e,t=0){return fe(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);D(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);D(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=Ne(function(e,t=0){return de(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=Ne(function(e,t=0){return fe(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function pe(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function me(e,t,r,i,a){return t=+t,r>>>=0,a||pe(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return me(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return me(this,e,t,!1,n)};function he(e,t,r,i,a){return t=+t,r>>>=0,a||pe(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return he(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return he(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;
60if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var ge={};function _e(e,t,n){ge[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}_e(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),_e(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),_e(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ve(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ve(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ve(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function ye(e,t,n){xe(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&Se(t,e.length-(n+1))}function be(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new ge.ERR_OUT_OF_RANGE(`value`,i,e)}ye(r,i,a)}function xe(e,t){if(typeof e!=`number`)throw new ge.ERR_INVALID_ARG_TYPE(t,`number`,e)}function Se(e,t,n){throw Math.floor(e)===e?t<0?new ge.ERR_BUFFER_OUT_OF_BOUNDS:new ge.ERR_OUT_OF_RANGE(n||`offset`,`>= ${n?1:0} and <= ${t}`,e):(xe(e,n),new ge.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var Ce=/[^+/0-9A-Za-z-_]/g;function we(e){if(e=e.split(`=`)[0],e=e.trim().replace(Ce,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function Te(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function Ee(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function De(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Oe(e){return t.toByteArray(we(e))}function ke(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Ae(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function je(e){return e!==e}var Me=function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Ne(e){return typeof BigInt>`u`?Pe:e}function Pe(){throw Error(`BigInt not supported`)}}),BF=OF((e,t)=>{typeof window<`u`?(window.global=window,globalThis.fetch=window.fetch,t.exports={Buffer:zF().Buffer,Crypto:window.crypto}):t.exports={Buffer:zF().Buffer,Crypto:crypto}}),VF={};kF(VF,{AVSCTap:()=>oI,ArweaveSigner:()=>eI,DataItem:()=>_I,MAX_TAG_BYTES:()=>hI,MIN_BINARY_SIZE:()=>gI,SIG_CONFIG:()=>$F,SignatureConfig:()=>QF,Signer:()=>HF,createData:()=>yI,deserializeTags:()=>lI,indexToType:()=>tI,serializeTags:()=>sI,tagsExceedLimit:()=>cI});var HF=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,t,n,r){throw Error(`You must implement verify method on child`)}},UF=jF(PF(),1),WF=jF(IF(),1);async function GF(e){if(Array.isArray(e)){let t=(0,WF.concatBuffers)([(0,WF.stringToBuffer)(`list`),(0,WF.stringToBuffer)(e.length.toString())]);return await KF(e,await ZF().hash(t,`SHA-384`))}let t=e,n=(0,WF.concatBuffers)([(0,WF.stringToBuffer)(`blob`),(0,WF.stringToBuffer)(t.byteLength.toString())]),r=(0,WF.concatBuffers)([await ZF().hash(n,`SHA-384`),await ZF().hash(t,`SHA-384`)]);return await ZF().hash(r,`SHA-384`)}async function KF(e,t){if(e.length<1)return t;let n=(0,WF.concatBuffers)([t,await GF(e[0])]),r=await ZF().hash(n,`SHA-384`);return await KF(e.slice(1),r)}var qF=jF(LF(),1),JF=qF.default.default?qF.default.default:qF.default,YF=class extends JF{getPublicKey(e){throw Error(`Unimplemented`)}},XF;function ZF(){return XF??=new YF}var QF;(function(e){e[e.ARWEAVE=1]=`ARWEAVE`,e[e.ED25519=2]=`ED25519`,e[e.ETHEREUM=3]=`ETHEREUM`,e[e.SOLANA=4]=`SOLANA`,e[e.INJECTEDAPTOS=5]=`INJECTEDAPTOS`,e[e.MULTIAPTOS=6]=`MULTIAPTOS`,e[e.TYPEDETHEREUM=7]=`TYPEDETHEREUM`})(QF||={});var $F={[QF.ARWEAVE]:{sigLength:512,pubLength:512,sigName:`arweave`},[QF.ED25519]:{sigLength:64,pubLength:32,sigName:`ed25519`},[QF.ETHEREUM]:{sigLength:65,pubLength:65,sigName:`ethereum`},[QF.SOLANA]:{sigLength:64,pubLength:32,sigName:`solana`},[QF.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:`injectedAptos`},[QF.MULTIAPTOS]:{sigLength:2052,pubLength:1025,sigName:`multiAptos`},[QF.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:`typedEthereum`}},eI=class{signatureType=1;ownerLength=$F[1].pubLength;signatureLength=$F[1].sigLength;jwk;pk;constructor(e){this.pk=e.n,this.jwk=e}get publicKey(){return UF.default.toBuffer(this.pk)}sign(e){return ZF().sign(this.jwk,e)}
60static async verify(e,t,n){return await ZF().verify(e,t,n)}},tI={1:eI},nI=jF(PF(),1);async function rI(e){return GF([(0,WF.stringToBuffer)(`dataitem`),(0,WF.stringToBuffer)(`1`),(0,WF.stringToBuffer)(e.signatureType.toString()),e.rawOwner,e.rawTarget,e.rawAnchor,e.rawTags,e.rawData])}async function iI(e,t){let n=await rI(e),r=await t.sign(n),i=await ZF().hash(r);return{signature:Buffer.from(r),id:Buffer.from(i)}}async function aI(e,t){let{signature:n,id:r}=await iI(e,t);return e.getRaw().set(n,2),r}var oI=class{buf;pos;constructor(e=Buffer.alloc(hI),t=0){this.buf=e,this.pos=t}writeTags(e){if(!Array.isArray(e))throw Error(`input must be array`);let t=e.length,n;if(t)for(this.writeLong(t),n=0;n<t;n++){let t=e[n];if(t?.name===void 0||t?.value===void 0)throw Error(`Invalid tag format for ${t}, expected {name:string, value: string}`);this.writeString(t.name),this.writeString(t.value)}this.writeLong(0)}toBuffer(){let e=Buffer.alloc(this.pos);if(this.pos>this.buf.length)throw Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(e){let t=this.buf,n,r;if(e>=-1073741824&&e<1073741824){r=e>=0?e<<1:~e<<1|1;do t[this.pos]=r&127,r>>=7;while(r&&(t[this.pos++]|=128))}else{n=e>=0?e*2:-e*2-1;do t[this.pos]=n&127,n/=128;while(n>=1&&(t[this.pos++]|=128))}this.pos++,this.buf=t}writeString(e){let t=Buffer.byteLength(e),n=this.buf;this.writeLong(t);let r=this.pos;if(this.pos+=t,!(this.pos>n.length)){if(t>64)this.buf.write(e,this.pos-t,t,`utf8`);else{let i,a,o,s;for(i=0,a=t;i<a;i++)o=e.charCodeAt(i),o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=o&63|128):(o&64512)==55296&&((s=e.charCodeAt(i+1))&64512)==56320?(o=65536+((o&1023)<<10)+(s&1023),i++,n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=o&63|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=o&63|128)}this.buf=n}}readLong(){let e=0,t=0,n=this.buf,r,i,a,o;do r=n[this.pos++],i=r&128,e|=(r&127)<<t,t+=7;while(i&&t<28);if(i){a=e,o=268435456;do r=n[this.pos++],a+=(r&127)*o,o*=128;while(r&128);return(a%2?-(a+1):a)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],t;for(;t=this.readLong();)for(t<0&&(t=-t,this.skipLong());t--;){let t=this.readString(),n=this.readString();e.push({name:t,value:n})}return e}readString(){let e=this.readLong(),t=this.pos,n=this.buf;if(this.pos+=e,!(this.pos>n.length))return this.buf.slice(t,t+e).toString()}};function sI(e){let t=new oI;return t.writeTags(e),t.toBuffer()}function cI(e){let t=new oI;return t.writeTags(e),t.tagsExceedLimit()}function lI(e){return new oI(e).readTags()}function uI(e){let t=0;for(let n=e.length-1;n>=0;n--)t=t*256+e[n];return t}function dI(e){if(e>29)throw Error(`Short too long`);let t=[0,0];for(let n=0;n<t.length;n++){let r=e&255;t[n]=r,e=(e-r)/256}return Uint8Array.from(t)}function fI(e){let t=[0,0,0,0,0,0,0,0];for(let n=0;n<t.length;n++){let r=e&255;t[n]=r,e=(e-r)/256}return Uint8Array.from(t)}var pI=jF(BF(),1),mI=jF(zF(),1),hI=4096,gI=80,_I=class{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=uI(this.binary.subarray(0,2));if(QF?.[e]!==void 0)return e;throw Error(`Unknown signature type: `+e)}async isValid(){return _I.verify(this.binary)}get id(){return(async()=>nI.default.encode(await this.rawId))()}set id(e){this._id=nI.default.toBuffer(e)}get rawId(){return(async()=>mI.Buffer.from(await pI.Crypto.subtle.digest(`SHA-256`,this.rawSignature)))()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return nI.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return $F[this.signatureType].sigLength}get owner(){return nI.default.encode(this.rawOwner)}get ownerLength(){return $F[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):mI.Buffer.alloc(0)}get target(){return nI.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):mI.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let e=this.getTagsStart(),t=uI(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+t)}get tags(){let e=this.getTagsStart();if(uI(this.binary.subarray(e,e+8))==0)return[];let t=uI(this.binary.subarray(e+8,e+16));return lI(mI.Buffer.from(this.binary.subarray(e+16,e+16+t)))}get tagsB64Url(){return this.tags.map(e=>({name:nI.default.encode(e.name),value:nI.default.encode(e.value)}))}getStartOfData(){let e=this.getTagsStart(),t=uI(this.binary.subarray(e+8,e+16));return e+16+t}get rawData(){let e=this.getTagsStart(),t=uI(this.binary.subarray(e+8,e+16)),n=e+16+t;return this.binary.subarray(n,this.binary.length)}get data(){return nI.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await aI(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=mI.Buffer.from(await ZF().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:nI.default.encode(e.name),value:nI.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<gI)return!1;let t=new _I(e),n=t.signatureType,r=t.getTagsStart(),i=uI(e.subarray(r,r+8)),a=uI(e.subarray(r+8,r+16));if(a>hI)return!1;if(i>0)try{if(lI(mI.Buffer.from(e.subarray(r+16,r+16+a))).length!==i)return!1}catch{return!1}let o=tI[n],s=await rI(t);return await o.verify(t.rawOwner,s,t.rawSignature)}async getSignatureData(){return rI(this)}getTagsStart(){let e=this.getTargetStart(),t=e+(this.binary[e]==1?33:1),n=this.binary[t]==1;return t+=n?33:1,t}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,t=this.binary[this.getTargetStart()]==1;return e+=t?32:0,e}},vI=jF(PF(),1);function yI(e,t,n){let r=t.publicKey,i=n?.target?vI.default.toBuffer(n.target):null,a=1+(i?.byteLength??0),o=n?.anchor?Buffer.from(n.anch
60or):null,s=1+(o?.byteLength??0),c=(n?.tags?.length??0)>0?sI(n.tags):null,l=16+(c?c.byteLength:0),u=Buffer.from(e),d=u.byteLength,f=2+t.signatureLength+t.ownerLength+a+s+l+d,p=Buffer.alloc(f);if(p.set(dI(t.signatureType),0),p.set(new Uint8Array(t.signatureLength).fill(0),2),r.byteLength!==t.ownerLength)throw Error(`Owner must be ${t.ownerLength} bytes, but was incorrectly ${r.byteLength}`);p.set(r,2+t.signatureLength);let m=2+t.signatureLength+t.ownerLength;if(p[m]=i?1:0,i){if(i.byteLength!==32)throw Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);p.set(i,m+1)}let h=m+a,g=h+1;if(p[h]=o?1:0,o){if(g+=o.byteLength,o.byteLength!==32)throw Error(`Anchor must be 32 bytes`);p.set(o,h+1)}p.set(fI(n?.tags?.length??0),g);let _=fI(c?.byteLength??0);p.set(_,g+8),c&&p.set(c,g+16);let v=g+l;return p.set(u,v),new _I(p)}var bI={...VF};globalThis.arbundles??=bI;var xI=bI,SI=bI;globalThis.Buffer||(globalThis.Buffer=bF.Buffer);var{DataItem:CI}=xF;function wI(e){return async({data:t,tags:n,target:r,anchor:i,createDataItem:a=e=>new CI(e)})=>{let o=await e.signDataItem({data:t,tags:n,target:r,anchor:i}),s=a(bF.Buffer.from(o));return{id:await s.id,raw:await s.getRaw()}}}var{result:TI,results:EI,message:DI,spawn:OI,monitor:kI,unmonitor:AI,dryrun:jI,assign:MI}=vF({GATEWAY_URL:globalThis.GATEWAY_URL||void 0,MU_URL:globalThis.MU_URL||void 0,CU_URL:globalThis.CU_URL||void 0,GRAPHQL_URL:globalThis.GRAPHQL_URL||void 0,GRAPHQL_MAX_RETRIES:globalThis.GRAPHQL_MAX_RETRIES||void 0,GRAPHQL_RETRY_BACKOFF:globalThis.GRAPHQL_RETRY_BACKOFF||void 0}),NI=yF.createDataItemSigner,PI=i(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=E.prototype={constructor:E,toString:null,valueOf:null},ee=new E(1),w=20,te=4,ne=-7,re=21,ie=-1e7,ae=1e7,T=!1,oe=1,se=0,ce={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},le=`0123456789abcdefghijklmnopqrstuvwxyz`,ue=!0;function E(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof E))return new E(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>ae?g.c=g.e=null:e.e<ie?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>ae?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,le.length,`Base`),t==10&&ue)return g=new E(e),pe(g,w+g.e+1,te);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,E.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=le.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&E.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>ae)g.c=g.e=null;else if(d<ie)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}E.clone=m,E.ROUND_UP=0,E.ROUND_DOWN=1,E.ROUND_CEIL=2,E.ROUND_FLOOR=3,E.ROUND_HALF_UP=4,E.ROUND_HALF_DOWN=5,E.ROUND_HALF_EVEN=6,E.ROUND_HALF_CEIL=7,E.ROUND_HALF_FLOOR=8,E.EUCLID=9,E.config=E.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),w=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),te=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),ne=n[0],re=n[1]):(v(n,-p,p,t),ne=-(re=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),ie=n[0],ae=n[1];else if(v(n,-p,p,t),n)ie=-(ae=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))T=n;else throw T=!n,Error(o+`crypto unavailable`);else T=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),oe=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),se=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ce=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\
vendor: 13,509 bytes, line 60
60s]|(.).*\1/.test(n))ue=n.slice(0,10)==`0123456789`,le=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:w,ROUNDING_MODE:te,EXPONENTIAL_AT:[ne,re],RANGE:[ie,ae],CRYPTO:T,MODULO_MODE:oe,POW_PRECISION:se,FORMAT:ce,ALPHABET:le}},E.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!E.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},E.maximum=E.max=function(){return de(arguments,-1)},E.minimum=E.min=function(){return de(arguments,1)},E.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new E(ee);if(e==null?e=w:v(e,0,p),c=i(e/l),T)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw T=!1,Error(o+`crypto unavailable`);if(!T)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),E.sum=function(){for(var e=1,t=arguments,n=new E(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=w,y=te;for(_>=0&&(d=se,se=0,r=r.replace(`.`,``),h=new E(i),p=h.pow(r.length-_),se=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=le,e):(c=e,le)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,ee,w,te,ne,re,ie=r.s==i.s?1:-1,ae=r.c,T=i.c;if(!ae||!ae[0]||!T||!T[0])return new E(!r.s||!i.s||(ae?T&&ae[0]==T[0]:!T)?NaN:ae&&ae[0]==0||!T?ie*0:ie/0);for(y=new E(ie),b=y.c=[],f=r.e-i.e,ie=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),ie=ie/l|0),p=0;T[p]==(ae[p]||0);p++);if(T[p]>(ae[p]||0)&&f--,ie<0)b.push(1),m=!0;else{for(w=ae.length,ne=T.length,p=0,ie+=2,g=a(u/(T[0]+1)),g>1&&(T=e(T,g,u),ae=e(ae,g,u),ne=T.length,w=ae.length),ee=ne,x=ae.slice(0,ne),S=x.length;S<ne;x[S++]=0);re=T.slice(),re=[0].concat(re),te=T[0],T[1]>=u/2&&te++;do{if(g=0,d=t(T,x,ne,S),d<0){if(C=x[0],ne!=S&&(C=C*u+(x[1]||0)),g=a(C/te),g>1)for(g>=u&&(g=u-1),_=e(T,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,ne<v?re:T,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=T.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(T,x,ne,S)<1;)g++,n(x,ne<S?re:T,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=ae[ee]||0:(x=[ae[ee]],S=1)}while((ee++<w||x[0]!=null)&&ie--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,ie=b[0];ie>=10;ie/=10,p++);pe(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function D(e,t,n,r){var i,a,o,s,c;if(n==null?n=te:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=ne||o>=re)?b(c,o):x(c,o,`0`);else if(e=pe(new E(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=ne)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function de(e,t){for(var n,r,i=1,a=new E(e[0]);i<e.length;i++)r=new E(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function fe(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>ae?e.c=e.e=null:n<ie?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new E(d,u);if(E.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function pe(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>ae?e.c=e.e=null:e.e<ie&&(e.c=[e.e=0])}return e}function me(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=ne||n>=re?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new E(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new E(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=te:v(t,0,8),pe(new E(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new E(e,n),w,te)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new E(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new E(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+me(e));if(t!=null&&(t=new E(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new E(me(h)**(d?e.s*(2-y(e)):+me(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new E(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new E(f?1/c:c);else se&&(c=i(se/l+2));for(d?(n=new E(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+me(e)),p=s%2),m=new E(ee);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),pe(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+me(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=ee.div(m)),t?m.mod(t):c?pe(m,se,te,u):m)},C.integerValue=function(e){var t=new E(this);return e==null?e=te:v(e,0,8),pe(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new E(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new E(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new E(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new E(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new E(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new E(e,t),t=e.s,!s||!t)return new E(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new E(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new E(f[0]?o:te==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?fe(e,f,d):(e.s=te==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new E(e,n),!a.c||!e.s||e.c&&!e.c[0]?new E(NaN):!e.c||a.c&&!a.c[0]?new E(a):(oe==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,oe),e=a.minus(r.times(e)),!e.c[0]&&oe==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new E(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),fe(e,v,r)},C.negated=function(){var e=new E(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new E(e,t),t=e.s,!i||!t)return new E(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new E(i/0);if(!s[0]||!u[0])return u[0]?e:new E(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),fe(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=te:v(t,0,8),pe(new E(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=w+4,d=new E(`0.5`);if(c!==1||!s||!s[0])return new E(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+me(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new E(n)):r=new E(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(pe(a,a.e+w+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(pe(r,r.e+w+2,1),e=!r.times(r).eq(o));break}}return pe(r,r.e+w+1,te,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),D(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),D(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ce;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new E(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(ee)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+me(u));if(!y)return new E(v);for(n=new E(ee),p=r=new E(ee),i=f=new E(ee),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=ae,ae=1/0,u=new E(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;
60return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,te).minus(v).abs().comparedTo(t(f,r,s,te).minus(v).abs())<1?[p,i]:[f,r],ae=c,h},C.toNumber=function(){return+me(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),D(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=ne||a>=re?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&ue?(r=pe(new E(r),w+a+1,te),t=x(g(r.c),r.e,`0`)):(v(e,2,le.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return me(this)},C._isBigNumber=!0,e!=null&&E.set(e),E}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),FI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=PI();e.default=class{BigNum;constructor(){this.BigNum=(e,n)=>new(t.BigNumber.clone({DECIMAL_PLACES:n}))(e)}winstonToAr(e,{formatted:t=!1,decimals:n=12,trim:r=!0}={}){let i=this.stringToBigNum(e,n).shiftedBy(-12);return t?i.toFormat(n):i.toFixed(n)}arToWinston(e,{formatted:t=!1}={}){let n=this.stringToBigNum(e).shiftedBy(12);return t?n.toFormat():n.toFixed(0)}compare(e,t){let n=this.stringToBigNum(e),r=this.stringToBigNum(t);return n.comparedTo(r)}isEqual(e,t){return this.compare(e,t)===0}isLessThan(e,t){let n=this.stringToBigNum(e),r=this.stringToBigNum(t);return n.isLessThan(r)}isGreaterThan(e,t){let n=this.stringToBigNum(e),r=this.stringToBigNum(t);return n.isGreaterThan(r)}add(e,t){let n=this.stringToBigNum(e);return this.stringToBigNum(t),n.plus(t).toFixed(0)}sub(e,t){let n=this.stringToBigNum(e);return this.stringToBigNum(t),n.minus(t).toFixed(0)}stringToBigNum(e,t=12){return this.BigNum(e,t)}}})),II=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class{METHOD_GET=`GET`;METHOD_POST=`POST`;config;constructor(e){this.applyConfig(e)}applyConfig(e){this.config=this.mergeDefaults(e)}getConfig(){return this.config}mergeDefaults(e){let t=e.protocol||`http`,n=e.port||(t===`https`?443:80);return{host:e.host||`127.0.0.1`,protocol:t,port:n,timeout:e.timeout||2e4,logging:e.logging||!1,logger:e.logger||console.log,network:e.network}}async get(e,t){return await this.request(e,{...t,method:this.METHOD_GET})}async post(e,t,n){let r=new Headers(n?.headers||{});return r.get(`content-type`)?.includes(`application/json`)||r.append(`content-type`,`application/json`),r.append(`accept`,`application/json, text/plain, */*`),await this.request(e,{...n,method:this.METHOD_POST,body:typeof t==`string`?t:JSON.stringify(t),headers:r})}async request(e,n){let r=new Headers(n?.headers||{}),i=`${this.config.protocol}://${this.config.host}:${this.config.port}`,a=n?.responseType;delete n?.responseType,e.startsWith(`/`)&&(e=e.slice(1)),this.config.network&&r.append(`x-network`,this.config.network),this.config.logging&&this.config.logger(`Requesting: ${i}/${e}`);let o=await fetch(`${i}/${e}`,{...n||{},headers:r});this.config.logging&&this.config.logger(`Response: ${o.url} - ${o.status}`);let s=o.headers.get(`content-type`)?.match(/charset=([^()<>@,;:\"/[\]?.=\s]*)/i)?.[1],c=o,l=async()=>
60{if(s)try{c.data=new TextDecoder(s).decode(await o.arrayBuffer())}catch{c.data=await o.text()}else c.data=await o.text()};if(a===`arraybuffer`)c.data=await o.arrayBuffer();else if(a===`text`)await l();else if(a===`webstream`)c.data=t(o.body);else try{let e=await o.clone().json();typeof e==`object`?c.data=await o.json():await l(),e=null}catch{await l()}return c}};var t=e=>{let t=e;return t[Symbol.asyncIterator]===void 0&&(t[Symbol.asyncIterator]=n(e)),t},n=function(e){return async function*(){let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}}})),LI=i((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),RI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.concatBuffers=n,e.b64UrlToString=r,e.bufferToString=i,e.stringToBuffer=a,e.stringToB64Url=o,e.b64UrlToBuffer=s,e.bufferTob64=c,e.bufferTob64Url=l,e.b64UrlEncode=u,e.b64UrlDecode=d;var t=LI();function n(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].byteLength;let n=new Uint8Array(t),r=0;n.set(new Uint8Array(e[0]),r),r+=e[0].byteLength;for(let t=1;t<e.length;t++)n.set(new Uint8Array(e[t]),r),r+=e[t].byteLength;return n}function r(e){return i(s(e))}function i(e){return new TextDecoder(`utf-8`,{fatal:!0}).decode(e)}function a(e){return new TextEncoder().encode(e)}function o(e){return l(a(e))}function s(e){return new Uint8Array(t.toByteArray(d(e)))}function c(e){return t.fromByteArray(new Uint8Array(e))}function l(e){return u(c(e))}function u(e){try{return e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/\=/g,``)}catch(e){throw Error(`Failed to encode string`,{cause:e})}}function d(e){try{e=e.replace(/\-/g,`+`).replace(/\_/g,`/`);let t;return t=e.length%4==0?0:4-e.length%4,e.concat(`=`.repeat(t))}catch(e){throw Error(`Failed to decode string`,{cause:e})}}})),zI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=RI();e.default=class{keyLength=4096;publicExponent=65537;hashAlgorithm=`sha256`;driver;constructor(){if(!this.detectWebCrypto())throw Error(`SubtleCrypto not available!`);this.driver=crypto.subtle}async generateJWK(){let e=await this.driver.generateKey({name:`RSA-PSS`,modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:`SHA-256`}},!0,[`sign`]),t=await this.driver.exportKey(`jwk`,e.privateKey);return{kty:t.kty,e:t.e,n:t.n,d:t.d,p:t.p,q:t.q,dp:t.dp,dq:t.dq,qi:t.qi}}async sign(e,t,{saltLength:n}={}){let r=await this.driver.sign({name:`RSA-PSS`,saltLength:n??32},await this.jwkToCryptoKey(e),t);return new Uint8Array(r)}async hash(e,t=`SHA-256`){let n=await this.driver.digest(t,e);return new Uint8Array(n)}async verify(e,t,n){let r={kty:`RSA`,e:`AQAB`,n:e},i=await this.jwkToPublicCryptoKey(r),a=await this.driver.digest(`SHA-256`,t),o=await this.driver.verify({name:`RSA-PSS`,saltLength:0},i,n,t),s=await this.driver.verify({name:`RSA-PSS`,saltLength:32},i,n,t),c=Math.ceil((i.algorithm.modulusLength-1)/8)-a.byteLength-2,l=await this.driver.verify({name:`RSA-PSS`,saltLength:c},i,n,t),u=o||s||l;if(!u){let e={algorithm:i.algorithm.name,modulusLength:i.algorithm.modulusLength,keyUsages:i.usages,saltLengthsAttempted:`0, 32, ${c}`};console.warn(`Transaction Verification Failed! 61`,`Details: ${JSON.stringify(e,null,2)} \n`,`N.B. ArweaveJS is only guaranteed to verify txs created using ArweaveJS.`)}return u}async jwkToCryptoKey(e){return this.driver.importKey(`jwk`,e,{name:`RSA-PSS`,hash:{name:`
61SHA-256`}},!1,[`sign`])}async jwkToPublicCryptoKey(e){return this.driver.importKey(`jwk`,e,{name:`RSA-PSS`,hash:{name:`SHA-256`}},!1,[`verify`])}detectWebCrypto(){if(typeof crypto>`u`)return!1;let e=crypto?.subtle;return e===void 0?!1:[`generateKey`,`importKey`,`exportKey`,`digest`,`sign`].every(t=>typeof e[t]==`function`)}async encrypt(e,n,r){let i=await this.driver.importKey(`raw`,typeof n==`string`?t.stringToBuffer(n):n,{name:`PBKDF2`,length:32},!1,[`deriveKey`]),a=await this.driver.deriveKey({name:`PBKDF2`,salt:r?t.stringToBuffer(r):t.stringToBuffer(`salt`),iterations:1e5,hash:`SHA-256`},i,{name:`AES-CBC`,length:256},!1,[`encrypt`,`decrypt`]),o=new Uint8Array(16);crypto.getRandomValues(o);let s=await this.driver.encrypt({name:`AES-CBC`,iv:o},a,e);return t.concatBuffers([o,s])}async decrypt(e,n,r){let i=await this.driver.importKey(`raw`,typeof n==`string`?t.stringToBuffer(n):n,{name:`PBKDF2`,length:32},!1,[`deriveKey`]),a=await this.driver.deriveKey({name:`PBKDF2`,salt:r?t.stringToBuffer(r):t.stringToBuffer(`salt`),iterations:1e5,hash:`SHA-256`},i,{name:`AES-CBC`,length:256},!1,[`encrypt`,`decrypt`]),o=e.slice(0,16),s=await this.driver.decrypt({
61name:`AES-CBC`,iv:o},a,e.slice(16));return t.concatBuffers([s])}}})),BI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class{api;constructor(e){this.api=e}getInfo(){return this.api.get(`info`).then(e=>e.data)}getPeers(){return this.api.get(`peers`).then(e=>e.data)}}})),VI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getError=t,e.default=class extends Error{type;response;constructor(e,t={}){t.message?super(t.message):super(),this.type=e,this.response=t.response}getType(){return this.type}};function t(e){let t=e.data;if(typeof e.data==`string`)try{t=JSON.parse(e.data)}catch{}if(e.data instanceof ArrayBuffer||e.data instanceof Uint8Array)try{t=JSON.parse(t.toString())}catch{}return t?t.error||t:e.statusText||`unknown`}})),HI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;var t=$I();async function n(e){if(Array.isArray(e)){let n=t.default.utils.concatBuffers([t.default.utils.stringToBuffer(`list`),t.default.utils.stringToBuffer(e.length.toString())]);return await r(e,await t.default.crypto.hash(n,`SHA-384`))}let n=t.default.utils.concatBuffers([t.default.utils.stringToBuffer(`blob`),t.default.utils.stringToBuffer(e.byteLength.toString())]),i=t.default.utils.concatBuffers([await t.default.crypto.hash(n,`SHA-384`),await t.default.crypto.hash(e,`SHA-384`)]);return await t.default.crypto.hash(i,`SHA-384`)}async function r(e,i){if(e.length<1)return i;let a=t.default.utils.concatBuffers([i,await n(e[0])]),o=await t.default.crypto.hash(a,`SHA-384`);return await r(e.slice(1),o)}})),UI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.arrayCompare=e.MIN_CHUNK_SIZE=e.MAX_CHUNK_SIZE=void 0,e.chunkData=a,e.generateLeaves=o,e.computeRootHash=s,e.generateTree=c,e.generateTransactionChunks=l,e.buildLayers=u,e.generateProofs=d,e.arrayFlatten=p,e.intToBuffer=g,e.bufferToInt=_,e.validatePath=v,e.debug=y;var t=$I(),n=RI();e.MAX_CHUNK_SIZE=256*1024,e.MIN_CHUNK_SIZE=32*1024;var r=32,i=32;async function a(n){let r=[],i=n,a=0;for(;i.byteLength>=e.MAX_CHUNK_SIZE;){let n=e.MAX_CHUNK_SIZE,o=i.byteLength-e.MAX_CHUNK_SIZE;o>0&&o<e.MIN_CHUNK_SIZE&&(n=Math.ceil(i.byteLength/2));let s=i.slice(0,n),c=await t.default.crypto.hash(s);a+=s.byteLength,r.push({dataHash:c,minByteRange:a-s.byteLength,maxByteRange:a}),i=i.slice(n)}return r.push({dataHash:await t.default.crypto.hash(i),minByteRange:a,maxByteRange:a+i.byteLength}),r}async function o(e){return Promise.all(e.map(async({dataHash:e,minByteRange:t,maxByteRange:n})=>({type:`leaf`,id:await h(await Promise.all([h(e),h(g(n))])),dataHash:e,minByteRange:t,maxByteRange:n})))}async function s(e){return(await c(e)).id}async function c(e){return await u(await o(await a(e)))}async function l(e){let t=await a(e),n=await u(await o(t)),r=await d(n),i=t.slice(-1)[0];return i.maxByteRange-i.minByteRange===0&&(t.splice(t.length-1,1),r.splice(r.length-1,1)),{data_root:n.id,chunks:t,proofs:r}}async function u(e,t=0){if(e.length<2)return e[0];let n=[];for(let t=0;t<e.length;t+=2)n.push(await m(e[t],e[t+1]));return u(n,t+1)}function d(e){let t=f(e);return Array.isArray(t)?p(t):[t]}function f(e,t=new Uint8Array,r=0){if(e.type==`leaf`)return{offset:e.maxByteRange-1,proof:(0,n.concatBuffers)([t,e.dataHash,g(e.maxByteRange)])};if(e.type==`branch`){let i=(0,n.concatBuffers)([t,e.leftChild.id,e.rightChild.id,g(e.byteRange)]);return[f(e.leftChild,i,r+1),f(e.rightChild,i,r+1)]}throw Error(`Unexpected node type`)}function p(e){let t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...p(e)):t.push(e)}),t}async function m(e,t){return t?{type:`branch`,id:await h([await h(e.id),await h(t.id),await h(g(e.maxByteRange))]),byteRange:e.maxByteRange,maxByteRange:t.maxByteRange,leftChild:e,rightChild:t}:e}async function h(e){return Array.isArray(e)&&(e=t.default.utils.concatBuffers(e)),new Uint8Array(await t.default.crypto.hash(e))}function g(e){let t=new Uint8Array(r);for(var n=t.length-1;n>=0;n--){var i=e%256;t[n]=i,e=(e-i)/256}return t}function _(e){let t=0;for(var n=0;n<e.length;n++)t*=256,t+=e[n];return t}e.arrayCompare=(e,t)=>e.every((e,n)=>t[n]===e);
61async function v(t,n,a,o,s){if(o<=0)return!1;if(n>=o)return v(t,0,o-1,o,s);if(n<0)return v(t,0,0,o,s);if(s.length==i+r){let n=s.slice(0,i),c=s.slice(n.length,n.length+r),l=await h([await h(n),await h(c)]);return(0,e.arrayCompare)(t,l)?{offset:o-1,leftBound:a,rightBound:o,chunkSize:o-a}:!1}let c=s.slice(0,i),l=s.slice(c.length,c.length+i),u=s.slice(c.length+l.length,c.length+l.length+r),d=_(u),f=s.slice(c.length+l.length+u.length),p=await h([await h(c),await h(l),await h(u)]);return(0,e.arrayCompare)(t,p)?n<d?await v(c,n,a,Math.min(o,d),f):await v(l,n,Math.max(a,d),o,f):!1}async function y(e,t=``){if(e.byteLength<1)return t;let n=e.slice(0,i),a=e.slice(n.length,n.length+i),o=e.slice(n.length+a.length,n.length+a.length+r),s=_(o),c=e.slice(n.length+a.length+o.length),l=await h([await h(n),await h(a),await h(o)]);return y(c,`${t}\n${JSON.stringify(Buffer.from(n))},${JSON.stringify(Buffer.from(a))},${s} => ${JSON.stringify(l)}`)}})),WI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Tag=void 0;var t=RI(),n=HI(),r=UI(),i=class{get(e,n){if(!Object.getOwnPropertyNames(this).includes(e))throw Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return n&&n.decode&&n.string?t.bufferToString(this[e]):n&&n.decode&&!n.string?this[e]:t.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(n?.decode!==void 0||n?.string!==void 0)throw e===`tags`&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),Error(`Cannot decode or stringify an array.`);return this[e]}return n&&n.decode==1?n&&n.string?t.b64UrlToString(this[e]):t.b64UrlToBuffer(this[e]):this[e]}},a=class extends i{name;value;constructor(e,t,n=!1){super(),this.name=e,this.value=t}};e.Tag=a,e.default=class extends i{format=2;id=``;last_tx=``;owner=``;tags=[];target=``;quantity=`0`;data_size=`0`;data=new Uint8Array;data_root=``;reward=`0`;signature=``;chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data==`string`&&(this.data=t.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(e=>new a(e.name,e.value)))}addTag(e,n){this.tags.push(new a(t.stringToB64Url(e),t.stringToB64Url(n)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:t.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:t,reward:n,tags:r,signature:i}){this.id=e,this.owner=t,n&&(this.reward=n),r&&(this.tags=r),this.signature=i}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,r.generateTransactionChunks)(e),this.data_root=t.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root=``)}getChunk(e,n){if(!this.chunks)throw Error(`Chunks have not been prepared`);let r=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:t.bufferTob64Url(r.proof),offset:r.offset.toString(),chunk:t.bufferTob64Url(n.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((e,n)=>t.concatBuffers([e,n.get(`name`,{decode:!0,string:!1}),n.get(`value`,{decode:!0,string:!1})]),new Uint8Array);return t.concatBuffers([this.get(`owner`,{decode:!0,string:!1}),this.get(`target`,{decode:!0,string:!1}),this.get(`data`,{decode:!0,string:!1}),t.stringToBuffer(this.quantity),t.stringToBuffer(this.reward),this.get(`last_tx`,{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(e=>[e.get(`name`,{decode:!0,string:!1}),e.get(`value`,{decode:!0,string:!1})]);return await(0,n.default)([t.stringToBuffer(this.format.toString()),this.get(`owner`,{decode:!0,string:!1}),this.get(`target`,{decode:!0,string:!1}),t.stringToBuffer(this.quantity),t.stringToBuffer(this.reward),this.get(`last_tx`,{decode:!0,string:!1}),r,t.stringToBuffer(this.data_size),this.get(`data_root`,{decode:!0,string:!1})]);default:throw Error(`Unexpected transaction format: ${this.format}`)}}}})),GI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TransactionUploader=void 0;var t=WI(),n=RI(),r=VI(),i=UI(),a=1,o=[`invalid_json`,`chunk_too_big`,`data_path_too_big`,`offset_too_big`,`data_size_too_big`,`chunk_proof_ratio_not_attractive`,`invalid_proof`],s=1e3*40;e.TransactionUploader=class e{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError=``;get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,n){if(this.api=e,!n.id)throw Error(`Transaction is not signed`);if(!n.chunks)throw Error(`Transaction chunks not prepared`);this.data=n.data,this.transaction=new t.default(Object.assign({},n,{data:new Uint8Array}))}async uploadChunk(e){if(this.isComplete)throw Error(`Upload is already complete`);if(this.lastResponseError===``?this.totalErrors=0:this.totalErrors++,this.totalErrors===100)throw Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let t=this.lastResponseError===``?0:Math.max(this.lastRequestTimeEnd+s-Date.now(),s);if(t>0&&(t-=t*Math.random()*.3,await new Promise(e=>setTimeout(e,t))),this.lastResponseError=``,!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,i.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),n.b64UrlToBuffer(a.data_path)))throw Error(`Unable to validate chunk ${this.chunkIndex}`);let c=await this.api.post(`chunk`,this.transaction.getChunk(this.chunkIndex,this.data)).catch(e=>(console.error(e.message),{status:-1,data:{error:e.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=c.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,r.getError)(c),o.includes(this.lastResponseError))throw Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(n,r,i){if(!r||typeof r.chunkIndex!=`number`||typeof r.transaction!=`object`)throw Error(`Serialized object does not match expected format.`);var a=new t.default(r.transaction);a.chunks||await a.prepareChunks(i);let o=new e(n,a);if(o.chunkIndex=r.chunkIndex,o.lastRequestTimeEnd=r.lastRequestTimeEnd,o.lastResponseError=r.lastResponseError,o.lastResponseStatus=r.lastResponseStatus,o.txPosted=r.txPosted,o.data=i,o.transaction.data_root!==r.transaction.data_root)throw Error(`Data mismatch: Uploader doesn't match provided data.`);return o}static async fromTransactionId(e,t){let n=await e.get(`tx/${t}`);if(n.status!==200)throw Error(`Tx ${t} not found: ${n.status}`);let r=n.data;return r.data=new Uint8Array,{txPosted:!0,chunkIndex:0,lastResponseError:``,lastRequestTimeEnd:0,lastResponseStatus:0,transaction:r}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=a){this.transaction.data=this.data;let e=await this.api.post(`tx`,this.transaction).catch(e=>(console.error(e),{status:-1,data:{error:e.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=e.status,this.transaction.data=new Uint8Array,e.status>=200&&e.status<300){this.txPosted=!0,this.chunkIndex=a;return}throw this.lastResponseError=(0,r.getError)(e),Error(`Unable to upload transaction: ${e.status}, ${this.lastResponseError}`)}let e=await this.api.post(`tx`,this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=e.status,!(e.status>=200&&e.status<300))throw this.lastResponseError=(0,r.getError)(e),Error(`Unable to upload transaction: ${e.status}, ${this.lastResponseError}`);this.txPosted=!0}}}));n({default:()=>KI});var KI,qI=t((()=>{KI={}})),JI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VI(),n=WI(),r=RI(),i=GI();qI(),e.default=class{api;crypto;chunks;constructor(e,t,n){this.api=e,this.crypto=t,this.chunks=n}async getTransactionAnchor(){let e=await this.api.get(`tx_anchor`);if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,t){let n=t?`price/${e}/${t}`:`price/${e}`,r=await this.api.get(n);if(!/^\d+$/.test(r.data)||!r.ok)throw Error(`Could not getPrice. Received: ${r.data}. Status: ${r.status}, ${r.statusText}`);return r.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let t=parseInt(r.data.data_size);if(r.data.format>=2&&t>0&&t<=1024*1024*12){let t=await this.getData(e);return new n.default({...r.data,data:t})}return new n.default({...r.data,format:r.data.format||1})}throw r.status==404?new t.default(`TX_NOT_FOUND`):r.status==410?new t.default(`TX_FAILED`):new t.default(`TX_INVALID`)}fromRaw(e){return new n.default(e)}async search(e,t){return this.api.post(`arql`,{op:`equals`,expr1:e,expr2:t}).then(e=>e.data?e.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(e=>e.status==200?{status:200,confirmed:e.data}:{status:e.status,confirmed:null})}async getData(e,t){let n;try{n=await this.chunks.downloadChunkedData(e)}catch(t){console.error(`Error while trying to download chunked data for ${e}`),console.error(t)}if(!n){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:t,ok:r,status:i,statusText:a}=await this.api.get(`/${e}`,{responseType:`arraybuffer`});if(!r)throw Error(`Bad http status code`,{cause:{status:i,statusText:a}});n=t}catch(t){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(t)}}if(!n)throw Error(`${e} data was not found!`);return t&&t.decode&&!t.string?n:t&&t.decode&&t.string?r.bufferToString(n):r.bufferTob64Url(n)}
61async sign(e,t,n){let i=typeof t==`object`&&(e=>{let t=!0;return[`n`,`e`,`d`,`p`,`q`,`dp`,`dq`,`qi`].map(n=>!(n in e)&&(t=!1)),t})(t),a=typeof arweaveWallet==`object`;if(!i&&!a)throw Error(`No valid JWK or external wallet found to sign transaction.`);if(i){e.setOwner(t.n);let i=await e.getSignatureData(),a=await this.crypto.sign(t,i,n),o=await this.crypto.hash(a);e.setSignature({id:r.bufferTob64Url(o),owner:t.n,signature:r.bufferTob64Url(a)})}else if(a){try{(await arweaveWallet.getPermissions()).includes(`SIGN_TRANSACTION`)||await arweaveWallet.connect([`SIGN_TRANSACTION`])}catch{}let t=await arweaveWallet.sign(e,n);e.setSignature({id:t.id,owner:t.owner,reward:t.reward,tags:t.tags,signature:t.signature})}else throw Error(`An error occurred while signing. Check wallet is valid`)}async verify(e){let t=await e.getSignatureData(),n=e.get(`signature`,{decode:!0,string:!1}),i=r.bufferTob64Url(await this.crypto.hash(n));if(e.id!==i)throw Error(`Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.`);return this.crypto.verify(e.owner,t,n)}async post(e){if(typeof e==`string`?e=new n.default(JSON.parse(e)):typeof e.readInt32BE==`function`?e=new n.default(JSON.parse(e.toString())):typeof e==`object`&&!(e instanceof n.default)&&(e=new n.default(e)),!(e instanceof n.default))throw Error(`Must be Transaction object`);e.chunks||await e.prepareChunks(e.data);let t=await this.getUploader(e,e.data);try{for(;!t.isComplete;)await t.uploadChunk()}catch(e){if(t.lastResponseStatus>0)return{status:t.lastResponseStatus,statusText:t.lastResponseError,data:{error:t.lastResponseError}};throw e}return{status:200,statusText:`OK`,data:{}}}async getUploader(e,t){let r;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),e instanceof n.default){if(t||=e.data,!(t instanceof Uint8Array))throw Error(`Data format is invalid`);e.chunks||await e.prepareChunks(t),r=new i.TransactionUploader(this.api,e),(!r.data||r.data.length===0)&&(r.data=t)}else{if(typeof e==`string`&&(e=await i.TransactionUploader.fromTransactionId(this.api,e)),!t||!(t instanceof Uint8Array))throw Error(`Must provide data when resuming upload`);r=await i.TransactionUploader.fromSerialized(this.api,e,t)}return r}async*upload(e,t){let n=await this.getUploader(e,t);for(;!n.isComplete;)await n.uploadChunk(),yield n;return n}}})),YI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=RI();qI(),e.default=class{api;crypto;constructor(e,t){this.api=e,this.crypto=t}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(e=>e.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(e=>e.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e===`use_wallet`?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e===`use_wallet`){try{await arweaveWallet.connect([`ACCESS_ADDRESS`])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return t.bufferTob64Url(await this.crypto.hash(t.b64UrlToBuffer(e)))}}})),XI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SiloResource=void 0;var t=RI();e.default=class{api;crypto;transactions;constructor(e,t,n){this.api=e,this.crypto=t,this.transactions=n}async get(e){if(!e)throw Error(`No Silo URI specified`);let t=await this.parseUri(e),n=await this.transactions.search(`Silo-Name`,t.getAccessKey());if(n.length==0)throw Error(`No data could be found for the Silo URI: ${e}`);let r=await this.transactions.get(n[0]);if(!r)throw Error(`No data could be found for the Silo URI: ${e}`);let i=r.get(`data`,{decode:!0,string:!1});return this.crypto.decrypt(i,t.getEncryptionKey())}async readTransactionData(e,t){if(!t)throw Error(`No Silo URI specified`);let n=await this.parseUri(t),r=e.get(`data`,{decode:!0,string:!1});return this.crypto.decrypt(r,n.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw Error(`Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'`);let i=r[1],a=2**parseInt(r[2]),o=await this.hash(t.stringToBuffer(i),a);return new n(e,t.bufferTob64(o.slice(0,15)),await this.hash(o.slice(16,31),1))}async hash(e,t){let n=await this.crypto.hash(e);for(let e=0;e<t-1;e++)n=await this.crypto.hash(n);return n}};var n=class{uri;accessKey;encryptionKey;constructor(e,t,n){this.uri=e,this.accessKey=t,this.encryptionKey=n}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};e.SiloResource=n})),ZI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VI(),n=RI();e.default=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let n=await this.api.get(`tx/${e}/offset`);if(n.status===200)return n.data;throw Error(`Unable to get transaction offset: ${(0,t.getError)(n)}`)}async getChunk(e){let n=await this.api.get(`chunk/${e}`);if(n.status===200)return n.data;throw Error(`Unable to get chunk: ${(0,t.getError)(n)}`)}async getChunkData(e){let t=await this.getChunk(e);return n.b64UrlToBuffer(t.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}
61async downloadChunkedData(e){let t=await this.getTransactionOffset(e),n=parseInt(t.size),r=parseInt(t.offset)-n+1,i=new Uint8Array(n),a=0;for(;a<n;){this.api.config.logging&&console.log(`[chunk] ${a}/${n}`);let e;try{e=await this.getChunkData(r+a)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${r+a}`),console.error(`[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node`)}if(e)i.set(e,a),a+=e.length;else throw Error(`Couldn't complete data download at ${a}/${n}`)}return i}}})),QI=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=VI();qI(),e.default=class e{api;network;static HASH_ENDPOINT=`block/hash/`;static HEIGHT_ENDPOINT=`block/height/`;constructor(e,t){this.api=e,this.network=t}async get(n){let r=await this.api.get(`${e.HASH_ENDPOINT}${n}`);if(r.status===200)return r.data;throw r.status===404?new t.default(`BLOCK_NOT_FOUND`):Error(`Error while loading block data: ${r}`)}async getByHeight(n){let r=await this.api.get(`${e.HEIGHT_ENDPOINT}${n}`);if(r.status===200)return r.data;throw r.status===404?new t.default(`BLOCK_NOT_FOUND`):Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}}})),$I=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0});var t=FI(),n=II(),r=zI(),i=BI(),a=JI(),o=YI(),s=WI(),c=RI(),l=XI(),u=ZI(),d=QI();e.default=class e{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new r.default;static utils=c;constructor(r){this.api=new n.default(r),this.wallets=new o.default(this.api,e.crypto),this.chunks=new u.default(this.api),this.transactions=new a.default(this.api,e.crypto,this.chunks),this.silo=new l.default(this.api,this.crypto,this.transactions),this.network=new i.default(this.api),this.blocks=new d.default(this.api,this.network),this.ar=new t.default}get crypto(){return e.crypto}get utils(){return e.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,t){let n={};if(Object.assign(n,e),!e.data&&!(e.target&&e.quantity))throw Error(`A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.`);if(e.owner==null&&t&&t!==`use_wallet`&&(n.owner=t.n),e.last_tx??(n.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data==`string`&&(e.data=c.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw Error(`Expected data to be a string, Uint8Array or ArrayBuffer`);if(e.reward==null){let t=e.data?e.data.byteLength:0;n.reward=await this.transactions.getPrice(t,n.target)}n.data_root=``,n.data_size=e.data?e.data.byteLength.toString():`0`,n.data=e.data||new Uint8Array;let r=new s.default(n);return await r.getSignatureData(),r}async createSiloTransaction(e,t,n){let r={};if(Object.assign(r,e),!e.data)throw Error(`Silo transactions must have a 'data' value`);if(!n)throw Error(`No Silo URI specified.`);if(e.target||e.quantity)throw Error(`Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.`);if(e.owner==null){if(!t||!t.n)throw Error(`A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.`);r.owner=t.n}e.last_tx??(r.last_tx=await this.transactions.getTransactionAnchor());let i=await this.silo.parseUri(n);if(typeof e.data==`string`){let t=await this.crypto.encrypt(c.stringToBuffer(e.data),i.getEncryptionKey());r.reward=await this.transactions.getPrice(t.byteLength),r.data=c.bufferTob64Url(t)}if(e.data instanceof Uint8Array){let t=await this.crypto.encrypt(e.data,i.getEncryptionKey());r.reward=await this.transactions.getPrice(t.byteLength),r.data=c.bufferTob64Url(t)}let a=new s.default(r);return a.addTag(`Silo-Name`,i.getAccessKey()),a.addTag(`Silo-Version`,`0.1.0`),a}arql(e){return this.api.post(`/arql`,e).then(e=>e.data||[])}}})),eL=i((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getDefaultConfig=void 0;var t=(e,t)=>{let n=/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,r=t.split(`.`),i=r[r.length-1],a=[`localhost`,`[::1]`];return a.includes(t)||e==`file`||a.includes(i)||!!t.match(n)||!!i.match(n)},n=e=>{let t=e.charAt(0)===`[`;return!!e.match(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)||t};e.getDefaultConfig=(e,r)=>{if(t(e,r))return{protocol:`https`,host:`arweave.net`,port:443};if(!n(r)){let t=r.split(`.`);if(t.length>=3)return t.shift(),{protocol:e,host:t.join(`.`)}}return{protocol:e,host:r}}})),tL=r(i((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);
61(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0});var r=$I(),i=eL();r.default.init=function(e={}){let t={host:`arweave.net`,port:443,protocol:`https`};if(typeof location!=`object`||!location.protocol||!location.hostname)return new r.default({...e,...t});let n=location.protocol.replace(`:`,``),a=location.hostname,o=location.port?parseInt(location.port):n==`https`?443:80,s=(0,i.getDefaultConfig)(n,a),c=e.protocol||s.protocol,l=e.host||s.host,u=e.port||s.port||o;return new r.default({...e,host:l,protocol:c,port:u})},typeof globalThis==`object`?globalThis.Arweave=r.default:typeof self==`object`&&(self.Arweave=r.default),n($I(),e),e.default=r.default}))()),nL=new(tL.default.default||tL.default)({host:`arweave.net`,port:443,protocol:`https`}),rL={arconnectWalletSwitchListenerAdded:!1},iL=[`ACCESS_ADDRESS`,`ACCESS_PUBLIC_KEY`,`SIGN_TRANSACTION`,`DISPATCH`,`SIGNATURE`,`ENCRYPT`,`DECRYPT`,`ACCESS_TOKENS`],aL=1e6,oL=100,sL=`arConnect`,cL=async()=>{try{return await M.call(`arweave`,`exchange_rate`,{},`post`)}catch{return 0}};function lL(){return async(e,t)=>{try{let t=await cL();e({type:ql,data:Number(t)})}catch(e){console.error(e)}}}function uL(){return nd.getItem(`AR_ADDRESS_IN_USE`)===`true`?()=>{}:(nd.setItem(`WANDER_DISCONNECT`,`false`),async(e,t)=>{if(e({type:fu}),window.arweaveWallet)try{await globalThis.window?.arweaveWallet?.connect(iL),window.wanderInstance.close(),rL.arconnectWalletSwitchListenerAdded||=(window.addEventListener(`walletSwitch`,n),!0);let r=await globalThis.window.arweaveWallet.getActiveAddress(),i=t(),a=Wt(i),o=i.app.modal,s=i.app.modalProps;if(e({type:_l,data:{address:r,type:sL,ar:await _L(r),usdPerAr:await cL()},wallet:window.arweaveWallet}),a!==r){e(A8(cf,{previousModal:o?{id:o,modalProps:s}:void 0}));return}}catch(t){console.error(`error:`,t),(typeof t==`string`?t:t?.message||String(t)).includes(`User cancelled the AuthRequest`)&&nd.setItem(`WANDER_DISCONNECT`,`true`),e({type:qr,data:{error:t?.message||`Error connecting to Arconnect.`}})}else e({type:qr,data:{error:`Arconnect not found, install the extension.`}});function n(t){t?.detail?.address&&e(fL())}})}function dL(){return async(e,t)=>{if(nd.getItem(`AR_ADDRESS_IN_USE`)!==`true`)if(e({type:oc}),window.arweaveWallet)try{let t=await globalThis.window.arweaveWallet.getActiveAddress();e({type:_l,data:{address:t,type:sL,ar:await _L(t),usdPerAr:await cL()},wallet:window.arweaveWallet})}catch(t){e({type:qr,data:{error:t?.message||`Error connecting to Arconnect.`}})}else e({type:qr,data:{error:`Arconnect not found, install the extension.`}})}}function fL(){return async e=>{if(e({type:fu}),window.arweaveWallet)try{await globalThis.window?.arweaveWallet?.disconnect(),e({type:Xa}),window.wanderInstance.signOut()}catch(t){e({type:qr,data:{error:t?.message||`Error connecting to Arconnect.`}})}}}var pL=e=>async t=>{try{if(!window.arweaveWallet)throw Error(`arweaveWallet not found.`);let t=new TextEncoder().encode(e),n=await window.arweaveWallet.signMessage(t);return await window.arweaveWallet.verifyMessage(t,n)}catch{return!1}},mL=(e,t,n,r,i)=>async(a,o)=>{a({type:Du,data:{claimId:r}});let s=``,c=``,l;try{if(!window.arweaveWallet){a({type:bs,data:{claimId:r,error:`error: no wallet connection`}});return}let u=Wt(o());if(await window.arweaveWallet.getActiveAddress()!==u){a({type:bs,data:{claimId:r,error:`error: wallet address not registered`}});return}{let o=await M.call(`customer`,`tip`,{amount:Math.round(oL*e.tipAmountTwoPlaces),creator_channel_name:e.tipChannelName,creator_channel_claim_id:e.channelClaimId,tipper_channel_name:t?``:n.activeChannelName,tipper_channel_claim_id:t?``:n.activeChannelId,currency:e.currency,anonymous:t,source_claim_id:r,receiver_address:e.recipientAddress,sender_address:u,environment:i,v2:!0},`post`);if(o.error){a({type:bs,data:{claimId:r,error:o.error}});return}s=o.reference_token,l=o.transaction_amount}let d=[{name:`Tip_Type`,value:`tip`},{name:`Claim_ID`,value:r},{name:`X-O-Ref`,value:s}],f=String(l);if(e.currency===`AR`)try{let{transactionId:t}=await vL(e.recipientAddress,f,d);c=t}catch(e){return console.error(e),a({type:bs,data:{claimId:r,error:`error: arweave transaction failed`}}),{error:e?.message||e}}else e.currency===`USD`&&(c=await DI({process:`7zH9dlMNoxprab9loshv3Y7WG45DOny_Vrq9KrXObdQ`,data:``,tags:[{name:`Action`,value:`Transfer`},{name:`Quantity`,value:String(e.tipAmountTwoPlaces*aL)},{name:`Recipient`,value:e.recipientAddress},{name:`Tip_Type`,value:`tip`},{name:`Claim_ID`,value:r},{name:`X-O-Ref`,value:s}],Owner:u,signer:NI(window.arweaveWallet)}));if(!c){let e=`error: arweave transaction failed`;return a({type:bs,data:{claimId:r,error:e}}),{error:e}}await M.call(`customer`,`tip`,{amount:Math.round(oL*e.tipAmountTwoPlaces),creator_channel_name:e.tipChannelName,creator_channel_claim_id:e.channelClaimId,tipper_channel_name:t?``:n.activeChannelName,tipper_channel_claim_id:t?``:n.activeChannelId,currency:e.currency,anonymous:t,source_claim_id:r,receiver_address:e.recipientAddress,sender_address:u,environment:i,v2:!0,tx_id:c,token:s},`post`)}catch(e){return console.error(e),a({type:bs,data:{claimId:r,error:e.message}}),{error:e?.message||e}}return a({type:Yu,data:{claimId:r}}),{transactionId:c,currency:e.currency,referenceToken:s}},hL=()=>async(e,t)=>{let n=t();Object.keys(n.arwallet?.tippingStatusById).length===1&&e({type:bs,data:{claimId:Object.keys(n.arwallet?.tippingStatusById)[0],error:`Modal closed`}})},gL=(e,t)=>`https://${t}/wallet/${e}/balance`,_L=async e=>{for(let t of[`arweave.net`,`permagate.io`,`zerosettle.online`,`zigza.xyz`,`ario-gateway.nethermind.dev`])try{return await(await fetch(gL(e,t))).json()/0xe8d4a51000}catch{}return-1},vL=async(e,t,n)=>{let r;try{let i={target:e,recipient:e,quantity:t},a=await nL.createTransaction(i);
61n.forEach(e=>{a.addTag(e.name,e.value)}),await nL.transactions.sign(a),r=await nL.transactions.post(a);let{status:o,statusText:s}=r;if(o!==200)return{error:s,transactionId:r.transactionId,status:o};let{id:c}=a;return{transactionId:c,status:o}}catch(e){return console.error(`ERROR SENDING WINSTONS`,e),{error:`Unknown Error`}}},yL=e=>async t=>{t({type:Fu,data:e})},bL=e=>/^[A-Za-z0-9_-]{43}$/.test(e),xL=(e,t)=>async n=>{if(n({type:Oc}),!window.arweaveWallet)return n({type:ul,data:{error:`arweaveWallet not found.`}}),{error:`arweaveWallet not found.`};if(!bL(e))return n({type:ul,data:{error:`Invalid Arweave address.`}}),{error:`Invalid Arweave address.`};try{let r=nL.ar.arToWinston(t.toString()),i={target:e,recipient:e,quantity:r},a=await nL.createTransaction(i),o=await _L(await globalThis.window.arweaveWallet.getActiveAddress()),s=nL.ar.arToWinston(o.toString()),c=null;if(a.quantity>=s){let t={target:e,recipient:e,quantity:String(r-a.reward)};c=await nL.createTransaction(t),await nL.transactions.sign(c)}else c=a,await nL.transactions.sign(c);let l=await nL.transactions.post(c);return n(N({message:`${t} AR successfully sent to ${e}`})),n({type:bc,data:{txId:l.id,recipient:e,amount:t}}),{txId:l.id}}catch(e){return n(N({message:e.message||`Failed to send AR`,isError:!0})),n({type:ul,data:{error:e.message||`Failed to send AR`}}),{error:e.message||`Failed to send AR`}}},SL=tt(),CL=null;function wL(){return(e,t)=>{let{wallet:{totalBalance:n}}=t();return CL===null&&(CL=j.wallet_balance().then(t=>{CL=null;let{available:r,reserved:i,reserved_subtotals:a,total:o}=t,{claims:s,supports:c,tips:l}=a,u=parseFloat(o);n!==u&&e({type:Ta,data:{totalBalance:u,balance:parseFloat(r),reservedBalance:parseFloat(i),claimsBalance:parseFloat(s),supportsBalance:parseFloat(c),tipsBalance:parseFloat(l)}})}).catch(()=>{CL=null})),CL}}function TL(e=1,t=99999){return(n,r)=>{Zn(r())||(n({type:ws}),j.account_list({page:e,page_size:t}).then(e=>{n({type:Hl,data:e.items})},()=>{n({type:Mc})}))}}function EL(){return e=>{e(wL()),setInterval(()=>e(wL()),1e4)}}function DL(e=1,t=999999){return n=>{n({type:as}),j.transaction_list({page:e,page_size:t}).then(e=>{n({type:Fl,data:{transactions:e.items}})}).catch(e=>{n({type:ca}),gC(n,D(`Failed to get transactions. Try again later.`),e.message||e,`long`)})}}function OL(){return(e,t)=>{let n=Math.random().toString(36).substr(2,9);e({type:$a,data:n});let r=t(),i=rn(r);j.txo_list(i).then(t=>{let n=t.items||[],i=xn(r),a=n.reduce((e,t)=>(t.type===`support`&&t.signing_channel&&!i[t.signing_channel.channel_id]&&e.push(t.signing_channel.channel_id),e),[]);return a.length&&e(lK({page_size:9999,page:1,no_totals:!0,claim_ids:a})),t}).then(t=>{e({type:$o,data:{result:t,fetchId:n}})}).catch(t=>{e({type:$o,data:{error:t.message,fetchId:n}})})}}function kL(e){return t=>{t({type:jo,data:e}),t(OL())}}function AL(){return async e=>{e({type:au});let t=await Promise.all([j.txo_list({type:`other`,is_not_spent:!0,page:1,page_size:1}),j.txo_list({type:`support`,is_not_spent:!0,page:1,page_size:1})]),n={},r=t[0].total_items,i=t[1].total_items;n.other=typeof r==`number`?r:0,n.support=typeof i==`number`?i:0,e({type:Xr,data:n,debug:{resultSets:t}})}}function jL(){return async e=>{e({type:tc});let t=(await j.txo_spend({type:`other`}))[0];e({type:kl,data:{txids:[t.txid]}}),e({type:no,data:{txid:t.txid}}),e(GL())}}function ML(){return async e=>{e({type:po});let t=(await j.txo_spend({type:`support`,is_not_my_input:!0}))[0];e({type:kl,data:{txids:[t.txid]}}),e({type:Ms,data:{txid:t.txid}}),e(GL())}}function NL(){return async e=>{e({type:jc});let t=(await j.txo_spend({}))[0];e({type:kl,data:{txids:[t.txid]}}),e({type:Vl,data:{txid:t.txid}}),e(GL())}}function PL(){return async(e,t)=>{let n=Vr(t())-.005;n<=0||(e({type:to}),await j.wallet_send({addresses:[`bbHs8svj9NMVHYPLro1L1GkXk6scNouFJE`],amount:mC(n)}),e({type:fs}))}}function FL(){return e=>{e({type:La}),j.address_unused().then(t=>{e({type:bi,data:{address:t}})})}}function IL(e){return t=>{t({type:ka}),j.address_is_mine({address:e}).then(e=>{e||t(FL()),t({type:Gc})})}}function LL(e,t){return(n,r)=>{if(Ye(r())-t<=0){n(N({title:D(`Insufficient credits`),message:D(`Insufficient credits`)}));return}n({type:du}),j.wallet_send({addresses:[e],amount:mC(t)}).then(e=>{e.txid?(n({type:Qr}),n(N({message:D(`Credits successfully sent.`),linkText:`${t} LBC`,linkTarget:`/wallet`}))):(n({type:ac,data:{error:e}}),n(N({message:D(`Transaction failed`),isError:!0})))},e=>{n({type:ac,data:{error:e.message}}),(typeof e==`object`?e.message:e).endsWith(`Your action timed out, but may have been completed.`)?n(A8(ld,{title:D(`Transaction failed`),body:`The transaction timed out, but may have been completed. Please wait a few minutes, then check your wallet transactions before attempting to retry.`,onConfirm:e=>e(),hideCancel:!0})):n(N({message:D(`Transaction failed`),subMessage:uC(e?.message),isError:!0}))})}}function RL(e,t,n,r,i=!0,a=``){return(o,s)=>{let c=s(),l=Ye(c),u=_n(c),d=u?u.find(t=>t.claim_id===e.claim_id):!1,f=t||d;if(l-e.amount<=0){o(N({message:D(`Insufficient credits`),isError:!0}));return}let p=t=>{i&&o(N({message:D(f?`Boost transaction successful.`:`Tip successfully sent.`),subMessage:D(`I'm sure they appreciate it!`),linkText:`${e.amount} LBC`,linkTarget:`/${Dr}?tab=fiat-payment-history`})),o({type:Zl,data:{amount:e.amount,type:f?d?`support_own`:`support_others`:`tip`}}),n&&n(t)},m=e=>{let n=D(t?`Boost transaction failed.`:`Tip transaction failed.`);if((typeof e==`object`?e.message:e).endsWith(`Your action timed out, but may have been completed.`)){let e;switch(a){case`comment`:e=D(`The transaction timed out, but may have been completed. Please wait a few minutes, then check your wallet transactions before attempting to retry. Note that due to current limitations, we are unable to re-link the tip sent to a new comment.`);break;default:e=D(`The transaction timed out, but may have been completed. Please wait a few minutes, then check your wallet transactions before attempting to retry.`);break}o(A8(ld,{title:n,body:e,onConfirm:e=>e(),hideCancel:!0}))}o({type:zs,data:{error:e,type:f?d?`support_own`:`support_others`:`tip`}}),r&&r(e)};o({type:Qc}),j.support_create({...e,tip:!f,blocking:!0,amount:mC(e.amount)}).then(p,m)}}function zL(){return{type:$l}}function BL(e){return t=>{t({type:Ml}
61),j.wallet_encrypt({new_password:e}).then(e=>{t(e===!0?{type:$s,result:e}:{type:pc,result:e})})}}function VL(e){return t=>{t({type:vi}),j.wallet_unlock({password:e}).then(e=>{t(e===!0?{type:Uu,result:e}:{type:bo,result:e})})}}function HL(e,t,n,r){return i=>{i(r?{type:Wo}:{type:Vi});let a={claim_id:e};return r&&(a.preview=!0),n&&(a.keep=n),j.support_abandon(a).then(n=>(r||(gC(i,D(`Successfully unlocked your tip!`),``,`long`,!1),i({type:Ji,data:{claimId:e,txid:n.txid,effective:n.outputs[0].amount,type:t}}),i(GL())),n)).catch(e=>{gC(i,D(`Error unlocking your tip`),e.message||e,`long`),i({type:Ao,data:e.message})})}}function UL(){return e=>{e({type:bu}),j.wallet_decrypt().then(t=>{e(t===!0?{type:Ks,result:t}:{type:il,result:t})})}}function WL(){return e=>{e({type:Ls}),j.wallet_status().then(t=>{t&&e({type:Xu,result:t.is_encrypted})})}}var GL=()=>(e,t)=>{let n=t(),r=sr(n),i=pr(n);if(!Object.keys(r).length&&!i.length)return;let a,o=()=>{let n=t(),o=sr(n),s=pr(n),c=Rn(n),l=Vn(n),u=[],d={},f=[],p=new Set([]),m=Object.entries(o);m.forEach(([e,t])=>{u.push(j.transaction_show({txid:t.txid})),p.add(t.type)}),s.length&&s.forEach(e=>u.push(j.transaction_show({txid:e}))),Promise.all(u).then(t=>{let n=!1;t.forEach(e=>{if(s.includes(e.txid))e.height>0&&f.push(e.txid);else if(e.height<=0){let t=m.find(t=>t[1].txid===e.txid);d[t[0]]=t[1]}else n=!0}),n&&(e({type:ll,data:d}),p.has(`channel`)&&e(sK()),p.has(`stream`)&&e(tK())),f.length&&(f.includes(c)&&e(N({message:D(`Your wallet is finished consolidating`)})),f.includes(l)&&e(N({message:D(`Your tips have been collected`)})),e({type:kl,data:{txids:f,remove:!0}})),!Object.keys(r).length&&!i.length&&clearInterval(a)})};a=setInterval(()=>{o()},3e4)},KL=(e,t,n,r,i,a,o)=>s=>{M.call(`customer`,`tip`,{amount:Math.round(100*e.tipAmount),creator_channel_name:e.tipChannelName,creator_channel_claim_id:e.channelClaimId,tipper_channel_name:t?``:n.activeChannelName,tipper_channel_claim_id:t?``:n.activeChannelId,currency:a||`USD`,anonymous:t,source_claim_id:r,environment:i},`post`).then(t=>{let n=a===`USD`?`$`:`€`;s(N({message:D(`Tip successfully sent.`),subMessage:D(`I'm sure they appreciate it!`),linkText:`${n}${e.tipAmount} ⇒ ${e.tipChannelName}`,linkTarget:`/wallet`})),o&&o(t)}).catch(e=>{s(N({message:e.message||D(`Sorry, there was an error in processing your payment!`),isError:!0}))})},qL=({uri:e,transactionType:t})=>async(n,r)=>{let i=r(),a=Lt(i,e),o=jn(a);if(!o)return Promise.resolve();let{claim_id:s,name:c}=o,l=IC(i),u=Wt(i),d=gt(i,s),f=xu(i),p=Or(i,e),m=mr(i,e),h={rentalTag:Wn(i,e),purchaseTag:m,preorderTag:p},g=t===`rental`,_=0,v=0;h.purchaseTag&&h.rentalTag?(_=Number(h.purchaseTag),v=Number(h.rentalTag.price)):h.purchaseTag?_=Number(h.purchaseTag):h.rentalTag?v=Number(h.rentalTag.price):h.preorderTag&&(_=Number(h.preorderTag));let y=g?v:_,b=g?h.rentalTag.expirationTimeInSeconds:void 0,x=Number.isInteger(b)&&b>=0?{validity_seconds:b}:{};try{let{reference_token:e,transaction_amount:r}=await M.call(`customer`,`new_transaction`,{amount:Math.round(100*y),creator_channel_name:c,creator_channel_claim_id:s,...l?{tipper_channel_name:l.name,tipper_channel_claim_id:l.claim_id}:{anonymous:!0},currency:`AR`,environment:SL,source_claim_id:a.claim_id,target_claim_id:a.claim_id,type:t,...x,receiver_address:d.address,sender_address:u,v2:!0},`post`),i=[{name:`X-O-Ref`,value:e}],{transactionId:o}=await vL(d.address,String(r),i);await M.call(`customer`,`new_transaction`,{amount:Math.round(100*y),creator_channel_name:c,creator_channel_claim_id:s,...l?{tipper_channel_name:l.name,tipper_channel_claim_id:l.claim_id}:{anonymous:!0},currency:`AR`,environment:SL,source_claim_id:a.claim_id,target_claim_id:a.claim_id,type:t,...x,receiver_address:d.address,sender_address:u,token:e,tx_id:o,v2:!0},`post`);let f={purchase:{title:`Purchase completed successfully`,subtitle:`Enjoy!`},preorder:{title:`Preorder completed successfully`,subtitle:`You will be able to see the content as soon as it's available!`},rental:{title:`Rental completed successfully`,subtitle:`Enjoy!`}}[t];n(N({message:D(f.title),subMessage:D(f.subtitle)}));return}catch(e){n(N({message:e.message||D(`Sorry, there was an error in processing your payment!`),isError:!0}));return}return M.call(`customer`,`new_transaction`,{amount:Math.round(100*y),creator_channel_name:c,creator_channel_claim_id:s,...l?{tipper_channel_name:l.name,tipper_channel_claim_id:l.claim_id}:{anonymous:!0},currency:f||`USD`,environment:SL,source_claim_id:a.claim_id,target_claim_id:a.claim_id,type:t,...x},`post`).then(e=>
61{let r={purchase:{title:`Purchase completed successfully`,subtitle:`Enjoy!`},preorder:{title:`Preorder completed successfully`,subtitle:`You will be able to see the content as soon as it's available!`},rental:{title:`Rental completed successfully`,subtitle:`Enjoy!`}}[t];n(N({message:D(r.title),subMessage:D(r.subtitle)}))}).catch(e=>{n(N({message:e.message||D(`Sorry, there was an error in processing your payment!`),isError:!0}))})},JL=e=>e.sync||Sn,YL=e=>JL(e).syncHash,XL=e=>JL(e).lastSyncHash,ZL=e=>JL(e).getSyncErrorMessage,QL=e=>JL(e).getSyncIsPending,$L=e=>JL(e).setSyncIsPending,eR=e=>JL(e).syncApplyPasswordError,tR=e=>JL(e).syncLocked,nR=e=>JL(e).prefsReady,rR=e=>JL(e).fatalError,iR=e=>JL(e).syncDeferredDueToMissingPassword,aR=`auth_token`,oR=`saved_password`,sR=typeof window==`object`&&window.location.hostname.includes(`localhost`)?window.location.hostname:Ie,cR;function lR(){try{document.cookie=`cookietest=1`;let e=document.cookie.indexOf(`cookietest=`)!==-1;return document.cookie=`cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT`,e}catch{return!1}}function uR(e,t,n){let r=``;if(n){let e=new Date;e.setTime(e.getTime()+n*24*60*60*1e3),r=`expires=${e.toUTCString()};`}let i=`${e}=${t||``}; ${r} path=/;`;i+=` SameSite=None;`,i+=` domain=${sR}; Secure;`,document.cookie=i}function dR(e){let t=e+`=`,n=document.cookie.split(`;`);for(var r=0;r<n.length;r++){let e=n[r];for(;e.charAt(0)===` `;)e=e.substring(1,e.length);if(e.indexOf(t)===0)return e.substring(t.length,e.length)}return null}function fR(e){document.cookie=e+`=; Max-Age=-99999999; domain=${sR}; path=/; Secure; SameSite=None;`}function pR(e,t){return new Promise(n=>{let r=e??``;cR=r,t&&(r?uR(oR,r,365):gR()),n()})}function mR(){return new Promise(e=>{if(cR){e(cR);return}return hR().then(t=>e(t))})}function hR(){return new Promise(e=>{e(dR(oR))})}function gR(){return new Promise(e=>{fR(oR),e()})}function _R(){return dR(aR)}function vR(e){return uR(aR,e,365)}function yR(){return new Promise(e=>{fR(aR),e()})}function bR(){return new Promise(e=>{yR(),gR(),sessionStorage.removeItem(`bannerHidden`),e()})}function xR(){let e=_R();e&&(yR(),vR(e));let t=dR(oR);t&&uR(oR,t,365)}var SR={id:``,name:``,title:``,items:[],itemCount:0,createdAt:cd(),updatedAt:cd(),type:`collection`};function CR(){return{[rr]:{...SR,items:[],id:rr,name:Qe,type:kr.PLAYLIST},[cr]:{...SR,items:[],id:cr,name:qn,type:kr.PLAYLIST}}}function wR(e){return e&&(e.value?.claims||e.claims&&e.claims.map(e=>e.claim_id)||[])}function TR(e){let t=Object.assign({},SR),n=wR(e),r=e.confirmations===0||e.claim_id?.startsWith(`pending-`)?cd():0,i=Number(e.meta?.creation_timestamp||e.timestamp||r||0),a=Number(e.timestamp||e.meta?.creation_timestamp||r||0);return Object.assign(t,{id:e.claim_id,name:e.value.title||e.name,title:e.value.title||e.name,items:n||[],itemCount:n?n.length:0,description:e.value.description,thumbnail:e.value.thumbnail,tags:e.value.tags||[],createdAt:i,updatedAt:a,type:DR(e.value.tags)}),t}var ER=e=>e&&e.items&&e.items.length;function DR(e,t=new Set,n=new Set){return t.size===1&&t.has(`stream`)&&(n.size===1&&(n.has(`audio`)||n.has(`video`))||n.size===2&&n.has(`audio`)&&n.has(`video`))?kr.PLAYLIST:e&&e.includes(an.FEATURED_CHANNELS)?kr.FEATURED_CHANNELS:kr.COLLECTION}function OR(e,t){let n={};switch(e){case kr.PLAYLIST:case kr.CHANNELS:case kr.COLLECTION:break;case kr.FEATURED_CHANNELS:n.featuredChannelsParams={channelId:t.signing_channel?.claim_id};break;default:console.error(`resolveAuxParams: unhandled type: ${e}`);break}return n}function kR(e){return e&&(e.title||e.name)}function AR(e){switch(e){case rr:return D(`Watch Later`);case cr:return D(`Favorites`);case tn:return D(`Queue`);default:return null}}function jR(e){if(e){let t=e.value?.stream_type;if(t&&(t===`audio`||t===`video`)&&!zr(e)&&!Nr(e)){let t=Ar(e);return t===`non-scheduled`||t===`started`}}return!1}var MR=null,NR=1e3*60*5,PR=`no wallet found for this user`,FR=`InvalidPasswordError`;function IR(e,t){let n=e();return t&&n.sync.sharedStateSyncId!==t}function LR(e,t,n){return r=>(r({type:_a}),M.call(`sync`,`set`,{old_hash:e,new_hash:t,data:n},`post`).then(e=>{if(!e.hash)throw Error(`No hash returned for sync/set.`);return r({type:Io,data:{syncHash:e.hash,lastSyncHash:t||e.hash}})}).catch(e=>{r({type:Zo,data:{error:e}})}))}function RR(e){return{type:ya,data:e}}var zR=(e,t)=>(n,r)=>{let i=r(),a=iu(i,me),o=QL(i),s=$L(i),c=tR(i);return mR().then(r=>{let i=t||t===``?t:r===null?``:String(r);if(a&&!o&&!s&&!c)return n(HR(i,e))})};function BR(e,t){return(n,r)=>{!e&&MR&&clearInterval(MR);let i=r(),a=cn(i),o=iu(i,me),s=tR(i);a&&o&&!s&&(n(zR((e,r)=>n(r5(e,r,t)))),e||(MR=setInterval(()=>{iu(r(),`enable_sync`)&&n(zR((e,t)=>n(r5(e,t,void 0))))},NR)))}}function VR(){return()=>{MR&&clearInterval(MR)}}function HR(e,t){let n=e??``;function r(e,n){if(t){if(typeof t!=`function`)throw Error(`Second argument passed to "doGetSync" must be a function`);t(e,n)}}let i=j.getApiRequestHeaders()&&Object.keys(j.getApiRequestHeaders()).includes(`X-Lbry-Auth-Token`)?j.getApiRequestHeaders()[id]:``;return i&&i!==_R()?(window.location.reload(),()=>{}):(e,t)=>{let i=YL(t());e({type:wa});let a={},o=null;return j.wallet_status().then(t=>(o=t,t.is_locked?XR(t,n)?(e({type:Sc,data:!0}),e({type:ti}),r(null,!1),YR):j.wallet_unlock({password:n}):!0)).then(e=>{if(e===YR)return YR;if(e)return j.sync_hash();throw a.unlockFailed=!0,Error()}).then(e=>{if(e===YR)return YR;let t=e;
61return a.lastSyncHash=t,M.call(`sync`,`get`,{hash:t},`post`)}).then(t=>{if(t===YR)return YR;let s=t.hash;if(a.syncHash=s,a.syncData=t.data,a.changed=t.changed||s!==i,a.hasSyncedWallet=!0,!t.error&&t.changed)return XR(o,n)?(e({type:Sc,data:!0}),a.changed=!1,a.syncData=void 0,e({type:qc,data:a}),r(null,!1),YR):j.sync_apply({password:n,data:t.data,blocking:!0})}).then(t=>{if(t===YR)return;if(!t){e({type:qc,data:a}),r(null,a.changed);return}let{hash:n,data:i}=t;if(a.lastSyncHash=n,n!==a.syncHash)return e(LR(a.syncHash,n,i)).then(t=>{if(t?.type!==`SET_SYNC_COMPLETED`||!t?.data?.syncHash)throw t?.data?.error||Error(`sync/set failed`);a.syncHash=t.data.syncHash,e({type:qc,data:a}),r(null,a.changed)});e({type:qc,data:a}),r(null,a.changed)}).catch(t=>{let i=t&&t.data&&t.data.name===FR,s=!!t?.message?.match(/rpc call sync_apply\(\) on.*?status code: 413. could not decode body to rpc response: invalid character/);if(a.unlockFailed)e({type:Bc,data:{error:t}}),e({type:pu}),r(t);else if(!s&&a.hasSyncedWallet){let n=t&&t.message||`Error getting synced wallet`;e({type:Bc,data:{error:n}}),i&&e({type:pu}),r(n)}else{let i=t&&t.message===PR;if(e({type:qc,data:{hasSyncedWallet:!1,syncHash:null,lastSyncHash:a.lastSyncHash,fatalError:!i}}),s&&!i&&r(!1,!0),i){if(XR(o,n)){e({type:Sc,data:!0}),r(null,!1);return}return j.sync_apply({password:n}).then(({hash:t,data:n})=>{e(LR(``,t,n)),r(!1,!0)}).catch(e=>{r(e)})}}})}}function UR(){return e=>{e({type:wa}),j.sync_hash().then(t=>{M.call(`sync`,`get`,{hash:t},`post`).then(n=>{e({type:qc,data:{hasSyncedWallet:!0,syncHash:n.hash,lastSyncHash:t,syncData:n.data,hashChanged:n.changed}})}).catch(()=>{e({type:qc,data:{hasSyncedWallet:!1,syncHash:null,lastSyncHash:t}})})})}}function WR(e){return{type:Ki,data:e}}function GR(){return{type:ia,data:!0}}function KR(e){if(!e||e.version!==`0.1`||!e.value||typeof e.value!=`object`)return e;let t={builtinCollections:CR(),editedCollections:{},savedCollectionIds:[],unpublishedCollections:{}},n={...e.value},r=!1;return Object.entries(t).forEach(([e,t])=>{Object.prototype.hasOwnProperty.call(n,e)||(n[e]=t,r=!0)}),r?{...e,value:n}:e}function qR(e){if(e&&e.version===`0.1`&&e.value){let t=t=>Object.prototype.hasOwnProperty.call(e.value,t),{subscriptions:n,following:r,tags:i,blocked:a,coin_swap_codes:o,settings:s,app_welcome_version:c,sharing_3P:l,unpublishedCollections:u,editedCollections:d,updatedCollections:f,builtinCollections:p,savedCollectionIds:m,autoPublishById:h,lastViewedAnnouncement:g}=e.value;return{...t(`subscriptions`)?{subscriptions:n}:{},...t(`following`)?{following:r}:{},...t(`tags`)?{tags:i}:{},...t(`blocked`)?{blocked:a}:{},...t(`coin_swap_codes`)?{coin_swap_codes:o}:{},...t(`settings`)?{settings:s}:{},...t(`app_welcome_version`)?{app_welcome_version:c}:{},...t(`sharing_3P`)?{sharing_3P:l}:{},...t(`unpublishedCollections`)?{unpublishedCollections:u}:{},...t(`editedCollections`)?{editedCollections:d}:{},...t(`updatedCollections`)?{updatedCollections:f}:{},...t(`builtinCollections`)?{builtinCollections:p}:{},...t(`savedCollectionIds`)?{savedCollectionIds:m}:{},...t(`autoPublishById`)?{autoPublishById:h}:{},...t(`lastViewedAnnouncement`)?{lastViewedAnnouncement:g}:{}}}return{}}function JR(e){return t=>{let{subscriptions:n,following:r,tags:i,blocked:a,coin_swap_codes:o,settings:s,app_welcome_version:c,sharing_3P:l,unpublishedCollections:u,editedCollections:d,updatedCollections:f,builtinCollections:p,savedCollectionIds:m,autoPublishById:h,lastViewedAnnouncement:g}=qR(e);t({type:sc,data:{subscriptions:n,following:r,tags:i,blocked:a,coinSwapCodes:o,settings:s,welcomeVersion:c,allowAnalytics:l,unpublishedCollections:u,editedCollections:d,updatedCollections:f,builtinCollections:p,savedCollectionIds:m,autoPublishById:h,lastViewedAnnouncement:g}})}}var YR={__syncDeferred:!0};function XR(e,t){return!!(e&&e.is_encrypted)&&(t===``||t==null)}async function ZR(e,t,n,r){let i=t(),a=iu(i,me),o=cn(i),s=tR(i);if(!a||!o||s||!r||r===n)return;let c=await mR(),l=c===null?``:c,u=await j.wallet_status();if(u.is_locked&&!await j.wallet_unlock({password:l})){e({type:Sc,data:!0});return}if(XR(u,l)){e({type:Sc,data:!0});return}let{hash:d,data:f}=await j.sync_apply({password:l});d!==n&&await e(LR(n||``,d,f))}function QR(e,t,n,r,i){return async(a,o)=>{let s=XL(o()),c={type:typeof t,version:n,value:t},l={key:e,value:JSON.stringify(c)};try{await j.preference_set(l);let t=await j.sync_hash();if(e===`shared`)try{await ZR(a,o,s,t)}catch(e){console.error(`Failed to sync shared preferences after preference_set`,e),a({type:gc,error:e})}return r&&r(c),c}catch(e){a({type:gc,error:e}),i&&i()}}}function $R(e,t,n){return r=>{let i={key:e};return j.preference_get(i).then(async n=>{if(n){let i=e===`shared`?KR(n[e]):n[e];return i!==n[e]&&await r(QR(e,i.value,i.version)),t(i)}return t(null)}
61).catch(e=>{r({type:gc,error:e}),n&&n(e)})}}var ez={};ez[hc]=e=>Object.assign({},e,{authToken:null,authenticating:!1}),ez[hs]=e=>Object.assign({},e,{authenticating:!0}),ez[Su]=(e,t)=>Object.assign({},e,{authToken:t.data.authToken,authenticating:!1});var tz=(e,t)=>(n=t,r)=>{let i=e[r.type];if(i){let e=i(n,r);return Object.assign({},n,e)}return n};function nz(e,t){if(!Array.isArray(e)&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=Object.values(e),r=Object.values(t);if(n.length===r.length)return n.every((e,t)=>e===r[t])}return e===t}var rz={fetchingBlackListedData:!1,fetchingBlackListedDataSucceed:void 0,blackListedData:{}},iz=tz({[Js]:e=>({...e,fetchingBlackListedData:!0}),[$c]:(e,t)=>{let{blackListedData:n,success:r}=t.data;return{...e,fetchingBlackListedData:!1,fetchingBlackListedDataSucceed:r,blackListedData:n}},[mu]:(e,t)=>{let{error:n,success:r}=t.data;return{...e,fetchingBlackListedData:!1,fetchingBlackListedDataSucceed:r,fetchingBlackListedDataError:n}}},rz),az={loading:!1,filteredData:{}},oz=tz({[wo]:e=>({...e,loading:!0}),[fi]:(e,t)=>{let{filteredData:n}=t.data;return{...e,loading:!1,filteredData:n}},[Au]:(e,t)=>{let{error:n}=t.data;return{...e,loading:!1,fetchingFilteredDataError:n}}},az),sz={fetchingViewCount:!1,viewCountError:void 0,viewCountById:{},fetchingSubCount:!1,subCountError:void 0,subCountById:{},subCountLastFetchedById:{}},cz=tz({[Ac]:e=>({...e,fetchingViewCount:!0}),[Bl]:(e,t)=>({...e,viewCountError:t.data}),[dl]:(e,t)=>{let{claimIdCsv:n,viewCounts:r}=t.data,i=Object.assign({},e.viewCountById),a=n.split(`,`);return a.length===r.length&&a.forEach((e,t)=>{i[e]=r[t]}),{...e,fetchingViewCount:!1,viewCountById:i}},[qo]:e=>({...e,fetchingSubCount:!0}),[Mo]:(e,t)=>({...e,subCountError:t.data}),[Xi]:(e,t)=>{let{claimIds:n,subCounts:r,fetchDate:i}=t.data,a=Object.assign({},e.subCountById),o=Object.assign({},e.subCountLastFetchedById),s=!1;return n.length===r.length&&n.forEach((e,t)=>{a[e]!==r[t]&&(a[e]=r[t],s=!0),o[e]=i}),{...e,fetchingSubCount:!1,subCountLastFetchedById:o,...s?{subCountById:a}:{}}
61}},sz),lz={},uz={hasSyncedWallet:!1,syncHash:null,syncData:null,setSyncErrorMessage:null,getSyncErrorMessage:null,syncApplyErrorMessage:``,syncApplyIsPending:!1,syncApplyPasswordError:!1,getSyncIsPending:!1,setSyncIsPending:!1,hashChanged:!1};lz[wa]=e=>Object.assign({},e,{getSyncIsPending:!0,getSyncErrorMessage:null}),lz[qc]=(e,t)=>Object.assign({},e,{syncHash:t.data.syncHash,syncData:t.data.syncData,hasSyncedWallet:t.data.hasSyncedWallet,getSyncIsPending:!1,hashChanged:t.data.hashChanged}),lz[Bc]=(e,t)=>Object.assign({},e,{getSyncIsPending:!1,getSyncErrorMessage:t.data.error}),lz[_a]=e=>Object.assign({},e,{setSyncIsPending:!0,setSyncErrorMessage:null}),lz[Zo]=(e,t)=>Object.assign({},e,{setSyncIsPending:!1,setSyncErrorMessage:t.data.error}),lz[Io]=(e,t)=>Object.assign({},e,{setSyncIsPending:!1,setSyncErrorMessage:null,hasSyncedWallet:!0,syncHash:t.data.syncHash}),lz[Dl]=e=>Object.assign({},e,{syncApplyPasswordError:!1,syncApplyIsPending:!0,syncApplyErrorMessage:``}),lz[qs]=e=>Object.assign({},e,{syncApplyIsPending:!1,syncApplyErrorMessage:``}),lz[cc]=(e,t)=>Object.assign({},e,{syncApplyIsPending:!1,syncApplyErrorMessage:t.data.error}),lz[pu]=e=>Object.assign({},e,{syncApplyPasswordError:!0}),lz[gs]=()=>uz;var dz=e=>e.blacklist||{},fz=e=>dz(e).blackListedData,pz=(e,t)=>
61{let n=Lt(e,t),r=jn(n),i=fz(e);return i[n?.claim_id]||i[r?.claim_id||r?.channel_id]},mz=e=>e.filtered||{},hz=e=>mz(e).filteredData,gz=(e,t)=>{let n=Lt(e,t),r=jn(n),i=hz(e);return i[n?.claim_id]||i[r?.claim_id||r?.channel_id]},_z=e=>e.stats||{},vz=e=>_z(e).viewCountById,yz=e=>_z(e).subCountById,bz=(e,t)=>{let n=Ut(e,t),r=vz(e);return n?r[n]:void 0},xz=(e,t)=>{let n=Ut(e,t),r=yz(e);return n?r[n]:void 0},Sz=`top_subscribed`,Cz=`featured`;function wz(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}var Tz=o(),Ez=e=>e.subscriptions||Sn,Dz=a(Ez,e=>e.subscriptions&&[...e.subscriptions].sort((e,t)=>e.channelName.localeCompare(t.channelName))),Oz=a(Dz,e=>e&&e.map(e=>e.uri)),kz=a(Dz,e=>e?Xn.Arr.useStableEmpty(e.map(e=>Ft(e.uri).channelClaimId)):Xn.Arr.EMPTY),Az=e=>Ez(e).lastActiveSubscriptions,jz=a(Ez,e=>e.following);a(Dz,e=>Ez(e).suggested,(e,t)=>{if(!t)return null;let n=wz(t[Sz]),r=wz(t[Cz]),i={...n};return Object.keys(r).forEach(e=>{i[e]||(i[e]=r[e])}),e.forEach(({uri:e})=>{let t=e.slice(7);i[t]&&delete i[t]}),Object.keys(i).map(e=>({uri:e,label:i[e]}))}),a(Dz,Br,(e,t)=>{let n={};return e.forEach(e=>{t&&t[e.uri]&&(n[e.uri]=!0)}),n});var Mz=(0,Tz.createCachedSelector)((e,t)=>t,Lt,Dz,(e,t,n)=>{let r=jn(t);if(r){let e=r.permanent_url;return n.some(t=>Gt(t.uri,e))}return Gn(t,e)?n.some(t=>Gt(t.uri,e)):!1})((e,t)=>String(t)),Nz=(0,Tz.createCachedSelector)(Xe,Dz,(e,t)=>{let n=jn(e);if(n){let e=n.permanent_url;return t.some(t=>Gt(t.uri,e))}return!1})((e,t)=>String(t)),Pz=e=>a(jz,lr(e,!0),yr(e),(t,n,r)=>{let i=Array.isArray(t)?t:[];if(n){let e=i.find(e=>Gt(e.uri,n));return!!(e&&e.notificationsDisabled)}let a;try{({isChannel:a}=Ft(e))}catch{}if(a&&r){let e=r.permanent_url,t=i.find(t=>Gt(t.uri,e));return!!(t&&t.notificationsDisabled)}return!1}),Fz={NEWEST:0,OLDEST:1,CONTROVERSY:2,POPULARITY:3,NEWEST_NO_PINS:4},Iz={SELF:`self`,MODERATOR:`moderator`,ADMIN:`admin`},Lz={IS_EDITED:5*1e3},Rz=e=>`https://static.odycdn.com/stickers/${e}`,Z=(e,t,n)=>({name:`:${e}:`,url:Rz(t),price:n}),zz=`CAT/PNG/cat_with_border.png`,Bz=`FAIL/PNG/fail_with_border.png`,Vz=`HYPE/PNG/hype_with_border.png`,Hz=`PANTS/PNG/PANTS_1_with_frame.png`,Uz=`PISS/PNG/piss_with_frame.png`,Wz=`pregnant%20man/png/Pregnant%20man_white%20border_blondie.png`,Gz=`ROCKET%20SPACEMAN/PNG/rocket-spaceman_with-border.png`,Kz=`SALTY/PNG/salty.png`,qz=`SICK/PNG/sick2_with_border.png`,Jz=`SICK/PNG/with%20borderdark%20with%20frame.png`,Yz=`SLIME/PNG/slime_with_frame.png`,Xz=`MISC/PNG/fire.png`,Zz=`SPHAGETTI%20BATH/PNG/sphagetti%20bath_with_frame.png`,Qz=`THUG%20LIFE/PNG/thug_life_with_border_clean.png`,$z=`WHUUT/PNG/whuut_with-frame.png`,eB=`BULL/PNG/bull-ride.png`,tB=`TRAP/PNG/trap.png`,nB=`MISC/PNG/kanye_west.png`,rB=`MISC/PNG/che_guevara.png`,iB=`MISC/PNG/bill_cosby.png`,aB=`MISC/PNG/kurt_cobain.png`,oB=`MISC/PNG/bill_clinton.png`,sB=`MISC/PNG/taylor_swift.png`,cB=`MISC/PNG/epstein_island.png`,lB=`MISC/PNG/donald_trump.png`,uB=`MISC/PNG/egg_carton.png`,dB=`MISC/PNG/mount_rushmore.png`,fB=`MISC/PNG/money_printer.png`,pB=`ELIMINATED/PNG/eliminated.png`,mB=`TRASH/PNG/trash.png`,hB=`BAN/PNG/ban.png`,gB=`TIPS/png/$%20comet%20tip%20with%20border.png`,_B=`TIPS/png/big_LBC_TIPV.png`,vB=`TIPS/png/with%20borderbig$tip.png`,yB=`TIPS/png/bite_$tip_with%20border.png`,bB=`TIPS/png/bite_$tip_closeup.png`,xB=`TIPS/png/with%20borderfortunechest_LBC_tip.png`,SB=`TIPS/png/with%20borderfortunechest$_tip.png`,CB=`TIPS/png/with%20borderlarge_LBC_tip%20.png`,wB=`TIPS/png/with%20borderlarge$tip.png`,TB=`TIPS/png/LBC%20bite.png`,EB=`TIPS/png/LBC%20comet%20tip%20with%20border.png`,DB=`TIPS/png/with%20bordermedium_LBC_tip%20%20%20%20%20%20%20%20%20%20.png`,OB=`TIPS/png/with%20bordermedium$_%20tip.png`,kB=`TIPS/png/with%20bordersilver_odysee_coinv.png`,AB=`TIPS/png/with%20bordersmall_LBC_tip%20.png`,jB=`TIPS/png/with%20bordersmall$_tip.png`,MB=`TIPS/png/tip_hand_flip_$%20_with_border.png`,NB=`TIPS/png/tip_hand_flip_coin_with_border.png`,PB=`TIPS/png/tip_hand_flip_lbc_with_border.png`,FB=[Z(`FIRE`,Xz),Z(`SLIME`,Yz),Z(`PISS`,Uz),Z(`THUMBS_UP`,`MISC/PNG/thumbs_up.png`),Z(`BRAVO`,`MISC/PNG/bravo.png`),Z(`WOW`,`MISC/PNG/wow.png`),Z(`GRR`,`MISC/PNG/grr.png`),Z(`ACTUALLY`,`MISC/PNG/actually.png`),Z(`INTERESTING`,`MISC/PNG/interesting.png`),Z(`CAT`,zz),Z(`FAIL`,Bz),Z(`HYPE`,Vz),Z(`PANTS_1`,Hz),Z(`DOGE`,`MISC/PNG/doge.png`),Z(`EGG_CARTON`,uB),Z(`WAITING`,`MISC/PNG/waiting.png`),Z(`BULL_RIDE`,eB),Z(`ELIMINATED`,pB),Z(`BAN`,hB),Z(`MONEY_PRINTER`,fB),Z(`MOUNT_RUSHMORE`,dB),Z(`KANYE_WEST`,nB),Z(`TAYLOR_SWIFT`,sB),Z(`DONALD_TRUMP`,lB),Z(`BILL_CLINTON`,oB),Z(`EPSTEIN_ISLAND`,cB),Z(`KURT_COBAIN`,aB),Z(`BILL_COSBY`,
61iB),Z(`CHE_GUEVARA`,rB),Z(`PREGNANT_MAN_BLONDE`,Wz),Z(`ROCKET_SPACEMAN`,Gz),Z(`SALTY`,Kz),Z(`SICK_FLAME`,qz),Z(`SICK_SKULL`,Jz),Z(`SPHAGETTI_BATH`,Zz),Z(`THUG_LIFE`,Qz),Z(`TRAP`,tB),Z(`TRASH`,mB),Z(`WHUUT`,$z)],IB=[Z(`TIP_HAND_FLIP`,MB,1),Z(`TIP_HAND_FLIP_COIN`,NB,1),Z(`TIP_HAND_FLIP_LBC`,PB,1),Z(`COMET_TIP`,gB,5),Z(`SILVER_ODYSEE_COIN`,kB,5),Z(`LBC_COMET_TIP`,EB,25),Z(`SMALL_TIP`,jB,25),Z(`SMALL_LBC_TIP`,AB,25),Z(`BITE_TIP`,yB,50),Z(`BITE_TIP_CLOSEUP`,bB,50),Z(`BITE_LBC_CLOSEUP`,TB,50),Z(`MEDIUM_TIP`,OB,50),Z(`MEDIUM_LBC_TIP`,DB,50),Z(`LARGE_TIP`,wB,100),Z(`LARGE_LBC_TIP`,CB,100),Z(`BIG_TIP`,vB,150),Z(`BIG_LBC_TIP`,_B,150),Z(`FORTUNE_CHEST`,SB,200),Z(`FORTUNE_CHEST_LBC`,xB,200)],LB=`like`,RB=`dislike`,zB=`creator_like`,BB=[...FB,...IB],VB=/(<stkr>:[A-Z0-9_]+:<stkr>)/,HB=e=>`<stkr>${e}<stkr>`;function UB(e){let t=e.match(VB),n=t&&t[0],r=n&&n.replace(/<stkr>/g,``);return n&&n.length===e.length&&BB.find(({name:e})=>e===r)}function WB(e){let t=UB(e);return t&&t.url}function GB(e){return e===0&&D(`Leave a comment`)||e===1&&D(`1 comment`)||D(`%total_comments% comments`,{total_comments:e})}function KB(e){if(!e)return{};if(Array.isArray(e))return{sections:e};if(typeof e==`string`){try{let t=JSON.parse(e);if(Array.isArray(t))return{sections:t};if(t&&typeof t==`object`)return t}catch{}return{}}return typeof e==`object`?e:{}}function qB(e){if(!e)return[];let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return[]}return Array.isArray(t)?t.map((e,t)=>{if(!e||typeof e!=`object`)return null;let n=typeof e.name==`string`?e.name.trim():``;if(!n)return null;let r=Number(e.createdAt||0),i=Number(e.lastUsedAt||0),a=!!e.isPinned,o=e.data&&typeof e.data==`object`?e.data:{};return{id:e.id||`${n.toLowerCase().replace(/\s+/g,`-`)}-${r||t}`,name:n,createdAt:Number.isFinite(r)?r:0,lastUsedAt:Number.isFinite(i)&&i>0?i:void 0,isPinned:a,data:o}}).filter(Boolean):[]}function JB(e){if(!e)return[];let t=qB(e.upload_templates);if(t.length>0)return t;let n=qB(KB(e.homepage_settings).upload_templates);return n.length>0?n:[]}var YB=e=>e.search.results,XB=e=>e.search.mentionQuery,ZB=e=>e.comments||Sn,QB=e=>ZB(e).commentById||Sn,$B=e=>ZB(e).byId,eV=e=>ZB(e).isLoading,tV=e=>ZB(e).isLoadingByParentId,nV=e=>ZB(e).isFetchingReacts,rV=e=>e.comments.myReactsByCommentId,iV=(e,t)=>e.comments.myReactsByCommentId&&e.comments.myReactsByCommentId[t],aV=(e,t)=>tV(e)[t],oV=e=>{let t=eV(e),n=Object.keys(tV(e)).length===0;return t&&n},sV=e=>e.comments.othersReactsByCommentId,cV=(e,t)=>e.comments.othersReactsByCommentId&&e.comments.othersReactsByCommentId[t],lV=(0,Tz.createCachedSelector)(Ut,e=>e.comments.commentById,e=>e.comments.pinnedCommentsById,(e,t,n)=>{let r=n&&n[e],i=[];return r&&r.forEach(e=>{i.push(t[e])}),i})((e,t)=>String(t)),uV=a(e=>ZB(e).moderationBlockList,e=>e||Ot),dV=a(ZB,e=>e.adminBlockList||Ot),fV=a(ZB,e=>e.moderatorBlockList||Ot),pV=e=>ZB(e).personalTimeoutMap,mV=e=>ZB(e).adminTimeoutMap,hV=e=>ZB(e).moderatorTimeoutMap,gV=e=>ZB(e).moderatorBlockListDelegatorsMap,_V=e=>ZB(e).togglingForDelegatorMap,vV=e=>ZB(e).blockingByUri,yV=e=>ZB(e).unBlockingByUri,bV=e=>ZB(e).fetchingModerationBlockList,xV=e=>ZB(e).moderationDelegatesById,SV=e=>ZB(e).moderationDelegatorsById,CV=a(ZB,e=>{let t=Object.keys(e.moderationDelegatorsById);for(let n=0;n<t.length;++n){let r=t[n];if(e.moderationDelegatorsById[r]&&e.moderationDelegatorsById[r].global)return!0}return!1}),wV=a(ZB,QB,(e,t)=>{let n=e.byId||Sn,r={};return Object.keys(n).forEach(e=>{let i=n[e];r[e]=Array(i===null?0:i.length);for(let n=0;n<i.length;n++)r[e][n]=t[i[n]]}),r}),TV=e=>ZB(e).superChatsByUri,EV=a(e=>ZB(e).topLevelCommentsById,QB,(e,t)=>{let n=e||Sn,r={};return Object.keys(n).forEach(e=>{let i=n[e];r[e]=Array(i===null?0:i.length);for(let n=0;n<i.length;n++)r[e][n]=t[i[n]]}),r}),DV=a((e,t)=>t,QB,(e,t)=>t[e]),OV=e=>ZB(e).fetchedCommentAncestors,kV=a((e,t)=>t,OV,(e,t)=>t&&t[e]),AV=(e,t)=>{let n=Ut(e,t);return $B(e)[n]},jV=(e,t)=>{let n=Ut(e,t);return!!ZB(e).listErrorsByClaimId?.[n]},MV={claimsById:xn,myClaimIds:rt,myChannelClaimIds:Et,mutedChannels:br,personalBlockList:uV,blackListedData:fz,filteredData:hz,showMatureContent:Wu,geoBlockList:Tr,locale:bt,delegatorsById:SV},NV=Object.keys(MV),PV=Object.values(MV),FV=e=>ZB(e).pendingCommentReactions,IV=e=>ZB(e).settingsByChannelId,LV=e=>ZB(e).fetchingSettings,RV=(e,t)=>{let n=IV(e);return n&&n[t]},zV=(e,t)=>{let n=RV(e,t);return n&&n.comments_enabled},BV=(e,t)=>zV(e,t)===!1,VV=(e,t)=>{let n=RV(e,t);return n&&n.livestream_chat_members_only},HV=(e,t)=>{let n=RV(e,t);return n&&n.comments_members_only},UV=(e,t)=>RV(e,t)?.channel_sections,WV=(e,t)=>JB(RV(e,t)),GV=(0,Tz.createCachedSelector)(RV,e=>{let t=e?.channel_sections;if(t&&t.entries)return Object.values(t.entries).filter(e=>e.value_type===`featured_channels`)})((e,t)=>String(t)),KV=(0,Tz.createCachedSelector)((e,t)=>t,wV,Ut,...PV,(e,t,n,...r)=>ZV(t&&t[n],n,r))((e,t)=>String(t)),qV=(0,Tz.createCachedSelector)((e,t)=>t,(e,t,n)=>n,EV,Ut,...PV,(e,t=-1,n,r,...i)=>{let a=n&&n[r];return a?ZV(t>0?a.slice(0,t):a,r,i):Ot})((e,t,n=-1)=>`${String(t)}:${n}`),JV=(e,t)=>{let n=Ut(e,t);return e.comments.topLevelTotalPagesById[n]||0},YV=(e,t)=>{let n=Ut(e,t);return e.comments.lastFetchedTopLevelPageById?.[n]||0},XV=(0,Tz.createCachedSelector)((e,t)=>t,e=>ZB(e).repliesByParentId,QB,...PV,(e,t,n,...r)=>{let i=t[e]||Ot;if(!i.length)return Ot;let a=[];
61return i.forEach(e=>{a.push(n[e])}),ZV(a,a.find(e=>e&&e.claim_id)?.claim_id,r)})((e,t)=>String(t)),ZV=(e,t,n)=>{let{claimsById:r,myClaimIds:i,myChannelClaimIds:a,mutedChannels:o,personalBlockList:s,blackListedData:c,filteredData:l,showMatureContent:u,geoBlockList:d,locale:f,delegatorsById:p}=n.reduce((e,t,n)=>(e[NV[n]]=t,e),{}),m=r[t]?.signing_channel?.claim_id,h=!1;for(let e of Object.values(p))if(e&&typeof e==`object`&&`delegators`in e){for(let t of Object.values(e.delegators))if(t===m){h=!0;break}if(h)break}return e?e.filter(e=>{if(!e)return!1;let n=r[e.channel_id];if(n){if((i&&i.size>0||a&&a.length>0)&&(n.is_my_output||a.includes(n.claim_id)||i.includes(n.claim_id)))return!0;if(c[n.claim_id]||l[n.claim_id]||!u&&Dn(n))return!1}return!(t&&i&&i.size>0&&i.includes(t))&&!h&&s.includes(e.channel_url)||n&&gr(n,f,d)?!1:!o.includes(e.channel_url)}):Ot},QV=e=>a(ZB,t=>t.repliesTotalPagesByParentId[e]||0),$V=(e,t)=>{let n=Ut(e,t);return e.comments.totalCommentsById[n]||0},eH=(e,t)=>GB($V(e,t)),tH=e=>a(uV,t=>t?t.includes(e):!1),nH=e=>a(dV,t=>t?t.includes(e):!1),rH=(e,t)=>a(fV,gV,(n,r)=>n?n.includes(e)&&r[e]&&r[e].includes(t):!1),iH=(e,t)=>a(_V,n=>n[e]&&n[e].includes(t)),aH=e=>a(vV,yV,(t,n)=>t[e]||n[e]),oH=(e,t)=>TV(e)[t],sH=(e,t)=>{let n=oH(e,t);return n?n.comments:void 0},cH=(0,Tz.createCachedSelector)((e,t)=>t,ft,xn,qV,Oz,YB,XB,(e,t,n,r,i,a,o)=>{let s,c=[],l=[],u=[],d=[];if(e){let i=n[t[e]],a=i&&jn(i);s=a&&a.canonical_url,r.forEach(({channel_url:e})=>{if(!c.includes(e)){c.push(e);let r=n[t[e]];r&&r.canonical_url&&l.push(r.canonical_url)}})}i.forEach(e=>{let r=n[t[e]];r&&r.canonical_url&&u.push(r.canonical_url)});let f=!1;return a&&a.length>0&&(a.forEach(e=>{let r=n[t[e]];r&&r.canonical_url&&d.push(r.canonical_url)}),f=d.length>0),{canonicalCommentors:l,canonicalCreatorUri:s,canonicalSearch:d,canonicalSubscriptions:u,commentorUris:c,hasNewResolvedResults:f,query:o}})((e,t,n)=>`${String(t)}:${n}`),lH=(e,t)=>t?ZB(e).myCommentedChannelIdsById[t]:null,uH=Object.freeze({}),dH=(0,Tz.createCachedSelector)(Lt,fz,hz,br,uV,(e,t,n,r,i)=>{if(!e)return uH;let a=jn(e),o={};return t&&(a&&t[a.claim_id||a.channel_id]||t[e.claim_id])&&(o.blacklisted=!0),n&&(a&&n[a.claim_id||a.channel_id]||n[e.claim_id])&&(o.filtered=!0),r?.length&&a&&r.some(e=>Gt(e,a.permanent_url))&&(o.muted=!0),i.length&&a&&i.some(e=>Gt(e,a.permanent_url))&&(o.blocked=!0),Object.keys(o).length===0?uH:o})((e,t)=>String(t)),fH=Array.from({length:256});for(let e=0;e<=255;++e)fH[e]=e.toString(16).padStart(2,`0`);function pH(e){let t=new Uint8Array(e),n=Array.from({length:t.length});for(let e=0;e<t.length;++e)n[e]=fH[t[e]];return n.join(``)}var mH=tt(),hH=e=>async(t,n)=>{let r=n(),i=$t(r,e),a=ct(r,e);if(!(i&&wt(r,i)))return t({type:Fa,data:i}),await M.call(`account`,`check`,{channel_claim_id:i,channel_name:a,environment:mH,v2:!0},`post`).then(e=>t({type:nl,data:{accountCheckResponse:e,claimId:i}})).catch(()=>t({type:nl,data:{accountCheckResponse:void 0,claimId:i}}))},gH=()=>async(e,t)=>Xt(t())?Promise.resolve():(e({type:bl}),await M.call(`account`,`status`,{environment:mH,v2:!0},`post`).then(t=>(e({type:Cs,data:t}),t?.arweave||t?.stripe?t:{stripe:t})).catch(t=>{if(t.message===`account not linked to user, please link first`)return e({type:Cs,data:!1}),t;e(N({message:D(`There was an error getting your account setup, please try again later`),isError:!0})),e({type:Cs,data:null})})),_H=()=>async(e,t)=>await M.call(`account`,`remove`,{environment:mH},`post`).then(()=>e(gH())).catch(t=>{throw e(N({message:t.message||t,isError:!0})),Error(t.message||t)}),vH=()=>async e=>await M.call(`customer`,`list`,{environment:mH},`post`).then(t=>{e({type:Kl,data:t})}).catch(e=>e),yH=e=>async t=>(t({type:aa}),await M.call(`customer`,`list`,{environment:mH,claim_id_filter:e},`post`).then(e=>t({type:Ya,data:e})).catch(e=>t({type:Bi,data:{error:e.message}}))),bH=e=>t=>{let n={environment:mH,claim_id_filter:e.join(`,`)};return t({type:aa}),M.call(`customer`,`list`,n,`post`).then(e=>t({type:Ya,data:e})).catch(e=>t({type:Bi,data:e.message}))},xH=e=>t=>M.call(`customer`,`purchase_cost`,{environment:mH,amount:e}),SH=()=>async e=>await M.call(`account`,`list`,{environment:mH},`post`).then(t=>{Number.isInteger(t?.length)&&t.reverse(),e({type:Ic,data:t})}),CH=()=>async(e,t)=>{if(!kt(t()))return e({type:yc}),await M.call(`customer`,`status`,{environment:mH},`post`).then(t=>(e({type:Dc,data:t}),t)).catch(t=>(t===`internal_apis_down`?e(N({message:D(ln),isError:!0})):t.message===`user as customer is not setup yet`||e(N({message:D(hn),isError:!0})),typeof t==`object`&&t?.message===`user as customer is not setup yet`?e({type:Dc,data:null}):e({type:Dc,data:void 0}),t))},wH=()=>async e=>await M.call(`customer`,`remove`,{environment:mH},`post`).then(()=>e(CH())).catch(t=>{throw e(N({message:t.message||t,isError:!0})),Error(t.message||t)}),TH=async(e,t,n=`AR`)=>{try{let r=await window.arweaveWallet.getActivePublicKey(),i=new TextEncoder().encode(e),a={currency:n,pub_key:r,signature:pH(await window.arweaveWallet.signMessage(i))};return t&&(a.default=!0),await M.call(`arweave/address`,`add`,a,`post`)}catch(e){throw console.error(e),e}},EH=async(e,t)=>{try{return await M.call(`arweave/address`,`update`,{id:e,status:t},`post`)}catch(e){throw console.error(e),e}},DH=async e=>{try{return await M.call(`arweave/address`,`update`,{id:e,set_default:!0},`post`)}catch(e){throw console.error(e),e}},OH=(e,t)=>async n=>{n({type:rl,data:e});try{let r=await TH(e,t);if(r.error)throw Error(r.error);await n(gH()),n({type:yu,data:e})}catch(e){if(console.error(e),e.message===`address already exists`)return;throw e.message===`address already exists for another user`?(nd.setItem(`AR_ADDRESS_IN_USE`,`true`),n({type:Gs,data:e.message}),n({type:qr,data:{error:e.message}}),e):(n(A8(bd,{error:e.message||e})),n({type:Gs,data:e?.message||e}),e)}},kH=()=>e=>{nd.setItem(`AR_ADDRESS_IN_USE`,`false`),e({type:nu})},AH=(e,t)=>async n=>{n({type:fc,data:e});try{await EH(e,t),await n(gH()),n({type:jl,data:e})}catch(e){console.error(e),n({type:Qs,data:e?.message||e})}},jH=e=>async t=>{t({type:ks,data:e});try{await DH(e),await t(gH()),t({type:wl,data:e})}catch(e){console.error(e),t({type:Lc,data:e?.message||e})}},MH=(e,t=!1)=>({membership_id:e,revert:t}),NH=e=>e.map(e=>e.price).reduce((e,t)=>
61e+t,0),PH=e=>{let t=kn().subtract(30,`days`);return e.filter(e=>e.completed_at&&kn(e.completed_at).diff(t)>0).reduce((e,t)=>e+t.usd_amount,0)};function FH(e,t,n){let r=`Exclusive content`,i=`Exclusive livestreams`;switch(e){case`file`:case`post`:return r;case`livestream`:switch(t){case`new_placeholder`:return i;case`choose_replay`:return r;case`edit_placeholder`:switch(n){case`update_only`:return i;case`use_replay`:case`upload_replay`:return r}}}return Ve(!1,`unhandled restriction combo`,{type:e,liveCreateType:t,liveEditType:n}),r}function IH(e,t){return e.filter(e=>e.perks&&e.perks.some(e=>e.name===t))}function LH(e){return new Date>new Date(e)}var RH=e=>{let t=e.membership.first_payment_due_at,n=kn(t),r=kn(e.subscription.ends_at),i=kn(),a=i.diff(n)<0,o=r&&i.diff(r)>0;return e.payments.some(e=>e.status===`submitted`)||t===null&&o?null:a&&o?n:r},zH=e=>{let t=RH(e);return t===null?null:t.format(`LL`)},BH=Object.freeze({PREMIUM:`Premium`,PREMIUM_PLUS:`Premium+`});Object.freeze({[BH.PREMIUM]:`Badge on profile, automatic credits confirmation, early access to new features`,[BH.PREMIUM_PLUS]:`Badge on profile, automatic credits confirmation, early access to new features, keeps Odysee Ad-free for everyone`});var VH=Object.freeze({year:`Yearly`,month:`Monthly`}),HH=Object.freeze({[BH.PREMIUM]:{[_t.EUR]:`€0.89`,[_t.USD]:`99¢`},[BH.PREMIUM_PLUS]:{[_t.EUR]:`€2.68`,[_t.USD]:`$2.99`}}),UH=Object.freeze({MEMBER_BADGE:{id:4,name:`Member badge`,description:`Badge shown in chat`},PROTECTED_CONTENT:{id:5,name:`Exclusive content`,description:`Access to members-only content and chat`},PROTECTED_LIVESTREAM:{id:6,name:`Exclusive livestreams`,description:`Access to members-only livestreams and chat`},MEMBERS_ONLY_CHAT:{id:7,name:`Members-only chat`,description:`Access to members-only chat on public content`,editable:!0}}),WH=[UH.MEMBER_BADGE.id],GH=[UH.MEMBER_BADGE.id,UH.PROTECTED_CONTENT.id,UH.PROTECTED_LIVESTREAM.id],KH=[UH.MEMBERS_ONLY_CHAT.id],qH=e=>e.memberships||Sn,JH=e=>qH(e).membershipMineByCreatorId,YH=e=>qH(e).membershipMineFetching,XH=e=>JH(e)!==void 0,ZH=e=>qH(e).membershipBuyError,QH=e=>qH(e).fetchingIdsByCreatorId,$H=e=>qH(e).channelMembershipsByCreatorId,eU=e=>qH(e).legacyOdyseePremiumById,tU=(e,t)=>$H(e)[t],nU=e=>qH(e).pendingBuyIds,rU=e=>qH(e).membershipPaymentsIncoming,iU=(e,t)=>{let n=nU(e);return n?n.includes(t):!1},aU=e=>qH(e).membershipListFetchingIds,oU=(e,t)=>{let n=aU(e);return n?n.includes(t):!1},sU=e=>qH(e).membershipListByCreatorId,cU=(e,t)=>sU(e)[t],lU=e=>qH(e).claimMembershipTiersFetchingIds,uU=(e,t)=>{let n=lU(e);return n?n.includes(t):!1},dU=e=>qH(e).protectedContentClaimsByCreatorId,fU=e=>
61qH(e).mySupportersList,pU=e=>fU(e)?.length||0,mU=e=>qH(e).listingAllMyTiers,hU=e=>qH(e).membershipOdyseePerks,gU=a(hU,e=>e.filter(e=>GH.includes(e.id))),_U=a(fU,e=>e&&NH(e)),vU=a(rU,e=>e&&PH(e)),yU=a(xr,fU,(e,t)=>t&&t.filter(t=>t.supported_channel_name===e)),bU=(e,t)=>yU(e,t)?.length||0,xU=a(yU,e=>e&&NH(e)),SU=a(JH,e=>{if(!e)return e;let t={};for(let n in e){let r=e[n];for(let e of r)e.auto_renew&&(t[n]=new Set(t[n]),t[n].add(e),t[n]=Array.from(t[n]))}return t}),CU=(e,t,n)=>{let r=JH(e)[t];return r&&!!r.find(e=>e.membership.id===n&&(e.subscription.is_active===!0||e.subscription.status===`pending`&&e.payments.some(e=>e.status===`submitted`)))||!1},wU=(e,t)=>JH(e)[t],TU=(e,t,n)=>{let r=wU(e,t);return r&&r.find(e=>e.membership.id===n)||null},EU=(e,t,n)=>{let r=JH(e)[t];return r&&!!r.find(e=>e.membership.id===n&&e.subscription.status===`canceled`&&!LH(e.subscription.ends_at))||!1},DU=(e,t,n)=>{let r=JH(e)[t];return r&&!!r.find(e=>e.membership.id===n&&e.subscription.status===`pending`&&!e.payments.some(e=>e.status===`submitted`))||!1},OU=a(JH,e=>{let t={};for(let n in e){let r=e[n];for(let e of r)e.subscription.is_active===!0&&(t[n]=new Set(t[n]),t[n].add(e),t[n]=Array.from(t[n]))}return t}),kU=a(a(JH,e=>{if(!e)return e;let t=Object.assign({},e);return delete t[bn.ID],t}),e=>e&&Object.values(e).reduce((e,t)=>e.concat(t),[])),AU=(e,t)=>OU(e)[t]||null,jU=e=>gW(e).reduce((e,t)=>{let n=t.subscriber_channel_claim_id;return e[n]?e[n].push(t):e[n]=[t],e},{}),MU=(e,t)=>{let n=AU(e,t);return!!(n&&n.length>0)},NU=e=>MU(e,bn.ID),PU=a(OU,e=>{let t=new Set([]);return Object.entries(e).forEach(([e,n])=>{n.forEach(e=>{t.add(e.membership.id)})}),t.size?Array.from(t):null});a(JH,e=>{if(!e)return e;let t={};for(let n in e){let r=e[n];for(let e of r)e.subscription.status===`canceled`&&(t[n]=new Set(t[n]),t[n].add(e),t[n]=Array.from(t[n]))}return t});var FU=(e,t)=>{let n=JH(e);return n&&n[t]},IU=(e,t)=>QH(e)[t],LU=(e,t)=>{let n=eU(e);return n?n[t]:null},RU=(0,Tz.createCachedSelector)((e,t,n)=>n,tU,AU,Et,(e,t,n,r)=>t&&t[e])((e,t,n)=>`${String(t)}:${String(n)}`),zU=(e,t,n)=>t!==bn.ID&&RU(e,t,n);a(e=>AU(e,bn.ID),e=>e?e.some(e=>e.name===BH.PREMIUM_PLUS):e===void 0?void 0:!1);var BU=a(sU,e=>{let t={};for(let n in e){let r=e[n];r&&r.forEach(e=>{t[e.membership_id]=e})}return t}),VU=(e,t)=>BU(e)[t],HU=a((e,t)=>t,sU,(e,t)=>{let n={};return e.forEach(e=>{let r=t[e];r&&(n[e]=r)}),n}),UU=(e,t,n)=>{let r=cU(e,t);if(!r)return-1;let i=r.findIndex(e=>e.membership_id===n);return i===-1?-1:i},WU=a(e=>{let t=Et(e);return t&&HU(e,t)},e=>!!(e&&Object.values(e).length>0)),GU=[],KU=e=>{if(e===void 0)return;if(!e||e.length===0)return GU;let t=e.filter(e=>e.prices.some(e=>e.address!==``)&&e.enabled);return t.length===0?GU:t},qU=(0,Tz.createCachedSelector)((e,t)=>cU(e,t),e=>KU(e))((e,t)=>String(t)),JU=(e,t)=>qU(e,$t(e,t)||``),YU=(e,t,n)=>{if(!e)return null;let r=cU(e,t);if(!r)return null;let i=r.filter(e=>e.enabled===!0).findIndex(e=>e.membership_id===n);return i===-1?null:i+1},XU=a(JU,e=>e!==void 0),ZU=a(JU,e=>!!(e?.length>0&&e.some(e=>e.enabled=!0))),QU=(e,t)=>{let n=FU(e,t);if(!n)return n;let r=cU(e,t);return r&&Object.assign({},n[0],r.find(e=>e.membership_id===n[0].id))},$U=a((e,t)=>FU(e,$t(e,t)||``),e=>e&&(e.filter(e=>e.subscription.is_active&&e.subscription.status!==`canceled`)[0]||null)),eW=(e,t)=>{let n=dU(e);if(n){for(let e in n){let r=n[e];if(r&&r[t]&&r[t].memberships)return r[t].memberships}return null}},tW=(e,t)=>{let n=eW(e,t),r=$n(e,t);return r&&zn(e,r.permanent_url)?n&&n.length>0:!1},nW=a((e,t)=>{let n=eW(e,t);if(!n)return n;let r=new Set(n),i=BU(e);if(!i)return;let a=[];return r.forEach(e=>{let t=i[e];t&&a.push(t)}),a},PU,(e,t)=>{if(!e)return e;let n=new Set(t);return e.some(e=>n.has(e.membership_id))||null}),rW=(e,t)=>nW(e,t),iW=(e,t)=>{let n=tW(e,t);if(n===void 0)return!1;let r=rW(e,t);return!!(Nt(e,t)||!n||r)},aW=(e,t)=>{let n=tW(e,t);if(!n)return n;let r=rW(e,t);return!!(!Nt(e,t)&&n&&!r)},oW=(e,t)=>{let n=Ut(e,t);return n&&aW(e,n)},sW=a((e,t)=>t,BU,(e,t)=>[...e.map(e=>t[e])].sort((e,t)=>e.prices.amount-t.prices.amount)),cW=(e,t)=>{let n=sW(e,t);return n&&n[0]},lW=(e,t)=>{let n=eW(e,t);return n&&cW(e,n)},uW=(e,t)=>{let n=lW(e,t);if(!(!n||!n.prices))return(n.prices[0]?.amount/100).toFixed(2)},dW=a(qU,e=>{if(!e)return e;let t=new Set([]);
61return e.forEach(e=>e.perks&&e.perks.some(n=>{if(String(n.id)===String(UH.MEMBERS_ONLY_CHAT.id))return t.add(e.membership_id),!0})),Array.from(t)}),fW=a(AU,e=>e&&e.filter(e=>e.perks&&e.perks.some(e=>String(e.id)===String(UH.MEMBERS_ONLY_CHAT.id)))),pW=(e,t)=>{let n=fW(e,t);return!!n&&n.length>0},mW=(e,t)=>{let n=dW(e,t);if(n===void 0)return!1;let r=pW(e,t);return!!(Nt(e,t)||!n||r)},hW=(e,t)=>{let n=cU(e,t);return n&&n.length>0},gW=e=>qH(e).membershipPaymentsIncoming,_W=e=>qH(e).membershipPaymentsIncomingFetching,vW=e=>qH(e).membershipPaymentsOutgoing;function yW(e,t,n=!1){return async(r,i)=>{if(!nR(i()))return r(B8());r({type:di,data:{uri:e}}),r(N({message:D(n?`Channel unmuted!`:`Channel muted. You will not see them again.`),linkText:D(t?`See All`:``),linkTarget:`/settings/block_and_mute`}))}}function bW(e,t=!0){return n=>n(yW(e,t))}function xW(e,t=!0){return n=>n(yW(e,t,!0))}function SW(){return e=>{e({type:Ra}),fetch(ve).then(async t=>{let n={};try{n=await t.json()}catch{}e({type:Ai,data:n.data||{}})}).catch(()=>{e({type:xi})})}}var CW={};CW.TYPE_NEW_DEVELOPER=`new_developer`,CW.TYPE_NEW_USER=`new_user`,CW.TYPE_CONFIRM_EMAIL=`email_provided`,CW.TYPE_FIRST_CHANNEL=`new_channel`,CW.TYPE_FIRST_STREAM=`first_stream`,CW.TYPE_MANY_DOWNLOADS=`many_downloads`,CW.TYPE_FIRST_PUBLISH=`first_publish`,CW.TYPE_REFERRAL=`referrer`,CW.TYPE_REFEREE=`referee`,CW.TYPE_REWARD_CODE=`reward_code`,CW.TYPE_SUBSCRIPTION=`subscription`,CW.YOUTUBE_CREATOR=`youtube_creator`,CW.TYPE_WEEKLY_WATCH=`weekly_watch`,CW.TYPE_NEW_ANDROID=`new_android`,CW.claimReward=(e,t)=>{function n(e,t,n){if(!M.enabled){t(Error(D(`Credits are not enabled.`)));return}M.call(`reward`,`claim`,n,`post`).then(t=>{let n=N({message:t.reward_notification||`You have claimed a ${t.reward_amount} Credit.`,linkText:D(`Show All`),linkTarget:`/rewards`});window.store.dispatch(n),CW.callbacks.claimRewardSuccess&&CW.callbacks.claimRewardSuccess(t),e(t)},t)}return new Promise((r,i)=>{j.address_unused().then(a=>{let o={reward_type:e,wallet_address:a,...t};switch(e){case CW.TYPE_FIRST_CHANNEL:j.channel_list({page:1,page_size:10}).then(e=>{let t=e.items&&e.items.find(e=>e.name.length&&e.name[0]===`@`&&e.txid.length&&e.type===`claim`);t?(o.transaction_id=t.txid,n(r,i,o)):i(Error(D(`Please create a channel identity first.`)))}).catch(i);break;case CW.TYPE_FIRST_PUBLISH:j.stream_list({page:1,page_size:10}).then(e=>{let t=e.items&&e.items.find(e=>e.name.length&&e.name[0]!==`@`&&e.txid.length&&e.type===`claim`);t?(o.transaction_id=t.txid,n(r,i,o)):i(e.length?Error(D(`Please upload something and wait for confirmation by the network to claim this credit.`)):Error(D(`Please upload something to claim this credit.`)))}).catch(i);break;case CW.TYPE_FIRST_STREAM:case CW.TYPE_NEW_USER:default:n(r,i,o)}})})},CW.callbacks={claimRewardSuccess:null,claimFirstRewardSuccess:null,rewardApprovalRequired:null},CW.setCallback=(e,t)=>{CW.callbacks[e]=t};var wW=e=>e.rewards||Sn,TW=e=>wW(e).claimedRewardsById,EW=a(TW,e=>Object.values(e)||[]),DW=a(EW,e=>e.reduce((e,t)=>{let n=e;return n[t.transaction_id]=t,n},{})),OW=e=>wW(e).unclaimedRewards,kW=e=>!!wW(e).fetching,AW=a(OW,e=>e.reduce((e,t)=>e+t.reward_amount,0)),jW=e=>wW(e).claimPendingByType,MW=()=>a(jW,(e,t)=>t.reward_type,(e,t)=>e[t]),NW=e=>wW(e).claimErrorsByType,PW=()=>a(NW,(e,t)=>t.reward_type,(e,t)=>e[t]),FW=()=>a(OW,(e,t)=>t,(e,t)=>e.find(e=>e.claim_code===t));a(wW,e=>e.rewardedContentClaimIds);var IW=a(OW,e=>e.filter(e=>e.reward_type===CW.TYPE_REFERRAL)[0]),LW=a(OW,e=>e.some(e=>e.reward_type===CW.TYPE_REFEREE)),RW=a(jW,e=>!!(e[CW.TYPE_NEW_USER]||e[CW.TYPE_CONFIRM_EMAIL])),zW=a(TW,e=>{let t=Object.values(e),n=!!t.find(e=>e&&e.reward_type===CW.TYPE_NEW_USER),r=!!t.find(e=>e&&e.reward_type===CW.TYPE_CONFIRM_EMAIL);return n&&r}),BW=a(OW,e=>{let t=e.find(e=>e.reward_type===CW.TYPE_WEEKLY_WATCH);if(t&&t.data&&t.data.last_claimed){let e=new Date(t.data.last_claimed);return(new Date().getTime()-e.getTime())/(1e3*60*60*24)<6.5}}),VW=a(Vt,e=>e&&e.is_reward_approved),HW=CW;function UW(){return e=>{e({type:ba}),M.call(`reward`,`list`,{multiple_rewards_per_type:!0}).then(t=>{e({type:na,data:{userRewards:t}})}).catch(()=>{e({type:na,data:{userRewards:[]}})})}}function WW(e,t={}){return(n,r)=>{let i=r(),a=dn(i),o=OW(i),s=e===HW.TYPE_REWARD_CODE||e===HW.TYPE_NEW_ANDROID?{reward_type:HW.TYPE_REWARD_CODE}:o.find(t=>t.reward_type===e);if(e!==HW.TYPE_REWARD_CODE&&e!==HW.TYPE_CONFIRM_EMAIL&&e!==HW.TYPE_WEEKLY_WATCH&&e!==HW.TYPE_NEW_ANDROID&&(!s||s.transaction_id))return;if(!a&&e!==HW.TYPE_CONFIRM_EMAIL&&e!==HW.TYPE_REWARD_CODE&&e!==HW.TYPE_NEW_ANDROID){(!t||!t.failSilently&&HW.callbacks.rewardApprovalRequested)&&HW.callbacks.rewardApprovalRequested();return}let c=t.params||{};return!c.claim_code&&s&&(c.claim_code=s.claim_code),n({type:va,data:{reward:s}}),HW.claimReward(e,c).then(e=>{setTimeout(()=>{n(wL()).then(()=>{n({type:Rl,data:{reward:e}}
61),e.reward_type===HW.TYPE_NEW_USER&&HW.callbacks.claimFirstRewardSuccess?HW.callbacks.claimFirstRewardSuccess():e.reward_type===HW.TYPE_REFERRAL&&n(ZW()),n(UW()),t.callback&&t.callback()})},2e3)},e=>{n({type:qi,data:{reward:s,error:!t||!t.failSilently?e:void 0}}),t.notifyError&&n(N({message:uC(e?.message||e),isError:!0})),t.callback&&t.callback(e)})}}function GW(){return e=>{e(WW(HW.TYPE_NEW_USER)),e(WW(HW.TYPE_CONFIRM_EMAIL))}}function KW(){return(e,t)=>{let n=t(),r=OW(n);!dn(n)||!M.enabled||(r.find(e=>e.reward_type===HW.TYPE_FIRST_STREAM)?e(WW(HW.TYPE_FIRST_STREAM)):BW(n)||e(WW(HW.TYPE_WEEKLY_WATCH,{failSilently:!0})))}}var qW=e=>e=>e(WW(HW.TYPE_REFEREE)),JW=!1,YW=200,XW=1e4;function ZW(e=!0){return t=>{t({type:ji}),Promise.all([M.call(`user`,`invite_status`),M.call(`user_referral_code`,`list`)]).then(([n,r])=>{e&&t(UW()),t({type:Si,data:{invitesRemaining:n.invites_remaining?n.invites_remaining:0,invitees:n.invitees,referralLink:`${M.CONNECTION_STRING}user/refer?r=${r}`,referralCode:r}})}).catch(e=>{t({type:To,data:{error:e}})})}}function QW(e,t,n){let r={app_version:e,domain:n};j.status().then(e=>{r.app_id=n&&n!==`lbry.tv`?(n.replace(/[.]/gi,``)+e.installation_id).slice(0,66):e.installation_id,r.node_id=e.lbry_id,j.version().then(n=>{r.daemon_version=n.lbrynet_version,r.operating_system=n.os_system,r.platform=n.platform,M.call(`install`,`new`,r),t&&t(e)}).catch(e=>{Qx.log(`'install/new' skipped due to: (${e.message})`,{fingerprint:[`doInstallNew`]})})})}function $W(){let e=Date.now();return new Promise((t,n)=>{(function n(){try{sessionStorage.setItem(`test`,`available`),sessionStorage.removeItem(`test`),JW=!0}catch{}if(!JW)return t();if(!nd.getItem(rd.AUTH_IN_PROGRESS))return nd.setItem(rd.AUTH_IN_PROGRESS,`true`),t();if(Date.now()-e<XW)setTimeout(n,YW);else return t()})()})}function eG(){return async(e,t)=>{let n=xs(t());e({type:Ma});try{let t=await M.call(`user`,`has_premium`,{channel_claim_ids:n},`post`),r=Object.keys(t),i=e=>e.has_premium?BH.PREMIUM:e.has_premium_plus?BH.PREMIUM_PLUS:null,a={};r.forEach(e=>{a[e]=i(t[e])}),e({type:ni,data:{membershipsById:a}}),e({type:qa,data:t[n]})}catch{e({type:Ea})}}}function tG(e){return async t=>{t({type:Jc,data:{channelIds:e}});let n=e.join(`,`);try{let e=await M.call(`user`,`has_premium`,{channel_claim_ids:n},`post`),r=Object.keys(e),i=e=>e.has_premium?BH.PREMIUM:e.has_premium_plus?BH.PREMIUM_PLUS:null,a={};r.forEach(t=>{a[t]=i(e[t])}),t({type:ni,data:{membershipsById:a}})}catch{t({type:za,data:{channelIds:e}})}}}function nG(e,t=!0,n,r=!0){return i=>{i({type:Hu}),$W().then(()=>(i(SW()),M.authenticate(Ie,ce()))).then(a=>{nd.removeItem(rd.AUTH_IN_PROGRESS),M.getAuthToken().then(o=>{i({type:yo,data:{user:a,accessToken:o}}),i(jG()),t&&(i(UW()),r&&!a?.device_types?.includes(`web`)&&QW(e,n,Ie))})}).catch(e=>{nd.removeItem(rd.AUTH_IN_PROGRESS),i({type:Is,data:{error:e}})})}}function rG(){return e=>new Promise((t,n)=>{e({type:vs}),M.getCurrentUser().then(n=>{e({type:wu,data:{user:n}}),t(n)}).catch(t=>{n(t),e({type:sl,data:{error:t}})})})}function iG(){return e=>{M.getCurrentUser().then(t=>{t.has_verified_email&&(e(UW()),e({type:wu,data:{user:t}}))})}}function aG(){return{type:ga}}function oG(e,t){return n=>{n({type:Jo,data:{phone:e,country_code:t}}),M.call(`user`,`phone_number_new`,{phone_number:e,country_code:t},`post`).then(()=>{n({type:Wi,data:{phone:e}})},e=>{n({type:No,data:{error:e}})})}}function sG(e){return{type:Il,data:{error:e}}}function cG(e){return(t,n)=>{let r=Lr(n()),i=Ze(n());t({type:la,code:e}),M.call(`user`,`phone_number_confirm`,{verification_code:e,phone_number:r,country_code:i},`post`).then(e=>{e.is_identity_verified&&(t({type:os,data:{user:e}}),t(WW(CW.TYPE_NEW_USER)))}).catch(e=>t(sG(e)))}}function lG(e){return t=>{t({type:Ts,email:e});let n=n=>{t({type:Sl,data:{email:e}}),t({type:Ul}),n?t({type:Ri}):M.call(`user_email`,`resend_token`,{email:e,only_if_expired:!0},`post`)};M.call(`user`,`exists`,{email:e},`post`).catch(e=>{throw e.response&&e.response.status===404?t({type:ml}):e.response&&e.response.status===412&&n(!1),e}).then(e=>{n(e.has_password)},e=>t({type:Nc,data:{error:e}}))}}function uG(e,t){return n=>{n({type:Ts,email:e});let r=()=>{n({type:Sl,data:{email:e}}),n(rG())},i=e=>n({type:Nc,data:{error:e}});M.call(`user`,`signin`,{email:e,...t?{password:t}:{}},`post`).catch(t=>{if(t.response&&t.response.status===409)return n({type:Ul}),M.call(`user_email`,`resend_token`,{email:e,only_if_expired:!0},`post`).then(r,i);
61if(t.response&&t.response.status===417)return n({type:Qa}),n({type:Ul}),M.call(`user_email`,`resend_token`,{email:e,only_if_expired:!0},`post`).then(r,i);throw t}).then(r,i)}}function dG(e,t){return n=>new Promise((r,i)=>{n({type:Ts,email:e});let a=()=>{n({type:Sl,data:{email:e}}),n(rG()),r()},o=e=>{e.response&&e.response.status===409&&n({type:Ul}),n({type:Nc,data:{error:e}}),i(e)};M.call(`user`,`signup`,{email:e,...t?{password:t}:{}},`post`).then(a,o)})}function fG(e){return t=>{t({type:xa,email:e}),M.call(`user_password`,`reset`,{email:e},`post`).then(()=>{t({type:so})},e=>t({type:ra,data:{error:e}}))}}function pG(e,t,n){return r=>{r({type:Vo});let i=()=>{r({type:Zi}),r(rG())},a=e=>r({type:li,data:{error:e}});M.call(`user_password`,`set`,{new_password:e,...t?{old_password:t}:{},...n?{auth_token:n}:{}},`post`).then(i,a)}}function mG(){return async e=>{e({type:nc}),await M.call(`user`,`delete`,{},`post`).then(()=>{e({type:Yr})},t=>{if(e({type:Yr}),t.message!==`a delete operation is already in progress`)throw t})}}function hG(e){return t=>{t({type:el}),M.call(`user_email`,`resend_token`,{email:e,only_if_expired:!0},`post`).catch(e=>{if(e.response&&e.response.status===409)throw e}).then(()=>{t({type:hu})},e=>{t({type:Vs,data:{error:e}})})}}function gG(){return{type:cu}}function _G(){return{type:$u}}function vG(e){return t=>(t({type:pi}),M.call(`user`,`invite`,{email:e},`post`).then(n=>(t({type:ju,data:{email:e}}),t(N({message:D(`Invite sent to %email_address%`,{email_address:e})})),t(ZW()),n)).catch(e=>{t({type:ho,data:{error:e}})}))}function yG(){return e=>{e({type:ds})}}var bG=e=>async(t,n)=>{let r=n(),i=lt(r),a=!!it(r);if(i||a)return;t({type:eo});let o=e.replace(`lbry://`,``);return await M.call(`user`,`referral`,{referrer:o},`post`).then(e=>{t({type:Zr,data:o}),VW(r)&&t(WW(CW.TYPE_REFEREE)),t(rG())}).catch(e=>t({type:es,data:{error:e}}))};function xG(){return async e=>{e({type:Jl});try{let t=(await j.address_list({page:1,page_size:99999})).items[0],n=await M.call(`yt`,`transfer`,{address:t.address,public_key:t.pubkey});if(!n||!n.length){e({type:vl,data:``});return}let r=(await Promise.allSettled(n.map(e=>e&&e.channel&&e.channel.channel_certificate?j.channel_import({channel_data:e.channel.channel_certificate}):Promise.resolve(null)))).some(e=>e.status===`rejected`),i=await j.channel_list({page:1,page_size:99999}),a={};(i.items||[]).forEach(e=>{a[e.claim_id]=e.has_signing_key===!0});let o=n.filter(e=>e.channel_claim_id&&!a[e.channel_claim_id]);if(e(rG()),e(sK()),r||o.length>0){let t=o.map(e=>e.lbry_channel_name).filter(Boolean).join(`, `);e({type:vl,data:t?D(`Could not import the signing key for %channels%. Please try again or contact support.`,{channels:t}):D(`Could not import your channel signing key. Please try again or contact support.`)});return}e({type:Rc,data:n})}catch(t){e({type:vl,data:String(t&&t.message?t.message:t)})}}}function SG(){return e=>(e({type:Jl}),M.call(`yt`,`transfer`).then(t=>{if(t&&t.length)e({type:Rc,data:t});else throw Error()}).catch(t=>{e({type:vl,data:String(t)})}))}function CG(e=!1){return t=>{fetch(Oe).then(async e=>{let n={};try{n=await e.json()}catch{}t({type:wc,data:n.data||{}})}).catch(n=>{e||setTimeout(()=>{t(CG(!0))},1e4),t({type:wc,data:{}})})}}var wG=tt(),TG=1e6,EG=100;function DG(e){let t=e?.message||e;return typeof t==`string`&&(t.match(/membership already exists for this channel/i)||t.match(/prior \(even deleted memberships\)/i)||t.match(/Duplicate entry.*membership_v2\.idx_user_publish_name_unique/i))?D(`This tier name has already been used for this channel. Deleted tier names cannot currently be reused, so please choose a different tier name.`):t}var OG=(e,t)=>async(n,r)=>{if(!t||t.length===0)return;let i=[...new Set(t)].filter(Boolean),a=r(),o=IU(a,e),s=new Set(o),c=tU(a,e),l=i.filter(e=>{let t=s.has(e),n=c&&(c[e]||c[e]===null);return!t&&!n});if(l.length===0)return;let u=l.join(`,`);return n({type:Ua,data:{channel:e,ids:l}}),n(tG(l)),await M.call(`membership_v2`,`check`,{channel_id:e,claim_ids:u}).then(t=>{let r={};for(let e in t){let n=t[e];if(Number.isInteger(n?.length))for(let t of n)t.name&&(r[e]=t.name);r[e]||(r[e]=null)}return n({type:Fi,data:{channelId:e,membershipsById:r}})}).catch(t=>n({type:Ei,data:{channelId:e,error:t}}))},kG=e=>async t=>t(OG(bn.ID,e)),AG=(e,t)=>async(n,r)=>{let{channel_claim_id:i}=e,a=r(),o=oU(a,i),s=cU(a,i);return(o||s)&&!t?Promise.resolve():(n({type:Hi,data:i}),await M.call(`membership_v2`,`list`,{...e},`post`).then(e=>n({type:Go,data:{channelId:i,list:e}}
61)).catch(()=>n({type:Go,data:{channelId:i,list:null}})))},jG=()=>async(e,t)=>YH(t())?Promise.resolve():(e({type:ku}),await M.call(`membership_v2/subscription`,`list`,{},`post`).then(t=>e({type:ui,data:t})).catch(t=>{e({type:fo,data:t})})),MG=e=>async(t,n)=>{let r=n(),{tippedChannelId:i,subscriberChannelId:a,priceId:o,membershipId:s}=e,c=Wt(r),l={subscriber_channel_claim_id:a,price_id:String(o),source_payment_address:c||``};if(!o)return;t({type:Ha,data:s});let u=``,d=``,f,p=``,m=``,h;try{if(!await t(pL(`hello`)))throw Error(`wallet not unlocked`);if(await M.call(`membership_v2`,`subscribe`,{...l},`post`).then(e=>{let{token:t,payee_address:n,price:r}=e,{transaction_amount:i,amount:a,transaction_currency:o}=r;f=a/EG*TG,p=String(i),u=t,d=n,m=o}),m===`AR`){let{transactionId:e,error:t}=await vL(d,p,[{name:`X-O-Ref`,value:u}]);if(t)throw Error(t?.message||t);h=e}else m===`USD`&&(h=await DI({process:`7zH9dlMNoxprab9loshv3Y7WG45DOny_Vrq9KrXObdQ`,data:``,tags:[{name:`Action`,value:`Transfer`},{name:`Quantity`,value:String(f)},{name:`Recipient`,value:d},{name:`Tip_Type`,value:`tip`},{name:`Claim_ID`,value:i},{name:`X-O-Ref`,value:u}],Owner:c,signer:NI(window.arweaveWallet)}));let e={token:u,tx_id:h};await t(jG()),await M.call(`membership_v2/subscription`,`transaction_notify`,e,`post`),await t(jG()),t({type:Zc,data:s})}catch(e){return t({type:Ti,data:{id:s,error:e?.message||e}}),console.error(e?.message||e),Promise.reject(e)}},NG=()=>e=>{e({type:Pi})},PG=(e,t)=>async n=>(n({type:Wc,data:e}),await M.call(`membership_v2/subscription`,`cancel`,MH(e,t),`post`).then(t=>(n({type:Oa,data:e}),n(jG()),t)).catch(t=>{if(t.message===`this subscription is no longer active`)n({type:Oa,data:e});else throw n({type:ai,data:e}),Error(t)})),FG=()=>async e=>{e({type:oa});try{let t=await M.call(`membership_v2/transactions`,`inbound`,{},`post`),n=new Set([]);t.forEach(e=>{n.add(e.creator_channel_claim_id),n.add(e.subscriber_channel_claim_id)}),e(ZG(Array.from(n))),e({type:is,data:t})}catch(t){e({type:Pl,data:t.message||t}),console.log(`error`,t.message||t)}},IG=()=>async e=>{e({type:ls});try{let t=await M.call(`membership_v2/transactions`,`outbound`,{},`post`),n=new Set([]);t.forEach(e=>{n.add(e.creator_channel_claim_id),n.add(e.subscriber_channel_claim_id)}),e(ZG(Array.from(n))),e({type:Za,data:t})}catch(t){e({type:Qo,data:t.message||t}),console.log(`error`,t.message||t)}},LG=e=>async t=>await M.call(`membership_v2`,`create`,{...e},`post`).then(e=>({response:e})).catch(e=>({error:DG(e)})),RG=e=>async t=>await M.call(`membership_v2`,`update`,{...e},`post`).then(e=>({response:e})).catch(e=>({error:DG(e)})),zG=e=>async t=>await M.call(`membership_perk`,`list`,{...e,environment:wG},`post`).then(e=>t({type:ma,data:e})).catch(e=>e),BG=e=>(t,n)=>{let{membership:r,subscription:i}=e,a=i.status===`canceled`,o=n(),{name:s}=$n(o,r.channel_claim_id),c=od(new Date(i.ends_at)),l=Bt(o,tr({channelName:s,channelClaimId:r.channel_claim_id}));return t(a?A8(ld,{title:D(`Confirm Restoring %membership_name% Membership`,{membership_name:r.name}),subtitle:D(`Are you sure you want to restore your %creator_name%'s "%membership_name%" membership? `,{membership_name:r.name}),busyMsg:D(`Restoring your membership...`),onConfirm:(e,n)=>{n(!0),t(PG(r.id,!0)).then(()=>{n(!1),t(N({message:D(`Your membership was successfully restored.`)})),e()})}}):A8(ld,{title:D(`Confirm %membership_name% Cancellation`,{membership_name:r.name}),subtitle:D(`Are you sure you want to cancel your %creator_name%'s "%membership_name%" membership? You will still have all your features until %end_date% at which point your purchase will not be renewed and you will lose access to your membership features and perks.`,{creator_name:l,membership_name:r.name,end_date:c}),busyMsg:D(`Canceling your membership...`),onConfirm:(e,n)=>{n(!0),t(PG(r.id)).then(()=>{n(!1),t(N({message:D(`Your membership was successfully cancelled and will no longer be renewed.`)})),e()})}}))},VG=e=>async t=>{t({type:Ho,data:e}),await M.call(`membership_v2`,`status_set`,{membership_id:e,enabled:!1},`post`).then(n=>(t({type:Oa,data:e}),n)).catch(n=>(t({type:ai,data:e}),n))},HG=e=>async(t,n)=>{let r=n(),i=e.filter(e=>!uU(r,e));if(i.length===0)return Promise.resolve();let a=i.toString();t({type:js,data:i}),await M.call(`membership_v2/member_content`,`resolve`,{claim_ids:a},`post`).then(e=>(t({type:Iu,data:{idsToFetch:i,response:e}}),e)).catch(e=>(t({type:Gu,data:i}),e))},UG=e=>async(t,n)=>uU(n(),e)?Promise.resolve():t(HG([e])),WG=(e,t,n,r,i)=>async i=>{i({type:Pa,data:{memberRestrictionTierIds:r,contentClaimId:t}}),await M.call(`membership_v2/member_content`,`modify`,{claim_id:t,membership_ids:r.slice().sort((e,t)=>
61e-t).join(`,`),channel_id:e,claim_name:n},`post`).then(e=>e).catch(e=>(r?.length>0&&i(N({isError:!0,message:D(D(`Failed to apply membership tiers. Access to the content may still be restricted.`)+` Error: `+(e?.message||e)+` 62`+D(`If the issue persists, please reach out to [email protected]`))})),e))},GG=()=>async e=>M.call(`membership_v2`,`subscribers`,{only_active:!0},`post`).then(t=>{e({type:So,data:t})}).catch(()=>e({type:So,data:null})),KG=()=>async(e,t)=>{let n=t();if(mU(n)!==void 0)return Promise.resolve();e({type:Qu});let r=Qt(n);if(!r)return Promise.resolve();let i=[];return r.map((t,n)=>{i[n]=e(AG({channel_claim_id:t.claim_id},null))}),await Promise.all(i).then(t=>(e({type:ao}),t)).catch(t=>(e({type:ao}),t))},qG,JG;async function YG(e,t){if(t===void 0)return Promise.resolve({claimId:e,cost:0,includesData:!0});let n=Number(t.amount);if(t.currency===`LBC`){let{LBC_USD:e}=await M.getExchangeRates();n/=1/e}return n=Number(Math.max(n,.01).toFixed(2)),Promise.resolve({claimId:e,cost:Number(t.amount),includesData:!0,feeCurrency:t.currency,usdCost:n})}function XG(e,t=!1,n=!0,r={}){return(i,a)=>{let o=e.reduce((e,t)=>{try{e.push(Tt(t))}catch{}return e},[]),s=a(),c=new Set(Rr(s)),l={},u=vn(s),d=o.filter(e=>{if(c.has(e))return!1;let n=u[e];return t&&n?(l[n.canonical_url||n.permanent_url]={stream:n},!1):!0});return d.length===0?Promise.resolve(l):(i({type:Yo,data:{uris:o}}),j.resolve({urls:d,...r}).then(async e=>{let t=new Set([]),a=new Set([]),o=new Set([]),s=new Set([]),u=new Set,d=[],f={};for(let r in e){let i=Object.assign({},e[r]);if(`error`in i&&i.error)f[r]={stream:null,claimsInChannel:null,channel:null,collection:null};else{let e=i;if(n){let t=e.reposted_claim;if(t){let e=t.permanent_url;c.has(e)||a.add(e),t.value_type!==`channel`&&t.value_type!==`collection`&&Ur(t)&&o.add(t.claim_id)}}let l={};if(e.value_type===`channel`){let t=e;l.channel=t,l.claimsInChannel=t.meta&&t.meta.claims_in_channel||0}else if(e.value_type===`collection`){let n=e;l.collection=n,t.add(n.claim_id)}else{let t=e;if(l.stream=t,Ur(t)&&o.add(t.claim_id),(Pt(t)||t.value?.fee)&&t.claim_id&&d.push(t.claim_id),t.signing_channel){let e=t.signing_channel;l.channel=e,l.claimsInChannel=e.meta&&e.meta.claims_in_channel||0}u.add(YG(t.claim_id,t.value?t.value.fee:void 0))}let p=dr(e);p&&s.add(p),f[r]=l}}let p=[{type:Gi,data:{resolveInfo:f}}];if(u.size>0){let e=await Promise.all(Array.from(u));p.push({type:Al,data:e})}return i({type:`BATCH_ACTIONS`,actions:p}),o.size>0&&i(HG(Array.from(o))),d.length>0&&i(bH(d)),s.size>0&&i(kG(Array.from(s))),a.size>0&&i(XG(Array.from(a),!0,!1,r)),{...e,...l}}).catch(e=>i({type:Po,data:o})))}}function ZG(e,t=!0,n){return async(r,i)=>{let a=i(),o=xn(a),s=Mn(a),c={},l=e.filter(e=>{if(s.includes(e))return!1;let n=o[e];return t&&n&&n.canonical_url?(c[n.canonical_url]={stream:n},!1):!0});return l.length===0?Promise.resolve(c):r(lK({...n,claim_ids:l,page:1,page_size:Math.min(l.length,50),no_totals:!0},{useAutoPagination:l.length>50})).then(e=>({...e,...c}))}}var QG=(e,t=!0,n={})=>ZG([e],t,n);function $G(e,t=!1,n=!0,r={}){return XG([e],t,n,r)}var eK=!1;function tK(e=1,t=99999,n=!0,r=[],i=!1,a=[]){return async(o,s)=>{let c=t===wf;if(c){if(eK)return;eK=!0}o({type:Ku});let l=s(),u=[`stream`,`repost`];r&&r.length!==0&&(u=u.filter(e=>r.includes(e)));let d=async(e,t)=>{let r=e.items,a=An(l);for(let e=0;e<r.length-1;e++)if(!Object.keys(a).includes(r[e].claim_id)&&r[e].confirmations>r[e+1].confirmations){M.call(`event`,`desktop_error`,{error_message:`CLAIM STUCK IN UPLOADS: ${r[e].claim_id}`});break}o({type:_s,data:{result:e,resolve:n,setNewPageItems:!c,isAllMyClaimsFetched:c&&t,isPublicationOnlyClaimList:!0}});let s=[],u=new Set([]),d=new Set([]),f=new Set;e.items.forEach(e=>{s.push(e.claim_id),e.value_type!==`channel`&&e.value_type!==`collection`&&Ur(e)&&u.add(e.claim_id);let t=dr(e);t&&d.add(t),f.add(YG(e.claim_id,e.value?e.value.fee:void 0))}),f.size>0&&o({type:Al,data:await Promise.all(Array.from(f))}),u.size>0&&o(HG(Array.from(u))),d.size>0&&o(kG(Array.from(d))),i&&s.length>0&&o(kS(s.join(`,`)))};try{let r=c?1:e,i=r;do{let e=await j.claim_list({page:r,page_size:c?500:t,claim_type:u,channel_id:a,resolve:n});c&&(i=e.total_pages||1),await d(e,r>=i),r++}while(r<=i)}catch{o({type:Cu})}finally{c&&(eK=!1)}}}function nK(e,t){return n=>{t&&t(vf);let r=e.type===`claim`,i=e.type===`support`&&e.is_my_input,a=e.type===`support`&&!e.is_my_input,o=r?{claimId:e.claim_id}:{outpoint:`${e.txid}:${e.nout}`},s=r?oi:Nl,c=r?Ro:pa;n({type:s,data:o});let l=()=>{t&&t(xf),n(N({message:r?`Error abandoning your claim/support`:`Error unlocking your tip`,isError:!0}))},u=()=>{n({type:c,data:o});let e;e=D(r?`Successfully removed your upload.`:i?`Successfully abandoned your support.`:`Successfully unlocked your tip!`),t&&t(yf),n(N({message:e}))},d={blocking:!0};r?d.claim_id=e.claim_id:(d.txid=e.txid,d.nout=e.nout);let f;if(i||a)f=`support_abandon`;else if(r){let{normalized_name:t}=e;f=t.startsWith(`@`)?`channel_abandon`:`stream_abandon`}if(!f){Ve(!1,`No "method" chosen for claim or support abandon`);return}j[f](d).then(u,l)}}function rK(e,t){let{txid:n,nout:r}=e,i=`${n}:${r}`;return(a,o)=>{let s=o(),c=_n(s),l=Tn(s),u=Ct(s,e)?e:c.find(e=>e.txid===n&&e.nout===r),d=l[i];if(!u&&!d){Ve(!1,`No associated support or claim with txid: `+n);return}let f=u?{claimId:u.claim_id}:{outpoint:`${d.txid}:${d.nout}`},p=!!u,m=p?oi:Nl,h=p?Ro:pa;a({type:m,data:f});let g=()=>{a(N({message:p?`Error abandoning your claim/support`:`Error unlocking your tip`,isError:!0})),t&&t(xf)},_=()=>{a({type:h,data:f}),t&&t(yf);let e;e=D(p?`Successfully removed your upload.`:d?`Successfully abandoned your support.`:`Successfully unlocked your tip!`),a(N({message:e})),a(OL())},v={txid:n,nout:r,blocking:!0},y;if(d)y=`support_abandon`;else if(u){let{name:e}=u;y=e.startsWith(`@`)?`channel_abandon`:`stream_abandon`}if(!y){Ve(!1,`No "method" chosen for claim or support abandon`);return}j[y](v).then(_,g)}}function iK(){return{type:ro}}function aK(e,t,n,r){return(i,a)=>{let o=dt(a());if(i({type:ii}),o){i({type:Xc,data:`Channel limit exceeded`});return}let s={name:e,bid:mC(t),blocking:!0};
62return n&&(n.title&&(s.title=n.title),n.coverUrl&&(s.cover_url=n.coverUrl),n.thumbnailUrl&&(s.thumbnail_url=n.thumbnailUrl),n.description&&(s.description=n.description),n.website&&(s.website_url=n.website),n.email&&(s.email=n.email),n.tags&&(s.tags=n.tags.map(e=>e.name)),n.languages&&(s.languages=n.languages)),j.channel_create(s).then(e=>{let t=e.outputs[0];return i({type:Va,data:{channelClaim:t}}),i({type:ci,data:{claims:[t]}}),i(mK(r)),t}).catch(e=>{i({type:Xc,data:e.message})})}}function oK(e,t){return(n,r)=>{n({type:Ii});let i=Qt(r()).find(t=>t.claim_id===e.claim_id),a={claim_id:e.claim_id,bid:mC(e.amount),title:e.title,cover_url:e.coverUrl,thumbnail_url:e.thumbnailUrl,description:e.description,website_url:e.website,email:e.email,tags:[],replace:!0,languages:e.languages||[],locations:[],blocking:!0,featured:e.featured||[]};for(let[e,t]of Object.entries(a))t??delete a[e];return e.tags&&(a.tags=e.tags.map(e=>e.name)),i&&i.value&&i.value.locations&&(a.locations=i.value.locations),j.channel_update(a).then(e=>{let r=e.outputs[0];return n({type:ja,data:{channelClaim:r}}),n({type:ci,data:{claims:[r]}}),n(mK(t)),!!e.outputs[0]}).then().catch(e=>{n({type:Ga,data:e})})}}var sK=(e=1,t=99999,n=!0)=>(r,i)=>{fr(i())||(r({type:_c}),j.channel_list({page:e,page_size:t,resolve:n}).then(e=>{r({type:ol,data:{claims:e.items}}),r(eG())},e=>{r({type:Cc,data:e})}))};function cK(){return e=>{e({type:$r})}}function lK(e={no_totals:!0,page_size:10,page:1},t){let n=e,r=Sr(n);return async(e,i)=>{if(Pn(i(),r))return Promise.resolve();e({type:ms,data:{query:r}});let a=async i=>{let a={},o=[],s=[],c=new Set([]),l=new Set([]),u=new Set,d=[],f;i.items.some((e,t)=>{a[e.canonical_url]={stream:e},o.push(e.canonical_url),s.push(e.claim_id),e.value_type!==`channel`&&e.value_type!==`collection`&&(Ur(e)&&c.add(e.claim_id),u.add(YG(e.claim_id,e.value?e.value.fee:void 0))),e.value_type===`collection`&&(f||={},f[e.canonical_url]={stream:e});let r=dr(e);r&&l.add(r),!n.has_no_source&&e.claim_id&&(Pt(e)||e.value?.fee)&&d.push(e.claim_id)});let p=[{type:cs,data:{query:r,resolveInfo:a,urls:o,append:n.page&&n.page!==1,page:n.page,pageSize:n.page_size,totalItems:i.total_items,totalPages:i.total_pages}}];f&&p.push({type:fa,data:{resolveInfo:f}});let m=[];if(u.size>0)try{let e=await Promise.all(Array.from(u));p.push({type:Al,data:e}),m=e.filter(e=>Number(e.cost)>0).map(e=>e.claimId)}catch{}return e({type:`BATCH_ACTIONS`,actions:p}),m.length>0&&!n.include_purchase_receipt&&e(ZG(m,!1,{include_purchase_receipt:!0})),c.size>0&&e(HG(Array.from(c))),l.size>0&&e(kG(Array.from(l))),d.length>0&&e(bH(d)),t?.fetch?.viewCount&&s.length>0&&e(kS(s.join(`,`))),a},o=t=>(e({type:rs,data:{query:r},error:t}),!1),s=t?.useAutoPagination?(()=>{let e=[],t=async r=>{e=e.concat(r.items);let i=r.items.length===n.page_size;if(n.page++,n.page>3||!i)return a({items:e,page:n.page,page_size:n.page_size});try{return t(await j.claim_search(n))}catch(e){o(e)}};return t})():a;return await j.claim_search(n).then(s,o).catch(e=>{o(e)})}}function uK(e){return t=>new Promise(n=>{t({type:Lo});function r(r){let i=r.outputs[0];t({type:Uo,data:{originalClaimId:e.claim_id,repostClaim:i}}),t({type:ci,data:{claims:[i]}}),t(tK(1,10)),n(i)}function i(e){t({type:$i,data:{error:e.message}})}j.stream_repost(e).then(r,i)})}function dK(e){return(t,n)=>(t({type:uo}),t(lK({name:e,channel_ids:Et(n()),page:1,page_size:50,no_totals:!0,include_is_my_output:!0},{useAutoPagination:!0})).then(e=>(t({type:Ca}),Object.keys(e).length===0)))}function fK(){return{type:Es}}function pK(e=1,t=20){return n=>{n({type:Ni}),j.purchase_list({page:e,page_size:t,resolve:!0}).then(e=>n({type:Nu,data:{result:e}}),e=>{n({type:Do,data:{error:e.message}})})}}var mK=e=>(t,n)=>{e&&(qG=e),clearInterval(JG);let r=()=>{let e=n(),r=Object.assign({},An(e)),i={};for(let e of Object.keys(r))e.startsWith(`pending-`)||(i[e]=r[e]);if(Object.keys(i).length)return j.claim_list({claim_id:Object.keys(r),resolve:!0}).then(e=>{let n=e.items,i=[],a=[];n.forEach(e=>{e.claim_id&&e.confirmations>0&&r[e.claim_id].txid===e.txid&&(i.push(e),delete r[e.claim_id]),e.value?.tags?.includes(`c:members-only`)&&a.push(e.claim_id)}),t({type:ta,data:{claims:i,pending:r}}
62),t(HG(a));let o=i.filter(e=>e.value_type===`channel`);o.length&&qG&&o.forEach(e=>qG(e)),Object.keys(r).length===0&&clearInterval(JG)});clearInterval(JG)};JG=setInterval(()=>{r()},3e4)},hK=(e,t)=>(n,r)=>n(lK({limit_claims_per_channel:1,channel:e,no_totals:!0,order_by:[`release_time`],page:1,has_source:!0,stream_types:t?[`audio`,`video`]:void 0})).then(t=>n({type:Ka,data:{uri:e,results:t}})).catch(()=>n({type:Li})),gK=e=>async(t,n)=>await t(lK({channel_ids:[e],has_no_source:!0,claim_type:[`stream`],no_totals:!0,page_size:20,page:1,include_is_my_output:!0,order_by:[`release_time`]}));function _K(...e){return{type:`BATCH_ACTIONS`,actions:e}}var vK=`${be}/streams/kill?app=live&`,yK=`rtmp://publish.odysee.live/live`,bK=`${be}/replays/list`,xK=45*1e3,SK=15*1e3,CK=300*1e3;function wK(e){if(!e)return``;let t=e.trim();if(!t)return``;try{return t.includes(`://`)?new URL(t).hostname:t.split(`/`)[0].split(`:`)[0]}catch{return t.split(`/`)[0].split(`:`)[0]}}function TK(){try{return be&&new URL(be).protocol===`http:`?`http`:`https`}catch{return`https`}}function EK(){if(De)return wK(De);if(!be)return``;try{return new URL(be).hostname}catch{return``}}function DK(){let e=EK();return e?{urls:`turn:${e}:3478?transport=tcp`,username:`ome`,credential:`airen`}:null}function OK(){let e=EK();return De||be&&/localhost|127\.0\.0\.1/.test(be)&&e?`rtmp://${e}/live`:yK}function kK(e){let t=e.indexOf(`?`);return t===-1?{channelId:e,sigQuery:``}:{channelId:e.slice(0,t),sigQuery:e.slice(t+1)}}function AK(e){if(!e||!be)return null;let t=EK();if(!t)return null;let n=Se||`3334`,r=TK(),{channelId:i,sigQuery:a}=kK(e);return Te?Te.split(`{streamKey}`).join(e).split(`{proto}`).join(r).split(`{host}`).join(t).split(`{port}`).join(n).split(`{channelId}`).join(i).split(`{sigQuery}`).join(a):a?`${r}://${t}:${n}/webrtc/${i}?direction=whip&transport=tcp&${a}`:`${r}://${t}:${n}/webrtc/${i}?direction=whip&transport=tcp`}var jK=e=>e.livestream||Sn,MK=e=>jK(e).livestreamInfoByCreatorId,NK=e=>jK(e).activeLivestreamByCreatorId,PK=e=>jK(e).futureLivestreamsByCreatorId,FK=e=>jK(e).pastLivestreamsByCreatorId,IK=e=>jK(e).viewersById,LK=e=>jK(e).isLiveFetchingIds,RK=e=>jK(e).activeLivestreamsFetchingQueries,zK=e=>jK(e).activeCreatorLivestreamsByQuery,BK=e=>jK(e).socketConnectionById,VK=e=>jK(e).isLivePollingChannelIds,HK=(e,t)=>MK(e)[t],UK=(e,t)=>HK(e,t)!==void 0,WK=(e,t)=>IK(e)[t],GK=(e,t)=>PK(e)[t],KK=(e,t)=>FK(e)[t],qK=(0,Tz.createCachedSelector)((e,t,n,r)=>r?XK(e,r):NK(e),(e,t)=>t,(e,t,n)=>n,IK,(e,t,n,r)=>{if(!e)return e;let i=[];for(let r in e){let a=e[r];a&&(!t||t.includes(r))&&(!n||!n.includes(r))&&i.push(a)}return[...i].sort((e,t)=>{let[n,i]=[r[e.claimId],r[t.claimId]];return n<i?1:n>i?-1:0}).map(e=>e.uri)})((e,t,n,r)=>`${t?t.toString():``}-${n?n.toString():``}-${r||``}`),JK=(e,t)=>LK(e).includes(t),YK=(e,t)=>zK(e)[t],XK=(e,t)=>{let n=YK(e,t);if(!n)return n;let{creatorIds:r}=n;if(!r)return r;let i={};return r.forEach(t=>{i[t]=NK(e)[t]}),i},ZK=(e,t)=>VK(e).includes(t),QK=(e,t)=>{let n=YK(e,t);return n&&n.lastFetchedDate},$K=(e,t)=>{let n=YK(e,t);return n&&n.lastFetchedFailCount},eq=e=>RK(e).length>0,tq=(e,t)=>RK(e).includes(t),nq=(e,t)=>t&&BK(e)[t],rq=(e,t)=>
62!!nq(e,Ut(e,t))?.connected,iq=(e,t)=>{let n=$t(e,t);return!!(n&&ZK(e,n))},aq=(e,t)=>{if(!t)return Ot;let n=(mn(e)||Ot).filter(e=>e.value_type===`stream`&&e.value&&!e.value.source&&e.confirmations>0&&e.signing_channel&&e.signing_channel.claim_id===t);return n.length===0?Ot:[...n].sort((e,t)=>t.timestamp-e.timestamp)},oq=(e,t)=>{if(!t)return Ot;let n=(Qn(e)||Ot).filter(e=>e.value_type===`stream`&&e.value&&!e.value.source&&e.signing_channel&&e.signing_channel.claim_id===t);return n.length===0?Ot:n},sq=e=>t=>aq(t,e),cq=(0,Tz.createCachedSelector)((e,t)=>t,NK,(e,t)=>!e||!t?!1:Object.values(t).some(t=>t&&t.uri===e))((e,t)=>String(t)),lq=(e,t)=>{if(!t)return!1;let n=NK(e);return n?Object.values(n).some(e=>e&&e.claimId===t):!1},uq=(e,t)=>{if(!t)return null;let n=NK(e);if(!n)return null;for(let e in n){let r=n[e];if(r&&r.uri===t&&r.liveThumbnailUrl)return r.liveThumbnailUrl}return null},dq=(e,t)=>{let n=NK(e);if(!(!t||!n))return n[t]},fq=(e,t)=>{if(rq(e,t))return!0;let n=$t(e,t);return n&&dq(e,n)!==void 0},pq=(e,t)=>{let n=$t(e,t);if(!n)return n;let r=dq(e,n);return r&&r.uri},mq=(e,t)=>{let n=pq(e,t);if(!n)return n;if(n===t)return!0;let r=Lt(e,t);if(!r)return r;if([r.canonical_url,r.permanent_url].includes(n))return!0},hq=(e,t)=>{let n=dq(e,t);if(n)return n.uri;let r=GK(e,t),i=KK(e,t),a=i&&i.length>0;return r&&r.length>0?r[0].uri:a?i[0].uri:n},gq=(e,t)=>{let n=hq(e,t);return n&&Lt(e,n)},_q=a(Kt,e=>e.isBetween(kn().subtract(15,`minutes`),kn())),vq=a(Kt,e=>e.isBetween(kn().subtract(15,`minutes`),kn())),yq=(e,t)=>{let n=mq(e,t);if(!n)return n;let r=sn(e,t),i=yt(e,t),a=_q(e,t);return r||a||i},bq=(e,t)=>{let n=mq(e,t),r=yt(e,t),i=vq(e,t);if(!n&&(r||i))return!0;let a=_q(e,t);return!!(n&&r&&!a)},xq=(e,t)=>{let n=$t(e,t);if(!n)return n;let r=BV(e,n),i=Mr(t,Ht)(e);return r||i},Sq=e=>e.fileInfo||Sn,Cq=a(Sq,e=>e.byOutpoint||Sn),wq=e=>Sq(e).isFetchingFileList,Tq=e=>Sq(e).fetchingOutpoints;a(wq,Pr,(e,t)=>e||t);var Eq=(e,t)=>{let n=un(e,t);return n&&Cq(e)[n]},Dq=e=>t=>Eq(t,e),Oq=a(Sq,e=>e.downloadingByOutpoint||Sn),kq=(e,t)=>{let n=un(e,t);return n?Tq(e).includes(n):!1};a(Sq,e=>e.urisLoading||Sn);var Aq=a(Cq,mn,(e,t)=>Object.values(e).filter(e=>{let n=e,r=t.map(e=>e.claim_id);return n&&r.indexOf(n.claim_id)===-1&&(n.completed||n.written_bytes)}));a(a(Oq,Cq,(e,t)=>{let n=Object.keys(e),r=[];return n.forEach(e=>{let n=t[e];n&&r.push(n)}),r}),e=>{let t=[];e.forEach(e=>{t.push(e.written_bytes/e.total_bytes*100)});let n=t.reduce((e,t)=>e+t,0);return e.length>0?n/e.length/100:-1}),a(Sq,e=>e.errors||Sn);var jq=a(Aq,e=>e.slice().map(e=>`lbry://${e.claim_name}#${e.claim_id}`)),Mq=e=>a(Dq(e),On(e),(e,t)=>{if(!e&&!t)return;let n=e&&e.file_name;return j.getMediaType(t,n)}),Nq=e=>a(Dq(e),e=>e&&e.download_path),Pq=e=>a(Dq(e),e=>e?e.written_bytes>0||e.blobs_completed>0:!1),Fq=a(jq,e=>e.length);function Iq(e,t){if(t){let n=new RegExp(t,`i`);return e.filter(e=>{let{metadata:t}=e;return t.title&&t.title.match(n)||e.channel_name&&e.channel_name.match(n)||e.claim_name&&e.claim_name.match(n)})}return e}var Lq=(e,t=1)=>a(Aq,n=>{let r=Iq(n,e),i=(Number(t)-1)*20,a=Number(t)*20;return r&&r.length?r.slice(i,a).map(e=>tr({streamName:e.claim_name,channelName:e.channel_name,channelClaimId:e.channel_claim_id})):[]}),Rq=(e,t)=>{if(ir(e,t)){let n=jn(Lt(e,t));if(!n)return n;let{videoUrl:r}=dq(e,n.claim_id)||{};return r}let n=Eq(e,t);return n&&n.streaming_url},zq=10,Bq=50,Vq=e=>e.content||Sn;function Hq(e){return e.content}var Uq=e=>Vq(e).playingUri,Wq=e=>!!Uq(e).uri,Gq=e=>Uq(e).collection,Kq=e=>Gq(e).collectionId,qq=e=>Gq(e).loop,Jq=e=>Gq(e).shuffle?.newUrls,Yq=e=>Vq(e).primaryUri,Xq=e=>Vq(e).lastViewedAnnouncement,Zq=e=>Vq(e).recsysEntries,Qq=e=>Vq(e).autoplayCountdownUri,$q=(e,t)=>t?Vq(e).collectionLastPlayedUris?.[t]:void 0,eJ=(e,t)=>Qq(e)===t,tJ=(e,t)=>{let n=iJ(e,t),r=Jq(e);return n&&r},nJ=(e,t)=>{let n=iJ(e,t),r=qq(e);return n&&!!r},rJ=(e,t)=>{let n=Gq(e);return n.collectionId===t&&n},iJ=(e,t)=>!!rJ(e,t),aJ=(e,t)=>{let n=rJ(e,t);return n&&n.shuffle},oJ=(e,t)=>!!aJ(e,t),sJ=(e,t)=>{let n=rJ(e,t);return!!(n&&n.loop)},cJ=(e,t)=>{let{uri:n}=Uq(e);if(!n)return!1;if(n===t)return!0;let r=Lt(e,t);if(t&&r){let{canonical_url:e}=r;if(n===e)return!0}return r?(r.canonical_url,r.permanent_url).includes(n):!1},lJ=e=>{let t=Yq(e),n=Uq(e),r=Qq(e),i=n.uri||r;if(!i&&!r)return!1;let{source:a,primaryUri:o,location:s,collection:c}=n,{pathname:l,search:u}=s||{},{pathname:d,search:f}=e.router.location,p=new URLSearchParams(f),m=new URLSearchParams(u),h=p.get(`view`),g=m.get(`view`),_=h&&h!==g,v=p.get(`lid`),y=!!a,b=a===`comment`,x=a===`queue`,S=y&&i!==t&&l===d;return x&&t!==i||S&&_?!0:!(t&&cJ(e,t)||x&&(t===i||v!==c.collectionId)||S||(y&&!b&&t?o===t:i===t))},uJ=(e,t)=>
62{let n=Lt(e,t);if(n){let t=`${n.txid}:${n.nout}`,r=n.claim_id,i=Vq(e).positions;return i[r]?i[r][t]==null?i[r].remote||null:i[r][t]:null}return null},dJ=e=>Vq(e).history||[],fJ=e=>Vq(e).fetchingRemoteHistory;a(dJ,e=>Math.ceil(e.length/Bq));var pJ=e=>a(dJ,t=>t.find(t=>t.uri===e)),mJ=e=>a(pJ(e),e=>!!e);a(dJ,e=>e.slice(0,zq));var hJ=a(dJ,e=>{let t=[];for(let n of e)n.uri.indexOf(`@`)!==-1&&t.push(n.uri);return t}),gJ=e=>a(On(e),Mq(e),ar(e),(e,t,n)=>t===`video`||Cn.includes(e)&&n!==`exe`||t===`livestream`?ea:t===`audio`?xo:t===`image`?zc:[`md`,`markdown`].includes(n)||[`text/md`,`text/markdown`].includes(e)?`md`:e===`application/pdf`?`pdf`:[`text/htm`,`text/html`].includes(e)?ei:[`text`,`document`,`script`].includes(t)?yi:[`3D-file`,`model`].includes(t)?`cad`:t===`comic-book`||yn.includes(e)?Oi:[`application/zip`,`application/x-gzip`,`application/x-gtar`,`application/x-tgz`,`application/vnd.rar`,`application/x-7z-compressed`].includes(e)?Ia:t===`application`?Ou:Wa),_J=a((e,t)=>On(t)(e),(e,t)=>Mq(t)(e),(e,t)=>ar(t)(e),(e,t,n)=>t===`video`||Cn.includes(e)&&n!==`exe`||t===`livestream`?ea:t===`audio`?xo:t===`image`?zc:[`md`,`markdown`].includes(n)||[`text/md`,`text/markdown`].includes(e)?`md`:e===`application/pdf`?`pdf`:[`text/htm`,`text/html`].includes(e)?ei:[`text`,`document`,`script`].includes(t)?yi:[`3D-file`,`model`].includes(t)?`cad`:t===`comic-book`||yn.includes(e)?Oi:[`application/zip`,`application/x-gzip`,`application/x-gtar`,`application/x-tgz`,`application/vnd.rar`,`application/x-7z-compressed`].includes(e)?Ia:t===`application`?Ou:Wa),vJ=a(_J,e=>Kc.includes(e)),yJ=(e,t)=>gJ(t)(e)===`md`,bJ=(e,t)=>{let n=Yt(e,t),r=Je(e,t),i=Ye(e);return!n&&r&&r.cost>0&&r.cost>i},xJ=(e,t)=>{let n=en(e,t)===`scheduled`,r=nr(e,t);if(e.user.user?.global_mod&&(n||r))return!0;let i=Yt(e,t);if(i)return!0;if(n)return!!i;let a=wr(e,t),o=Yn(e,t),s=oW(e,t);return!a&&!s&&!o},SJ=(e,t)=>{let n=xJ(e,t);if(!n)return n;let r=Wr(e,t),i=vJ(e,t);return!r&&i},CJ=e=>e.collections||Sn,wJ=e=>e.router&&e.router.location&&e.router.location.search||``,TJ=0xe8d4a51000,EJ=e=>{if(!e)return 0;let t=Number(e);return!Number.isFinite(t)||t<=0?0:t>TJ?t:t*1e3},DJ=e=>CJ(e).savedIds,OJ=e=>CJ(e).builtin,kJ=e=>CJ(e).unpublished,AJ=e=>CJ(e).edited,jJ=e=>CJ(e).unsavedChanges,MJ=e=>CJ(e).updated,NJ=e=>CJ(e).collectionItemsFetchingIds,PJ=e=>CJ(e).queue,FJ=e=>CJ(e).lastUsedCollectionIds,IJ=e=>CJ(e).isFetchingMyCollections,LJ=e=>CJ(e).resolvedIds,RJ=e=>CJ(e).thumbnailClaimsFetchingCollectionIds,zJ=e=>CJ(e).autoPublishById||Sn,BJ=e=>CJ(e).publishingById||Sn,VJ=e=>CJ(e).publishErrorById||Sn,HJ=(e,t)=>!!zJ(e)[t],UJ=e=>CJ(e).autoPublishScheduledAtById||Sn,WJ=(e,t)=>UJ(e)[t]||null,GJ=(e,t)=>!!BJ(e)[t],KJ=(e,t)=>VJ(e)[t],qJ=(e,t)=>RJ(e).includes(t),JJ=a(LJ,e=>new Set(e||[])),YJ=(0,Tz.createCachedSelector)(JJ,(e,t)=>t,(e,t)=>e.has(t))((e,t)=>String(t));a(kJ,e=>Object.keys(e));var XJ=(e,t)=>!!DJ(e)?.includes(t),ZJ=a(Hr,DJ,(e,t)=>{let n={};return t.forEach(t=>{let r=e[t];r&&(n[t]=r)}),n}),QJ=a(kJ,AJ,ZJ,(e,t,n)=>{let r=Object.keys(e||{}),i=Object.keys(t||{}),a=Object.keys(n||{});return r.length>0||i.length>0||a.length>0}),$J=e=>{let t=QJ(e),n=Mt(e);return t||n&&n.length>0},eY=(e,t)=>AJ(e)[t],tY=(e,t)=>!!eY(e,t),nY=(e,t)=>{let n=jJ(e);return n?n[t]:null},rY=(e,t)=>!!nY(e,t),iY=(e,t)=>{let n=AJ(e);return n[t]?n[t]:MJ(e)[t]},aY=(e,t)=>{let n=gY(e,t);return n&&(n.title||n.name)||``},oY=(e,t)=>gY(e,t)?.description,sY=(e,t)=>Hr(e)[t],cY=(e,t)=>kJ(e)[t],lY=(e,t)=>{if(cY(e,t)||Ln.includes(t))return!0;let n=Mt(e);return n&&n.includes(t)?!0:Nt(e,t)},uY=a(vr,AJ,MJ,(e,t,n)=>{let r=Object.assign({},e);return Object.entries(t).forEach(([e,t])=>{n[e]?r[e]={...r[e],updatedAt:t.updatedAt}:r[e]=t}),r}),dY=a(uY,AJ,MJ,(e,t,n)=>{if(!e)return e;let r={};for(let i in e){let a=e[i],o=n[i],s=t[i];r[i]=Object.assign({},a),o?Object.assign(r[i],o):s&&Object.assign(r[i],s)}return r}),fY=(e,t)=>{let n=uY(e);return n&&n[t]},pY=a((e,t)=>!!fY(e,t),tY,(e,t)=>e&&!t),mY=(e,t)=>NJ(e).includes(t),hY=a(OJ,Hr,kJ,AJ,PJ,jJ,(e,t,n,r,i,a)=>({queue:i,...t,...r,...n,...e,...a})),gY=a((e,t)=>t,hY,Hr,wJ,(e,t,n,r)=>{if(!e)return e;let i=t[e];return new URLSearchParams(r).get(wn.QUERIES.VIEW)===wn.VIEWS.PUBLIC&&n[e]||i}),_Y=(e,t)=>
62OJ(e)[t],vY=a((e,t)=>t,OJ,dY,kJ,AJ,(e,t,n,r,i)=>{let a=[t,r,i,n],o=e.match(/[a-f0-9]{40}/)?.[0];return a.some(t=>Object.values(t).some(({items:t})=>t?.some(t=>t===e||t===o)))}),yY=()=>a([FJ,hY,OJ,kJ,AJ,Mt,(e,t)=>t],(e,t,n,r,i,a,o)=>{let s=o.match(/[a-f0-9]{40}/)?.[0],c=Object.keys(n||{}),l=Object.keys(r||{}),u=Object.keys(i||{}),d=new Set([...c,...l,...u,...a||[]]),f=e.filter(e=>d.has(e)).map(e=>{let n=t[e];return n?{...n,hasClaim:n.items?.some(e=>e===o||e===s)}:null}).filter(Boolean),p=Object.entries(t).filter(([e,t])=>d.has(e)&&t.items?.some(e=>e===o||e===s)&&!f.some(e=>e.id===t.id)).map(([e,t])=>({...t,hasClaim:!0}));return f.concat(p)}),bY=(e,t,n)=>!!VY(e,t,n),xY=(0,Tz.createCachedSelector)((e,t)=>gY(e,t)?.items,e=>e&&e.filter(e=>typeof e==`string`))((e,t)=>String(t)),SY=(0,Tz.createCachedSelector)((e,t)=>gY(e,t)?.items,e=>e&&e.filter(e=>typeof e!=`string`))((e,t)=>String(t)),CY=(e,t)=>{let n=xY(e,t),r=n&&n[0];if(!r)return null;if(at(r)||Jn(r))return r;let i=Xe(e,r);return i&&(i.permanent_url||i.canonical_url)||null},wY=(e,t)=>xY(e,t)?.length||0,TY=(e,t)=>wY(e,t)===0,EY=e=>!Ln.some(t=>{if(t!==`queue`)return wY(e,t)>0}),DY=(e,t)=>{let n=gY(e,t);return n&&n.thumbnail?.url},OY=a(gY,er,iY,(e,t,n)=>{let r=Ln.includes(e?.id),i=EJ(n?.updatedAt||e?.updatedAt||e?.createdAt||0);return!i&&r?EJ(t):i||0}),kY=a(gY,(e,t)=>t,er,(e,t,n)=>Ln.includes(t)?EJ(n):EJ(e?.createdAt||0)),AY=(e,t)=>ER(gY(e,t)),jY=(e,t)=>!!(cY(e,t)||Ln.includes(t)||(tY(e,t)||rY(e,t))&&new URLSearchParams(wJ(e)).get(wn.QUERIES.VIEW)!==wn.VIEWS.PUBLIC),MY=(e,t)=>!!(cY(e,t)||Ln.includes(t)),NY=/^[a-f0-9]{40}$/i,PY=a(jY,xY,ft,(e,t,n)=>{if(!t||!e)return t;let r=new Set;if(!t.some(e=>{if(NY.test(e))return r.add(e),!1;let t;try{t=n[Tt(e)]}catch{t=n[e]}if(t===void 0){try{let{streamClaimId:t,channelClaimId:n,isChannel:i}=Ft(e),a=i?n:t;if(a&&NY.test(a))return r.add(a),!1}catch{}return!0}if(t===null)return r.add(null),!1;if(typeof t!=`string`||!NY.test(t))return!1;r.add(t)}))return Array.from(r)}),FY=a(PY,e=>e&&e.includes(null)),IY=new Map,LY=(0,Tz.createCachedSelector)((e,t)=>t,(e,t,n)=>n,xY,xn,Cr,(e,t,n,r,i)=>{if(!n)return n;let a=[],o;if(n.forEach(e=>{if(at(e)||Jn(e))a.push(e);else{let t=r[e];if(t){let e=t.permanent_url||t.canonical_url;e&&a.push(e)}else t===void 0&&!i.includes(e)&&(o=!0)}}),o&&(!Number.isInteger(t)||t>a.length))return;let s=a,c=`${e}:${t}`,l=IY.get(c);return l&&l.length===s.length&&l.every((e,t)=>e===s[t])?l:(IY.set(c,s),s)})((e,t,n)=>`${String(t)}:${String(n)}`),RY=(0,Tz.createCachedSelector)(LY,e=>e,(e,t)=>e?e.find(e=>SJ(t,e)):void 0)((e,t)=>String(t)),zY=(0,Tz.createCachedSelector)(LY,(e,t)=>t,e=>e,(e,t,n)=>e&&e.filter(e=>{let t=Lt(n,e,!1);return t===void 0?!0:t!==null&&t.value_type!==`deleted`}))((e,t)=>String(t)),BY=(0,Tz.createCachedSelector)(zY,e=>e&&e.length)((e,t)=>String(t)),VY=(0,Tz.createCachedSelector)((e,t,n)=>n,(e,t,n)=>Lt(e,n),(e,t)=>LY(e,t),(e,t)=>xY(e,t),(e,t,n,r)=>{let i=n||r;if(!i)return i;if(i.includes(e))return e;if(!t)return!1;let a=t.permanent_url;if(i.includes(a))return a;let o=t.canonical_url;if(i.includes(o))return o;try{let{streamClaimId:t}=Ft(e);if(i.includes(t))return t}catch{}return!1})((e,t,n)=>`${t}:${n}`),HY=(e,t)=>gY(e,t)?.type,UY=(e,t)=>{let n=gY(e,t);return n&&n.sourceId},WY=(e,t)=>{if(t===`queue`)return tn;if(cY(e,t))return En.UNPUBLISHED;if(eY(e,t))return En.EDITED;if(Ln.includes(t))return En.BUILTIN;if(iY(e,t))return En.UPDATED},GY=(0,Tz.createCachedSelector)(VY,(e,t)=>LY(e,t),(e,t)=>{let n=t&&t.findIndex(t=>t===e);return n>-1?n:null})((e,t,n)=>`${t}:${n}`),KY=(0,Tz.createCachedSelector)(VY,(e,t)=>zY(e,t),tJ,(e,t,n)=>{let r=n?n.filter(e=>t?.includes(e)):t,i=r&&r.findIndex(t=>t===e);return i>-1?i:null})((e,t,n)=>`${t}:${n}`),qY=(e,t,n)=>KY(e,t,n)===BY(e,t)-1,JY=(0,Tz.createCachedSelector)(zY,KY,tJ,nJ,(e,t,n,r)=>{if(t===null)return null;let i=n?n.filter(t=>e?.includes(t)):e;return i?.length?t===0&&r?i[i.length-1]:i[t-1]:null})((e,t,n)=>`${String(t)}:${String(n)}`),YY=(0,Tz.createCachedSelector)(zY,KY,tJ,nJ,(e,t,n,r)=>{if(t===null)return null;let i=n?n.filter(t=>e?.includes(t)):e;return i?.length?t===i.length-1&&r?i[0]:i[t+1]||null:null})((e,t,n)=>`${String(t)}
62:${String(n)}`),XY=e=>e.publish||Sn,ZY=a(XY,e=>{let{editingURI:t,uri:n}=e;if(!t||!n)return!1;let r,i,a,o,s,c;try{({isChannel:r,streamName:i,channelName:a}=Ft(n)),{isChannel:o,streamName:s,channelName:c}=Ft(t)}catch{return!1}return(r?a:i)===(o?c:s)}),QY=a(XY,e=>e.settings,ZY,(e,t,n)=>{let{languages:r,...i}=e,a=r&&r.length&&r[0],{clientSettings:o={}}=t||{},{language:s}=o,c;return c=!a&&n&&s?s:a||s||`en`,{...i,language:c}}),$Y=(e,t)=>XY(e)[t],eX=(e,t=!0)=>{let{editingURI:n,uri:r,activeFormId:i,savedForms:a}=QY(e),o=ZY(e),s=xn(e),c=vt(e),l,u,d;try{({channelName:l,streamName:u}=Ft(r))}catch{return}try{({streamClaimId:d}=Ft(n))}catch{d=void 0}if(o)return s[d];let f=t?e=>l&&e===l||e===u:e=>{let t=e?.toLowerCase(),n=u?.toLowerCase(),r=l?.toLowerCase();return r&&t===r||t===n},p=c.find(e=>e.claim_id?.startsWith(`__preview_`)?!1:e.name&&f(e.name));if(p)return p;if(a&&u)for(let[e,t]of Object.entries(a)){if(e===i)continue;let n=t;if(n.name&&f(n.name))return{claim_id:`__draft_${e}__`,name:n.name,_isDraftConflict:!0}}},tX=a(e=>eX(e,!0),e=>{let t=e&&e.value&&e.value.source&&e.value.source.size;return t?Number(t)>Fe*1073741824:!1}),nX=a(XY,Rr,({uri:e,name:t},n)=>{if(e){let r=n.includes(e),{isChannel:i}=Ft(e),a;if(i&&t){let e=tr({streamName:t});a=n.includes(e)}return r||a}return!1}),rX=a(XY,e=>eX(e,!0),vn,({name:e},t,n)=>{if(!e)return null;let r=n[tr({streamName:e})];return!t&&r?r.meta.effective_amount:t&&r?r.meta.effective_amount||r.amount:null}),iX=a(e=>e.publish.type,e=>e.publish.liveCreateType,e=>e.publish.liveEditType,e=>e.publish.channelId,RC,sU,(e,t,n,r,i,a)=>{if(i||!r)return;let o=FH(e,t,n);return IH(a[r]||[],o).map(e=>e?.membership_id)}),aX=a(e=>e.publish.memberRestrictionOn,e=>e.publish.memberRestrictionTierIds,e=>e.publish.visibility,e=>e.publish.channelId,RC,sU,iX,(e,t,n,r,i,a,o)=>{let s=n===`unlisted`,c=!!a[r],l=o?o.length>0:!1,u=!s&&!i&&c&&l,d=e,f=t.length>0;return{isApplicable:u,isSelectionValid:!d||d&&f,isRestricting:u&&d&&f,details:{isUnlisted:s,isAnonymous:i,hasTiers:c,hasTiersWithRestrictions:l}}}),oX=e=>XY(e).currentUploads,sX=a(oX,e=>e&&Object.keys(e).length);a(oX,e=>e.publish.pipelineItems,(e,t)=>(e?Object.keys(e).length:0)+(t?Object.values(t):[]).filter(e=>e.stage!==`published`&&e.stage!==`error`&&e.stage!==`idle`).length);var cX=e=>XY(e).tags.some(e=>e.name===jt),lX=(0,Tz.createCachedSelector)(MY,gY,aY,PY,LC,qt,tY,rY,(e,t,n,r,i,a,o,s)=>{let c=r&&r.filter(Boolean),l={title:n,description:t.description,thumbnail_url:t.thumbnail?.url,claims:c,tags:t.tags||[]};if(e)return{...l,bid:1e-4,channel_id:i,name:Kr(n)};let u={channel_id:i,...a};return(o||s)&&Object.assign(u,l),u})((e,t)=>t),uX=e=>{let t=$Y(e,`channel`);return t&&t!==`anonymous`},dX=a(e=>e.publish.pipelineItems,e=>{let t=e||{};return Object.values(t).filter(e=>e.stage!==`idle`)}),fX=50,pX=15e3,mX=3,hX={},gX={},_X=(e={resolve:!0,page:1,page_size:50})=>async t=>(t({type:Ps}),await j.collection_list(e).then((()=>{let n={items:[],page:0,page_size:e.page_size,total_pages:0,total_items:0},r=()=>{n.items.length>0?t(_K({type:_s,data:{result:n}},{type:qu})):t({type:qu})},i=async t=>{let{items:a,...o}=t,s=t.items.length===e.page_size;if(n.items=n.items.concat(a),Object.assign(n,o),e.page++,!s)return r();try{return i(await j.collection_list(e))}catch{r()}};return i})(),e=>t({type:qu})));function vX(e,t,n){return(r,i)=>{let a=i(),o=MY(a,t),s=gY(a,t),c=Math.floor(Date.now()/1e3),l=s.createdAt||c,u={channel_id:e.channel_id,bid:mC(e.bid),blocking:!0,title:e.title,thumbnail_url:e.thumbnail_url,tags:e.tags?e.tags.map(e=>typeof e==`string`?e:e.name):[],languages:e.languages||[],description:e.description},d={};if(o){let t={...u,name:e.name,claims:e.claims};Object.assign(d,t)}else{let n={...u,claim_id:t,clear_claims:!0,replace:!0,claims:e.claims};Object.assign(d,n)}if(d.description&&typeof d.description!=`string`&&delete d.description,d.claims){let e=ft(a),t=xn(a),n=/^[a-f0-9]{40}$/i;d.claims=d.claims.filter(r=>{if(!r||typeof r!=`string`)return!1;let i;try{i=e[Tt(r)]}catch{i=e[r]}return i===null?!1:i===void 0?n.test(r)?t[r]!==null:!1:n.test(i)})}return r({type:mi,data:{collectionId:t}}
62),new Promise((e,i)=>{let a=o?j.collection_create:j.collection_update;function u(n){let i=n.outputs?n.outputs[0]:n,a=i;a.meta||={},a.meta.creation_timestamp||(a.meta.creation_timestamp=l),a.timestamp||=c;let o={...s,id:i.claim_id,name:d.title||s.name,title:d.title||s.title||s.name,description:d.description,thumbnail:d.thumbnail_url?{url:d.thumbnail_url}:s.thumbnail,tags:d.tags||s.tags||[],items:d.claims||[],itemCount:d.claims?d.claims.length:0,createdAt:i.meta?.creation_timestamp||i.timestamp,updatedAt:i.timestamp||c};return r({type:td,data:t}),r({type:Tc,data:{collectionKey:En.UPDATED,collection:{id:i.claim_id,updatedAt:c}}}),r({type:Mu,data:{collectionId:t,publishedCollectionId:i.claim_id}}),r(_K({type:ci,data:{claims:[i]}},{type:Tu,data:{resolvedCollection:o}},{type:Ol,data:o},mK(()=>{}))),e(i)}function f(e){n&&n(),r({type:go,data:{collectionId:t,error:e?.message||e}});let a=e?.message?.match&&e.message.match(/script size ([0-9]+) exceeds limit 8192/),o=null;if(a){let e=parseInt(a.at(1).toString())-8192,t=Math.ceil(e/24);o=D(`Playlist exceeds size limits.`)+` `+(t>1?D(`Please remove %itemsToDelete% items`,{itemsToDelete:t}):D(`Please remove 1 item`))+` `+(e>1?D(`or %extraBytes% characters of text.`,{extraBytes:e}):D(`or 1 character of text.`))}r(N({message:o||e.message||e,isError:!0})),i(e)}return a(d).then(u,f)})}}var yX=e=>t=>{hX[e]&&clearTimeout(hX[e]),t({type:Ys,data:{collectionId:e,scheduledAt:Date.now()+pX}}),hX[e]=setTimeout(()=>{delete hX[e],t({type:Ys,data:{collectionId:e,scheduledAt:null}}),t(bX(e,!0))},pX)},bX=(e,t=!1)=>async(n,r)=>{let i=r(),a=HJ(i,e),o=MY(i,e),s=lY(i,e),c=et(i,e),l=GJ(i,e),u=tY(i,e),d=rY(i,e);if(!t&&!a||o||!s||c||l||!u&&!d)return Promise.resolve();let f=lX(i,e);if(f?.claims===void 0&&(await n(kX({collectionId:e})),i=r(),f=lX(i,e)),f?.claims===void 0){let t=(gX[e]||0)+1;return gX[e]=t,t<=mX?n(yX(e)):(delete gX[e],n(N({message:D(`Failed to auto-publish playlist changes. Playlist items could not be loaded.`),isError:!0}))),Promise.resolve()}return delete gX[e],f.claims.length>0?t?n(vX(f,e)).catch(()=>Promise.resolve()):(n(yX(e)),Promise.resolve()):Promise.resolve()},xX=()=>(e,t)=>{let n=zJ(t());Object.entries(n).forEach(([t,n])=>{n&&e(bX(t))})},SX=(e,t)=>n=>{n({type:lc,data:{collectionId:e,enabled:t}}),n(N({message:D(t?`Auto-publish enabled. New playlist edits will publish in the background.`:`Auto-publish disabled. You can still publish manually.`)})),t&&n(bX(e))},CX=e=>t=>t(bX(e,!0)),wX=(e,t)=>(n,r)=>{let{items:i,sourceId:a}=e,o=Ke();if(t&&t(o),a){let t=r(),i=LY(t,a),s=gY(t,a),c=$n(t,a),l=s.description||Bn(c?.canonical_url,`description`)(t),u=s.thumbnail?.url||hr(c);return n({type:Ru,data:{entry:{...e,id:o,items:i,itemCount:i.length,description:l,...u&&{thumbnail:{url:u}}}}})}return n({type:Ru,data:{entry:{id:o,items:i||[],...e}}})},TX=(e,t=void 0,n=!1)=>(r,i)=>{let a=i(),o=Xe(a,e),s=gY(a,e),c=async()=>{if(t&&r({type:cl,data:{collectionId:e,collectionKey:t}}),o&&n){let e=Object.assign({},s);delete e.id,r(wX(e))}r({type:td,data:e})};return o?r(rK(o,c)):c()},EX=e=>(t,n)=>{t(N({message:XJ(n(),e)?D(`Removed from saved Playlists.`):D(`Added to saved Playlists!`)})),t({type:Ci,data:e})},DX=e=>{let t=[];return e.forEach(e=>{let n=e.items||Object.values(e).map(e=>e.stream||e);t=t.concat(n)}),t},OX=(e,t)=>async(n,r)=>{let i=t=>{let n=[];return e.forEach(e=>{let r=t.findIndex(t=>[t.canonical_url,t.permanent_url,t.claim_id].includes(e));r>=0&&n.push(t[r])}),n};try{let a=t||fX,o=e.length,s=[];for(let t=0;t<Math.ceil(o/a);t++){let n=t*a,r=(t+1)*a,i=e.slice(n,r).filter(Boolean),o=[],c=[];i.forEach(e=>{e.startsWith(`lbry://`)?o.push(e):c.push(e)}),s.push({uris:o,ids:c})}let c=[];for(let e of s)(await Promise.all([e.uris.length>0?n(XG(e.uris,!0)):null,e.ids.length>0?n(ZG(e.ids)):null])).forEach(e=>e&&c.push(e));let l=i(DX(c.filter(Boolean)));if(l.length!==e.length){let t=new Set;l.forEach(e=>{t.add(e.claim_id),t.add(e.permanent_url),t.add(e.canonical_url)});let n=e.filter(e=>!t.has(e)),a=()=>{let e=r(),t=Mn(e),i=Rr(e);return n.some(e=>t.includes(e)||i.includes(e))};for(let e=0;e<40&&a();e++)await new Promise(e=>setTimeout(e,250));
62let o=r(),s=xn(o),c=ft(o);n.forEach(e=>{let t=s[e]?e:c[e],n=t&&s[t];n&&l.push(n)}),l=i(l)}return l}catch{return null}},kX=e=>async(t,n)=>{let r=n(),{collectionId:i,pageSize:a}=e;if(mY(r,i))return Promise.resolve();t({type:ys,data:i});let o=jY(r,i),s=jr(r,i);if(!o&&s===void 0&&await t(QG(i,!0,{include_is_my_output:!0})).finally(()=>{r=n()}),!o&&s===null)return t({type:vc,data:i});let c,l;if(o){let e=gY(r,i);if(e.items.length>0)c=e.items&&t(OX(e.items,a));else{let n=WY(r,i);return t({type:Tu,data:{resolvedCollection:{...e,items:[],itemCount:0,key:n}}})}}else{let e=wR(Xe(r,i));c=e&&t(OX(e,a))}if(c&&(l=await c),!l||l?.length===void 0)return t({type:vc,data:i});let u=gY(r,i),d=WY(r,i);if(o){let e={};l.forEach(t=>{e[t.claim_id]=t,t.permanent_url&&(e[t.permanent_url]=t),t.canonical_url&&(e[t.canonical_url]=t)});let n=u.items.map(t=>e[t]?.permanent_url||t);return t({type:Tu,data:{resolvedCollection:{...u,items:n,key:d}}})}else{let e=Xe(r,i),{value:n}=e,{tags:a}=n||{},o=wR(e)||[],s=new Set,c=new Set,d=[],f={};l.forEach(e=>{f[e.claim_id]=e}),o.forEach(e=>{let t=f[e];t?(d.push(t.claim_id),s.add(t.value_type),t.value&&t.value.stream_type&&c.add(t.value.stream_type)):d.push(e)});let p=DR(a,s,c),m={...u,items:d,itemCount:d.length,type:p,...OR(p,e)};return t(_K({type:Tu,data:{resolvedCollection:m}},{type:Ol,data:m}))}},AX=e=>async(t,n)=>{let r=n(),{collectionIds:i,pageSize:a}=e,o=i.toString();if(qJ(r,o))return Promise.resolve();t({type:Mi,data:o});let s=new Set;return i.forEach(e=>{let t=gY(r,e);t&&t.items&&t.items.slice(0,3).forEach(e=>s.add(e))}),await t(OX(Array.from(s),a)).finally(()=>t({type:Eo,data:o}))},jX=(e,t,n)=>async(r,i)=>{let a=i(),o=gY(a,e);if(!o||(o.items?.length&&!YJ(a,e)&&(await r(kX({collectionId:e})),a=i(),o=gY(a,e)),!o?.items))return!1;let s=o.items.map(e=>{let t=e.match(/[a-f|0-9]{40}$/),n=t?t[0]:null;return{claim:n?Xe(a,n):e,item:e}}),c=s.filter(({claim:e})=>e&&typeof e!=`string`),l=s.filter(({claim:e})=>!e||typeof e==`string`).map(({item:e})=>
62e).filter(Boolean),u=[...c].sort(({claim:e},{claim:r})=>{if(t===ut.RELEASED_AT){let t=e?.value?.release_time||e?.meta?.creation_timestamp||0,i=r?.value?.release_time||r?.meta?.creation_timestamp||0;if(n===ot.ASC)return i-t;if(n===ot.DESC)return t-i}if(t===ut.NAME){let t=e?.value?.title||e?.meta?.name||`A`,i=r?.value?.title||r?.meta?.name||`A`;if(n===ot.ASC)return i.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`});if(n===ot.DESC)return t.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})}return 0}).map(({claim:e})=>e?.permanent_url||e?.canonical_url||e?.claim_id);return u=u.concat(l),r({type:Tc,data:{collectionKey:En.UNSAVED_CHANGES,collection:{...o,items:u,itemCount:u.length}}})},MX=(e,t)=>async(n,r)=>{let i=r(),a=gY(i,e);if(!a)return n(N({message:D(`Collection does not exist.`),isError:!0})),!1;let o=!!sY(i,e),s=jY(i,e),{uris:c,remove:l,replace:u,order:d,type:f,isPreview:p}=t,m=YJ(i,e),h=!!(a.items&&a.items.length),g=!c&&!l&&!u&&!d,_=h&&!m&&(!s||g);if(_&&(await n(kX({collectionId:e})),i=r(),a=gY(i,e),m=YJ(i,e)),_&&!m&&!g)return n(N({message:D(`Failed to resolve collection items. Please try again.`),isError:!0})),!1;let v=LY(i,e);!v&&a&&a.items&&a.items.length&&(await n(kX({collectionId:e})),i=r(),a=gY(i,e),v=LY(i,e));let y=a&&a.items?a.items.filter(e=>typeof e==`string`):[],b=(v||y).concat(),x=new Set(b),S=b;if(c)if(u)S=c;else if(l){let t=c.map(t=>VY(i,e,t));S=b.filter(e=>e&&(!c||!t.includes(e)))}else c.forEach(e=>!x.has(e)&&S.push(e));else l&&(S=[]);if(d){let e=S.concat(),[t]=e.splice(d.from,1);e.splice(d.to,0,t),S=e}let C=e===tn,ee=t.title||t.name;return new Promise(r=>{n({type:C?Hc:Tc,data:{collectionKey:p?En.UNSAVED_CHANGES:o?En.EDITED:WY(i,e),collection:{...a,items:S,itemCount:S.length,...`description`in t?{description:t.description}:{},...`tags`in t?{tags:t.tags}:{},...ee?{name:ee,title:ee}:{},...f?{type:f}:{},...`thumbnail_url`in t?{thumbnail:t.thumbnail_url?{url:t.thumbnail_url}:void 0}:{}}}}),!C&&!p&&n(bX(e)),r(!0)})},NX=e=>t=>{hX[e]&&(clearTimeout(hX[e]),delete hX[e]),t({type:Ys,data:{collectionId:e,scheduledAt:null}}),t({type:cl,data:{id:e,collectionKey:`edited`}}),t({type:cl,data:{id:e,collectionKey:En.UNSAVED_CHANGES}}),t({type:Tc,data:{collectionKey:En.UPDATED,collection:{id:e}}})},PX=e=>t=>{t({type:cl,data:{id:e,collectionKey:`unsavedChanges`}})},FX=()=>(e,t)=>e({type:ri}),IX=`fresh`,LX=`order`,RX=`sort`,zX=`duration`,BX=`language`,VX=`content`,HX=`reposted_uri`,UX=`channel_ids`,WX=`tags_any`,GX=`tags_followed`,KX=`fee_amount`,qX=`rent`,JX=`purchase`,YX=`week`,XX=`month`,ZX=`year`,QX=`default`,$X=[QX,`day`,YX,XX,ZX,`all`],eZ=`trending`,tZ=[`trending_group`,`trending_mixed`],nZ=[`effective_amount`],rZ=[`release_time`],iZ=`new_created`,aZ=[`creation_timestamp`],oZ=`new_asc`,sZ=[`^release_time`],cZ=`name_asc`,lZ=[`^name`],uZ=[`new`,eZ,`top`],dZ={SHORT:`short`,LONG:`long`,ALL:`all`,CUSTOM:`custom`},fZ=Object.values(dZ),pZ={NEWEST:{key:`new`,opt:``,str:`Newest first`},OLDEST:{key:`old`,opt:`^`,str:`Oldest first`}},mZ=`video`,hZ=`audio`,gZ=`document`,_Z=`binary`,vZ=`image`,yZ=`model`,bZ=[mZ,hZ,gZ,vZ,yZ,_Z],xZ=`claim_type`,SZ=`channel`,CZ=`stream`,wZ=`repost`,TZ=`collection`,EZ=[`all`,mZ,hZ,vZ,gZ,TZ,SZ,yZ,wZ,_Z],DZ=[LX,`t`,IX,VX,zX],Q={RESULT_COUNT:`size`,CLAIM_TYPE:`claimType`,RELATED_TO:`related_to`,INCLUDE_FILES:`file`,INCLUDE_CHANNELS:`channel`,INCLUDE_FILES_AND_CHANNELS:`file,channel`,INCLUDE_MATURE:`nsfw`,MEDIA_AUDIO:`audio`,MEDIA_VIDEO:`video`,MEDIA_TEXT:`text`,MEDIA_IMAGE:`image`,MEDIA_APPLICATION:`application`,SORT:`sort_by`,SORT_ASCENDING:`^release_time`,SORT_DESCENDING:`release_time`,EXACT:`exact`,PRICE_FILTER_FREE:`free_only`,LANGUAGE:`language`,TIME_FILTER:`time_filter`,TIME_FILTER_LAST_HOUR:`lasthour`,TIME_FILTER_TODAY:`today`,TIME_FILTER_THIS_WEEK:`thisweek`,TIME_FILTER_THIS_MONTH:`thismonth`,TIME_FILTER_THIS_YEAR:`thisyear`,MIN_DURATION:`min_duration`,MAX_DURATION:`max_duration`,DEBOOST_SAME_CREATOR:`deboost_same_creator`,MAX_ASPECT_RATIO:`max_aspect_ratio`,CONTENT_ASPECT_RATIO:`content_aspect_ratio`,CONTENT_ASPECT_RATIO_OR_MISSING:`content_aspect_ratio_or_missing`,EXCLUDE_SHORTS:`exclude_shorts`,EXCLUDE_SHORTS_ASPECT_RATIO_LTE:`exclude_shorts_aspect_ratio_lte`,EXCLUDE_SHORTS_DURATION_LTE:`exclude_shorts_duration_lte`,CHANNEL_IDS:`channel_ids`},OZ=0,kZ=20,AZ=[Q.MEDIA_AUDIO,Q.MEDIA_VIDEO,Q.MEDIA_TEXT,Q.MEDIA_IMAGE,Q.MEDIA_APPLICATION],jZ=e=>e[0]===`"`&&e[e.length-1]===`"`,MZ=(e,t={})=>{let n=encodeURIComponent(e),r=typeof t.size==`number`||typeof t.size==`string`?t.size:kZ,i=typeof t.from==`number`||typeof t.from==`string`?t.from:OZ,a=[t.exact&&!jZ(n)?`s="${n}"`:`s=${n}`,`size=${r}`,`from=${i}
62`],{isBackgroundSearch:o}=t,c=o===void 0?!1:!o,l=!1;function u(){let e=!1,t=!1,n=!1,r=!1;for(let i of a)i.includes(`mediaType`)&&(e=!0,[Q.MEDIA_VIDEO,Q.MEDIA_AUDIO].some(e=>i.includes(e))&&(n=!0)),i.includes(`claimType`)&&(t=!0,i.includes(Q.INCLUDE_FILES)&&(r=!0));return(!e||n)&&(!t||r)}if(l=u(),c){let e=t[Q.CLAIM_TYPE];if(e&&(a.push(`claimType=${e}`),!e.includes(Q.INCLUDE_CHANNELS))){let e=AZ.filter(e=>!!t[e]);e.length>0&&e.length<AZ.length&&a.push(`mediaType=${e.join(`,`)}`)}let n=t[Q.SORT];(typeof n==`string`&&n!==``||typeof n==`number`)&&a.push(`${Q.SORT}=${n}`);let r=t[Q.TIME_FILTER];(typeof r==`string`&&r!==``||typeof r==`number`)&&a.push(`${Q.TIME_FILTER}=${r}`);let i=t[Q.MIN_DURATION];if(l&&i&&i>0){let e=i*60;a.push(`${Q.MIN_DURATION}=${e}`)}let o=t[Q.MAX_DURATION];if(l&&o&&o>0){let e=o*60;a.push(`${Q.MAX_DURATION}=${e}`)}}let f={},{related_to:p,nsfw:m,free_only:h,language:g,gid:_,uuid:v,max_aspect_ratio:y,deboost_same_creator:b,content_aspect_ratio:x,content_aspect_ratio_or_missing:S}=t,{store:C}=window,ee=!1;
62return C&&(ee=iu(C.getState(),d)),p&&(f[Q.RELATED_TO]=p,_&&v&&(f.gid=_,f.uuid=v)),h&&(f[Q.PRICE_FILTER_FREE]=!0),m===!1&&(f[Q.INCLUDE_MATURE]=!1),g&&(f[Q.LANGUAGE]=g),y&&(f[Q.MAX_ASPECT_RATIO]=y),b&&(f[Q.DEBOOST_SAME_CREATOR]=b),x&&(f[Q.CONTENT_ASPECT_RATIO]=x),S&&(f[Q.CONTENT_ASPECT_RATIO_OR_MISSING]=S),ee&&(f[Q.EXCLUDE_SHORTS]=ee,f[Q.EXCLUDE_SHORTS_ASPECT_RATIO_LTE]=s,f[Q.EXCLUDE_SHORTS_DURATION_LTE]=180),f&&Object.keys(f).forEach(e=>{let t=f[e];a.push(`${e}=${t}`)}),a.join(`&`)},NZ=e=>e.startsWith(`lbry://`)?e:`lbry://${e}`;function PZ(e,t){if(e.includes(t)){let n=e.indexOf(t),r=e.indexOf(`&`,n+t.length);e=r>n?e.substring(0,n)+e.substring(r):e.substring(0,n)}return e}function FZ(e){let t=e;return t=PZ(t,`&from=`),t=PZ(t,`&gid=`),t=PZ(t,`&uuid=`),t}function IZ(e){let t=`${Re}/`,n=`${Le}/`,r=`${Pe}/`,i=`https://odysee.com/`,a=e.includes(r),o=e.includes(i),s=e.includes(n),c=e.includes(t),l=c||s||a||o,u=e.startsWith(`lbry://`)&&e!==`lbry://`;if(l){let a=r;s&&(a=n),c&&(a=t),o&&(a=i);let l=e&&e.slice(a.length).replace(/:/g,`#`)||``;
62try{let e=`lbry://${l}`;return Ft(e),[e,null]}catch{return[l,`error`]}}if(u)try{if(mt(e)){let t;try{t=Tt(e)}catch{return[e,null]}return[t,null]}else return[e,null]}catch{return[e,`error`]}else return e.startsWith(`@`)?zt(e.slice(1))?[e,null]:[e,``]:[NZ(e),null]}function LZ(e,t,n,r,i=!1){let a={size:i?50:20,nsfw:e,isBackgroundSearch:!0};return a[Q.CLAIM_TYPE]=Q.INCLUDE_FILES,a[Q.MEDIA_VIDEO]=!0,a[Q.PRICE_FILTER_FREE]=!0,(e||!t)&&(a[Q.RELATED_TO]=n),r&&(a[Q.LANGUAGE]=r),a}function RZ(e,t,n,r,i){let a={size:50,nsfw:e,isBackgroundSearch:!1};return a[Q.CLAIM_TYPE]=`stream`,a[Q.MEDIA_VIDEO]=!0,a[Q.PRICE_FILTER_FREE]=!0,a[Q.MAX_DURATION]=3,a[Q.MAX_ASPECT_RATIO]=s,a[Q.DEBOOST_SAME_CREATOR]=.1,i?a[Q.CHANNEL_IDS]=[n]:(e||!t)&&(a[Q.RELATED_TO]=n),r&&(a[Q.LANGUAGE]=r),a}function zZ(e,t){return FZ(MZ(e.replace(/\//,` `),t))}function BZ({currentQuery:e,filteredResultCount:t,from:n,hasReachedMaxResultsLength:r,hideYouTubeMirrors:i,isSearching:a,lastCompletedSearchFrom:o,visibleResultTarget:s}){return!!(i&&e&&!a&&o===n&&t<s&&!r)}function VZ(e){return e.any_tags&&e.any_tags.length>0&&(delete e.limit_claims_per_channel,JSON.stringify(e.order_by)!==JSON.stringify(nZ)&&delete e.release_time),e}var HZ=20,UZ=e=>e.search,WZ=e=>UZ(e).searchQuery,GZ=e=>UZ(e).options,KZ=e=>UZ(e).searching,qZ=e=>UZ(e).resultsByQuery,JZ=e=>UZ(e).hasReachedMaxResultsLength,YZ=e=>UZ(e).personalRecommendations,XZ=e=>a(qZ,t=>{if(!e)return;e=e.replace(/^lbry:\/\//i,``).replace(/\//,` `);let n=FZ(e);return t[n]&&t[n].uris}),ZZ=e=>a(qZ,t=>{if(e)return e=e.replace(/^lbry:\/\//i,``).replace(/\//,` `),t[FZ(e)]?.lastCompletedFrom}),QZ=e=>a(JZ,t=>e?(e=e.replace(/^lbry:\/\//i,``).replace(/\//,` `),t[FZ(e)]):t[e]),$Z=(0,Tz.createCachedSelector)(Lt,Wu,Wr,qZ,mc,e=>iu(e,ee),Yl,(e,t,n,r,i,a,o)=>{let s=a?i:null;if(e?.value?.title){let i=LZ(t,n,e.claim_id,s,o);return r[zZ(e.value.title,i)]}})((e,t)=>String(t)),eQ=a(vn,$Z,(e,t)=>{let n={};return t&&t.uris.forEach(t=>{e[t]&&(n[t]=e[t])}),n},{memoizeOptions:{maxSize:3,resultEqualityCheck:nz}}),tQ=(0,Tz.createCachedSelector)(Lt,$Z,eQ,ur,Yl,(e,t,n,r,i)=>{if(!e||!t)return;let a=e.claim_id;return t.uris.filter(e=>{let t=n[e];if(!t)return!0;let o=t?.signing_channel?.claim_id,s=!!o&&r.includes(o),c;try{let{claimId:t}=Ft(e);c=t===a}catch{}let l=t?.claim_id?.startsWith(`pending-`)||t?.confirmations===0,u=i&&nn(t);return!c&&!s&&!l&&!u}).slice(0,HZ)})((e,t)=>String(t)),nQ=(0,Tz.createCachedSelector)(Lt,dJ,tQ,eQ,e=>e.claims.costInfosById,(e,t,n,r,i)=>{if(!(!e||!n)){for(let e=0;e<n.length;++e){let a=n[e],o=r[a],s=o&&i[o.claim_id]?.cost!==0,c=o?.value?.stream_type===`video`,l=o?.value?.stream_type===`audio`;if(!t.some(e=>o?.permanent_url===e.uri||o?.canonical_url===e.uri)&&!s&&(c||l)){if(e>0){let t=n.slice(),r=t[0];return t[0]=a,t[e]=r,t}break}}return n}})((e,t)=>String(t)),rQ=(e,t)=>{let n=nQ(e,t);return n&&n[0]},iQ=(0,Tz.createCachedSelector)(Xe,Wu,qZ,mc,e=>iu(e,ee),Yl,(e,t,n,r,i,a)=>{if(e&&e?.value?.title&&e.claim_id){let o=Dn(e),s=e.value.title,c=i?r:null,l=zZ(s,LZ(t,o,e.claim_id,c,a)),u=n[l];return u?{poweredBy:u.recsys,uuid:u.uuid}:l}})((e,t)=>String(t)),aQ=e=>{let t=`lbry://${e}`,n=``;try{let{isChannel:r}=Ft(t);r||(n=`lbry://@${e}`)}catch{}return a(Wu,Un(t),yr(t),yr(n),(e,t,n,r)=>{let i=n&&Dn(n),a=r&&Dn(r),o=t&&t.amount;if(!n&&!r)return;if(!n&&r)return e?r.canonical_url:a?void 0:r.canonical_url;if(n&&!r)return e?n.repost_url||n.canonical_url:i?void 0:n.repost_url||n.canonical_url;let s=n&&(n.repost_bid_amount||n.meta.effective_amount),c=r&&r.meta.effective_amount;if(!e){if(i&&!a)return r.canonical_url;if(a&&!i)return n.repost_url||n.canonical_url;if(i&&a)return}let l=Number(s)>Number(c)?n.repost_url||n.canonical_url:r.canonical_url;return o&&o>s&&o>c?o.permanent_url:l})},oQ=(e,t=``)=>{let n=`lbry://${t}`,r;try{let{isChannel:e}=Ft(n);e||(r=`lbry://@${t}`)}catch{}let i=$e(e,n),a=r?$e(e,r):!1;return i||a};function sQ(e){let t=e.headers,n=t.get(`x-powered-by`),r=t.get(`x-uuid`);return e.status===200?e.json().then(e=>({body:e,poweredBy:n,uuid:r})):Promise.reject(Error(e.statusText))}Ve(xe,`RECSYS_FYP_ENDPOINT not defined!`);var cQ={fetchPersonalRecommendations:e=>fetch(`${xe}/${e}/fyp`,{headers:{[id]:_R()}}).then(e=>e.json()).then(e=>e).catch(t=>(console.log(`FYP: fetch`,{error:t,userId:e}),{})),markPersonalRecommendations:(e,t)=>fetch(`${xe}/${e}/fyp/${t}/mark`,{method:`POST`,headers:{[id]:_R()}}).catch(n=>(console.log(`FYP: mark`,{error:n,userId:e,gid:t}),{})),ignoreRecommendation:(e,t,n,r)=>{let i=`${xe}/${e}/fyp/${t}/c/${n}/ignore`;return r&&(i+=`?entire_channel=1`),fetch(i,{method:`POST`,headers:{[id]:_R()}}).then(e=>e).catch(r=>(console.log(`FYP: ignore`,{error:r,userId:e,gid:t,claimId:n}),{}))}},lQ={CONNECTION_STRING:ze,user_id:``,uid:``,search:e=>lQ.uid?fetch(`${lQ.CONNECTION_STRING}?${e}${lQ.uid}`).then(sQ):fetch(`${lQ.CONNECTION_STRING}?${e}`).then(sQ),searchRecommendations:e=>lQ.user_id?fetch(`${Ce}?${e}${lQ.user_id}${lQ.uid}`).then(sQ):fetch(`${Ce}?${e}`).then(sQ)},uQ=e=>{lQ.user_id=e?`&user_id=${e}
62`:``,lQ.uid=e?`&uid=${e}`:``},dQ=e=>{let t=[];return e.forEach(e=>{if(e){let{name:n,claimId:r}=e,i={};n.startsWith(`@`)?(i.channelName=n,i.channelClaimId=r):(i.streamName=n,i.streamClaimId=r);let a=tr(i,!0);mt(a)&&t.push(a)}}),t},fQ=(e,t)=>(n,r)=>{let i=e.replace(/^lbry:\/\//i,``).replace(/\//,` `);if(!i){n({type:ua});return}let a=r(),o=MZ(i,t),s=t.size,c=t.from,l=XZ(o)(a);if(l&&l.length&&(!s||!c||c+s<l.length))return;n({type:ss});let u=t.hasOwnProperty(Q.RELATED_TO);(u?lQ.searchRecommendations:lQ.search)(o).then(e=>{let{body:t,poweredBy:r,uuid:i}=e,a=dQ(t);if(u){n(ZG(t.map(e=>e.claimId))).finally(()=>{n({type:ns,data:{query:o,from:c,size:s,uris:a,poweredBy:r,uuid:i}})});return}let l=[];l.push(XG(a)),l.push({type:ns,data:{query:o,from:c,size:s,uris:a,poweredBy:r,uuid:i}}),n(_K(...l))}).catch(()=>{n({type:ua})})},pQ=(e,t)=>(n,r)=>{let i=r(),a=WZ(i),o={...GZ(i),...e};nd.setItem(rd.SEARCH_OPTIONS,JSON.stringify(o)),n({type:Yi,data:e}),a&&n(fQ(a,{...o,...t}))},mQ=(e,t)=>n=>{n({type:Ja,data:{query:e,uris:t}})},hQ=(e,t=null,n=!1)=>(r,i)=>{let a=i(),o=Lt(a,e),s=Wu(a),c=Wr(a,e),l=mc(a),u=iu(a,`search_in_language`)?l:null;if(o&&o.value&&o.claim_id){let e;if(n){if(e=o.signing_channel?.claim_id,!e){console.error(`No channel ID found for channel shorts mode`);return}}else e=o.claim_id;let i=RZ(s,c,e,u,n);t&&(i.gid=t.gid,i.uuid=t.uuid);let{title:a}=o.value;a&&i&&r(fQ(a,i))}},gQ=(e,t=null)=>(n,r)=>{let i=r(),a=Lt(i,e),o=Wu(i),s=Yl(i),c=Wr(i,e),l=mc(i),u=iu(i,`search_in_language`)?l:null;if(a&&a.value&&a.claim_id){let e=LZ(o,c,a.claim_id,u,s);t&&(e.gid=t.gid,e.uuid=t.uuid);let{title:r}=a.value;r&&e&&n(fQ(r,e))}},_Q=()=>(e,t)=>{let n=Vt(t());if(!n||!n.id){e({type:El});return}cQ.fetchPersonalRecommendations(n.id).then(t=>{let{gid:n,recs:r}=t;if(n&&r){let t=dQ(r);e(lK({claim_ids:r.map(e=>e.claimId),page:1,page_size:50,no_totals:!0})).finally(()=>{e({type:al,data:{gid:n,uris:t}})})}else e({type:El})}).catch(()=>{e({type:El})})},vQ=e=>(t,n)=>{let r=n(),i=Vt(r),a=YZ(r),o=Ut(r,e);!i||!i.id||!a.gid||!o||t(A8(rf,{uri:e,onConfirm:n=>{cQ.ignoreRecommendation(i.id,a.gid,o,n).then(n=>{t({type:xc,data:{uri:e}}),t(N({message:D(`Recommendation removed.`),subMessage:D(`Thanks for the feedback!`)}))}).catch(e=>{Ve(!1,`recsys "ignore" failed`,e)})}}))},yQ=`@@router/CALL_HISTORY_METHOD`,bQ=`@@router/LOCATION_CHANGE`,xQ=new Set,SQ=[],CQ=null,wQ=`POP`,TQ=EQ();function EQ(){if(typeof window>`u`)return{pathname:`/`,search:``,hash:``,state:void 0,key:`default`};let e=window.history.state,t=e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`usr`)?e.usr:e,n=e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`key`)?e.key:`default`;return{pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,state:t,key:n}}function DQ(e){if(!e||typeof e==`string`)return e;let{state:t,...n}=e;return n}function OQ(e,t){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`state`)?e.state:t}function kQ(e){return!e||typeof e==`string`?e||`/`:`${e.pathname||TQ.pathname||`/`}${e.search?String(e.search).startsWith(`?`)?e.search:`?${e.search}`:``}${e.hash?String(e.hash).startsWith(`#`)?e.hash:`#${e.hash}`:``}`}function AQ(e,t){for(let n of xQ)n(e,t)}function jQ(e,t){TQ=e,wQ=t,AQ(e,t)}function MQ(e,t){TQ=e,wQ=t}function NQ(e,t){switch(e){case`push`:{if(!CQ){SQ.push({method:e,args:t});return}let[n,r]=t;CQ(DQ(n),{state:OQ(n,r)});break}case`replace`:{if(!CQ){SQ.push({method:e,args:t});return}let[n,r]=t;CQ(DQ(n),{replace:!0,state:OQ(n,r)});break}case`go`:window.history.go(t[0]);break;case`back`:window.history.back();break;case`forward`:window.history.forward();break;default:break}}function PQ(){!CQ||SQ.length===0||SQ.splice(0,SQ.length).forEach(({method:e,args:t})=>NQ(e,t))}function FQ(e){CQ=e,PQ()}function IQ(){CQ=null}var LQ=(e,t)=>NQ(`push`,[e,t]),RQ=()=>NQ(`back`,[]),zQ=(e,t)=>({type:bQ,payload:{action:t,location:e}}),BQ=(e,t)=>(jQ(e,t),zQ(e,t)),VQ={get action(){return wQ},get location(){return TQ},push(e,t){NQ(`push`,[e,t])},replace(e,t){NQ(`replace`,[e,t])},go(e){NQ(`go`,[e])},goBack(){NQ(`back`,[])},goForward(){NQ(`forward`,[])},createHref(e){return kQ(DQ(e))},listen(e){return xQ.add(e),()=>{xQ.delete(e)}},block(){return()=>{}}};function HQ(e={action:VQ.action,location:VQ.location},t){return t.type===bQ?t.payload:e}var UQ=()=>()=>e=>t=>{if(t.type===yQ){let{method:e,args:n}=t.payload;NQ(e,n)}return e(t)};function WQ(e){let t=unescape(encodeURIComponent(e)),n=``;for(let e=0;e<t.length;e++)n+=t.charCodeAt(e).toString(16).padStart(2,`0`);return n}var GQ=tt();
62async function KQ(e,t,n){let r=Lt(t,n),i=Ct(t,r),a=zr(r)||!!r?.value?.fee||Ir(t,n)||!!zn(t,n);if(!r||!i||!a)return;let o=dr(r);if(o)try{let t=await j.channel_sign({channel_id:o,hexdata:WQ(r.claim_id)}),i={key:`signature`,value:t.signature,signature:t.signature,signature_ts:t.signing_ts};return e({type:Ll,data:{uri:n,accessKey:i}}),i}catch{return null}}function qQ(e,t,n,r,i){return a=>{n&&a(rK(i,r)),j.file_delete({outpoint:e,delete_from_download_dir:t}),a({type:Rs,data:{outpoint:e}})}}function JQ(e,t,n,r,i){return(a,o)=>{let s=o(),c=Uq(s),{outpoint:l}=Dq(e)(s)||``,{nout:u,txid:d}=Lt(s,e),f=`${d}:${u}`,p=[];n||p.push(j8()),p.push(qQ(l||f,t,n,e=>{e===`done`&&n&&(r&&RQ(),a(j8()))},i)),c.uri===e&&p.push(r$()),a(_K(...p))}}var YQ=(e,t,n)=>async(r,i)=>{let a=i(),o=kq(a,e),s=Dq(e)(a);if(o&&!n)return;if(s!==void 0&&n!==void 0&&!t?.purchaseAuthorization){n(s);return}let c=un(a,e),l=t&&t.uriAccessKey,u=a.content.uriAccessKeys[e],d=l||u||null;return r({type:mo,data:{outpoint:c}}),d||=await KQ(r,a,e)||null,j.get({uri:e,environment:GQ,...d},t?.purchaseAuthorization).then(t=>{typeof t!=`object`||!t||t.error===`Timeout`?(r({type:Lu,data:{outpoint:c}}),r(N({message:`File timeout for uri ${e}`,isError:!0}))):((t.purchase_receipt||t.content_fee)&&r({type:wi,data:{uri:e,purchaseReceipt:t.purchase_receipt||t.content_fee}}),d&&r({type:Ll,data:{uri:e,accessKey:d}}),r({type:Ns,data:{fileInfo:t,outpoint:c}}),n&&n(t))}).catch(o=>{if(r({type:Ba,data:{uri:e,error:o}}),r({type:Lu,data:{outpoint:c}}),on(a,e)&&o.message===`stream doesn't have source data`||o?.message&&/pending-/.test(o.message))return;let s=Lt(i(),e);if(s?.claim_id?.startsWith(`pending-`)||s?.confirmations===0){let a=[3e3,5e3,8e3,12e3,2e4],o=async s=>{if(s>=a.length)return;await new Promise(e=>setTimeout(e,a[s]));let c=Lt(i(),e);c?.claim_id?.startsWith(`pending-`)||c?.confirmations===0?o(s+1):r(YQ(e,{...t,purchaseAuthorization:void 0},n))};o(0);return}o instanceof tS&&!t?.purchaseAuthorization||r(N({message:D(`Failed to load the file. If problem persists, visit https://help.odysee.tv/ for support.`),...o.message?{subMessage:o.message}:{},isError:!0,duration:`long`}))})};function XQ(e,t,n,r){return(i,a)=>{i({type:Yc,data:{uri:e}});let o=Ye(a()),{cost:s}=t;if(parseFloat(String(s))>o){i({type:Ba,data:{uri:e,error:`Insufficient credits`}}),Promise.resolve();return}return i(YQ(e,{purchaseAuthorization:r},n))}}function ZQ(){return{type:Pc}}var QQ=Me,$Q=`lighthouse-v0`,e$=e=>e?e.map(e=>{try{let{claimId:t}=Ft(e);return t}catch{return[]}}):[],$={entries:{},debug:!1,saveEntries:function(){if(window&&window.store)try{window.store.dispatch({type:lo,data:JSON.parse(JSON.stringify($.entries))})}catch{}},onClickedRecommended:function(e,t){let n=$.entries[e]?$.entries[e]:null,r=n?n.uuid:``,i=n?n.recClaimIds:[],a=n?n.recClickedVideoIdx:[],o=i.indexOf(t);r&&$.createRecsysEntry(t,r),a.push(o),$.log(`onClickedRecommended`,t)},onRecsLoaded:function(e,t,n=``){if(window&&window.store){let r=iQ(window.store.getState(),e);$.entries[e]?$.entries[e].uuid||($.entries[e].uuid=n||r.uuid):$.createRecsysEntry(e,null,n||r.uuid);let i=e$(t);$.entries[e].recsysId=r.poweredBy||$Q,$.entries[e].pageLoadedAt=Date.now(),$.entries[e].recClaimIds=i}$.log(`onRecsLoaded`,e)},createRecsysEntry:function(e,t,n=``){if(window&&window.store&&e){let r=window.store.getState(),i=iQ(r,e),a=Vt(r),o=a?a.id:null;$.entries[e]={uuid:n||i.uuid,claimId:e,recClickedVideoIdx:[],pageLoadedAt:Date.now(),events:[],incognito:!(a&&a.has_verified_email),isFollowing:Nz(r,e)},t?($.entries[e].uid=o||null,$.entries[e].parentUuid=t):($.entries[e].uid=o,$.entries[e].recsysId=null,$.entries[e].recClaimIds=[]),$.saveEntries()}$.log(`createRecsysEntry`,e)},updateRecsysEntry:function(e,t,n){let r=$.entries[e];r&&(r[t]=n)},sendRecsysEntry:function(e,t){if($.entries[e]){let{events:n,...r}=$.entries[e],i=JSON.stringify(r);return fetch(QQ,{method:`POST`,headers:{[id]:_R(),"Content-Type":`application/json`},body:i}).then(()=>{t||(delete $.entries[e],$.saveEntries())}).catch(e=>{console.log(`RECSYS: failed to send entry`,e)})}$.log(`sendRecsysEntry`,e)},sendEntries:function(e,t){if(e){Object.keys($.entries).length!==0&&console.warn(`RECSYS: sendEntries() called on non-empty state. Data will be overwritten.`);try{$.entries=JSON.parse(JSON.stringify(e))}catch{$.entries={}}}
62Object.keys($.entries).forEach(e=>{$.entries[e].isResumedSend=t,$.sendRecsysEntry(e,!1)})},onRecsysPlayerEvent:function(e,t,n){let r=window.store.getState(),i=r&&iu(r,`autoplay_next`);$.entries[e]&&!$.entries[e].autoplay&&(i&&t.event===4?$.entries[e].autoplay=!0:$.entries[e].autoplay=!1),$.entries[e]||$.createRecsysEntry(e),n&&($.entries[e].isEmbed=!0),$.entries[e].events.push(t),$.log(`onRecsysPlayerEvent`,e)},log:function(e,t){$.debug&&console.log(`Call: ***${e}***, ClaimId: ${t}, Recsys Entries`,Object.assign({},$.entries))},onPlayerDispose:function(e,t,n){if(window&&window.store){let r=window.store.getState();(Uq(r)!==Yq(r)||t)&&(t&&($.entries[e].isEmbed=!0),$.entries[e].totalPlayTime=n,$.sendRecsysEntry(e))}$.log(`PlayerDispose`,e)},onNavigate:function(){if(window&&window.store){let e=window.store.getState(),t=Uq(e),n=yr(t&&t.uri||``)(e),r=n?n.claim_id:null,i=iu(e,u);Object.keys($.entries).forEach(e=>{!($.entries[e].parentUuid&&!$.entries[e].recClaimIds)&&(e!==r&&i||!i)&&($.entries[e].pageExitedAt=Date.now(),$.saveEntries()),$.log(`OnNavigate`,e)})}}};VQ.listen(()=>{$.onNavigate()});var t$=$,n$=e=>async(t,n)=>t({type:Sa,data:{uri:e}}),r$=()=>e=>e(c$({uri:null,collection:{}})),i$=()=>e=>e(l$({source:null,sourceId:null,commentId:null,collection:{}})),a$=()=>e=>e(l$({collection:{collectionId:null}})),o$=({source:e})=>(t,n)=>{let r=n(),i=lJ(r);if(Uq(r).source===e&&!i)return iu(r,`floating_player`)?t(i$()):t(r$())},s$=e=>({uri:e?.uri||null,source:e?.source||null,sourceId:e?.sourceId||null,commentId:e?.commentId||null,isShort:typeof e?.isShort==`boolean`?e.isShort:null,location:{pathname:e?.location?.pathname||``,search:e?.location?.search||``},collection:{collectionId:e?.collection?.collectionId||null,loop:!!e?.collection?.loop,shuffle:!!e?.collection?.shuffle}}),c$=e=>async(t,n)=>{let r=Uq(n()),i=e.collection?.collectionId,a=s$(e),o=s$(r);return JSON.stringify(a)===JSON.stringify(o)?Promise.resolve():(i&&i!==`queue`&&e.uri&&t({type:vu,data:{collectionId:i,uri:e.uri}}),t({type:zi,data:e}))},l$=e=>(t,n)=>t(c$({...Uq(n()),...e}));function u$(e,t,n,r){return(i,a)=>{function o(e){n&&n(e)}return i(XQ(e,{cost:t},o,r))}}function d$(e){return t=>t(h$(e,null,!0,()=>t(q8(e))))}var f$=e=>async(t,n)=>{let{uri:r,collection:i}=e;if(!r)return;let a=n(),o=Lt(a,r),s=Wr(a,r),c=vJ(a,r),l=ir(a,r),u=cq(a,r),d=!s&&c&&(!l||u),f=o?{isShort:typeof e.isShort==`boolean`?e.isShort:Nn(o)}:{};if(!d)return;let{collectionId:p}=i||{},m=Gq(a)||{},h=m.collectionId===tn,g=bY(a,tn,r),{search:_}=a.router.location,v=_&&new URLSearchParams(_),y=v&&v.get(`lid`);if(h&&!g){let n=In(a,r);return t(MX(tn,{uris:y?LY(a,y).filter(e=>!bY(a,tn,e)):[n],type:kr.PLAYLIST})),t(l$({...e,collection:m,...f}))}return p&&m.collectionId&&p===m.collectionId?t(l$({...e,collection:{...m,...i},...f})):t(l$({...e,collection:p?i:{},...f}))},p$=({uri:e,collectionId:t,navigateInline:n})=>(r,i)=>{let a=i(),o=lJ(a),s=t||Kq(a),c=s&&bY(a,s,e),l=s===`queue`||iu(a,`floating_player`),u=(n||!t&&!o||!l)&&!!e,d=Jt(e),f=c?Er(s):``;if(u){let t=Lt(a,e),n=c&&s?{...Gq(a),collectionId:s}:{};r(n$(e)),r(c$({uri:e,location:{pathname:d,search:f},collection:n,isShort:t?Nn(t):void 0})),LQ({pathname:d,...c?{search:f,state:{collectionId:s}}:{}})}let p=SJ(a,e),m=ir(a,e),h=cq(a,e),g=p&&(!m||h),_=s&&qY(a,s,e),v=iu(a,fe),y=!_||o||v;if(!g){if(u)return;r(l$({uri:null,collection:{collectionId:c?s:null}})),y&&r(A$({uri:e,show:!0}));return}u||(r(f$({uri:e,...c?{collection:{collectionId:s}}:{}})),y&&r(A$({uri:e,show:!1})))};function m$({uri:e,collectionName:t,collectionId:n,sourceId:r,createNew:i,createCb:a}){return async(o,s)=>{let c=s(),l=!!(n&&e&&bY(c,n,e)),u=n;if(i)o(wX({name:t,items:e?[e]:[],type:kr.PLAYLIST,sourceId:r},e=>{u=e,a&&a(e)}));else if(u&&e)if(u===`queue`){let t=Uq(c),{collectionId:n}=t.collection||{},{permanent_url:r}=Lt(c,t.uri)||{},i=(LY(c,n)||[r]).filter(e=>!!e),a=!!(r&&bY(c,`queue`,r)),s=bY(c,tn,e);if(!await o(MX(`queue`,{uris:r&&r!==e&&!a?[...i,e]:[e],remove:s,type:kr.PLAYLIST})))return}else o(MX(u,{uris:[e],remove:l,type:kr.PLAYLIST}));if(!e&&i)return;let d=Kq(c),f=Uq(c),p=e&&cJ(c,e),m=d&&u&&d===u,h=f.uri&&!p,g=async()=>{let t=s(),n=e&&cJ(t,e),r=u&&CY(t,u)||e;n?o(l$({collection:{collectionId:u}})):r&&(await o($G(r,!1)),o(YQ(r)),o(f$({uri:r,collection:{collectionId:u}})))};if(u===`queue`){let t=s(),n=Uq(t),{permanent_url:r}=Lt(t,n.uri)||{},i=!!(r&&(lJ(t)||Yq(t)===n.uri)),a=!!(r&&bY(t,`queue`,r));if(!l){let t={collection:{collectionId:tn},source:tn};i&&r?a||o(l$({...t})):e&&(await o($G(e,!1)),o(YQ(e)),o(f$({uri:e,...t})))}}else{let n=!!u&&YJ(c,u),r=!!u&&jY(c,u),i;(n||r)&&(i=LY(c,u));let a=()=>
62{let t=s(),n=Uq(t),r=n?.uri?Lt(t,n.uri):void 0;e&&cJ(t,e)&&n?.uri&&Nn(r)&&o(n$(null));let i=`/$/${It}/${u}`;window.location.pathname===i?window.location.reload():LQ(i)};o(N({message:D(l?`Removed from %playlist_name%`:`Added to %playlist_name%`,{playlist_name:t})+(i?.length?` (${l?i.length-1:i.length+1})`:``),actionText:D(m||h||l?`Edit Playlist`:`Start Playing`),action:m||h||l?a:g,secondaryActionText:m||h||l?void 0:D(`Edit Playlist`),secondaryAction:m||h||l?void 0:a}))}}}function h$(e,t=null,n=!1,r,i=!1){return async(n,a)=>{let o=a(),s=Yt(o,e),c=Dq(e)(o),l=Dt(o,e),u=Ut(o,e),d=Je(o,e),f=d&&Number(d.cost),p=Ir(o,e),m=rS(Lt(o,e))&&!p,h={sdk:Dt(o,e),fiat:Hn(o,u),fiat_rent:pt(o,u)};function g(){return n(u$(e,f,r,t))}function _(){if(p&&!s){if(!h.fiat&&!h.fiat_rent)i||n(A8(kd,{uri:e}));else return g();return}if(!s&&!c&&!l)i||n(A8(Ed,{uri:e}));else return g()}return m||t?g():_()}}function g$(e,t){return(n,r)=>{let i=r(),{claim_id:a,txid:o,nout:s}=yr(e)(i);n({type:dc,data:{claimId:a,outpoint:`${o}:${s}`,position:t}})}}function _$(e){return(t,n)=>{let r=n(),{claim_id:i,txid:a,nout:o}=yr(e)(r);t({type:hl,data:{claimId:i,outpoint:`${a}:${o}`}})}}function v$(e){return t=>{t({type:Zs,data:{uri:e,lastViewed:Date.now()}})}}function y$(e){return(t,n)=>{t({type:lu,data:{uri:e}});let r=Ut(n(),e);r&&t(x$(r))}}function b$(){return e=>{e({type:rc})}}function x$(e){return()=>{let t=e?{claim_id:e}:{};return M.call(`user`,`view_history/delete`,t,`post`).catch(e=>{console.error(`Failed to delete remote view history`,e)})}}var S$=200,C$=!1;function w$(){return async(e,t)=>{if(!C$){C$=!0,e({type:Xl});try{let t=[],n=1,r=!0;for(;r;){let e=await M.call(`user`,`view_history`,{page:n,page_size:500},`post`),i=e?.items||(Array.isArray(e)?e:[]);i.length>0?(t=t.concat(i),r=e?.has_more===!0,n+=1):r=!1}if(t.length===0){e({type:Ss,data:{remoteHistory:[],remotePositions:{}}});return}let i=t.map(e=>e.claim_id),a=await e(ZG(i,!0)),o={};a&&Object.values(a).forEach(e=>{let t=e?.stream||e?.channel;t&&t.claim_id&&t.canonical_url&&(o[t.claim_id]=t.canonical_url)});let s=[];for(let e of t){let t=o[e.claim_id];t&&s.push({uri:t,lastViewed:new Date(e.updated_at).getTime()})}let c={};for(let e=0;e<i.length;e+=S$){let t=i.slice(e,e+S$);try{let e=await M.call(`file`,`last_positions`,{claim_ids:t.join(`,`)},`post`);e&&Object.assign(c,e)}catch(e){console.error(`Failed to fetch last positions batch`,e)}}e({type:Ss,data:{remoteHistory:s,remotePositions:c}})}catch(t){console.error(`Failed to fetch remote view history`,t),e({type:yl})}finally{C$=!1}}}}var T$=e=>(t,n)=>{let{collectionId:r,hideToast:i}=e,a=n(),{collection:o}=Uq(a),s=sJ(a,r);if(t(l$({collection:{...o,collectionId:r,loop:!s}})),!i)return t(N({message:D(s?`Loop is off.`:`Loop is on.`)}))},E$=({collectionId:e,currentUri:t})=>async(n,r)=>{await n(kX({collectionId:e}));let i=r(),a=zY(i,e),o=iJ(i,e),s=a.map(e=>({item:e,sort:Math.random()})).sort((e,t)=>e.sort-t.sort).map(({item:e})=>e);t&&(s.splice(s.indexOf(t),1),s.splice(0,0,t));let c={collection:{collectionId:e,shuffle:{newUrls:s}}};o?n(l$(c)):(n(f$({uri:s[0],...c})),LQ({pathname:Jt(s[0]),search:Er(e),state:{collectionId:e,forceAutoplay:!0}}))},D$=({currentUri:e,collectionId:t,hideToast:n})=>(r,i)=>{let a=tJ(i(),t);if(r(a?l$({collection:{collectionId:t,shuffle:void 0}}):E$({collectionId:t,currentUri:e})),!n)return r(N({message:D(a?`Shuffle is off.`:`Shuffle is on.`)}))};function O$(e){return t=>{t({type:Pu,data:e})}}function k$(){return(e,t)=>{let n=Zq(t());n&&t$.sendEntries(n,!0)}}var A$=({uri:e,show:t})=>n=>
62e&&n({type:`CHECK_IF_PURCHASED_FAILED`,data:{uri:e,show:t}});function j$(e){return async(t,n)=>{let r=n(),i=Lt(r,e),a=Ct(r,i),o=zr(i),s=r.content.uriAccessKeys[e];if(s)return s;if(!i)return Ve(!1,`uri not resolved?`,e),null;if(!a||!o)return;let c=i.claim_id,l=dr(i);try{let n=await j.channel_sign({channel_id:l,hexdata:WQ(c)}),r={signature:n.signature,signature_ts:n.signing_ts};return t({type:Ll,data:{uri:e,accessKey:r}}),r}catch{return Ve(!1,`Failed to sign claim id`,e),null}}}var M$=`none`,N$=Object.freeze({FREE:`free`,USDC:`usdc`,FIAT:`fiat`,SDK:`sdk`}),P$=Object.freeze({RECOMMENDED:95e5,MAX:195e5}),F$=Object.freeze({converting:1,optimizing:1,uploading:3}),I$=`file`,L$=`post`,R$=`livestream`,z$=[{value:`Creative Commons Attribution 4.0 International`,url:`https://creativecommons.org/licenses/by/4.0/legalcode`},{value:`Creative Commons Attribution-ShareAlike 4.0 International`,url:`https://creativecommons.org/licenses/by-sa/4.0/legalcode`},{value:`Creative Commons Attribution-NoDerivatives 4.0 International`,url:`https://creativecommons.org/licenses/by-nd/4.0/legalcode`},{value:`Creative Commons Attribution-NonCommercial 4.0 International`,url:`https://creativecommons.org/licenses/by-nc/4.0/legalcode`},{value:`Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International`,url:`https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode`},{value:`Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International`,url:`https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode`}],B$=[{value:`Creative Commons Attribution 3.0`,url:`https://creativecommons.org/licenses/by/3.0/legalcode`}],V$=`None`,H$=`Public Domain`,U$=`other`,W$=`copyright`,G$=`https://thumbs.odycdn.com/upload`,K$=Object.freeze({STATUS:`type`,UPLOADED_URL:`message`,TIMESTAMP:`timestamp`}),q$=Object.freeze({BLOB_KEY:`file-input`,ACTION_KEY:`upload`,ACTION_VAL:`Upload`}),J$=`apiDown`,Y$=`ready`,X$=`inProgress`,Z$=`complete`,Q$=`manual`;function $$(e,t){let n=Number(e),r=Number(t);return n&&r?n*8/r:0}function e1(e,t,n,r,i){let a=(parseFloat(String(t))||0)+(parseFloat(String(n))||0);i({bid:e}),e<=0||isNaN(e)?r(D(`Deposit cannot be 0`)):a<e?r(D(`Deposit cannot be higher than your available balance: %balance%`,{balance:a})):a-e<.0015?r(D(`Please decrease your deposit to account for transaction fees`)):r(e<.001?D(`Your deposit must be higher`):``)}function t1(e,t,n,r,i){let a=[...n];e===0?t===`none`?a=[]:(a[0]=t,a[0]===a[1]&&(a.length=1)):t===`none`||t===a[0]?a.splice(1,1):a[e]=t,r(i?{...i,languages:a}:{languages:a})}function n1(e,t,n,r,i){let{type:a,liveCreateType:o,liveEditType:s,name:c,bid:l,filePath:u,description:d,language:f,releaseTime:p,licenseUrl:m,licenseType:h,otherLicenseDescription:g,thumbnail:_,channel:v,title:y,paywall:b,fee:x,tags:S,optimize:C,remoteFileUrl:ee}=e,w=t&&t.name===c?t:null,te;switch(h){case W$:case U$:te=g;break;default:te=h}let ne=n?n.find(e=>e.name===v):null,re=ne?ne.claim_id:``,ie=Number(Math.round(Date.now()/1e3)),{claim_id:ae}=t||{},T={name:c,title:y,description:d,locations:[],bid:mC(l),languages:[f],thumbnail_url:_,release_time:r1.releaseTime(ie,p,w,e)||ie,blocking:!0,preview:!1,...ae?{claim_id:ae}:{},...C?{optimize_file:!0}:{},..._?{thumbnail_url:_}:{},...re?{channel_id:re}:{},...m?{license_url:m}:{},...te?{license:te}:{}},oe=new Set(S.map(e=>e.name));return r1.tags.useLbryUploader(oe,e),r1.tags.scheduledLivestream(oe,e,T.release_time,ie),r1.tags.fiatPaywall(oe,e),r1.tags.membershipRestrictions(oe,T.channel_id,r),r1.tags.visibility(oe,e),T.tags=Array.from(oe),w&&w.value&&w.value.locations&&(T.locations=w.value.locations),b===N$.SDK&&e.visibility===`public`&&x&&x.currency&&Number(x.amount)>0&&(T.fee_currency=x.currency,T.fee_amount=mC(x.amount)),u&&(a!==`livestream`||a===`livestream`&&o===`edit_placeholder`&&s===`upload_replay`)&&(T.file_path=u),ee&&a===`livestream`&&(o===`choose_replay`||o===`edit_placeholder`&&s===`use_replay`)&&(T.remote_url=ee),i&&(T.preview=!0,T.optimize_file=!1),T}var r1={releaseTime:(e,t,n,r)=>{let i=!!n,{liveEditType:a}=r,o=2147483647,s={};if(i&&n){let e=n.value?.tags||[];s.wasHidden=e.includes(At.UNLISTED)||e.includes(At.PRIVATE),s.wasScheduled=e.includes(_r.SHOW)||e.includes(_r.HIDE),s.timestamp=n.timestamp,s.release_time=n.value?.release_time,s.creation_timestamp=n.meta?.creation_timestamp,s.isStreamPlaceholder=Fr(n)}switch(r.visibility){case`public`:case`private`:case`unlisted`:if(i){if(s.isStreamPlaceholder)if(Ve(a===`use_replay`||a===`upload_replay`||a===`update_only`),a===`use_replay`||a===`upload_replay`){let t=Number(s.release_time||s.timestamp);return t>e?e:t}else return t===void 0?e:t;return t===void 0?Number(s.release_time)===o&&r.visibility!==`unlisted`?s.creation_timestamp||e:s.wasScheduled?s.creation_timestamp:Number(s.release_time||s.timestamp):t}else return r.visibility===`unlisted`?o:t===void 0?e:t;case`scheduled`:return i?t===void 0?s.wasHidden?s.creation_timestamp:Number(s.release_time||s.timestamp):t:(Ve(t,`New scheduled publish cannot have undefined release time`),t);default:Ve(!1,`unhandled: "${r.visibility}"`);break}},tags:{useLbryUploader:(e,t)=>{t.useLBRYUploader&&e.add(Zt)},scheduledLivestream:(e,t,n,r)=>{let{type:i,liveCreateType:a,liveEditType:o}=t;i===`livestream`&&(a===`new_placeholder`||a===`edit_placeholder`&&o===`update_only`)&&n&&n>r?e.add(jt):e.delete(jt)},fiatPaywall:(e,t)=>
62{let{paywall:n,fiatPurchaseEnabled:r,fiatPurchaseFee:i,fiatRentalEnabled:a,fiatRentalFee:o,fiatRentalExpiration:s,visibility:c}=t;if(new Set(e).forEach(t=>{(t===`c:rental`||t===`c:purchase`||t.startsWith(`c:rental:`)||t.startsWith(`c:purchase:`)||t.startsWith(`rental:`)||t.startsWith(`purchase:`))&&e.delete(t)}),c===`public`&&n===N$.FIAT&&(r&&i?.currency&&Number(i.amount)>0&&(e.add(St),e.add(`${St}:${i.amount.toFixed(2)}`)),a&&o?.currency&&Number(o.amount)>0&&s?.unit&&Number(s.value)>0)){let t=s.value*(Gr[s.unit]||3600);e.add(gn),e.add(`${gn}:${o.amount.toFixed(2)}:${t}`)}},membershipRestrictions:(e,t,n)=>{e.delete(nt),t&&n.isRestricting&&e.add(nt),Ve(!n.isApplicable||n.isSelectionValid,`Trying to publish an invalid Tier Restriction selection`)},visibility:(e,t)=>{let{visibility:n}=t;switch(e.delete(At.PRIVATE),e.delete(At.UNLISTED),e.delete(_r.SHOW),e.delete(_r.HIDE),n){case`public`:break;case`private`:e.add(At.PRIVATE);break;case`unlisted`:e.add(At.UNLISTED);break;case`scheduled`:e.add(t.scheduledShow?_r.SHOW:_r.HIDE);break;default:Ve(!1,`unhandled: "${n}"`);break}}}},i1=Object.freeze({file:Fn,post:pn,livestream:st});function a1(e){if(!e)return`undefined_claim`;switch(e.value_type){case`stream`:return e.value?e.value.source?e.value.stream_type:`livestream`:`stream`;default:return e.value_type}}var o1=(e,t)=>(n,r)=>{let i=(e,t)=>{n(A8(Nd,{publishPayload:e,previewResponse:t}))},a=!e||e===`---`,o=r(),s=$Y(o,`editingURI`)||``,c=$Y(o,`remoteFileUrl`),{memberRestrictionTierIds:l,name:u}=o.publish,d=aX(o),f=yr(s)(o)||{},p=f.value&&f.value.source,m=a&&!p&&!c,h=(t,i)=>{let a=mn(r()),o=t.outputs[0];Qx.apiLog.publish(o,e=>{let t=dr(e);if(t){let r=d.isRestricting?l:[];n(WG(t,e.claim_id,u,r,void 0))}});let{permanent_url:s}=o,c=[];c.push({type:hi,data:{type:a1(o)}});let f=a.some(e=>e.claim_id===o.claim_id);c.push({type:ci,data:{claims:[o],options:{overrideTags:!0,overrideSigningChannel:!0}}}),n(_K(...c)),n(A8(Md,{uri:s,isEdit:f,filePath:e,lbryFirstError:i})),n(mK(void 0)),m&&(n(u1()),LQ(`/$/${st}`))},g=e=>{let t=[];t.push({type:Ec});let r=typeof e==`string`?e:e.message;r.endsWith(`Your action timed out, but may have been completed.`)&&(r=Bf,d.isRestricting&&(r=Uf)),t.push(XS({message:r,cause:e.cause})),n(_K(...t))};if(t){n(D1(h,g,i));return}m||LQ(`/$/${or}`),n(D1(h,g))},s1=e=>(t,n)=>{t(D1((e,r)=>{let i=n(),a=ht(i),o=e.outputs[0],{permanent_url:s}=o,{memberRestrictionTierIds:c,name:l}=i.publish,u=aX(i);Qx.apiLog.publish(o,e=>{let n=dr(e);if(n){let r=u.isRestricting?c:[];t(WG(n,e.claim_id,l,r,void 0))}});let d=a.has(o.claim_id),f=[];f.push({type:hi,data:{type:a1(o)}}),f.push({type:ci,data:{claims:[o]}}),t(_K(...f)),t(A8(Md,{uri:s,isEdit:d,lbryFirstError:r})),t(mK(void 0))},e=>{let n=[];n.push({type:Ec}),n.push(XS({message:e.message,cause:e.cause})),t(_K(...n))},void 0,e))},c1=()=>e=>(e({type:Bo,data:{thumbnailPath:``,thumbnailError:void 0}}),e({type:Bo,data:{uploadThumbnailStatus:Y$,thumbnail:``,thumbnailIsUserChosen:!1}})),l1=(e,t=``,n=``)=>(r,i)=>{Ve(i1[e],`invalid type`,e);let a=i(),o=a.publish.type,s=a.publish.activeFormId;o===e&&s||(s&&r({type:`PUBLISH_SAVE_FORM`,data:{id:s}}),r(u1()),r(_K({type:`PUBLISH_SET_ACTIVE_FORM`,data:{id:null}},{type:Bo,data:{type:e}}))),t&&r({type:Bo,data:{name:t}}),LQ(n||`/$/${i1[e]||i1.file}`)},u1=()=>(e,t)=>{let n=t(),r=Bn(kc(n)?.permanent_url,`languages`)(n);return e({type:Wl,data:{language:r?r[0]:null}}),e(c1())},d1=(e,t)=>n=>{t&&n({type:Fs,data:{id:t}}),n({type:Ju,data:{id:e}})},f1=e=>t=>t({type:Bo,data:{...e}}),p1=(e,t)=>(n,r)=>{let{name:i,claimToEdit:a}=r().publish,o=/[ =&#:$@%?;/\\\n"<>%{}|^~[\]`\u{0000}-\u{0008}\u{000b}-\u{000c}\u{000e}-\u{001F}\u{D800}-\u{DFFF}\u{FFFE}-\u{FFFF}]/gu,s={name:i,title:e},c=e.replace(o,`-`);!a&&!t&&(c.startsWith(i)||c===i.slice(0,-1)||!e||!i)&&(s.name=c),n({type:Bo,data:{...s}})};function m1(e,t,n){window.URL=window.URL||window.webkitURL;let r=document.createElement(`video`),i=window.URL.createObjectURL(e),a=()=>{window.URL.revokeObjectURL(i),r.removeAttribute(`src`),r.load()};r.preload=`metadata`,r.addEventListener(`loadedmetadata`,()=>{if(!n()){a();return}t({type:Bo,data:{fileDur:r.duration,fileBitrate:$$(e.size,r.duration)}}),a()}),r.addEventListener(`error`,()=>{if(!n()){a();return}t({type:Bo,data:{fileDur:0,fileBitrate:0}}),a()}),r.src=i}var h1=(e,t=!0)=>(n,r)=>{let i=r(),{name:a,title:o,type:s,liveCreateType:c,liveEditType:l,editingURI:u}=i.publish,d=ZY(i),f=s===`livestream`&&!!u&&c===`edit_placeholder`&&l===`upload_replay`;if(!e){n(d||!t?{type:Bo,data:{filePath:``,fileDur:0,fileBitrate:0,fileVideoCodec:``,fileAudioCodec:``,fileFormat:``,fileWidth:0,fileHeight:0,fileFps:0,fileNeedsTransmux:!1,fileText:void 0}}:{type:Bo,data:{filePath:``,name:``,fileDur:0,fileBitrate:0,fileVideoCodec:``,fileAudioCodec:``,fileFormat:``,fileWidth:0,fileHeight:0,fileFps:0,fileNeedsTransmux:!1,fileText:void 0}});return}Ve(typeof e!=`string`);let p=e.path||e,m=()=>$Y(r(),`filePath`)===p,h=e.type&&e.type.split(`/`),g=h?h[0]===`video`:!1,_=h?h[1]===`mp4`:!1,v=!1;if(h&&h[0]===`text`)v=h[1]===`plain`||h[1]===`markdown`;else if(e.name){let t=e.name.split(`.`).pop();v=[`txt`,`md`,`markdown`].includes(t)}let y=e.name?.toLowerCase().split(`.`).pop()||``,b=y===`mp4`||y===`mov`||y===`m4v`,x={fileSize:e.size,fileMime:e.type,fileVid:g,fileDur:0,fileBitrate:0,fileVideoCodec:``,fileAudioCodec:``,fileFormat:y,fileWidth:0,fileHeight:0,fileFps:0,fileNeedsTransmux:g&&!b,fileSizeTooBig:!1,fileText:void 0};if(g||h&&h[0]===`audio`)qe(()=>import(`./src-Dr1ZI6FQ.js`).then(async t=>{let r;try{r=new t.Input({formats:t.ALL_FORMATS,source:new t.BlobSource(e)});let i=await r.computeDuration()||0,a=await r.getPrimaryVideoTrack(),o=await r.getPrimaryAudioTrack(),s={fileDur:i,fileBitrate:i>0?e.size*8/i:0};if(a){let e=await a.computePacketStats(120);s.fileVideoCodec=a.codec||``,s.fileWidth=a.displayWidth||0,s.fileHeight=a.displayHeight||0,s.fileFps=e.averagePacketRate||0}o&&(s.fileAudioCodec=o.codec||``),s.fileFormat=b?`mp4`:y,s.fileNeedsTransmux=g&&!b,m()&&n({type:Bo,data:s})}catch(t){console.warn(`[Publish] MediaBunny metadata extraction failed, falling back:`,t),_&&m1(e,n,m)}finally{r&&r.dispose()}}),__vite__mapDeps([11,1,12,4,13,7])).catch(()=>{_&&m1(e,n,m)});else if(x.fileDur=0,v){let t=new FileReader;t.addEventListener(`load`,e=>{if(e.target instanceof FileReader){let t=e.target.result;n({type:Bo,data:{fileText:t}})}}),t.readAsText(e)}let S=Fe*1073741824;e.size&&Number(e.size)>S&&(x.fileSizeTooBig=!0);let C=e.name&&e.name.substr(0,e.name.lastIndexOf(`.`))||``,ee=t?C:a||C;!f&&(t||!o)&&(x.title=C||ee),!f&&!d&&t?x.name=Kr(C||ee):!f&&!d&&!a&&(x.name=Kr(ee)),x.filePath=p,n({type:Bo,data:x})},g1=(e,t,n,r,i,a)=>o=>{let s,c,l,u,d,f,p=(e=``)=>{o(_K({type:Bo,data:{uploadThumbnailStatus:Y$,thumbnail:``,nsfw:!1}},XS(e)))};o({type:Bo,data:{thumbnailError:void 0}});let m=e=>fetch(G$,{method:`POST`,body:e}).then(e=>e.text()).then(e=>{try{return e.length?JSON.parse(e):{}}catch{throw Error(e)}}).then(e=>e.type===`success`?(a&&a(e.message),o({type:Bo,data:{uploadThumbnailStatus:Z$,thumbnail:e.message}})):p(e.message||D(`There was an error in the upload. The format or extension might not be supported.`))).catch(e=>{let t=e.message;t===`Failed to fetch`&&(t=D(`Thumbnail upload service may be down, try again later. Some plugins like AdGuard Français may be blocking the service. If using Brave, go to brave://a
62dblock and disable it, or turn down shields.`)),p({message:t,cause:[l,c,u,s,f].join(` | `)})});if(o({type:Bo,data:{uploadThumbnailStatus:X$}}),n&&n.readFile&&e)n.readFile(e,`base64`).then(t=>{c=`png`,l=`thumbnail.png`,u=`image/png`;let n=new FormData;return n.append(`file-input`,{uri:`file://`+e,type:u,name:l}),n.append(`upload`,`Upload`),m(n)});else{if(e&&r&&i)s=r.readFileSync(e),c=i.extname(e),l=i.basename(e),d=r.statSync(e),f=d.size,u=`image/${c.slice(1)}`;else if(t)c=`.${t.type&&t.type.split(`/`)[1]}`,l=t.name,u=t.type,f=t.size;else return null;if(f&&f>=Be){p(D(`Thumbnail size over %max_size%MB, please edit and reupload.`,{max_size:Be/(1024*1024)}));return}let n=new FormData,a=t||s&&new File([s],l,{type:u});return n.append(`file-input`,a),n.append(`upload`,`Upload`),m(n)}},_1=(e,t,n)=>(Ve(e,`doPrepareEdit: claim must not be null`,{uri:t,claimType:n}),async(n,r)=>{let{name:i,amount:a,value:o={}}=e,s=e&&e.signing_channel&&e.signing_channel.name||null,c=e&&e.signing_channel&&e.signing_channel.claim_id||null,{author:l,description:u,fee:d={amount:`0`,currency:`LBC`},languages:f,license:p,license_url:m,thumbnail:h,title:g,tags:_,stream_type:v}=o,y=r(),b=gJ(e?.permanent_url)(y)===`md`,x=Fr(e),S=x?R$:b?L$:I$,C=x?`edit_placeholder`:void 0,ee=x?`update_only`:void 0,w={type:S,...C?{liveCreateType:C}:{},...ee?{liveEditType:ee}:{},claim_id:e.claim_id,name:i,bid:Number(a),author:l,description:u,fee:{amount:Number(d.amount),currency:d.currency},languages:f,thumbnail:h?h.url:null,title:g,uri:t,uploadThumbnailStatus:h?Q$:void 0,licenseUrl:m,nsfw:Dn(e),tags:_?_.map(e=>({name:e})):[],streamType:v,claimToEdit:{...e}};z$.some(({value:e})=>e===p)?w.licenseType=p:(!p||p===`None`||p===`Public Domain`?w.licenseType=p:p&&!m&&p!==`None`?w.licenseType=W$:w.licenseType=U$,w.otherLicenseDescription=p),s&&(w.channel=s),c&&(w.channelId=c);let te=xt(_),ne=fn(_);if(te||ne?w.paywall=N$.FIAT:d.amount&&Number(d.amount)>0?w.paywall=N$.SDK:w.paywall=N$.FREE,te&&(w.fiatRentalEnabled=!0,w.fiatRentalFee={amount:te.price,currency:`USD`},w.fiatRentalExpiration={value:te.expirationTimeInSeconds/Gr.days,unit:`days`}),ne&&(w.fiatPurchaseEnabled=!0,w.fiatPurchaseFee={amount:ne,currency:`USD`}),new Set(w.tags&&w.tags.map(e=>e.name)).has(`c:members-only`))if(c){let t=eW(y,e.claim_id);t===void 0&&(await n(UG(e.claim_id)),y=r(),t=eW(y,e.claim_id)),t&&t.length>0?(w.memberRestrictionOn=!0,w.memberRestrictionTierIds=t):(w.memberRestrictionOn=!1,w.memberRestrictionTierIds=[])}else w.tags?w.tags=w.tags.filter(e=>e.name===nt):w.tags=[];_?_.includes(At.UNLISTED)?w.visibility=`unlisted`:_.includes(At.PRIVATE)?w.visibility=`private`:_.includes(_r.HIDE)?(w.visibility=`scheduled`,w.scheduledShow=!1):_.includes(_r.SHOW)?(w.visibility=`scheduled`,w.scheduledShow=!0):w.visibility=`public`:w.visibility=`public`,w.channelId?(n(a5(w.channelId,!1)),n(o5(!1))):n(o5(!0)),n({type:ps,data:w}),LQ(`/$/${i1[S]}`)}),v1=100,y1=24;function b1(e){return[...e].sort((e,t)=>{let n=Number(e?.value?.release_time||e?.meta?.creation_timestamp||0);return Number(t?.value?.release_time||t?.meta?.creation_timestamp||0)-n})}function x1(e){return(e&&e.items||[]).filter(e=>e&&e.value_type===`stream`)}function S1(e,t){let n=t.toLowerCase();return e.filter(e=>(e?.value?.title||e?.name||``).toLowerCase().includes(n))}function C1(e){if(!e||typeof e!=`object`)return null;let t=e.claimId||e.claim_id||e.claimID||e.claimid||e.id;return t&&String(t).trim()||null}async function w1(e,t){if(!Array.isArray(t)||t.length===0)return[];let n=[...new Set(t.map(e=>e?.claim_id).filter(Boolean))];if(n.length===0)return t;try{let r=await e(ZG(n,!0));if(!r||typeof r!=`object`)return t;let i={};return Object.values(r).forEach(e=>{let t=e&&typeof e==`object`?e.stream:null;t&&t.claim_id&&t.value_type===`stream`&&(i[t.claim_id]=t)}),t.map(e=>i[e.claim_id]||e)}catch{return t}}var T1=(e=``,t=`all`)=>async(n,r)=>{let i=e.trim(),a=r(),o=Wu(a),s=Et(a)||[];if(t===`unlisted`){let e={page:1,page_size:v1,any_tags:[At.UNLISTED],claim_type:[`stream`],order_by:[`release_time`],remove_duplicates:!0};s.length>0&&(e.channel_ids=s);let t=await w1(n,b1(x1(await j.claim_search(e))));return{claims:i.length>0?S1(t,i):t}}if(t===`scheduled`){let e={page:1,page_size:v1,any_tags:Object.values(_r),claim_type:[`stream`],order_by:[`release_time`],remove_duplicates:!0};s.length>0&&(e.channel_ids=s);let t=await w1(n,b1(x1(await j.claim_search(e))));return{claims:i.length>0?S1(t,i):t}}if(i.length<3)return{claims:await w1(n,b1(x1(await j.claim_list({page:1,page_size:v1,resolve:!0,claim_type:[`stream`]}))))};if(s.length===0)return{claims:await w1(n,S1(b1(x1(await j.claim_list({page:1,page_size:v1,resolve:!0,claim_type:[`stream`]}))),i))};let c=s.join(`,`),l=`from=0&s=${encodeURIComponent(i)}&sort_by=release_time&nsfw=${o?`true`:`false`}&size=${y1}`,u=await lQ.search(`${l}&channel_id=${encodeURIComponent(c)}`),d=[];
62Array.isArray(u?.body)&&u.body.forEach(e=>{let t=C1(e);t&&d.push(t)});let f=[...new Set(d)],p=f.length>0?await n(ZG(f,!0)):{},m=[];return p&&typeof p==`object`&&Object.values(p).forEach(e=>{let t=e&&typeof e==`object`?e.stream:null;t&&t.claim_id&&t.value_type===`stream`&&m.push(t)}),{claims:b1(m)}},E1=(e,t)=>async(n,r)=>{if(!e)return;let{value:i={}}=e,{description:a,fee:o={amount:0,currency:`LBC`},languages:s,license:c,license_url:l,thumbnail:u,title:d,tags:f}=i,p=r(),m={},h=new Set(t),g=f||[],_={amount:Number(o.amount)||0,currency:o.currency||`LBC`};if(h.has(`title`)&&(m.title=d||``),h.has(`description`)&&(m.description=a||``),h.has(`tags`)&&(m.tags=g.filter(e=>e!==At.UNLISTED&&e!==At.PRIVATE&&e!==_r.HIDE&&e!==_r.SHOW&&e!==`c:members-only`).map(e=>({name:e})),m.nsfw=Dn(e)),h.has(`thumbnail`)){let e=u?.url||``;m.thumbnail=e,m.uploadThumbnailStatus=e?Q$:Y$}if(h.has(`languages`)){let e=s||[];m.languages=e,m.language=e[0]||``}if(h.has(`license`)&&(m.licenseType=V$,m.licenseUrl=``,m.otherLicenseDescription=``,c&&(z$.some(({value:e})=>e===c)||c===`None`||c===`Public Domain`?m.licenseType=c:l?(m.licenseType=U$,m.otherLicenseDescription=c):(m.licenseType=W$,m.otherLicenseDescription=c),l&&(m.licenseUrl=l))),h.has(`visibility`)&&(g.includes(At.UNLISTED)?m.visibility=`unlisted`:g.includes(At.PRIVATE)?m.visibility=`private`:m.visibility=`public`,m.memberRestrictionOn=!1,m.memberRestrictionTierIds=[]),h.has(`price`)){m.paywall=N$.FREE,m.fiatPurchaseEnabled=!1,m.fiatRentalEnabled=!1;let e=xt(g),t=fn(g);e||t?m.paywall=N$.FIAT:_.amount>0?(m.paywall=N$.SDK,m.fee=_):m.paywall=N$.FREE,e&&(m.fiatRentalEnabled=!0,m.fiatRentalFee={amount:e.price,currency:`USD`},m.fiatRentalExpiration={value:e.expirationTimeInSeconds/Gr.days,unit:`days`}),t&&(m.fiatPurchaseEnabled=!0,m.fiatPurchaseFee={amount:t,currency:`USD`})}if(h.has(`visibility`)&&g.includes(`c:members-only`)){let t=e.signing_channel?.claim_id||null,i=p.publish.channelId;if(t&&t===i){let t=eW(p,e.claim_id);t===void 0&&(await n(UG(e.claim_id)),p=r(),t=eW(p,e.claim_id)),t&&t.length>0&&(m.memberRestrictionOn=!0,m.memberRestrictionTierIds=t)}}n(f1(m))},D1=(e,t,n,r)=>(i,a)=>{n||i({type:_o});let o=a(),s=o.publish.claimToEdit,c=Qt(o),l=QY(o),{memberRestrictionTierIds:u,name:d}=l,f=aX(o),p=r||n1(l,s,c,f,!!n),{channel_id:m}=p,h=s?.claim_id||``;return m&&!n&&i(WG(m,h,d,f.isRestricting?u:[],h?void 0:!0)),n?n(p,null):j.publish(p).then(t=>e(t),t)},O1=e=>async(t,n)=>{let{createClaim:r}=await qe(async()=>{let{createClaim:e}=await import(`./publish-v4-tasks-8zUK5ZTC.js`);return{createClaim:e}},__vite__mapDeps([14,1,2,15,16,7])),i=n(),a=QY(i),o=i.publish.claimToEdit,{uploadUrl:s,guid:c,remote_url:l,publishId:u,...d}=n1(a,o,Qt(i),aX(i),!1),f=j.getApiRequestHeaders();return r(f&&Object.keys(f).includes(`X-Lbry-Auth-Token`)?f[id]:``,e,{...d,_defer:!0},{onSuccess:()=>{},onFailure:()=>{}})},k1=(e,t)=>async(n,r)=>{let i=r(),a=i.publish.claimToEdit,o=Qt(i),s=QY(i),c=aX(i);n({type:_o}),LQ(`/$/${or}`);try{let{tusUrl:r}=await e;n({type:Eu,data:{id:t,updates:{stage:`processing`,progress:0}}});let{memberRestrictionTierIds:i,name:l}=s,u=n1(s,a,o,c,!1),{channel_id:d}=u,f=a?.claim_id||``;d&&n(WG(d,f,l,c.isRestricting?i:[],f?void 0:!0));let{createClaim:p}=await qe(async()=>{let{createClaim:e}=await import(`./publish-v4-tasks-8zUK5ZTC.js`);return{createClaim:e}},__vite__mapDeps([14,1,2,15,16,7])),{pollPublishStatus:m}=await qe(async()=>{let{pollPublishStatus:e}=await import(`./publish-v4-B0_xRv25.js`);return{pollPublishStatus:e}},__vite__mapDeps([17,1,2,3,4,5,6,15,16,7,8,9,10])),h=j.getApiRequestHeaders()&&Object.keys(j.getApiRequestHeaders()).includes(`X-Lbry-Auth-Token`)?j.getApiRequestHeaders()[id]:``,{uploadUrl:g,guid:_,remote_url:v,publishId:y,...b}=u,x=await p(h,r,b,{onSuccess:()=>{},onFailure:()=>{}}),S=o?.find(e=>e.claim_id===d),C=S?.short_url||S?.canonical_url||S?.permanent_url,ee=C?`${C}/${s.name}`:tr({streamName:s.name,channelName:s.channel},!0),w=!!s.fileMime&&s.fileMime.startsWith(`audio/`),te=s.fileMime||(s.fileVid?`video/mp4`:void 0),ne=s.fileVid?s.fileDur?{video:{duration:s.fileDur}}:{}:w&&s.fileDur?{audio:{duration:s.fileDur}}:{},re=`pending-${t}`;
62n({type:ci,data:{claims:[{claim_id:re,name:s.name,permanent_url:ee,canonical_url:ee,short_url:ee,type:`claim`,value_type:`stream`,confirmations:0,is_channel_signature_valid:!!S,value:{title:s.title,description:s.description,thumbnail:{url:s.thumbnail},tags:s.tags?.map(e=>e.name)||[],source:te?{media_type:te}:void 0,...ne},signing_channel:S?{claim_id:S.claim_id,name:S.name,permanent_url:S.permanent_url,canonical_url:S.canonical_url,value:S.value}:void 0,txid:re,nout:0,meta:{effective_amount:`0`},timestamp:Math.floor(Date.now()/1e3)}],options:{overrideTags:!0,overrideSigningChannel:!0}}}),n({type:zu,data:{id:null}}),n({type:hi,data:{}}),m(h,x,t,n).then(e=>{let r=e.outputs[0];n({type:Qi,data:{claimId:re}}),n({type:ci,data:{claims:[r],options:{overrideTags:!0,overrideSigningChannel:!0}}}),n({type:Eu,data:{id:t,updates:{stage:`published`,progress:100,uri:r.permanent_url||ee}}}),n(mK(void 0))}).catch(e=>{n({type:Qi,data:{claimId:re}}),n({type:Eu,data:{id:t,updates:{stage:`error`,error:e?.message||`Publish confirmation failed. Your upload may have been blocked by a browser extension.`}}}),n(N({isError:!0,message:D(`Publish failed.`),subMessage:e?.message||D(`Confirmation timed out. A browser extension may be blocking the request.`),duration:`long`}))})}catch(e){n({type:Ec}),n({type:Qi,data:{claimId:`pending-${t}`}}),n({type:Eu,data:{id:t,updates:{stage:`error`,error:e?.message}}}),n(XS({message:typeof e==`string`?e:e.message,cause:e.cause}))}},A1=()=>(e,t)=>{let{checkingReflector:n}=t().claims,r,i=async()=>{let n=Kn(t()),i=Object.keys(n),a={},o=[];Object.keys(n).length?(i.forEach(e=>{o.push(j.file_list({claim_id:e}))}),Promise.all(o).then(e=>{e.forEach(e=>{if(e.items[0]){let t=e.items[0],n=t.claim_id,{is_fully_reflected:r,uploading_to_reflector:i,reflector_progress:o}=t;i&&(a[n]={fileListItem:t,progress:o,stalled:!r&&!i})}})}).then(()=>{e({type:oo,data:a}),Object.keys(a).length||(e({type:Co,data:!1}),clearInterval(r))})):(e({type:Co,data:!1}),clearInterval(r))};i(),n||(e({type:Co,data:!0}),r=setInterval(()=>{i()},5e3))};function j1(e,t,n,r){return(i,a)=>{i({type:Ko,data:{file:e,params:t,uploader:n,backend:r}})}}var M1=e=>t=>t({type:Ui,data:e});function N1(e,t){return(n,r)=>{let i=r().publish.currentUploads?.[e];if(i?.file){let e=i.file,t=typeof e==`string`?e:e.name,n=typeof e==`object`&&`size`in e?e.size:0;qe(async()=>{let{removeCachedFile:e}=await import(`./uploadCache-DwKdMhmg.js`);return{removeCachedFile:e}},__vite__mapDeps([18,1,7,19])).then(({removeCachedFile:e})=>{e(`optimized-${t}-${n}`).catch(()=>{}),e(`converted-${t}-${n}`).catch(()=>{})}).catch(()=>{})}n({type:ha,data:{guid:e,params:t}})}}var P1=()=>void 0,F1=function(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},I1=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){let a=e[n++];t[r++]=String.fromCharCode((i&31)<<6|a&63)}else if(i>239&&i<365){let a=e[n++],o=e[n++],s=e[n++],c=((i&7)<<18|(a&63)<<12|(o&63)<<6|s&63)-65536;t[r++]=String.fromCharCode(55296+(c>>10)),t[r++]=String.fromCharCode(56320+(c&1023))}else{let a=e[n++],o=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(a&63)<<6|o&63)}}return t.join(``)},L1={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`,get ENCODED_VALS(){return this.ENCODED_VALS_BASE+`+/=`},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+`-_.`},HAS_NATIVE_SUPPORT:typeof atob==`function`,encodeByteArray(e,t){if(!Array.isArray(e))throw Error(`encodeByteArray takes an array as a parameter`);this.init_();let n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){let i=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,c=s?e[t+2]:0,l=i>>2,u=(i&3)<<4|o>>4,d=(o&15)<<2|c>>6,f=c&63;s||(f=64,a||(d=64)),r.push(n[l],n[u],n[d],n[f])}return r.join(``)},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(F1(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):I1(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){let i=n[e.charAt(t++)],a=t<e.length?n[e.charAt(t)]:0;++t;let o=t<e.length?n[e.charAt(t)]:64;++t;let s=t<e.length?n[e.charAt(t)]:64;if(++t,i==null||a==null||o==null||s==null)throw new R1;let c=i<<2|a>>4;if(r.push(c),o!==64){let e=a<<4&240|o>>2;if(r.push(e),s!==64){let e=o<<6&192|s;
vendor: 22,218 bytes, line 62
62r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},R1=class extends Error{constructor(){super(...arguments),this.name=`DecodeBase64StringError`}},z1=function(e){let t=F1(e);return L1.encodeByteArray(t,!0)},B1=function(e){return z1(e).replace(/\./g,``)},V1=function(e){try{return L1.decodeString(e,!0)}catch(e){console.error(`base64Decode failed: `,e)}return null};function H1(){if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof globalThis<`u`)return globalThis;throw Error(`Unable to locate global object.`)}var U1=()=>H1().__FIREBASE_DEFAULTS__,W1=()=>{if(typeof process>`u`)return;let e={}.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},G1=()=>{if(typeof document>`u`)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let t=e&&V1(e[1]);return t&&JSON.parse(t)},K1=()=>{try{return P1()||U1()||W1()||G1()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},q1=()=>K1()?.config,J1=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),typeof e==`function`&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,n))}}};function Y1(){try{return typeof indexedDB==`object`}catch{return!1}}function X1(){return new Promise((e,t)=>{try{let n=!0,r=`validate-browser-context-for-indexeddb-analytics-module`,i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{t(i.error?.message||``)}}catch(e){t(e)}})}function Z1(){return!(typeof navigator>`u`||!navigator.cookieEnabled)}var Q1=`FirebaseError`,$1=class e extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=Q1,Object.setPrototypeOf(this,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,e0.prototype.create)}},e0=class{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){let n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],a=i?t0(i,n):`Error`;return new $1(r,`${this.serviceName}: ${a} (${r}).`,n)}};function t0(e,t){return e.replace(n0,(e,n)=>{let r=t[n];return r==null?`<${n}?>`:String(r)})}var n0=/\{\$([^}]+)}/g;function r0(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);for(let i of n){if(!r.includes(i))return!1;let n=e[i],a=t[i];if(i0(n)&&i0(a)){if(!r0(n,a))return!1}else if(n!==a)return!1}for(let e of r)if(!n.includes(e))return!1;return!0}function i0(e){return typeof e==`object`&&!!e}function a0(e){return e&&e._delegate?e._delegate:e}var o0=class{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode=`LAZY`,this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}},s0=`[DEFAULT]`,c0=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new J1;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){let t=this.normalizeInstanceIdentifier(e?.identifier),n=e?.optional??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}else if(n)return null;else throw Error(`Service ${this.name} is not available`)}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(u0(e))try{this.getOrInitializeService({instanceIdentifier:s0})}catch{}for(let[e,t]of this.instancesDeferred.entries()){let n=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch{}}}}clearInstance(e=s0){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>`INTERNAL`in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>`_delete`in e).map(e=>e._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=s0){return this.instances.has(e)}getOptions(e=s0){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(let[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){let n=this.normalizeInstanceIdentifier(t),r=this.onInitCallbacks.get(n)??new Set;r.add(e),this.onInitCallbacks.set(n,r);let i=this.instances.get(n);return i&&e(i,n),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){let n=this.onInitCallbacks.get(t);if(n)for(let r of n)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:l0(e),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=s0){return this.component?this.component.multipleInstances?e:s0:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!==`EXPLICIT`}};function l0(e){return e===s0?void 0:e}function u0(e){return e.instantiationMode===`EAGER`}var d0=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new c0(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}},f0=[],p0;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.VERBOSE=1]=`VERBOSE`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.SILENT=5]=`SILENT`})(p0||={});var m0={debug:p0.DEBUG,verbose:p0.VERBOSE,info:p0.INFO,warn:p0.WARN,error:p0.ERROR,silent:p0.SILENT},h0=p0.INFO,g0={[p0.DEBUG]:`log`,[p0.VERBOSE]:`log`,[p0.INFO]:`info`,[p0.WARN]:`warn`,[p0.ERROR]:`error`},_0=(e,t,...n)=>{if(t<e.logLevel)return;let r=new Date().toISOString(),i=g0[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)},v0=class{constructor(e){this.name=e,this._logLevel=h0,this._logHandler=_0,this._userLogHandler=null,f0.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in p0))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e==`string`?m0[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!=`function`)throw TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,p0.DEBUG,...e),this._logHandler(this,p0.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,p0.VERBOSE,...e),this._logHandler(this,p0.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,p0.INFO,...e),this._logHandler(this,p0.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,p0.WARN,...e),this._logHandler(this,p0.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,p0.ERROR,...e),this._logHandler(this,p0.ERROR,...e)}},y0=(e,t)=>t.some(t=>e instanceof t),b0,x0;function S0(){return b0||=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]}function C0(){return x0||=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]}var w0=new WeakMap,T0=new WeakMap,E0=new WeakMap,D0=new WeakMap,O0=new WeakMap;function k0(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`success`,i),e.removeEventListener(`error`,a)},i=()=>{t(F0(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener(`success`,i),e.addEventListener(`error`,a)});return t.then(t=>{t instanceof IDBCursor&&w0.set(t,e)}).catch(()=>{}),O0.set(t,e),t}function A0(e){if(T0.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`complete`,i),e.removeEventListener(`error`,a),e.removeEventListener(`abort`,a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException(`AbortError`,`AbortError`)),r()};e.addEventListener(`complete`,i),e.addEventListener(`error`,a),e.addEventListener(`abort`,a)});T0.set(e,t)}var j0={get(e,t,n){if(e instanceof IDBTransaction){if(t===`done`)return T0.get(e);if(t===`objectStoreNames`)return e.objectStoreNames||E0.get(e);if(t===`store`)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return F0(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t===`done`||t===`store`)?!0:t in e}};function M0(e){j0=e(j0)}function N0(e){return e===IDBDatabase.prototype.transaction&&!(`objectStoreNames`in IDBTransaction.prototype)?function(t,...n){let r=e.call(I0(this),t,...n);return E0.set(r,t.sort?t.sort():[t]),F0(r)}:C0().includes(e)?function(...t){return e.apply(I0(this),t),F0(w0.get(this))}:function(...t){return F0(e.apply(I0(this),t))}}function P0(e){return typeof e==`function`?N0(e):(e instanceof IDBTransaction&&A0(e),y0(e,S0())?new Proxy(e,j0):e)}function F0(e){if(e instanceof IDBRequest)return k0(e);if(D0.has(e))return D0.get(e);let t=P0(e);return t!==e&&(D0.set(e,t),O0.set(t,e)),t}var I0=e=>O0.get(e);function L0(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){let o=indexedDB.open(e,t),s=F0(o);return r&&o.addEventListener(`upgradeneeded`,e=>{r(F0(o.result),e.oldVersion,e.newVersion,F0(o.transaction),e)}),n&&o.addEventListener(`blocked`,e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener(`close`,()=>a()),i&&e.addEventListener(`versionchange`,e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}function R0(e,{blocked:t}={}){let n=indexedDB.deleteDatabase(e);return t&&n.addEventListener(`blocked`,e=>t(e.oldVersion,e)),F0(n).then(()=>void 0)}var z0=[`get`,`getKey`,`getAll`,`getAllKeys`,`count`],B0=[`put`,`add`,`delete`,`clear`],V0=new Map;function H0(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t==`string`))return;if(V0.get(t))return V0.get(t);let n=t.replace(/FromIndex$/,``),r=t!==n,i=B0.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||z0.includes(n)))return;let a=async function(e,...t){let a=this.transaction(e,i?`readwrite`:`readonly`),o=a.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return V0.set(t,a),a}M0(e=>({...e,get:(t,n,r)=>H0(t,n)||e.get(t,n,r),has:(t,n)=>!!H0(t,n)||e.has(t,n)}));var U0=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(W0(e)){let t=e.getImmediate();return`${t.library}/${t.version}`}else return null}).filter(e=>e).join(` `)}};function W0(e){return e.getComponent()?.type===`VERSION`}var G0=`@firebase/app`,K0=`0.14.10`,q0=new v0(`@firebase/app`),J0=`@firebase/app-compat`,Y0=`@firebase/analytics-compat`,X0=`@firebase/analytics`,Z0=`@firebase/app-check-compat`,Q0=`@firebase/app-check`,$0=`@firebase/auth`,e2=`@firebase/auth-compat`,t2=`@firebase/database`,n2=`@firebase/data-connect`,r2=`@firebase/database-compat`,i2=`@firebase/functions`,a2=`@firebase/functions-compat`,o2=`@firebase/installations`,s2=`@firebase/installations-compat`,c2=`@firebase/messaging`,l2=`@firebase/messaging-compat`,u2=`@firebase/performance`,d2=`@firebase/performance-compat`,f2=`@firebase/remote-config`,p2=`@firebase/remote-config-compat`,m2=`@firebase/storage`,h2=`@firebase/storage-compat`,g2=`@firebase/firestore`,_2=`@firebase/ai`,v2=`@firebase/firestore-compat`,y2=`firebase`,b2=`[DEFAULT]`,x2={[G0]:`fire-core`,[J0]:`fire-core-compat`,[X0]:`fire-analytics`,[Y0]:`fire-analytics-compat`,[Q0]:`fire-app-check`,[Z0]:`fire-app-check-compat`,[$0]:`fire-auth`,[e2]:`fire-auth-compat`,[t2]:`fire-rtdb`,[n2]:`fire-data-connect`,[r2]:`fire-rtdb-compat`,[i2]:`fire-fn`,[a2]:`fire-fn-compat`,[o2]:`fire-iid`,[s2]:`fire-iid-compat`,[c2]:`fire-fcm`,[l2]:`fire-fcm-compat`,[u2]:`fire-perf`,[d2]:`fire-perf-compat`,[f2]:`fire-rc`,[p2]:`fire-rc-compat`,[m2]:`fire-gcs`,[h2]:`fire-gcs-compat`,[g2]:`fire-fst`,[v2]:`fire-fst-compat`,[_2]:`fire-vertex`,"fire-js":`fire-js`,[y2]:`fire-js-all`},S2=new Map,C2=new Map,w2=new Map;function T2(e,t){try{e.container.addComponent(t)}catch(n){q0.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function E2(e){let t=e.name;if(w2.has(t))return q0.debug(`There were multiple attempts to register component ${t}.`),!1;w2.set(t,e);for(let t of S2.values())T2(t,e);for(let t of C2.values())T2(t,e);return!0}function D2(e,t){let n=e.container.getProvider(`heartbeat`).getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}var O2=new e0(`app`,`Firebase`,{"no-app":`No Firebase App '{$appName}' has been created - call initializeApp() first`,"bad-app-name":`Illegal App name: '{$appName}'`,"duplicate-app":`Firebase App named '{$appName}' already exists with different options or config`,"app-deleted":`Firebase App named '{$appName}' already deleted`,"server-app-deleted":`Firebase Server App has been deleted`,"no-options":`Need to provide options, when not being deployed to hosting via source.`,"invalid-app-argument":`firebase.{$appName}() takes either no argument or a Firebase App instance.`,"invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":`Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.`,"idb-get":`Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.`,"idb-set":`Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.`,"idb-delete":`Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.`,"finalization-registry-not-supported":`FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.`,"invalid-server-app-environment":`FirebaseServerApp is not for use in browser environments.`}),k2=class{constructor(e,t,n){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new o0(`app`,()=>this,`PUBLIC`))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw O2.create(`app-deleted`,{appName:this._name})}};function A2(e,t={}){let n=e;typeof t!=`object`&&(t={name:t});let r={name:b2,automaticDataCollectionEnabled:!0,...t},i=r.name;if(typeof i!=`string`||!i)throw O2.create(`bad-app-name`,{appName:String(i)});if(n||=q1(),!n)throw O2.create(`no-options`);let a=S2.get(i);if(a){if(r0(n,a.options)&&r0(r,a.config))return a;throw O2.create(`duplicate-app`,{appName:i})}let o=new d0(i);for(let e of w2.values())o.addComponent(e);let s=new k2(n,r,o);return S2.set(i,s),s}function j2(e=b2){let t=S2.get(e);if(!t&&e===`[DEFAULT]`&&q1())return A2();if(!t)throw O2.create(`no-app`,{appName:e});return t}function M2(e,t,n){let r=x2[e]??e;n&&(r+=`-${n}`);let i=r.match(/\s|\//),a=t.match(/\s|\//);if(i||a){let e=[`Unable to register library "${r}" with version "${t}":`];i&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&a&&e.push(`and`),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),q0.warn(e.join(` `));return}E2(new o0(`${r}-version`,()=>({library:r,version:t}),`VERSION`))}var N2=`firebase-heartbeat-database`,P2=1,F2=`firebase-heartbeat-store`,I2=null;function L2(){return I2||=L0(N2,P2,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(F2)}catch(e){console.warn(e)}}}}).catch(e=>{throw O2.create(`idb-open`,{originalErrorMessage:e.message})}),I2}async function R2(e){try{let t=(await L2()).transaction(F2),n=await t.objectStore(F2).get(B2(e));return await t.done,n}catch(e){if(e instanceof $1)q0.warn(e.message);else{let t=O2.create(`idb-get`,{originalErrorMessage:e?.message});q0.warn(t.message)}}}async function z2(e,t){try{let n=(await L2()).transaction(F2,`readwrite`);await n.objectStore(F2).put(t,B2(e)),await n.done}catch(e){if(e instanceof $1)q0.warn(e.message);else{let t=O2.create(`idb-set`,{originalErrorMessage:e?.message});q0.warn(t.message)}}}function B2(e){return`${e.name}!${e.options.appId}`}var V2=1024,H2=30,U2=class{constructor(e){this.container=e,this._heartbeatsCache=null,this._storage=new K2(this.container.getProvider(`app`).getImmediate()),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){try{let e=this.container.getProvider(`platform-logger`).getImmediate().getPlatformInfoString(),t=W2();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))return;if(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats.length>H2){let e=J2(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){q0.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return``;let e=W2(),{heartbeatsToSend:t,unsentEntries:n}=G2(this._heartbeatsCache.heartbeats),r=B1(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(e){return q0.warn(e),``}}};function W2(){return new Date().toISOString().substring(0,10)}function G2(e,t=V2){let n=[],r=e.slice();for(let i of e){let e=n.find(e=>e.agent===i.agent);if(!e){if(n.push({agent:i.agent,dates:[i.date]}),q2(n)>t){n.pop();break}}else if(e.dates.push(i.date),q2(n)>t){e.dates.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}var K2=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Y1()?X1().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){let e=await R2(this.app);return e?.heartbeats?e:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return z2(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){let t=await this.read();return z2(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??t.lastSentHeartbeatDate,heartbeats:[...t.heartbeats,...e.heartbeats]})}else return}};function q2(e){return B1(JSON.stringify({version:2,heartbeats:e})).length}function J2(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}function Y2(e){E2(new o0(`platform-logger`,e=>new U0(e),`PRIVATE`)),E2(new o0(`heartbeat`,e=>new U2(e),`PRIVATE`)),M2(G0,K0,e),M2(G0,K0,`esm2020`),M2(`fire-js`,``)}Y2(``),M2(`firebase`,`12.11.0`,`app`);var X2=`@firebase/installations`,Z2=`0.6.21`,Q2=1e4,$2=`w:${Z2}`,e4=`FIS_v2`,t4=`https://firebaseinstallations.googleapis.com/v1`,n4=3600*1e3,r4=new e0(`installations`,`Installations`,{"missing-app-config-values":`Missing App configuration value: "{$valueName}"`,"not-registered":`Firebase Installation is not registered.`,"installation-not-found":`Firebase Installation not found.`,"request-failed":`{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"`,"app-offline":`Could not process request. Application offline.`,"delete-pending-registration":`Can't delete installation while there is a pending registration request.`});function i4(e){return e instanceof $1&&e.code.includes(`request-failed`)}function a4({projectId:e}){return`${t4}/projects/${e}/installations`}
vendor: 5,554 bytes, line 62
62function o4(e){return{token:e.token,requestStatus:2,expiresIn:d4(e.expiresIn),creationTime:Date.now()}}async function s4(e,t){let n=(await t.json()).error;return r4.create(`request-failed`,{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function c4({apiKey:e}){return new Headers({"Content-Type":`application/json`,Accept:`application/json`,"x-goog-api-key":e})}function l4(e,{refreshToken:t}){let n=c4(e);return n.append(`Authorization`,f4(t)),n}async function u4(e){let t=await e();return t.status>=500&&t.status<600?e():t}function d4(e){return Number(e.replace(`s`,`000`))}function f4(e){return`${e4} ${e}`}async function p4({appConfig:e,heartbeatServiceProvider:t},{fid:n}){let r=a4(e),i=c4(e),a=t.getImmediate({optional:!0});if(a){let e=await a.getHeartbeatsHeader();e&&i.append(`x-firebase-client`,e)}let o={fid:n,authVersion:e4,appId:e.appId,sdkVersion:$2},s={method:`POST`,headers:i,body:JSON.stringify(o)},c=await u4(()=>fetch(r,s));if(c.ok){let e=await c.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:o4(e.authToken)}}else throw await s4(`Create Installation`,c)}function m4(e){return new Promise(t=>{setTimeout(t,e)})}function h4(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,`-`).replace(/\//g,`_`)}var g4=/^[cdef][\w-]{21}$/,_4=``;function v4(){try{let e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;let t=y4(e);return g4.test(t)?t:_4}catch{return _4}}function y4(e){return h4(e).substr(0,22)}function b4(e){return`${e.appName}!${e.appId}`}var x4=new Map;function S4(e,t){let n=b4(e);C4(n,t),w4(n,t)}function C4(e,t){let n=x4.get(e);if(n)for(let e of n)e(t)}function w4(e,t){let n=E4();n&&n.postMessage({key:e,fid:t}),D4()}var T4=null;function E4(){return!T4&&`BroadcastChannel`in self&&(T4=new BroadcastChannel(`[Firebase] FID Change`),T4.onmessage=e=>{C4(e.data.key,e.data.fid)}),T4}function D4(){x4.size===0&&T4&&(T4.close(),T4=null)}var O4=`firebase-installations-database`,k4=1,A4=`firebase-installations-store`,j4=null;function M4(){return j4||=L0(O4,k4,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(A4)}}}),j4}async function N4(e,t){let n=b4(e),r=(await M4()).transaction(A4,`readwrite`),i=r.objectStore(A4),a=await i.get(n);return await i.put(t,n),await r.done,(!a||a.fid!==t.fid)&&S4(e,t.fid),t}async function P4(e){let t=b4(e),n=(await M4()).transaction(A4,`readwrite`);await n.objectStore(A4).delete(t),await n.done}async function F4(e,t){let n=b4(e),r=(await M4()).transaction(A4,`readwrite`),i=r.objectStore(A4),a=await i.get(n),o=t(a);return o===void 0?await i.delete(n):await i.put(o,n),await r.done,o&&(!a||a.fid!==o.fid)&&S4(e,o.fid),o}async function I4(e){let t,n=await F4(e.appConfig,n=>{let r=R4(e,L4(n));return t=r.registrationPromise,r.installationEntry});return n.fid===_4?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}function L4(e){return H4(e||{fid:v4(),registrationStatus:0})}function R4(e,t){if(t.registrationStatus===0){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(r4.create(`app-offline`))};let n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()};return{installationEntry:n,registrationPromise:z4(e,n)}}else if(t.registrationStatus===1)return{installationEntry:t,registrationPromise:B4(e)};else return{installationEntry:t}}async function z4(e,t){try{let n=await p4(e,t);return N4(e.appConfig,n)}catch(n){throw i4(n)&&n.customData.serverCode===409?await P4(e.appConfig):await N4(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}async function B4(e){let t=await V4(e.appConfig);for(;t.registrationStatus===1;)await m4(100),t=await V4(e.appConfig);if(t.registrationStatus===0){let{installationEntry:t,registrationPromise:n}=await I4(e);return n||t}return t}function V4(e){return F4(e,e=>{if(!e)throw r4.create(`installation-not-found`);return H4(e)})}function H4(e){return U4(e)?{fid:e.fid,registrationStatus:0}:e}function U4(e){return e.registrationStatus===1&&e.registrationTime+Q2<Date.now()}async function W4({appConfig:e,heartbeatServiceProvider:t},n){let r=G4(e,n),i=l4(e,n),a=t.getImmediate({optional:!0});if(a){let e=await a.getHeartbeatsHeader();e&&i.append(`x-firebase-client`,e)}let o={installation:{sdkVersion:$2,appId:e.appId}},s={method:`POST`,headers:i,body:JSON.stringify(o)},c=await u4(()=>fetch(r,s));if(c.ok)return o4(await c.json());throw await s4(`Generate Auth Token`,c)}function G4(e,{fid:t}){return`${a4(e)}/${t}/authTokens:generate`}async function K4(e,t=!1){let n,r=await F4(e.appConfig,r=>{if(!X4(r))throw r4.create(`not-registered`);let i=r.authToken;if(!t&&Z4(i))return r;if(i.requestStatus===1)return n=q4(e,t),r;{if(!navigator.onLine)throw r4.create(`app-offline`);let t=$4(r);return n=Y4(e,t),t}});return n?await n:r.authToken}async function q4(e,t){let n=await J4(e.appConfig);for(;n.authToken.requestStatus===1;)await m4(100),n=await J4(e.appConfig);let r=n.authToken;return r.requestStatus===0?K4(e,t):r}function J4(e){return F4(e,e=>{if(!X4(e))throw r4.create(`not-registered`);let t=e.authToken;return e3(t)?{...e,authToken:{requestStatus:0}}:e})}async function Y4(e,t){try{let n=await W4(e,t),r={...t,authToken:n};return await N4(e.appConfig,r),n}catch(n){if(i4(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await P4(e.appConfig);else{let n={...t,authToken:{requestStatus:0}};await N4(e.appConfig,n)}throw n}}function X4(e){return e!==void 0&&e.registrationStatus===2}function Z4(e){return e.requestStatus===2&&!Q4(e)}function Q4(e){let t=Date.now();
62return t<e.creationTime||e.creationTime+e.expiresIn<t+n4}function $4(e){let t={requestStatus:1,requestTime:Date.now()};return{...e,authToken:t}}function e3(e){return e.requestStatus===1&&e.requestTime+Q2<Date.now()}async function t3(e){let t=e,{installationEntry:n,registrationPromise:r}=await I4(t);return r?r.catch(console.error):K4(t).catch(console.error),n.fid}async function n3(e,t=!1){let n=e;return await r3(n),(await K4(n,t)).token}async function r3(e){let{registrationPromise:t}=await I4(e);t&&await t}function i3(e){if(!e||!e.options)throw a3(`App Configuration`);if(!e.name)throw a3(`App Name`);for(let t of[`projectId`,`apiKey`,`appId`])if(!e.options[t])throw a3(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function a3(e){return r4.create(`missing-app-config-values`,{valueName:e})}var o3=`installations`,s3=`installations-internal`,c3=e=>{let t=e.getProvider(`app`).getImmediate();return{app:t,appConfig:i3(t),heartbeatServiceProvider:D2(t,`heartbeat`),_delete:()=>Promise.resolve()}},l3=e=>{let t=D2(e.getProvider(`app`).getImmediate(),o3).getImmediate();return{getId:()=>t3(t),getToken:e=>n3(t,e)}};function u3(){E2(new o0(o3,c3,`PUBLIC`)),E2(new o0(s3,l3,`PRIVATE`))}u3(),M2(X2,Z2),M2(X2,Z2,`esm2020`);var d3=`/firebase-messaging-sw.js`,f3=`/firebase-cloud-messaging-push-scope`,p3=`BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4`,m3=`https://fcmregistrations.googleapis.com/v1`,h3=`google.c.a.c_id`,g3=`google.c.a.c_l`,_3=`google.c.a.ts`,v3=`google.c.a.e`,y3=1e4,b3;(function(e){e[e.DATA_MESSAGE=1]=`DATA_MESSAGE`,e[e.DISPLAY_NOTIFICATION=3]=`DISPLAY_NOTIFICATION`})(b3||={});var x3;(function(e){e.PUSH_RECEIVED=`push-received`,e.NOTIFICATION_CLICKED=`notification-clicked`})(x3||={});function S3(e){let t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}function C3(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/\-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}var w3=`fcm_token_details_db`,T3=5,E3=`fcm_token_object_Store`;async function D3(e){if(`databases`in indexedDB&&!(await indexedDB.databases()).map(e=>e.name).includes(w3))return null;let t=null;return(await L0(w3,T3,{upgrade:async(n,r,i,a)=>{if(r<2||!n.objectStoreNames.contains(E3))return;let o=a.objectStore(E3),s=await o.index(`fcmSenderId`).get(e);if(await o.clear(),s){if(r===2){let e=s;if(!e.auth||!e.p256dh||!e.endpoint)return;t={token:e.fcmToken,createTime:e.createTime??Date.now(),subscriptionOptions:{auth:e.auth,p256dh:e.p256dh,endpoint:e.endpoint,swScope:e.swScope,vapidKey:typeof e.vapidKey==`string`?e.vapidKey:S3(e.vapidKey)}}}else if(r===3){let e=s;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:S3(e.auth),p256dh:S3(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:S3(e.vapidKey)}}}else if(r===4){let e=s;t={token:e.fcmToken,createTime:e.createTime,subscriptionOptions:{auth:S3(e.auth),p256dh:S3(e.p256dh),endpoint:e.endpoint,swScope:e.swScope,vapidKey:S3(e.vapidKey)}}}}}})).close(),await R0(w3),await R0(`fcm_vapid_details_db`),await R0(`undefined`),O3(t)?t:null}function O3(e){if(!e||!e.subscriptionOptions)return!1;let{subscriptionOptions:t}=e;return typeof e.createTime==`number`&&e.createTime>0&&typeof e.token==`string`&&e.token.length>0&&typeof t.auth==`string`&&t.auth.length>0&&typeof t.p256dh==`string`&&t.p256dh.length>0&&typeof t.endpoint==`string`&&t.endpoint.length>0&&typeof t.swScope==`string`&&t.swScope.length>0&&typeof t.vapidKey==`string`&&t.vapidKey.length>0}var k3=`firebase-messaging-database`,A3=1,j3=`firebase-messaging-store`,M3=null;function N3(){return M3||=L0(k3,A3,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(j3)}}}),M3}async function P3(e){let t=L3(e),n=await(await N3()).transaction(j3).objectStore(j3).get(t);if(n)return n;{let t=await D3(e.appConfig.senderId);if(t)return await F3(e,t),t}}async function F3(e,t){let n=L3(e),r=(await N3()).transaction(j3,`readwrite`);return await r.objectStore(j3).put(t,n),await r.done,t}async function I3(e){let t=L3(e),n=(await N3()).transaction(j3,`readwrite`);await n.objectStore(j3).delete(t),await n.done}function L3({appConfig:e}){return e.appId}var R3=new e0(`messaging`,`Messaging`,{"missing-app-config-values":`Missing App configuration value: "{$valueName}"`,"only-available-in-window":`This method is available in a Window context.`,"only-available-in-sw":`This method is available in a service worker context.`,"permission-default":`The notification permission was not granted and dismissed instead.`,"permission-blocked":`The notification permission was not granted and blocked instead.`,"unsupported-browser":`This browser doesn't support the API's required to use the Firebase SDK.`,"indexed-db-unsupported":`This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)`,"failed-service-worker-registration":`We are unable to register the default service worker. {$browserErrorMessage}`,"token-subscribe-failed":`A problem occurred while subscribing the user to FCM: {$errorInfo}`,"token-subscribe-no-token":`FCM returned no token when subscribing the user to push.`,"token-unsubscribe-failed":`A problem occurred while unsubscribing the user from FCM: {$errorInfo}`,"token-update-failed":`A problem occurred while updating the user from FCM: {$errorInfo}`,"token-update-no-token":`FCM returned no token when updating the user to push.`,"use-sw-after-get-token":`The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.`,"invali
62d-sw-registration":`The input to useServiceWorker() must be a ServiceWorkerRegistration.`,"invalid-bg-handler":`The input to setBackgroundMessageHandler() must be a function.`,"invalid-vapid-key":`The public VAPID key must be a string.`,"use-vapid-key-after-get-token":`The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.`});async function z3(e,t){let n=await U3(e),r=W3(t),i={method:`POST`,headers:n,body:JSON.stringify(r)},a;try{a=await(await fetch(H3(e.appConfig),i)).json()}catch(e){throw R3.create(`token-subscribe-failed`,{errorInfo:e?.toString()})}if(a.error){let e=a.error.message;throw R3.create(`token-subscribe-failed`,{errorInfo:e})}if(!a.token)throw R3.create(`token-subscribe-no-token`);return a.token}async function B3(e,t){let n=await U3(e),r=W3(t.subscriptionOptions),i={method:`PATCH`,headers:n,body:JSON.stringify(r)},a;try{a=await(await fetch(`${H3(e.appConfig)}/${t.token}`,i)).json()}catch(e){throw R3.create(`token-update-failed`,{errorInfo:e?.toString()})}if(a.error){let e=a.error.message;throw R3.create(`token-update-failed`,{errorInfo:e})}if(!a.token)throw R3.create(`token-update-no-token`);return a.token}async function V3(e,t){let n={method:`DELETE`,headers:await U3(e)};try{let r=await(await fetch(`${H3(e.appConfig)}/${t}`,n)).json();if(r.error){let e=r.error.message;throw R3.create(`token-unsubscribe-failed`,{errorInfo:e})}}catch(e){throw R3.create(`token-unsubscribe-failed`,{errorInfo:e?.toString()})}}function H3({projectId:e}){return`${m3}/projects/${e}/registrations`}async function U3({appConfig:e,installations:t}){let n=await t.getToken();return new Headers({"Content-Type":`application/json`,Accept:`application/json`,"x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function W3({p256dh:e,auth:t,endpoint:n,vapidKey:r}){let i={web:{endpoint:n,auth:t,p256dh:e}};return r!==p3&&(i.web.applicationPubKey=r),i}var G3=10080*60*1e3;async function K3(e){let t=await X3(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:S3(t.getKey(`auth`)),p256dh:S3(t.getKey(`p256dh`))},r=await P3(e.firebaseDependencies);if(!r)return Y3(e.firebaseDependencies,n);if(!Z3(r.subscriptionOptions,n)){try{await V3(e.firebaseDependencies,r.token)}catch(e){console.warn(e)}return Y3(e.firebaseDependencies,n)}else if(Date.now()>=r.createTime+G3)return J3(e,{token:r.token,createTime:Date.now(),subscriptionOptions:n});else return r.token}async function q3(e){let t=await P3(e.firebaseDependencies);t&&(await V3(e.firebaseDependencies,t.token),await I3(e.firebaseDependencies));let n=await e.swRegistration.pushManager.getSubscription();return n?n.unsubscribe():!0}async function J3(e,t){try{let n=await B3(e.firebaseDependencies,t),r={...t,token:n,createTime:Date.now()};return await F3(e.firebaseDependencies,r),n}catch(e){throw e}}async function Y3(e,t){let n={token:await z3(e,t),createTime:Date.now(),subscriptionOptions:t};return await F3(e,n),n.token}async function X3(e,t){return await e.pushManager.getSubscription()||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:C3(t)})}function Z3(e,t){let n=t.vapidKey===e.vapidKey,r=t.endpoint===e.endpoint,i=t.auth===e.auth,a=t.p256dh===e.p256dh;return n&&r&&i&&a}function Q3(e){let t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return $3(t,e),e6(t,e),t6(t,e),t}function $3(e,t){if(!t.notification)return;e.notification={};let n=t.notification.title;n&&(e.notification.title=n);let r=t.notification.body;r&&(e.notification.body=r);let i=t.notification.image;i&&(e.notification.image=i);let a=t.notification.icon;a&&(e.notification.icon=a)}function e6(e,t){t.data&&(e.data=t.data)}function t6(e,t){if(!t.fcmOptions&&!t.notification?.click_action)return;e.fcmOptions={};let n=t.fcmOptions?.link??t.notification?.click_action;n&&(e.fcmOptions.link=n);let r=t.fcmOptions?.analytics_label;r&&(e.fcmOptions.analyticsLabel=r)}function n6(e){return typeof e==`object`&&!!e&&h3 in e}r6(`AzSCbw63g1R0nCw85jG8`,`Iaya3yLKwmgvh7cF0q4`);function r6(e,t){let n=[];for(let r=0;r<e.length;r++)n.push(e.charAt(r)),r<t.length&&n.push(t.charAt(r));return n.join(``)}function i6(e){if(!e||!e.options)throw a6(`App Configuration Object`);if(!e.name)throw a6(`App Name`);let t=[`projectId`,`apiKey`,`appId`,`messagingSenderId`],{options:n}=e;for(let e of t)if(!n[e])throw a6(e);
62return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}function a6(e){return R3.create(`missing-app-config-values`,{valueName:e})}var o6=class{constructor(e,t,n){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1,this.firebaseDependencies={app:e,appConfig:i6(e),installations:t,analyticsProvider:n}}_delete(){return Promise.resolve()}};async function s6(e){try{e.swRegistration=await navigator.serviceWorker.register(d3,{scope:f3}),e.swRegistration.update().catch(()=>{}),await c6(e.swRegistration)}catch(e){throw R3.create(`failed-service-worker-registration`,{browserErrorMessage:e?.message})}}async function c6(e){return new Promise((t,n)=>{let r=setTimeout(()=>n(Error(`Service worker not registered after ${y3} ms`)),y3),i=e.installing||e.waiting;e.active?(clearTimeout(r),t()):i?i.onstatechange=e=>{e.target?.state===`activated`&&(i.onstatechange=null,clearTimeout(r),t())}:(clearTimeout(r),n(Error(`No incoming service worker found.`)))})}async function l6(e,t){if(!t&&!e.swRegistration&&await s6(e),!(!t&&e.swRegistration)){if(!(t instanceof ServiceWorkerRegistration))throw R3.create(`invalid-sw-registration`);e.swRegistration=t}}async function u6(e,t){t?e.vapidKey=t:e.vapidKey||=p3}async function d6(e,t){if(!navigator)throw R3.create(`only-available-in-window`);if(Notification.permission===`default`&&await Notification.requestPermission(),Notification.permission!==`granted`)throw R3.create(`permission-blocked`);return await u6(e,t?.vapidKey),await l6(e,t?.serviceWorkerRegistration),K3(e)}async function f6(e,t,n){let r=p6(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(r,{message_id:n[h3],message_name:n[g3],message_time:n[_3],message_device_time:Math.floor(Date.now()/1e3)})}function p6(e){switch(e){case x3.NOTIFICATION_CLICKED:return`notification_open`;case x3.PUSH_RECEIVED:return`notification_foreground`;default:throw Error()}}async function m6(e,t){let n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===x3.PUSH_RECEIVED&&(typeof e.onMessageHandler==`function`?e.onMessageHandler(Q3(n)):e.onMessageHandler.next(Q3(n)));let r=n.data;n6(r)&&r[v3]===`1`&&await f6(e,n.messageType,r)}var h6=`@firebase/messaging`,g6=`0.12.25`,_6=e=>{let t=new o6(e.getProvider(`app`).getImmediate(),e.getProvider(`installations-internal`).getImmediate(),e.getProvider(`analytics-internal`));return navigator.serviceWorker.addEventListener(`message`,e=>m6(t,e)),t},v6=e=>{let t=e.getProvider(`messaging`).getImmediate();return{getToken:e=>d6(t,e)}};function y6(){E2(new o0(`messaging`,_6,`PUBLIC`)),E2(new o0(`messaging-internal`,v6,`PRIVATE`)),M2(h6,g6),M2(h6,g6,`esm2020`)}async function b6(){try{await X1()}catch{return!1}return typeof window<`u`&&Y1()&&Z1()&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window&&`fetch`in window&&ServiceWorkerRegistration.prototype.hasOwnProperty(`showNotification`)&&PushSubscription.prototype.hasOwnProperty(`getKey`)}async function x6(e){if(!navigator)throw R3.create(`only-available-in-window`);return e.swRegistration||await s6(e),q3(e)}function S6(e=j2()){return b6().then(e=>{if(!e)throw R3.create(`unsupported-browser`)},e=>{throw R3.create(`indexed-db-unsupported`)}),D2(a0(e),`messaging`).getImmediate()}async function C6(e,t){return e=a0(e),d6(e,t)}function w6(e){return e=a0(e),x6(e)}y6();var T6={apiKey:Ge,authDomain:We,projectId:Ue,storageBucket:Ae,messagingSenderId:_e,appId:Ne,measurementId:ke},E6=ye,D6=()=>{try{let e=JSON.parse(nd.getItem(`fcm`)||`[]`);return Array.isArray(e)?e:[]}catch{return[]}},O6=e=>{nd.setItem(`fcm`,JSON.stringify(Array.isArray(e)?e:[]))},k6=e=>{O6(Array.from(new Set(D6().concat(String(e)))))},A6=e=>{O6(D6().filter(t=>String(t)!==String(e)))},j6=e=>D6().includes(String(e)),M6=new(i(((e,t)=>{(function(n,r){var i=`0.7.41`,a=``,o=`?`,s=`function`,c=`undefined`,l=`object`,u=`string`,d=`major`,f=`model`,p=`name`,m=`type`,h=`vendor`,g=`version`,_=`architecture`,v=`console`,y=`mobile`,b=`tablet`,x=`smarttv`,S=`wearable`,C=`embedded`,ee=500,w=`Amazon`,te=`Apple`,ne=`ASUS`,re=`BlackBerry`,ie=`Browser`,ae=`Chrome`,T=`Edge`,oe=`Firefox`,se=`Google`,ce=`Honor`,le=`Huawei`,ue=`Lenovo`,E=`LG`,D=`Microsoft`,de=`Motorola`,fe=`Nvidia`,pe=`OnePlus`,me=`Opera`,he=`OPPO`,ge=`Samsung`,_e=`Sharp`,ve=`Sony`,ye=`Xiaomi`,be=`Zebra`,xe=`Facebook`,Se=`Chromium OS`,Ce=`Mac OS`,we=` Browser`,Te=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},Ee=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},De=function(e,t){return typeof e===u?Oe(t).indexOf(Oe(e))!==-1:!1},Oe=function(e){return e.toLowerCase()},ke=function(e){return typeof e===u?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},Ae=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,a),typeof t===c?e:e.substring(0,ee)},je=function(e,t){for(var n=0,i,a,o,c,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(o=0;o<p.length;o++)d=u[++a],c=p[o],typeof c===l&&c.length>0?c.length===2?typeof c[1]==s?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:c.length===3?typeof c[1]===s&&!(c[1].exec&&c[1].test)?this[c[0]]=d?c[1].call(this,d,c[2]):r:this[c[0]]=d?d.replace(c[1],c[2]):r:c.length===4&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):r):this[c]=d||r;n+=2}},Me=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(De(t[n][i],e))return n===o?r:n}else if(De(t[n],e))return n===o?r:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Ne={"1.0":`/8`,"1.2":`/1`,"1.3":`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},Pe={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,"8.1":`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},Fe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[p,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[p,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,g],[/opios[\/ ]+([\w\.]+)/i],[g,[p,me+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[p,me+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[p,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[p,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[p,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[p,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[p,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[p,`UC`+ie]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[p,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[p,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[p,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[p,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[p,`Smart Lenovo `+ie]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,`$1 Secure `+ie],g],[/\bfocus\/([\w\.]+)/i],[g,[p,oe+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[p,me+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[p,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[p,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[p,me+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[p,`MIUI`+we]],[/fxios\/([\w\.-]+)/i],[g,[p,oe]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[p,`360`]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,`$1`+we],g],[/samsungbrowser\/([\w\.]+)/i],[g,[p,ge+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[p,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,`Sogou Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,g],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,xe],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[p,`GSA`]],[/musical_ly(?:.
62+app_?version\/|_)([\w\.]+)/i],[g,[p,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[p,ae+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,ae+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[p,`Android `+ie]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[p,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[g,Me,Ne]],[/(webkit|khtml)\/([\w\.]+)/i],[p,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[p,oe+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[p,[g,/master.|lts./,``]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,a,Oe]],[/ sun4\w[;\)]/i],[[_,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,Oe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,ge],[m,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,ge],[m,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[h,te],[m,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,te],[m,b]],[/(macintosh);/i],[f,[h,te]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,_e],[m,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[f,[h,ce],[m,b]],[/honor([-\w ]+)[;\)]/i],[f,[h,ce],[m,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[f,[h,le],[m,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,le],[m,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[f,/_/g,` `],[h,ye],[m,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[f,/_/g,` `],[h,ye],[m,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,he],[m,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[f,[h,Me,{OnePlus:[`304`,`403`,`203`],"*":he}],[m,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,`Vivo`],[m,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[f,[h,`Realme`],[m,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,de],[m,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,de],[m,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,E],[m,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,E],[m,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}
62(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[f,[h,ue],[m,b]],[/(nokia) (t[12][01])/i],[h,f,[m,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[f,/_/g,` `],[m,y],[h,`Nokia`]],[/(pixel (c|tablet))\b/i],[f,[h,se],[m,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,se],[m,y]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,ve],[m,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,`Xperia Tablet`],[h,ve],[m,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,pe],[m,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,w],[m,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,`Fire Phone $1`],[h,w],[m,y]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[m,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,re],[m,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,ne],[m,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,ne],[m,y]],[/(nexus 9)/i],[f,[h,`HTC`],[m,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g,` `],[m,y]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[f,[h,`TCL`],[m,b]],[/(itel) ((\w+))/i],[[h,Oe],f,[m,Me,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,`Acer`],[m,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,`Meizu`],[m,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[f,[h,`Ulefone`],[m,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[f,[h,`Energizer`],[m,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[f,[h,`Cat`],[m,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[f,[h,`Smartfren`],[m,y]],[/droid.+; (a(?:015|06[35]|142p?))/i],[f,[h,`Nothing`],[m,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[f,[h,`Archos`],[m,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[f,[h,`Archos`],[m,y]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[h,f,[m,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[m,y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[m,b]],[/(surface duo)/i],[f,[h,D],[m,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,`Fairphone`],[m,y]],[/(u304aa)/i],[f,[h,`AT&T`],[m,y]],[/\bsie-(\w*)/i],[f,[h,`Siemens`],[m,y]],[/\b(rct\w+) b/i],[f,[h,`RCA`],[m,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,`Dell`],[m,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,`Verizon`],[m,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,`Barnes & Noble`],[m,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,`NuVision`],[m,b]],[/\b(k88) b/i],[f,[h,`ZTE`],[m,b]],[/\b(nx\d{3}j) b/i],[f,[h,`ZTE`],[m,y]],[/\b(gen\d{3}) b.+49h/i],[f,[h,`Swiss`],[m,y]],[/\b(zur\d{3}) b/i],[f,[h,`Swiss`],[m,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,`Zeki`],[m,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,`Dragon Touch`],f,[m,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,`Insignia`],[m,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,`NextBook`],[m,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,`Voice`],f,[m,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,`LvTel`],f,[m,y]],[/\b(ph-1) /i],[f,[h,`Essential`],[m,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,`Envizen`],[m,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,`MachSpeed`],[m,b]],[/\btu_(1491) b/i],[f,[h,`Rotor`],[m,b]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[f,[h,fe],[m,b]],[/(sprint) (\w+)/i],[h,f,[m,y]],[/(kin\.[onetw]{3})/i],[[f,/\./g,` `],[h,D],[m,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,be],[m,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,be],[m,y]],[/smart-tv.+(samsung)/i],[h,[m,x]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,`SmartTV`],[h,ge],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,E],[m,x]],[/(apple) ?tv/i],[h,[f,te+` TV`],[m,x]],[/crkey/i],[[f,ae+`cast`],[h,se],[m,x]],[/droid.+aft(\w+)( bui|\))/i],[f,[h,w],[m,x]],[/(shield \w+ tv)/i],[f,[h,fe],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,_e],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,ve],[m,x]],[/(mi(tv|box)-?\w+) bui/i],[f,[h,ye],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[h,f,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,Ae],[f,Ae],[m,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[f,[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[m,v]],[/droid.+; (shield)( bui|\))/i],[f,[h,fe],[m,v]],[/(playstation \w+)/i],[f,[h,ve],[m,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,D],[m,v]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[f,[h,ge],[m,S]],[/((pebble))app/i,/(asu
vendor: 4,976 bytes, line 62
62s|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[h,f,[m,S]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[f,[h,he],[m,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[h,te],[m,S]],[/(opwwe\d{3})/i],[f,[h,pe],[m,S]],[/(moto 360)/i],[f,[h,de],[m,S]],[/(smartwatch 3)/i],[f,[h,ve],[m,S]],[/(g watch r)/i],[f,[h,E],[m,S]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,be],[m,S]],[/droid.+; (glass) \d/i],[f,[h,se],[m,S]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,f,[m,S]],[/; (quest( \d| pro)?)/i],[f,[h,xe],[m,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[m,C]],[/(aeobc)\b/i],[f,[h,w],[m,C]],[/(homepod).+mac os/i],[f,[h,te],[m,C]],[/windows iot/i],[[m,C]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[f,[m,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[m,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[f,[h,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[p,T+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[p,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[p,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,g],[/ladybird\//i],[[p,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,g],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[g,Me,Pe]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,Me,Pe],[p,`Windows`]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[p,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,Ce],[g,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,`$1 Touch`],g],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,g],[/\(bb(10);/i],[g,[p,re]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[p,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[p,oe+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[p,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[p,`watchOS`]],[/crkey\/([\d\.]+)/i],[g,[p,ae+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,Se],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,g],[/(sunos) ?([\w\.\d]*)/i],[[p,`Solaris`],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,g]]},Ie=function(e,t){if(typeof e===l&&(t=e,e=r),!(this instanceof Ie))return new Ie(e,t).getResult();var i=typeof n!==c&&n.navigator?n.navigator:r,o=e||(i&&i.userAgent?i.userAgent:a),v=i&&i.userAgentData?i.userAgentData:r,x=t?Te(Fe,t):Fe,S=i&&i.userAgent==o;return this.getBrowser=function(){var e={};return e[p]=r,e[g]=r,je.call(e,o,x.browser),e[d]=ke(e[g]),S&&i&&i.brave&&typeof i.brave.isBrave==s&&(e[p]=`Brave`),e},this.getCPU=function(){var e={};return e[_]=r,je.call(e,o,x.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[f]=r,e[m]=r,je.call(e,o,x.device),S&&!e[m]&&v&&v.mobile&&(e[m]=y),S&&e[f]==`Macintosh`&&i&&typeof i.standalone!==c&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[f]=`iPad`,e[m]=b),e},this.getEngine=function(){var e={};return e[p]=r,e[g]=r,je.call(e,o,x.engine),e},this.getOS=function(){var e={};return e[p]=r,e[g]=r,je.call(e,o,x.os),S&&!e[p]&&v&&v.platform&&v.platform!=`Unknown`&&(e[p]=v.platform.replace(/chrome os/i,Se).replace(/macos/i,Ce)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===u&&e.length>ee?Ae(e,ee):e,this},this.setUA(o),this};Ie.VERSION=i,Ie.BROWSER=Ee([p,g,d]),Ie.CPU=Ee([_]),Ie.DEVICE=Ee([f,h,m,v,y,x,b,S,C]),Ie.ENGINE=Ie.OS=Ee([p,g]),typeof e===c?typeof define===s&&define.amd?define(function(){return Ie}
62):typeof n!==c&&(n.UAParser=Ie):(typeof t!==c&&t.exports&&(e=t.exports=Ie),e.UAParser=Ie);var Le=typeof n!==c&&(n.jQuery||n.Zepto);if(Le&&!Le.ua){var Re=new Ie;Le.ua=Re.getResult(),Le.ua.get=function(){return Re.getUA()},Le.ua.set=function(e){Re.setUA(e);var t=Re.getResult();for(var n in t)Le.ua[n]=t[n]}}})(typeof window==`object`?window:e)}))()).UAParser().getResult(),N6=async()=>{let e=`serviceWorker`in navigator,t=`Notification`in window,n=`PushManager`in window;if(!e||!t||!n)return!1;try{return await b6()}catch{}return!1},P6=null,F6=null,I6=`/sw.js`,L6=`/`,R6=e=>{if(Array.isArray(e))return e;if(e&&typeof e==`object`){if(Array.isArray(e.items))return e.items;if(Array.isArray(e.data))return e.data;if(Array.isArray(e.result))return e.result}return[]},z6=()=>{let e=window.navigator.userAgentData?.mobile||!1,t=M6.browser?.name||`unknown`,n=M6.os?.name||`unknown`;return{type:`web-${e?`mobile`:`desktop`}`,name:`${t}-${n}`}},B6=async()=>`serviceWorker`in navigator?await navigator.serviceWorker.getRegistration(L6)||navigator.serviceWorker.register(I6,{scope:L6}):null,V6=async()=>{let e=await B6();if(e)return C6(P6,{serviceWorkerRegistration:e,vapidKey:E6})},H6=async(e,t=!0)=>{try{let n=await V6();return n?(await M.call(`cfm`,`add`,{token:n,...z6()}),t&&k6(e),!0):!1}catch{return!1}},U6=async(e,t=!0)=>{try{let n=await V6();return n?(await w6(P6),await M.call(`cfm`,`remove`,{token:n}),t&&A6(e),!0):!1}catch{return!1}},W6=async e=>{let t=await B6();if(!t||!t.pushManager)return!1;let n=await t.pushManager.getSubscription()!==null,r=j6(e);return n&&r},G6=async e=>j6(e)?H6(e,!1):!1,K6=async e=>j6(e)?U6(e,!1):!1,q6=async e=>{if(!j6(e))return;let t=async()=>{try{let t=R6(await M.call(`cfm`,`list`)),n=await V6();if(!n)return;t.find(e=>e?.value===n||e?.token===n)||await H6(e,!1)}catch{}};typeof window.requestIdleCallback==`function`?window.requestIdleCallback(()=>{t()}):window.setTimeout(()=>{t()},0)},J6=(async()=>{await N6()&&(P6=S6(A2(T6)),F6={supported:!0,subscribe:H6,unsubscribe:U6,subscribed:W6,reconnect:G6,disconnect:K6,validate:q6})})(),Y6=new Proxy({},{get(e,t){return t===`ready`?J6:F6?F6[t]:t===`supported`?!1:()=>Promise.reject(Error(`Push notifications are not supported in this browser environment.`))}}),X6={url:be,enabled:!!be};function Z6(e){if(e.status>=200&&e.status<300)return e.json();if(e)return e.json().then(t=>{let n;return n=t.error?Error(t.error):Error(`Unknown API error signature`),n.response=e,Promise.reject(n)})}function Q6(e,t){return fetch(e,t).then(Z6)}X6.call=(e,t,n={},r=`post`)=>{if(!X6.enabled)return Promise.reject(Error(D(`Odysee internal API is disabled`)));if(!(r===`get`||r===`post`))return Promise.reject(Error(D(`Invalid method`)));Object.keys(n).forEach(e=>{let t=n[e];typeof t==`object`&&(n[e]=JSON.stringify(t))});let i=new URLSearchParams(n).toString(),a=`${X6.url}/${e}/${t}?${i}`,o={method:`GET`};return r===`post`&&(o={method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:i},a=`${X6.url}/${e}/${t}`),Q6(a,o).then(e=>e.data).catch(e=>{throw e})};function $6(e){let t=[],n=0,r=0;return e&&e.forEach(e=>{let{is_fiat:i,support_amount:a,channel_url:o}=e;i?n+=a:r+=a,t.push(o||`0`)}),{superChatsChannelUrls:t,superChatsFiatAmount:n,superChatsLBCAmount:r}}var e8=e=>
62({uri:e?.CanonicalURL||e?.uri||``,claimUri:e?.CanonicalURL||e?.uri||``,claimId:e?.ClaimID||e?.claimId||``,releaseTime:e?.ReleaseTime||e?.releaseTime}),t8=e=>e.VideoURL||e.VideoURLLLHLS;function n8(e){let t=e?.data&&!e?.ChannelClaimID?e.data:e;if(!t)return t;let n=t.ChannelClaimID||t.channel_claim_id||t.ChannelClaimId,r=t.ActiveClaim||t.activeClaim||null;return{...t,ChannelClaimID:n,Live:t.Live??t.live??!1,ViewerCount:t.ViewerCount??t.viewCount??0,ThumbnailURL:t.ThumbnailURL??t.thumbnailUrl??null,Start:t.Start??t.start??null,VideoURL:t.VideoURL??t.videoUrl??null,VideoURLLLHLS:t.VideoURLLLHLS??t.videoUrlLLHLS??null,VideoURLWebRTC:t.VideoURLWebRTC??t.videoUrlWebRTC??null,P2PTrackerURL:t.P2PTrackerURL??t.p2pTrackerUrl??null,P2PSwarmID:t.P2PSwarmID??t.p2pSwarmId??null,ActiveClaim:r}}var r8=e=>e.reduce((e,t)=>{let n=n8(t);if(!n?.ChannelClaimID)return e;let r=n.ActiveClaim?{...e8(n.ActiveClaim),videoUrl:t8(n),videoUrlPublic:n.VideoURL||null,p2pTrackerUrl:n.P2PTrackerURL||null,p2pSwarmId:n.P2PSwarmID||null,startedStreaming:kn(n.Start)}:{uri:``,claimUri:``,claimId:``,videoUrl:t8(n),videoUrlPublic:n.VideoURL||null,p2pTrackerUrl:n.P2PTrackerURL||null,p2pSwarmId:n.P2PSwarmID||null,startedStreaming:kn(n.Start)};return e[n.ChannelClaimID]={type:`application/x-mpegurl`,isLive:n.Live,viewCount:n.ViewerCount,creatorId:n.ChannelClaimID,thumbnailUrl:n.ThumbnailURL||null,activeClaim:r,...n.PastClaims?{pastClaims:n.PastClaims.map(e8)}:{},...n.FutureClaims?{futureClaims:n.FutureClaims.map(e8)}:{}},e},{}),i8=async(e,t)=>{if(!e||!t)throw Error(`Invalid channel data provided.`);let n=WQ(t),r;if(r=await j.channel_sign({channel_id:e,hexdata:n}),!r||!r.signature||!r.signing_ts)throw Error(`Error getting channel signature.`);return{d:n,s:r.signature,t:r.signing_ts}},a8=async(e,t)=>{let n=await i8(e,t),r=encodeURIComponent(t);if(!(await(await fetch(`${vK}channel_claim_id=${e}&channel_name=${r}&signature_ts=${n.t}&signature=${n.s}`)).json()).data)throw Error(`Kill stream API failed.`)};function o8(e,t,n,r){if(!n)return;let i=[];for(let r in n){let a=n[r];a&&(!e||e.includes(r))&&(!t||!t.includes(r))&&i.push(a)}return[...i].sort((e,t)=>{let[n,i]=[r[e.claimId],r[t.claimId]];return n<i?1:n>i?-1:0}).map(e=>e.uri)}var s8=X6,c8=(e,t={any_languages:null})=>async n=>{let{any_languages:r}=t,i=[];for(let t in e){let n=e[t];if(n){let{activeClaim:{claimId:e}}=n;e&&i.push(e)}}let a=await n(lK({page:1,page_size:50,has_no_source:!0,claim_ids:i,claim_type:[`stream`],no_totals:!0,...r?{any_languages:r}:{}},{useAutoPagination:!0})),o={};for(let t in a){let n=a[t].stream,r=dr(n);r&&(o[r]=e[r])}return o},l8=e=>async(t,n)=>{if(!JK(n(),e))return t({type:zo,data:e}),s8.call(`livestream`,`is_live`,{channel_claim_id:e}).then(async n=>t({type:si,data:r8([n?.data?{...n.data,ChannelClaimID:e}:n])})).catch(()=>t({type:si,data:{[e]:null}}))},u8=(e={any_languages:null})=>async(t,n)=>{let r=n(),i=JSON.stringify(e);if(tq(r,i))return;let a=Date.now(),o=QK(r,i),s=Number.isInteger(o)&&a-o;if(Number.isInteger(s)&&s<3e5){let e=$K(r,i);if(e===0||e>=3)return}let c={query:i,date:a};return t({type:Ql,data:i}),s8.call(`livestream`,`all`).then(async n=>{let r=await t(c8(r8(n),e));t({type:Bs,data:{...c,livestreamInfoByCreatorId:r}})}).catch(()=>t({type:xl,data:c}))},d8=(e,t)=>n=>n({type:gi,data:{channelId:e,isPolling:t}}),f8=`${He}/internal?id=`,p8=`${He}/commentron?id=`,m8={COMMENTER:`commenter`,VIEWER:`viewer`},h8={},g8={},_8=0,v8=(e,t)=>`${p8}${e}&category=${t}&sub_category=viewer`,y8=(e,t)=>`${p8}${e}&category=${t}&sub_category=commenter`,b8=(e,t,n)=>{function r(){let i=h8[e];if(i&&(i.readyState===WebSocket.OPEN||i.readyState===WebSocket.CONNECTING))return;i&&(i.close(),h8[e]=null);let a=_8**2*1e3;setTimeout(()=>{h8[e]=new WebSocket(e),h8[e].addEventListener(`open`,e=>{_8=0,console.log(`Connected to ${n} WS`)}),h8[e].addEventListener(`message`,e=>{t(JSON.parse(e.data))}),h8[e].addEventListener(`error`,e=>{console.log(`${n} websocket onerror`,e)}),h8[e].addEventListener(`close`,()=>{console.log(`Disconnected from ${n} WS`),g8[e]?g8[e]=null:(_8+=1,r())})},a)}r()},x8=e=>t=>{h8[e]!==void 0&&h8[e]!==null&&(g8[e]=!0,h8[e].close(),h8[e]=null,t({type:Di}
62))},S8=e=>t=>{let n=_R();if(!n){console.error(`Unable to connect to web socket because auth token is missing`);return}b8(`${f8}${n}`,n=>{switch(n.type){case`pending_notification`:e&&t(QS());break;case`swap-status`:t({type:gu,data:n.data});break}},`notification`)},C8=(e,t,n,r,i)=>(i,a)=>{let o=a(),s=$t(o,e),c=!UK(o,s),l=$n(o,n),u=!!(l&&zn(o,l.permanent_url)),d=n.split(``).reverse().join(``),f=u?d:n;b8(r===m8.COMMENTER?y8(f,t):v8(f,t),t=>{if(t.type===`delta`){let r=t.data.comment;i({type:Bu,data:{comment:r,claimId:n,uri:e}})}if(t.type===`viewers`){let e=t.data.connected;i({type:As,data:{connected:e,claimId:n}})}if(t.type===`pinned`){let e=t.data.comment;i({type:uc,data:{pinnedComment:e,claimId:n,unpin:!e.is_pinned}})}if(t.type===`removed`){let{comment_id:e}=t.data.comment;i({type:ts,data:{comment_id:e}})}if(t.type===`setting`){let n=$t(a(),e);i({type:ko,data:{responseData:t.data,creatorId:n}})}t.type===`livestream`&&i(l8(s))},`${r||m8.VIEWER} comment`),c&&i(l8(s)),i(D8(!0,n,r||m8.VIEWER))},w8=(e,t,n)=>(r,i)=>{let a=i(),o=$n(a,e),s=!!(o&&zn(a,o.permanent_url)),c=e.split(``).reverse().join(``),l=s?c:e;r(x8(n===m8.COMMENTER?y8(l,t):v8(l,t))),r(D8(!1,e,n))},T8=(e,t,n,r)=>i=>i(C8(e,t,n,m8.COMMENTER,r)),E8=(e,t)=>n=>n(w8(e,t,m8.COMMENTER)),D8=(e,t,n)=>r=>r({type:fl,data:{connected:e,sub_category:n,id:t}}),O8=Y6,k8=`0.0.0`;function A8(e,t={}){return{type:ec,data:{id:e,modalProps:t}}}function j8(){return{type:Aa}}function M8(){return{type:ou}}function N8(){return(e,t)=>{let n=xC(t());n&&window.open(n,`_blank`,`noopener,noreferrer`)}}function P8(){return(e,t)=>{let n=xC(t());n&&window.open(n,`_blank`,`noopener,noreferrer`),e({type:us}),e(j8()),e(A8(vd))}}function F8(){return(e,t)=>{let n=t();OC(n)&&(clearInterval(OC(n)),e({type:Hs}))}}function I8(){return e=>{e(F8()),e({type:_i})}}function L8(){return(e,t)=>{let n=TC(t());if(n)try{n.cancel()}catch(e){console.error(e)}e({type:sa})}}function R8(){return e=>{fetch(`${Pe}/$/minVersion/v1/get`).then(e=>e.json()).then(e=>e?.status===`success`&&e?.data?Number(e.data):void 0).then(t=>{t>ge&&e({type:ed,data:{reason:`newVersionFound`,extra:t}})}).catch(e=>Ve(!1,`minVersion failed`,e))}}function z8(){return e=>{Ee!==`true`&&(e(R8()),setInterval(()=>e(R8()),3600*1e3))}}function B8(){return(e,t)=>{e(N({message:cn(t())?D(`Please wait a bit, we are still getting your account ready.`):D(`Sign in or create an account to change this setting.`),isError:!1}))}}function V8(){return(e,t)=>{t(),e(nG(k8,!0,e=>{let t=e&&e.wallet&&e.wallet.connected_features&&e.wallet.connected_features.trending_algorithm;t&&Qx.event.trendingAlgorithm(t)},void 0)),e({type:Na})}}function H8(){return async e=>{window.persistor.pause(),await window.persistor.flush(),await window.persistor.purge(),window.sessionStorage.clear(),e(zL()),e(u1()),window.location.reload()}}function U8(){return()=>{window.close()}}function W8(e){return t=>{t({type:Tl,data:{volume:e}})}}function G8(e){return t=>{t({type:ru,data:{muted:e}})}}function K8(){return{type:ki}}function q8(e,t){return(n,r)=>{let i=r(),a=Lt(i,e),{txid:o,nout:s,claim_id:c}=a,l=Yt(i,e),u=Ar(a)===`scheduled`||zr(a)||Nr(a),d=!!Vt(i)?.global_mod,f=`${o}:${s}`;if(l||d&&u)return Promise.resolve();let p=uJ(i,e);return Qx.apiLog.view(e,f,c,p,void 0,t)}}function J8(e,t){return(n,r)=>{let i=t.isLivestream,a=r(),o=Lt(a,e),s=Vt(a),{value:{video:c,audio:l,source:u}}=o,d=i?0:parseInt(String(t.currentTime*1e3)),f=parseInt(String(t.secondsToLoad*1e3)),p=i?0:c&&c.duration||l&&l.duration,m=i?0:u.size,h=i?0:m*8,g=i?t.bitrateAsBitsPerSecond:parseInt(String(h/p)),_=s&&s.id.toString();_&&Qx.video.videoBufferEvent(o,{isLivestream:i,timeAtBuffer:d,bufferDuration:f,bitRate:g,userId:_,duration:p,playerPoweredBy:t.playerPoweredBy,readyState:t.readyState})}}function Y8(e){return t=>{let n=e.purchase_receipt&&e.purchase_receipt.amount;if(n){let e=Number(Number(n).toFixed(0));Qx.event.purchase(e)}}}function X8(){return(e,t)=>{let n=Vt(t());O8.ready&&O8.ready.then(()=>{O8.supported&&n&&(O8.reconnect(n.id),O8.validate(n.id))}).catch(()=>{}),e(S8(!0)),e(QS(null,!1)),e(mK(()=>{})),e(EL()),e(sK()),e(_X()).then(()=>e(xX())),e(jG()),e(gH()),e(_Q()),e(w$())}}function Z8(){Object.values(window.beforeUnloadMap||{}
62).forEach(e=>{window.removeEventListener(`beforeunload`,e.cb)})}function Q8(){return async(e,t)=>{let n=Vt(t());try{O8.ready&&(await O8.ready,O8.supported&&n&&await O8.disconnect(n.id))}finally{nd.setItem(`AR_ADDRESS_IN_USE`,`false`),M.call(`user`,`signout`).then(bR).then(async()=>{let e=t().app?.volume,n=t().app?.muted,i=t().settings?.clientSettings?.homepage;window.persistor.pause(),await window.persistor.flush(),await window.persistor.purge();try{let t=(await qe(async()=>{let{default:e}=await import(`./localforage-BpmEEj9j.js`).then(e=>r(e.default));return{default:e}},__vite__mapDeps([20,1,21,7]))).default,a={volume:e,muted:n,homepage:i};await t.setItem(`preservedAcrossLogout`,a)}catch{}}).catch(e=>{Qx.error(`\`doSignOut\`: ${e.message||e}`)}).finally(()=>location.reload())}}}function $8(){return async(e,t)=>{let n=Object.values(window.beforeUnloadMap||{});n.length>0?e(A8(Ud,{pendingActions:n.map(e=>e.msg),onConfirm:()=>{Z8(),e(Q8())}})):e(Q8())}}function e5(){return{type:Vu,data:!0}}function t5(e,t){return(n,r)=>{let i=MC(r()),a=e??i;if(Qx.toggleThirdParty(a),!t)return n({type:tu,data:a})}}function n5(e){let{SDK_SYNC_KEYS:t}=hf;return(t,n)=>{let r=n();iu(r,me),cn(r);function i(r){return zl(n()),r===null?t(GR()):IR(n,e)||t(JR(r)),!0}function a(e){return t(N({isError:!0,message:D(`Unable to load your saved preferences.`)})),t({type:gc,error:e}),!1}return t($R(`shared`,i,a))}}function r5(e,t,n){return(r,i)=>{if(e)console.error(`Error in doHandleSyncComplete`,e);else if(t){if(IR(i,n))return;r(n5(n))}}}function i5(){return{type:Vc}}function a5(e,t){return(n,r)=>{if(e||t)return n({type:Os,data:{claimId:e}})}}function o5(e){return{type:vo,data:{enabled:e}}}function s5(e){return(t,n)=>{let r=zC(n());t(r&&r===e?{type:su}:{type:pl,data:e})}}var c5=e=>t=>t({type:Oo,data:e}),l5=e=>t=>t({type:da,data:e}),u5={no:`nn`,"zh-Hans":`zh-cn`,"zh-Hant":`zh-tw`};function d5(e){return(t,n)=>{let r=u5[e]||e;r===`en`||r&&r.startsWith(`en-`)?kn.locale(`en`):qe(()=>import(`dayjs/locale/${r}.js`).then(()=>kn.locale(r)),[]).catch(e=>{Ve(!1,`Failed to load locale:`,e),kn.locale(`en`)})}}function f5(e){return t=>{t({type:Ws,data:e})}}export{c1 as $,yq as $a,gH as $c,NC as $d,jf as $f,DY as $i,$V as $l,qX as $n,ZW as $o,Gd as $p,eX as $r,VU as $s,T$ as $t,vR as $u,s5 as A,Lq as Aa,pW as Ac,VL as Ad,KS as Af,AY as Ai,YV as Al,rQ as An,XG as Ao,Dd as Ap,WX as Ar,IW as As,N$ as At,tz as Au,o8 as B,mq as Ba,HH as Bc,LC as Bd,CS as Bf,_Y as Bi,rV as Bl,UX as Bn,NG as Bo,pd as Bp,PX as Br,tW as Bs,j$ as Bt,TR as Bu,c5 as C,Uq as Ca,uW as Cc,ML as Cd,HS as Cf,WY as Ci,bV as Cl,uQ as Cn,hK as Co,yd as Cp,nZ as Cr,FW as Cs,U$ as Ct,hz as Cu,M8 as D,Dq as Da,YU as Dc,UL as Dd,BS as Df,aY as Di,aV as Dl,aQ as Dn,QG as Do,tf as Dp,HX as Dr,zW as Ds,L$ as Dt,cz as Du,$8 as E,Nq as Ea,bU as Ec,jL as Ed,US as Ef,XJ as Ei,eV as El,XZ as En,uK as Eo,ef as Ep,uZ as Er,kW as Es,R$ as Et,pz as Eu,w8 as F,sq as Fa,WH as Fc,yL as Fd,IS as Ff,$J as Fi,SV as Fl,IZ as Fn,zG as Fo,Fd as Fp,MX as Fr,xW as Fs,a$ as Ft,LR as Fu,A1 as G,iq as Ga,xH as Gc,HC as Gd,rS as Gf,kJ as Gi,pV as Gl,xZ as Gn,AG as Go,_d as Gp,dX as Gr,DU as Gs,o$ as Gt,jR as Gu,a8 as H,lq as Ha,RH as Hc,UC as Hd,mS as Hf,IJ as Hi,sV as Hl,TZ as Hn,UG as Ho,bd as Hp,SX as Hr,XU as Hs,p$ as Ht,CR as Hu,E8 as I,NK as Ia,KH as Ic,mL as Id,PS as If,jY as Ii,fV as Il,BZ as In,GG as Io,Id as Ip,vX as Ir,JU as Is,i$ as It,WR as Iu,E1 as J,_q as Ja,SH as Jc,PC as Jd,mx as Jf,JY as Ji,UV as Jl,dZ as Jn,BG as Jo,rf as Jp,uX as Jr,oU as Js,O$ as Jt,gR as Ju,u1 as K,gq as Ka,wH as Kc,jC as Kd,$x as Kf,MJ as Ki,lV as Kl,VX as Kn,jG as Ko,gd as Kp,lX as Kr,jU as Ks,k$ as Kt,lR as Ku,u8 as L,dq as La,VH as Lc,dL as Ld,NS as Lf,FY as Li,gV as Ll,VZ as Ln,KG as Lo,Pd as Lp,_X as Lr,hW as Ls,r$ as Lt,BR as Lu,K8 as M,Eq as Ma,LU as Mc,fL as Md,WS as Mf,kY as Mi,HV as Ml,nQ as Mn,VG as Mo,ud as Mp,NX as Mr,OW as Ms,_$ as Mt,HR as Mu,C8 as N,wq as Na,$U as Nc,lL as Nd,GS as Nf,CY as Ni,uV as Nl,GZ as Nn,OG as No,df as Np,FX as Nr,CW as Ns,b$ as Nt,zR as Nu,N8 as O,Pq as Oa,MU as Oc,BL as Od,RS as Of,HY as Oi,nV as Ol,oQ as On,ZG as Oo,ld as Op,pZ as Or,LW as Os,P$ as Ot,oz as Ou,T8 as P,Rq as Pa,WU as Pc,xL as Pd,FS as Pf,RY as Pi,xV as Pl,FZ as Pn,kG as Po,nf as Pp,TX as Pr,bW as Ps,y$ as Pt,QR as Pu,k1 as Q,oq as Qa,_H as Qc,DC as Qd,Af as Qf,UY as Qi,JV as Ql,JX as Qn,_G as Qo,mf as Qp,aX as Qr,zU as Qs,f$ as Qt,mR as Qu,l8 as R,fq as Ra,BH as Rc,hL as Rd,kS as Rf,KY as Ri,hV as Rl,MZ as Rn,LG as Ro,pf as Rp,kX as Rr,cW as Rs,d$ as Rt,VR as Ru,o5 as S,Kq as S
62a,vU as Sc,HL as Sd,oC as Sf,GJ as Si,LV as Sl,cQ as Sn,tK as So,cf as Sp,rZ as Sr,MW as Ss,V$ as St,bz as Su,X8 as T,hJ as Ta,iU as Tc,kL as Td,JS as Tf,KJ as Ti,sH as Tl,ZZ as Tn,pK as To,$d as Tp,tZ as Tr,DW as Ts,I$ as Tt,fz as Tu,Y6 as U,cq as Ua,yH as Uc,CC as Ud,j as Uf,AJ as Ui,cV as Ul,wZ as Un,FG as Uo,md as Up,jX as Ur,EU as Us,h$ as Ut,AR as Uu,$6 as V,qK as Va,zH as Vc,FC as Vd,M as Vf,MY as Vi,iV as Vl,SZ as Vn,PG as Vo,vd as Vp,CX as Vr,ZU as Vs,w$ as Vt,SR as Vu,l1 as W,eq as Wa,vH as Wc,SC as Wd,iS as Wf,uY as Wi,FV as Wl,CZ as Wn,IG as Wo,hd as Wp,EX as Wr,CU as Ws,m$ as Wt,kR as Wu,o1 as X,UK as Xa,kH as Xc,BC as Xd,Rf as Xf,DJ as Xi,RV as Xl,fZ as Xn,xG as Xo,uf as Xp,cX as Xr,dW as Xs,n$ as Xt,_R as Xu,_1 as Y,uq as Ya,OH as Yc,WC as Yd,zf as Yf,pY as Yi,IV as Yl,zX as Yn,SG as Yo,Jd as Yp,nX as Yr,aW as Ys,c$ as Yt,xR as Yu,s1 as Z,aq as Za,hH as Zc,kC as Zd,Pf as Zf,ZJ as Zi,qV as Zl,KX as Zn,gG as Zo,Wd as Zp,ZY as Zr,ZH as Zs,A$ as Zt,hR as Zu,U8 as _,lJ as _a,_U as _c,KL as _d,QS as _f,tY as _i,zV as _l,Rd as _m,vQ as _n,iK as _o,sf as _p,lZ as _r,GW as _s,K$ as _t,kz as _u,I8 as a,Qq as aa,gU as ac,eR as ad,gC as af,iX as ai,rH as al,Md as am,YQ as an,CK as ao,Tf as ap,bZ as ar,vG as as,j1 as at,UB as au,d5 as b,sJ as ba,iW as bc,RL as bd,rC as bf,TY as bi,GV as bl,zd as bm,pQ as bn,aK as bo,Ed as bp,iZ as br,UW as bs,W$ as bt,xz as bu,W8 as c,$q as ca,_W as cc,YL as cd,fC as cf,mY as ci,aH as cl,Td as cm,LQ as cn,bK as co,wf as cp,IX as cr,oG as cs,g1 as ct,LB as cu,P8 as d,fJ as da,SU as dc,TL as dd,uC as df,vY as di,cH as dl,Ud as dm,FQ as dn,AK as do,Ef as dp,YX as dr,hG as ds,J$ as dt,Iz as du,OY as ea,JH as ec,pR as ed,AC as ef,tX as ei,jH as el,lf as em,D$ as en,bq as eo,Lf as ep,hZ as er,CG as es,T1 as et,WV as eu,n5 as f,_J as fa,nW as fc,DL as fd,sC as ff,HJ as fi,kV as fl,jd as fm,MQ as fn,rK as fo,Of as fp,ZX as fr,bG as fs,Z$ as ft,Fz as fu,A8 as g,yJ as ga,fU as gc,qL as gd,$S as gf,bY as gi,BV as gl,Xd as gm,hQ as gn,lK as go,hf as gp,cZ as gr,KW as gs,G$ as gt,Az as gu,z8 as h,eJ as ha,kU as hc,FL as hd,YS as hf,gY as hi,jV as hl,xd as hm,gQ as hn,dK as ho,bf as hp,LX as hr,dG as hs,Y$ as ht,Mz as hu,q8 as i,mJ as ia,hU as ic,nR as id,vC as if,sX as ii,tH as il,kd as im,JQ as in,WK as io,If as ip,yZ as ir,rG as is,p1 as it,WB as iu,i5 as j,Fq as ja,rW as jc,uL as jd,qS as jf,BY as ji,VV as jl,YZ as jn,oK as jo,dd as jp,GX as jr,AW as js,F$ as jt,UR as ju,t5 as k,Mq as ka,NU as kc,WL as kd,zS as kf,hY as ki,oV as kl,KZ as kn,$G as ko,Kd as kp,RX as kr,RW as ks,M$ as kt,iz as ku,H8 as l,uJ as la,vW as lc,tR as ld,pC as lf,SY as li,dV as ll,Od as lm,UQ as ln,OK as lo,Cf as lp,XX as lr,aG as ls,e1 as lt,FB as lu,j8 as m,bJ as ma,FU as mc,AL as md,ZS as mf,oY as mi,AV as ml,wd as mm,_Q as mn,mK as mo,vf as mp,BX as mr,uG as ms,Q$ as mt,Pz as mu,Y8 as n,zY as na,YH as nc,QL as nd,GC as nf,QY as ni,dH as nl,Yd as nm,t$ as nn,nq as no,Nf as np,gZ as nr,lG as ns,h1 as nt,HB as nu,L8 as o,SJ as oa,cU as oc,iR as od,_C as of,yY as oi,iH as ol,Nd as om,WQ as on,xK as oo,Sf as op,mZ as or,fG as os,M1 as ot,zB as ou,r5 as p,Wq as pa,QU as pc,OL as pd,aC as pf,WJ as pi,DV as pl,qd as pm,BQ as pn,nK as po,yf as pp,DZ as pr,yG as ps,X$ as pt,Lz as pu,O1 as q,hq as qa,CH as qc,RC as qd,Qx as qf,YY as qi,XV as ql,EZ as qn,RG as qo,Cd as qp,oX as qr,UU as qs,v$ as qt,yR as qu,J8 as r,gJ as ra,TU as rc,XL as rd,EC as rf,rX as ri,nH as rl,Sd as rm,ZQ as rn,IK as ro,Ff as rp,vZ as rr,mG as rs,f1 as rt,GB as ru,G8 as s,xJ as sa,gW as sc,rR as sd,mC as sf,EY as si,QV as sl,Ad as sm,IQ as sn,SK as so,kf as sp,QX as sr,pG as ss,N1 as st,RB as su,B8 as t,LY as ta,XH as tc,ZL as td,wC as tf,$Y as ti,AH as tl,Qd as tm,g$ as tn,rq as to,Mf as tp,_Z as tr,iG as ts,d1 as tt,JB as tu,V8 as u,Hq as ua,xU as uc,IL as ud,hC as uf,PY as ui,mV as ul,Hd as um,HQ as un,DK as uo,Df as up,$X as ur,cG as us,t1 as ut,IB as uu,a5 as v,cJ as va,pU as vc,PL as vd,nC as vf,YJ as vi,KV as vl,Ld as vm,fQ as vn,cK as vo,ff as vp,oZ as vr,qW as vs,q$ as vt,Oz as vu,l5 as w,Yq as wa,eW as wc,wL as wd,VS as wf,wY as wi,CV as wl,QZ as wn,gK as wo,Zd as wp,eZ as wr,EW as ws,H$ as wt,gz as wu,e5 as x,oJ as xa,oW as xc,NL as xd,N as xf,lY as xi,OV as xl,Vd as xm,lQ as xn,sK as xo,af as xp,aZ as xr,PW as xs,B$ as xt,vz as xu,f5 as y,Xq as ya,mW as yc,LL as yd,iC as yf,rY as yi,eH as yl,Bd as ym,mQ as yn,fK as yo,of as yp,sZ as yr,WW as ys,z$ as yt,Dz as yu,d8 as z,xq as za,GH as zc,IC as zd,ES as zf,GY as zi,lH as zl,Q as zn,MG as zo,fd as zp,AX as zr,lW as zs,E$ as zt,RR as zu}; 63//# sourceMappingURL=app-5r5pIz90.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.